
Speeding marquee
Scroll, Text, Hover
The “built for” section of the landing page of a workspace app, on warm white: under the headline One workspace, built for teams sits a row of cards for the different kinds of user, and passing over a card turns the last word of the headline into that card’s word, designers, agencies, students, founders: the old letters rise away getting lighter, the new ones come up from below from thin to full weight, in the card’s colour, while the card lifts, takes a tint and draws its icon.
A folder that runs on its own: index.html, style.css, script.js and the libraries from a CDN. The React and Vue tabs hold the same demo as a ready component, which switches its animations off when it leaves the page.
<!doctype html>
<!--
"Card-driven headline word" from Animorio · https://animorio.com
License: free on your own sites and your clients’ sites, paid work included.
Not for resale, redistribution, templates or code collections · https://animorio.com/en/license/
-->
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>The headline whose word changes as you pass over the cards</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<main class="stage" data-stage>
<!-- the "built for" section of a made-up workspace app: passing over a card changes the last word of the headline -->
<section class="sezione" data-sezione aria-label="Brightdesk">
<p class="occhiello" data-occhiello>
<svg class="occhiello__segno" viewBox="0 0 16 16" aria-hidden="true"><rect x="2.5" y="2.5" width="11" height="11" rx="3.2"></rect><path d="M5.5 8h5M8 5.5v5"></path></svg>
Brightdesk
</p>
<h1 class="titolo" data-titolo>
<span class="riga" data-riga>One workspace,</span>
<span class="riga" data-riga>built for <span class="parola" data-parola aria-live="polite"><span class="parola__dentro" data-dentro></span></span><span class="punto">.</span></span>
</h1>
<span class="titolo misura" data-misura aria-hidden="true"></span>
<ul class="card" data-cards>
<li class="c" data-card data-word="designers" data-color="#7c3aed" tabindex="0">
<svg class="c__icona" viewBox="0 0 24 24" aria-hidden="true"><path d="M4 20l3.2-.8L18.6 7.8a2 2 0 0 0-2.8-2.8L4.4 16.4z"></path><path d="M14.5 6.5l3 3"></path></svg>
<span class="c__nome">Design teams</span>
<span class="c__riga">Files, specs and reviews</span>
<svg class="c__freccia" viewBox="0 0 16 16" aria-hidden="true"><path d="M3.5 8h9M8.5 4l4 4-4 4"></path></svg>
</li>
<li class="c" data-card data-word="agencies" data-color="#ea580c" tabindex="0">
<svg class="c__icona" viewBox="0 0 24 24" aria-hidden="true"><rect x="3.5" y="7.5" width="17" height="12" rx="2.5"></rect><path d="M9 7.5V5.5a1.5 1.5 0 0 1 1.5-1.5h3A1.5 1.5 0 0 1 15 5.5v2"></path><path d="M3.5 12.5h17"></path></svg>
<span class="c__nome">Agencies</span>
<span class="c__riga">Every client, one board</span>
<svg class="c__freccia" viewBox="0 0 16 16" aria-hidden="true"><path d="M3.5 8h9M8.5 4l4 4-4 4"></path></svg>
</li>
<li class="c" data-card data-word="students" data-color="#0d9488" tabindex="0">
<svg class="c__icona" viewBox="0 0 24 24" aria-hidden="true"><path d="M2.5 9.5L12 5l9.5 4.5L12 14z"></path><path d="M6.5 11.5v4.5c0 1.2 2.5 2.5 5.5 2.5s5.5-1.3 5.5-2.5v-4.5"></path></svg>
<span class="c__nome">Students</span>
<span class="c__riga">Notes that stay together</span>
<svg class="c__freccia" viewBox="0 0 16 16" aria-hidden="true"><path d="M3.5 8h9M8.5 4l4 4-4 4"></path></svg>
</li>
<li class="c" data-card data-word="founders" data-color="#2563eb" tabindex="0">
<svg class="c__icona" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 3.5c3 2 4.5 5 4.5 9l-2 3h-5l-2-3c0-4 1.5-7 4.5-9z"></path><path d="M9.5 15.5l-2 4 3-1M14.5 15.5l2 4-3-1"></path><circle cx="12" cy="10" r="1.6"></circle></svg>
<span class="c__nome">Startups</span>
<span class="c__riga">Plans, docs and launches</span>
<svg class="c__freccia" viewBox="0 0 16 16" aria-hidden="true"><path d="M3.5 8h9M8.5 4l4 4-4 4"></path></svg>
</li>
</ul>
<p class="nota" data-nota>One price for the whole team. Free for students.</p>
</section>
<svg class="ghost" data-ghost viewBox="0 0 20 20" aria-hidden="true"><path d="M4 2.5v13.2l3.5-3.3 2.4 5.3 2.3-1-2.4-5.2 4.8-.2z"></path></svg>
</main>
<script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/gsap.min.js"></script>
<script src="script.js"></script>
</body>
</html>Change values, colours and text with the controls and watch the animation respond live. Or write in the code yourself. Then download the folder with your changes.
28 values to change
With the Animorio connector, Claude Code, ChatGPT, Cursor or VS Code take it from here, guide included, and fit it into your project. Paste this request:
Take “Card-driven headline word” from Animorio and fit it into my siteThe word is a span with overflow hidden holding one absolutely positioned span per letter: GSAP decides the width and the leaving letters vanish at its edge.
The old letters go to yPercent minus 112, fade and lose weight, LETTER_STAGGER seconds apart; the new ones start only once the last old letter is gone: never two words readable together.
Every letter has font-variation-settings with the weight in a CSS variable, --w; GSAP takes it from WEIGHT_FROM to WEIGHT_TO while the letter rises through the keyframes 112, minus 8, 2, 0: the word arrives thin and fills up as it settles.
The new word’s width is measured on a hidden twin of the headline, with the same typeface and the final weight; the word reaches it with back.out(SPRING), and the centred headline slides the rest of the line along.
Each card carries its word and colour in data-word and data-color; the script computes fill, border and glow (no color-mix, it does not survive the video), the card lifts LIFT pixels and its icon redraws itself with stroke-dashoffset.
| Name | File | Default | What it changes |
|---|---|---|---|
REST_WORD | script.js | 'teams' | The headline’s word when no card is chosen. |
REST_COLOR | script.js | '#141414' | The colour of the word at rest. |
LETTER_STAGGER | script.js | 0.026 | The seconds between one letter and the next as they roll. |
WEIGHT_FROM | script.js | 260 | The weight the new letters arrive with. |
WEIGHT_TO | script.js | 680 | The weight the letters settle at. |
SPRING | script.js | 1.6 | How much the word’s width bounces (0 means no bounce). |
LIFT | script.js | 5 | How many pixels the chosen card lifts. |
AUTO_PILOT | script.js | 1.4 | After how many seconds the drawn pointer starts (0 means never). |
For the section of a landing page that says who a product is for: an app, a piece of software, a service with different kinds of people (designers, agencies, students, founders). One headline that adapts to the card you pass over, instead of four blocks of text.
The same animation with adapted sizes: the cards go onto two rows of two, the headline is measured on the width and height of the screen and a tap on a card changes the word.
No rolling letters, no spring and the card does not lift: the word changes with a fade and takes its width at once, the card takes on its tint.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 5.9 KB; the libraries: GSAP 28 KB.
Tested on 28 October 2026
Use it in your own projects and in your clients’ projects. Do not resell it or redistribute it as is. GSAP stays under its own Standard license. Full license.
Support Animorio
Animorio stays free thanks to the people who support it. If you like, buy us a coffee: it helps us make the next animations.
You asked for
We made it for you: it’s in the library, with the preview, the Playground and the code to copy.
An animation you can’t find, or a site to take apart in the journal: tell us which. We pick the next ones from here.
With your account’s email and password.
or with your email
You’re signed in as .
With your account, you can download the zip of every animation and every pack, for free.