
The elastic button
Buttons, Hover, Text
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.
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>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
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 siteWhile 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 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 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.
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.
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.
| Name | File | Default | What it changes |
|---|---|---|---|
PRICE | script.js | 9 | How much each extra half hour costs, in euros. |
REQUEST_FROM | script.js | 14 | From what hour the checkout becomes on request. |
SNAP | script.js | 0.55 | How long the handle’s spring lasts when you let go, in seconds. |
SPRING | script.js | 0.55 | How much the handle bounces into place (lower bounces more). |
SUN_START | script.js | #f5b53d | The sun’s colour at eleven. |
SUN_END | script.js | #ee5f2b | The sun’s colour at four. |
ACCENT | script.js | #ee7a2b | The colour of the price, the confirmation and the mark on the handle. |
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.
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.
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.
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.
Tested on 29 October 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.