Skip to content

Instantly share code, notes, and snippets.

@malerba118
Created September 3, 2021 02:17
Show Gist options
  • Select an option

  • Save malerba118/f9f7988ac6be7c5170ec67db00ced459 to your computer and use it in GitHub Desktop.

Select an option

Save malerba118/f9f7988ac6be7c5170ec67db00ced459 to your computer and use it in GitHub Desktop.
Parallax Brainstorming
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