Jump to content
Search Community

Slow animation with stagger

Daniel Hult test
Moderator Tag

Recommended Posts

Hi!

I was just trying out the stagger method in gsap to test some things out and tried to replicate your own "Advanced stagger in GSAP 3" codepen. Yours look very smooth, but why is mine so janky and "slow/glitchy"?

Here is your original one:

See the Pen jdawKx?editors=1010 by GreenSock (@GreenSock) on CodePen

See the Pen zYvKgoj by daniel-hult (@daniel-hult) on CodePen

Link to comment
Share on other sites

Hey Daniel.

 

Not all elements animate equally. The biggest reason why your animation performs worse is actually because of your border-radius. Since you're scaling the elements, the browser has to continually update the border radius which isn't the most performant property. You can minimize this performance hit by using will-change: transform, but it's probably best to avoid scaling things with percent border radiuses if you can help it. 

Link to comment
Share on other sites

10 minutes ago, Daniel Hult said:

Will just setting it to a fixed value work?

Test and see ;) 

 

10 minutes ago, Daniel Hult said:

Or is border radius something specific that can slow down animations?

Like I said, border-radius is not the most performant of properties. The best answer, as usual, is test things out. See what works and what doesn't. 

 

If you need circles in your project, it might make sense to use a background image or something.

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