Created
December 24, 2020 04:49
-
-
Save aranda-adapptor/7df1c9e0d7f95cd486b2a7a6bdc147a4 to your computer and use it in GitHub Desktop.
Use star id to vary the star animation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const animatedStyle = useAnimatedStyle(() => { | |
const x = Math.sin(props.time.value * 2 + props.id) * 50; | |
const y = Math.cos(props.time.value * 2 + props.id) * 50; | |
return { | |
left: props.x + x, | |
top: props.y + y, | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment