Jump to content
Search Community

Looping Animation for Text Carousel Fade Effect

newyorker test
Moderator Tag

Go to solution Solved by Rodrigo,

Recommended Posts

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...