Script – 23-28 Apr 7
Working with framer motion
I need my animation to show when it reaches viewport with this logic below from stack overflow:
But using variants to reuse animation for different headings, the animation loads no longer until I reach the last heading of the page
I thought of having different variants for each title but that would just make my code messy. Is there any more cleaner way to sort this out?
2 Replies
So I figured out the way to do this, all you have to do is have as many useAnimation and inView needed for the number of elements you are going to apply
In my case, that's 3 useAnimation & inView for 3 titles
Voila
This question has an answer! Thank you for helping 😄
If you have a followup question, you may want to reply to this thread so other members know they're related. https://discord.com/channels/102860784329052160/902647189120118794/961769444953165894
This thread hasn’t had any activity in 12 hours, so it’s now locked.
Threads are closed automatically after 12 hours. If you have a followup question, you may want to reply to this thread so other members know they're related. https://discord.com/channels/102860784329052160/902647189120118794/961769444953165894