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.

11.2 KB
Raw Blame
<!doctype html>
<!--
  KALLAWAY · tier1 · stat · ODOMETER
  Rolling-digit odometer: each digit column spins up to its final value via a
  y-translate on a stacked digit strip. A glass frame wraps the digit windows.
  Aurora bloom, grain, vignette, breathing glow.
  Knob: data-value on #t1-st-odo-value (default "42,800").
  Slots: kicker (~28 chars), stat (the number string, for the slot system),
         label (~70 chars, <em>), source (~40 chars).
-->
<html>
  <head>
    <meta charset="utf-8" />
    <link rel="stylesheet" href="../../tokens.css" />
    <style>
      html, body { margin: 0; }

      #t1-st-odo {
        position: absolute; inset: 0; width: 1920px; height: 1080px;
        background: var(--canvas); color: var(--text);
        font-family: var(--font-display); overflow: hidden;
      }

      #t1-st-odo .bloom {
        position: absolute; inset: 0; background: var(--bloom-bottom); z-index: 1;
      }
      #t1-st-odo .bg-grid {
        position: absolute; inset: 0; z-index: 1;
        background-image: var(--dot); background-size: var(--dot-size);
        opacity: 0.5;
        -webkit-mask-image: radial-gradient(120% 100% at 50% 60%, #000 35%, transparent 80%);
                mask-image: radial-gradient(120% 100% at 50% 60%, #000 35%, transparent 80%);
      }

      #t1-st-odo .content {
        position: absolute; left: 0; right: 0; top: 0; bottom: 0;
        display: flex; flex-direction: column; align-items: center;
        justify-content: center; z-index: 4; gap: 52px; padding-bottom: 30px;
      }

      #t1-st-odo .kicker {
        font-family: var(--font-mono);
        font-size: var(--size-label);
        font-weight: var(--wt-bold);
        letter-spacing: var(--track-wide);
        text-transform: uppercase;
        color: var(--accent);
        text-shadow: var(--textglow-accent);
      }

      /* Glass frame that clips the rolling digits */
      #t1-st-odo .odo-frame {
        position: relative;
        display: flex; flex-direction: row; align-items: stretch; gap: 0;
        background: var(--glass-bg);
        border: var(--stroke) solid var(--glass-border);
        border-radius: var(--radius);
        box-shadow: var(--glass-shadow),
                    0 0 60px rgba(var(--accent-rgb), 0.18),
                    inset 0 1px 0 var(--glass-hi);
        overflow: hidden;
        backdrop-filter: var(--glass-blur);
        -webkit-backdrop-filter: var(--glass-blur);
        padding: 0 12px;
      }
      /* Top + bottom mask inside the frame — fades the scrolling digits at edges */
      #t1-st-odo .odo-frame::before,
      #t1-st-odo .odo-frame::after {
        content: "";
        position: absolute; left: 0; right: 0; height: 56px; z-index: 3; pointer-events: none;
      }
      #t1-st-odo .odo-frame::before {
        top: 0;
        background: linear-gradient(to bottom, var(--canvas-deep) 10%, transparent 100%);
      }
      #t1-st-odo .odo-frame::after {
        bottom: 0;
        background: linear-gradient(to top, var(--canvas-deep) 10%, transparent 100%);
      }

      /* One column per significant digit (or comma/separator) */
      #t1-st-odo .odo-col {
        position: relative;
        width: 96px;
        height: 180px;
        overflow: hidden;
        flex-shrink: 0;
      }
      #t1-st-odo .odo-col.sep {
        width: 44px;
        display: flex; align-items: center; justify-content: center;
      }
      #t1-st-odo .sep-char {
        font-family: var(--font-display);
        font-weight: var(--wt-black);
        font-size: 120px;
        line-height: 1;
        color: rgba(255,255,255,0.55);
        padding-bottom: 6px;
        align-self: center;
      }

      /* Digit strip inside each column — 10 digits stacked */
      #t1-st-odo .odo-strip {
        position: absolute;
        top: 0; left: 0; right: 0;
        display: flex; flex-direction: column; align-items: center;
        will-change: transform;
      }
      #t1-st-odo .odo-digit {
        height: 180px;
        line-height: 180px;
        font-family: var(--font-display);
        font-weight: var(--wt-black);
        font-size: 120px;
        letter-spacing: var(--track-tight);
        color: var(--white);
        text-align: center;
        width: 100%;
        flex-shrink: 0;
      }
      /* The "hero" digit at the center of the window glows */
      #t1-st-odo .odo-digit.hero {
        background: linear-gradient(155deg, #ffffff 10%, rgba(var(--accent-rgb), 0.82) 78%);
        -webkit-background-clip: text; background-clip: text;
        -webkit-text-fill-color: transparent; text-fill-color: transparent;
        filter: drop-shadow(0 0 22px rgba(var(--accent-rgb), 0.55));
      }

      /* Glow halo around the frame */
      #t1-st-odo .odo-glow {
        position: absolute;
        pointer-events: none;
        inset: -30px;
        border-radius: calc(var(--radius) + 30px);
        background: radial-gradient(ellipse at 50% 50%, rgba(var(--accent-rgb), 0.14) 0%, transparent 65%);
        z-index: 0;
      }

      #t1-st-odo .label {
        font-family: var(--font-body);
        font-size: var(--size-body);
        font-weight: var(--wt-med);
        color: var(--text-dim);
        text-align: center;
        max-width: 880px;
        line-height: 1.45;
      }
      #t1-st-odo .label em {
        font-style: normal; color: var(--text); text-shadow: var(--textglow);
      }

      #t1-st-odo .source {
        position: absolute; left: var(--pad); bottom: 44px;
        font-family: var(--font-mono); font-size: var(--size-tiny);
        font-weight: var(--wt-reg); letter-spacing: 0.12em;
        text-transform: uppercase; color: var(--text-faint); z-index: 5;
      }

      #t1-st-odo .vignette {
        position: absolute; inset: 0; pointer-events: none; z-index: 6;
        background: var(--vignette);
      }
      #t1-st-odo .grain {
        position: absolute; inset: -40px; background: var(--tex-grain);
        background-size: 200px 200px; mix-blend-mode: overlay; opacity: 0.10;
        pointer-events: none; z-index: 7;
      }
    </style>
  </head>
  <body>
    <div id="t1-st-odo" data-composition-id="t1-st-odo" data-start="0" data-width="1920" data-height="1080">
      <div class="bloom"></div>
      <div class="bg-grid"></div>

      <div class="content">
        <div class="kicker" data-slot="kicker">ACTIVE LEARNERS · Q4 2026</div>

        <!-- data-value drives the odometer columns; hidden slot anchor for runtime override -->
        <div style="position:relative;">
          <div class="odo-glow"></div>
          <div class="odo-frame" id="t1-st-odo-frame">
            <!-- columns built by JS based on data-value -->
          </div>
        </div>

        <span id="t1-st-odo-value" data-slot="stat" data-value="42800"
              style="display:none;">42,800</span>

        <div class="label" data-slot="label">creators actively enrolled in <em>certification programs</em> this quarter</div>
      </div>

      <div class="source" data-slot="source">SOURCE · PLATFORM DATA 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 });

      /* --- parse the value knob -------------------------------------------- */
      const valEl    = document.getElementById("t1-st-odo-value");
      const rawVal   = valEl.getAttribute("data-value") || "42800";
      const targetNum = parseInt(rawVal.replace(/[^0-9]/g, ""), 10) || 42800;

      /* Format with commas for display */
      function fmtNum(n) {
        return Math.round(n).toLocaleString("en-US");
      }

      /* Build the odometer columns from the target string */
      const targetStr = fmtNum(targetNum);   // e.g. "42,800"
      const frame     = document.getElementById("t1-st-odo-frame");
      const DIGIT_H   = 180;                  // height of one digit cell in px

      const strips = [];   // { stripEl, targetDigit } for digit columns only

      for (let i = 0; i < targetStr.length; i++) {
        const ch = targetStr[i];
        const col = document.createElement("div");

        if (ch === "," || ch === ".") {
          /* Separator column */
          col.className = "odo-col sep";
          const s = document.createElement("span");
          s.className = "sep-char";
          s.textContent = ch;
          col.appendChild(s);
        } else {
          /* Digit column */
          col.className = "odo-col";
          col.style.overflow = "hidden";

          const strip = document.createElement("div");
          strip.className = "odo-strip";

          /* Build 0–9 digit cells; mark the target digit .hero */
          const target = parseInt(ch, 10);
          for (let d = 0; d <= 9; d++) {
            const cell = document.createElement("div");
            cell.className = "odo-digit" + (d === target ? " hero" : "");
            cell.textContent = String(d);
            strip.appendChild(cell);
          }
          col.appendChild(strip);
          frame.appendChild(col);

          /* Start strip at 0 (showing digit 0 at center of window) */
          gsap.set(strip, { y: 0 });
          strips.push({ strip, target });
          continue;
        }

        frame.appendChild(col);
      }

      /* ---- Grain flicker -------------------------------------------------- */
      tl.fromTo("#t1-st-odo .grain",
        { backgroundPosition: "0px 0px" },
        { backgroundPosition: "110px 80px", duration: 0.6, ease: "none", repeat: 11, yoyo: true }, 0);

      /* ---- Scene entrance ------------------------------------------------- */
      tl.from("#t1-st-odo .bloom",
          { autoAlpha: 0, scale: 0.88, transformOrigin: "50% 120%", duration: 1.4, ease: "expo.out" }, 0)
        .from("#t1-st-odo .bg-grid",
          { autoAlpha: 0, duration: 1.1, ease: "power2.out" }, 0.2)
        .from("#t1-st-odo .kicker",
          { autoAlpha: 0, y: 18, filter: "blur(8px)", duration: 0.75, ease: "power3.out" }, 0.50)
        .from("#t1-st-odo .odo-glow",
          { autoAlpha: 0, scale: 0.6, duration: 1.2, ease: "expo.out" }, 0.65)
        .from("#t1-st-odo .odo-frame",
          { autoAlpha: 0, scale: 0.82, transformOrigin: "50% 50%",
            duration: 1.0, ease: "back.out(1.4)" }, 0.72);

      /* ---- Digit spin-up — stagger right-to-left so ones finish first ------- */
      strips.forEach(function(item, idx) {
        /* rightmost column (idx = strips.length-1) lands first at t=1.10 */
        const staggerOffset = (strips.length - 1 - idx) * 0.10;
        const startT = 1.10 + staggerOffset;
        /* y offset to show target digit: -(target * DIGIT_H) */
        tl.to(item.strip,
          { y: -(item.target * DIGIT_H), duration: 1.60, ease: "power3.out" }, startT);
      });

      tl.from("#t1-st-odo .label",
          { autoAlpha: 0, y: 20, filter: "blur(8px)", duration: 0.85, ease: "power3.out" }, 2.80)
        .from("#t1-st-odo .source",
          { autoAlpha: 0, duration: 0.7, ease: "power2.out" }, 3.10)
        /* Breathing glow on the frame */
        .to("#t1-st-odo .odo-glow",
          { opacity: 0.55, scale: 1.08, transformOrigin: "50% 50%",
            duration: 1.6, ease: "sine.inOut", repeat: 2, yoyo: true }, 3.40)
        .set({}, {}, 7);

      window.__timelines["t1-st-odo"] = tl;
    </script>
  </body>
</html>