
The colour columns
Hover, SVG
The legroom of three cabins compared, on warm white: two seats in profile drawn as in a diagram, with the dimension between one and the next. Picking Economy, Premium or Business moves the rear seat away on a spring, the backs lean, the dimension stretches and the figures count. Pointing at a figure colours its part of the drawing: the dimension, or the arc of the recline being drawn.
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>
<!--
"Legroom compare" 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>Legroom compare</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">
<!-- legroom compared across three cabins: two seats in profile, drawn as a diagram, moving apart,
the dimension line stretching between them and the figures counting -->
<section class="lr" data-lr aria-label="Legroom">
<header class="lr__head"><strong>Legroom</strong><span class="lr__fare"><span data-outfare>Included</span></span></header>
<div class="lr__seg" role="group" aria-label="Cabin" data-seg>
<i class="lr__pick" data-pick aria-hidden="true"></i>
<button type="button" class="lr__opt" data-cabin="0"><span>Economy</span></button>
<button type="button" class="lr__opt" data-cabin="1"><span>Premium</span></button>
<button type="button" class="lr__opt" data-cabin="2"><span>Business</span></button>
</div>
<svg class="lr__draw" viewBox="0 -18 300 136" role="img" aria-label="Two seats in profile and the distance between them" data-draw>
<line class="floor" x1="6" y1="78" x2="294" y2="78"></line>
<g class="seat" data-seat="0"><line class="leg" x1="22" y1="5" x2="22" y2="32"></line><rect class="pad" x="0" y="0" width="44" height="10" rx="5"></rect><g data-back><rect class="pad" x="-5" y="-54" width="10" height="59" rx="5"></rect><rect class="head" x="-7" y="-56" width="14" height="15" rx="6"></rect></g></g>
<g class="seat" data-seat="1"><line class="leg" x1="22" y1="5" x2="22" y2="32"></line><rect class="pad" x="0" y="0" width="44" height="10" rx="5"></rect><g data-back><rect class="pad" x="-5" y="-54" width="10" height="59" rx="5"></rect><rect class="head" x="-7" y="-56" width="14" height="15" rx="6"></rect></g></g>
<line class="ref" data-ref></line><path class="arc" data-arc pathLength="1"></path>
<g class="dim" data-dim><line data-dimline y1="92" y2="92"></line><line data-dima y1="86" y2="98"></line><line data-dimb y1="86" y2="98"></line><text data-outdim y="112" text-anchor="middle">31 in</text></g>
</svg>
<div class="lr__stats">
<button type="button" class="lr__stat" data-stat="pitch"><i>Seat pitch</i><b><span data-outpitch>31</span> in</b></button>
<button type="button" class="lr__stat" data-stat="recline"><i>Recline</i><b><span data-outrecline>5</span>°</b></button>
<span class="lr__stat lr__stat--plain"><i>Seat width</i><b><span data-outwidth>17.2</span> in</b></span>
</div>
</section>
<span class="live" aria-live="polite" data-live></span>
<svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.200 19.200 11l-6.300 1.600-3.300 5.900Z"></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.
24 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 “Legroom compare” from Animorio and fit it into my sitePitch, recline and width. A single function rewrites from the animated numbers the rear seat’s position, the backs’ rotation, the dimension and the figures.
An inch is always worth the same drawing units: the distance between the seats is the real one, small. That is why the Business seat nearly reaches the edge.
The backs rotate round the hip by writing the transform attribute from the animated number, with the pivot in the drawing’s coordinates.
On the pitch the dimension is coloured; on the recline an arc goes from upright to the back and is drawn with stroke-dashoffset.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #0b7f86 | The colour of the figure pointed at, on the drawing and in its box. |
GLIDE | script.js | 0.9 | How many seconds the seats take to move apart when the cabin changes. |
SPRING | script.js | 1 | How much the tile and the seats bounce. |
LOOP | script.js | true | Left alone, the demo’s pointer tries the three cabins, points at the figures and starts again. |
On an airline’s fare page, in the seat-selection step or on a site comparing flights; the same diagram with its stretching dimension carries a sofa’s measurements, the space between a venue’s tables, a car’s boot or a bike’s sizes.
The card is at most 348 pixels wide and about 310 tall, and narrows with the screen: the drawing is an SVG scaling as a whole. On a phone a tap on a figure points at it and another lets go. The options are 32 pixels tall.
No sliding seats and no counting: on changing cabin the drawing and the numbers are the new ones at once, and pointing at the recline shows the arc already drawn. The demo’s pointer does not start.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 6.0 KB; the libraries: GSAP 28 KB.
Tested on 30 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.