convert splash

This commit is contained in:
Samuel Newman
2024-11-12 20:43:44 +00:00
parent b29f7b64ac
commit 5697c9ff48
+31 -21
View File
@@ -10,6 +10,7 @@ import Animated, {
Easing, Easing,
interpolate, interpolate,
runOnJS, runOnJS,
runOnUI,
useAnimatedStyle, useAnimatedStyle,
useSharedValue, useSharedValue,
withTiming, withTiming,
@@ -146,30 +147,39 @@ export function Splash(props: React.PropsWithChildren<Props>) {
if (isReady) { if (isReady) {
SplashScreen.hideAsync() SplashScreen.hideAsync()
.then(() => { .then(() => {
intro.value = withTiming( runOnUI(() => {
1, 'worklet'
{duration: 400, easing: Easing.out(Easing.cubic)}, intro.set(
async () => { withTiming(
// set these values to check animation at specific point
// outroLogo.value = 0.1
// outroApp.value = 0.1
outroLogo.value = withTiming(
1, 1,
{duration: 1200, easing: Easing.in(Easing.cubic)}, {duration: 400, easing: Easing.out(Easing.cubic)},
() => { () => {
runOnJS(onFinish)() // set these values to check animation at specific point
// outroLogo.value = 0.1
// outroApp.value = 0.1
outroLogo.set(
withTiming(
1,
{duration: 1200, easing: Easing.in(Easing.cubic)},
() => runOnJS(onFinish)(),
),
)
outroApp.set(
withTiming(1, {
duration: 1200,
easing: Easing.inOut(Easing.cubic),
}),
)
outroAppOpacity.set(
withTiming(1, {
duration: 1200,
easing: Easing.in(Easing.cubic),
}),
)
}, },
) ),
outroApp.value = withTiming(1, { )
duration: 1200, })()
easing: Easing.inOut(Easing.cubic),
})
outroAppOpacity.value = withTiming(1, {
duration: 1200,
easing: Easing.in(Easing.cubic),
})
},
)
}) })
.catch(() => {}) .catch(() => {})
} }