ISSUE-045 - Chyron Body - Added Team Name flicker.
Added DarkBG option to Workspace PreviewWindow. Fixed issue with blindsColorFadeDelay not being correct. Calibrating the timing of animations and transitions better. Added the subtle TeamColorBar squeeze look with outline and a wide clip-path adjustment.
This commit is contained in:
1 parent
b545750f70
commit
9ff77cc88a
11 files changed
+68
-42
No files matched your search
@@ -38,29 +38,17 @@ export function ChyronsDirectorControls() {
|
||||
const { chyrons } = useSelector(broadcastGraphicsSelector);
|
||||
const { selectedCars } = useSelector(broadcastDirectorSelector);
|
||||
|
||||
|
||||
|
||||
// Handle changes to the chyron mode so submodes can be changed accordingly.
|
||||
useEffect(() => {
|
||||
setChyronSubModes(getChyronSubModesList(chyronMode));
|
||||
}, [chyronMode]);
|
||||
|
||||
// Handle changes to selected cars
|
||||
// useEffect(() => {
|
||||
// console.log(selectedCars, chyrons);
|
||||
// // Do not change chyrons while in a non-closed state.
|
||||
// if (chyrons != null && chyrons.openState !== 0) {
|
||||
// return;
|
||||
// }
|
||||
// if (chyronMode === "driver") {
|
||||
// buildDriver();
|
||||
// }
|
||||
// }, [selectedCars]);
|
||||
|
||||
|
||||
const onOpen = () => {
|
||||
// dispatch(setChyronsOpenState(1));
|
||||
buildDriver();
|
||||
setTimeout(() => {
|
||||
// Delay a short time and increment the open state so the animation can happen.
|
||||
dispatch(incrementChyronsOpenState());
|
||||
}, 50);
|
||||
};
|
||||
|
||||
const onNext = () => {
|
||||
|
||||
@@ -68,7 +68,7 @@ export function ChyronDriver({ chyronData, subMode, openState }: ChyronDriverPro
|
||||
open={openState !== 0}
|
||||
transitionProps={[{
|
||||
property: "outline",
|
||||
duration: 1000,
|
||||
duration: 1167,
|
||||
}]}
|
||||
/>
|
||||
<BaseBlack
|
||||
@@ -79,25 +79,26 @@ export function ChyronDriver({ chyronData, subMode, openState }: ChyronDriverPro
|
||||
timing: "ease-in",
|
||||
}, {
|
||||
property: "width",
|
||||
duration: 400,
|
||||
duration: 667,
|
||||
timing: "ease-out",
|
||||
delay: 100,
|
||||
delay: 0,
|
||||
}]}
|
||||
/>
|
||||
<BaseLayout
|
||||
open={openState !== 0}
|
||||
transitionProps={[{
|
||||
property: "clip-path",
|
||||
duration: 800,
|
||||
duration: 400,
|
||||
timing: "ease-in",
|
||||
delay: 333,
|
||||
}]}
|
||||
>
|
||||
<BaseBackgroundColor
|
||||
open={openState !== 0}
|
||||
transitionProps={[{
|
||||
property: "opacity",
|
||||
duration: 600,
|
||||
delay: 900,
|
||||
duration: 566,
|
||||
delay: 600,
|
||||
}]}
|
||||
teamColor={teamColor}
|
||||
/>
|
||||
@@ -129,9 +130,9 @@ export function ChyronDriver({ chyronData, subMode, openState }: ChyronDriverPro
|
||||
open={openState !== 0}
|
||||
transitionProps={[{
|
||||
property: "clip-path",
|
||||
duration: 750,
|
||||
duration: 667,
|
||||
timing: "ease-in-out",
|
||||
delay: 750,
|
||||
delay: 733,
|
||||
}]}
|
||||
color={teamColor}
|
||||
/>
|
||||
@@ -150,7 +151,9 @@ export function ChyronDriver({ chyronData, subMode, openState }: ChyronDriverPro
|
||||
</NumberContainer>
|
||||
)}
|
||||
</NameContainer>
|
||||
<TeamName>{car.driver.team.shortName}</TeamName>
|
||||
<TeamName open={openState !== 0}>
|
||||
{car.driver.team.shortName}
|
||||
</TeamName>
|
||||
</TextContainer>
|
||||
<FlagContainer
|
||||
open={openState !== 0}
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
import { animated } from "@react-spring/web";
|
||||
import styled from "styled-components";
|
||||
import styled, { css, keyframes } from "styled-components";
|
||||
|
||||
import { Placement, Px, TransitionArgs } from "../../../../types/style";
|
||||
import { commonTransition, placementStyleRules } from "../../../../utils/styling";
|
||||
|
||||
type TransitionProps = {
|
||||
type OpenProps = {
|
||||
open: boolean,
|
||||
};
|
||||
type TransitionProps = OpenProps & {
|
||||
transitionProps: TransitionArgs[],
|
||||
};
|
||||
|
||||
@@ -91,7 +93,9 @@ export const TeamColorBar = styled.div<TeamColorBarProps & TransitionProps>`
|
||||
|
||||
clip-path: ${({ open }) => open
|
||||
? "polygon(0 0, 100% 0, 100% 100%, 0 100%)"
|
||||
: "polygon(0 0, 100% 0, 100% 0, 0 0)"};
|
||||
: "polygon(-100% 0, 200% 0, 200% 0, -100% 0)"};
|
||||
|
||||
outline: ${({ color }) => color} solid 1px;
|
||||
|
||||
${({ transitionProps }) => commonTransition(transitionProps)};
|
||||
`;
|
||||
@@ -137,11 +141,23 @@ export const NumberContainer = styled.div`
|
||||
`;
|
||||
NumberContainer.displayName = "NumberContainer";
|
||||
|
||||
export const TeamName = styled.div`
|
||||
const blinkingAnimation = keyframes`
|
||||
0% { opacity: 0.4 }
|
||||
14% { opacity: 0 }
|
||||
42% { opacity: 0.4 }
|
||||
56% { opacity: 0 }
|
||||
86% { opacity: 1 }
|
||||
`;
|
||||
|
||||
export const TeamName = styled.div<OpenProps>`
|
||||
position: relative;
|
||||
font-family: ${p => p.theme.fonts.f1Regular};
|
||||
color: #d1d1d1;
|
||||
font-size: 20px;
|
||||
|
||||
${({ open }) => open && css`
|
||||
animation: ${blinkingAnimation} 233ms step-end 500ms;
|
||||
`}
|
||||
`;
|
||||
TeamName.displayName = "TeamName";
|
||||
|
||||
|
||||
+2
-2
@@ -92,7 +92,7 @@ export const VenetianBlindsTransition = (
|
||||
opaqueWidth={blindsSize.opaque}
|
||||
blindsColor={blindsColor}
|
||||
blindsColorFadeDuration={blindsColorFadeDuration}
|
||||
blindsColorFadeDelay={blindsColorFadeDelay}
|
||||
blindsColorFadeDelay={blindsColorFadeDelay + delay}
|
||||
blindsClosing={visible}
|
||||
spanBlinkDuration={spanBlinkDuration}
|
||||
spanBlinkDelay={delay}
|
||||
@@ -106,7 +106,7 @@ export const VenetianBlindsTransition = (
|
||||
opaqueWidth={blindsSize.opaque}
|
||||
blindsColor={blindsColor}
|
||||
blindsColorFadeDuration={blindsColorFadeDuration}
|
||||
blindsColorFadeDelay={blindsColorFadeDelay}
|
||||
blindsColorFadeDelay={blindsColorFadeDelay + delay}
|
||||
blindsClosing={visible}
|
||||
spanBlinkDuration={spanBlinkDuration}
|
||||
spanBlinkDelay={delay}
|
||||
|
||||
@@ -26,7 +26,7 @@ export const Workspace = ({
|
||||
prototypeControls,
|
||||
}: WorkspaceProps) => {
|
||||
const dispatch = useDispatch();
|
||||
const { animatedBG, workspaceProperties } = useSelector(workspaceSelector);
|
||||
const { animatedBG, darkBG, workspaceProperties } = useSelector(workspaceSelector);
|
||||
const { currentWorkspaceId: overlayWorkspaceId } = useSelector(overlayToolSelector);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -56,6 +56,7 @@ export const Workspace = ({
|
||||
<PreviewWindow
|
||||
dimensions={workspaceProperties.previewWindowDimensions}
|
||||
animatedBG={animatedBG}
|
||||
darkBG={darkBG}
|
||||
>
|
||||
{previewContent}
|
||||
<OverlayDisplay
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import styled, { css, keyframes } from "styled-components";
|
||||
import { PadBox } from "@bedrock-layout/padbox";
|
||||
|
||||
import bg from "../../../public/images/misc/checker-40x40.png";
|
||||
import { Dimensions } from "../../../types/state";
|
||||
|
||||
import bgLight from "../../../public/images/misc/checker-40x40-light.png";
|
||||
import bgDark from "../../../public/images/misc/checker-40x40-dark.png";
|
||||
|
||||
const scrollAnimation = keyframes`
|
||||
from { background-position: 0 0; }
|
||||
to { background-position: 80px -40px; }
|
||||
@@ -12,6 +14,7 @@ const scrollAnimation = keyframes`
|
||||
export type PreviewWindowProps = {
|
||||
dimensions: Dimensions,
|
||||
animatedBG?: boolean,
|
||||
darkBG?: boolean,
|
||||
};
|
||||
export const PreviewWindow = styled.div<PreviewWindowProps>`
|
||||
position: relative;
|
||||
@@ -24,7 +27,7 @@ export const PreviewWindow = styled.div<PreviewWindowProps>`
|
||||
|
||||
border-radius: 1em;
|
||||
|
||||
background-image: url("${bg}");
|
||||
background-image: url("${({ darkBG }) => darkBG ? bgDark : bgLight}");
|
||||
background-position: 0px 0px;
|
||||
background-repeat: repeat;
|
||||
|
||||
|
||||
@@ -1,28 +1,37 @@
|
||||
import { Grid } from "@bedrock-layout/grid";
|
||||
import { InlineCluster } from "@bedrock-layout/inline-cluster";
|
||||
import { PadBox } from "@bedrock-layout/padbox";
|
||||
import { Split } from "@bedrock-layout/split";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
|
||||
import { workspaceSelector } from "../../../features/workspace/workspaceSelector";
|
||||
import { setAnimatedBG } from "../../../features/workspace/workspaceSlice";
|
||||
import { setAnimatedBG, setDarkBG } from "../../../features/workspace/workspaceSlice";
|
||||
|
||||
import { Toggle } from "../../Common/Inputs/Toggle";
|
||||
import { OverlayControl } from "../../OverlayTool";
|
||||
|
||||
export const WorkspaceControls = () => {
|
||||
const dispatch = useDispatch();
|
||||
const { animatedBG } = useSelector(workspaceSelector);
|
||||
const { animatedBG, darkBG } = useSelector(workspaceSelector);
|
||||
|
||||
return(
|
||||
<Grid gutter="sm" minItemWidth="100px">
|
||||
<PadBox padding="sm">
|
||||
<Split gutter="md">
|
||||
<InlineCluster as={PadBox} padding="sm" gutter="md">
|
||||
<Toggle
|
||||
label="Animate BG"
|
||||
toggled={animatedBG}
|
||||
onToggle={(value: boolean) => {
|
||||
dispatch(setAnimatedBG(value));
|
||||
}} />
|
||||
</PadBox>
|
||||
}}
|
||||
/>
|
||||
<Toggle
|
||||
label="Dark BG"
|
||||
toggled={darkBG}
|
||||
onToggle={(value: boolean) => {
|
||||
dispatch(setDarkBG(value));
|
||||
}}
|
||||
/>
|
||||
</InlineCluster>
|
||||
<OverlayControl />
|
||||
</Grid>
|
||||
</Split>
|
||||
);
|
||||
};
|
||||
Reference in new issue
Block a user