-
-
Save mfrancois3k/dbf40e1684b214a9fabf9d5b3e9e2966 to your computer and use it in GitHub Desktop.
Framer animate text
This file contains hidden or 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 * as React from "react" | |
import { | |
Frame, | |
addPropertyControls, | |
ControlType, | |
useMotionValue, | |
Color, | |
useAnimation, | |
animate, | |
} from "framer" | |
let r = useMotionValue(0) | |
let start = r | |
let end = 100 | |
const [value, setValue] = React.useState(0) | |
let controls = animate(start, end, { | |
duration: 1.0, | |
ease: "linear", | |
delay: 0.0, | |
onUpdate: (v) => { | |
setValue(String(Math.round(v))) | |
}, | |
onComplete: (v) => { | |
//console.log(v) | |
}, | |
}) | |
<Frame | |
{...rest} | |
background={invisBG} | |
style={{ | |
color: "#fff", | |
}} | |
> | |
<div>{value}</div> | |
</Frame> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment