
Speeding marquee
Scroll, Text, Hover
A hover effect on a word, in the minimal style: every letter is a small window with two typefaces in it, a serif and a sans. Where the pointer touches it, the serif letter rolls up and out and the same letter without serifs rises from below, in orange, one pixel too far and back; the neighbours slide over a hair because the two shapes are not the same width. When the pointer moves on, a short mark on the baseline counts down a moment and the letter turns serif again: a quick pass leaves a trail of different letters that turn back in the order you touched them.
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>
<!--
"Typeface-shifting 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 word that changes typeface where you touch it</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/fraunces@5.3.0/full.css">
<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>
<!-- the word: every letter is a small window with the serif letter and the sans letter stacked in it.
Touched, the letter rolls up from one face to the other and rolls back a moment after the pointer leaves -->
<!-- the script adds the thin baseline rule inside it; the short accent marks on the rule count down the moment each
letter stays changed -->
<h1 class="parola" data-word aria-label="Regalia"></h1>
<p class="nota" data-note>Run the pointer over the letters</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.
14 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 “Typeface-shifting word” from Animorio and fit it into my siteEvery letter is a cell holding a window with hidden overflow and two copies of the letter, one in Fraunces and one in Mona Sans, stacked. GSAP moves them only with yPercent: 0 is in view, -101 is gone out of the top, 101 waits underneath.
Once the fonts are in, the width of both shapes of each letter is measured and divided by the type size. The cell takes its width from a CSS variable in em, which GSAP animates on a short elastic: so a resize has nothing to measure again.
On the way there the serif face leaves through the top and the sans rises from below; on the way back the sans leaves through the top and the serif rises from below. The letter never goes backwards: it looks like a drum always turning the same way.
The face that arrives stops 1.4 pixels high, worked out from the window’s height, and comes down with sine.inOut. The sans arrives 90 points heavier and lightens as it settles.
While the pointer is on the letter the count is stopped. When it leaves, a timeline grows the mark with back.out, shrinks it linearly for the waiting time and then turns the letter back: that is why a trail turns back in the order it was made.
| Name | File | Default | What it changes |
|---|---|---|---|
WORD | script.js | Regalia | The word. |
HOLD | script.js | 0.9 | How many seconds a letter stays changed after the pointer has left it. |
ROLL | script.js | 0.42 | How long the roll from one shape to the other takes, in seconds. |
SERIF_WEIGHT | script.js | 380 | The weight of the serif. |
SANS_WEIGHT | script.js | 540 | The weight of the sans. |
SANS_WIDTH | script.js | 86 | The width of the sans: 75 is condensed, 125 is wide. |
WAVE | script.js | true | A click sends the change through the whole word. |
SPEED | script.js | 1 | The speed of the invisible pointer when nobody touches the word. |
For the headline of a type foundry, a design studio, a magazine or a portfolio, where the word itself should show that type is something you can touch.
The same animation with adapted sizes: the word is as big as the box allows, in width and height, and the letters change under the finger sliding over them.
The letters do not roll: the two shapes cross-fade into each other and the mark underneath fades instead of shrinking.
GSAP 3.15.0, Fraunces (font variabile) 5.3.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 5.0 KB; the libraries: GSAP 28 KB.
Tested on 31 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.