
The layered button
Buttons, Hover, Physics
The Send to kitchen button of the floor app of a made-up osteria, Osteria Lume: the waiter fires table 12’s order to the kitchen. On the tap the paper ticket comes out of the pill’s icon, grows and is caught by the steel rail above it, as in real kitchens; then it slides along the rail to the pass, swinging at every start and stop, and the pill fills with tomato red right under it. On arrival the ticket knocks the end stop with a pixel of bounce, the pill swells, a check draws itself and the label becomes In the kitchen · 14 min. Another tap recalls the ticket into the pill.
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>
<!--
"Send to kitchen button" 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 Send to kitchen button with the order ticket that slides along the rail</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">
<!-- one gesture: fire the table's order. Pressed, the ticket lifts out of the pill and is caught by the
steel ticket rail above it; it slides along the rail to the pass, filling the pill as it goes, and clips
onto the end stop with a flutter: the kitchen has it -->
<div class="frame" data-wrap>
<div class="rail" data-rail aria-hidden="true">
<span class="rail__bar" data-railbar></span>
<span class="rail__stop rail__stop--l"></span>
<span class="rail__stop rail__stop--r" data-stop></span>
</div>
<div class="ticket" data-ticket aria-hidden="true">
<div class="ticket__in" data-tin>
<svg viewBox="0 0 60 76" class="ticket__svg">
<defs>
<linearGradient id="k-paper" x1="0" y1="0" x2="0" y2="1">
<stop offset="0" stop-color="#fffdf8"/>
<stop offset="0.7" stop-color="#f8f3e9"/>
<stop offset="1" stop-color="#efe7d8"/>
</linearGradient>
</defs>
<path class="ticket__paper" d="M0 0H60V70L57 73 54 70 51 73 48 70 45 73 42 70 39 73 36 70 33 73 30 70 27 73 24 70 21 73 18 70 15 73 12 70 9 73 6 70 3 73 0 70Z"/>
<path class="ticket__crease" d="M0 4.5H60"/>
<text class="t-table" x="5" y="14.5">TABLE <tspan data-ttable>12</tspan></text>
<text class="t-time" x="55" y="14.5" text-anchor="end" data-ttime>19:28</text>
<path class="ticket__rule" d="M5 19H55"/>
<text class="t-item" x="5" y="28"><tspan class="t-q">2</tspan> Cacio e pepe</text>
<text class="t-item" x="5" y="36.5"><tspan class="t-q">1</tspan> Burrata</text>
<text class="t-item" x="5" y="45"><tspan class="t-q">1</tspan> Tagliata, rare</text>
<text class="t-note" x="5" y="53">no nuts, seat 3</text>
<path class="ticket__rule" d="M5 58H55"/>
<text class="t-house" x="30" y="65.5" text-anchor="middle">OSTERIA LUME</text>
</svg>
</div>
</div>
<button class="c" type="button" data-btn data-autoclic aria-describedby="c-note">
<span class="c__skin" data-skin aria-hidden="true">
<span class="c__glow" data-glow></span>
<span class="c__fill" data-fill></span>
<span class="c__edge" data-edge></span>
<span class="c__sheen" data-sheen></span>
</span>
<span class="c__icon" aria-hidden="true">
<svg viewBox="0 0 24 24" class="c__glyph" data-glyph>
<path d="M6.5 3.8h11v15.4l-1.4-1.1-1.4 1.1-1.4-1.1-1.3 1.1-1.4-1.1-1.4 1.1-1.3-1.1-1.4 1.1Z"/>
<path class="g__line" d="M9.3 8.3h5.4M9.3 11.4h5.4M9.3 14.4h3"/>
</svg>
<svg viewBox="0 0 24 24" class="c__check" data-checksvg>
<path data-check d="M6.2 12.6l3.7 3.6 7.9-8.4"/>
</svg>
</span>
<span class="c__labels" data-labels>
<span class="c__label" data-l="idle">Send to kitchen</span>
<span class="c__label" data-l="wait">Sending to kitchen</span>
<span class="c__label" data-l="done">In the kitchen<span class="c__sep">·</span><span class="c__eta"><span data-mins>14</span> min</span></span>
</span>
</button>
<p class="note" id="c-note" aria-live="polite">
<span class="note__t" data-n="idle">Table <span data-ntable>12</span> · 4 items · €58.00</span>
<span class="note__t" data-n="done">Fired 19:28 · Chef Marta is on it</span>
</p>
</div>
</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.
34 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 “Send to kitchen button” from Animorio and fit it into my siteThe ticket is an SVG with the jagged-edged paper, the dishes and the note. Before the flight the script measures the centre of the icon in the pill against the ticket’s place on the rail, and a fromTo brings it from there, at 30% of its size, to the start of the rail.
An outer element gets x, y and scale from GSAP; the inner one only the rotation of a damped pendulum integrated in the ticker, pushed by the rail’s acceleration worked out from position differences between frames. A touch of skewY the other way makes the paper look like it bends.
The fill does not follow time but the ticket: on every frame the ticket’s centre on screen is read and turned into a fraction of the pill, which becomes the red’s inset clip-path. So the red’s edge and its light always sit under the paper, at any width.
Like the site’s pills: on hover the label moves on the wdth axis from 100 to 112 and the background, a separate layer, grows on a bouncing curve; the label width is measured at its widest, after the font has arrived, so nothing around it moves.
| Name | File | Default | What it changes |
|---|---|---|---|
TABLE | script.js | 12 | The table number, on the ticket and in the line below. |
MINUTES | script.js | 14 | The minutes the kitchen quotes for the table. |
WAIT | script.js | 1.2 | The seconds the ticket slides along the rail. |
SWAY | script.js | 1 | How much the hanging ticket bends and swings. |
BOUNCE | script.js | 1.5 | How much the pill and the label bounce. |
STRETCH | script.js | 112 | How much the label widens on the wdth axis on hover. |
--pomodoro | style.css | #c2412b | The red that fills the pill. |
--acciaio | style.css | #b9bcc2 | The steel of the rail. |
In the floor app or point of sale of a restaurant, trattoria or bar, to fire a table’s order to the kitchen; or on a restaurant site with QR ordering at the table, where guests see their ticket reach the pass.
The pill drops to 56 pixels and the label tightens by a point; the rail is sized on the screen width and the finger taps like the mouse. Without hover the light and the wide label stay off, the ticket still swings on the rail.
No flight, slide or pendulum: the rail brightens with a fade, the ticket appears still at the pass, the red and the check fade in and the label changes without moving; on the way back everything fades out.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 8.3 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.