Skip to content
Back to the lab

ScrollTrigger pin + containerAnimation + SplitText

Text that scrolls sideways

As you scroll down, the sentence moves left. The section is pinned for one screen, the vertical scroll distance is converted one to one into horizontal movement, and each character returns to its place from a random height and angle as it crosses the screen.

Source · GitHub

The pin distance equals the width by which the track overflows, so the text moves one pixel for each pixel scrolled (the ease has to be none). Each character has its own ScrollTrigger whose containerAnimation points at the horizontal tween, so "left 100% → left 40%" is measured in horizontal progress. The horizontal layout (a full-height stage, a max-content track, a 100vw lead-in) is written by GSAP as inline styles inside a matchMedia branch; the server output and touch devices get an ordinary centred paragraph that only fades in. The text is split again after a locale switch. The slogan on the About page uses the same component (fx/SidewaysBand).

Source

Source files on GitHub:

Back to the lab