Jump to content
Search Community

Staggered multiple-element fade-in-out animation

AduITC test
Moderator Tag

Go to solution Solved by Carl,

Recommended Posts

Good morning everyone!

I'm very sorry to bother you with a trivial question, but I'm totally new to this amazing tool that is GSAP and I'm still struggling to understand its syntax and logic, as I'm not an experienced dev. I really want to learn this wonderful library as it seems very powerful, but for now I'm stuck on small basic things.

 

I have created the following animation in CSS:

https://codepen.io/AduITSU/pen/BaLMLYO

 

Please, ignore the 4s pause between each repeat: it shouldn't be there in the final concept. As you can see, each object-pair gradually changes color to light blue in 1s and then reverts back to its original fill in 1s before the following object-pair does the same thing and so forth.

 

I've tried to replicate this in GSAP... here's the miserable result:

https://codepen.io/AduITSU/pen/vYXbXWW

 

I suppose I must place the "stagger" object somewhere else but I can't figure out where. Plus, I don't know which GSAP easing is the most similar to the CSS normal "ease". Could you please help me guys??

 

Thank you very much for your patience and kindness!

See the Pen BaLMLYO by AduITSU (@AduITSU) on CodePen

Link to comment
Share on other sites

  • Solution

Hi AdulTSU,

 

This is an interesting challenge and not too tricky with GSAP, but it does require knowing some of the finer nuances of the API.

 

Please see this video on placing repeat in the stagger object vs placing it on a timeline or tween

 

I was able to get what you want pretty close I think with this approach

 

See the Pen BaLMJYP?editors=0010 by snorkltv (@snorkltv) on CodePen

 

The blog post below contains a lesson from my course GSAP3 Beyond the Basics which shows how to get rid of any pause between repeats

 

https://www.snorkl.tv/greensock-staggers-with-seamless-loops/

 

Hopefully this helps point you in the right direction

 

 

 

  • Like 5
Link to comment
Share on other sites

Thank you very much, Carl!

This is exactly what I was looking for!

I really appreciate your help and the resources you pointed me to. I will study them carefully in order to enhance my very poor "mastery" of GSAP!

Thanks again for your kindness!

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