willybrauner / interpol

Interpolate values with a GSAP-like API ~ 3.3kB
40 stars 0 forks source link

Something like timeScale in gsap #92

Closed csskiller closed 1 year ago

csskiller commented 1 year ago

Hi Willy!

Amazing library, my real congratulations! I was looking for something lighter than gsap and didnt find nothing async, simpler, lighter and clearer as Interpol.

Just one question : Is there a way to modify the time Scale ( the velocity ) of a Interpol or timeline? As I said in the title, in gsap is "timeScale", and you can use it to make something like that : https://codepen.io/mikeK/pen/YzyVpwg

Really thanks!

willybrauner commented 1 year ago

Thanks @csskiller :)

I think you can control the velocity of an Interpol or Timeline with the .seek(progress) method by updating the progress depending on what you want (force calculation, scroll velocity. Etc). But you have to calculate it by yourself.

Interpol is a very low level API, that's why a lot of gsap features are not covered by its method collection.

csskiller commented 1 year ago

Yes, good idea!