Skip to content

Instantly share code, notes, and snippets.

@malerba118
Last active May 3, 2023 16:27
Show Gist options
  • Save malerba118/567cdada1bce81fda5e28eb865ee729e to your computer and use it in GitHub Desktop.
Save malerba118/567cdada1bce81fda5e28eb865ee729e to your computer and use it in GitHub Desktop.
const Item = () => {
const progress = useScrollProgress()
return <motion.div style={{ opacity: progress }} />
}
const App = () => {
return (
<Scroll.Section
start={{ section: 'start', container: 'center' }}
end={{ section: 'end', container: 'center' }}
>
<Item />
<Scroll.Slice start={0} end={0.5}>
<Item />
</Scroll.Slice>
<Scroll.Slice start={0.5} end={1}>
<Item />
</Scroll.Slice>
</Scroll.Section>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment