Created
March 24, 2020 17:37
-
-
Save lintonye/44d38acbdf96791e6e707b983cf8fed7 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, transform } from "framer" | |
import { | |
useScroll, | |
useTrackScrollY, | |
// @ts-ignore | |
} from "@framer/lintonye.parallax/code" | |
const appState = Data({ | |
percentage: 0, | |
}) | |
export function Lottie(): Override { | |
const { scrollY } = useScroll() | |
useTrackScrollY(y => { | |
appState.percentage = transform(y, [0, -200], [0, 100]) | |
}) | |
return { | |
percentage: appState.percentage, | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment