Back to the library

Viewfinder lock confirm

Variant: Standard

Four corner brackets close in on a captured frame while the image comes into focus, then a timestamped caption confirms the save. Use it to confirm a captured photo, scan or evidence attachment, where the user needs to see exactly what was saved. The brackets settle in 288ms on a strong ease-out so the lock lands almost at once, and they leave in 192ms, faster than they came in.

confirmationcapturefocusbracketsfeedback

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>Viewfinder lock confirm — Standard</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; /* include ONLY if at least one border-radius is wrapped below */
  --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
     (#d97757 / #b85c3e / #788c5d / #b04a3f). */
  --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 — every duration in the document runs off --t. */
  --cycle: 3.2s; /* the authored master loop */
  --t: calc(var(--cycle) / var(--speed));

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1); /* include only if used */
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1); /* include only if used */

  --_stroke: 2px;
  --_arm: 18px;
  --_travel: 10px;
  --_gap: 6px;
  --_ink: 0.9;
  --_blur: 3px;
  --_cap-weight: 500;
}

* { box-sizing: border-box; }

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

.stage { padding: 28px; }

.frame {
  position: relative;
  width: min(280px, 68vw);
}

.photo {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: calc(3px * var(--round));
  overflow: hidden;
  background: var(--oat);
}

.photo svg {
  display: block;
  width: 100%;
  height: 100%;
  animation: focus var(--t) var(--ease-in-out) infinite both;
}

.sky { fill: var(--oat); }
.ground { fill: color-mix(in oklch, var(--olive) 45%, var(--oat)); }
.bldg { fill: color-mix(in oklch, var(--slate) 28%, var(--oat)); }
.bldg-2 { fill: color-mix(in oklch, var(--slate) 42%, var(--oat)); }
.win { fill: color-mix(in oklch, var(--clay) 55%, var(--oat)); }

.corner {
  position: absolute;
  width: var(--_arm);
  height: var(--_arm);
  border: 0 solid var(--slate);
  border-radius: calc(2px * var(--round));
  animation: lock var(--t) var(--ease-out) infinite both;
}
.tl { top: calc(-1 * var(--_gap)); left: calc(-1 * var(--_gap)); border-top-width: var(--_stroke); border-left-width: var(--_stroke); --_dx: -1; --_dy: -1; }
.tr { top: calc(-1 * var(--_gap)); right: calc(-1 * var(--_gap)); border-top-width: var(--_stroke); border-right-width: var(--_stroke); --_dx: 1; --_dy: -1; animation-delay: calc(30ms / var(--speed)); }
.br { bottom: calc(-1 * var(--_gap)); right: calc(-1 * var(--_gap)); border-bottom-width: var(--_stroke); border-right-width: var(--_stroke); --_dx: 1; --_dy: 1; animation-delay: calc(60ms / var(--speed)); }
.bl { bottom: calc(-1 * var(--_gap)); left: calc(-1 * var(--_gap)); border-bottom-width: var(--_stroke); border-left-width: var(--_stroke); --_dx: -1; --_dy: 1; animation-delay: calc(90ms / var(--speed)); }

.caption {
  margin: 14px 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: clamp(11px, 3.4vw, 13px);
  font-weight: var(--_cap-weight);
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}
.caption > * { animation: caption var(--t) var(--ease-out) infinite both; }
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--rust);
  flex: none;
}
.label { animation-delay: calc(50ms / var(--speed)); }
.time {
  margin-left: auto;
  color: color-mix(in oklch, var(--slate) 60%, var(--ivory));
  animation-delay: calc(100ms / var(--speed));
}

/* 9% of 3.2s = 288ms lock; exit 80%→86% = 192ms, faster than the entrance. */
@keyframes lock {
  0% { opacity: 0; transform: translate(calc(var(--_dx) * var(--_travel)), calc(var(--_dy) * var(--_travel))); }
  9%, 80% { opacity: var(--_ink); transform: translate(0, 0); }
  86%, 100% { opacity: 0; transform: translate(calc(var(--_dx) * var(--_travel) * 0.4), calc(var(--_dy) * var(--_travel) * 0.4)); }
}

@keyframes focus {
  0% { filter: blur(var(--_blur)); }
  9%, 86% { filter: blur(0); }
  100% { filter: blur(var(--_blur)); }
}

@keyframes caption {
  0%, 9% { opacity: 0; transform: translateY(4px); }
  16%, 80% { opacity: 1; transform: translateY(0); }
  85%, 100% { opacity: 0; transform: translateY(0); }
}

@keyframes lock-fade {
  0% { opacity: 0; }
  9%, 80% { opacity: var(--_ink); }
  86%, 100% { opacity: 0; }
}

@keyframes caption-fade {
  0%, 9% { opacity: 0; }
  16%, 80% { opacity: 1; }
  85%, 100% { opacity: 0; }
}

@media (max-width: 380px) {
  .stage { padding: 22px; }
  .caption { margin-top: 12px; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .photo svg { animation: none; filter: none; }
  .corner {
    animation-name: lock-fade;
    animation-duration: calc(var(--t) * 2);
    transform: none;
  }
  .tr { animation-delay: calc(60ms / var(--speed)); }
  .br { animation-delay: calc(120ms / var(--speed)); }
  .bl { animation-delay: calc(180ms / var(--speed)); }
  .caption > * {
    animation-name: caption-fade;
    animation-duration: calc(var(--t) * 2);
  }
  .label { animation-delay: calc(100ms / var(--speed)); }
  .time { animation-delay: calc(200ms / var(--speed)); }
}
</style>
</head>
<body>
  <div class="stage">
    <div class="frame">
      <div class="photo">
        <svg viewBox="0 0 160 100" preserveAspectRatio="xMidYMid slice" aria-hidden="true">
          <rect class="sky" x="0" y="0" width="160" height="100" />
          <rect class="bldg" x="14" y="38" width="30" height="40" />
          <rect class="bldg-2" x="40" y="28" width="22" height="50" />
          <rect class="bldg" x="92" y="44" width="26" height="34" />
          <rect class="bldg-2" x="114" y="34" width="34" height="44" />
          <rect class="win" x="46" y="36" width="5" height="6" />
          <rect class="win" x="122" y="44" width="5" height="6" />
          <rect class="ground" x="0" y="76" width="160" height="24" />
        </svg>
      </div>
      <span class="corner tl"></span>
      <span class="corner tr"></span>
      <span class="corner br"></span>
      <span class="corner bl"></span>
    </div>
    <p class="caption" role="status">
      <span class="dot"></span>
      <span class="label">Saved to record</span>
      <span class="time">14:02:36</span>
    </p>
  </div>
</body>
</html>

The variant family

Same idea, one axis moved. Compare them side by side before you commit.