Levin Riegner
Community Answers
-
Levin Riegner's post in How to access scroll position when using ScrollSmoother was marked as the answer
Fixed!
I needed to do this instead:
// NOTE Before render, calculate smooth scrolling useLayoutEffect(() => { const ctx = gsap.context(() => { smoother.current = ScrollSmoother.create({ smooth: 2, // seconds it takes to "catch up" to native scroll position effects: true, // look for data-speed and data-lag attributes on elements and animate accordingly onUpdate: (self) => { let scrollY = self.scrollTop(); console.log(scrollY); } }); }, main); return () => ctx.revert(); }, []);
-
Levin Riegner's post in Scrolltrigger + timeline is causing staggered/one-by-one animations was marked as the answer
It seems i was missing the timing function at the very end:
Old Code:
tl.fromTo(parallaxImage7.current, { filter: 'blur(12px)', y: '100%' }, { filter: 'blur(0px)', y: '-100%' });
New Code:
tl.fromTo(parallaxImage7.current, { filter: 'blur(12px)', y: '100%' }, { filter: 'blur(0px)', y: '-100%' }, 0);