From 2f4aa06f94036a0c3b0874724e32553da8bd19a7 Mon Sep 17 00:00:00 2001 From: Tomek Zawadzki Date: Wed, 22 Jul 2026 15:46:04 +0200 Subject: [PATCH] Fix splash screen on iOS --- src/Splash.tsx | 59 ++++++++++++++++---------------------------------- 1 file changed, 19 insertions(+), 40 deletions(-) diff --git a/src/Splash.tsx b/src/Splash.tsx index c255af08d3..8ef6b4cf7c 100644 --- a/src/Splash.tsx +++ b/src/Splash.tsx @@ -72,21 +72,26 @@ export function Splash(props: React.PropsWithChildren) { const isDarkMode = colorScheme === 'dark' const logoAnimation = useAnimatedStyle(() => { + const introScale = interpolate(intro.get(), [0, 1], [0.8, 1], 'clamp') + const outroScale = + reduceMotion === true + ? 1 + : interpolate(outroLogo.get(), [0, 0.08, 1], [1, 0.8, 500], 'clamp') + + const introOpacity = interpolate(intro.get(), [0, 1], [0, 1], 'clamp') + const outroOpacity = interpolate( + outroAppOpacity.get(), + [0, 0.1, 0.2, 1], + [1, 1, 0, 0], + 'clamp', + ) + return { + opacity: introOpacity * outroOpacity, transform: [ - { - scale: interpolate(intro.get(), [0, 1], [0.8, 1], 'clamp'), - }, - { - scale: interpolate( - outroLogo.get(), - [0, 0.08, 1], - [1, 0.8, 500], - 'clamp', - ), - }, + {translateY: -(insets.top / 2)}, + {scale: 0.1 * outroScale * introScale}, ], - opacity: interpolate(intro.get(), [0, 1], [0, 1], 'clamp'), } }) const bottomLogoAnimation = useAnimatedStyle(() => { @@ -94,27 +99,6 @@ export function Splash(props: React.PropsWithChildren) { opacity: interpolate(intro.get(), [0, 1], [0, 1], 'clamp'), } }) - const reducedLogoAnimation = useAnimatedStyle(() => { - return { - transform: [ - { - scale: interpolate(intro.get(), [0, 1], [0.8, 1], 'clamp'), - }, - ], - opacity: interpolate(intro.get(), [0, 1], [0, 1], 'clamp'), - } - }) - - const logoWrapperAnimation = useAnimatedStyle(() => { - return { - opacity: interpolate( - outroAppOpacity.get(), - [0, 0.1, 0.2, 1], - [1, 1, 0, 0], - 'clamp', - ), - } - }) const appAnimation = useAnimatedStyle(() => { return { @@ -180,8 +164,6 @@ export function Splash(props: React.PropsWithChildren) { AccessibilityInfo.isReduceMotionEnabled().then(setReduceMotion) }, []) - const logoAnimations = - reduceMotion === true ? reducedLogoAnimation : logoAnimation // special off-spec color for dark mode const logoBg = isDarkMode ? '#0F1824' : '#fff' @@ -224,17 +206,14 @@ export function Splash(props: React.PropsWithChildren) { - - - + )}