Thanks for the tips, Blake.
It still doesn't seem to scrub without setting markers to true.
Here is a better example on the current development link:
https://verhaal.netlify.app/
For full context, I am trying to mimic the behavior on this site:
https://fuzzco.com/
if (typeof window !== `undefined` && location) {
gsap.registerPlugin(ScrollTrigger);
ScrollTrigger.refresh();
useEffect(() => {
var direction = -1
var mod = gsap.utils.wrap(0, window.innerHeight);
gsap.set('.container-marquee',{yPercent:100})
var anim = gsap.to('.container-marquee', {
yPercent: (100 * direction),
ease: 'linear',
overwrite: true,
duration: 20,
repeat:-1,
})
function infiniteReverse() {
tl.totalTime(tl.rawTime() + tl.duration() + tl.repeatDelay());
}
var tl = gsap.timeline({
pause: false,
repeatDelay:0.5,
onReverseComplete: infiniteReverse,
scrollTrigger: {
trigger: document.body,
start: "top top", // When the top of the trigger reaches the top of the viewport
end: "bottom top", // When the bottom of the trigger reaches the top of the scroller
markers: false,
scrub: true,
toggleActions:"restart complete reverse reset play",
onUpdate: self => {
direction = self.direction
gsap.to(anim, {
overwrite: true,
timeScale: self.getVelocity() / 5,
yPercent: (100 * direction),
});
},
},
});
}, [])
}