
The inchworm menu
Menus, Hover, Transitions
The compare tray of Halden Audio, a made-up headphone shop, on white with a single cobalt blue. Three cards with drawn headphones: tick «Compare» and the box fills while the tick draws itself, the drawing flies on an arc into a dashed slot of the tray at the bottom and the «Compare (2)» counter rolls. With two or three products the black pill opens the tray into the comparison table: the tray rises on a spring, the rows for price, battery, weight, noise cancelling and fast charge arrive one after the other and the best value of each row lights up in blue. Back closes it, Clear empties everything.
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>
<!--
"Compare tray" 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>Compare tray</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">
<!-- three headphones in a made-up shop. Tick «Compare» on a card: its picture flies into the tray,
the empty dashed slots fill and the counter rolls. Press Compare: the tray opens into the table,
rows arrive one after the other and the best value of each row lights up. Clear puts everything back -->
<section class="shop" data-shop aria-label="Halden Audio headphones">
<header class="shop__head">
<span class="brand">Halden Audio</span>
<span class="crumb">Headphones <span class="sep">/</span> <strong>Wireless</strong></span>
</header>
<ul class="cards" data-cards>
<li class="card" data-card="0">
<div class="thumb" data-thumb>
<svg viewBox="0 0 80 56" aria-hidden="true"><g class="ph">
<path class="band" d="M20 34V27a20 20 0 0 1 40 0v7"/>
<rect class="cup" x="13" y="29" width="12" height="18" rx="5"/>
<rect class="cup" x="55" y="29" width="12" height="18" rx="5"/>
<path class="pad" d="M25 32v12M55 32v12"/>
</g></svg>
</div>
<p class="card__name">Arc 2</p>
<p class="card__price">$249</p>
<button class="check" type="button" role="checkbox" aria-checked="false" data-check>
<span class="box"><svg viewBox="0 0 16 16" aria-hidden="true"><path class="tick" pathLength="1" d="M4 8.4l2.6 2.5L12 5.4"/></svg></span>
<span>Compare</span>
</button>
</li>
<li class="card" data-card="1">
<div class="thumb" data-thumb>
<svg viewBox="0 0 80 56" aria-hidden="true"><g class="ph">
<path class="band" d="M22 33v-5a18 18 0 0 1 36 0v5"/>
<circle class="cup" cx="21" cy="38" r="8"/>
<circle class="cup" cx="59" cy="38" r="8"/>
<circle class="pad" cx="21" cy="38" r="3.4"/>
<circle class="pad" cx="59" cy="38" r="3.4"/>
</g></svg>
</div>
<p class="card__name">Arc Pro</p>
<p class="card__price">$349</p>
<button class="check" type="button" role="checkbox" aria-checked="false" data-check>
<span class="box"><svg viewBox="0 0 16 16" aria-hidden="true"><path class="tick" pathLength="1" d="M4 8.4l2.6 2.5L12 5.4"/></svg></span>
<span>Compare</span>
</button>
</li>
<li class="card" data-card="2">
<div class="thumb" data-thumb>
<svg viewBox="0 0 80 56" aria-hidden="true"><g class="ph">
<rect class="cup" x="22" y="24" width="36" height="22" rx="11"/>
<path class="pad" d="M22 34h36"/>
<circle class="bud" cx="33" cy="17" r="4.6"/>
<circle class="bud" cx="47" cy="17" r="4.6"/>
</g></svg>
</div>
<p class="card__name">Drift Buds</p>
<p class="card__price">$179</p>
<button class="check" type="button" role="checkbox" aria-checked="false" data-check>
<span class="box"><svg viewBox="0 0 16 16" aria-hidden="true"><path class="tick" pathLength="1" d="M4 8.4l2.6 2.5L12 5.4"/></svg></span>
<span>Compare</span>
</button>
</li>
</ul>
<!-- the tray: three slots, the counter and Compare. It opens into the table -->
<div class="tray" data-tray>
<div class="tray__bar" data-bar>
<div class="slots" data-slots>
<span class="slot" data-slot></span>
<span class="slot" data-slot></span>
<span class="slot" data-slot></span>
</div>
<button class="clear" type="button" data-clear>Clear</button>
<button class="go" type="button" data-go>
<span class="go__words" data-words>
<span class="go__word" data-word="compare">Compare <span class="count">(<span class="num" data-num><b>0</b></span>)</span></span>
<span class="go__word" data-word="back">Back</span>
</span>
</button>
</div>
<div class="table" data-table aria-hidden="true">
<div class="row row--head" data-row>
<span class="row__label">Model</span>
<span class="cell" data-col="0"><b>Arc 2</b></span>
<span class="cell" data-col="1"><b>Arc Pro</b></span>
<span class="cell" data-col="2"><b>Drift Buds</b></span>
</div>
<div class="row" data-row data-best="2">
<span class="row__label">Price</span>
<span class="cell" data-col="0">$249</span><span class="cell" data-col="1">$349</span><span class="cell" data-col="2">$179</span>
</div>
<div class="row" data-row data-best="1">
<span class="row__label">Battery</span>
<span class="cell" data-col="0">40 h</span><span class="cell" data-col="1">60 h</span><span class="cell" data-col="2">8 h</span>
</div>
<div class="row" data-row data-best="2">
<span class="row__label">Weight</span>
<span class="cell" data-col="0">254 g</span><span class="cell" data-col="1">288 g</span><span class="cell" data-col="2">52 g</span>
</div>
<div class="row" data-row data-best="1">
<span class="row__label">Noise cancelling</span>
<span class="cell" data-col="0">Standard</span><span class="cell" data-col="1">Adaptive</span><span class="cell" data-col="2">Standard</span>
</div>
<div class="row" data-row data-best="0">
<span class="row__label">Fast charge</span>
<span class="cell" data-col="0">10 min = 6 h</span><span class="cell" data-col="1">10 min = 4 h</span><span class="cell" data-col="2">10 min = 1 h</span>
</div>
</div>
</div>
<p class="sr" aria-live="polite" data-live></p>
</section>
</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.
60 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 “Compare tray” from Animorio and fit it into my siteA list keeps the cards in the order they were ticked: the slot in the tray is the position in the list, and when a card is removed the others slide to the left.
The card drawing is copied into a fixed element; a number from 0 to 1 moves it along a quadratic curve with a lifted middle point, while the scale goes from the card to the size of the slot. On arrival the copy disappears and the slot gets the drawing with a back.out.
The tray is as tall as its row; to open it GSAP takes its height to the size of the shop, measured in pixels and remeasured on resize, with a light back.out. The table rows come in staggered and only at the end do the best values light up.
Each row says in data-best which column wins; if that product was picked, the cell turns blue and a pale band widens behind it with an elastic. The columns that were not picked stay faded.
Compare and Back sit on top of each other out of the flow, in a box as wide as the visible one: when the word changes the box springs to the new width, and the pill follows it.
| Name | File | Default | What it changes |
|---|---|---|---|
FLIGHT | script.js | 0.62 | Seconds of the drawing’s flight from the card to the tray. |
ARC | script.js | 46 | How high the drawing lifts during the flight, in pixels. |
OPEN | script.js | 0.75 | Seconds the tray takes to open into the table. |
ROW_STAGGER | script.js | 0.06 | Seconds between one table row and the next. |
PRESS | script.js | 0.95 | Scale of the pill while pressed. |
AUTO_PAUSE | script.js | 6 | Seconds of quiet before the demo plays by itself again. |
In shops with similar products to choose between (headphones, phones, bikes, mattresses, service plans): wherever buyers want to put two or three things side by side without leaving the page.
Everything is in em and the size follows both the width and the height of the window, so shop, tray and table fit the phone box. A tap works like a click; the height of the open tray is measured again when the window changes.
No flights or springs: the tick appears already drawn, the drawing appears straight in the slot, the number changes without rolling and the table fades in with the best values already lit.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 7.9 KB; the libraries: GSAP 28 KB.
Tested on 28 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.