
Speeding marquee
Scroll, Text, Hover
The price calendar of a small hotel: every day of the month with its price for the night. The switch at the top lights up the cheapest nights one after the other, from the least expensive; a tap sets the arrival, the nights stretch as a band up to the departure and at the bottom the total rolls with the number of nights.
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>
<!--
"Nightly price 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>Nightly price calendar with the cheapest nights lighting up</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">
<!-- the price calendar of a small hotel: every day of the month with its price for the night; the switch at the
top lights up the cheapest nights one after the other; a tap sets the arrival, the nights stretch as a band
up to the departure and the total at the bottom rolls with the number of nights -->
<section class="card" data-card aria-label="Prices per night in December">
<header class="head">
<div>
<p class="head__place">Casa Lume, Lisbon</p>
<h1 class="head__title">December</h1>
</div>
<button class="flex" type="button" role="switch" aria-checked="false" data-flex>
<span class="flex__label">Cheapest nights</span>
<span class="flex__track" aria-hidden="true"><span class="flex__knob" data-knob></span></span>
</button>
</header>
<div class="week" aria-hidden="true"><span>M</span><span>T</span><span>W</span><span>T</span><span>F</span><span>S</span><span>S</span></div>
<div class="grid" data-grid></div>
<footer class="foot">
<p class="foot__what"><span data-what>Pick your arrival</span></p>
<p class="foot__total"><span data-total></span></p>
</footer>
</section>
<p class="sr" data-live aria-live="polite"></p>
<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.
23 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 “Nightly price calendar” from Animorio and fit it into my siteThe script creates the days: one empty cell so the month starts on a Tuesday, then 31 buttons with number and price. The price comes from three knobs (base, weekend, holidays) plus a small fixed variation, the same at every load.
The days are sorted by price and the first CHEAP take the is-cheap class; the tile behind each scales from 0.5 to 1 with elastic.out, staggered by STAGGER in price order. So the eye sees the best night first.
Three numbers: arrival, departure and the day under the pointer. paint reads them and sets the classes: is-from and is-to for the navy ends with corners rounded on one side only, is-in for the band in between.
At every change the prices of the nights from the arrival to the day before the departure are added up. The number rolls up if the total rises and down if it falls.
The days are buttons: you reach them with Tab, focus acts as the pointer for the band and Esc clears the choice.
| Name | File | Default | What it changes |
|---|---|---|---|
BASE | script.js | 96 | The price of an ordinary night, in euros. |
WEEKEND | script.js | 34 | How much more Friday and Saturday cost. |
HOLIDAYS | script.js | 58 | How much more it costs from the 23rd to the end of the month. |
CHEAP | script.js | 6 | How many cheap nights light up. |
STAGGER | script.js | 0.07 | The delay between one cheap night and the next, in seconds. |
ACCENT | script.js | #0f9f7c | The colour of the cheap nights. |
BAND | script.js | #13212b | The colour of arrival and departure. |
LOOP | script.js | true | Left alone, a pointer lights the cheap nights and picks three nights. |
For the site of a hotel, a bed and breakfast, a holiday home or a campsite whose prices change from day to day: people with flexible dates see at once when it is worth going. The same calendar suits flights, trains and rentals.
The same card, as wide as the screen: seven columns sharing the width, slightly shorter days on short screens. With a finger you tap the arrival and then the departure; the band shows after the second tap.
No springs: the cheap nights fade in all together, the knob goes straight to its place and the total changes with a fade.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 5.8 KB; the libraries: GSAP 28 KB.
Tested on 14 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.