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.

9.7 KB
Raw Blame
<!doctype html>
<!--
  KALLAWAY · tier2 · label · RATING
  A glass chip showing a row of stars that light up staggered to a value, plus
  `term` (numeric rating, e.g. "4.9") and `detail` (context line).
  Stars: filled in accent blue; partially lit (0.5) stars also supported.
  Anchored right side. Transparent overlay.
  Slots: term (~5 chars — numeric label e.g. "4.9"), detail (~48 chars — context).
-->
<html>
  <head>
    <meta charset="utf-8" />
    <link rel="stylesheet" href="../../tokens.css" />
    <style>
      html, body { margin: 0; background: transparent; }

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

      /* Localized glow — right side */
      #t2-lb-rate .local-glow {
        position: absolute; right: 70px; top: 390px;
        width: 540px; height: 340px; border-radius: 50%;
        background: radial-gradient(ellipse at 50% 50%,
          rgba(var(--accent2-rgb), 0.20) 0%,     /* yellow glow for star */
          rgba(var(--accent-rgb),  0.12) 40%,
          transparent 75%);
        filter: blur(40px);
        pointer-events: none;
      }

      /* Glass chip */
      #t2-lb-rate .chip {
        position: absolute; right: 80px; top: 420px;
        width: 420px;
        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 28px rgba(var(--accent-rgb), 0.18),
                    inset 0 0 0 1px rgba(var(--accent-rgb), 0.06);
        border-radius: var(--radius);
        padding: 28px 32px;
        display: flex; flex-direction: column; gap: 12px;
        overflow: hidden;
      }

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

      /* Row: big number + stars side by side */
      #t2-lb-rate .rating-row {
        display: flex; flex-direction: row;
        align-items: center; gap: 16px;
      }

      /* Big numeric value — yellow (accent-2) for that rare pop */
      #t2-lb-rate .rating-value {
        font-family: var(--font-mono); font-weight: 700;
        font-size: 56px; letter-spacing: -0.02em; line-height: 1.0;
        background: linear-gradient(110deg,
          #FFFFFF 0%, var(--accent-2) 70%);
        -webkit-background-clip: text; background-clip: text;
        -webkit-text-fill-color: transparent; color: transparent;
        filter: drop-shadow(0 0 14px rgba(var(--accent2-rgb), 0.65))
                drop-shadow(0 0 5px rgba(255,255,255,0.25));
        flex-shrink: 0;
      }

      /* Star row */
      #t2-lb-rate .stars {
        display: flex; flex-direction: row; gap: 6px;
        align-items: center;
      }

      /* Individual star — SVG polygon; dim by default, lit when .lit */
      #t2-lb-rate .star {
        width: 34px; height: 34px;
        opacity: 0.18; /* dim = unfilled */
        transition: none; /* GSAP controls this */
        filter: drop-shadow(0 0 6px rgba(var(--accent2-rgb), 0));
      }

      #t2-lb-rate .star.lit {
        /* target state GSAP animates TO — handled in JS */
      }

      #t2-lb-rate .star svg {
        width: 34px; height: 34px;
      }

      /* Thin rule */
      #t2-lb-rate .rule {
        height: 1px; width: 100%;
        background: linear-gradient(90deg,
          rgba(var(--accent2-rgb), 0.40) 0%,
          rgba(var(--accent-rgb),  0.30) 60%,
          transparent 100%);
        transform-origin: left center;
      }

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

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

      <div class="chip">
        <div class="rating-row">
          <div class="rating-value" data-slot="term">4.9</div>
          <div class="stars" id="star-row">
            <!-- 5 stars; JS will manage .lit / glow based on rating-value -->
            <div class="star" data-index="0">
              <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
                <polygon points="12,2 15.09,8.26 22,9.27 17,14.14 18.18,21.02 12,17.77 5.82,21.02 7,14.14 2,9.27 8.91,8.26"
                  fill="#F5D82A" stroke="#F5D82A" stroke-width="1" stroke-linejoin="round"/>
              </svg>
            </div>
            <div class="star" data-index="1">
              <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
                <polygon points="12,2 15.09,8.26 22,9.27 17,14.14 18.18,21.02 12,17.77 5.82,21.02 7,14.14 2,9.27 8.91,8.26"
                  fill="#F5D82A" stroke="#F5D82A" stroke-width="1" stroke-linejoin="round"/>
              </svg>
            </div>
            <div class="star" data-index="2">
              <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
                <polygon points="12,2 15.09,8.26 22,9.27 17,14.14 18.18,21.02 12,17.77 5.82,21.02 7,14.14 2,9.27 8.91,8.26"
                  fill="#F5D82A" stroke="#F5D82A" stroke-width="1" stroke-linejoin="round"/>
              </svg>
            </div>
            <div class="star" data-index="3">
              <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
                <polygon points="12,2 15.09,8.26 22,9.27 17,14.14 18.18,21.02 12,17.77 5.82,21.02 7,14.14 2,9.27 8.91,8.26"
                  fill="#F5D82A" stroke="#F5D82A" stroke-width="1" stroke-linejoin="round"/>
              </svg>
            </div>
            <div class="star" data-index="4">
              <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
                <polygon points="12,2 15.09,8.26 22,9.27 17,14.14 18.18,21.02 12,17.77 5.82,21.02 7,14.14 2,9.27 8.91,8.26"
                  fill="#F5D82A" stroke="#F5D82A" stroke-width="1" stroke-linejoin="round"/>
              </svg>
            </div>
          </div>
        </div>

        <div class="rule"></div>
        <div class="detail" data-slot="detail">average across 2,400 verified student reviews</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-rate";
      const tl    = gsap.timeline({ paused: true });

      /* Parse rating from the visible text (e.g. "4.9" → 4.9) */
      const ratingEl  = document.querySelector(`${COMP} .rating-value`);
      const ratingVal = parseFloat(ratingEl.textContent.trim()) || 4.9;
      const stars     = Array.from(document.querySelectorAll(`${COMP} .star`));

      /* Determine filled count (floor) + whether a partial star is needed */
      const fullStars    = Math.floor(ratingVal);
      const hasFraction  = (ratingVal - fullStars) >= 0.3 && fullStars < 5;

      /* ---- build timeline in sequential statements (no spread in method chain) ---- */

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

      /* 2 — chip springs in */
      tl.from(`${COMP} .chip`, {
            autoAlpha: 0, x: 52, scale: 0.86, filter: "blur(14px)",
            transformOrigin: "100% 50%",
            duration: 0.78, ease: "back.out(1.4)" }, 0.20);

      /* 3 — rating value blur-in */
      tl.from(`${COMP} .rating-value`, {
            autoAlpha: 0, y: -16, filter: "blur(16px)",
            duration: 0.58, ease: "power4.out" }, 0.56);

      /* 4 — staggered star light-up (full stars) */
      if (fullStars > 0) {
        tl.to(stars.slice(0, fullStars), {
            opacity: 1.0,
            filter: "drop-shadow(0 0 10px rgba(245,216,42,0.80)) drop-shadow(0 0 4px rgba(245,216,42,0.60))",
            duration: 0.28, stagger: 0.12, ease: "power3.out" }, 0.88);
      }

      /* 4b — partial/half star (if any) */
      if (hasFraction) {
        tl.to(stars[fullStars], {
            opacity: 0.55,
            filter: "drop-shadow(0 0 6px rgba(245,216,42,0.50))",
            duration: 0.28, ease: "power3.out" }, 0.88 + fullStars * 0.12);
      }

      /* 5 — rule draws */
      tl.from(`${COMP} .rule`, {
            scaleX: 0, transformOrigin: "0% 50%",
            duration: 0.42, ease: "power3.out" }, 1.70);

      /* 6 — detail fades */
      tl.from(`${COMP} .detail`, {
            autoAlpha: 0, y: 10,
            duration: 0.45, ease: "power2.out" }, 1.86);

      /* 7 — soft star shimmer pulse, finite */
      if (fullStars > 0) {
        tl.to(stars.slice(0, fullStars), {
            filter: "drop-shadow(0 0 18px rgba(245,216,42,0.95)) drop-shadow(0 0 6px rgba(245,216,42,0.70))",
            duration: 0.90, ease: "sine.inOut", repeat: 2, yoyo: true,
            stagger: 0.08 }, 2.4);
      }

      /* 8 — chip glow pulse */
      tl.to(`${COMP} .chip`, {
            boxShadow: "0 24px 70px rgba(0,0,0,0.50), 0 0 44px rgba(55,189,248,0.35), inset 0 0 0 1px rgba(55,189,248,0.16)",
            duration: 1.1, ease: "sine.inOut", repeat: 2, yoyo: true }, 2.6);

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

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