Skip to content
animorio
IT
All components

Glass stay calendar

Calendars, Hover, TransitionsGSAP, CSS onlyAdvancedCompressed weight: Demo 12 KBGSAP 28 KBFreeDownload the zip

The booking calendar of a vacation rental, Casa Alvear, in a frosted glass card on a warm night, like a Dribbble shot. Under every day the price of that night, higher on Friday and Saturday; the nights already taken are dim and struck through by a thin line. Pick the arrival and a champagne brushstroke of light follows the pointer from day to day on a spring, the nights roll like an odometer and the total climbs with scrolling digits; once the departure is picked, a light runs along the stroke. The arrows slide the months in on a spring.

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>
<!--
  "Glass stay calendar" 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 stay booking calendar in the glass card with the brushstroke of light</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>
    <!-- two warm lights behind the glass, so the frosted card has something to blur -->
    <span class="glow glow--a" data-glow-a aria-hidden="true"></span>
    <span class="glow glow--b" data-glow-b aria-hidden="true"></span>

    <!-- the date picker of a vacation rental: one month at a time, the price of each night under its day, the nights
         already booked struck through. Between arrival and departure a brushstroke of light runs through the days;
         nights and total roll like odometers. -->
    <section class="cal" data-card aria-label="Choose the dates of your stay">
      <span class="cal__shine" aria-hidden="true"></span>

      <header class="cal__head">
        <div class="cal__brand">
          <span class="cal__name">Casa Alvear</span>
          <span class="cal__where">Sea-view loft, Menorca</span>
        </div>
        <span class="cal__rate">
          <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M8 1.6l1.9 4.1 4.5.5-3.4 3 1 4.4L8 11.3l-4 2.3 1-4.4-3.4-3 4.5-.5z"/></svg>
          4.96
        </span>
      </header>

      <div class="cal__bar">
        <button class="cal__nav" type="button" data-prev aria-label="Previous month">
          <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M10 3.5L5.5 8l4.5 4.5"/></svg>
        </button>
        <div class="cal__month" aria-live="polite" data-month></div>
        <button class="cal__nav" type="button" data-next aria-label="Next month">
          <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M6 3.5L10.5 8 6 12.5"/></svg>
        </button>
      </div>

      <div class="cal__week" aria-hidden="true">
        <span>Mo</span><span>Tu</span><span>We</span><span>Th</span><span class="we">Fr</span><span class="we">Sa</span><span>Su</span>
      </div>

      <div class="cal__view" data-view></div>

      <footer class="cal__foot">
        <div class="sum" data-sum>
          <p class="sum__nights"><span class="odo" data-nights></span><span class="sum__word" data-word>nights</span></p>
          <p class="sum__dates">
            <span data-dates>Pick your arrival</span>
            <button class="sum__clear" type="button" data-clear>Clear</button>
          </p>
        </div>
        <div class="tot">
          <span class="tot__label">Total</span>
          <span class="tot__value"><span class="tot__cur">€</span><span class="odo" data-total></span></span>
        </div>
        <button class="book" type="button" data-book disabled>
          <span class="book__face">
            <span class="book__words" data-book-words>Reserve</span>
            <svg class="book__icon" viewBox="0 0 16 16" aria-hidden="true">
              <path class="book__check" data-check pathLength="1" d="M3.4 8.4l3 3 6.2-6.6"/>
            </svg>
          </span>
        </button>
      </footer>
    </section>

    <!-- the drawn pointer of the autopilot -->
    <svg class="hand" data-hand viewBox="0 0 24 24" aria-hidden="true">
      <path d="M5 2.8l13.4 9.6-6.1.9 3.6 7-2.6 1.3-3.6-7-4.7 4.2z"/>
    </svg>
    <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>

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.

