Last active
March 29, 2019 21:35
-
-
Save lintonye/a2594b866400cb51c11e5610d8d8c1fe to your computer and use it in GitHub Desktop.
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 { Override, AnimationControls } from "framer"; | |
const anim1 = new AnimationControls(); | |
const anim2 = new AnimationControls(); | |
// Where to call unmount??? | |
anim1.mount(); | |
anim2.mount(); | |
async function animate() { | |
await anim1.start({ x: 200 }); | |
await anim2.start({ y: -100 }); | |
} | |
export function Anim1(): Override { | |
return { | |
animate: anim1 | |
}; | |
} | |
export function Anim2(): Override { | |
return { | |
animate: anim2 | |
}; | |
} | |
export function Start(): Override { | |
return { | |
onClick: () => animate() | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment