Jump to content
Search Community

Timeline doesn't animate in float values

SimonVonSchmude test
Moderator Tag

Go to solution Solved by akapowl,

Recommended Posts

I wanted to test this simple looping animation using the timeline functionality. 
When the second animation eases out, it seems to stutter. Using the console, i found out that gsap assigns float values to the css for the first animation, but integer values for the second one, making it appear less smooth. How can i force gsap to use float precision? 

See the Pen bGZdKWG by SimonVonSchmude (@SimonVonSchmude) on CodePen

Link to comment
Share on other sites

Hi @SimonVonSchmude welcome to the forum!

 

You can set the snap object to snap the values to specific increments, see the docs for more info https://gsap.com/docs/v3/GSAP/CorePlugins/Snap/

 

I don't know if this will solve your issue. I've personally never used letterSpacing to animate text I usually then gravitate to our SpiltText Plugin, this because I have the feeling the browser probably has to do something like repaint if you animate that property which is causing the issues you're seeing. With if you split the text in to individual characters you can animate properties like translateX and Y, which will be much more performant when animating. 

 

Still hope it helps and happy tweening! 

 

See the Pen GReJGdb?editors=0010 by mvaneijgen (@mvaneijgen) on CodePen

 

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