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.0 KB
Raw Blame
<!doctype html>
<!--
  KALLAWAY · tier1 · stat · DONUT
  A donut chart (SVG) with one accent segment that sweeps in. Center % counts
  up. The remainder is a dimmed ghost track. Aurora bloom, glass glow, breathing.
  Knob: data-pct on #t1-st-donut-svg (default 73).
  Slots: kicker (~28 chars uppercase), stat (e.g. "73%"), 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-donut {
        position: absolute; inset: 0; width: 1920px; height: 1080px;
        background: var(--canvas); color: var(--text);
        font-family: var(--font-display); overflow: hidden;
      }

      #t1-st-donut .bloom {
        position: absolute; inset: 0; background: var(--bloom-bottom); z-index: 1;
      }
      #t1-st-donut .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%);
      }

      /* Layout: left = donut, right = text column */
      #t1-st-donut .layout {
        position: absolute; inset: 0; z-index: 4;
        display: flex; align-items: center; justify-content: center;
        gap: 120px; padding: 0 120px;
      }

      /* Kicker above donut */
      #t1-st-donut .left-col {
        display: flex; flex-direction: column; align-items: center; gap: 0;
        flex-shrink: 0;
      }

      #t1-st-donut .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);
        margin-bottom: 52px;
      }

      /* Donut container */
      #t1-st-donut .donut-wrap {
        position: relative;
        width: 500px; height: 500px;
        display: flex; align-items: center; justify-content: center;
      }

      /* Glow halo behind the donut */
      #t1-st-donut .donut-glow {
        position: absolute; inset: -50px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(var(--accent-rgb), 0.20) 0%, transparent 60%);
      }

      /* SVG */
      #t1-st-donut .donut-svg {
        position: relative; z-index: 2;
        width: 500px; height: 500px;
      }

      /* Center readout */
      #t1-st-donut .donut-center {
        position: absolute; inset: 0; z-index: 3;
        display: flex; flex-direction: column; align-items: center; justify-content: center;
      }
      #t1-st-donut .stat {
        font-family: var(--font-display);
        font-weight: var(--wt-black);
        font-size: 100px;
        line-height: 1;
        letter-spacing: var(--track-tight);
        background: linear-gradient(160deg, #ffffff 15%, rgba(var(--accent-rgb), 0.85) 80%);
        -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.60));
      }
      #t1-st-donut .stat-sub {
        font-family: var(--font-mono);
        font-size: 20px;
        font-weight: var(--wt-bold);
        letter-spacing: 0.12em;
        text-transform: uppercase;
        color: var(--text-dim);
        margin-top: 6px;
      }

      /* Right text column */
      #t1-st-donut .right-col {
        display: flex; flex-direction: column; gap: 32px;
        max-width: 720px;
      }
      #t1-st-donut .label {
        font-family: var(--font-body);
        font-size: var(--size-headline);
        font-weight: var(--wt-semi);
        color: var(--text);
        line-height: 1.35;
      }
      #t1-st-donut .label em {
        font-style: normal; color: var(--accent); text-shadow: var(--textglow-accent);
      }

      /* Source */
      #t1-st-donut .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-donut .vignette {
        position: absolute; inset: 0; pointer-events: none; z-index: 6;
        background: var(--vignette);
      }
      #t1-st-donut .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-donut" data-composition-id="t1-st-donut" data-start="0"
         data-width="1920" data-height="1080">
      <div class="bloom"></div>
      <div class="grid"></div>

      <div class="layout">
        <div class="left-col">
          <div class="kicker" data-slot="kicker">COURSE RETENTION RATE</div>

          <div class="donut-wrap">
            <div class="donut-glow"></div>

            <!--
              Donut: cx=250,cy=250 r=200 strokeWidth=50
              Full circumference = 2π×200 ≈ 1256.6
              Track is always shown; accent arc sweeps in from top (rotate -90).
            -->
            <svg class="donut-svg" id="t1-st-donut-svg" data-pct="73"
                 viewBox="0 0 500 500" fill="none" xmlns="http://www.w3.org/2000/svg">
              <defs>
                <linearGradient id="donutGrad" x1="0%" y1="0%" x2="100%" y2="100%">
                  <stop offset="0%" stop-color="#37BDF8" stop-opacity="0.7"/>
                  <stop offset="100%" stop-color="#ffffff" stop-opacity="0.95"/>
                </linearGradient>
                <filter id="donutGlow" x="-15%" y="-15%" width="130%" height="130%">
                  <feGaussianBlur in="SourceGraphic" stdDeviation="5" result="blur"/>
                  <feComposite in="SourceGraphic" in2="blur" operator="over"/>
                </filter>
              </defs>

              <!-- Ghost track -->
              <circle cx="250" cy="250" r="200"
                stroke="rgba(255,255,255,0.07)"
                stroke-width="50"
                fill="none"
              />

              <!-- Accent arc — starts at top -->
              <circle id="t1-st-donut-arc"
                cx="250" cy="250" r="200"
                stroke="url(#donutGrad)"
                stroke-width="50"
                stroke-linecap="butt"
                fill="none"
                transform="rotate(-90 250 250)"
                filter="url(#donutGlow)"
              />

              <!-- Bright leading tip dot -->
              <circle id="t1-st-donut-tip" cx="250" cy="50" r="16"
                fill="#ffffff"
                style="filter: drop-shadow(0 0 12px rgba(55,189,248,0.9)) drop-shadow(0 0 30px rgba(55,189,248,0.55));"
              />
            </svg>

            <div class="donut-center">
              <div class="stat" id="t1-st-donut-num" data-slot="stat">73%</div>
              <div class="stat-sub">retention</div>
            </div>
          </div>
        </div>

        <!-- Right text -->
        <div class="right-col">
          <div class="label" data-slot="label">of learners who start <em>finish the program</em> — 3× the industry average of 24%</div>
        </div>
      </div>

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

      /* Read knob */
      const svgEl = document.getElementById("t1-st-donut-svg");
      const pct   = parseFloat(svgEl.getAttribute("data-pct")) || 73;
      const arcEl = document.getElementById("t1-st-donut-arc");
      const tipEl = document.getElementById("t1-st-donut-tip");
      const numEl = document.getElementById("t1-st-donut-num");

      const r     = 200;
      const circ  = 2 * Math.PI * r;   // ≈ 1256.6

      /* Init arc hidden */
      arcEl.style.strokeDasharray  = circ;
      arcEl.style.strokeDashoffset = circ;

      /* Tip position on the ring for a given 0-100 percent.
         Arc starts at top (−90°) and sweeps clockwise. */
      function tipPos(p) {
        const angle = (p / 100) * 2 * Math.PI - Math.PI / 2;
        return {
          cx: 250 + r * Math.cos(angle),
          cy: 250 + r * Math.sin(angle)
        };
      }
      tipEl.setAttribute("cx", "250");
      tipEl.setAttribute("cy", "50");   // top

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

      /* Bloom + grid */
      tl.from("#t1-st-donut .bloom",
        { autoAlpha: 0, scale: 0.88, transformOrigin: "50% 120%", duration: 1.4, ease: "expo.out" }, 0)
        .from("#t1-st-donut .grid",
          { autoAlpha: 0, duration: 1.1, ease: "power2.out" }, 0.2)

        /* Kicker */
        .from("#t1-st-donut .kicker",
          { autoAlpha: 0, y: 18, filter: "blur(8px)", duration: 0.75, ease: "power3.out" }, 0.45)

        /* Donut glow blooms */
        .from("#t1-st-donut .donut-glow",
          { autoAlpha: 0, scale: 0.4, transformOrigin: "50% 50%", duration: 1.3, ease: "expo.out" }, 0.55)

        /* SVG scale+blur in */
        .from("#t1-st-donut .donut-svg",
          { autoAlpha: 0, scale: 0.7, transformOrigin: "50% 50%", duration: 0.9, ease: "back.out(1.4)" }, 0.65)

        /* Arc sweep + tip travel + count-up */
        .to({ val: 0 }, {
          val: pct,
          duration: 1.8, ease: "power2.out",
          onUpdate: function() {
            const v = this.targets()[0].val;
            arcEl.style.strokeDashoffset = circ - (v / 100) * circ;
            const pos = tipPos(v);
            tipEl.setAttribute("cx", pos.cx);
            tipEl.setAttribute("cy", pos.cy);
            numEl.textContent = Math.round(v) + "%";
          }
        }, 0.90)

        /* Center number blur-in */
        .from("#t1-st-donut .stat",
          { autoAlpha: 0, filter: "blur(18px)", duration: 0.85, ease: "power3.out" }, 0.95)

        .from("#t1-st-donut .stat-sub",
          { autoAlpha: 0, y: 8, duration: 0.7, ease: "power2.out" }, 1.60)

        /* Right-col label slides in */
        .from("#t1-st-donut .label",
          { autoAlpha: 0, x: 40, filter: "blur(10px)", duration: 0.9, ease: "power3.out" }, 1.80)

        /* Source */
        .from("#t1-st-donut .source",
          { autoAlpha: 0, duration: 0.7, ease: "power2.out" }, 2.30)

        /* Breathing glow pulse */
        .to("#t1-st-donut .donut-glow",
          { opacity: 0.55, scale: 1.10, transformOrigin: "50% 50%",
            duration: 1.6, ease: "sine.inOut", repeat: 2, yoyo: true }, 2.80)

        .set({}, {}, 7);

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