Skip to content
animorio
IT
Back to the library

Night baby monitor

SVG, HoverGSAP, CSS onlyMediumCompressed weight: Demo 7.0 KBGSAP 28 KBFreeDownload the zip

The baby monitor of a nursery, at night, in a dark card: the sound of the room scrolls as a strip of small bars, the newest on the right. First it is quiet, then the baby stirs and the bars turn gold, then they cross the dashed line and turn coral: the status at the top goes from “Sleeping” to “Stirring” to “Crying”, the card gives a start and below it counts for how long. With the pointer on the strip a hairline says how long ago and how loud. “Play lullaby” starts the lullaby and the room goes quiet again. Minimal style.

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>
<!--
  "Night baby monitor" 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>Baby monitor at night</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">
    <!-- a baby monitor at night: the sound of the nursery scrolling as a strip of bars, quiet, then restless,
         then over the line; the status follows what the strip says, and a lullaby settles it again -->
    <section class="bm" data-bm aria-label="Baby monitor">
      <header class="bm__head">
        <div class="bm__what"><strong>Mila’s room</strong><span>Nursery monitor, live</span></div>
        <span class="bm__pill" data-pill><span class="bm__clip"><span data-outstate>Sleeping</span></span></span>
      </header>

      <div class="bm__strip" data-strip>
        <svg class="bm__svg" viewBox="0 0 312 96" preserveAspectRatio="none" aria-hidden="true">
          <line class="bm__limit" data-limit x1="0" x2="312" y1="20" y2="20"></line>
          <line class="bm__limit" data-limit x1="0" x2="312" y1="76" y2="76"></line>
          <g data-bars></g>
          <line class="bm__hair" data-hair x1="0" x2="0" y1="6" y2="90"></line>
        </svg>
        <span class="bm__tip" data-tip><b data-outwhen>now</b><i data-outloud>Quiet</i></span>
      </div>

      <div class="bm__row">
        <span class="bm__since"><span class="bm__clip"><span data-outsince>Quiet for 14:32</span></span></span>
        <span class="bm__room">20.5°C<i></i>48% humidity</span>
      </div>

      <button type="button" class="bm__btn" data-lull aria-pressed="false">
        <span class="bm__eq" aria-hidden="true"><i></i><i></i><i></i></span>
        <span class="bm__clip bm__clip--btn"><span data-outbtn>Play lullaby</span></span>
      </button>
    </section>
    <span class="live" aria-live="polite" data-live></span>

    <svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.200 19.200 11l-6.300 1.600-3.300 5.900Z"></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>

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.

20 values to change

Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI

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 “Night baby monitor” 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 black, a dark rounded card: at the top “Mila’s room”, “Nursery monitor, live” and on the right the status pill, “Sleeping”. Below, a darker panel with the sound of the last five seconds: a row of pale rounded bars, centred vertically, scrolling smoothly to the left and fading at the edge; the newest grows as it enters from the right. Two dashed lines mark the threshold. Then a row: “Quiet for 14:32” and on the right “20.5°C” and “48% humidity”. At the bottom the light button “Play lullaby” with three tiny bars. After a few seconds the bars jump up and turn gold: the pill rolls to “Stirring” and the row counts “Stirring for”. Then the crying comes, in waves with sobs: the bars cross the line and turn coral, the pill says “Crying”, the card’s edge and shadow take the coral and the card gives a start. Moving over the strip a hairline appears on the nearest bar and a glass label says “2.3 s ago” and “Quiet”, “Restless” or “Loud”. Tapping “Play lullaby” the button empties, the three bars play and it counts the seconds left; the crying fades in three seconds, the bars go low and pale again and the status returns to “Sleeping” with a small breath of the card.

How it works

A row of samples

The sound is a list of numbers between 0 and 1: every 0.11 seconds one comes in on the right and one leaves on the left. The bars are always the same, only height and colour change.

Scrolling without steps

Between one sample and the next the group of bars slides by one step; at the new sample it goes back to zero with the heights moved one place. The last bar grows as it comes in.

Status read from the strip

“Crying” is not decided by the script: it fires when at least five of the last nine bars are over the line, and stays while two remain.

Hairline and label

The nearest bar comes from the pointer’s position; hairline and label are rewritten at every sample, because under the pointer the strip keeps scrolling.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#ff8a5cThe colour of crying: the bars over the line, the status and the card’s edge.
SENSscript.js0.5The sound threshold, from 0.2 (fires at once) to 0.9 (loud crying only).
CALMscript.js5How many quiet seconds before the nursery stirs.
LULLABYscript.js6How many seconds the lullaby lasts.
LOOPscript.jstrueLeft alone, the demo’s pointer reads the strip and starts the lullaby.

Try them in the Playground

When to use it

In a baby monitor or smart home app, on the page presenting the product or in the parents’ dashboard; the same strip with a threshold carries the noise of an office, a dog barking home alone, a microphone level on a call or the vibrations of a machine in a workshop.

On phones

The card is at most 352 pixels wide and about 290 tall. The strip narrows with the card and the bars with it; with a finger you read by dragging on the strip. The button is 44 pixels tall.

With reduced motion

The strip advances in steps, one sample at a time, without sliding; no starts or bounces, status and texts change in one step, the button’s three bars stay still. The demo’s pointer does not start.

Pitfalls

  • The status is not just a colour: the pill writes it and the row below counts how long it has lasted; changes are announced to screen readers only once.
  • Without the hysteresis (five bars to enter, two to stay) the status flickers at every sob.
  • Bars are not created or destroyed: 47 fixed rectangles, otherwise the browser rebuilds the drawing at every sample.
  • The sound here is made up by a small seeded generator: in a real app the samples come from the microphone, and the rest does not change.
  • Name, temperature and humidity are invented.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 2 December 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