Outline Marquee Scroll Push: Time Loop Plus Scroll Push on a Giant Text-Stroke Ribbon
Goal
Build a black page with one giant text ribbon drawn only in outline (transparent fill, thin -webkit-text-stroke). The ribbon runs on its own from right to left in a seamless infinite loop and, on top of that, scroll pushes it further left: the two motions live on two different transform properties (xPercent for the loop, x for the push), so they add up instead of fighting. The ribbon sits in a sticky stage inside a tall scroll corridor, so it stays centred on screen while you scroll and you can see the push speed it up. GSAP + ScrollTrigger, native scroll.
Tech
Vanilla HTML/CSS/JS with ES module imports. gsap (npm) + ScrollTrigger. Font: Funnel Display weight 300.
Layout / HTML
<div class="om">
<section class="om-run" aria-label="Cities">
<div class="om-stage">
<div class="om-band" aria-hidden="true">
<div class="om-track">
<span>Lisbon · Mexico City · Bogotá · Madrid · Santiago · Lima · </span><span>Lisbon · Mexico City · Bogotá · Madrid · Santiago · Lima · </span>
</div>
</div>
</div>
</section>
</div>
The track holds the same text twice: looping it to xPercent:-50 lands the second copy exactly where the first started, so the loop has no seam. The text must be at least as wide as the viewport (it is, at this size).
Styling
:root: --om-bg:#050608, --om-stroke:rgba(255,255,255,.8).
.om:background:var(--om-bg); font-family:"Funnel Display"..om-run:position:relative; height:260svh(the scroll corridor; its length is how long the push lasts)..om-stage:position:sticky; top:0; height:100svh; display:flex; align-items:center; overflow:hidden..om-band:width:100%; overflow:hidden..om-track:display:flex; width:max-content; font-weight:300; font-size:clamp(5rem,14vw,12.5rem); line-height:1; letter-spacing:-.02em; white-space:nowrap; color:transparent; -webkit-text-stroke:1px var(--om-stroke); will-change:transform. Eachspanhaspadding-right:.3em, so the join between the two copies keeps the same spacing as the rest.
GSAP effect (be exact)
gsap.registerPlugin(ScrollTrigger). Build in mount(config) → destroy().
const DEFAULTS = { loopDuration: 38, push: .35, startProgress: .08 };
If matchMedia("(prefers-reduced-motion: reduce)") matches, do nothing (the ribbon stays still and fully readable).
Loop (time)
const loop = gsap.to(track, { xPercent: -50, duration: 38, ease: "none", repeat: -1 });
loop.progress(.08); // start a little into the loop, not on the exact edge
Push (scroll)
gsap.to(track, {
x: () => -innerWidth * .35, ease: "none",
scrollTrigger: { trigger: ".om-run", start: "top top", end: "bottom bottom", scrub: true, invalidateOnRefresh: true },
});
x is a function plus invalidateOnRefresh, so the push distance is recalculated when the viewport is resized.
destroy(): kill the loop, the scroll tween and its ScrollTrigger, then clearProps:"all" on the track.
Assets / images
None. The ribbon is pure type.
Behavior notes
xPercentandxare separate transform components in GSAP, so one tween can loop forever while another is scrubbed by scroll on the same element. Putting both onxwould make the later tween overwrite the earlier one.- The outline only reads at large sizes; below ~4rem a 1px stroke looks like a hairline smudge.
- The sticky corridor is for the demo. Inside a normal page you can drop the corridor and use
trigger: section, start: "top bottom", end: "bottom top"so the push happens while the band crosses the viewport. - Only the prefixed variables are global.
Using this outside its demo page
This component is written as a complete page: that is how the demo is meant to look. If you are dropping it into an existing project, or combining it with other components, these are the things it declares at document level and that you need to move or reconcile first.
- Palette on
:root:--om-bg,--om-stroke. Generic names like--ink,--paperor--mutedare defined by many components in this catalogue with different values, and they will also collide with whatever your own project defines. Move them onto the component's wrapper (.my-section { --ink: … }) or keep the prefix. - **Rules on
*, *::before, *::after,html, body**: the demo owns the whole document, so these set the box model and resets. Dropped into an existing project they restyle the entire page, not just this section. Re-target them at the component's wrapper before using it.