
The inchworm menu
Menus, Hover, Transitions
The Buy now button of a made-up homeware shop, Mareld, under the card of a linen throw. One tap: the dark pill opens on a spring into a small sheet, with the saved address, the saved card and the total coming in row by row, and a warm ring that counts three seconds before the order goes. Undo in those three seconds winds the ring back, says nothing was charged and closes the sheet. If the ring closes it turns into a green tick, the status rolls to the order number, a light crosses the sheet and the product card gets its Ordered badge.
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>
<!--
"Buy now with undo 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 Buy now button with one tap and three seconds to undo</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/geist@5.3.0/index.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<main class="stage">
<!-- the Buy now button of a made-up homeware shop, Mareld: one tap opens the pill into a small sheet with the saved
address, the saved card and the total, and a ring counts three seconds before the order goes; Undo stops it.
When the ring closes it becomes a tick and the order number rolls in. -->
<div class="wrap" data-wrap>
<!-- the product the button buys: a quiet card, the swatch drawn in CSS -->
<article class="product" data-product>
<div class="product__swatch" aria-hidden="true"><span class="product__fold"></span></div>
<div class="product__text">
<span class="product__brand">Mareld</span>
<b class="product__name">Linen throw, Oat</b>
<span class="product__meta">130 x 180 cm · in stock</span>
</div>
<span class="product__price" data-price>€64</span>
<span class="product__badge" data-badge aria-hidden="true">
<svg viewBox="0 0 12 12"><path d="M2.6 6.3 5 8.6 9.6 3.6"></path></svg>Ordered
</span>
</article>
<!-- the button: closed it is a pill, open it is the one-tap sheet -->
<div class="pill" data-pill>
<span class="pill__light" data-light aria-hidden="true"></span>
<button class="closed" type="button" data-buy aria-label="Buy now for 64 euros">
<svg class="closed__icon" viewBox="0 0 20 20" aria-hidden="true">
<path d="M3.5 6.5h13l-1.2 9.2a1.6 1.6 0 0 1-1.6 1.4H6.3a1.6 1.6 0 0 1-1.6-1.4Z"></path>
<path d="M7 6.5V5.4a3 3 0 0 1 6 0v1.1"></path>
</svg>
<span class="closed__label" data-label>Buy now</span>
<span class="closed__sep" aria-hidden="true"></span>
<span class="closed__sub">1 tap</span>
</button>
<div class="sheet" data-sheet aria-hidden="true">
<div class="row" data-row>
<svg class="row__icon" viewBox="0 0 20 20" aria-hidden="true"><path d="M3.5 9 10 3.8 16.5 9v7.2h-4.2v-4.4H7.7v4.4H3.5Z"></path></svg>
<span class="row__text"><b>Home</b><span data-address>14 Calder Lane, Leith</span></span>
</div>
<div class="row" data-row>
<svg class="row__icon" viewBox="0 0 20 20" aria-hidden="true"><rect x="2.8" y="5" width="14.4" height="10.2" rx="1.8"></rect><path d="M2.8 8.4h14.4M5.6 12.2h3"></path></svg>
<span class="row__text"><b>Card</b><span data-card>ending 4821</span></span>
<span class="row__total" data-total>€64.00</span>
</div>
<div class="foot" data-row>
<span class="ring" aria-hidden="true">
<svg viewBox="0 0 36 36">
<circle class="ring__track" cx="18" cy="18" r="15"></circle>
<circle class="ring__run" data-run cx="18" cy="18" r="15"></circle>
<path class="ring__tick" data-tick d="M11.6 18.4 16 22.6 24.6 13.6"></path>
</svg>
<span class="ring__num" data-num>3</span>
</span>
<span class="status" aria-live="polite">
<span class="status__win"><span class="status__now" data-status>Placing your order</span></span>
<span class="status__sub" data-sub>Arrives Tuesday</span>
</span>
<button class="undo" type="button" data-undo tabindex="-1">Undo</button>
</div>
</div>
</div>
</div>
</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.
34 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 “Buy now with undo button” from Animorio and fit it into my siteA single element, the pill, changes width, height and radius with GSAP: closed it is 13.5 by 3.6 rem, open it takes the column’s width and the sheet’s natural height, measured for a moment at auto height before animating. Sizes are read again on resize, even with the sheet open.
An SVG circle of radius 15 with a dash as long as the circumference: a three-second linear tween moves stroke-dashoffset from zero to the circumference, and at each whole second the number changes with a small hop. At the end the stroke turns green and a tick draws itself from its dasharray.
The status line sits in a one-line window with hidden overflow: the new text comes in from below while the old one leaves at the top and is removed, so two lines never overlap.
Undo stops the count, winds the ring back and closes the sheet a second later: nothing goes. The autopilot tries undoing once and lets it go once, and stops at the first real click or key.
| Name | File | Default | What it changes |
|---|---|---|---|
LABEL | script.js | Buy now | The label of the closed button. |
ADDRESS | script.js | 14 Calder Lane, Leith | The saved address in the sheet. |
CARD | script.js | ending 4821 | The saved card. |
TOTAL | script.js | €64.00 | The order total. |
COUNTDOWN | script.js | 3 | The seconds to undo before the order goes. |
SPRING | script.js | 1 | How much the sheet bounces as it opens. |
HOLD | script.js | 2.4 | The seconds the order-placed message stays before closing. |
IDLE | script.js | 1.2 | The seconds before the autopilot starts. |
--anello | style.css | #f2b544 | The colour of the counting ring. |
On a product page or in a shop’s app, for people whose address and card are already saved: buying in one tap, but with three seconds to think again, like shops with express checkout.
Card and sheet take almost the whole width and the rows tighten; the finger taps like the mouse. Without hover the light stays off.
No springs or passing light: the sheet fades in already open, the ring still drains because it is the count, the number changes without hops, the tick appears already drawn and the sheet fades closed.
GSAP 3.15.0, Geist (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 7.4 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.