From 736776a06fa42f3f337a99ae3d402b690597ba31 Mon Sep 17 00:00:00 2001 From: guizmo Date: Sun, 5 May 2024 19:48:37 +0200 Subject: [PATCH] feat(SkyBackground): add fade in animation --- components/SkyBackground/SkyBackground.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/SkyBackground/SkyBackground.tsx b/components/SkyBackground/SkyBackground.tsx index f813968..f915d6f 100644 --- a/components/SkyBackground/SkyBackground.tsx +++ b/components/SkyBackground/SkyBackground.tsx @@ -69,6 +69,11 @@ const Star = memo( getRandomInt(0, 3000), withRepeat(withTiming(1, {duration: 2000}), -1, true), ) + } else { + opacity.value = withDelay( + getRandomInt(0, 10000), + withTiming(getRandomInt(0.1, 1), {duration: 2000}), + ) } }, [animated, opacity]) @@ -79,7 +84,7 @@ const Star = memo( width={size} height={size} r={size / 2} - opacity={animated ? opacity : getRandomInt(0.1, 1)} + opacity={opacity} color="white" /> )