Skip to content
animorio
IT
Back to the library

Hotel floor plan

Scroll, SVGGSAP, CSS onlyMediumCompressed weight: Demo 12 KBGSAP + ScrollTrigger 45 KBLenis 5.3 KBFreeDownload the zip

Scroll inside the preview

The booking page of Velmoor House, a made-up city hotel: as you scroll, the fourth floor seen from above draws itself in thin lines on a night background (the walls, the corridor, the partitions between the rooms, the windows, the doors swinging open, the beds, desks and bathrooms landing on a spring). Then a light runs down the corridor and the rooms free for the chosen dates light up warm one after the other, the bedside lamp with a small flicker and the window glowing outside, while the taken ones stay dark under a fine hatch and the count of free rooms rolls up. At the end the corner room is chosen: the others dim, a warm line goes round it, its light spills through the door into the corridor and the card underneath turns from its loading shimmer into the room, the price per night and ‘Check availability’.

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>
<!--
  "Hotel floor plan" 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>Velmoor House, fourth floor</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>
  <!-- the booking page of a made-up city hotel, Velmoor House. The stage sticks while you scroll and the scroll draws
       the plan of the fourth floor seen from above in thin lines: the walls, the rooms, the windows, the doors, the
       furniture. Then a light runs down the corridor and the rooms free for your dates light up warm one by one, the
       taken ones stay dark under a fine hatch, the best one opens its door and spills its light into the corridor, and
       its card resolves with the price per night and Check availability. -->
  <main>
    <section class="floor" data-floor>
      <div class="stage" data-stage>
        <div class="light" data-light aria-hidden="true"></div>
        <div class="grain" aria-hidden="true"></div>

        <div class="frame" data-frame>
          <article class="panel" data-panel>
            <span class="panel__edge" aria-hidden="true"></span>
            <span class="panel__glow" aria-hidden="true"></span>

            <header class="head">
              <span class="mark" aria-hidden="true">
                <svg viewBox="0 0 16 16"><path d="M3.5 13.5V7.2a4.5 4.5 0 0 1 9 0v6.3"/><path d="M6.4 13.5V9.4a1.6 1.6 0 0 1 3.2 0v4.1"/></svg>
              </span>
              <p class="brand">Velmoor House <span class="brand__floor muted">Fourth floor</span></p>
              <p class="dates">
                <svg viewBox="0 0 16 16" aria-hidden="true"><rect x="2.5" y="3.5" width="11" height="10" rx="2.2"/><path d="M2.5 6.8h11M5.5 2.2v2.4M10.5 2.2v2.4"/></svg>
                <span>14 to 16 Nov</span><span class="dates__sep" aria-hidden="true"></span><span class="muted">2 guests</span>
              </p>
            </header>

            <div class="map" data-map>
              <svg class="plan" viewBox="0 0 640 300" role="img" aria-label="Plan of the fourth floor of Velmoor House seen from above, with the rooms free for your dates lit">
                <defs>
                  <radialGradient id="lamp" cx="0.5" cy="0.5" r="0.5">
                    <stop offset="0" style="stop-color:var(--warm)" stop-opacity="0.62"/>
                    <stop offset="0.35" style="stop-color:var(--warm)" stop-opacity="0.24"/>
                    <stop offset="1" style="stop-color:var(--warm)" stop-opacity="0"/>
                  </radialGradient>
                  <linearGradient id="spill-up" x1="0" y1="0" x2="0" y2="1">
                    <stop offset="0" style="stop-color:var(--warm)" stop-opacity="0.5"/>
                    <stop offset="1" style="stop-color:var(--warm)" stop-opacity="0"/>
                  </linearGradient>
                  <linearGradient id="scan" x1="0" y1="0" x2="1" y2="0">
                    <stop offset="0" stop-color="#fff" stop-opacity="0"/>
                    <stop offset="0.7" stop-color="#fff" stop-opacity="0.07"/>
                    <stop offset="0.96" stop-color="#fff" stop-opacity="0.22"/>
                    <stop offset="1" stop-color="#fff" stop-opacity="0"/>
                  </linearGradient>
                  <pattern id="hatch" width="5" height="5" patternUnits="userSpaceOnUse" patternTransform="rotate(45)">
                    <line x1="0" y1="0" x2="0" y2="5" style="stroke:var(--hair-soft)" stroke-width="0.8"/>
                  </pattern>
                  <filter id="soft" x="-50%" y="-200%" width="200%" height="500%">
                    <feGaussianBlur stdDeviation="3"/>
                  </filter>
                  <clipPath id="inside"><rect x="21" y="21" width="598" height="258"/></clipPath>
                </defs>

                <rect class="floorplate" x="20" y="20" width="600" height="260" rx="1"/>
                <g data-outside></g>
                <g data-lights></g>
                <g data-hatches></g>
                <g clip-path="url(#inside)"><rect class="scan" data-scan x="-80" y="20" width="80" height="260" fill="url(#scan)"/></g>
                <g data-spill></g>
                <g class="lines" data-lines></g>
                <g class="furniture" data-furniture></g>
                <g class="doors" data-doors></g>
                <g class="labels" data-labels></g>
                <rect class="pick" data-pick x="0" y="0" width="10" height="10" rx="2"/>
              </svg>
            </div>

            <footer class="foot">
              <div class="count">
                <p class="count__line"><b class="count__num" data-count>0</b> <span>rooms free</span></p>
                <p class="count__sub muted">on this floor, for two nights</p>
              </div>

              <div class="card" data-card>
                <div class="card__wait" data-wait aria-hidden="true">
                  <span class="bar bar--a"></span><span class="bar bar--b"></span><span class="bar bar--c"></span>
                </div>
                <div class="card__room" data-room>
                  <div class="card__text">
                    <p class="card__kind muted">Corner King</p>
                    <p class="card__name">Room 406</p>
                    <p class="card__meta muted">31 m<sup>2</sup>, two windows on the park</p>
                  </div>
                  <div class="card__buy">
                    <p class="price"><b data-price>0</b><span class="muted"> / night</span></p>
                    <a class="cta" href="#" data-cta>
                      <span class="cta__fill" aria-hidden="true"></span>
                      <span class="cta__words">Check availability</span>
                      <svg class="cta__arrow" viewBox="0 0 16 16" aria-hidden="true"><path d="M3.5 8h8.6M8.6 4.4 12.2 8l-3.6 3.6"/></svg>
                    </a>
                  </div>
                </div>
              </div>
            </footer>
          </article>
        </div>
        <p class="sr" aria-live="polite" data-live></p>
      </div>
    </section>
  </main>

  <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>

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 “Hotel floor plan” 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 background, with a warm light growing behind it, sits the glass panel of Velmoor House, a made-up city hotel: the mark with the arch of a door, ‘Fourth floor’, the date pill ‘14 to 16 Nov, 2 guests’; in the middle the plan of the floor on a barely visible grid, underneath the count of free rooms and the room card, still waiting with three shimmering lines. As you scroll the stage stays put and the plan draws itself: first the outline of the walls, then the two corridor walls with the gap of every door, the partitions between the twelve rooms running from the corridor to the windows, the lifts and the stairs on the left; the windows open in the wall, the doors turn on their hinges, pass their stop by a breath and come back, with their dotted swing. Then the furniture arrives room by room on a spring: the bed, the two pillows a beat later, the bedside table with its lamp, the desk with its chair, the bathroom with the shower and the basin, and the room numbers. A light runs down the corridor from left to right: where it passes the free rooms light up, the lamp catches with a small flicker and spreads on a spring, the room takes a breath of amber, the window glows outside and the number warms, while the counter rolls from zero to five, one small roll for each room; the taken ones are covered by a fine hatch and stay dark. Then 406 is chosen, the corner room with two windows: the other free rooms dim, a warm line goes round it, its number swells, the door opens a little further and its light spills into the corridor like a fading blade. The card leaves its shimmer and composes itself line by line: ‘Corner King’, ‘Room 406’, ‘31 m², two windows on the park’, the price counting up to 214 euros a night and the ‘Check availability’ pill lighting up with its swelling fill. Scrolling back takes it all apart again.

