
The inchworm menu
Menus, Hover, Transitions
The cookie consent of an invented site, dark on black with a single amber colour: the bar at the bottom, on Customize, grows on a spring into the preferences card, with a light running along its edge. The category switches turn on one after another with a stretching knob and a rolling count, Analytics opens to say what it does and the card rises with it, and Save folds everything into a small confirmation pill with a check drawing itself.
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>
<!--
"Cookie preferences" 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 cookie preferences growing out of the bar</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" data-stage>
<!-- one shell that changes shape: the cookie bar at the bottom grows into the preferences card,
and saving folds it into a small confirmation pill -->
<div class="glow" data-glow aria-hidden="true"></div>
<div class="frame" data-frame aria-hidden="true"></div>
<section class="shell" data-shell aria-label="Selvane cookie preferences">
<span class="shell__sheen" data-sheen aria-hidden="true"></span>
<!-- the bar -->
<div class="layer bar" data-bar>
<span class="tile" aria-hidden="true">
<svg viewBox="0 0 24 24"><path d="M12 3.2a8.8 8.8 0 1 0 8.8 8.9 3 3 0 0 1-3.4-2.9 3 3 0 0 1-2.9-3.4A3 3 0 0 1 12 3.2Z"/><circle cx="9" cy="10" r="1.1"/><circle cx="14.6" cy="14.6" r="1.1"/><circle cx="9.4" cy="15.4" r="0.9"/></svg>
</span>
<p class="bar__text"><b>We use cookies</b> to keep Selvane fast and a little more personal.</p>
<div class="bar__acts">
<button class="btn btn--ghost" data-customize>Customize</button>
<button class="btn btn--solid" data-accept>Accept all</button>
</div>
</div>
<!-- the preferences card -->
<div class="layer panel" data-panel aria-hidden="true">
<header class="panel__head" data-reveal>
<span class="tile" aria-hidden="true">
<svg viewBox="0 0 24 24"><path d="M12 3.4 5 6v5.6c0 4.3 2.9 7.6 7 9 4.1-1.4 7-4.7 7-9V6Z"/><path class="tile__tick" d="m9 12.2 2.2 2.2 4-4.3"/></svg>
</span>
<div class="panel__titles">
<h1 class="panel__title">Privacy preferences</h1>
<p class="panel__sub">Choose what Selvane may store on this device.</p>
</div>
<button class="icon-btn" data-close aria-label="Close preferences">
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M7 7l10 10M17 7 7 17"/></svg>
</button>
</header>
<ul class="cats">
<li class="cat is-locked" data-reveal>
<div class="cat__row">
<span class="cat__name">Essential<small>Sign in, cart, security</small></span>
<span class="lock" aria-hidden="true"><svg viewBox="0 0 24 24"><rect x="6.5" y="11" width="11" height="8.4" rx="2"/><path d="M9 11V8.6a3 3 0 0 1 6 0V11"/></svg></span>
<button class="switch is-on" role="switch" aria-checked="true" aria-disabled="true" aria-label="Essential, always on" data-switch="essential" disabled><span class="switch__fill"></span><i></i></button>
</div>
</li>
<li class="cat" data-reveal data-cat="analytics">
<div class="cat__row">
<button class="cat__name cat__open" data-open aria-expanded="false" aria-controls="det-analytics">Analytics<small>How pages are read</small>
<svg class="chev" viewBox="0 0 24 24" aria-hidden="true"><path d="m8 10 4 4 4-4"/></svg>
</button>
<button class="switch" role="switch" aria-checked="false" aria-label="Analytics" data-switch="analytics"><span class="switch__fill"></span><i></i></button>
</div>
<div class="cat__more" id="det-analytics" data-more>
<p class="more__text" data-more-line>Counts visits and scroll depth, never who you are, so we know which pages to make faster.</p>
<div class="chips" data-more-line>
<span class="chip">First party</span>
<span class="chip">Kept 13 months</span>
<span class="chip">No ads</span>
</div>
</div>
</li>
<li class="cat" data-reveal>
<div class="cat__row">
<span class="cat__name">Personalisation<small>Remembers your picks</small></span>
<button class="switch" role="switch" aria-checked="false" aria-label="Personalisation" data-switch="personal"><span class="switch__fill"></span><i></i></button>
</div>
</li>
<li class="cat" data-reveal>
<div class="cat__row">
<span class="cat__name">Marketing<small>Offers on other sites</small></span>
<button class="switch" role="switch" aria-checked="false" aria-label="Marketing" data-switch="marketing"><span class="switch__fill"></span><i></i></button>
</div>
</li>
</ul>
<footer class="panel__foot" data-reveal>
<p class="count" aria-live="polite"><span class="count__num" data-count><span data-digit>1</span></span> of 4 on</p>
<button class="btn btn--ghost" data-reject>Reject all</button>
<button class="btn btn--solid" data-save>Save</button>
</footer>
</div>
<!-- the confirmation pill -->
<button class="layer pill" data-pill aria-hidden="true" tabindex="-1" aria-label="Cookie settings">
<svg class="pill__check" viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="9" data-ring></circle><path d="m8 12.3 2.7 2.7 5.3-5.6" data-tick></path></svg>
<span class="pill__text" data-pill-text>Preferences saved</span>
<span class="pill__meta" data-pill-meta>3 of 4</span>
</button>
</section>
<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.
39 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 “Cookie preferences” from Animorio and fit it into my siteBar, card and pill are three absolute layers inside the same shell, each laid out at its own fixed pixel width, so the text never rewraps while the shell changes size. The script measures the three layers and GSAP takes the shell’s width, height and borderRadius from one size to the next, with overflow hidden cutting what does not fit yet.
The shell keeps its bottom edge still and grows upwards: the width with power4.out, the height a moment longer with back.out, which takes it a few pixels past and settles it. Meanwhile a thread of light 46% wide runs along the top edge with keyframed opacity, and the card’s rows come in staggered by five hundredths.
Inside the track an amber fill has its transformOrigin on the left: scaleX brings it behind the knob, which slides with back.out while widening by 32% on the side it is heading to, then comes back with elastic. A box-shadow that spreads and fades makes the halo, and the category name takes a step of a pixel and a half.
The Analytics detail goes from height 0 to auto, and with it the shell goes to the card’s height measured with the detail open, with the same duration and curve: the card seems to open by itself. The count is a drum one line high: the new digit comes in from below with yPercent while the old one leaves at the top.
Save fades the rows from the bottom, then the shell shrinks to the pill’s width measured with max-content; the circle and the check draw with strokeDashoffset and the text goes from wdth 78 to 102. A timeline with repeatRefresh moves the drawn pointer reading the positions every time; at the first real touch it stops and starts again after eight seconds.
| Name | File | Default | What it changes |
|---|---|---|---|
BRAND | script.js | Selvane | The name of the invented site asking for consent, written in the bar and the card. |
ACCENT | script.js | #ffb547 | The colour of the switches that are on, the icons and the check. |
MORPH | script.js | 0.75 | The seconds the bar takes to grow into the card and the card to fold into the pill. |
SPRING | script.js | 1.3 | How far the card goes past its height before settling; at 0 no bounce. |
TOGGLE_GAP | script.js | 0.6 | The seconds between one switch and the next in the autopilot’s loop. |
HOLD | script.js | 2.2 | The seconds the confirmation pill stays before the loop starts again. |
For the cookie consent of any site: an online store, a blog, a portfolio, a product landing page, a hotel or restaurant site. It suits any time a bar at the bottom has to open into richer settings without a modal covering everything.
The bar goes onto two lines, with the buttons half wide each under the text; the card is as wide as the box minus the margins and the category rows are also measured on the height, so open with the Analytics detail it fits whole in the box. The shell keeps its bottom edge where the open card ends up in the middle. A tap does what a click does.
No springs or slides: the shell fades out, takes its new size and fades back in; the switches change colour with a fade and the knob already in place, the detail opens without growing and the pill’s check is already drawn. The drawn pointer stays hidden.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 10 KB; the libraries: GSAP 28 KB.
Tested on 6 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.