
The elastic button
Buttons, Hover, Text
The API keys card of a developer platform, on white: the key hides behind a row of dots in a monospaced field. The eye button opens its lid and the key scrambles into random letters that settle from left to right; the copy button folds its sheets into a drawn check and sends «Copied» up. Regenerate asks for confirmation right in the row, then the old key is wiped in strips and the new one types itself character by character.
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 field" 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 key field to reveal and copy</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" data-stage>
<!-- the API keys card of a developer platform: a hidden key that reveals itself with a scramble settling left to right,
a copy button whose icon turns into a drawn check, and a regenerate action that asks first, wipes the old key in strips and types the new one -->
<section class="keys" data-card aria-label="Corriva API keys">
<header class="keys__head">
<svg class="keys__mark" viewBox="0 0 24 24" aria-hidden="true"><path d="M4 12a8 8 0 0 1 13.7-5.6"></path><path d="M20 12a8 8 0 0 1-13.7 5.6"></path><path d="M9 12h6"></path></svg>
<div>
<p class="keys__brand">Corriva <span>/ API keys</span></p>
<p class="keys__sub">Use this key to call the Corriva API from your server.</p>
</div>
</header>
<div class="keys__row">
<p class="keys__label" id="etichetta">Production key</p>
<p class="keys__scope">Full access</p>
</div>
<div class="field" data-field>
<code class="field__key" data-key aria-labelledby="etichetta" aria-live="polite"></code>
<div class="field__tools">
<button class="tool" type="button" data-eye aria-label="Reveal key" aria-pressed="false">
<svg class="tool__icon eye" viewBox="0 0 24 24" aria-hidden="true">
<g class="eye__open" data-eye-open>
<path d="M2.8 12c2.2-3.9 5.3-5.9 9.2-5.9s7 2 9.2 5.9c-2.2 3.9-5.3 5.9-9.2 5.9S5 15.9 2.8 12Z"></path>
<circle class="eye__pupil" data-pupil cx="12" cy="12" r="2.9"></circle>
</g>
<g class="eye__shut" data-eye-shut>
<path d="M3 11.2c2.3 2.5 5.3 3.8 9 3.8s6.7-1.3 9-3.8"></path>
<path d="M6.2 13.6 4.9 15.6M12 15v2.4M17.8 13.6l1.3 2"></path>
</g>
</svg>
</button>
<span class="tools__sep" aria-hidden="true"></span>
<button class="tool" type="button" data-copy aria-label="Copy key">
<svg class="tool__icon copy" viewBox="0 0 24 24" aria-hidden="true">
<g data-copy-sheets>
<rect x="8.5" y="8.5" width="11" height="11" rx="2.4"></rect>
<path d="M15.5 5.6V5.4c0-1.3-1-2.4-2.4-2.4H6.4C5 3 4 4 4 5.4v6.7c0 1.3 1 2.4 2.4 2.4h.2"></path>
</g>
<path class="copy__check" data-check d="M5.5 12.6 9.8 16.8 18.6 7.6"></path>
</svg>
<span class="tool__tip" data-tip>Copied</span>
</button>
</div>
</div>
<p class="keys__meta"><span data-created>Created Oct 12, 2026</span><span class="keys__gap" aria-hidden="true"></span><span data-used>Last used 2 min ago</span></p>
<div class="keys__foot" data-foot>
<div class="foot__idle" data-idle>
<p class="foot__note">Keep it secret. Rotate it if it leaks.</p>
<button class="ghostbtn" type="button" data-regen>
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M19.4 9.2A7.6 7.6 0 0 0 5.6 7.8L4.4 9.4"></path><path d="M4.2 4.8v4.8H9"></path><path d="M4.6 14.8a7.6 7.6 0 0 0 13.8 1.4l1.2-1.6"></path><path d="M19.8 19.2v-4.8H15"></path></svg>
<span>Regenerate</span>
</button>
</div>
<div class="foot__ask" data-ask aria-hidden="true">
<p class="foot__warn">The old key will stop working.</p>
<div class="foot__btns">
<button class="ghostbtn ghostbtn--plain" type="button" data-cancel tabindex="-1">Cancel</button>
<button class="solidbtn" type="button" data-confirm tabindex="-1">Regenerate key</button>
</div>
</div>
</div>
</section>
<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.
26 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 field” from Animorio and fit it into my siteThe key is a code element in a monospaced face with a 1ch-wide span for each character: the dot, the random letter and the real letter always take the same place, so the row never shifts sideways while it changes.
A GSAP tween runs a clock from zero to the chosen duration; on every frame each character checks two thresholds, when to start scrambling and when to stop, growing from left to right. Between the two it takes a random letter every other frame, after the second it takes its own and hops three pixels with back.out.
The open eye is an SVG group squashed to 0.12 in height: opening brings it back to 1 with back.out while the pupil grows a moment later and the lashes fade upwards. The copy check is a stroke with a strokeDasharray that draws itself after the sheets have shrunk and gone.
Regenerate swaps the footer row for the confirmation row, which sits on top of it in absolute position: one rises and fades, the other comes up from below on a spring. On confirming, the old key splits into strips of six characters that squash one after another, then the new one is born with the same prefix and types itself with a 26 millisecond stagger.
A timeline with repeatRefresh takes the drawn pointer to the buttons reading their real position every time, turns on their hover state, presses them and calls the same functions as real clicks. At the first real touch it stops, and it starts again from the top after eight quiet seconds.
| Name | File | Default | What it changes |
|---|---|---|---|
KEY | script.js | crv_live_7Hq2mXk9TzR4vLp8Nw | The key the field hides and reveals. |
ACCENT | script.js | #5b5bd6 | The colour of the scrambling letters and of the new key’s border. |
SCRAMBLE_TIME | script.js | 0.9 | The seconds the key scrambles before it settles. |
WIPE_TIME | script.js | 0.6 | The seconds the old key takes to wipe in strips. |
PAUSE | script.js | 1 | The seconds the autopilot waits between one gesture and the next. |
For the settings of a developer platform or an AI app, a service’s tokens panel, a dashboard’s integrations page, any secret to show once and copy.
The card takes the full width minus the margins, the key drops to 10.5 pixels with 3.1vw and the buttons stay at 34 pixels, easy for a finger; under 380 pixels the footer text tightens a little so the warning and the buttons fit on one line. A tap does what a click does.
No scramble and no hops: the key goes from dots to letters with a fade, the eye opens only in light, the check appears without drawing, the wipe and the new key are fades and the drawn pointer stays hidden.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 7.3 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.