Back to the library

Sensor — the frame is the exposure

Variant: Share frame

Screen sharing, where the indicator is not a dot but a border around exactly what other people can see. It fades in at the screen edge on 216ms ease-out with the pill above it; when the share narrows to one window the same ring travels inward and wraps that window over 504ms on ease-in-out, because it is already on screen and moving — a second frame fading in over the first would leave a moment where two extents are claimed. The ring is one clip-path polygon, an outer loop and an inner loop filled even-odd, with the same ten vertices in both states so the browser can tween one into the other while the band stays 3px the whole way. Everything outside the new extent recedes behind a veil on the same 504ms, so the lit area and the framed area are one rectangle. The pill swaps "Sharing your screen" for "Sharing one window" across the morph’s midpoint, out before in, and carries a permanent Stop. It leaves on 180ms, quicker than it came, since the frame should stop claiming exposure the moment exposure ends. Reach for it in screen-share, remote-control and co-browsing tools.

statusprivacyindicatormorphclip-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" />
    <meta name="animation-knobs" content="round: 0-1.25" />
    <title>Sensor — the frame is the exposure</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 — 7.2s, so 1% is 72ms. Idle 576ms, the whole screen shared
           for 2.1s, a 504ms narrowing to one window, 2.5s shared that way,
           then stop. */
        --cycle: 7.2s;
        --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);
        --_desk: color-mix(in srgb, var(--oat) 42%, var(--ivory));
        --_line: color-mix(in srgb, var(--slate) 10%, transparent);
        --_ink: color-mix(in srgb, var(--clay) 66%, var(--slate));

        /* The two extents the frame can claim, as ring polygons in the
           bezel's space (4px round the screen, whose 1px border the windows sit inside): an outer loop, then
           an inner one, filled even-odd so the middle is a hole. Same ten
           vertices in both, which is what lets clip-path tween one into the
           other. Both rings stand 1px off the edge they frame, so the
           screen's rounded corners never cut the whole-screen ring and the
           window ring frames the window rather than redrawing its border. */
        --_whole: polygon(
          evenodd,
          0 0,
          100% 0,
          100% 100%,
          0 100%,
          0 0,
          3px 3px,
          3px calc(100% - 3px),
          calc(100% - 3px) calc(100% - 3px),
          calc(100% - 3px) 3px,
          3px 3px
        );
        --_one: polygon(
          evenodd,
          calc((100% - 10px) * 0.08 + 1px) calc((100% - 10px) * 0.14 + 1px),
          calc((100% - 10px) * 0.58 + 9px) calc((100% - 10px) * 0.14 + 1px),
          calc((100% - 10px) * 0.58 + 9px) calc((100% - 10px) * 0.78 + 9px),
          calc((100% - 10px) * 0.08 + 1px) calc((100% - 10px) * 0.78 + 9px),
          calc((100% - 10px) * 0.08 + 1px) calc((100% - 10px) * 0.14 + 1px),
          calc((100% - 10px) * 0.08 + 4px) calc((100% - 10px) * 0.14 + 4px),
          calc((100% - 10px) * 0.08 + 4px) calc((100% - 10px) * 0.78 + 6px),
          calc((100% - 10px) * 0.58 + 6px) calc((100% - 10px) * 0.78 + 6px),
          calc((100% - 10px) * 0.58 + 6px) calc((100% - 10px) * 0.14 + 4px),
          calc((100% - 10px) * 0.08 + 4px) calc((100% - 10px) * 0.14 + 4px)
        );
        --_stop-bg: color-mix(in srgb, var(--rust) 10%, var(--paper));
        --_veil: color-mix(in srgb, var(--ivory) 62%, transparent);
      }

      * {
        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);
      }

      .rig {
        display: grid;
        justify-items: center;
        gap: clamp(8px, 2.5vw, 12px);
      }

      .pill {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        height: 26px;
        padding: 0 4px 0 10px;
        border-radius: 999px;
        background: var(--paper);
        border: 1px solid var(--oat);
        opacity: 0;
        animation: pill var(--t) infinite;
      }

      @keyframes pill {
        0%,
        8% {
          opacity: 0;
          transform: translateY(-4px);
          animation-timing-function: var(--ease-out);
        }
        11%,
        82% {
          opacity: 1;
          transform: translateY(0);
          animation-timing-function: var(--ease-out);
        }
        84.5%,
        100% {
          opacity: 0;
          transform: translateY(0);
        }
      }

      .dot {
        flex: none;
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: var(--clay);
      }

      .says {
        display: grid;
        font-size: 12px;
        font-weight: 600;
        color: var(--_ink);
      }

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

      .whole-l {
        animation: whole-l var(--t) ease infinite;
      }

      .one-l {
        opacity: 0;
        animation: one-l var(--t) ease infinite;
      }

      /* Sequenced across the morph's midpoint: the old claim is gone before
         the new one is printed, so the pill never names both extents. */
      @keyframes whole-l {
        0%,
        42% {
          opacity: 1;
        }
        43.5%,
        90% {
          opacity: 0;
        }
        91%,
        100% {
          opacity: 1;
        }
      }

      @keyframes one-l {
        0%,
        44% {
          opacity: 0;
        }
        45.5%,
        90% {
          opacity: 1;
        }
        91%,
        100% {
          opacity: 0;
        }
      }

      .stop {
        padding: 2px 8px;
        border-radius: 999px;
        font-size: 11.5px;
        font-weight: 600;
        color: var(--rust);
        background: var(--_stop-bg);
      }

      .bezel {
        position: relative;
        padding: 4px;
      }

      .screen {
        position: relative;
        width: min(332px, calc(86vw - 8px));
        aspect-ratio: 16 / 10;
        border-radius: calc(10px * var(--round));
        background: var(--_desk);
        border: 1px solid var(--oat);
        overflow: hidden;
      }

      .win {
        position: absolute;
        background: var(--paper);
        border: 1px solid var(--oat);
        border-radius: calc(6px * var(--round));
        padding: 0 10px;
      }

      .win::before {
        content: '';
        display: block;
        height: clamp(9px, 3vw, 13px);
        margin: 0 -10px 10px;
        border-bottom: 1px solid var(--oat);
      }

      .win i {
        display: block;
        height: 4px;
        margin-bottom: 8px;
        border-radius: 999px;
        background: var(--_line);
      }

      .win i:nth-of-type(2) {
        width: 72%;
      }

      .win i:nth-of-type(3) {
        width: 86%;
      }

      .a {
        left: 8%;
        top: 14%;
        width: 50%;
        height: 64%;
      }

      .b {
        left: 46%;
        top: 30%;
        width: 46%;
        height: 56%;
      }

      /* What is no longer shared recedes behind a veil on the same 504ms as
         the ring, so "exactly what others see" reads at a glance: the lit
         area and the framed area are one rectangle. */
      .veil {
        position: absolute;
        inset: 0;
        background: var(--_veil);
        opacity: 0;
        animation: veil var(--t) infinite;
      }

      @keyframes veil {
        0%,
        40% {
          opacity: 0;
          animation-timing-function: var(--ease-in-out);
        }
        47%,
        82% {
          opacity: 1;
          animation-timing-function: var(--ease-out);
        }
        84.5%,
        100% {
          opacity: 0;
        }
      }

      .frame {
        position: absolute;
        inset: 0;
        background: var(--clay);
        clip-path: var(--_whole);
        opacity: 0;
        animation:
          extent var(--t) infinite,
          frame var(--t) infinite;
      }

      /* The frame encloses exactly what other people can see, so changing
         what is shared moves the frame — never a second frame fading in over
         the first. 504ms on ease-in-out: the ring is already on screen and
         is travelling, and the window it lands on is the only thing still
         inside it. */
      @keyframes extent {
        0%,
        40% {
          clip-path: var(--_whole);
          animation-timing-function: var(--ease-in-out);
        }
        47%,
        90% {
          clip-path: var(--_one);
        }
        90.1%,
        100% {
          clip-path: var(--_whole);
        }
      }

      /* In on 216ms ease-out with the pill; out on 180ms when sharing stops,
         because exits are quicker than entrances and the moment exposure
         ends is the moment the frame should stop claiming it. */
      @keyframes frame {
        0%,
        8% {
          opacity: 0;
          animation-timing-function: var(--ease-out);
        }
        11%,
        82% {
          opacity: 1;
          animation-timing-function: var(--ease-out);
        }
        84.5%,
        100% {
          opacity: 0;
        }
      }

      @media (prefers-reduced-motion: reduce) {
        /* The pill drops its 4px drop-in. The frame still travels — its
           extent is the datum, and a frame that jumped would lose the window
           it was narrowing to — but every clock stretches by the same 1.5. */
        .pill {
          animation-name: pill-calm;
        }

        @keyframes pill-calm {
          0%,
          8% {
            opacity: 0;
          }
          11%,
          82% {
            opacity: 1;
          }
          84.5%,
          100% {
            opacity: 0;
          }
        }

        .pill,
        .frame,
        .veil,
        .whole-l,
        .one-l {
          animation-duration: calc(var(--t) * 1.5);
        }
      }
    </style>
  </head>
  <body>
    <div
      class="rig"
      role="img"
      aria-label="Screen sharing starts and a clay frame lines the whole desktop under a 'Sharing your screen' pill; then the frame travels inward to wrap a single window and the pill changes to 'Sharing one window'"
    >
      <span class="pill">
        <span class="dot"></span>
        <span class="says">
          <span class="whole-l">Sharing your screen</span>
          <span class="one-l">Sharing one window</span>
        </span>
        <span class="stop">Stop</span>
      </span>
      <div class="bezel" aria-hidden="true">
        <div class="screen">
          <div class="win b"><i></i><i></i><i></i></div>
          <span class="veil"></span>
          <div class="win a"><i></i><i></i><i></i></div>
        </div>
        <span class="frame"></span>
      </div>
    </div>
  </body>
</html>