Created
October 31, 2019 19:00
-
-
Save lintonye/ae35342c5aa34a38e23f0803708560a5 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 * as React from "react" | |
import { Override, Data, useTransform, motionValue } from "framer" | |
const x = motionValue(0) | |
export function Card(props): Override { | |
const rotate = useTransform(x, [-100, 100], [-20, 20]) | |
return { | |
rotate, | |
x, | |
drag: "x", | |
} | |
} | |
export function Rect(props): Override { | |
const opacity = useTransform(x, [-100, 0, 100], [0, 1, 0]) | |
return { | |
opacity, | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment