Skip to content

Write HTML. Render video. Built for agents.

7.9 KB
Raw Blame
{"html":"<!doctype html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <script src=\"https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js\"></script>\n    <style>\n      *,\n      *::before,\n      *::after {\n        margin: 0;\n        padding: 0;\n        box-sizing: border-box;\n      }\n      body {\n        background: transparent;\n        overflow: hidden;\n      }\n      #yt-li-root {\n        /* ---- yt tokens ---- */\n        --yt-font: \"Inter\", -apple-system, sans-serif;\n        --yt-paper: #e9e9e6;\n        --yt-paper-dark: #1c1c1e;\n        --yt-ink: #1d1d1f;\n        --yt-ink-dark: #e8e8e4;\n        --yt-red: #e62e2e;\n        --yt-line-alpha: 0.1;\n\n        position: relative;\n        width: 1920px;\n        height: 1080px;\n        overflow: hidden;\n        background: var(--yt-paper);\n        font-family: var(--yt-font);\n      }\n      #yt-li-root.yt-dark {\n        background: var(--yt-paper-dark);\n      }\n      #yt-li-lines {\n        position: absolute;\n        inset: 0;\n      }\n      .yt-li-line {\n        position: absolute;\n        left: -40px;\n        right: -40px;\n        height: 2px;\n        background: rgba(0, 0, 0, var(--yt-line-alpha));\n      }\n      .yt-dark .yt-li-line {\n        background: rgba(255, 255, 255, var(--yt-line-alpha));\n      }\n      #yt-li-center {\n        position: absolute;\n        inset: 0;\n        display: flex;\n        flex-direction: column;\n        align-items: center;\n        justify-content: center;\n        gap: 42px;\n      }\n      #yt-li-logo {\n        width: 220px;\n        height: 220px;\n        border-radius: 50%;\n        display: flex;\n        align-items: center;\n        justify-content: center;\n        background: var(--yt-ink);\n        color: #ffffff;\n        font-weight: 700;\n        font-size: 92px;\n        letter-spacing: -0.03em;\n        overflow: hidden;\n      }\n      .yt-dark #yt-li-logo {\n        background: var(--yt-ink-dark);\n        color: var(--yt-paper-dark);\n      }\n      #yt-li-logo img {\n        width: 100%;\n        height: 100%;\n        object-fit: contain;\n      }\n      .yt-li-shadow #yt-li-logo,\n      .yt-li-shadow #yt-li-text {\n        filter: drop-shadow(0 14px 30px rgba(0, 0, 0, 0.22));\n      }\n      #yt-li-textrow {\n        display: flex;\n        align-items: center;\n        gap: 26px;\n        min-height: 96px;\n      }\n      #yt-li-text {\n        font-weight: 700;\n        font-size: 74px;\n        letter-spacing: -0.015em;\n        color: var(--yt-ink);\n        white-space: nowrap;\n      }\n      .yt-dark #yt-li-text {\n        color: var(--yt-ink-dark);\n      }\n      #yt-li-arrow {\n        display: inline-flex;\n        align-items: center;\n        justify-content: center;\n        width: 84px;\n        height: 64px;\n        border-radius: 16px;\n        background: var(--yt-red);\n        opacity: 0;\n      }\n      #yt-li-arrow svg {\n        width: 38px;\n        stroke: #ffffff;\n        stroke-width: 3.2;\n        stroke-linecap: round;\n        stroke-linejoin: round;\n        fill: none;\n      }\n    </style>\n  </head>\n  <body>\n    <div\n      id=\"yt-li-root\"\n      data-composition-id=\"yt-logo-intro\"\n      data-start=\"0\"\n      data-duration=\"6\"\n      data-width=\"1920\"\n      data-height=\"1080\"\n    >\n      <div id=\"yt-li-lines\"></div>\n      <div id=\"yt-li-center\">\n        <div id=\"yt-li-logo\"></div>\n        <div id=\"yt-li-textrow\">\n          <div id=\"yt-li-text\"></div>\n          <div id=\"yt-li-arrow\">\n            <svg viewBox=\"0 0 24 24\"><path d=\"M4 12h15M13 5l7 7-7 7\" /></svg>\n          </div>\n        </div>\n      </div>\n      <div\n        id=\"yt-li-drv\"\n        class=\"clip\"\n        data-start=\"0\"\n        data-duration=\"6\"\n        data-track-index=\"0\"\n        style=\"position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none\"\n      ></div>\n    </div>\n    <script>\n      (function () {\n        window.__timelines = window.__timelines || {};\n\n        /* ---- published parameters ----\n           A logo intro: logo drops in, a kicker line, then the title\n           with an accent-red arrow. Background lines with frequency +\n           distortion (seeded offsets — no randomness). */\n        var CONFIG = {\n          scheme: \"light\", // \"light\" | \"dark\"\n          logoType: \"text\", // \"text\" | \"image\"\n          logoText: \"YT\",\n          logoSrc: null,\n          kicker: \"LET'S DIVE IN\",\n          title: \"yt-logo-intro\",\n          arrow: { enabled: true },\n          lines: { enabled: true, count: 12, distort: 10 },\n          dropShadow: true,\n          animationIn: true,\n          animationOut: true,\n        };\n\n        var DUR = 6;\n        function clamp(v, lo, hi) {\n          return Math.min(hi, Math.max(lo, v));\n        }\n        var IN = clamp(DUR * 0.08, 0.3, 0.8);\n        var OUT = clamp(DUR * 0.06, 0.25, 0.6);\n\n        var root = document.getElementById(\"yt-li-root\");\n        var lines = document.getElementById(\"yt-li-lines\");\n        var logo = document.getElementById(\"yt-li-logo\");\n        var text = document.getElementById(\"yt-li-text\");\n        var arrow = document.getElementById(\"yt-li-arrow\");\n\n        if (CONFIG.scheme === \"dark\") root.classList.add(\"yt-dark\");\n        if (CONFIG.dropShadow) root.classList.add(\"yt-li-shadow\");\n\n        /* background lines: even spacing + seeded sine distortion */\n        if (CONFIG.lines.enabled) {\n          var gap = 1080 / (CONFIG.lines.count + 1);\n          for (var i = 1; i <= CONFIG.lines.count; i++) {\n            var l = document.createElement(\"div\");\n            l.className = \"yt-li-line\";\n            var wobble = Math.sin(i * 2.399) * CONFIG.lines.distort;\n            l.style.top = Math.round(i * gap + wobble) + \"px\";\n            l.style.transform = \"rotate(\" + (Math.sin(i * 1.7) * 0.35).toFixed(2) + \"deg)\";\n            lines.appendChild(l);\n          }\n        }\n\n        if (CONFIG.logoType === \"image\" && CONFIG.logoSrc) {\n          var img = document.createElement(\"img\");\n          img.src = CONFIG.logoSrc;\n          logo.appendChild(img);\n        } else {\n          logo.textContent = CONFIG.logoText;\n        }\n        if (!CONFIG.arrow.enabled) arrow.style.display = \"none\";\n\n        var tl = gsap.timeline({ paused: true });\n\n        if (CONFIG.animationIn) tl.from(root, { opacity: 0, duration: IN, ease: \"power2.out\" }, 0);\n\n        /* logo pops */\n        gsap.set(logo, { opacity: 0, scale: 0.55, y: 24 });\n        tl.to(\n          logo,\n          { opacity: 1, scale: 1, y: 0, duration: 0.55, ease: \"back.out(1.5)\" },\n          IN * 0.6,\n        );\n\n        /* kicker -> swap -> title + arrow */\n        gsap.set(text, { opacity: 0, y: 14 });\n        tl.set(text, { textContent: CONFIG.kicker, letterSpacing: \"0.22em\", fontSize: \"40px\" }, 0);\n        tl.to(text, { opacity: 1, y: 0, duration: 0.45, ease: \"power2.out\" }, IN * 0.6 + 0.45);\n        tl.to(text, { opacity: 0, y: -12, duration: 0.3, ease: \"power2.in\" }, 2.3);\n        tl.set(\n          text,\n          { textContent: CONFIG.title, letterSpacing: \"-0.015em\", fontSize: \"74px\", y: 14 },\n          2.62,\n        );\n        tl.to(text, { opacity: 1, y: 0, duration: 0.5, ease: \"power3.out\" }, 2.66);\n        gsap.set(arrow, { scale: 0.5, x: -14 });\n        tl.to(arrow, { opacity: 1, scale: 1, x: 0, duration: 0.45, ease: \"back.out(1.6)\" }, 2.9);\n\n        /* ambient: lines breathe */\n        tl.to(lines, { y: 8, duration: 2.2, ease: \"sine.inOut\", yoyo: true, repeat: 1 }, 0.8);\n\n        /* exit + hard kill */\n        if (CONFIG.animationOut) {\n          tl.to(root, { opacity: 0, duration: OUT, ease: \"power2.in\" }, DUR - OUT - 0.05);\n        }\n        tl.set(root, { visibility: \"hidden\" }, DUR - 0.02);\n\n        window.__timelines[\"yt-logo-intro\"] = tl;\n      })();\n    </script>\n  </body>\n</html>\n"}