// H Scrolling
const tl = gsap.timeline({
ease: "none",
scrollTrigger: {
trigger: container,
start: 'center center',
pin: true,
scrub: true,
invalidateOnRefresh: true,
end: () => scrollWidth,
onUpdate: (self) => {
gsap.set(container, { x: -self.progress * scrollWidth });
},
},
})
My next.js app is using horizontal scroll using the code above, and for one of the sections I'd like:
- there will be two blocks of text stacked horizontally
- as the container scrolls into that section I'd like the two blocks to enter view, one coming from above and one coming from below and both ending their their stacked positions
- should be scrub:1 also so that if the user scrolls back past the centre point of the view that the two sections move back of the view in opposite directions.
If anyone can point me in the direction of relevant threads for this effect, especially ones that handle this effect for a horizontal scrolling app, that would be appreciated.