Back to the library

Sensor — announce, then settle

Variant: Announce, then settle

A camera-in-use indicator that says it loudly once and then quietly for as long as it is true. The Camera label opens out of the status dot over 224ms on ease-out — it is laid out at full width and only its clip moves, so the bar never reflows — reads for 1.8s, then folds back into the dot over 256ms on ease-in-out, because by then it is on screen and changing shape rather than arriving. The label is sequenced inside the clip: it lands after the pill has room and is gone before the pill closes on it. The settled dot does not pulse. A light that blinks for the whole call is an alert, and alerts get tuned out; a steady one is a state, and a state is what a camera being on is. It leaves only when the camera does, 192ms and a touch smaller, so the exit reads as switching off. Reach for it in any app that turns on a sensor for the user, where the first second needs to be impossible to miss and the next forty minutes need to be impossible to resent.

statusprivacyindicatorclip-pathloop

The source

A complete HTML document. Paste it into an empty .html file and it plays — no stylesheet, script, font, or image to fetch.

<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>Sensor — announce, then settle</title>
    <style>
      :root {
        /* Neutrals — fixed, never remixed. */
        --ivory: #faf9f5;
        --paper: #ffffff;
        --oat: #e3dacc;
        --slate: #141413;

        /* Knobs — the remix API. A knob exists iff declared here and used below. */
        --hue: 38.8;
        --lift: 0;
        --chroma: 1;
        --round: 1;
        --speed: 1;

        /* Accents — derived from the knobs with the family's offsets baked in,
           so one hue roll moves them together. Defaults reproduce the original hex. */
        --clay: oklch(calc(0.6724 + var(--lift)) calc(0.1308 * var(--chroma)) var(--hue));
        --clay-d: oklch(calc(0.5797 + var(--lift)) calc(0.127 * var(--chroma)) var(--hue));
        --olive: oklch(
          calc(0.6118 + var(--lift)) calc(0.0713 * var(--chroma)) calc(var(--hue) + 88.3)
        );
        --rust: oklch(
          calc(0.5408 + var(--lift)) calc(0.1357 * var(--chroma)) calc(var(--hue) - 10.3)
        );

        /* Clock — 6.4s, so 1% is 64ms. Off for 384ms, a 1.8s announcement,
           2.6s of quiet dot, then the camera stops and the dot goes with it. */
        --cycle: 6.4s;
        --t: calc(var(--cycle) / var(--speed));

        --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
        --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

        --_muted: color-mix(in srgb, var(--slate) 52%, transparent);
        --_tint: color-mix(in srgb, var(--olive) 16%, var(--paper));
        --_ink: color-mix(in srgb, var(--olive) 72%, var(--slate));
      }

      * {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
      }

      body {
        min-height: 100vh;
        display: grid;
        place-items: center;
        background: var(--ivory);
        font-family:
          system-ui,
          -apple-system,
          'Segoe UI',
          Roboto,
          sans-serif;
        color: var(--slate);
      }

      .device {
        width: min(320px, 86vw);
        background: var(--paper);
        border: 1px solid var(--oat);
        border-radius: calc(16px * var(--round));
        overflow: hidden;
      }

      .bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 40px;
        padding: 0 10px 0 14px;
        border-bottom: 1px solid var(--oat);
      }

      .time {
        font-size: 12.5px;
        font-weight: 600;
        font-variant-numeric: tabular-nums;
      }

      /* The pill is laid out at full width from the first frame and only its
         clip changes, so opening and collapsing never reflow the bar. The
         collapsed clip is exactly the dot: the label grows out of the light
         and folds back into it, which is what tells the reader the two are
         one indicator rather than a toast that happened to sit nearby. */
      .pill {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        height: 24px;
        padding: 0 8px 0 10px;
        border-radius: 999px;
        background: var(--_tint);
        transform-origin: calc(100% - 12px) 50%;
        clip-path: inset(7.5px 7.5px 7.5px calc(100% - 16.5px) round 999px);
        opacity: 0;
        animation:
          pill-clip var(--t) infinite,
          pill-show var(--t) infinite;
      }

      .lbl {
        font-size: 12px;
        font-weight: 600;
        letter-spacing: 0.005em;
        color: var(--_ink);
        animation: lbl var(--t) ease infinite;
      }

      .dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--olive);
      }

      /* Open on ease-out (224ms) because it is an entrance answering the
         camera; collapse on ease-in-out (256ms) because by then the pill is
         already on screen and is changing shape, not arriving. */
      @keyframes pill-clip {
        0%,
        6% {
          clip-path: inset(7.5px 7.5px 7.5px calc(100% - 16.5px) round 999px);
          animation-timing-function: var(--ease-out);
        }
        9.5%,
        39% {
          clip-path: inset(0 0 0 0 round 999px);
          animation-timing-function: var(--ease-in-out);
        }
        43%,
        100% {
          clip-path: inset(7.5px 7.5px 7.5px calc(100% - 16.5px) round 999px);
        }
      }

      /* The settled dot does not pulse. It is a state, not an alert, and a
         camera light that blinks for as long as the camera runs teaches people
         to stop looking at it — the quiet is what keeps it believable. It only
         leaves when the camera does, 192ms on ease-out, a touch smaller as it
         goes so the exit reads as switching off, not sliding away. */
      @keyframes pill-show {
        0%,
        6% {
          opacity: 0;
          transform: scale(1);
          animation-timing-function: var(--ease-out);
        }
        7%,
        84% {
          opacity: 1;
          transform: scale(1);
          animation-timing-function: var(--ease-out);
        }
        87%,
        99% {
          opacity: 0;
          transform: scale(0.8);
        }
        100% {
          opacity: 0;
          transform: scale(1);
        }
      }

      /* Sequenced around the clip: the word lands after the pill has room for
         it and is gone before the pill starts to close on it. */
      @keyframes lbl {
        0%,
        8% {
          opacity: 0;
        }
        10.5%,
        37.5% {
          opacity: 1;
        }
        39%,
        100% {
          opacity: 0;
        }
      }

      .app {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: clamp(16px, 5vw, 22px) 16px;
      }

      .btn {
        display: grid;
        place-items: center;
        flex: none;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        border: 1px solid var(--oat);
        background: var(--paper);
        animation: press var(--t) infinite;
      }

      /* Two 160ms dips, the only motion the finger gets. Each bottoms out
         64ms before the system answers, so the pill opens and the dot leaves
         as the finger lifts — the response follows the press instead of
         racing it. */
      @keyframes press {
        0%,
        4.5% {
          transform: scale(1);
          animation-timing-function: var(--ease-out);
        }
        5.5% {
          transform: scale(0.95);
          animation-timing-function: var(--ease-out);
        }
        7%,
        82.5% {
          transform: scale(1);
          animation-timing-function: var(--ease-out);
        }
        83.5% {
          transform: scale(0.95);
          animation-timing-function: var(--ease-out);
        }
        85%,
        100% {
          transform: scale(1);
        }
      }

      .glyph {
        width: 20px;
        height: 20px;
        overflow: visible;
        fill: none;
        stroke-linecap: round;
        stroke-linejoin: round;
      }

      .cam {
        stroke: var(--slate);
        stroke-width: 1.6;
      }

      .slash-under,
      .slash {
        stroke-dasharray: 22;
        animation: slash var(--t) infinite;
      }

      .slash-under {
        stroke: var(--paper);
        stroke-width: 4.5;
      }

      .slash {
        stroke: var(--slate);
        stroke-width: 1.6;
      }

      @keyframes slash {
        0%,
        6% {
          stroke-dashoffset: 0;
          animation-timing-function: var(--ease-out);
        }
        8.5%,
        84% {
          stroke-dashoffset: 22;
          animation-timing-function: var(--ease-out);
        }
        86.5%,
        100% {
          stroke-dashoffset: 0;
        }
      }

      .meta {
        display: grid;
        gap: 2px;
      }

      .title {
        font-size: 13px;
        font-weight: 600;
        letter-spacing: -0.01em;
      }

      .state {
        display: grid;
        font-size: 11.5px;
        color: var(--_muted);
      }

      .state span {
        grid-area: 1 / 1;
      }

      .s-off {
        animation: s-off var(--t) ease infinite;
      }

      .s-on {
        opacity: 0;
        animation: s-on var(--t) ease infinite;
      }

      @keyframes s-off {
        0%,
        6% {
          opacity: 1;
        }
        7%,
        84% {
          opacity: 0;
        }
        85.5%,
        100% {
          opacity: 1;
        }
      }

      @keyframes s-on {
        0%,
        6.8% {
          opacity: 0;
        }
        8.3%,
        84% {
          opacity: 1;
        }
        85%,
        100% {
          opacity: 0;
        }
      }

      @media (prefers-reduced-motion: reduce) {
        /* The press dip goes. The pill still opens and folds — clip and
           opacity are the message, not travel — and every clock in the piece
           stretches by the same 1.5 so the dot still lands on the frame the
           camera does. */
        .btn {
          animation: none;
        }

        .pill {
          animation-name: pill-clip, pill-show-calm;
        }

        @keyframes pill-show-calm {
          0%,
          6% {
            opacity: 0;
          }
          7%,
          84% {
            opacity: 1;
          }
          87%,
          100% {
            opacity: 0;
          }
        }

        .pill,
        .lbl,
        .slash,
        .slash-under,
        .s-off,
        .s-on {
          animation-duration: calc(var(--t) * 1.5);
        }
      }
    </style>
  </head>
  <body>
    <div
      class="device"
      role="img"
      aria-label="Turning the camera on opens a 'Camera' pill out of a green status dot; after a couple of seconds the label folds back into the dot, which stays lit and still until the camera is turned off"
    >
      <div class="bar">
        <span class="time">9:41</span>
        <span class="pill">
          <span class="lbl">Camera</span>
          <span class="dot"></span>
        </span>
      </div>
      <div class="app">
        <span class="btn">
          <svg class="glyph" viewBox="0 0 20 20" aria-hidden="true">
            <g class="cam">
              <rect x="2" y="5.5" width="11" height="9" rx="2" />
              <path d="M13 9 L18 6.5 V13.5 L13 11" />
            </g>
            <path class="slash-under" d="M3 3 L17 17" />
            <path class="slash" d="M3 3 L17 17" />
          </svg>
        </span>
        <span class="meta">
          <span class="title">Standup call</span>
          <span class="state">
            <span class="s-off">Video off</span>
            <span class="s-on">Video on</span>
          </span>
        </span>
      </div>
    </div>
  </body>
</html>