diff options
author | Paul Frazee <pfrazee@gmail.com> | 2024-11-23 16:20:24 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-23 16:20:24 -0800 |
commit | 32bf8122e8c8a0fbadd53b8a015cfbc9014519a2 (patch) | |
tree | 55bd24596e6fadadbf4326b26e3d14e418c5c7bb /src/components/anim/AnimatedCheck.tsx | |
parent | 523d1f01a51c0e85e49916fb42b204f7004ffac1 (diff) | |
parent | b4d07c4112b9a62b5380948051aa4a7fd391a2d4 (diff) | |
download | voidsky-32bf8122e8c8a0fbadd53b8a015cfbc9014519a2.tar.zst |
Merge branch 'main' into main
Diffstat (limited to 'src/components/anim/AnimatedCheck.tsx')
-rw-r--r-- | src/components/anim/AnimatedCheck.tsx | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/components/anim/AnimatedCheck.tsx b/src/components/anim/AnimatedCheck.tsx index 7fdfc14cf..60407274e 100644 --- a/src/components/anim/AnimatedCheck.tsx +++ b/src/components/anim/AnimatedCheck.tsx @@ -32,21 +32,25 @@ export const AnimatedCheck = React.forwardRef< const checkAnim = useSharedValue(0) const circleAnimatedProps = useAnimatedProps(() => ({ - strokeDashoffset: 166 - circleAnim.value * 166, + strokeDashoffset: 166 - circleAnim.get() * 166, })) const checkAnimatedProps = useAnimatedProps(() => ({ - strokeDashoffset: 48 - 48 * checkAnim.value, + strokeDashoffset: 48 - 48 * checkAnim.get(), })) const play = React.useCallback( (cb?: () => void) => { - circleAnim.value = 0 - checkAnim.value = 0 + circleAnim.set(0) + checkAnim.set(0) - circleAnim.value = withTiming(1, {duration: 500, easing: Easing.linear}) - checkAnim.value = withDelay( - 500, - withTiming(1, {duration: 300, easing: Easing.linear}, cb), + circleAnim.set(() => + withTiming(1, {duration: 500, easing: Easing.linear}), + ) + checkAnim.set(() => + withDelay( + 500, + withTiming(1, {duration: 300, easing: Easing.linear}, cb), + ), ) }, [circleAnim, checkAnim], |