Skip to content
motionprompts motionprompts

Outline Marquee Scroll Push

GSAP animation component · Published 2026-11-21 · by vanguardia.dev

Open live demo ↗ Raw prompt (.md)

What it does

Giant outline-only text ribbon (text-stroke, transparent fill) that loops on its own over time with a seamless -50% xPercent tween and is pushed further left by scroll through a separate scrubbed x tween, so both motions add up. The stage is sticky inside a tall corridor so the push is visible while scrolling.

How it's built

Categoryscroll
Techgsap
GSAP pluginsScrollTrigger
Complexitysection
Performance costlight
Mobile-safeyes

marquee outline text-stroke loop scrub sticky scrolltrigger typography

Rebuild it with AI

To reproduce this animation in your own project, copy the prompt below into Claude Code, Cursor or any AI coding agent. The prompt is validated, it describes the exact structure, timing and easing, so the agent rebuilds the effect faithfully and you can then adapt colors, copy and layout to your design.

The full prompt

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. Each span has padding-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

  • xPercent and x are separate transform components in GSAP, so one tween can loop forever while another is scrubbed by scroll on the same element. Putting both on x would 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, --paper or --muted are 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.

New components in your inbox

One email a week, only when new components ship, each with its live demo and prompt.