Skip to content
animorio
IT
All components

Home alarm arm button

Buttons, Hover, SVGGSAP, CSS onlyMediumCompressed weight: Demo 7.5 KBGSAP 28 KBFreeDownload the zip

The Arm Away button of a made-up smart home security app, Ostrum, on black. On the tap it checks the sensors one at a time, the front door, the windows and the motion, and each becomes a tick; then an amber light runs around the pill and wears away with the seconds to leave the house, and another tap cancels. At zero the circuit closes in mint green, the shield fills, the padlock snaps and the house is armed. One more tap disarms it: Welcome home.

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>
<!--
  "Home alarm arm button" 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 Arm Away button of the home alarm with the sensors that close and the exit delay</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 Arm Away button of a made-up home security app, Ostrum: pressed, it checks the front door, the windows
         and the motion sensor one by one, then a light runs around the pill for the exit delay; tap again to cancel.
         At zero the circuit closes in green, the padlock in the shield snaps shut and the house is armed. -->
    <button class="arm" type="button" data-arm aria-pressed="false">
      <span class="arm__body" aria-hidden="true"><span class="arm__tint"></span><span class="arm__light"></span></span>
      <span class="arm__edge" aria-hidden="true"></span>
      <svg class="circuit" data-circuit aria-hidden="true">
        <path class="circuit__glow" data-glow></path>
        <path class="circuit__run" data-run></path>
        <path class="circuit__tip" data-tip></path>
      </svg>

      <span class="seat" data-seat aria-hidden="true">
        <span class="seat__scan" data-scan></span>
        <svg viewBox="0 0 24 24">
          <path class="seat__fill" data-fill d="M12 3.1 5.2 5.7v5.5c0 4.3 2.9 7.8 6.8 9.4 3.9-1.6 6.8-5.1 6.8-9.4V5.7Z"></path>
          <path class="seat__shield" d="M12 3.1 5.2 5.7v5.5c0 4.3 2.9 7.8 6.8 9.4 3.9-1.6 6.8-5.1 6.8-9.4V5.7Z"></path>
          <path class="seat__shackle" data-shackle d="M10.1 11.2V9.7a1.9 1.9 0 0 1 3.8 0v1.5"></path>
          <rect class="seat__lock" data-lock x="8.7" y="11.1" width="6.6" height="4.9" rx="1.3"></rect>
          <path class="seat__hole" d="M12 12.9v1.2"></path>
        </svg>
      </span>

      <span class="label">
        <span class="label__main"><span data-word>Arm Away</span></span>
        <span class="label__sub"><span data-sub>12 sensors ready</span></span>
      </span>

      <span class="tag" data-tag aria-hidden="true">
        <span class="tag__sensors" data-sensors>
          <span class="sensor" data-sensor>
            <svg viewBox="0 0 20 20"><g class="sensor__icon"><path d="M5.5 17V3.6h9V17M3.5 17h13"></path><path d="M11.8 10.2v.8"></path></g><path class="sensor__tick" d="M5.6 10.4 8.6 13.3 14.4 7"></path></svg>
          </span>
          <span class="sensor" data-sensor>
            <svg viewBox="0 0 20 20"><g class="sensor__icon"><rect x="3.8" y="3.8" width="12.4" height="12.4" rx="1.4"></rect><path d="M10 3.8v12.4M3.8 10h12.4"></path></g><path class="sensor__tick" d="M5.6 10.4 8.6 13.3 14.4 7"></path></svg>
          </span>
          <span class="sensor" data-sensor>
            <svg viewBox="0 0 20 20"><g class="sensor__icon"><path d="M7.2 7.2a4 4 0 0 0 0 5.6M12.8 7.2a4 4 0 0 1 0 5.6M4.9 4.9a7.3 7.3 0 0 0 0 10.2M15.1 4.9a7.3 7.3 0 0 1 0 10.2"></path><path d="M10 9.2v1.6"></path></g><path class="sensor__tick" d="M5.6 10.4 8.6 13.3 14.4 7"></path></svg>
          </span>
        </span>
        <span class="tag__count" data-count><span data-secs>8s</span></span>
        <span class="tag__done" data-done>
          <svg viewBox="0 0 20 20"><path d="M7 9V7.2a3 3 0 0 1 6 0V9"></path><rect x="5" y="9" width="10" height="7.4" rx="1.8"></rect></svg>
          <span>On</span>
        </span>
      </span>
    </button>
    <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>

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.

