Jump to content
Search Community

Laggy Animations

Sam King test
Moderator Tag

Recommended Posts

Hey guys!

Sorry, new here. I've got GSAP running on most of my sites, but on my one it seems MAJORLY laggy. I've tried autoAlpha but to no avail.

 

www.dotcreo.co.uk

 

Sorry if this isn't a sufficient link. I can't get my whole project on codepen :S 

If anything I can do to help the process easier for you guys to diagnose just let me know :)

 

Cheers

Link to comment
Share on other sites

Quote

Please don't include your whole project

 

It's pretty tough to troubleshoot without a minimal demo - the issue could be caused by CSS, markup, a third party library, your browser, an external script that's totally unrelated to GSAP, etc. Would you please provide a very simple CodePen or CodeSandbox that demonstrates the issue? 

 

Please don't include your whole project. Just some colored <div> elements and the GSAP code is best (avoid frameworks if possible). See if you can recreate the issue with as few dependancies as possible. If not, incrementally add code bit by bit until it breaks. Usually people solve their own issues during this process! If not, then at least we have a reduced test case which greatly increases your chances of getting a relevant answer.

 

Here's a starter CodePen that loads all the plugins. Just click "fork" at the bottom right and make your minimal demo

See the Pen aYYOdN by GreenSock (@GreenSock) on CodePen

 

If you're using something like React/Next/Nuxt/Gatsby or some other framework, you may find CodeSandbox easier to use. 

 

Once we see an isolated demo, we'll do our best to jump in and help with your GSAP-specific questions. 

Link to comment
Share on other sites

Hey GSAP Helper,

 

Thanks for your swift reply, and apologies again for that.

 

I've created a codepen here, but during creating it I seem to have found the issue. It's pertinent to the Lottie animations.

See the Pen xxzmooN by samkingtwentytwo (@samkingtwentytwo) on CodePen

 

When I comment out the Lottie animations on localhost it seems to majorly improve any lag. 

 

I'm wondering how I can fix this? 

 

Thanks!

Link to comment
Share on other sites

Lottie animations are quite heavy perf-wise I'm afraid. Some options could be to export out for canvas instead of SVG, cut down on the number of frames, or cut down on the number of Lottie animations.

The folks in the Lottie forums will be able to help you a little more than we can -

https://stackblitz.com/edit/nuxt-starter-khrgsj?file=pages/index.vue

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