Skip to content

Instantly share code, notes, and snippets.

@josefrichter
Created September 28, 2021 13:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josefrichter/48362bfe9e4e723edad8cdbb5af608ed to your computer and use it in GitHub Desktop.
Save josefrichter/48362bfe9e4e723edad8cdbb5af608ed to your computer and use it in GitHub Desktop.
export function ScaleV2(): Override {
const [endX, endScale, endOpacity] = [-60, 0.5, 0.6] // TODO pass this from outside
const x = useTransform(contentOffsetY, [0, -400], [0, endX], {
clamp: false,
})
const scale = useTransform(contentOffsetY, [0, -400], [1, endScale], {
clamp: false,
})
const opacity = useTransform(contentOffsetY, [0, -400], [1, endOpacity], {
clamp: false,
})
return {
scale: scale,
x: x,
opacity: opacity,
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment