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.

4.2 KB
Raw Blame
<!doctype html>
<!--
  VOX EXPLAINER · tier2 · label-circle (overlay: term with hand-drawn yellow ring)
  TRANSPARENT. A term sits left-of-center; a slightly irregular yellow ellipse ring
  "draws on" around it (SVG stroke-dashoffset).
  Slots: term, detail.
-->
<html>
  <head>
    <meta charset="utf-8" />
    <link rel="stylesheet" href="../../tokens.css" />
    <style>
      html, body { margin: 0; background: transparent; }
      #t2-lb-circ {
        position: absolute; inset: 0; width: 1920px; height: 1080px;
        background: transparent; font-family: var(--font-display);
      }
      #t2-lb-circ .wrap { position: absolute; left: 150px; top: 360px; width: 760px; }

      /* term row — relative so the SVG ring can sit on top absolutely */
      #t2-lb-circ .term-row {
        position: relative; display: inline-block;
      }
      #t2-lb-circ .term {
        display: inline-block;
        font-family: var(--font-display);
        font-weight: var(--wt-black);
        font-size: 72px;
        letter-spacing: var(--track-tight);
        color: var(--ink);
        padding: 8px 24px;
        position: relative; z-index: 2;
        background: rgba(239, 233, 220, 0.94);
        border-radius: 2px;
      }
      /* hand-drawn ring — SVG absolutely overlaid on the term-row */
      #t2-lb-circ .ring-svg {
        position: absolute;
        top: -18px; left: -22px;
        width: calc(100% + 44px);
        height: calc(100% + 36px);
        pointer-events: none; z-index: 3;
        overflow: visible;
      }
      #t2-lb-circ .ring-ellipse {
        fill: none;
        stroke: var(--yellow);
        stroke-width: 7;
        stroke-linecap: round;
        /* slight imperfection via a small path jitter from rx/ry mismatch */
      }

      #t2-lb-circ .detail {
        margin-top: 28px; max-width: 620px;
        font-family: var(--font-label); font-weight: var(--wt-reg);
        font-size: var(--size-body); line-height: 1.4; color: var(--ink);
        background: rgba(239,233,220,0.92); padding: 10px 16px; display: inline-block;
      }    </style>
  </head>
  <body>
    <div id="t2-lb-circ" data-composition-id="t2-lb-circ" data-start="0" data-width="1920" data-height="1080">
      <div class="wrap">
        <div class="term-row">
          <div class="term" data-slot="term">confirmation bias</div>
          <!--
            SVG ring: a single ellipse. We animate stroke-dashoffset to "draw on."
            The ellipse circumference ≈ 2π * sqrt((rx²+ry²)/2).
            We'll set dasharray/dashoffset via JS for exact match.
          -->
          <svg class="ring-svg" viewBox="0 0 100 100" preserveAspectRatio="none">
            <ellipse class="ring-ellipse"
              cx="50" cy="50" rx="47" ry="45"
              transform="rotate(-4, 50, 50)"
            />
          </svg>
        </div>
        <div class="detail" data-slot="detail">We seek facts that confirm what we already believe.</div>
      </div>
    </div>

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

      /* Compute the ellipse perimeter to set dasharray so the ring draws fully. */
      const ellipse = document.querySelector("#t2-lb-circ .ring-ellipse");
      const rx = 47, ry = 45;
      /* Ramanujan approximation for ellipse circumference in SVG user units */
      const h = Math.pow(rx - ry, 2) / Math.pow(rx + ry, 2);
      const perim = Math.PI * (rx + ry) * (1 + (3 * h) / (10 + Math.pow(4 - 3 * h, 0.5)));
      ellipse.style.strokeDasharray  = perim;
      ellipse.style.strokeDashoffset = perim;

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

      /* 1. term snaps in via scaleX wipe */
      tl.from("#t2-lb-circ .term", {
          autoAlpha: 0, scaleX: 0, transformOrigin: "left center",
          duration: 0.32, ease: "power3.out"
        }, 0.0)
      /* 2. ring draws on (stroke-dashoffset → 0) */
        .to("#t2-lb-circ .ring-ellipse", {
          strokeDashoffset: 0, duration: 0.52, ease: "power2.inOut"
        }, 0.28)
      /* 3. detail steps in */
        .from("#t2-lb-circ .detail", {
          autoAlpha: 0, y: 14, duration: 0.30, ease: "steps(4)"
        }, 0.68)
        .set({}, {}, 7);

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