Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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