
The inchworm menu
Menus, Hover, Transitions
A product card that becomes the details window itself: tapped, it leaves its place, grows to the middle with a small overshoot while the page behind dims, the print at the top grows with it and below the description, the sizes and Add to cart come in one after the other. On closing, the details leave and the window goes back exactly onto the card, to the pixel.
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>
<!--
"Card to modal" 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>Card to modal</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">
<!-- a product card that becomes the window: it grows from its own place to the middle, the page dims,
the details come in one after the other, and closing takes it back exactly where it was -->
<div class="cm" data-cm>
<button class="cm__card" type="button" data-card data-art="tide" data-title="Tidal no. 4" data-price="€38" data-text="Risograph print in two inks on warm recycled stock. Signed and numbered, edition of 120.">
<span class="cm__art cm__art--tide" aria-hidden="true"><i></i><i></i><i></i></span>
<span class="cm__meta"><b>Tidal no. 4</b><span>€38</span></span>
</button>
<button class="cm__card" type="button" data-card data-art="dune" data-title="Dune study" data-price="€42" data-text="Screen print in three passes on heavy cotton paper. Signed and numbered, edition of 80.">
<span class="cm__art cm__art--dune" aria-hidden="true"><i></i><i></i><i></i></span>
<span class="cm__meta"><b>Dune study</b><span>€42</span></span>
</button>
</div>
<div class="cm__dim" data-dim></div>
<div class="cm__modal" data-modal role="dialog" aria-modal="true" aria-labelledby="cm-title" hidden>
<span class="cm__art" data-outart aria-hidden="true"><i></i><i></i><i></i></span>
<button class="cm__close" type="button" data-close aria-label="Close"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M4 4l8 8M12 4l-8 8"></path></svg></button>
<div class="cm__body">
<span class="cm__meta"><b id="cm-title" data-outtitle>Tidal no. 4</b><span data-outprice>€38</span></span>
<p class="cm__text" data-in data-outtext></p>
<div class="cm__sizes" data-in role="radiogroup" aria-label="Size">
<button type="button" role="radio" aria-checked="false" data-size>A4</button>
<button type="button" role="radio" aria-checked="true" data-size>A3</button>
<button type="button" role="radio" aria-checked="false" data-size>A2</button>
</div>
<button class="cm__buy" type="button" data-in data-buy>Add to cart</button>
</div>
</div>
<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.
19 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 “Card to modal” from Animorio and fit it into my siteOn tap the script measures where the card sits inside the stage and where the window will go: at most 300 pixels wide, as tall as its content, in the middle. The window is a single element, filled with the card’s data (title, price, text, print).
GSAP takes the window’s x, y, width and height from the first measurement to the second, on a light back.out; the print’s height does the same. The real card is hidden with visibility, so it keeps its place in the grid.
To close, the card is measured again (the page may have changed) and the window goes back to it on a soft ease, with no bounce. When the journey is over the window hides and the card reappears in the same frame.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #2f5bff | The colour of the Add to cart button and of the first print’s ink. |
OPEN | script.js | 0.75 | How long the card takes to grow into the window. |
DIM | script.js | 0.5 | How much the page behind dims. |
In a shop’s product grid, for a quick view without leaving the page; in a portfolio’s gallery of work; in a list of articles, recipes, rooms, events: wherever a card has more to say than fits.
The two cards sit side by side in 292 pixels; the window is at most 300 wide and about 340 tall, the print getting shorter on low screens. It closes with the round button at the top or with a tap outside.
The window does not travel: it fades in already in the middle, with all its details in place, and fades out. 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 5.9 KB; the libraries: GSAP 28 KB.
Tested on 26 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.