
The elastic button
Buttons, Hover, Text
The Eject button of an external drive, with the drive plugged into its port on the right edge. On tap the triangle hops, an orange ring fills around the icon while the last writes finish and a light runs along the drive’s bar; then the icon turns into a green tick, the button kicks and the drive springs out of the port: “Safe to remove”. One more tap plugs it back 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>
<!--
"Eject button" 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>Eject button</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 Eject button of an external drive: it lets the last writes finish with a ring around the icon,
then pushes the drive out of its port and says it is safe to remove. One more tap plugs it back in -->
<div class="ej" data-ej>
<button class="ej__btn" type="button" data-btn data-state="idle" aria-label="Eject Atlas SSD">
<span class="ej__ico" aria-hidden="true">
<svg class="ej__ring" viewBox="0 0 48 48"><circle data-ring cx="24" cy="24" r="22.5" pathLength="1"></circle></svg>
<svg class="ej__glyph" data-glyph viewBox="0 0 24 24"><path data-tri d="M12 5.800 18.200 13.400H5.800Z"></path><rect x="5.800" y="16.100" width="12.400" height="2.500" rx="1.250"></rect></svg>
<svg class="ej__check" viewBox="0 0 24 24"><path data-check d="M6.500 12.600l3.700 3.700 7.300-8" pathLength="1"></path></svg>
</span>
<span class="ej__text">
<span class="ej__label"><span data-label>Eject Atlas SSD</span></span>
<span class="ej__sub" data-outsub>1.2 TB free of 2 TB</span>
</span>
</button>
<span class="ej__drive" data-drive aria-hidden="true">
<span class="ej__plug"></span>
<span class="ej__body">
<b>ATLAS</b>
<i data-bar></i>
</span>
</span>
</div>
<span class="live" aria-live="polite" data-live></span>
<svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.200 19.200 11l-6.300 1.600-3.300 5.900Z"></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.
14 values to change
Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI
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 “Eject button” from Animorio and fit it into my siteConnected, writing, ejected: the state is written in an attribute of the button, from which CSS takes the colours. While writing, taps do nothing and the button carries aria-busy.
A circle with pathLength 1 around the icon: GSAP takes its stroke-dashoffset from 1 to 0 over the WRITE time. Halfway the line below goes from two files to one; at the end the ejection starts.
The drive sits behind the button, its plug hidden under the edge. To eject it GSAP moves it by PUSH pixels on an elastic spring and turns it three degrees; the button recoils slightly the other way.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #1f9d61 | The colour of the button when the drive is safe to remove. |
WRITE | script.js | 1.8 | How many seconds the last writes take before ejecting. |
PUSH | script.js | 26 | How many pixels the drive comes out of its port. |
In the devices panel of a backup app, a file manager or a NAS, next to each connected drive; and wherever an action first has to wait for something to finish: disconnecting a device, closing a session, shutting a server down.
The same button, 64 pixels tall: with the drive it is about 290 pixels wide and fits a 320 screen too. The whole pill is tappable; the drive is only to look at.
No hops or springs: on tap labels and colours change, the ring shows half full and, once the wait is over, the icon is already the tick and the drive already out of the port. The light on the drive’s bar stays still. The demo’s pointer does not start.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 5.7 KB; the libraries: GSAP 28 KB.
Tested on 26 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.
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.