
The elastic button
Buttons, Hover, Text
The Start wash button of a made-up smart washing machine app, in a premium style on white: the dark pill holds a small porthole with a steel ring and a reflection on the glass; pressed, the water rises with a wave, the drum starts turning faster and faster and the pill widens onto Cotton 40° · 1:28 with the time on rolling digits. A second tap, or holding it, pauses: the drum slows down and the water settles with a sway. At the end Done draws its check and the porthole empties.
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>
<!--
"Start wash 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>The Start wash button with the water turning in the porthole</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 Start wash button of a made-up smart washing machine app: pressed, water rises in the little porthole with
a wave, the drum starts turning faster and faster and the pill widens to show the programme and the time left
with rolling digits; pressed again (or held) it pauses, the drum slows down and the water settles; at the end
Done draws its check and the porthole empties -->
<div class="wrap" data-wrap>
<span class="floor" aria-hidden="true"></span>
<button class="pill" type="button" data-pill data-autoclic aria-label="Start wash, Cotton 40 degrees, 1 hour 28 minutes">
<span class="pill__body" aria-hidden="true">
<span class="pill__grain"></span>
<span class="pill__glow" data-glow></span>
</span>
<!-- the porthole: the drum and the water on a canvas, the steel ring and the reflection on the glass in SVG -->
<span class="port" data-port aria-hidden="true">
<canvas class="port__inside" data-canvas width="132" height="132"></canvas>
<svg class="port__ring" viewBox="0 0 44 44">
<defs>
<linearGradient id="steel" x1="0" y1="0" x2="1" y2="1">
<stop offset="0" stop-color="#f6f8fb"/>
<stop offset=".28" stop-color="#9aa3ae"/>
<stop offset=".5" stop-color="#e3e7ec"/>
<stop offset=".74" stop-color="#6d7681"/>
<stop offset="1" stop-color="#c9ced5"/>
</linearGradient>
<linearGradient id="glare" x1="0" y1="0" x2="0" y2="1">
<stop offset="0" stop-color="#ffffff" stop-opacity=".75"/>
<stop offset="1" stop-color="#ffffff" stop-opacity="0"/>
</linearGradient>
</defs>
<circle class="ring__track" cx="22" cy="22" r="20.6"/>
<circle class="ring__progress" data-progress cx="22" cy="22" r="20.6"/>
<circle class="ring__steel" cx="22" cy="22" r="17.4" stroke="url(#steel)"/>
<circle class="ring__seal" cx="22" cy="22" r="15.5"/>
<path class="ring__glare" d="M10.6 17.4a12.4 12.4 0 0 1 13.8-8.2" stroke="url(#glare)"/>
<path class="ring__glint" d="M27.6 30.8a10.4 10.4 0 0 0 3.6-3.4"/>
</svg>
</span>
<span class="face face--start" data-start>
<span class="face__word" data-word>Start wash</span>
</span>
<span class="face face--run" data-run>
<span class="run__text">
<span class="run__line">
<span class="run__prog" data-prog>Cotton 40°</span>
<span class="run__sep">·</span>
<span class="time" data-time></span>
</span>
<span class="run__sub"><span class="run__subin" data-sub>Washing</span></span>
</span>
<span class="ctrl" data-ctrl>
<svg viewBox="0 0 24 24"><path data-bar1 d="M8.6 7 L11.2 7 L11.2 17 L8.6 17 Z"/><path data-bar2 d="M12.8 7 L15.4 7 L15.4 17 L12.8 17 Z"/></svg>
</span>
</span>
<span class="face face--done" data-done>
<svg class="done__ic" viewBox="0 0 24 24"><path data-check d="M6.4 12.6 10.2 16.2 17.6 8.4"/></svg>
<span class="done__word">Done</span>
</span>
<span class="pill__edge" aria-hidden="true"></span>
</button>
<p class="sr" data-live aria-live="polite"></p>
</div>
<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.
21 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 “Start wash button” from Animorio and fit it into my siteInside, a 44 pixel canvas (drawn at three or four times the density) redraws the glass every frame, the drum's holes and lifters turned by an angle, and the water. On top, an SVG with the steel ring (a five stop linear gradient on the stroke), the seal, the progress arc and the reflections on the glass, which stay still while the drum turns.
An object with level, turns per second, wave amplitude, sway and slosh is animated by GSAP; the canvas reads it and draws the surface as a tilted line plus two sines. The tilt goes against the turns, so the drum drags the water; on pause a damped slosh makes it rock until it settles.
The turns rise with power2.in over ACCEL seconds and fall with power3.out: the angle is added up every frame (step capped at 1/30 of a second), so the rotation never jumps, even when the speed changes halfway.
Each digit is a strip running from the highest down to 0 and repeating the highest at the end: going from 0 to 9 the strip moves one more place and then snaps back to the top unseen. The tens of the minutes have their own strip up to 5.
Start wash, the programme with the time and Done are absolutely positioned next to the porthole; GSAP only changes the pill's width, measured on the real words and again on resize. The two pause bars become the play triangle with a tween of the d attribute, four points against four points.
| Name | File | Default | What it changes |
|---|---|---|---|
LABEL | script.js | Start wash | The label of the button at rest. |
PROGRAM | script.js | Cotton 40° | The programme written when the pill widens. |
MINUTES | script.js | 88 | The minutes of the wash, written as hours and minutes (88 makes 1:28). |
WATER | script.js | #4fb6ff | The colour of the water, the progress arc and the check. |
SPIN | script.js | 1.2 | How many turns per second the drum makes while washing. |
ACCEL | script.js | 2.2 | How many seconds the drum takes to reach its speed. |
FILL | script.js | 0.52 | How high the water rises in the porthole, from 0 to 1. |
TICK | script.js | 0.7 | Every how many seconds one minute goes down, in the demo. |
RUN_TICKS | script.js | 7 | After how many minutes the time races to the end, to reach Done. |
In the app of a connected washing machine or dryer, in a smart home panel, on the site of a self service launderette or a laundry pickup service, and in any app where a button starts a long job with a countdown that can be paused.
The open pill is just over 260 pixels wide and fits comfortably at 320; a finger presses like the mouse and holding it pauses. Without hover the edge light stays still over the porthole and the water does not rock before the tap.
The drum stays still and the water does not wave: the level changes in a moment, the faces swap with a fade, the digits change without rolling, pause turns into play without morphing and Done arrives already drawn.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 10 KB; the libraries: GSAP 28 KB.
Tested on 13 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.