GithubHelp home page GithubHelp logo

Really laggy on mobile about easy-ease HOT 5 CLOSED

 avatar commented on June 5, 2024
Really laggy on mobile

from easy-ease.

Comments (5)

davidgilbertson avatar davidgilbertson commented on June 5, 2024

This is most likely because the code that you're passing to onStep is taking more than 16ms to complete on mobile. You can throttle the CPU in Chrome on desktop and use the DevTools performance tab to see what's taking so long.

If you're manipulating the DOM in any way that causes a repaint, this might be your problem. For most things DOM related you can use CSS animations instead.

I'll close this as I don't believe it's an issue with the library, but if you're stuck feel free to share your code and I'll see if I can help.

from easy-ease.

 avatar commented on June 5, 2024

Would it be possible to lower framerate to make up for the throttling?

from easy-ease.

davidgilbertson avatar davidgilbertson commented on June 5, 2024

Hmm, if I understand correctly, you're suggesting that the library would calculate how long it's taking to execute the code in onStep and adjust the number of steps for the remainder of the animation? I like the idea, but this would need to be done for every single step, potentially slowing down the whole thing for all users.

from easy-ease.

 avatar commented on June 5, 2024

No, I mean to change it to 30 fps for everyone.

from easy-ease.

davidgilbertson avatar davidgilbertson commented on June 5, 2024

Oh, no I'd like to leave it at 60 FPS.

You could fork (or even just copy/paste, it's very small) and make the change. But currently it uses requestAnimationFrame, not a hardcoded 60 FPS, so you'd need to change that logic.

I wrote a post about the inner workings if you're interested https://medium.com/hackernoon/writing-an-easing-function-a-slightly-interesting-story-70ce667c212a

from easy-ease.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.