
Keep scrolling
Transitions, Scroll
Scroll inside the preview
The page of a made-up lake hotel, Hotel Ardesia: under the headline sits the wide booking widget, with dates, guests, the nightly price and Check availability. As you scroll the widget comes loose and on a spring shrinks into a pill fixed at the bottom centre, its fields folding into each other, with the short dates, the guests, the total rolling digit by digit from the nightly price to the whole stay, and Book now. Scroll back up and it opens wide in its place again; at the foot of the page the pill widens into the confirmation and Book now turns into Reserved with a tick.
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>
<!--
"Sticky booking bar" 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>Hotel Ardesia · Sticky booking bar</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/newsreader@5.3.0/opsz.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/newsreader@5.3.0/opsz-italic.css">
<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>
<!-- The page of a made-up lake hotel, Hotel Ardesia. Under the headline sits the wide booking widget: dates, guests,
price and Check availability. Scroll and the widget comes loose, folds its fields into each other and shrinks on
a spring into a pill fixed at the bottom centre, with the short dates, the guests, the total that rolls from the
nightly price to the whole stay, and Book now. Scroll back up and it opens wide in its place again. At the foot
of the page the pill widens into the confirmation and Book now turns into Reserved with a tick. -->
<header class="testata">
<span class="marchio">Ardesia</span>
<nav class="testata__voci" aria-label="Sections"><span>Rooms</span><span>Breakfast</span><span>Getting here</span></nav>
</header>
<main>
<section class="apertura" data-apertura>
<p class="occhiello" data-entra>Hotel Ardesia · Valmora</p>
<h1 class="titolo" data-entra>Twelve rooms <em>above</em> the lake.</h1>
<p class="riga" data-entra>A slow house on the water, with breakfast on the terrace and a boat at the end of the garden.</p>
<div class="posto" data-posto aria-hidden="true"></div>
</section>
<section class="sezione" data-sezione>
<p class="sezione__sopra" data-riga>Rooms</p>
<h2 class="sezione__titolo" data-riga>Every room has a window on the water.</h2>
<ul class="stanze">
<li data-riga><span class="stanze__nome">Lake room</span><span class="stanze__dato">24 m²</span><span class="stanze__prezzo">from €180</span></li>
<li data-riga><span class="stanze__nome">Attic</span><span class="stanze__dato">30 m²</span><span class="stanze__prezzo">from €220</span></li>
<li data-riga><span class="stanze__nome">Corner suite</span><span class="stanze__dato">38 m²</span><span class="stanze__prezzo">from €260</span></li>
</ul>
</section>
<section class="sezione" data-sezione>
<p class="sezione__sopra" data-riga>Breakfast</p>
<h2 class="sezione__titolo" data-riga>Served until eleven, on the terrace when it’s warm.</h2>
<ul class="stanze stanze--orari">
<li data-riga><span class="stanze__nome">Weekdays</span><span class="stanze__prezzo">7:30 to 10:30</span></li>
<li data-riga><span class="stanze__nome">Weekends</span><span class="stanze__prezzo">8:00 to 11:00</span></li>
</ul>
</section>
<section class="sezione" data-sezione>
<p class="sezione__sopra" data-riga>Getting here</p>
<h2 class="sezione__titolo" data-riga>Forty minutes from the airport, and the boat stops below the garden.</h2>
</section>
<section class="sezione sezione--fine" data-sezione data-fine>
<h2 class="sezione__titolo sezione__titolo--grande" data-riga>Ready when <em>you</em> are.</h2>
<p class="sezione__nota" data-riga>Free cancellation until 48 hours before arrival.</p>
</section>
</main>
<!-- the booking bar: one fixed element that sits on the widget's place, then becomes the pill -->
<div class="barra" data-barra role="region" aria-label="Booking">
<span class="barra__luce" aria-hidden="true"></span>
<div class="largo" data-largo>
<div class="campo campo--date" data-campo><span class="campo__etichetta">Check-in · Check-out</span><span class="campo__valore">Dec 12 – Dec 15</span></div>
<div class="campo campo--ospiti" data-campo><span class="campo__etichetta">Guests</span><span class="campo__valore">2 adults</span></div>
<div class="campo campo--prezzo" data-campo><span class="campo__etichetta">Price</span><span class="campo__valore">from €<span data-prezzo-largo>180</span> <small>/ night</small></span></div>
<button class="tasto tasto--largo" type="button" data-cerca><span>Check availability</span></button>
</div>
<div class="stretto" data-stretto>
<div class="stretto__date" data-pezzo><b>Dec 12 – 15</b><span>2 guests</span></div>
<div class="stretto__totale" data-pezzo>
<b class="totale" aria-label="Total"><span class="totale__valuta">€</span><span class="totale__cifre" data-cifre></span></b>
<span data-notti>3 nights</span>
</div>
<button class="tasto tasto--prenota" type="button" data-prenota data-pezzo>
<span class="tasto__faccia" data-faccia-a>Book now</span>
<span class="tasto__faccia tasto__faccia--fatto" data-faccia-b><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3.2 8.4 6.6 11.6 12.8 4.8" pathLength="1" data-spunta/></svg>Reserved</span>
</button>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/gsap.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/ScrollTrigger.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/lenis@1.3.26/dist/lenis.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.
61 values to change
Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI
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 “Sticky booking bar” from Animorio and fit it into my siteThe bar is a single element with position fixed. At the top of the page there is an empty place as big as the widget: every frame the bar reads the place’s rectangle and sits on it, so it scrolls with the page as if it were inside.
A value s goes from 0 (widget) to 1 (pill) on a hand-written spring in GSAP’s ticker; a second value c goes from 0 to 1 for the confirmation at the foot. The bar’s position, width, height and radius are a lerp between the place’s rectangle and the pill’s, centred at the bottom.
The widget comes loose when its top passes 20% of the screen and comes back when it goes 24 pixels past that again: the small hysteresis keeps the bar from trembling on the line.
The wide layer keeps the widget’s width and is clipped by the shrinking bar; its fields slide towards the button and narrow, one after the other, as they fade. The narrow layer comes up piece by piece.
Every digit is a window one digit tall over a strip of 0 to 9 plus a blank: when the pill is nearly formed the columns roll to the total, right to left, on a back.out.
When the last section reaches the middle of the screen the pill widens; half a second later Book now presses in, the label leaves upwards and Reserved comes in from below with the tick drawing itself. Scroll back up and Book now returns.
| Name | File | Default | What it changes |
|---|---|---|---|
PRICE | script.js | 180 | The price per night shown in the widget. |
NIGHTS | script.js | 3 | The nights of the stay: the pill shows the price times these. |
LOOSE_AT | script.js | 0.2 | Share of the screen height: when the widget’s top passes it, the bar comes loose. |
PILL_WIDTH | script.js | 440 | The width of the pill at the bottom, in pixels. |
SPRING | script.js | 230 | The stiffness of the spring the bar moves on. |
DAMPING | script.js | 0.62 | The damping of the spring: lower overshoots more before settling. |
CONFIRM_DELAY | script.js | 0.5 | The seconds the pill waits at the foot before Book now becomes Reserved. |
For the page of a hotel, a holiday home, a restaurant or an event: whoever scrolls to read always has the dates, the price and the button to book within thumb’s reach, without the bar covering the page.
The widget goes on two rows (dates and guests on top, price and button below) and the pill is 94% of the screen wide and 56 pixels tall, 14 pixels from the bottom; the sections are one screen tall and keep room below for the pill. The finger’s scroll does everything.
No spring, no smooth scroll and no rolling digits: the bar goes from widget to pill with a fade, the page’s rows are already in place and Reserved appears without motion.
GSAP 3.15.0, ScrollTrigger 3.15.0, Lenis 1.3.26, Newsreader (font variabile) 5.3.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 8.3 KB; the libraries: GSAP + ScrollTrigger 45 KB, Lenis 5.3 KB.
Tested on 30 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.
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.