Jump to content
Search Community

Random Looping or a For Loop

celli test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

I make my GSAP animations using timelines and then nest the timelines so that I can control them better, which works for most things--but I know that this animation can be done in a much more streamlined way. How can I repeat my timelines and randomize them, without separating them into 4 'master timelines' to mimic the effect of random behaviors ? See codePen to see what I mean. I am trying to learn a better way to do things like this, but in a simplified way !

 

I know that I could have also used staggerTo on some of the rectangles as they fade up (I just didn't in this case), but I am more interested in seeing how I could have used a loop or something else to slim down and streamline my code.

See the Pen YqyPzb by celli (@celli) on CodePen

  • Like 1
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...