Randomly select an element to animate and loop it

Hello,

I’m trying to build a header of token that “shimmers”. the idea is that every second or so, I have a script that randomly selects a hero-token from the hero-container and spins it. When it is halfway through it’s spin, it would switch to a different hero-token image (any random token)

Curious how you would recommend going about this. I’m looking into some javascript libraries (anime.js) but wanted to see if folks had recommendations on where to start to make sure I optimize performance.

Thank you!


Here is my public share link: https://preview.webflow.com/preview/keegans-spectacular-site?utm_medium=preview_link&utm_source=designer&utm_content=keegans-spectacular-site&preview=4ca9ae94db0bff848fe88238df346351&workflow=preview

https://keegans-spectacular-site.webflow.io/

1 Like

Hey! Did you figure this out? Looking to create something similar.