react-scroll-motion icon indicating copy to clipboard operation
react-scroll-motion copied to clipboard

Feature request: Callbacks for the animations?

Open leeprobert opened this issue 2 years ago • 2 comments

More of a feature request but is it possible to include a callback for the animations? Is this possible now somehow? I would love to know when the element has begun to move or has ended. I would also love to get more information about the scroll position for the different pages. What the position should be when a page starts to move etc.

leeprobert avatar Apr 20 '22 10:04 leeprobert

It's not possible yet. But I can make that hooks. What kind of hooks do you need?

ex) onPageAppear, onPageDisappear... so on

1000ship avatar Jun 06 '22 03:06 1000ship

I don't suppose you did this, did you? I have a requirement to animate an image sequence on scroll so I need a way to pass in a prop to a component that represents the scroll position of the <Animator> as it is scrolled. Then I can calculate the frame number.

I would add some hooks for the page scrolls as you mentioned but also have one that gives you a normalised value of the scroll between 0 and 1 as well as the actual pixel value for the scroll.

leeprobert avatar Jul 12 '22 15:07 leeprobert