From 284b0919d638c74a2f7a5ca8f1c48bf2c57b57d0 Mon Sep 17 00:00:00 2001 From: Kyle Geib Date: Mon, 14 Feb 2022 13:59:34 -0500 Subject: [PATCH] ISSUE-045 - Chyron Body - Done! There ain't no way in hell I'm going to be able to convincingly animate the AngledFlag without spending maybe an entire week on it. I would honestly want to re-do the entire AngledFlag component from scratch before trying to animate it. The combination of rules and styles and all that is just too confusing to attempt right now. So, a basic slide- and fade-in I think is decent enough work. --- .../BroadcastGraphics/Chyrons/Driver/ChyronDriver.tsx | 10 ++++++++-- .../BroadcastGraphics/Chyrons/Driver/styles.ts | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/components/BroadcastGraphics/Chyrons/Driver/ChyronDriver.tsx b/src/components/BroadcastGraphics/Chyrons/Driver/ChyronDriver.tsx index 0526663..e151d84 100644 --- a/src/components/BroadcastGraphics/Chyrons/Driver/ChyronDriver.tsx +++ b/src/components/BroadcastGraphics/Chyrons/Driver/ChyronDriver.tsx @@ -50,7 +50,9 @@ export function ChyronDriver({ const flagProps = flagMode === "country" ? { flagMode, flag: car.driver.nationality } - : flagMode === "team" ? { flagMode, flag: car.driver.team.id } : undefined; + : flagMode === "team" + ? { flagMode, flag: car.driver.team.id } + : undefined; const dispatch = useDispatch(); @@ -192,7 +194,11 @@ export function ChyronDriver({ open={openState !== 0} transitionProps={[{ property: "opacity", - duration: 500 * DDM, + duration: 1200 * DDM, + delay: 1000 * DDM, + }, { + property: "right", + duration: 2000 * DDM, delay: 1000 * DDM, }]} height={baseHeight * 0.9} diff --git a/src/components/BroadcastGraphics/Chyrons/Driver/styles.ts b/src/components/BroadcastGraphics/Chyrons/Driver/styles.ts index 2856606..eca70e3 100644 --- a/src/components/BroadcastGraphics/Chyrons/Driver/styles.ts +++ b/src/components/BroadcastGraphics/Chyrons/Driver/styles.ts @@ -188,7 +188,8 @@ type FlagContainerProps = { }; export const FlagContainer = styled.div` position: absolute; - right: ${({ right }) => `${right}px`}; + right: ${({ right, open }) => open ? right : right * -3}px; + z-index: -1; display: flex; align-items: center;