
The inchworm menu
Menus, Hover, Transitions
The Try at home button of a made-up eyewear shop, Halden Optical: the three frames picked sit stacked on the right of the dark pill, on little paper cards. On hover the stack fans open; on the tap the pill grows, three slots open and each frame jumps from the stack into its own, the lid with the pressed-in name comes down and the amber tape seals it, a light runs along the tape while a courier is booked and the box becomes a green tick with the day it ships.
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>
<!--
"Try at home 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 Try at home button with three glasses frames packed into the box</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/index.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<main class="stage">
<!-- the Try at home button of a made-up eyewear shop, Halden Optical: the three frames you picked sit stacked on
the right of the pill; one tap and each drops into its slot of a little box, the lid comes down, the tape runs
across, a courier is booked and the pill says when the box ships. -->
<div class="wrap" data-wrap>
<button class="pill" type="button" data-pill aria-describedby="hint">
<span class="pill__body" data-body>
<span class="pill__light" data-light aria-hidden="true"></span>
<span class="pill__sweep" data-sweep aria-hidden="true"></span>
<span class="lead" aria-hidden="true">
<span class="lead__well" data-well>
<svg class="lead__box" data-box viewBox="0 0 20 20">
<path d="M3.2 6.6 10 3.4l6.8 3.2v7L10 16.8l-6.8-3.2Z"></path>
<path d="M3.2 6.6 10 9.8l6.8-3.2M10 9.8v7"></path>
<path class="lead__flap" d="M6.6 5 13.4 8.2"></path>
</svg>
<svg class="lead__tick" data-tick viewBox="0 0 20 20"><path d="M5.4 10.4 8.6 13.4 14.8 6.8"></path></svg>
</span>
</span>
<span class="say">
<span class="say__win"><span class="say__now" data-say>Try at home</span></span>
<span class="say__sub" data-sub>3 frames · free both ways</span>
</span>
<span class="tray" data-tray aria-hidden="true">
<span class="slot" data-slot></span>
<span class="slot" data-slot></span>
<span class="slot" data-slot></span>
<!-- the three frames picked: round tortoise, square black, cat-eye rose -->
<span class="chip chip--tort" data-chip>
<svg viewBox="0 0 40 20"><circle cx="11" cy="10.5" r="6.2"></circle><circle cx="29" cy="10.5" r="6.2"></circle><path d="M17.2 9.6q2.8-2 5.6 0M4.8 9.2 2 8M35.2 9.2 38 8"></path></svg>
</span>
<span class="chip chip--ink" data-chip>
<svg viewBox="0 0 40 20"><rect x="4.4" y="5" width="12.6" height="10" rx="2.4"></rect><rect x="23" y="5" width="12.6" height="10" rx="2.4"></rect><path d="M17 8.6q3-1.6 6 0M4.4 7.4 2 6.6M35.6 7.4 38 6.6"></path></svg>
</span>
<span class="chip chip--rose" data-chip>
<svg viewBox="0 0 40 20"><path d="M4 7.2q6.6-2.4 13.2-.4-.2 7.6-6.6 8.2Q4.6 15 4 7.2Z"></path><path d="M36 7.2q-6.6-2.4-13.2-.4.2 7.6 6.6 8.2 6-.0 6.6-7.8Z"></path><path d="M17.2 8.2q2.8-1.6 5.6 0M4 7.2 2 6M36 7.2 38 6"></path></svg>
</span>
<!-- the lid that closes the box, with the tape and the shop's name pressed in -->
<span class="lid" data-lid>
<span class="lid__name">Halden</span>
<span class="lid__tape" data-tape><span class="lid__shine" data-shine></span></span>
</span>
</span>
</span>
</button>
<p class="hint" id="hint">
<svg class="hint__icon" viewBox="0 0 16 16" aria-hidden="true"><path d="M12.6 6.2A5 5 0 1 0 13 9.4"></path><path d="M13.2 3.4v3h-3"></path></svg>
<span class="hint__win"><span class="hint__now" data-hint>Keep what you love, send back the rest</span></span>
</p>
<span class="live" aria-live="polite" data-live></span>
</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.
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 “Try at home button” from Animorio and fit it into my siteThe real button only gets movement and scale from GSAP (hover, press, the weight of the lid); inside, the pill’s body changes width. This way the two animations never wipe each other’s transform, and the focus ring stays on the body.
The frame cards are absolute inside the tray: stack and slot positions are measured in pixels (the slots’ offsetLeft) and read again on resize. Each card runs three overlapping tweens: it lifts while turning, slides sideways, drops with a back.out and squashes as it lands.
The lid comes down from yPercent -150 inside the pill, whose overflow is hidden, and sits above the cards with a fixed z-index (GSAP animates the cards’ z-index). The tape draws itself with scaleX from the left and a light inside it repeats for as long as the courier wait lasts.
The big label sits in a one-line window: the new one comes in from below, the old one leaves at the top and is removed. The line under the pill does the same and also widens its window to the new sentence, so it stays centred.
| Name | File | Default | What it changes |
|---|---|---|---|
LABEL | script.js | Try at home | The label of the button at rest. |
SHIPS | script.js | Ships Tuesday | The day the box ships, at the end. |
TRIAL_DAYS | script.js | 5 | The days to try the glasses at home. |
BOX_ID | script.js | HL-3307 | The box code in the line below. |
SPRING | script.js | 1 | How much the frames and the lid bounce. |
COURIER | script.js | 1.1 | The seconds of waiting while the courier is booked. |
HOLD | script.js | 2.4 | The seconds the confirmation stays before going back to rest. |
IDLE | script.js | 1 | The seconds before the autopilot starts. |
--nastro | style.css | #e0a458 | The colour of the tape that seals the box. |
--tartaruga | style.css | #9a5a32 | The colour of the tortoise frame. |
On the page of an eyewear, shoe or clothing shop that sends products to try at home for free: after picking the models, a button that shows the box being packed and says right away when it ships.
The pill narrows within the screen width and the stack and slot positions are read again; the finger taps like the mouse. Without hover the stack stays closed and the light off.
No jumps or bounces: the slots fade in, the frames fade out of the stack and back in already in place, the lid appears with the tape already on, the tick appears drawn and the lines change with a fade.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 8.3 KB; the libraries: GSAP 28 KB.
Tested on 15 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.