ISSUE-045 - Venetian Blinds - Improvements to Venetian Blinds prototype controls.
Now you have 10 different options (5 for position flag and 5 for driver portrait) to play with, as well as a slot selector to choose different starting corners. I have to admit that I didn't want to deal with type juggling with DriverId so I do a pretty hacky job. This is just for prototyping purposes so it really shouldn't be much of a focus for me, right? Added an overall delay prop for VenetianBlindsTransition so that I don't need to deal with special timing issues for the DriverChyron animation in the future.
This commit is contained in:
1 parent
9518f934ae
commit
16c29df42f
6 files changed
+70
-23
No files matched your search
+7
-2
@@ -8,6 +8,7 @@ import { Milliseconds } from "../../../../types/util";
|
||||
|
||||
type VenetianBlindsTransitionProps = {
|
||||
visible: boolean,
|
||||
delay?: Milliseconds,
|
||||
blindsColor: string,
|
||||
blindsColorFadeDuration: Milliseconds,
|
||||
blindsColorFadeDelay?: Milliseconds,
|
||||
@@ -26,6 +27,7 @@ type VenetianBlindsTransitionProps = {
|
||||
export const VenetianBlindsTransition = (
|
||||
{
|
||||
visible,
|
||||
delay = 0,
|
||||
blindsColor,
|
||||
blindsColorFadeDuration,
|
||||
blindsColorFadeDelay = 0,
|
||||
@@ -51,18 +53,19 @@ export const VenetianBlindsTransition = (
|
||||
const { wipe } = useSpring({
|
||||
wipe: visible ? 1 : 0,
|
||||
config: { duration: wipeDuration },
|
||||
delay: 0 + delay,
|
||||
});
|
||||
|
||||
const { opacity } = useSpring({
|
||||
opacity: visible ? 1 : opacityStart,
|
||||
config: { duration: opacityDuration },
|
||||
delay: opacityDelay,
|
||||
delay: opacityDelay + delay,
|
||||
});
|
||||
|
||||
const blindsSpring = useSpring({
|
||||
opacity: visible ? 1 : 0,
|
||||
config: { duration: blindsOpenDuration },
|
||||
delay: blindsOpenDelay,
|
||||
delay: blindsOpenDelay + delay,
|
||||
});
|
||||
|
||||
return (
|
||||
@@ -92,6 +95,7 @@ export const VenetianBlindsTransition = (
|
||||
blindsColorFadeDelay={blindsColorFadeDelay}
|
||||
blindsClosing={visible}
|
||||
spanBlinkDuration={spanBlinkDuration}
|
||||
spanBlinkDelay={delay}
|
||||
mirror={true} // Mirror version provides the opposite blinds.
|
||||
>
|
||||
{children}
|
||||
@@ -105,6 +109,7 @@ export const VenetianBlindsTransition = (
|
||||
blindsColorFadeDelay={blindsColorFadeDelay}
|
||||
blindsClosing={visible}
|
||||
spanBlinkDuration={spanBlinkDuration}
|
||||
spanBlinkDelay={delay}
|
||||
mirror={false}
|
||||
>
|
||||
{children}
|
||||
|
||||
@@ -48,11 +48,11 @@ export const VenetianBlindsFilter = styled.div<VenetianBlindsFilterProps>`
|
||||
${({ blindsColorFadeDelay = 0 }) => blindsColorFadeDelay}ms;
|
||||
}
|
||||
|
||||
${({ blindsClosing, spanBlinkDuration }) => (
|
||||
${({ blindsClosing, spanBlinkDuration, spanBlinkDelay = 0 }) => (
|
||||
blindsClosing && spanBlinkDuration
|
||||
? css`
|
||||
span {
|
||||
animation: ${spanBlinkAnimation} ${spanBlinkDuration}ms step-end;
|
||||
animation: ${spanBlinkAnimation} ${spanBlinkDuration}ms step-end ${spanBlinkDelay}ms;
|
||||
};
|
||||
`
|
||||
: null)
|
||||
|
||||
Reference in new issue
Block a user