
Long shadow letters
Text, Scroll, 3D
The hero of a design to code handoff tool, on white: the big headline ends with a word inside a tinted pill that rolls into the next one every two seconds, letter by letter, the old letters leaving at the top and the new ones climbing in from below, while the pill stretches or shrinks on a spring and slightly changes colour. Below, the subtitle and the two buttons.
A folder that runs on its own: index.html, style.css, script.js and the libraries from a CDN.
<!doctype html>
<!--
"Rotating word headline" 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 with a rotating word</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">
<!-- the hero of a made-up design handoff tool: the headline ends with a word in a tinted pill that rolls to the
next one every two seconds, the pill stretching to fit it while the rest of the line makes room -->
<section class="hero" data-hero aria-label="Handwell">
<a class="pill" href="#" data-pill>
<span class="pill__tag">Handwell 3</span>
<span class="pill__text">Handoff, rebuilt</span>
<svg class="pill__arrow" viewBox="0 0 16 16" aria-hidden="true"><path d="M5.5 3.5 10 8l-4.5 4.5"></path></svg>
</a>
<h1 class="title" data-title>
<span class="title__line" data-line>Ship faster</span>
<span class="title__line" data-line>with your <span class="rotor" data-rotor tabindex="0" aria-live="polite"><span class="rotor__track" data-track></span><span class="rotor__time" data-time aria-hidden="true"></span></span></span>
</h1>
<span class="misura title" data-measure aria-hidden="true"></span>
<p class="sub" data-sub>Handwell turns every design into specs, tokens and code your whole team can build from, the same afternoon.</p>
<div class="actions" data-actions>
<a class="btn btn--primary" href="#" data-btn>
<span class="btn__label">Try it free</span>
<svg class="btn__arrow" viewBox="0 0 16 16" aria-hidden="true"><path d="M3 8h9.5M8.5 4 12.5 8l-4 4"></path></svg>
</a>
<a class="btn btn--ghost" href="#" data-btn>
<span class="btn__label">See how it works</span>
</a>
</div>
</section>
</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.
17 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 “Rotating word headline” from Animorio and fit it into my siteEach word is a span with one span per letter, positioned absolutely inside the pill: this way the old and the new can share the space for a few tenths of a second, one leaving and one arriving, without pushing each other.
The old letters go to yPercent minus 115 with power3.in, LETTER_STAGGER seconds apart; the new ones start from 115 and reach 0 with the keyframes 115, minus 9, 2.5, 0 in 0.62 seconds with power3.out. The step to minus 9 is the extra pixel that makes them feel sprung. The pill has overflow hidden: the letters vanish at its edge.
The new word’s width is measured on a hidden twin of the headline, with the same typeface and size, plus 0.44 em of padding. GSAP takes the pill to that width with back.out(SPRING): the headline is centred, so the rest of the line slides by itself to make room.
For each word the script computes from its colour the fill at 10% and the edge at 24% and writes them into three CSS variables; the pill has a 0.6 second transition on fill and colour, and the glow behind the headline uses the same variable.
The change is made by a gsap.delayedCall of INTERVAL seconds, not a timeline: with the mouse over the pill the countdown and the filling line pause, and a click moves straight to the next word. After the last word the hero leaves and comes back from the start.
| Name | File | Default | What it changes |
|---|---|---|---|
WORDS | script.js | 'designers|engineers|founders|whole team' | The words that take turns in the pill, separated by a vertical bar. |
COLORS | script.js | '#6d28d9|#4f46e5|#0369a1|#0f766e' | The pill’s colour for each word, in the same order. |
INTERVAL | script.js | 2 | The seconds between one word and the next. |
LETTER_STAGGER | script.js | 0.032 | The seconds between one letter and the next as they roll. |
SPRING | script.js | 1.7 | How much the pill bounces as it stretches or shrinks (0 means no bounce). |
HOLD | script.js | 1.6 | The extra seconds on the last word before the hero starts over. |
For the opening of the landing page of a piece of software, an app or a service that speaks to different people: one sentence that adapts to whoever reads it (designers, engineers, founders, the whole team) without writing four headlines. It also suits the header of a pricing page or an announcement.
The same animation with adapted sizes: the headline is measured on the width and height of the screen and stays on two lines, the pill is measured again for every word and the buttons wrap if needed. A tap on the pill moves to the next word.
No rolling letters, no spring and no rising: the words take turns with a cross-fade, the pill takes the new width at once and the colour changes gently; the hero fades in.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 5.6 KB; the libraries: GSAP 28 KB.
Tested on 25 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.