Hello,
I'm new to GSAP but i was able to put some parallax and some pinned section with horizontal scroll working with ScrollTrigger, but now i wanted to add Locomotive Scroll for smooth scroll and other text animations but GSAP doesnt seem to like it.
After adding Locomotive scroll and initializing it, all animations done with ScrollTrigger stopped working.
Cant figure out the reason why.
I saw this in the scrollerProxy info tried to apply it to my case but with no success
const locoScroll = new LocomotiveScroll({
el: document.querySelector(".masterpage"), //my main container (data-scroll-container)
smooth: true,
});
locoScroll.on("scroll", ScrollTrigger.update);
ScrollTrigger.scrollerProxy(".masterpage", {
scrollTop(value) {
return arguments.length ? locoScroll.scrollTo(value, 0, 0) : locoScroll.scroll.instance.scroll.y;
},
getBoundingClientRect() {
return {top: 0, left: 0, width: window.innerWidth, height: window.innerHeight};
},
pinType: "transform"
});
Anyone could help me?
Thank you in advance