Hello, i need to use repeater for section text, but something works wrong with textTitle and textText, they apply the animation only on the first span.
Any suggestion?
});
gsap.utils.toArray(".section--text").forEach((section) => {
const tls = gsap.timeline({
scrollTrigger: {
trigger: section,
scroller: ".o-scroll",
scrub: true,
start: "top top",
end: "+=500%",
pin: true,
},
});
const delay = 0.2;
const textTitle = section.querySelector(".fade-up-title span");
const textText = section.querySelector(".fade-up-text span");
tls
.to(textTitle, { duration: 1, autoAlpha: 1, y: 0, stagger: delay }, 0)
.to(textText, { duration: 1, autoAlpha: 1, y: 0, stagger: delay }, 1)
.to(textTitle, { duration: 1, autoAlpha: 0, y: -200 }, 3)
.to(textText, { duration: 1, autoAlpha: 0, y: -200 }, 3);
});