Back to the library

Excise range

Variant: Standard

Confirms that a selected range was cut out of a timeline. Two cut marks draw in, the selected section drops away, and the tail slides left until its cut mark lands on the other one. Then both marks fade, the seam disappears and the duration readout updates. There's a 280ms pause after the cuts finish and before anything is removed. It's short enough not to slow anyone down, and it lets you see the cut happen before the range goes.

trimdeletetimelinestate-changeaudio

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="speed: 0.7-1.4" />
<title>Excise range — 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: 4s; /* 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 */

  /* Weight — the only tokens that differ across the family. */
  --_stroke: 2px;
  --_ext: 8px;
  --_drop: 14px;
  --_band: 0.18;
  --_cut-o: 0.85;
}

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

.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.card {
  width: min(380px, 90vw);
  padding: clamp(14px, 4vw, 22px);
  background: var(--paper);
  border: 1px solid var(--oat);
  border-radius: calc(14px * var(--round));
  display: grid;
  gap: clamp(14px, 4vw, 18px);
}

.head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: clamp(12px, 3.4vw, 13px);
}
.name { opacity: 0.6; }

.readout {
  display: inline-grid;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  animation: reset var(--t) infinite;
}
.readout span { grid-area: 1 / 1; text-align: right; }
.was { animation: was var(--t) infinite; }
.now { opacity: 0; animation: now var(--t) infinite; }

.track {
  position: relative;
  height: clamp(48px, 14vw, 56px);
  background: var(--ivory);
  border-radius: calc(6px * var(--round));
  isolation: isolate;
  animation: reset var(--t) infinite;
}

.seg { position: absolute; top: 0; bottom: 0; }
.a { left: 0; width: 40%; }
.b { left: 40%; width: 25%; animation: excise var(--t) infinite; }
/* -71.4286% of the tail's own width = the 25% of track that was removed. */
.c { left: 65%; width: 35%; animation: close var(--t) infinite; }

.clip { position: absolute; inset: 0; overflow: hidden; }
.wave { position: absolute; top: 0; height: 100%; color: var(--slate); opacity: 0.5; }
.a .wave { left: 0; width: 250%; }
.b .wave { left: -160%; width: 400%; color: var(--clay-d); opacity: 1; }
.c .wave { left: -185.7143%; width: 285.7143%; }

.b::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--clay);
  opacity: var(--_band);
  border-radius: calc(4px * var(--round));
}

.cut {
  position: absolute;
  top: calc(var(--_ext) * -1);
  bottom: calc(var(--_ext) * -1);
  width: var(--_stroke);
  background: var(--slate);
  border-radius: 999px;
  z-index: 2;
  clip-path: inset(0 0 100% 0);
  opacity: var(--_cut-o);
  animation: cut var(--t) infinite;
}
.a .cut { right: 0; transform: translateX(50%); }
.c .cut { left: 0; transform: translateX(-50%); animation-delay: calc(0.06s / var(--speed)); }

/* 280ms draw, 280ms held still before the excision — the pause is the point. */
@keyframes cut {
  0%, 10% { clip-path: inset(0 0 100% 0); opacity: var(--_cut-o); animation-timing-function: var(--ease-out); }
  17%, 44% { clip-path: inset(0 0 0 0); opacity: var(--_cut-o); animation-timing-function: var(--ease-out); }
  52%, 100% { clip-path: inset(0 0 0 0); opacity: 0; }
}
@keyframes excise {
  0%, 24% { transform: translateY(0); opacity: 1; animation-timing-function: var(--ease-out); }
  30%, 90% { transform: translateY(var(--_drop)); opacity: 0; }
  94%, 100% { transform: translateY(0); opacity: 1; }
}
@keyframes close {
  0%, 32% { transform: translateX(0); animation-timing-function: var(--ease-in-out); }
  39%, 90% { transform: translateX(-71.4286%); }
  94%, 100% { transform: translateX(0); }
}
@keyframes was {
  0%, 37% { opacity: 1; transform: translateY(0); animation-timing-function: var(--ease-out); }
  43%, 90% { opacity: 0; transform: translateY(-40%); }
  94%, 100% { opacity: 1; transform: translateY(0); }
}
@keyframes now {
  0%, 37% { opacity: 0; transform: translateY(40%); animation-timing-function: var(--ease-out); }
  43%, 90% { opacity: 1; transform: translateY(0); }
  94%, 100% { opacity: 0; transform: translateY(40%); }
}
/* Out in 160ms, back in 240ms: exit faster than enter; positions reset while hidden. */
@keyframes reset {
  0%, 86% { opacity: 1; animation-timing-function: var(--ease-out); }
  90%, 94% { opacity: 0; animation-timing-function: var(--ease-out); }
  100% { opacity: 1; }
}

