
The liquid grid
Hover, Transitions
The passage between two pages of the online shop of a made-up bottle brand, Ostra, inside a clean browser window: from the compare page, with the Trail 600 and the City 500 side by side and their specs in rows, to the page of the chosen bottle. Tap Choose and the other bottle steps aside, the chosen tile flies and grows into the big picture of the page, the bottle tips and settles on a spring as it lands, the name, the price and the four specs of the comparison each travel to their place on the product page, the address at the top rolls over and the colours, the sizes and Add to bag arrive. Back to compare runs the journey backwards.
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>
<!--
"Bottle compare transition" 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>Ostra, from the comparison to the chosen bottle</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">
<!-- the shop of a made-up bottle brand, Ostra, inside a clean browser window. The compare page sets two insulated
bottles side by side; choosing one sends the other away, and the chosen tile, its name, its price and its three
specs travel to their places on the product page. Back to compare runs the journey backwards -->
<section class="win" data-win aria-label="Ostra shop">
<span class="win__sheen" aria-hidden="true"></span>
<div class="bar">
<span class="bar__nav" aria-hidden="true">
<svg viewBox="0 0 16 16"><path d="M9.8 3.8 5.6 8l4.2 4.2"></path></svg>
<svg viewBox="0 0 16 16"><path d="M6.2 3.8 10.4 8l-4.2 4.2"></path></svg>
</span>
<p class="bar__url">
<svg viewBox="0 0 16 16" aria-hidden="true"><rect x="3.6" y="7" width="8.8" height="6.4" rx="1.8"></rect><path d="M5.6 7V5.4a2.4 2.4 0 0 1 4.8 0V7"></path></svg>
<span class="bar__host">ostra.shop/</span><span class="bar__path"><span class="bar__roll" data-url>compare</span></span>
</p>
<span class="bar__nav bar__nav--end" aria-hidden="true">
<svg viewBox="0 0 16 16"><path d="M12.4 6.6A4.6 4.6 0 1 0 12.6 9.6"></path><path d="M12.8 3.6v3.2H9.6"></path></svg>
</span>
</div>
<header class="head">
<p class="brand">
<svg class="brand__mark" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 3.2c3.6 0 6.2 3.6 6.2 8.8S15.6 20.8 12 20.8 5.8 17.2 5.8 12 8.4 3.2 12 3.2Z"></path><path d="M8.4 9.4c2.4 1.2 4.8 1.2 7.2 0"></path></svg>
<span>ostra</span>
</p>
<nav class="links" aria-label="Shop">
<span class="links__on">Bottles</span><span>Cups</span><span>Spares</span>
</nav>
<p class="bag" data-bag>
<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3.4 5.6h9.2l-.7 7.6a1 1 0 0 1-1 .9H5.1a1 1 0 0 1-1-.9Z"></path><path d="M5.8 5.6V4.6a2.2 2.2 0 0 1 4.4 0v1"></path></svg>
<span class="bag__n"><span class="bag__roll" data-bagn>0</span></span>
</p>
</header>
<div class="body" data-body>
<!-- the compare page -->
<section class="cmp" data-cmp aria-label="Compare">
<div class="cmp__head" data-chead>
<h1 class="cmp__title">Compare</h1>
<p class="cmp__count">Two bottles, side by side</p>
</div>
<div class="cols" data-cols></div>
<div class="specs" data-specs></div>
<div class="picks" data-picks></div>
</section>
<!-- the product page, filled with the chosen bottle -->
<section class="pdp" data-pdp aria-label="Product" aria-hidden="true">
<div class="pdp__tile tile" data-ptile>
<span class="tile__grain" aria-hidden="true"></span>
<span class="tile__glow" aria-hidden="true"></span>
<span class="tile__tag" data-ptag></span>
<span class="tile__shadow" data-pshadow aria-hidden="true"></span>
<span class="tile__bottle" data-pbottle></span>
</div>
<div class="pdp__info">
<button class="back" type="button" data-back>
<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M9.6 3.8 5.4 8l4.2 4.2"></path></svg>
<span>Back to compare</span>
</button>
<p class="pdp__eye" data-peye>Insulated bottle</p>
<h2 class="pdp__name"><span data-pname></span></h2>
<p class="pdp__price"><span data-pprice></span><span class="pdp__per" data-pper></span></p>
<div class="pdp__pick" data-ppick>
<span class="sw" data-psw></span>
<span class="seg" data-pseg></span>
</div>
<ul class="plist" data-plist></ul>
<button class="add" type="button" data-add>
<span class="add__fill" aria-hidden="true"></span>
<svg class="add__ok" viewBox="0 0 16 16" aria-hidden="true"><path d="M3.6 8.4 6.6 11.2 12.4 5" pathLength="1" stroke-dasharray="1 1" stroke-dashoffset="1"></path></svg>
<span class="add__txt"><span class="add__a">Add to bag</span><span class="add__b">Added</span></span>
</button>
</div>
</section>
</div>
</section>
<p class="sr" data-live aria-live="polite"></p>
<svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.2 19.2 11l-6.3 1.6-3.3 5.9Z"></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.
28 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 “Bottle compare transition” from Animorio and fit it into my siteThe comparison and the product page sit on top of each other in the same window. On click the product page is filled with the chosen bottle and the positions on both pages are measured with getBoundingClientRect: for every travelling piece (name, price, each of the specs) GSAP starts from the position and size it had in the comparison, with x, y and scale and the transformOrigin at the top left, and goes to zero. The original pieces switch off at the same instant, so you see a single object moving.
The tile is not scaled: GSAP changes its real width and height, from the small size to the size of the column. The tile is a container with container-type: size and the bottle and its shadow are measured in cqh, the height of the container: they grow on their own with the tile without stretching, and the corners stay round. As it lands, the bottle turns a few degrees from its base and comes back upright with elastic.out.
Back to compare puts the comparison back as it was, rebuilds the timeline from the measures of now, takes it to the end with progress(1) and plays it backwards with reverse, a little faster with timeScale. So the way there and the way back pass through the same points even if the window has changed size meanwhile.
| Name | File | Default | What it changes |
|---|---|---|---|
TRAVEL | script.js | 0.95 | How long the chosen tile takes to fly to the product page, in seconds. |
LAG | script.js | 0.05 | The gap between one travelling spec and the next, in seconds. |
AWAY | script.js | 1.4 | How far the other bottle moves to the side as it leaves, in em. |
SETTLE | script.js | 4 | How many degrees the bottle tips when it lands, before it settles (0 for none). |
BACK_SPEED | script.js | 1.15 | How much faster the way back to the comparison runs (1 the same as the way there). |
PAUSE | script.js | 2.4 | Left alone: how many seconds it stays on each product page. |
LOOP | script.js | true | Left alone, a pointer chooses a bottle, adds it to the bag, goes back and chooses the other one. |
--accent | style.css | #2f6a4f | The green of the better specs and of the added button. |
--ink | style.css | #17171a | The black of the words and the buttons. |
--bg | style.css | #efede8 | The warm white around the window. |
For an online shop with a product comparison page (bottles, headphones, mattresses, bikes): whoever has made up their mind taps the one they want and watches it arrive on its page, with the same specs they were comparing, without losing the thread; the way back puts them in the comparison as it was.
The same animation with adapted measures: the window is sized on width and height together and fits the box; on the phone you tap the tile or Choose to pick, Back to compare to go back.
No movement: the two pages cross-fade into each other, Added arrives already in place and the bag number simply changes.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 11 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.