
Speeding marquee
Scroll, Text, Hover
The opening of a made-up app that plans your week, on near black and in the style of product pieces: the headline arrives with its words in the wrong order, thin and grey, and sorts itself out, two words at a time. The right word hops over the row in a small arc, the other one dips and gives way; every word that finds its place gains weight and light. The last one turns lavender and pink, then the subtitle and the two buttons come in.
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>
<!--
"Self-sorting 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 whose words sort themselves into order</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 planning app: the headline arrives with its words in the wrong order and sorts itself,
two words at a time, then the subtitle and the two buttons come in -->
<section class="hero" aria-label="Plotwell">
<a class="pill" href="#" data-pill>
<span class="pill__tag">New</span>
<span class="pill__text">Auto-scheduling is here</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 aria-label="Your week, planned in seconds."></h1>
<p class="sub" data-sub>Plotwell reads your tasks, your meetings and your energy, and lays out the week before you have finished your coffee.</p>
<div class="actions" data-actions>
<a class="btn btn--primary" href="#" data-btn>
<span class="btn__shine" aria-hidden="true"></span>
<span class="btn__label">Plan my week</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.
20 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 “Self-sorting headline” from Animorio and fit it into my siteAt every swap the script measures all the words, changes the order in the DOM and measures again: each word starts where it was (x and y equal to the difference) and goes to zero with back.out. Words that wrap to the next line or come back up move smoothly too, with no position computed by hand.
The headline sorts itself like a selection sort: for each slot, from the left, the right word swaps with the one sitting there. With the starting order 4,2,0,3,1 it takes three swaps; words already in place only settle.
The outer span is moved by the FLIP, the inner one does the arc (a quarter em up and back with back.out), the weight with Mona Sans’s wght axis, the colour and the one-pixel settle. That way the transforms do not erase each other.
The last word has a 220% wide gradient clipped to the text: when it reaches its place the text colour turns transparent and the background position slides from 0 to 100%, so the white gives way to lavender and pink.
| Name | File | Default | What it changes |
|---|---|---|---|
HEADLINE | script.js | 'Your week, planned in seconds.' | The headline in the right order; the last word gets the colour. |
SCRAMBLE | script.js | '4,2,0,3,1' | The wrong order it arrives in: the positions of the words, counted from zero. |
SWAP_TIME | script.js | 0.62 | The seconds of each swap between two words. |
SWAP_GAP | script.js | 0.18 | The pause between one swap and the next. |
LIFT | script.js | 0.26 | How far the word passing over lifts, in em. |
WEIGHT_OFF | script.js | 380 | The weight of the words out of place. |
WEIGHT_ON | script.js | 680 | The weight of the words in place. |
HOLD | script.js | 3.6 | The seconds the headline stays sorted before starting again. |
For the opening of an app or a product that brings order: a planner, a task manager, an assistant that sorts mail or files. The headline tells on its own what the product does.
The same animation: the headline runs over two or three lines and swaps also cross from one line to another, with the same arc; the subtitle and buttons stay inside the box.
No swaps or arcs: the headline appears already in order, at full weight with the last word coloured, and everything fades in.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 5.1 KB; the libraries: GSAP 28 KB.
Tested on 26 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.