
Speeding marquee
Scroll, Text, Hover
The secret key card in the dashboard of a developer app, dark and product grade: pressing ‘Rotate key’ the characters after the prefix roll one after the other in a wave, like small counters, and land on the new key, blue for a moment, while a light runs under them and the line below says ‘Rotated just now’. Under the pointer the characters rise; the copy button turns its icon into a tick.
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>
<!--
"API key rotation" 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 API secret key that rotates with characters rolling in a wave</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 secret key card of a developer dashboard: pressed Rotate key, the characters after the prefix roll one
after the other in a wave, like small counters, and land on the new key while a light runs under them and
the line below says it was rotated just now; under the pointer the characters rise; the copy button turns
its icon into a tick -->
<article class="card" data-card aria-label="Secret key, production">
<header class="head">
<span class="head__icon" aria-hidden="true"><svg viewBox="0 0 20 20"><circle cx="7" cy="13" r="3.4"></circle><path d="M9.5 10.5 16 4M13 7l2.2 2.2M11 9l1.6 1.6"></path></svg></span>
<h1>Secret key</h1>
<span class="head__env">Production</span>
</header>
<div class="well" data-well>
<code class="key" data-key aria-label="Secret key"></code>
<span class="well__light" data-light aria-hidden="true"></span>
<button class="copy" type="button" data-copy aria-label="Copy the key">
<svg viewBox="0 0 20 20" aria-hidden="true">
<g data-copy-icon><rect x="7" y="7" width="9" height="9" rx="2.4"></rect><path d="M12.6 4H6.4A2.4 2.4 0 0 0 4 6.4v6.2"></path></g>
<path class="copy__tick" data-copy-tick pathLength="1" d="M5 10.6 8.6 14.2 15.4 6.4"></path>
</svg>
<span class="copy__tip" data-copy-tip aria-hidden="true">Copied</span>
</button>
</div>
<footer class="foot">
<span class="foot__when"><span class="foot__roll"><span data-when>Created 14 March</span></span></span>
<button class="rotate" type="button" data-rotate>
<svg viewBox="0 0 20 20" aria-hidden="true" data-rotate-icon><path d="M15.6 8.2A6 6 0 0 0 4.9 6.6M4.4 11.8a6 6 0 0 0 10.7 1.6"></path><path d="M4.6 3.4v3.4H8M15.4 16.6v-3.4H12"></path></svg>
Rotate key
</button>
</footer>
</article>
<p class="sr" data-live aria-live="polite"></p>
<svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.2 19.2 11l-6.3 1.6-3.3 5.9Z"></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.
19 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 “API key rotation” from Animorio and fit it into my siteEach character is made of three spans: the outer one, 0.64 em wide, rises under the pointer; the middle one clips; the inner one is the only one GSAP moves. So the rise and the roll never fight over the same transform.
For each character a series of FLIPS rolls: it leaves upwards in 75 milliseconds, changes letter and comes back from below. The last roll brings the real character and lands with back.out. Each character starts WAVE seconds after the one before: that is the wave.
While it rolls, the character is in the accent colour; once still a tween takes it back to light in 0.9 seconds and removes the inline colour. The light below is a radial glow crossing the well in the same time as the wave.
The keys come from a generator with a fixed seed and an alphabet without look-alike characters (0 and O, 1 and l): they are the same at every visit, and none is a real key.
Every frame, for each cell the horizontal distance from the pointer is measured: within a little over three cells the wanted value is (1 minus distance) squared, and the cell chases it by 22% a frame. The transform is rewritten only if it changes.
The button writes the key to the clipboard where the browser allows it; the sheets icon shrinks, the tick draws itself with stroke-dashoffset and the ‘Copied’ tag comes in from the right with back.out, then everything goes back.
| Name | File | Default | What it changes |
|---|---|---|---|
PREFIX | script.js | sk_live_ | The part of the key that never changes. |
LENGTH | script.js | 20 | How many characters change at each rotation. |
ACCENT | script.js | #5b8cff | The colour of the characters that just landed and of the light. |
WAVE | script.js | 0.045 | How many seconds between one character and the next. |
FLIPS | script.js | 4 | How many times each character rolls before it stops. |
LIFT | script.js | 5 | By how many pixels the characters rise under the pointer. |
LOOP | script.js | true | Left alone, a pointer rotates it and copies it. |
For the keys page in the settings of a developer app or a service with an API: the moment the old key is replaced can be seen, and is not mistaken for a plain page refresh. The same roll works for a recovery code, a discount code or a generated password.
The same animation with adapted sizes: the characters shrink with the screen width so the key stays on one line, and well and buttons also follow the window’s height. Dragging a finger along the key the characters rise.
No rolling and no rising: the old key fades and the new one appears in its place, the line below changes in place and the copy tick appears without drawing.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 6.9 KB; the libraries: GSAP 28 KB.
Tested on 14 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.