airbnb / lottie-android

Render After Effects animations natively on Android and iOS, Web, and React Native
http://airbnb.io/lottie/
Apache License 2.0
35.03k stars 5.41k forks source link

Smooth timeline forward like in Webflow #2270

Closed ofmarconi closed 1 year ago

ofmarconi commented 1 year ago

Is your feature request related to a problem? Please describe. When the page scrolls very fast the animation also advances super fast, in Webflow this is solved with a smoothness value.

Describe the solution you'd like We need to have a mathematical function that smooths this advance as the scroll happens.

Describe alternatives you've considered Webflow but I want to do this in Elementor Pro.

Additional context How it works in Webflow: https://www.loom.com/share/0da0e67df4cc43fea4ee50602179d488

ofmarconi commented 1 year ago

Where could I intercept the scroll information to put an EASE on the values before getting to the lottie? I think that's what webflow does, for Lottie the scroll is delayed...

gpeal commented 1 year ago

You can manually set the progress to whatever you want so you can replace the internal animator with your own. Would that work?

ofmarconi commented 1 year ago

@gpeal thanks for the reply! I confess that I did not understand very well, but it seems to be something interesting.

Correct me if I'm wrong:

Is it possible to define the progress in a custom way? instead of being directly related to Scroll or Mouse, would it be related to a var ?

Then update how I wanted this variable to move forward or backward in the animation progress?

gpeal commented 1 year ago

Yes, you can call setProgress on LottieDrawable/LottieAnimationView with whatever you want so you can create your own animator or tie it to events like scroll or click events.

ofmarconi commented 1 year ago

Thank you, it's a way, I'll study it, it's not so explicit in the documentation...