Skip to content

Instantly share code, notes, and snippets.

@lintonye
Created October 31, 2019 19:00
Show Gist options
  • Save lintonye/ae35342c5aa34a38e23f0803708560a5 to your computer and use it in GitHub Desktop.
Save lintonye/ae35342c5aa34a38e23f0803708560a5 to your computer and use it in GitHub Desktop.
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