Skip to content
animorio
IT
All components

Extend your stay button

Buttons, HoverGSAP, CSS onlyMediumCompressed weight: Demo 6.8 KBGSAP 28 KBFreeDownload the zip

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.

The code

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&nbsp;<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>

Playground

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

Or ask your AI assistant for it

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 site
Platform licenseFree on your sites and your clients’ sites. Want it inside a website builder, a template platform or a client dashboard? There’s a license for agencies and platforms.

What it does

On a white ground sits the dark Extend your stay pill: on the left a little paper calendar with two metal rings, the terracotta band with Sun and the day 22 split at the hinge like a flap; below, the grey line with the check-out, the time and the hotel name. On hover a warm light follows the pointer and the corner of the leaf lifts on a spring, showing the 23 underneath; pressed, the pill squashes slightly. On the tap the label narrows on the wdth axis and becomes Checking room 312, a gold light runs round the edge of the pill and the top leaf lifts in little jolts, as if the hotel were leafing through. When the room is free the light goes out, the top half of the 22 falls past the hinge, darkening, the bottom half of the 23 lands, slaps, bounces twice and the calendar nods; the band rolls from Sun to Mon. Sage green fills the pill from the left, the pill swells a hair, a sheen crosses it, the label rolls to Stay extended · +1 night with the night in gold and the line below moves to the new check-out Mon 23 Nov and €186 to the room. Another tap undoes it: the leaf flips back and the green slides out.

How it works

The day in four halves

The 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 leaf that falls and bounces

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.

The light running round the edge

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 elastic label

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.

Values to change

NameFileDefaultWhat it changes
DAYscript.js22The check-out day on the little calendar; after the tap it becomes the next day.
ROOMscript.js312The room number.
PRICEscript.js186The price of the extra night, in euros.
WAITscript.js1.5The seconds the light runs round the pill.
FLIPscript.js0.62The seconds of the flipping leaf.
BOUNCEscript.js1.4How much the pill, the leaf and the labels bounce.
HOLDscript.js3.2The seconds the autopilot leaves the extended stay in view.
PAUSEscript.js1.6The seconds of rest before the round starts again.
--salviastyle.css#2d5a4cThe green that fills the pill once the night is booked.
--cottostyle.css#c25a3cThe band of the little calendar.

Try them in the Playground

When to use it

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.

On phones

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.

With reduced motion

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.

Pitfalls

  • Before the flip the new day goes on the still top half and the old one stays on the bottom: otherwise, while the falling half was edge-on, the wrong number showed behind it for a moment.
  • The landing half starts at 90 degrees, edge-on and so invisible: it must be set there at the start, or on the first round it appeared open above the calendar.
  • The label width must be measured again after document.fonts.ready: measured before it cut the last letter of night.

Libraries

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.

Testing

Tested on 16 November 2026

  • Desktop: Done
  • Phone: Done
  • Reduced motion: Done
  • Safari on iPhone: To do

License

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.

All components