noclip27 Posted February 27, 2020 Share Posted February 27, 2020 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 1 Link to comment Share on other sites More sharing options...
Shaun Gorneau Posted February 27, 2020 Share Posted February 27, 2020 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! 3 1 Link to comment Share on other sites More sharing options...
noclip27 Posted February 27, 2020 Author Share Posted February 27, 2020 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! 2 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