Skip to content
animorio
IT
All components

Late checkout card

Cards, HoverGSAP, CSS onlyMediumCompressed weight: Demo 8.5 KBGSAP 28 KBFreeDownload the zip

A hotel’s checkout card in its app, with a single gesture: dragging the handle along the day, from eleven to four, moves the checkout time half an hour at a time, the sun sinks along its arc and warms in colour, the price is recalculated and after two the day becomes on request. The button confirms with a sweep of colour and a drawn tick; pressed again, you can change it.

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>
<!--
  "Late checkout card" 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 late checkout card with the sun setting as you drag the time</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: drag. The late checkout card of a hotel app: dragging the handle along the day moves the
         checkout time by half hours, the sun travels along its arc and warms up, the price is recalculated, and after
         two o'clock the day becomes "on request". Pressing the button confirms; pressing it again lets you change -->
    <section class="card" data-card aria-label="Late checkout, Maren House">
      <header class="card__head">
        <span class="card__mark" aria-hidden="true">
          <svg viewBox="0 0 20 20"><circle cx="7" cy="10" r="3.2"></circle><path d="M10.2 10h7.3M15 10v2.6M17.5 10v1.8"></path></svg>
        </span>
        <span class="card__who">
          <span class="card__hotel">Maren House</span>
          <span class="card__room">Room 412, Sun 2 Nov</span>
        </span>
        <span class="card__badge" data-badge><span>Checkout</span></span>
      </header>

      <div class="sky" aria-hidden="true">
        <svg class="sky__svg" viewBox="0 0 320 96" preserveAspectRatio="xMidYMax meet">
          <defs>
            <radialGradient id="sky-glow" cx="50%" cy="50%" r="50%">
              <stop offset="0" stop-opacity="0.38"></stop>
              <stop offset="1" stop-opacity="0"></stop>
            </radialGradient>
            <clipPath id="sky-clip"><rect x="0" y="0" width="320" height="88"></rect></clipPath>
          </defs>
          <path class="sky__arc" d="M24 88 A136 76 0 0 1 296 88"></path>
          <path class="sky__trail" data-trail d="M24 88 A136 76 0 0 1 296 88"></path>
          <g clip-path="url(#sky-clip)">
            <g class="sun" data-sun>
              <circle class="sun__glow" r="26" fill="url(#sky-glow)"></circle>
              <g class="sun__rays" data-rays></g>
              <circle class="sun__disc" r="7.5"></circle>
              <circle class="sun__shine" cx="-2.4" cy="-2.6" r="2.1"></circle>
            </g>
          </g>
          <line class="sky__horizon" x1="10" y1="88" x2="310" y2="88"></line>
        </svg>
      </div>

      <div class="readout">
        <span class="readout__time" data-time aria-live="polite"><span>11:00</span></span>
        <span class="readout__side">
          <span class="readout__price" data-price><span>Included</span></span>
          <span class="readout__note" data-note><span>Standard checkout</span></span>
        </span>
      </div>

      <div class="track" data-track>
        <div class="track__rail">
          <span class="track__request" aria-hidden="true"></span>
          <span class="track__fill" data-fill></span>
          <span class="track__ticks" data-ticks aria-hidden="true"></span>
          <span class="handle" data-handle role="slider" tabindex="0" aria-label="Checkout time" aria-valuemin="660" aria-valuemax="960" aria-valuenow="660" aria-valuetext="11:00">
            <span class="handle__knob"></span>
          </span>
        </div>
        <div class="track__labels" aria-hidden="true">
          <span>11</span><span>12</span><span>13</span><span>14</span><span>15</span><span>16</span>
        </div>
      </div>

      <button class="cta" type="button" data-cta>
        <span class="cta__sweep" data-sweep aria-hidden="true"></span>
        <span class="cta__label" data-cta-label><span>Drag to stay longer</span></span>
      </button>
    </section>

    <svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.2 19.2 11l-6.3 1.6-3.3 5.9Z"></path></svg>
  </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.

