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.2 KB
Raw Blame
<!doctype html>
<!--
  KALLAWAY · tier2 · label · METERCHIP
  A compact frosted glass chip containing a tiny inline bar-meter that fills
  left-to-right, with a term label above and a detail line below. Anchored
  right side. Transparent overlay — only the chip paints.
  Knob: data-pct on #t2-lb-mtr-bar-inner (default 70).
  Slots: term (~26 chars), detail (~70 chars).
-->
<html>
  <head>
    <meta charset="utf-8" />
    <link rel="stylesheet" href="../../tokens.css" />
    <style>
      html, body { margin: 0; background: transparent; }

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

      /* Localized ambient glow — right upper area */
      #t2-lb-mtr .local-glow {
        position: absolute;
        right: 80px; top: 310px;
        width: 500px; height: 300px;
        border-radius: 50%;
        background: radial-gradient(ellipse at 55% 45%,
          rgba(var(--accent-rgb), 0.22) 0%,
          rgba(var(--accent-rgb), 0.07) 54%,
          transparent 80%);
        filter: blur(42px);
        pointer-events: none;
      }

      /* The chip — anchored right, upper-mid */
      #t2-lb-mtr .chip {
        position: absolute;
        right: 120px; top: 340px;
        width: 390px;
        padding: 20px 24px 18px;
        background: var(--glass-bg-dark);
        backdrop-filter: var(--glass-blur);
        -webkit-backdrop-filter: var(--glass-blur);
        border: 1.5px solid var(--glass-border);
        border-radius: var(--radius);
        box-shadow:
          var(--glass-shadow),
          0 0 0 1px rgba(var(--accent-rgb), 0.28),
          0 0 20px rgba(var(--accent-rgb), 0.18),
          inset 0 1px 0 var(--glass-hi);
        overflow: hidden;
      }

      /* Hairline top shimmer */
      #t2-lb-mtr .chip::before {
        content: "";
        position: absolute; top: 0; left: 14px; right: 14px; height: 1px;
        background: linear-gradient(90deg,
          transparent,
          rgba(255,255,255,0.50) 45%,
          rgba(255,255,255,0.50) 55%,
          transparent);
      }

      /* Header row: small accent dot + term */
      #t2-lb-mtr .chip-header {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 14px;
      }

      #t2-lb-mtr .dot {
        width: 8px; height: 8px;
        border-radius: 50%;
        background: var(--accent);
        box-shadow: var(--glow-accent-sm);
        flex-shrink: 0;
      }

      #t2-lb-mtr .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);
        line-height: 1.1;
      }

      /* Bar-meter track */
      #t2-lb-mtr .meter-track {
        width: 100%;
        height: 10px;
        border-radius: 999px;
        background: rgba(255,255,255,0.08);
        overflow: hidden;
        margin-bottom: 10px;
        position: relative;
      }

      /* Gradient fill bar — width driven by JS from data-pct */
      #t2-lb-mtr .meter-fill {
        height: 100%;
        width: 0%;   /* animated by GSAP */
        border-radius: 999px;
        background: linear-gradient(90deg,
          rgba(var(--accent-rgb), 0.70) 0%,
          #37BDF8 60%,
          rgba(255,255,255,0.90) 100%);
        box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.55),
                    0 0 22px rgba(var(--accent-rgb), 0.30);
      }

      /* Value readout row */
      #t2-lb-mtr .meter-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 12px;
      }

      #t2-lb-mtr .pct-label {
        font-family: var(--font-mono);
        font-weight: var(--wt-bold);
        font-size: 20px;
        color: var(--accent);
        text-shadow: var(--textglow-accent);
        letter-spacing: 0.06em;
      }

      #t2-lb-mtr .pct-of {
        font-family: var(--font-mono);
        font-size: 16px;
        color: var(--text-faint);
        letter-spacing: 0.06em;
      }

      /* Divider */
      #t2-lb-mtr .divider {
        height: 1px;
        background: var(--glass-border);
        margin-bottom: 10px;
        border-radius: 1px;
      }

      #t2-lb-mtr .detail {
        font-family: var(--font-body);
        font-weight: var(--wt-reg);
        font-size: 19px;
        line-height: 1.45;
        color: var(--text-dim);
      }
    </style>
  </head>
  <body>
    <div id="t2-lb-mtr" data-composition-id="t2-lb-mtr"
         data-start="0" data-width="1920" data-height="1080">

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

      <div class="chip">
        <div class="chip-header">
          <div class="dot"></div>
          <div class="term" data-slot="term">Module Completion</div>
        </div>

        <div class="meter-track">
          <div class="meter-fill" id="t2-lb-mtr-fill" data-pct="70"></div>
        </div>

        <div class="meter-row">
          <div class="pct-label" id="t2-lb-mtr-pct">0%</div>
          <div class="pct-of">of enrolled learners</div>
        </div>

        <div class="divider"></div>

        <div class="detail" data-slot="detail">Courses with structured checkpoints see the highest completion in cohort data.</div>
      </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 });

      const COMP   = "#t2-lb-mtr";
      const fillEl = document.getElementById("t2-lb-mtr-fill");
      const pctEl  = document.getElementById("t2-lb-mtr-pct");
      const target = parseFloat(fillEl.getAttribute("data-pct")) || 70;

      /* ambient glow */
      tl.from(`${COMP} .local-glow`,
        { autoAlpha: 0, scale: 0.6, transformOrigin: "55% 45%",
          duration: 1.1, ease: "expo.out" }, 0)

      /* chip springs in from right */
        .from(`${COMP} .chip`,
          { autoAlpha: 0, x: 36, scale: 0.92, transformOrigin: "right center",
            filter: "blur(14px)", duration: 0.80, ease: "back.out(1.4)" }, 0.18)

      /* term + dot glide in */
        .from(`${COMP} .chip-header`,
          { autoAlpha: 0, x: 18, filter: "blur(8px)",
            duration: 0.62, ease: "power4.out" }, 0.60)

      /* bar fills + count-up using 3-arg .to on proxy */
        .to({ val: 0 }, {
          val: target,
          duration: 1.30, ease: "power2.out",
          onUpdate: function() {
            const v = this.targets()[0].val;
            fillEl.style.width = v + "%";
            pctEl.textContent  = Math.round(v) + "%";
          }
        }, 0.88)

      /* detail fades in */
        .from(`${COMP} .detail`,
          { autoAlpha: 0, y: 12, filter: "blur(6px)",
            duration: 0.60, ease: "power3.out" }, 1.55)

      /* finite glow pulse on chip border */
        .to(`${COMP} .chip`, {
          boxShadow:
            "0 24px 70px rgba(0,0,0,0.50), 0 0 0 1px rgba(55,189,248,0.50), 0 0 34px rgba(55,189,248,0.32), inset 0 1px 0 rgba(255,255,255,0.22)",
          duration: 1.10, ease: "sine.inOut", repeat: 2, yoyo: true }, 2.10)

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

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