Skip to content
motionprompts motionprompts

Rolling Name Ticker

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

Open live demo ↗ Raw prompt (.md)

What it does

"Free for" headline followed by a column of outline names behind a top and bottom fade mask: every ~2 seconds the column rolls up one name and the name level with the headline fills with the accent colour. The column is positioned by measuring the headline's right edge, and the duplicated list loops without a seam.

How it's built

Categorytext
Techgsap
Complexitysection
Performance costlight
Mobile-safeyes

ticker names outline text-stroke mask loop rotating-words 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

Rolling Name Ticker: Masked Outline Name Column That Rolls Into Line With a Headline

Goal

Build one full-viewport black section with a headline "Free for" on the left, vertically centred, and right after it a column of names in outline type (transparent fill, thin stroke) that is faded out at the top and bottom by a CSS mask. Every ~2 seconds the column rolls up by one name with an ease-in-out, and the name that lands level with the headline fills with the accent colour (and goes bold), so the sentence reads "Free for Lucía", then "Free for Mateo", and so on. The column is placed by measuring the right edge of the headline in JS, so it stays glued to it whatever the font or the screen width. The list is duplicated so the loop never shows a seam or a pause. GSAP only for the roll; the fill is a CSS transition.

Tech

Vanilla HTML/CSS/JS with ES module imports. gsap (npm), no plugins. Font: Funnel Display (400 for the headline, 300 for the outline names, 700 for the active one).

Layout / HTML

<div class="rn">
  <section class="rn-stage">
    <h2 class="rn-title"><span class="rn-lead">Free for</span> <span class="rn-sr" data-rn-current>Lucía</span></h2>
    <div class="rn-names" aria-hidden="true">
      <ul>
        <li>Valeria</li><li>Bruno</li><li>Lucía</li><li>Mateo</li><li>Daniela</li><li>Hugo</li>
        <li>Valeria</li><li>Bruno</li><li>Lucía</li><li>Mateo</li><li>Daniela</li><li>Hugo</li>
      </ul>
    </div>
  </section>
</div>

The visible column is decorative (aria-hidden); the visually hidden .rn-sr span inside the heading carries the current name for screen readers. The list is the six names twice.

Styling

:root: --rn-bg:#050608, --rn-ink:#fff, --rn-stroke:rgba(255,255,255,.55), --rn-stroke-alt:rgba(164,169,180,.7), --rn-accent:#3d7bff, --rn-size:clamp(2.25rem,6.7vw,6rem).

  • .rn: background:var(--rn-bg); color:var(--rn-ink); font-family:"Funnel Display".
  • .rn-stage: position:relative; height:100svh; min-height:520px; overflow:hidden.
  • .rn-title: position:absolute; left:clamp(1.25rem,3vw,2.5rem); top:50%; transform:translateY(-50%); margin:0; font-weight:400; font-size:var(--rn-size); line-height:1; letter-spacing:-.035em; white-space:nowrap.
  • .rn-sr: standard visually hidden (position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0)).
  • .rn-names: position:absolute; left:50% (overwritten by JS); top:0; bottom:0; right:0; mask linear-gradient(180deg, transparent 0%, #000 30%, #000 70%, transparent 100%) (plus -webkit-mask-image).
  • .rn-names ul: position:absolute; left:0; top:50%; margin:0; padding:0; list-style:none (its top edge sits on the headline's centre line; JS moves it up from there).
  • li: height:.98em; display:flex; align-items:center; font-weight:300; font-size:var(--rn-size); letter-spacing:-.035em; white-space:nowrap; color:transparent; -webkit-text-stroke:1px var(--rn-stroke); transition:color .35s cubic-bezier(.2,.7,.1,1), -webkit-text-stroke-color .35s. li:nth-child(3n+1) uses --rn-stroke-alt for a little tonal variety.
  • li.is-current: color:var(--rn-accent); -webkit-text-stroke-color:var(--rn-accent); font-weight:700.

GSAP effect (be exact)

Build in mount(config) → destroy().

const DEFAULTS = { interval: 1.9, duration: .7, gap: .26, first: 2 };

Placing the column: place(): r = lead.getBoundingClientRect(), s = stage.getBoundingClientRect(), fs = parseFloat(getComputedStyle(lead).fontSize); col.style.left = (r.right - s.left + fs * gap) + "px". Run it at mount, on resize and again after document.fonts.ready (the headline's width changes when the web font arrives).

Showing name n: show(n, instant):

  • toggle .is-current so only lis[n] has it, and write its text into .rn-sr;
  • gsap.to(ul, { y: () => -(n + .5) * rowHeight(), duration: instant ? 0 : .7, ease: "power3.inOut", overwrite: true }), where rowHeight() is lis[0].getBoundingClientRect().height. The + .5 centres the row on the headline's centre line.
  • When instant, set transition:none on the items before toggling the class, force a reflow, then clear it, so the jump does not fade.

Loop: start with i = first (show(2, true)). Every interval seconds (skip if document.hidden): i++; if i >= first + half + 1 (here 9, where half = lis.length / 2), jump instantly to the identical twin in the first half (i = first; show(i, true); i++), then show(i). The active name therefore always animates, and the jump happens between two identical frames.

If prefers-reduced-motion: reduce matches, show the first name and do not start the interval.

destroy(): clear the interval, remove the resize listener, kill tweens on the list, clearProps:"all" on it, reset col.style.left and remove .is-current.

Assets / images

None.

Behavior notes

  • Rows are sized in em of the same --rn-size as the headline, so the active name always lines up with it; changing the size only needs the variable.
  • The headline is measured, not given a fixed width: swap "Free for" for any phrase and the column follows.
  • Duplicating the list is what makes the loop seamless; with fewer than two names visible above and below the centre the mask edge shows empty space, so keep at least six names.
  • 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: --rn-bg, --rn-ink, --rn-stroke, --rn-stroke-alt, --rn-accent, --rn-size. 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.