gsap.registerPlugin(SplitText); console.clear(); document.fonts.ready.then(() => { gsap.set(".split", { opacity: 1 }); let split; SplitText.create(".split", { type: "words,lines", linesClass: "line", autoSplit: true, mask: "lines", onSplit: (self) => { split = gsap.from(self.lines, { duration: 0.6, yPercent: 100, opacity: 0, stagger: 0.1, ease: "expo.out", }); return split; } }); document.querySelector("button").addEventListener("click", (e) => { split.timeScale(0.2).play(0); }); });