
The elastic button
Buttons, Hover, Text
The button to add a night at a made-up hotel, Hotel Bellacqua. Inside the dark pill sits a little desk calendar with a terracotta band and the check-out day. On the tap a light runs round the edge while the hotel checks room 312 and the top leaf lifts a little, letting the next day show through; when the room is free the leaf flips over like a split-flap board, slaps and bounces, the band goes from Sun to Mon, sage green fills the pill, the label becomes Stay extended · +1 night and the line below rolls to the new check-out and the price. Another tap undoes it and the leaf flips back.
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>
<!--
"Extend your stay 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 Extend your stay button with the calendar day that flips over</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: one more night. Pressed, a beam of light runs round the pill while the hotel checks the room;
when it is free the check-out day on the little desk calendar flips over like a split-flap leaf, the pill
fills with green and the line below rolls to the new check-out -->
<div class="frame" data-wrap>
<button class="x" type="button" data-btn aria-describedby="x-note">
<span class="x__skin" aria-hidden="true"></span>
<span class="x__glow" data-glow aria-hidden="true"></span>
<span class="x__fill" data-fill aria-hidden="true"></span>
<span class="x__sheen" data-sheen aria-hidden="true"></span>
<span class="x__beam" data-beam aria-hidden="true"></span>
<span class="cal" data-cal aria-hidden="true">
<span class="cal__rings"><i></i><i></i></span>
<span class="cal__band"><span class="cal__wd" data-wd="a">Sun</span><span class="cal__wd" data-wd="b">Mon</span></span>
<span class="cal__face" data-face>
<span class="half half--top" data-ts><b data-n>22</b></span>
<span class="half half--bot" data-bs><b data-n>22</b></span>
<span class="half half--top half--fly" data-tf><b data-n>22</b><i class="half__shade"></i></span>
<span class="half half--bot half--fly" data-bf><b data-n>22</b><i class="half__shade"></i></span>
<span class="cal__hinge"></span>
</span>
</span>
<span class="x__labels" data-labels>
<span class="x__label" data-l="idle">Extend your stay</span>
<span class="x__label" data-l="wait">Checking room <span data-room>312</span></span>
<span class="x__label" data-l="done">Stay extended<span class="x__sep">·</span><span class="x__plus">+1 night</span></span>
</span>
</button>
<p class="note" id="x-note" aria-live="polite">
<span class="note__line" data-note="idle">Check-out Sun 22 Nov · 11:00 · Hotel Bellacqua</span>
<span class="note__line" data-note="done">New check-out <b>Mon 23 Nov</b> · <span data-price>€186</span> to room <span data-room>312</span></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.
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 “Extend your stay button” from Animorio and fit it into my siteThe calendar number is written four times, in four half boxes with hidden overflow: a still top and bottom half and two flying ones. Before the flip, the still top already shows the new day and the still bottom the old one; so while the leaves turn, the right number is always behind them.
The top half turns on its lower edge from 0 to −90 degrees with power2.in, as if falling; then the bottom half starts at 90 degrees and comes down to 0 with the same acceleration. On landing two small tweens lift it by seven and then one and a half degrees: the flap’s bounce. A dark veil on each half shades it while it is edge-on.
A conic gradient cut to a one-and-a-half-pixel ring by an exclude mask: GSAP spins its angle, a CSS variable, from 0 to 360 degrees on loop while the hotel checks the room.
The three labels are measured once the font has arrived; the outgoing one narrows on the wdth axis and rises, the incoming one arrives narrow and widens with a back.out, while the box changes width and the pill follows it.
| Name | File | Default | What it changes |
|---|---|---|---|
DAY | script.js | 22 | The check-out day on the little calendar; after the tap it becomes the next day. |
ROOM | script.js | 312 | The room number. |
PRICE | script.js | 186 | The price of the extra night, in euros. |
WAIT | script.js | 1.5 | The seconds the light runs round the pill. |
FLIP | script.js | 0.62 | The seconds of the flipping leaf. |
BOUNCE | script.js | 1.4 | How much the pill, the leaf and the labels bounce. |
HOLD | script.js | 3.2 | The seconds the autopilot leaves the extended stay in view. |
PAUSE | script.js | 1.6 | The seconds of rest before the round starts again. |
--salvia | style.css | #2d5a4c | The green that fills the pill once the night is booked. |
--cotto | style.css | #c25a3c | The band of the little calendar. |
In the guest app or area of a hotel, a B&B or a holiday home, during the stay: adding a night with one tap, with the new check-out date seen changing on the calendar.
The pill drops to 58 pixels and the label tightens by a point; the finger taps like the mouse. Without hover the leaf corner does not lift and the light stays off.
No turning leaf or running light: the number fades and comes back with the new day, the labels change with a fade and the green appears already full.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 6.8 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.