You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 12, 2024. It is now read-only.
I'm animating a custom value (not an element) with a spring, and I'd like to transfer the velocity to a new animation when it gets interrupted. Is there a way to obtain the current velocity of a running spring animation?
I know spring animations on dom elements get their velocity transferred automatically, how can I do it for this type of animation which uses a callback function?
Popmotion’s spring uses a velocity equation to figure out whether to stop on a given frame. I’ve modified that to expose this value - then if an animation is interrupted you can take the spring generator and scrub it to currentTime to get the velocity.
But I'm not sure if thats the right way, and I'm not sure how to "scrub the spring generator"
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm animating a custom value (not an element) with a spring, and I'd like to transfer the velocity to a new animation when it gets interrupted. Is there a way to obtain the current velocity of a running spring animation?
I know spring animations on dom elements get their velocity transferred automatically, how can I do it for this type of animation which uses a callback function?
I saw some discussion here #1 (reply in thread) that said:
But I'm not sure if thats the right way, and I'm not sure how to "scrub the spring generator"
Any help would be appreciated, thanks!
Beta Was this translation helpful? Give feedback.
All reactions