30 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 “Late checkout card” 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 background there is only a card: the checkout of Maren House, a made-up hotel, for room 412, Sunday 2 November. At the top, the drawn key, the hotel’s name and a grey tag, Checkout. Below it is the sky of the day: a dashed arc above a horizon line, and on the arc the sun, a yellow disc with a glint, eight short rays and a soft glow; behind the sun the part of the arc already travelled is a solid line in its colour. Then the time, big, 11:00, and on the right the price, Included, with Standard checkout under it. Lower down is the rail of the day, from eleven to four, with a long tick for every hour, a short one for every half hour and, from two onwards, a light hatch: there the checkout is on request. On the rail sits the handle, a white circle with a small orange diamond. At the bottom the grey button says Drag to stay longer. Dragging the handle (or touching the rail) the handle swells a little, the rail fills with a gradient from yellow to orange, the ticks passed light up, the sun sinks along the arc towards the horizon, its rays shorten and turn a little, and its colour moves from yellow to a deep orange. At every half hour the time changes, the old one leaving upwards before the new one comes in from below, and with it the price changes (+€9 per half hour) and the line below it: Confirmed instantly until two, Subject to availability after. Let go, the handle stops on the nearest half hour with a spring and a small bounce, and the button turns black: Add late checkout (or Request late checkout after two). Pressed, the button gives and comes back, a sweep from yellow to orange crosses it from the left, and the label becomes Checkout at 13:30 with a tick drawing itself, on a soft orange background; the tag at the top becomes Late checkout, the line under the price Added to your bill, the rail fades and the handle shrinks: the time is set. Pressing again lets you change it. Pressing the grey button at eleven, the handle gives a little nudge to show that it drags. A drawn pointer drags to half past one, confirms, goes back to changing and brings the handle back to eleven, by itself, until you touch the card.

How it works

One continuous value, one shown

While dragging, the value is continuous (the handle, the rail and the sun follow the finger with no steps); the texts change only when a half hour is crossed, and on release the value goes to the nearest half hour with elastic.out.

The sun on the arc

The arc is half an SVG ellipse: the time becomes a fraction of the arc, from 36 to 92 per cent, and the fraction an angle; the sun is placed at that point with translate, and the solid line behind it is the same arc with a stroke-dasharray as long as the part travelled.

The colour of the afternoon

The sun’s colour is a CSS variable recalculated every frame by mixing eleven o’clock yellow with four o’clock orange: the disc, the rays, the glow and the arc line all use it, so everything warms together.

One text at a time

Time, price, the line below and the button are windows one line high: the old text leaves in 0.11 seconds and only then does the new one come in with back.out, upwards if the time grows and downwards if it shrinks; two texts never share a place.

Confirmation as a state

The button is not just an action: once confirmed it becomes the confirmation itself, with the tick drawn by stroke-dashoffset, and the whole card moves to its set state (faded rail, smaller handle, dragging off) until it is pressed again.

Values to change

NameFileDefaultWhat it changes
PRICEscript.js9How much each extra half hour costs, in euros.
REQUEST_FROMscript.js14From what hour the checkout becomes on request.
SNAPscript.js0.55How long the handle’s spring lasts when you let go, in seconds.
SPRINGscript.js0.55How much the handle bounces into place (lower bounces more).
SUN_STARTscript.js#f5b53dThe sun’s colour at eleven.
SUN_ENDscript.js#ee5f2bThe sun’s colour at four.
ACCENTscript.js#ee7a2bThe colour of the price, the confirmation and the mark on the handle.

Try them in the Playground

When to use it

In the app or the website of a hotel, a holiday home or a hostel to ask for a later checkout; with other words, to pick the time of a table, a pickup or a delivery along the day.

On phones

The same card at the width of the screen, with a lower sky on short screens; a finger drags the handle or touches the rail, which doesn’t scroll the page.

With reduced motion

No springs, bounces or sweeps: the handle and the sun go straight to their place, the texts change with a fade and the confirmation appears already done. The drawn pointer does not run.

Pitfalls

  • An SVG gradient stop’s colour doesn’t read var() in the stop-color attribute: it has to go in the CSS (stop-color is also a CSS property), otherwise the sun’s glow stays black.
  • If the texts change on every finger movement, they pile up while dragging: they change only when the shown value crosses a half hour, and each text has its own timeline that is stopped before starting again.
  • The rail needs touch-action: none, otherwise on a phone the drag scrolls the page and the finger is lost halfway.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 29 October 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