Closed ngocducdim closed 2 years ago
@ngocducdim based on the visual, it may be possible. Not quite how you describe -- you must provide start end values for translateX
like translateX={['-100%, '0%']}
that will correspond to the progress 0 - 1
. Since these elements are fixed in view and don't naturally scroll you would have to use startScroll
and endScroll
config values to determine the progress. I can try and mock something up for you.
@ngocducdim I put together a CodeSandbox
This is probably the closest you can get. The main limitation I see is that there's no ability to set key points along the animation -- only a start and end value. If that works for you then you'll be ok, but if you need more advanced timeline/keyframes then I'd suggest looking at a different library such as GSAP ScrollTrigger.
Let me know if this helps.
Hi sorry for late reply, your demo is nice really helpful for the basic one, I will take a look the GSAP ScrollTrigger, thank you
<Parallax />
component will have propertytranslateX={1}
and at the progress value 0.5 the<Parallax />
component will have propertytranslateX={5}
, can we do that? I want implement the animation like below: