Created
September 3, 2021 02:17
-
-
Save malerba118/f9f7988ac6be7c5170ec67db00ced459 to your computer and use it in GitHub Desktop.
Parallax Brainstorming
This file contains hidden or 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
| const keyframes = { | |
| heading: ({ page, fromPx }) => ({ | |
| [page.y - fromPx(50)]: { | |
| y: 30, | |
| opacity: 0 | |
| }, | |
| [page.y]: { | |
| y: 0, | |
| opacity: 1 | |
| }, | |
| [page.y + fromPx(50)]: { | |
| y: -30, | |
| }, | |
| }) | |
| } | |
| const App = () => ( | |
| <Parallax> | |
| <Page> | |
| <Box h="200vh"> | |
| <Item keyframes={keyframes.heading}> | |
| <Heading>Some Title</Heading> | |
| </Item> | |
| </Box> | |
| </Page> | |
| <Page> | |
| <Box h="100vh"> | |
| </Box> | |
| </Page> | |
| </Parallax> | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment