Skip to content

Herk Edit Kit by Nate Herk: edit videos, reels, and YouTube Shorts with Codex or Claude Code. 15 skills, transcript-driven cuts, storytelling, 406 motion-graphics cards, and HyperFrames templates.

7.9 KB
Raw Blame
<!doctype html>
<!--
  VOX EXPLAINER · tier1 · stat · DIE-CUT WINDOW
  A paper card with a rectangular cut-out window revealing the big number on a
  contrasting yellow layer behind. Inner shadow on the window edge gives paper
  thickness. The window "opens" via a clip-path/scale reveal; the number behind
  settles in with a slight overshoot.
  Slots: kicker, stat, label (richtext <em>), source.
-->
<html>
  <head>
    <meta charset="utf-8" />
    <link rel="stylesheet" href="../../tokens.css" />
    <style>
      html, body { margin: 0; }
      #t1-stat-window {
        position: absolute; inset: 0; width: 1920px; height: 1080px;
        background: var(--paper); color: var(--ink);
        font-family: var(--font-display); overflow: hidden;
      }
      #t1-stat-window .grid {
        position: absolute; inset: -2px;
        background-image:
          repeating-linear-gradient(0deg,  var(--grid-line) 0 1px, transparent 1px var(--grid-size)),
          repeating-linear-gradient(90deg, var(--grid-line) 0 1px, transparent 1px var(--grid-size));
      }
      #t1-stat-window .grain {
        position: absolute; inset: -40px; background: var(--tex-grain);
        background-size: 180px 180px; mix-blend-mode: multiply; opacity: 0.4; pointer-events: none; z-index: 8;
      }
      #t1-stat-window .vignette {
        position: absolute; inset: 0; pointer-events: none; z-index: 7;
        background: radial-gradient(120% 120% at 50% 46%, transparent 52%, rgba(23,19,14,0.18) 100%);
      }

      /* ── yellow backing layer ── */
      #t1-stat-window .backing {
        position: absolute;
        /* window position: centred horizontally, upper-mid vertically */
        left: 260px; top: 190px;
        width: 1400px; height: 620px;
        background: var(--yellow);
        z-index: 1;
      }
      /* big stat sits inside the backing */
      #t1-stat-window .stat {
        position: absolute; inset: 0;
        display: flex; align-items: center; justify-content: center;
        font-weight: var(--wt-black); font-size: 480px; line-height: 1;
        letter-spacing: -0.06em; color: var(--ink);
        font-variant-numeric: tabular-nums;
        z-index: 2;
      }

      /* ── paper overlay with die-cut hole ──
         We achieve the cut-out with a clip-path on the overlay that excludes
         the window rectangle, so the yellow shows through.
         The overlay is the same as the paper background.                       */
      #t1-stat-window .overlay {
        position: absolute; inset: 0; z-index: 3;
        background: var(--paper);
        /* Clip path = full rect minus the window rectangle.
           Uses the even-odd fill rule via clip-path. We use two SVG polygon
           sub-paths but CSS clip-path doesn't support evenodd directly, so
           we use a drop-shadow trick + a pseudo for the inner shadow.
           Instead: use clip-path with a "frame" shape —
           outer rect corners → window corner path traced as a hole.          */
        clip-path: polygon(
          /* outer rect CCW */
          0% 0%, 100% 0%, 100% 100%, 0% 100%,
          /* inner cut-out CW (reversed winding = hole with evenodd) */
          13.54% 17.59%, 13.54% 75.0%, 86.46% 75.0%, 86.46% 17.59%
        );
        /* note: standard clip-path uses nonzero; for true evenodd we need SVG.
           We'll use an SVG clipPath instead — see below. */
      }

      /* Use SVG defs for evenodd clip */
      #t1-stat-window .overlay {
        /* reset clip-path; actual clip applied via SVG below */
        clip-path: none;
      }
      #t1-stat-window .overlay-svg {
        position: absolute; inset: 0; z-index: 3; pointer-events: none;
      }

      /* inner shadow on the window edge — simulated with a box-shadow on an
         absolutely positioned div matching the window rect, z above backing  */
      #t1-stat-window .window-shadow {
        position: absolute;
        left: 260px; top: 190px;
        width: 1400px; height: 620px;
        z-index: 4;
        box-shadow: inset 0 0 0 5px var(--ink),
                    inset 8px 12px 30px rgba(23,19,14,0.28),
                    inset -6px -8px 20px rgba(23,19,14,0.16);
        pointer-events: none;
      }

      /* kicker */
      #t1-stat-window .kicker {
        position: absolute; left: 130px; top: 90px; z-index: 6;
        font-family: var(--font-label); font-weight: var(--wt-bold);
        font-size: var(--size-label); letter-spacing: var(--track-wide);
        text-transform: uppercase; color: var(--red);
      }

      /* label */
      #t1-stat-window .label {
        position: absolute; left: 130px; right: 130px; bottom: 170px; z-index: 6;
        font-weight: var(--wt-thin); font-size: 60px; line-height: 1.08;
        letter-spacing: var(--track-tight); color: var(--ink);
      }
      #t1-stat-window .label em {
        font-style: italic; font-weight: var(--wt-black);
      }

      /* source */
      #t1-stat-window .source {
        position: absolute; left: 130px; bottom: 96px; z-index: 6;
        font-family: var(--font-label); font-weight: var(--wt-bold);
        font-size: var(--size-tiny); letter-spacing: var(--track-wide);
        text-transform: uppercase; color: var(--muted);
      }
    </style>
  </head>
  <body>
    <div id="t1-stat-window" data-composition-id="t1-stat-window" data-start="0" data-width="1920" data-height="1080">
      <div class="grid"></div>

      <!-- yellow backing with number behind the cut -->
      <div class="backing">
        <div class="stat" data-slot="stat">38M</div>
      </div>

      <!-- paper overlay with die-cut hole via SVG clip -->
      <svg style="position:absolute;width:0;height:0">
        <defs>
          <clipPath id="win-cut" clipPathUnits="objectBoundingBox">
            <!-- outer rect -->
            <path fill-rule="evenodd" d="
              M 0,0 L 1,0 L 1,1 L 0,1 Z
              M 0.1354,0.1759 L 0.8646,0.1759 L 0.8646,0.7500 L 0.1354,0.7500 Z
            "/>
          </clipPath>
        </defs>
      </svg>
      <div class="overlay" style="clip-path: url(#win-cut);"></div>

      <!-- inner shadow framing the window -->
      <div class="window-shadow"></div>

      <div class="kicker" data-slot="kicker">TOTAL REACH</div>
      <div class="label" data-slot="label">unique viewers in the first <em>72 hours</em></div>
      <div class="source" data-slot="source">SOURCE · INTERNAL METRICS 2026</div>
      <div class="vignette"></div>
      <div class="grain"></div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js"></script>
    <script>
      window.__timelines = window.__timelines || {};
      const tl = gsap.timeline({ paused: true });

      // grain flicker
      tl.fromTo("#t1-stat-window .grain", { backgroundPosition: "0px 0px" },
                { backgroundPosition: "150px 130px", duration: 0.5, ease: "steps(4)", repeat: 11, yoyo: true }, 0);

      // kicker
      tl.from("#t1-stat-window .kicker", { autoAlpha: 0, x: -20, duration: 0.3, ease: "steps(4)" }, 0.15);

      // window opens: backing + overlay reveal via scaleY from top
      tl.from("#t1-stat-window .backing",       { scaleY: 0, transformOrigin: "50% 0%", duration: 0.42, ease: "back.out(1.4)" }, 0.3);
      tl.from("#t1-stat-window .overlay",       { scaleY: 0, transformOrigin: "50% 0%", duration: 0.42, ease: "back.out(1.4)" }, 0.3);
      tl.from("#t1-stat-window .window-shadow", { scaleY: 0, transformOrigin: "50% 0%", duration: 0.42, ease: "back.out(1.4)" }, 0.3);

      // stat pops in after window is open
      tl.from("#t1-stat-window .stat", {
        autoAlpha: 0, scale: 0.68, transformOrigin: "50% 50%",
        duration: 0.4, ease: "back.out(2.4)"
      }, 0.7);

      // label and source
      tl.from("#t1-stat-window .label",  { autoAlpha: 0, y: 20, duration: 0.4, ease: "power3.out" }, 0.92);
      tl.from("#t1-stat-window .source", { autoAlpha: 0, duration: 0.3 }, 1.22);

      tl.set({}, {}, 6);
      window.__timelines["t1-stat-window"] = tl;
    </script>
  </body>
</html>