ScrollTrigger not animating the element ".profile__container",
unless I add scrub.
I want the scrollTrigger to element without the scrub.
Is there something I'm doing wrong.
useEffect(()=>{
const profileAboutTexts = document.querySelectorAll(".profile__about p");
// const profileContainer = document.querySelector(".profile__container")
// const about = aboutRef.current
profileAboutTexts.forEach(text=>{
new SplitType(text, { types: 'lines, char' })
})
const anim = {
y: 130,
transform: "rotateZ(25deg)",
opacity: 0,
stagger: {
amount: .8
},
}
const ctx = gsap.context(()=>{
tl.current = gsap.timeline();
tl.current.from(".profile__about p:first-child .char", {delay: 2, duration: 1.3, ...anim})
tl.current.from(".profile__about p:last-child .char",
{...anim,
scrollTrigger: {
trigger: ".profile__container",
start: "top 40%",
end: "top 20%",
markers: true,
}
}
)
}, aboutRef)
return ()=> {
ctx.revert()
}
}, [])