Jump to content
Search Community

mixpofo

Members
  • Posts

    2
  • Joined

  • Last visited

mixpofo's Achievements

  1. Hello, I am encountering an issue with ScrollTrigger and Lenis on the mobile version of my project. The scrolling experience is laggy and not smooth, whereas everything operates seamlessly on the desktop version. This is my code : useEffect(() => { const lenis = new Lenis({ duration: 2, easing: (t) => Math.min(1, 1.001 - Math.pow(2, -10 * t)), infinite: false, }); lenis.on("scroll", ScrollTrigger.update); gsap.ticker.add((time) => { lenis.raf(time * 1000); }); gsap.ticker.lagSmoothing(0); ScrollTrigger.normalizeScroll(true); // Nettoyage lors du démontage return () => { lenis.off("scroll", ScrollTrigger.update); }; }, []); Thanks !!
  2. Hello, everyone! I am using GSAP 3.8.0 with Next.js, and everything is working fine. However, when I upgraded to GSAP 3.12.0, my code stopped working as expected. Did something change from version 3.8.0 to 3.12.0? Here is my code: function getScrollAmount() { const extElements = document.querySelector("#extElements"); let racesWidth = extElements.scrollWidth; return -(racesWidth - window.innerWidth); } useEffect(() => { const extElements = document.querySelector("#extElements"); const tween = gsap.to(extElements, { x: getScrollAmount, duration: 3, ease: "none" }); ScrollTrigger.create({ trigger: ".extWrap", start: "top 0%", end: () => `+=${getScrollAmount() * -1}`, pin: true, animation: tween, scrub: 1, invalidateOnRefresh: true, markers: false, }); }, []);
×
×
  • Create New...