ddboy19912 Posted August 18, 2023 Share Posted August 18, 2023 I have a question related to scroll animations in react. Basically what I'm trying to achieve is when I scroll to the bottom of the page and scroll again, I want the footer to zoom into the screen like a modal and when I scroll up from the modal it returns to the last section (The last section should always be centered). This is very tricky because I'm also utilizing page snap on each section. I've tried to my understanding but not been able to achieve a concrete solution I've created a sandbox here to showcase and I've also added a reference below, Thank you : https://stackblitz.com/edit/stackblitz-starters-ougpwp?file=src%2FApp.tsx Bandicam 2023-08-18 10-59-32-874.mp4 Link to comment Share on other sites More sharing options...
Solution Cassie Posted August 18, 2023 Solution Share Posted August 18, 2023 Hiya! Is this a duplicate of this one? Looks like you're the friend Nick was helping out? If that answer solves this issue let me know. Link to comment Share on other sites More sharing options...
ddboy19912 Posted August 19, 2023 Author Share Posted August 19, 2023 I was able to solve the issue using the ScrollTrigger.observe() method ScrollTrigger.observe({ target: '.footer', type: 'wheel,touch', onUp: () => console.log('up'), onDown: () => setIsFooter(true), }); 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now