Jump to content
Search Community

Looping animation

noclip27 test
Moderator Tag

Recommended Posts

Is there a particular specific way to loop this codepen animation so it repeats after it is done cycling? I am new to the world of development, and animation in general and found this tweenmax library from that codepen. I would be grateful for a response for this so I can start delving into animation!

See the Pen YzPOzaQ by bustapaladin (@bustapaladin) on CodePen

  • Like 1
Link to comment
Share on other sites

Hi @noclip27,

 

You'll want to use repeat with a value of "-1", which means repeat infinitely.

 

I've also switched the code to GSAP 3 (with explanations in the comments) to show you how that would be done.

 

See the Pen jOPmmLg?editors=0010 by sgorneau (@sgorneau) on CodePen

 

Also ... check out how using 'defaults' can make this even simpler! (best to view these pens at their links so the JS doesn't wrap)

 

See the Pen ExjmmLW?editors=0010 by sgorneau (@sgorneau) on CodePen

 

Happy tweening!

 

  • Like 3
  • Thanks 1
Link to comment
Share on other sites

As a new developer, I managed to find the repeat() function in the docs but was overwhelmed with the task of re-factoring everything. I am very grateful that you updated the code and even added some commentary. Excited to start giving my creations a bit more soul. Thank you so much!

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