1000ship / react-scroll-motion

🎞 Easy to make scroll animation
https://1000ship.github.io/react-scroll-motion
MIT License
422 stars 47 forks source link

Feature request: add a delay property for the animations #22

Open leeprobert opened 2 years ago

leeprobert commented 2 years ago

I've been wondering how I can get an element to stay in position for a certain section of the scroll before it moves, zooms, fades out. This could be achieved by adding a delay to the animations so they don't start to animate for a certain number of pixels. So if you use a MoveOut function and add a delay of 20 then it will stay in its required position and not start to move out for the 20 pixels of scroll. Another option would be to add a sticky property so when using this option to position the element you also set how long it has to stay in position before it outros.

Does this make sense?

1000ship commented 2 years ago

In this module, the movement depends on only scroll progress. So you can't make time-delaying, but you can control movement to make custom animation

check this out if you wanna know how animation objeect looks like https://github.com/1000ship/react-scroll-motion#make-custom-animation