
The inchworm menu
Menus, Hover, Transitions
The notification of Basketry, a made-up grocery delivery app, as a black dynamic island on white, like a Dribbble shot. Folded, it says who is shopping your order and how many items are already in the basket, with a thin ring. When an item is sold out it opens on a spring: the sold-out carton struck through, the suggested swap beside it, a line running down to the auto-approval and two actions. Approve swap slides the new carton into place, draws the tick and folds the island back with the count rolling up by one; Refund takes it off the order. Dragged sideways it flies off with the speed of the finger and Undo brings it back.
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>
<!--
"Grocery swap notification" 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 grocery delivery notification with the sold-out item and the swap to approve</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>
<!-- one gesture: answer the shopper. The black island of Basketry says who is shopping your order; it opens on a
spring when an item is sold out, with the swap side by side. Approve swap slides the new carton into place and
the island folds back with one more item in the basket. Drag it sideways to clear it; Undo brings it back. -->
<div class="frame" data-wrap>
<div class="swipe" data-swipe>
<div class="island" data-island role="status" aria-live="polite">
<span class="island__skin" aria-hidden="true"></span>
<span class="island__grain" aria-hidden="true"></span>
<span class="island__rim" aria-hidden="true"></span>
<span class="island__sheen" data-sheen aria-hidden="true"></span>
<!-- the compact pill -->
<button class="pill" type="button" data-pill aria-expanded="false" aria-label="Show the update from your shopper">
<span class="pill__app" aria-hidden="true">
<svg viewBox="0 0 24 24"><path class="g-handle" d="M8.2 10.2 11 5.6M15.8 10.2 13 5.6"></path><path class="g-basket" d="M4.6 10.2h14.8l-1.6 7.4a1.8 1.8 0 0 1-1.8 1.4H8a1.8 1.8 0 0 1-1.8-1.4Z"></path><path class="g-slats" d="M9.6 13v3.4M14.4 13v3.4M12 13v3.4"></path></svg>
</span>
<span class="pill__who"><span data-shopper>Mara</span> is shopping</span>
<span class="pill__count" aria-hidden="true">
<span class="roll" data-roll><span class="roll__n" data-n-old>12</span><span class="roll__n" data-n-new>13</span></span>
<span class="pill__of">of <span data-total>18</span></span>
</span>
<svg class="ring" viewBox="0 0 20 20" aria-hidden="true"><circle class="ring__track" cx="10" cy="10" r="7.5"></circle><circle class="ring__fill" data-ring cx="10" cy="10" r="7.5"></circle></svg>
</button>
<!-- the open card -->
<div class="card" data-card aria-hidden="true">
<div class="card__head" data-part>
<span class="card__app" aria-hidden="true">
<svg viewBox="0 0 24 24"><path class="g-handle" d="M8.2 10.2 11 5.6M15.8 10.2 13 5.6"></path><path class="g-basket" d="M4.6 10.2h14.8l-1.6 7.4a1.8 1.8 0 0 1-1.8 1.4H8a1.8 1.8 0 0 1-1.8-1.4Z"></path><path class="g-slats" d="M9.6 13v3.4M14.4 13v3.4M12 13v3.4"></path></svg>
</span>
<span class="card__titles">
<span class="card__meta">Basketry<span class="card__sep">·</span>now</span>
<span class="card__title" data-title>Oat milk is sold out</span>
</span>
<button class="card__fold" type="button" data-fold aria-label="Fold the notification">
<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M4.5 9.8 8 6.3l3.5 3.5"></path></svg>
</button>
</div>
<div class="swap" data-part data-swaprow>
<div class="item item--gone" data-gone>
<span class="carton" aria-hidden="true">
<svg viewBox="0 0 28 36"><path class="carton__body" d="M5 12.5 9 6h10l4 6.5V32a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 5 32Z"></path><path class="carton__top" d="M9 6V2.8h10V6"></path><path class="carton__fold" d="M5 12.5h18"></path><rect class="carton__band carton__band--oat" x="7.4" y="18" width="13.2" height="7.4" rx="1.2"></rect></svg>
</span>
<span class="item__text">
<span class="item__name">Oatfield Barista<span class="item__strike" data-strike aria-hidden="true"></span></span>
<span class="item__sub">1 L<span class="card__sep">·</span>€2.10</span>
<span class="item__tag">Sold out</span>
</span>
</div>
<span class="swap__arrow" data-arrow aria-hidden="true">
<svg viewBox="0 0 20 12"><path d="M1.5 6h16M13 1.6 17.5 6 13 10.4"></path></svg>
</span>
<div class="item item--new" data-new>
<span class="item__halo" data-halo aria-hidden="true"></span>
<span class="carton" aria-hidden="true">
<svg viewBox="0 0 28 36"><path class="carton__body" d="M5 12.5 9 6h10l4 6.5V32a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 5 32Z"></path><path class="carton__top" d="M9 6V2.8h10V6"></path><path class="carton__fold" d="M5 12.5h18"></path><rect class="carton__band carton__band--almond" x="7.4" y="18" width="13.2" height="7.4" rx="1.2"></rect></svg>
</span>
<span class="item__text">
<span class="item__name">Almondry Pure</span>
<span class="item__sub">1 L<span class="card__sep">·</span>€2.40</span>
<span class="item__tag item__tag--diff" data-diff>+€0.30</span>
</span>
</div>
<span class="swap__note" data-swapnote aria-hidden="true"><svg viewBox="0 0 16 16"><path d="M3.4 8.4 6.6 11.4 12.6 4.8"></path></svg><span>In the basket<span class="swap__aisle">Dairy aisle</span></span></span>
</div>
<div class="card__foot" data-part>
<span class="timer">
<span class="timer__text"><span class="timer__long">Auto-approves</span><span class="timer__short">Auto</span> in <span data-left>0:40</span></span>
<span class="timer__line"><span class="timer__fill" data-line></span></span>
</span>
<span class="actions">
<button class="act act--ghost" type="button" data-refund><span class="act__face"><span class="act__labels"><span class="act__l" data-l="idle">Refund</span><span class="act__l" data-l="done">Refunded</span></span></span></button>
<button class="act act--go" type="button" data-approve><span class="act__face"><span class="act__labels"><span class="act__l" data-l="idle">Approve swap</span><span class="act__l" data-l="done"><svg class="tick" viewBox="0 0 16 16" aria-hidden="true"><path data-tick d="M3.4 8.4 6.6 11.4 12.6 4.8"></path></svg>Swapped</span></span></span></button>
</span>
</div>
</div>
</div>
</div>
<!-- after a swipe -->
<div class="cleared" data-cleared aria-hidden="true">
<span class="cleared__text">Notification cleared</span>
<button class="cleared__undo" type="button" data-undo>Undo</button>
</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.
48 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 “Grocery swap notification” from Animorio and fit it into my siteThe island is a box with hidden overflow whose width, height and radius GSAP animates, with two slightly different back.out eases 40 milliseconds apart, so it grows sideways first and then down. The pill and the card sit inside at their final size, centred: the card is never squeezed while the island grows, it is only uncovered.
The card height is measured with the card hidden but already as wide as the frame, after document.fonts.ready and on every resize: on a phone the rows are narrower and the timer reads Auto in, and the island always opens to the true size.
On the click getBoundingClientRect works out how far the new carton must move to take the sold-out one’s place, which meanwhile blurs and shrinks; the new carton arrives with a back.out and a green halo flaring and settling. The button labels are two stacked lines in a one-line window, moved up by GSAP with yPercent.
The number is a small drum with two figures, the old one and the new one below, moved up by one line; the ring is an SVG circle whose strokeDashoffset follows the items picked. Meanwhile the island swells by eight pixels and comes back with elastic.out.
Pointer events follow the finger only after seven pixels sideways (vertically the page scrolls, touch-action: pan-y); the speed is worked out over the last six samples. Past a third of the width, or flung fast, the notification flies off with a duration that depends on the speed; below that it springs back with elastic.out. A drag does not count as a click: a capture-phase listener stops it.
| Name | File | Default | What it changes |
|---|---|---|---|
SHOPPER | script.js | Mara | The name of the person shopping, in the pill. |
PICKED | script.js | 12 | The items already in the basket when the round starts. |
TOTAL | script.js | 18 | The items in the order. |
AUTO_APPROVE | script.js | 40 | The seconds before the swap is approved by itself. |
SPRING | script.js | 1 | How springy the island is: 0.4 calm, 2 very bouncy. |
HOLD | script.js | 2.2 | The seconds the autopilot leaves the card open before approving. |
AUTO | script.js | true | The automatic round, which stops at the first touch. |
--accento | style.css | #4fd98a | The app green: ring, count, swap edge and button. |
--isola | style.css | #0b0b0d | The black of the island. |
In the app or site of a grocery delivery service, a supermarket or an online pharmacy, when the person picking the order finds an item sold out and asks what to do: the answer is in the notification, without opening the app.
The card takes the screen width minus 32 pixels, the cartons and buttons tighten a little and the timer reads Auto in 0:39. The finger taps like the mouse and drags the notification sideways; vertically the page scrolls as usual.
No springs or slides: the pill and the card swap with a fade, the swap fades the sold-out carton out and In the basket in, the count changes without the drum and the swiped notification fades out and back.
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 16 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.