newyorker Posted December 14, 2023 Share Posted December 14, 2023 Hi everyone, I'm developing an animation for a set of divs that dynamically display Weather data fetched from an API. The goal is to create a seamless looping animation where three elements (st1, st2, st3) fade in and out in sequence, creating an overlapping carousel effect. The challenge I'm facing is with the transition from st3 back to st1 in the looping sequence. On the first loop, the transition from st1 to st3 is smooth and works as expected. However, in subsequent loops, st1 seems to restart and plays its fade-in animation again, which disrupts the flow. I know this is a very simple issue, but I just couldn't manage to create a seamless loop, and would really appreciate if someone can help me out. Here's my minimal StackBlitz demo for reference: https://stackblitz.com/edit/nextjs-zjgmib?file=pages%2Findex.js Thank you in advance. Link to comment Share on other sites More sharing options...
Solution Rodrigo Posted December 14, 2023 Solution Share Posted December 14, 2023 Hi, @Carl has you covered with His super seamless loop tutorial: https://www.snorkl.tv/greensock-staggers-with-seamless-loops/ Here is a codepen demo that shouldn't be too hard to port to React: See the Pen ExVEOPa by snorkltv (@snorkltv) on CodePen Hopefully this helps. Happy Tweening! 2 Link to comment Share on other sites More sharing options...
newyorker Posted December 14, 2023 Author Share Posted December 14, 2023 Thank you so much @Rodrigo, this is great. I will also definitely check out @Carl's tutorial. 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