How it works

A still stage and a single timeline

The section is 440vh tall and the stage inside is sticky, 100vh tall (100lvh where it exists). The whole floor is one paused GSAP timeline that ScrollTrigger drives with scrub: the scroll is the time, and scrolling back takes it all apart on its own. Lenis makes the scrolling soft.

The floor generated in the viewBox

The script draws the floor in a 640 by 300 viewBox: twelve identical rooms, six above and six below the corridor. Every room is drawn once as if it were above, and the ones below are the same drawing flipped by a matrix (y becomes 300 minus y): doors, beds and bathrooms mirror themselves.

Walls that draw, doors that swing

Every wall has a dash as long as itself (getTotalLength) and the dashoffset goes to zero. The doors are a line whose second end is computed from the angle around the hinge, with two keyframes: six degrees past the stop and back.

The running light and the rooms that answer

The corridor light is a rectangle with a gradient crossing the plan; every free room lights up at the exact moment the light passes its centre. The lamp is a radial gradient clipped to the room, with a three-frame flicker and a spring on its size.

The card that composes itself

The counter and the price are read from the timeline's time at every update; the counter makes a small roll when it changes. The card turns from its shimmering lines into the room, and the pill lights up and becomes pressable only past a threshold.

Values to change

NameFileDefaultWhat it changes
RIDEscript.js1How much scroll the whole floor takes: 2 = twice as long.
BOUNCEscript.js1.7How far the furniture passes its size as it lands (0 = none).
FLICKERscript.js0.45How much a lamp flickers as it catches (0 = none).
GLOWscript.js1How strong the lamp light and the warm light behind the panel are.
DIMscript.js0.42How much the other free rooms dim once the room is chosen (1 = not at all).
PRICEscript.js214The price per night of the chosen room, in euros.

Try them in the Playground

When to use it

On the booking page or the ‘rooms’ section of a hotel, a hostel, a serviced apartment or a B&B, a booking platform, a coworking space with rooms to reserve or an office with free desks: wherever you want to show what is free while scrolling. The colours are --warm, --hair and --page in the CSS, the free rooms and the chosen one FREE and CHOSEN in the script.

On phones

The same animations at adapted sizes: the panel is as wide as the height allows, below 600 pixels the counter goes on one line above the card and the floor next to the name goes, so it all fits in 341 by 410.

With reduced motion

No long scroll and no movement: the floor is already drawn, the free rooms lit, 406 chosen and the card ready with its price; the panel fades in.

Pitfalls

  • The rooms below flipped by a matrix flip their text too: the room numbers sit outside the flipped groups.
  • A clipPath inside a flipped group uses the group's coordinates: so it can be drawn once just like the rooms above.
  • Doors turned with rotation and svgOrigin inside the flipped groups all ended up at the same spot outside the plan: the door is a line whose second end is computed from the angle (cosine and sine) at every update; the chosen room number also grows by its font size, not by a scale.

Libraries

GSAP 3.15.0, ScrollTrigger 3.15.0, Lenis 1.3.26, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 12 KB; the libraries: GSAP + ScrollTrigger 45 KB, Lenis 5.3 KB.

Testing

Tested on 9 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 animations