17 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 “Home alarm arm button” 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 ground sits a graphite pill with a thread of light on its edge: on the left the shield with the padlock open, in the middle Arm Away and «12 sensors ready», on the right the door, the window and the waves of the motion sensor drawn in line. On hover the pill rises a pixel and a soft light follows the pointer; pressed, it squashes slightly. On the tap a thin arc turns around the shield and the sensors are checked one after the other: each icon hops, fades and a green tick draws itself in its place, while the line below rolls to «Front door closed», «8 windows closed», «No motion inside». Then the ticks fold away, the seconds take their place, and an amber light starts at the top centre and runs around the pill: it wears away clockwise with a brighter tip, and the number drops with a small hop. «Leave now», «Tap to cancel»: a tap winds the light back and writes Cancelled. At zero the circuit draws itself again in mint green, the shield fills, the padlock drops into place with a one pixel bounce, On appears on the right and the pill takes a green glow. Another tap opens the padlock, the light withdraws, Disarmed, Welcome home, and it goes back to rest.

How it works

The circuit of light in pixels

A single SVG path traces the pill: it starts at the top centre, goes right, makes the half circle, comes back along the bottom and closes on the other side. It is built from the button’s real width and height and rebuilt at every resize, then getTotalLength gives its length.

A piece of outline from two numbers

What shows is the stretch between a and b, two fractions of the circuit: stroke-dasharray as long as b minus a and stroke-dashoffset at minus a. The exit delay moves a from zero to one, arming moves b; the bright tip is the same path with a nine pixel dash, and below sits a blurred copy for the glow. A zero-length dash is hidden, because the round cap would draw a dot.

Seconds and light from the same number

A single linear tween takes the seconds left from EXIT to zero: the same onUpdate redraws the outline and, when the whole second changes, the number hops four pixels and settles with back.out.

The sensors and the padlock

Each sensor hops, its icon shrinks and the tick draws itself from its dasharray, while the status rolls in a one-line window. On arming the shield fills from the centre and the padlock’s shackle drops 1.8 units with back.out, the one pixel bounce.

Three taps, three meanings

The same button arms at rest, cancels during the exit delay and disarms when armed; aria-pressed and an aria-live line say out loud what happened. The autopilot stops at the first real click or key.

Values to change

NameFileDefaultWhat it changes
EXITscript.js8The seconds to leave the house before the alarm arms.
STEPscript.js0.42How many seconds to check each sensor.
READYscript.js12 sensors readyThe line under the label at rest.
WAITscript.js#ffb547The colour of the exit delay light.
ARMEDscript.js#5ff2c0The colour of the armed house.
HOLDscript.js2.6Alone: how many seconds it stays armed before it is disarmed.
RESTscript.js1.4Alone: how many seconds it waits before trying again.
LOOPscript.jstrueLeft alone, a pointer tries it by itself.

Try them in the Playground

When to use it

In a smart home or burglar alarm app, on the home screen: the button that arms the alarm as you leave, with the sensors checked first and the seconds to close the door behind you, like real alarm panels.

On phones

The pill takes the screen width minus the margins and below 360 pixels the sensor icons tighten; the finger taps like the mouse. Without hover the pointer light stays off.

With reduced motion

No hops or springs: the texts change in place, the ticks and the number fade in, the exit delay light still wears away because it is the count, the green circuit appears already closed and the padlock is already in place.

Pitfalls

  • A zero-length SVG dash with a round cap still draws a dot: when a and b meet the path must be hidden.
  • The outline built in pixels must be rebuilt on resize, even halfway through the count, or the light runs around a pill that is no longer there.
  • The autopilot must stop at the first real click (event.isTrusted), or it keeps pressing over whoever is trying it.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 15 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