convert splash

This commit is contained in:
Samuel Newman
2024-11-12 20:43:44 +00:00
parent b29f7b64ac
commit 5697c9ff48
+21 -11
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(() => {
'worklet'
intro.set(
withTiming(
1, 1,
{duration: 400, easing: Easing.out(Easing.cubic)}, {duration: 400, easing: Easing.out(Easing.cubic)},
async () => { () => {
// set these values to check animation at specific point // set these values to check animation at specific point
// outroLogo.value = 0.1 // outroLogo.value = 0.1
// outroApp.value = 0.1 // outroApp.value = 0.1
outroLogo.value = withTiming( outroLogo.set(
withTiming(
1, 1,
{duration: 1200, easing: Easing.in(Easing.cubic)}, {duration: 1200, easing: Easing.in(Easing.cubic)},
() => { () => runOnJS(onFinish)(),
runOnJS(onFinish)() ),
},
) )
outroApp.value = withTiming(1, { outroApp.set(
withTiming(1, {
duration: 1200, duration: 1200,
easing: Easing.inOut(Easing.cubic), easing: Easing.inOut(Easing.cubic),
}) }),
outroAppOpacity.value = withTiming(1, { )
outroAppOpacity.set(
withTiming(1, {
duration: 1200, duration: 1200,
easing: Easing.in(Easing.cubic), easing: Easing.in(Easing.cubic),
}) }),
},
) )
},
),
)
})()
}) })
.catch(() => {}) .catch(() => {})
} }