Created
December 23, 2018 05:24
-
-
Save stakes/438e1a9de509adee4948a923690916ed to your computer and use it in GitHub Desktop.
Loop Animation: Framer X code override
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
import { Data, animate, Override, Animatable } from "framer"; | |
const data = Data({ rotation: Animatable(0) }); | |
export const SecondHandRotate: Override = () => { | |
BeginRotateAnimation(); | |
return { | |
rotation: data.rotation, | |
originY: 1 | |
}; | |
}; | |
const BeginRotateAnimation = async () => { | |
data.rotation = 0; | |
await animate.linear(data.rotation, 360).finished; | |
BeginRotateAnimation(); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment