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.

8.1 KB
Raw Blame
<!doctype html>
<!--
  KALLAWAY · tier2 · label · PROGRESS CHIP
  A small glowing SVG ring that draws to a value; percentage counts up in the
  center. Term (label) + detail beneath the ring. Anchored right side.
  Transparent overlay.
  Knob: data-pct (default 70)  — integer 0–100.
  Slots: term (~20 chars — metric name), detail (~48 chars — context line).
-->
<html>
  <head>
    <meta charset="utf-8" />
    <link rel="stylesheet" href="../../tokens.css" />
    <style>
      html, body { margin: 0; background: transparent; }

      #t2-lb-prog {
        position: absolute; inset: 0; width: 1920px; height: 1080px;
        background: transparent; overflow: hidden;
        font-family: var(--font-display);
      }

      /* Localized glow — right side, centered on the ring */
      #t2-lb-prog .local-glow {
        position: absolute; right: 80px; top: 360px;
        width: 440px; height: 380px; border-radius: 50%;
        background: radial-gradient(ellipse at 50% 50%,
          rgba(var(--accent-rgb), 0.28) 0%,
          rgba(var(--accent-rgb), 0.09) 52%,
          transparent 75%);
        filter: blur(36px);
        pointer-events: none;
      }

      /* Outer glass card */
      #t2-lb-prog .chip {
        position: absolute; right: 80px; top: 390px;
        width: 340px;
        background: var(--glass-bg-dark);
        backdrop-filter: var(--glass-blur);
        -webkit-backdrop-filter: var(--glass-blur);
        border: 1.5px solid var(--glass-border);
        border-top: 1.5px solid var(--glass-hi);
        box-shadow: var(--glass-shadow),
                    0 0 30px rgba(var(--accent-rgb), 0.22),
                    inset 0 0 0 1px rgba(var(--accent-rgb), 0.06);
        border-radius: var(--radius);
        padding: 30px 30px 26px;
        display: flex; flex-direction: column; align-items: center; gap: 0;
        overflow: hidden;
      }

      /* Neon top-rim */
      #t2-lb-prog .chip::before {
        content: "";
        position: absolute; left: 0; right: 0; top: 0; height: 2px;
        background: linear-gradient(90deg,
          transparent 0%, rgba(var(--accent-rgb), 0.75) 40%,
          rgba(var(--accent-rgb), 0.75) 60%, transparent 100%);
        box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.50);
      }

      /* SVG ring wrapper */
      #t2-lb-prog .ring-wrap {
        position: relative; width: 140px; height: 140px;
        margin-bottom: 18px;
      }

      #t2-lb-prog .ring-svg {
        width: 140px; height: 140px;
        transform: rotate(-90deg);
      }

      /* Track (dim) ring */
      #t2-lb-prog .ring-track {
        fill: none;
        stroke: rgba(var(--accent-rgb), 0.14);
        stroke-width: 9;
      }

      /* Progress arc */
      #t2-lb-prog .ring-arc {
        fill: none;
        stroke: url(#ring-grad);
        stroke-width: 9;
        stroke-linecap: round;
        /* circumference of r=57: 2*pi*57 ≈ 358.14  */
        stroke-dasharray: 358.14;
        stroke-dashoffset: 358.14; /* starts empty; JS animates to target */
        filter: drop-shadow(0 0 6px rgba(var(--accent-rgb), 0.70));
      }

      /* Percentage label floating in center */
      #t2-lb-prog .pct-label {
        position: absolute;
        inset: 0;
        display: flex; align-items: center; justify-content: center;
        font-family: var(--font-mono); font-weight: 700;
        font-size: 34px; letter-spacing: -0.02em;
        background: linear-gradient(115deg, #FFFFFF 0%, var(--accent) 100%);
        -webkit-background-clip: text; background-clip: text;
        -webkit-text-fill-color: transparent; color: transparent;
        filter: drop-shadow(0 0 10px rgba(var(--accent-rgb), 0.60));
      }

      /* Term — metric name */
      #t2-lb-prog .term {
        font-family: var(--font-display); font-weight: var(--wt-bold);
        font-size: 26px; letter-spacing: var(--track-snug);
        color: var(--white); text-shadow: var(--textglow);
        text-align: center; margin-bottom: 8px;
      }

      /* Thin rule */
      #t2-lb-prog .rule {
        height: 1px; width: 100%;
        background: linear-gradient(90deg,
          transparent 0%, rgba(var(--accent-rgb), 0.50) 50%, transparent 100%);
        margin-bottom: 10px;
        transform-origin: center;
      }

      /* Detail */
      #t2-lb-prog .detail {
        font-family: var(--font-body); font-weight: var(--wt-reg);
        font-size: 19px; line-height: 1.45; letter-spacing: 0.01em;
        color: var(--text-dim); text-align: center;
      }
    </style>
  </head>
  <body>
    <div id="t2-lb-prog"
         data-composition-id="t2-lb-prog"
         data-start="0" data-width="1920" data-height="1080"
         data-pct="70">

      <div class="local-glow"></div>

      <div class="chip">
        <div class="ring-wrap">
          <svg class="ring-svg" viewBox="0 0 130 130" xmlns="http://www.w3.org/2000/svg">
            <defs>
              <linearGradient id="ring-grad" x1="0%" y1="0%" x2="100%" y2="0%">
                <stop offset="0%" stop-color="#FFFFFF" stop-opacity="0.9"/>
                <stop offset="100%" stop-color="#37BDF8" stop-opacity="1"/>
              </linearGradient>
            </defs>
            <!-- r=57 → cx=cy=65 -->
            <circle class="ring-track" cx="65" cy="65" r="57"/>
            <circle class="ring-arc"   cx="65" cy="65" r="57"/>
          </svg>
          <div class="pct-label">0%</div>
        </div>

        <div class="term"  data-slot="term">Completion Rate</div>
        <div class="rule"></div>
        <div class="detail" data-slot="detail">of enrolled students finish the full program</div>
      </div>
    </div>

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

      const COMP  = "#t2-lb-prog";
      const root  = document.querySelector(COMP);
      const pct   = Math.min(100, Math.max(0,
                      parseInt(root.dataset.pct ?? "70", 10)));

      /* SVG arc constants (r = 57) */
      const CIRC  = 2 * Math.PI * 57; /* ≈ 358.14 */

      const arc   = root.querySelector(".ring-arc");
      const pctEl = root.querySelector(".pct-label");

      const tl = gsap.timeline({ paused: true });

      /* 1 — local glow blooms in */
      tl.from(`${COMP} .local-glow`, {
            autoAlpha: 0, scale: 0.5, transformOrigin: "50% 50%",
            duration: 1.1, ease: "expo.out" }, 0)

        /* 2 — chip card springs in from the right */
        .from(`${COMP} .chip`, {
            autoAlpha: 0, x: 50, scale: 0.88, filter: "blur(14px)",
            transformOrigin: "100% 50%",
            duration: 0.75, ease: "back.out(1.4)" }, 0.22)

        /* 3 — ring-wrap fades in (slight blur) */
        .from(`${COMP} .ring-wrap`, {
            autoAlpha: 0, scale: 0.70, filter: "blur(10px)",
            transformOrigin: "50% 50%",
            duration: 0.60, ease: "power4.out" }, 0.55)

        /* 4 — arc draws + percentage counts up (VALUE RULE: 3-arg .to) */
        .to({ val: 0 }, {
            val: pct,
            duration: 1.30,
            ease: "power3.out",
            onUpdate: function() {
              const v      = Math.round(this.targets()[0].val);
              const offset = CIRC * (1 - v / 100);
              arc.style.strokeDashoffset = offset;
              pctEl.textContent = v + "%";
            }
          }, 0.70)

        /* 5 — term fades up */
        .from(`${COMP} .term`, {
            autoAlpha: 0, y: 10, filter: "blur(6px)",
            duration: 0.50, ease: "power4.out" }, 1.30)

        /* 6 — rule draws */
        .from(`${COMP} .rule`, {
            scaleX: 0, transformOrigin: "50% 50%",
            duration: 0.38, ease: "power3.out" }, 1.55)

        /* 7 — detail fades */
        .from(`${COMP} .detail`, {
            autoAlpha: 0, y: 8,
            duration: 0.42, ease: "power2.out" }, 1.68)

        /* 8 — glow pulse on chip + arc, finite */
        .to(`${COMP} .chip`, {
            boxShadow: "0 24px 70px rgba(0,0,0,0.50), 0 0 48px rgba(55,189,248,0.45), inset 0 0 0 1px rgba(55,189,248,0.18)",
            duration: 1.0, ease: "sine.inOut", repeat: 3, yoyo: true }, 2.4)

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

      window.__timelines["t2-lb-prog"] = tl;
    </script>
  </body>
</html>