Skip to content
animorio
IT
All components

Do not disturb room switch

Toggles, HoverGSAP, CSS onlyMediumCompressed weight: Demo 7.1 KBGSAP 28 KBFreeDownload the zip

The bedside panel of a hotel suite: two touch keys under smoked glass, Do not disturb and Make up room. A single light lives under the glass: touching a key it slides over on a spring, stretches as it travels, warms to amber for Do not disturb or cools to ice for Make up room, flares for an instant under the finger and lights the edge of the glass only where it rests. Touching the lit key again turns the sign off; the line underneath says what housekeeping will do and the small door tag what the corridor reads.

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>
<!--
  "Do not disturb room switch" 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 do not disturb switch with the light under the glass</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 bedside panel of a hotel suite: two capacitive keys under smoked glass, Do not disturb and Make up room.
         A light lives under the glass: it slides on a spring to the key you touch, stretches while it travels, warms
         to amber for Do not disturb and cools to ice for Make up room, and lights the edge of the glass where it sits.
         Touching the lit key again turns the sign off. -->
    <section class="panel" data-panel aria-label="Door sign, Suite 412">
      <header class="panel__head">
        <span class="panel__room">Suite 412</span>
        <span class="panel__hotel">Halvard Hotel</span>
      </header>

      <div class="pad" data-pad>
        <span class="pad__grain" aria-hidden="true"></span>
        <span class="glow" data-glow aria-hidden="true">
          <span class="glow__bloom" data-bloom></span>
          <span class="glow__strip" data-strip></span>
        </span>
        <span class="pad__edge" aria-hidden="true"></span>
        <span class="pad__sheen" aria-hidden="true"></span>
        <span class="pad__seam" aria-hidden="true"></span>

        <button class="key" type="button" aria-pressed="false" data-key="dnd">
          <span class="key__face" data-face>
            <svg class="key__icon" viewBox="0 0 20 20" aria-hidden="true">
              <path class="key__moon" d="M15.6 12.4A6.4 6.4 0 0 1 7.6 4.4a6.4 6.4 0 1 0 8 8z"/>
            </svg>
            <span class="key__label">Do not disturb</span>
          </span>
        </button>
        <button class="key" type="button" aria-pressed="false" data-key="mur" data-autoclic>
          <span class="key__face" data-face>
            <svg class="key__icon" viewBox="0 0 20 20" aria-hidden="true">
              <path d="M9 3.2c.45 3 1.8 4.35 4.8 4.8-3 .45-4.35 1.8-4.8 4.8-.45-3-1.8-4.35-4.8-4.8 3-.45 4.35-1.8 4.8-4.8z"/>
              <path d="M14.6 12.2c.2 1.25.75 1.8 2 2-1.25.2-1.8.75-2 2-.2-1.25-.75-1.8-2-2 1.25-.2 1.8-.75 2-2z"/>
            </svg>
            <span class="key__label">Make up room</span>
          </span>
        </button>
      </div>

      <footer class="panel__foot">
        <span class="status" data-status><span class="status__line" data-line>Housekeeping 10:00 to 14:00</span></span>
        <span class="panel__door" data-door>
          <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M4 14V2.6h7.2V14M2.6 14h10.8M9 8.4h.01"/></svg>
          <span data-doorword>Off</span>
        </span>
      </footer>
    </section>
    <p class="sr" aria-live="polite" data-live></p>
  </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.

22 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 “Do not disturb room switch” 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 black page a dark panel with round corners slowly rises: at the top ‘Suite 412’ and the invented hotel's name, Halvard Hotel, in small type; in the middle a plate of smoked glass with a very fine grain, split by a thin line into two keys, the moon of ‘Do not disturb’ and the two sparkles of ‘Make up room’, both off, grey. Underneath, the line ‘Housekeeping 10:00 to 14:00’ and the door tag with its small drawn door and ‘Off’. The finger touches Make up room: from the point of the touch a thin ring spreads under the glass, the key gives and comes back on a spring, and from below an ice coloured light rises, with a very thin LED strip along the bottom of the glass and a haze lighting the plate from underneath; the edge of the glass lights up only along that stretch, the sparkles and the label catch the light. The line underneath rolls to ‘Housekeeping by 11:30’, the tag lights up and says ‘Service’. Then the finger touches Do not disturb: the light slides across on a spring, stretching as it runs, passes the key by a pixel and settles, warming to amber on the way; it flares for an instant under the finger, the moon lights up, the line says ‘Housekeeping skips today’ and the tag ‘Privacy’. Back to Make up room, then touched again: the sign turns off, the light sinks under the glass and the loop starts over. With the pointer a faint reflection follows the finger over the glass and the keys can really be touched, from the keyboard too.

How it works

The layered glass

The plate is a two column grid with hidden overflow and isolation: underneath sits the light (a single element with the haze and the LED strip), above it an SVG feTurbulence grain in overlay blending, the reflection following the pointer, the thin line between the keys and the real keys, which are buttons with aria-pressed.

A spring for the light

The light's position is not a tween: it is a spring integrated by hand on the GSAP ticker, stiffness 210 and damping 21, in two steps per frame with the step capped at a thirtieth of a second. So it passes the key by a pixel and settles, and touching the other key halfway it starts from the speed it has. When it is still the loop leaves the ticker.

It stretches as it runs

The light is two thirds of a key wide, plus a share that grows with the spring's speed (up to 50% more): still it is an oval, travelling a streak. The colour is one number between 0 and 1 that GSAP takes from amber to ice, mixed by hand in the three channels and passed to the CSS as --lr, --lg, --lb.

The edge catching the light

The edge of the glass is a one pixel ring cut by two masks in exclusion (content-box against the whole box), filled with a radial gradient centred on the light's x (--lx): it lights up only along the stretch under the light and follows it. The panel's shadow takes a haze of the light's colour too, at a third of the strength.

The touch

On a touch a timeline takes the flare to 1 in 0.1 s and back to zero in 0.9 s, the key sinks to 95.5% and returns with elastic.out, and a thin ring spreads from the exact point of the finger. The line underneath is replaced by a new one coming in from below with back.out while the old one leaves at the top. Touching the lit key again sets the state back to Off and the intensity drops to zero.

Values to change

NameFileDefaultWhat it changes
STIFFNESSscript.js210The spring carrying the light from key to key: higher is quicker.
DAMPINGscript.js21Lower lets the light pass the key and come back.
STRETCHscript.js0.5How much the light stretches while it travels.
GLOWscript.js1How bright the light under the glass is.
FLASHscript.js0.45How much the light flares under the finger.
SPEEDscript.js12 = the walk on its own twice as fast, 0.5 = half.
LOOPscript.jstrueGoes through the three states again on its own.

Try them in the Playground

When to use it

For the app or site of a hotel, a holiday home or a serviced apartment: the room panel where the guest asks not to be disturbed or to have the room made up. It also suits a smart home app or any choice between two states that can also be switched off.

On phones

The same panel with adapted sizes: it is as wide as the box allows, the glass gets shorter with the screen's height, the keys work with a finger and the ring starts from the point of the touch.

With reduced motion

The light does not travel: it fades out, moves under the chosen key and fades back in; no ring, no key giving way, the line underneath changes with a fade.

Pitfalls

  • With a tween the light always arrived in the same time, even changing mind halfway: with a hand integrated spring it starts from the speed it has, and the finger sets its character.
  • An edge lit with border-image does not follow the round corners: the ring is an element with one pixel of padding and two masks in exclusion, which respects the border-radius.
  • The keys must sit above the grain and the reflection, or the click lands on the glass layers: the layers have pointer-events none and the keys the highest z-index.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 1 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 components