@keyframes cut-fade {
  0%, 10% { opacity: 0; }
  17%, 44% { opacity: var(--_cut-o); }
  52%, 100% { opacity: 0; }
}
@keyframes excise-fade {
  0%, 24% { opacity: 1; }
  30%, 90% { opacity: 0; }
  94%, 100% { opacity: 1; }
}
@keyframes close-fade {
  0%, 32% { opacity: 1; transform: translateX(0); }
  35% { opacity: 0; transform: translateX(0); }
  36% { opacity: 0; transform: translateX(-71.4286%); }
  42%, 90% { opacity: 1; transform: translateX(-71.4286%); }
  94%, 100% { opacity: 1; transform: translateX(0); }
}
@keyframes was-fade {
  0%, 37% { opacity: 1; }
  43%, 90% { opacity: 0; }
  94%, 100% { opacity: 1; }
}
@keyframes now-fade {
  0%, 37% { opacity: 0; }
  43%, 90% { opacity: 1; }
  94%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .readout, .track, .b, .c, .cut, .was, .now {
    animation-duration: calc(var(--cycle) * 2 / var(--speed));
  }
  .c .cut { animation-delay: calc(0.06s / var(--speed)); }
  .cut { clip-path: none; opacity: 0; animation-name: cut-fade; }
  .b { animation-name: excise-fade; }
  .c { animation-name: close-fade; }
  .was { animation-name: was-fade; }
  .now { animation-name: now-fade; }
}

@media (max-width: 380px) {
  .card { padding: 14px; gap: 14px; }
}
</style>
</head>
<body>
<svg class="defs" aria-hidden="true" focusable="false">
  <defs>
    <path id="wf" fill="none" stroke="currentColor" stroke-width="0.9" stroke-linecap="round" d="M1 17v6M3 14v12M5 11v18M7 15v10M9 9v22M11 6v28M13 12v16M15 16v8M17 13v14M19 8v24M21 5v30M23 10v20M25 14v12M27 17v6M29 15v10M31 11v18M33 7v26M35 4v32M37 9v22M39 13v14M41 16v8M43 14v12M45 10v20M47 6v28M49 8v24M51 12v16M53 15v10M55 17v6M57 13v14M59 9v22M61 5v30M63 7v26M65 11v18M67 14v12M69 16v8M71 12v16M73 8v24M75 10v20M77 14v12M79 16v8M81 15v10M83 11v18M85 6v28M87 3v34M89 8v24M91 13v14M93 15v10M95 17v6M97 14v12M99 10v20M101 7v26M103 11v18M105 15v10M107 13v14M109 9v22M111 12v16M113 15v10M115 16v8M117 14v12M119 17v6" />
  </defs>
</svg>

<div class="card" role="img" aria-label="A selected range is cut from the clip; length goes from 0:48 to 0:41">
  <div class="head">
    <span class="name">take_03.wav</span>
    <span class="readout"><span class="was">0:48</span><span class="now">0:41</span></span>
  </div>
  <div class="track">
    <div class="seg a">
      <div class="clip"><svg class="wave" viewBox="0 0 120 40" preserveAspectRatio="none" aria-hidden="true"><use href="#wf" /></svg></div>
      <span class="cut"></span>
    </div>
    <div class="seg b">
      <div class="clip"><svg class="wave" viewBox="0 0 120 40" preserveAspectRatio="none" aria-hidden="true"><use href="#wf" /></svg></div>
    </div>
    <div class="seg c">
      <div class="clip"><svg class="wave" viewBox="0 0 120 40" preserveAspectRatio="none" aria-hidden="true"><use href="#wf" /></svg></div>
      <span class="cut"></span>
    </div>
  </div>
</div>
</body>
</html>

The variant family

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