
The gallery that opens
Galleries, Transitions, Images, Physics
The dinner card of Trattoria Lume, a made up restaurant, dark and warm on black: a segmented control with four courses, Starters, Pasta, Mains and Desserts, and a pill that slides on a spring, stretching towards the course and catching up with its back edge. Below, the real photo of the dish comes in from the same side, with a slight zoom and film grain, while the previous photo darkens and steps back; the dish name and the ingredients slide the same way and the price rolls on its digits. On the pasta a saffron ‘Chef's pick’ badge pops up.
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>
<!--
"Menu course picker" 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 menu course picker with the sliding dish photo</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/fraunces@5.3.0/opsz.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<main class="stage">
<!-- the dinner card of Trattoria Lume: a segmented control with four courses and a pill that slides on a spring
(its two edges have their own springs, so it stretches towards the course and catches up); under it the real
photo of the course's dish slides in from the same side, with a slight zoom and film grain, then the dish name,
its ingredients and the price rolling on its digits -->
<article class="menu" data-menu>
<span class="menu__sheen" aria-hidden="true"></span>
<header class="menu__head">
<span class="menu__brand">
<svg class="menu__mark" viewBox="0 0 20 20" aria-hidden="true">
<path d="M10 2.6c2.2 2.6 3.4 4.6 3.4 6.6a3.4 3.4 0 0 1-6.8 0c0-2 1.2-4 3.4-6.6z"/>
<path d="M5.2 15.6h9.6M7 17.6h6"/>
</svg>
<span class="menu__name">Trattoria Lume</span>
</span>
<span class="menu__when">Dinner <span class="menu__dot">·</span> 7 to 11 pm</span>
</header>
<div class="seg" role="tablist" aria-label="Courses" data-seg>
<span class="seg__hover" data-hover aria-hidden="true"></span>
<span class="seg__pill" data-pill aria-hidden="true"><span class="seg__pill-face"></span></span>
<button class="seg__tab" type="button" role="tab" id="tab-starters" aria-controls="dish" aria-selected="true" tabindex="0" data-tab><span>Starters</span></button>
<button class="seg__tab" type="button" role="tab" id="tab-pasta" aria-controls="dish" aria-selected="false" tabindex="-1" data-tab><span>Pasta</span></button>
<button class="seg__tab" type="button" role="tab" id="tab-mains" aria-controls="dish" aria-selected="false" tabindex="-1" data-tab><span>Mains</span></button>
<button class="seg__tab" type="button" role="tab" id="tab-desserts" aria-controls="dish" aria-selected="false" tabindex="-1" data-tab><span>Desserts</span></button>
</div>
<section class="dish" id="dish" role="tabpanel" aria-labelledby="tab-starters" data-panel>
<div class="photo" data-photo>
<figure class="photo__layer" data-layer><img class="photo__img" src="starters.webp" width="1024" height="769" alt="Bruschetta with chopped tomatoes on grilled bread"></figure>
<figure class="photo__layer" data-layer><img class="photo__img" src="pasta.webp" width="1024" height="683" alt="Tagliatelle with slow ragù and shaved pecorino"></figure>
<figure class="photo__layer" data-layer><img class="photo__img" src="mains.webp" width="960" height="640" alt="Grilled salmon with charred peppers and herb yogurt"></figure>
<figure class="photo__layer" data-layer><img class="photo__img" src="desserts.webp" width="1024" height="683" alt="Tiramisu with cocoa and dark chocolate shavings"></figure>
<span class="photo__shade" aria-hidden="true"></span>
<span class="photo__grain" aria-hidden="true"></span>
<span class="photo__edge" aria-hidden="true"></span>
<span class="pick" data-pick>
<svg class="pick__icon" viewBox="0 0 16 16" aria-hidden="true">
<path d="M4.4 9.6c-1.6-.3-2.5-1.5-2.3-2.9.2-1.3 1.5-2.2 2.9-2 .5-1.3 1.7-2.1 3-2.1s2.5.8 3 2.1c1.4-.2 2.7.7 2.9 2 .2 1.4-.7 2.6-2.3 2.9V13H4.4z"/>
<path d="M4.4 11h7.2"/>
</svg>
<span>Chef's pick</span>
</span>
<span class="count" aria-hidden="true"><span data-count>4 pieces</span></span>
</div>
<div class="info">
<div class="info__text">
<h2 class="info__name"><span class="info__mask"><span data-name>Bruschetta al pomodoro</span></span></h2>
<p class="info__line"><span class="info__mask"><span data-line>Datterini, garlic, basil, grilled sourdough</span></span></p>
</div>
<p class="price" aria-label="11 euros" data-price>
<span class="price__cur">€</span>
<span class="price__col" data-col></span>
<span class="price__col" data-col></span>
</p>
</div>
</section>
<footer class="menu__foot">
<span class="menu__note" data-note>Vegetarian</span>
<button class="menu__add" type="button" data-add>
<span class="menu__add-face">
<svg viewBox="0 0 16 16" aria-hidden="true"><path class="menu__plus" data-plus d="M8 3.5v9M3.5 8h9"/><path class="menu__tick" data-tick pathLength="1" d="M3.6 8.4l2.9 2.9 5.9-6.4"/></svg>
<span data-add-words>Add to order</span>
</span>
</button>
</footer>
</article>
<p class="sr" aria-live="polite" data-live></p>
</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.
35 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 “Menu course picker” from Animorio and fit it into my siteThe pill is not driven by a tween: its left and right edges are two separate springs, integrated every frame in four steps (largest step 1/30 of a second). The leading edge has the full stiffness, the back edge LAG times less, with the damping scaled to keep the same bounce: so it stretches towards the course and shortens as it arrives. A click mid-flight only changes the targets.
The four photos are stacked, each in its own frame with hidden overflow. The new frame goes on top and arrives from xPercent ±100 with expo.out; the photo inside starts at a 1.14 zoom with its origin towards the side it comes from and brightness at 112%. The old frame steps back a quarter and its photo drops to 42% light: it looks pushed under.
Over the photos sit three still layers: a gradient shade with the vignette, the grain of an feTurbulence in an SVG background, in overlay, jumping in six steps every 0.9 s, and a 1 px edge catching the light at the top. After it lands the photo keeps easing from 1.02 to 1 over six seconds, like a camera that has not quite stopped.
Name and ingredients leave by 14 px towards the opposite side and come back 22 px from the pill's side with back.out, 0.06 s apart. The price has two columns with the digits 0 to 9 stacked: each goes to yPercent −digit×10 with back.out(1.25), and the digit on the side of the movement starts first.
A GSAP delayedCall moves to the next course after DWELL seconds and, on the chef's course, presses Add to order halfway through. A pointerdown or a key inside the card stops the pilot and restarts it after eight quiet seconds.
| Name | File | Default | What it changes |
|---|---|---|---|
STIFFNESS | script.js | 260 | The spring of the pill's leading edge: higher is quicker. |
DAMPING | script.js | 21 | Lower lets the pill pass the mark and come back. |
LAG | script.js | 0.5 | How much softer the back edge is: lower stretches the pill more. |
SLIDE_TIME | script.js | 0.95 | The seconds of the photo sliding in. |
ZOOM | script.js | 1.14 | How much the photo is zoomed in when it arrives. |
GRAIN | script.js | 0.2 | How visible the grain on the photo is. |
CHEF_PICK | script.js | 1 | The course with the Chef's pick badge: 0 starters, 1 pasta, 2 mains, 3 desserts. |
DWELL | script.js | 2.8 | The seconds the pilot stays on each course. |
LOOP | script.js | true | The pilot goes through the courses again and again. |
For the menu of a restaurant, a trattoria, a bistro or a bar on its site or in a booking and ordering app: the courses as tabs, with the dish photo and the price, and the chef's suggestion standing out.
The same animation with adapted sizes: the card is 92% of the screen wide, the photo and the margins are measured on the height too, the course labels tighten and the pill is measured again at every width change, even mid-flight. A finger taps the course and presses the button.
Nothing moves: the pill fades out and back in on the new course, the new photo fades in over the old one, words, price and badge change with a fade, the grain stays still.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0, Fraunces (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 9.6 KB; the libraries: GSAP 28 KB.
Tested on 5 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.