37 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 “Glass stay calendar” 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 an almost black night, with two soft lights behind (a warm amber one and a cool sea green one) and a very fine grain, a single frosted glass card blurs them: its edge is a hairline of light, brighter at the top, and a warm reflection follows the pointer on the glass and along the edge. At the top Casa Alvear, a sea-view loft in Menorca, and the rating 4.96 with a drawn star; under it the month with its two arrows and the week starting on Monday, with Friday and Saturday tinted champagne. Each day has its number and under it the price of that night, higher on Friday and Saturday; the nights already taken are dim and crossed by a thin diagonal line, the days of the next and previous months almost invisible. Tap the arrival and the day becomes a champagne tile born with a bounce; move the pointer and a brushstroke of light, with fine bristles and soft ends where it wraps from one week to the next, follows the day under the hand on a spring and stops before the first night already taken. Meanwhile at the bottom the nights roll like an odometer and the total climbs digit by digit. Tap the departure and the second tile is born with a bounce, the stroke lights up fully, a light runs through it from end to end, the dates are written under the nights and Reserve lights up; pressed, it says Reserved with a check that draws itself. The arrows bring the new month in from one side on a spring, the old one leaves on the other, the days arrive in a light wave and the month’s name rolls. Clear pulls the stroke back to the arrival and brings the numbers back to zero. Until someone touches it, a drawn pointer moves to May, picks the 13th to the 17th, rests on Reserve, clears and goes back to April.

How it works

Days as numbers

Every date is a number of days since 1970 (Date.UTC divided by 86400000): so arrival, departure and the brushstroke live in the same space even across two months. Every month is a grid of 42 cells starting on the Monday before the first of the month; the price of each night and the booked nights come from fixed rules (season, Friday and Saturday, a small seeded wobble), so they are the same on every loop.

The brushstroke in six rows

Under the day buttons there is a layer with six strips, one per week. The end of the stroke is a fractional number moved by GSAP towards the day under the pointer: on every frame each row takes its part between the arrival and the end, and where the stroke wraps the two cut edges fade with a mask. The bristles are one pixel lines in a repeating gradient, the running light is a pseudo-element moved with a CSS variable.

Nights and total as odometers

Each digit is a window one line tall over a column 0-9 and 0 again. GSAP moves the value and each column is computed like a real odometer: the units roll continuously, tens and hundreds move only while the digits below go from 9 to 0, and the leading zeros shrink to zero width.

Sliding months

The new month is built next to the old one in the same window, masked at the sides: it comes in from the arrow’s side with a back.out (the spring), the old one leaves quickly on the other and is removed, the days arrive with an 8 ms stagger and the month’s name rolls vertically. While sliding, the stroke is drawn in both months.

The pointer by itself

The autopilot is an async function awaiting GSAP tweens: the drawn pointer goes to the arrow, presses, picks the arrival, glides to the departure (on every frame elementFromPoint tells which day is under it, and the stroke follows), rests on Reserve, clears and goes back. It starts from the load event and stops at the first real touch.

Values to change

NameFileDefaultWhat it changes
START_YEARscript.js2027The year of the first month shown.
START_MONTHscript.js4The first month shown (1 = January); the pointer books in the next one.
NIGHTscript.js148The price of a weekday night, in euro.
WEEKENDscript.js52How much more a Friday or Saturday night costs.
ARRIVEscript.js13The day the pointer arrives.
LEAVEscript.js17The day the pointer leaves.
ROLLscript.js0.9How many seconds the nights and the total take to roll.
SPRINGscript.js1How springy the moves are: 0.4 calm, 2 very bouncy.
SPEEDscript.js1The speed of the autopilot: 2 twice as fast, 0.5 half.
AUTOscript.jstrueThe drawn pointer goes round by itself until someone touches the card.

Try them in the Playground

When to use it

For the page of a vacation rental, a hotel, a B&B, a farm stay or a campsite, and for any booking by nights or days (rentals, rooms, studios): it shows at once what each night costs, what is already taken and how much the whole stay comes to while the dates are being picked.

On phones

On the phone the card takes the full width minus the margins and the days get shorter with the screen’s height (clamp in vh), so the whole month fits in the frame; there is no hover, so the stroke jumps to the day between the first and the second tap.

With reduced motion

Nothing slides or bounces: the months swap with a fade, the stroke appears already whole, nights and total change in place without rolling, the drawn pointer is gone and the autopilot only changes the states.

Pitfalls

  • With Mona Sans tabular figures the total came out with a slashed zero and looked like a code font: the odometer columns already have a fixed width, so the numbers use proportional figures.
  • In the phone frame the card spilled sideways: the dates line did not shrink because a flex item does not go below its minimum width. With min-width 0 on the card and the line and a minmax(0, 1fr) column on the stage the card fits, and the tiles and the stroke are back under their days.
  • A queue of tweens in a repeating timeline records the pointer’s positions only once, and after a resize it pointed at nothing: the loop is an async function that measures every target just before moving.
  • When the loop started as soon as the script was read the poster landed on different moments: it starts from the load event.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 12 KB; the libraries: GSAP 28 KB.

Testing

Tested on 4 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