
Speeding marquee
Scroll, Text, Hover
A minimal text animation: the same six words, read six ways. A sentence sits on warm white, all of it said softly, light, narrow and grey; a thin cobalt stroke, the stress mark of a dictionary, hops from word to word, and where it lands that word takes the stress: it grows heavy and wide on the two axes of the variable typeface, on a spring that passes the mark by a hair and settles. Underneath, a line says what it means now. Pick the word with the pointer or a finger.
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>
<!--
"Shifting stress" 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 sentence that shifts its stress</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="scena" data-stage>
<div class="palco" data-palco>
<!-- one sentence on two lines: the script splits it into words, and the stressed one takes weight and width -->
<p class="frase" data-sentence></p>
<!-- the stress mark, a thin slanted stroke that hops from word to word -->
<span class="segno" data-mark aria-hidden="true"><span class="segno-tratto" data-mark-stroke></span></span>
<!-- what the sentence means with the stress where it is now -->
<p class="glossa" data-gloss aria-live="polite"></p>
</div>
<p class="nota" data-note>Hover a word to move the stress</p>
</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.
16 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 “Shifting stress” from Animorio and fit it into my siteEvery word has one number, its stress, from 0 to 1. Every frame it becomes font-variation-settings with wght from 300 to 820 and wdth from 86 to 118, and a colour from grey to black mixed by hand. The line is centred: when a word widens, the others move by themselves to make room.
Each word’s stress chases its target on a spring (stiffness 240, damping from 31 to 11 depending on BOUNCE): below critical damping it passes the mark by a hair and comes back. When the mark lands, the nearby words get a push backwards that fades with distance.
The mark flies on a number p from 0 to 1 animated by GSAP; the start and the end are read again every frame with getBoundingClientRect, because the words move while their weight changes. The arc is a sine as high as the distance, the lean follows the direction.
Before the hop the stroke squashes to 0.78 and stretches to 1.12; on arrival it squashes to 0.66, widening, and comes back with elastic.out. The word that receives it drops a pixel and a half and comes back up.
The walk on its own is a gsap.delayedCall that moves on to the next word; with the pointer over a word the walk stops, and it starts again a second and a half after the pointer has left the sentence. On a phone you pick by tapping.
| Name | File | Default | What it changes |
|---|---|---|---|
SENTENCE | script.js | I never said / you were wrong. | The sentence: the slash breaks the line. |
LIGHT_WEIGHT | script.js | 300 | The weight of the words said softly. |
STRESS_WEIGHT | script.js | 820 | The weight of the stressed word. |
LIGHT_WIDTH | script.js | 86 | The width of the soft words, from 75 to 125. |
STRESS_WIDTH | script.js | 118 | The width of the stressed word, from 75 to 125. |
BOUNCE | script.js | 0.5 | How far the stress passes the mark before it settles. |
HOLD | script.js | 2.1 | How many seconds the stress stays on each word. |
SPEED | script.js | 1 | 2 = twice as fast, 0.5 = half as fast. |
LOOP | script.js | true | Walk through the sentence again and again. |
For the page of an acting or diction school, a podcast, a dubbing or copywriting studio, for a quote in a blog or a portfolio that should make you think about how things are said.
The same animation with adapted sizes: the sentence is as big as the box allows, in width and height, and you pick the word with a finger.
No hops and no springs: the mark fades out and back in on the new word, the word takes the stress already in place and the line underneath changes in a fade.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 5.8 KB; the libraries: GSAP 28 KB.
Tested on 1 November 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.