diff options
author | Eric Bailey <git@esb.lol> | 2023-12-18 16:27:03 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-18 14:27:03 -0800 |
commit | d05658f2244d100392189d46ff2680df3b170606 (patch) | |
tree | 3d3346f5636d5ed45a8cccd54a96eb4683b42d1b /src/Splash.tsx | |
parent | 1cf5a0b0fcd6bd44175eb8677f9f43fe22ffed08 (diff) | |
download | voidsky-d05658f2244d100392189d46ff2680df3b170606.tar.zst |
Tweak splash speed (#2241)
Diffstat (limited to 'src/Splash.tsx')
-rw-r--r-- | src/Splash.tsx | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/src/Splash.tsx b/src/Splash.tsx index ead8e0f00..16375539f 100644 --- a/src/Splash.tsx +++ b/src/Splash.tsx @@ -49,6 +49,7 @@ export function Splash(props: React.PropsWithChildren<Props>) { const intro = useSharedValue(0) const outroLogo = useSharedValue(0) const outroApp = useSharedValue(0) + const outroAppOpacity = useSharedValue(0) const [isAnimationComplete, setIsAnimationComplete] = React.useState(false) const [isImageLoaded, setIsImageLoaded] = React.useState(false) const isReady = props.isReady && isImageLoaded @@ -62,8 +63,8 @@ export function Splash(props: React.PropsWithChildren<Props>) { { scale: interpolate( outroLogo.value, - [0, 0.06, 0.08, 1], - [1, 0.8, 0.8, 400], + [0, 0.08, 1], + [1, 0.8, 400], 'clamp', ), }, @@ -79,7 +80,12 @@ export function Splash(props: React.PropsWithChildren<Props>) { scale: interpolate(outroApp.value, [0, 1], [1.1, 1], 'clamp'), }, ], - opacity: interpolate(outroApp.value, [0, 0.9, 1], [0, 1, 1], 'clamp'), + opacity: interpolate( + outroAppOpacity.value, + [0, 0.08, 0.15, 1], + [0, 0, 1, 1], + 'clamp', + ), } }) @@ -92,29 +98,30 @@ export function Splash(props: React.PropsWithChildren<Props>) { intro.value = withTiming( 1, - {duration: 200, easing: Easing.out(Easing.cubic)}, + {duration: 400, easing: Easing.out(Easing.cubic)}, async () => { // set these values to check animation at specific point // outroLogo.value = 0.1 // outroApp.value = 0.1 outroLogo.value = withTiming( 1, - {duration: 1000, easing: Easing.in(Easing.cubic)}, - () => { - runOnJS(onFinish)() - }, - ) - outroApp.value = withTiming( - 1, - {duration: 1000, easing: Easing.inOut(Easing.cubic)}, + {duration: 1200, easing: Easing.in(Easing.cubic)}, () => { runOnJS(onFinish)() }, ) + outroApp.value = withTiming(1, { + duration: 1200, + easing: Easing.inOut(Easing.cubic), + }) + outroAppOpacity.value = withTiming(1, { + duration: 1200, + easing: Easing.in(Easing.cubic), + }) }, ) } - }, [onFinish, intro, outroLogo, outroApp, isReady]) + }, [onFinish, intro, outroLogo, outroApp, outroAppOpacity, isReady]) const onLoadEnd = useCallback(() => { setIsImageLoaded(true) |