Skip to content

Write HTML. Render video. Built for agents.

7.5 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      #mk-bg-root {\n        /* ---- mk tokens: override these in the host to re-skin the family ---- */\n        --mk-font: \"Inter\", -apple-system, sans-serif;\n        --mk-stage: #f5f5f7;\n        --mk-base: #ffffff;\n        --mk-blob-1: #ff7ac8;\n        --mk-blob-2: #45d6c8;\n        --mk-stage-dark: #000000;\n        --mk-base-dark: #0a0a0c;\n        --mk-blob-1-dark: #7d5cff;\n        --mk-blob-2-dark: #2d1b69;\n        --mk-radius-card: 40px;\n        --mk-shadow: 0 30px 80px rgba(0, 0, 0, 0.18);\n\n        position: relative;\n        width: 1920px;\n        height: 1080px;\n        overflow: hidden;\n        background: var(--mk-stage);\n      }\n      #mk-bg-root.mk-dark {\n        background: var(--mk-stage-dark);\n      }\n      /* The \"Bar\" — an animatable rounded-rect mask. Full-bleed by default,\n         animatable down to a floating card over the stage. */\n      #mk-bg-card {\n        position: absolute;\n        top: 0;\n        left: 0;\n        width: 1920px;\n        height: 1080px;\n        overflow: hidden;\n        border-radius: 0;\n        background: var(--mk-base);\n        box-shadow: var(--mk-shadow);\n      }\n      .mk-dark #mk-bg-card {\n        background: var(--mk-base-dark);\n      }\n      /* Soft radial blobs — the procedural \"mesh gradient\". Two oversized\n         radial gradients with a long falloff, drifting slowly. */\n      .mk-bg-blob {\n        position: absolute;\n        border-radius: 50%;\n        will-change: transform;\n      }\n      #mk-bg-blob1 {\n        background: radial-gradient(\n          circle closest-side,\n          var(--mk-blob-1) 0%,\n          rgba(255, 255, 255, 0) 72%\n        );\n      }\n      #mk-bg-blob2 {\n        background: radial-gradient(\n          circle closest-side,\n          var(--mk-blob-2) 0%,\n          rgba(255, 255, 255, 0) 72%\n        );\n      }\n      .mk-dark #mk-bg-blob1 {\n        background: radial-gradient(\n          circle closest-side,\n          var(--mk-blob-1-dark) 0%,\n          rgba(0, 0, 0, 0) 72%\n        );\n      }\n      .mk-dark #mk-bg-blob2 {\n        background: radial-gradient(\n          circle closest-side,\n          var(--mk-blob-2-dark) 0%,\n          rgba(0, 0, 0, 0) 72%\n        );\n      }\n    </style>\n  </head>\n  <body>\n    <div\n      id=\"mk-bg-root\"\n      data-composition-id=\"mk-background\"\n      data-start=\"0\"\n      data-duration=\"10\"\n      data-width=\"1920\"\n      data-height=\"1080\"\n    >\n      <div id=\"mk-bg-card\">\n        <div id=\"mk-bg-blob1\" class=\"mk-bg-blob\" data-layout-allow-overflow></div>\n        <div id=\"mk-bg-blob2\" class=\"mk-bg-blob\" data-layout-allow-overflow></div>\n      </div>\n      <div\n        id=\"mk-bg-drv\"\n        class=\"clip\"\n        data-start=\"0\"\n        data-duration=\"10\"\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 (inspector-style CONFIG) ---- */\n        var CONFIG = {\n          scheme: \"light\", // \"light\" | \"dark\"\n          animationIn: true, // fade/settle entrance\n          animationOut: true, // fade exit\n          drift: true, // ambient blob motion\n          // Soft BG blobs: center as fraction of canvas, radius in px\n          blob1: { x: 0.28, y: 0.32, r: 950, opacity: 0.85 },\n          blob2: { x: 0.74, y: 0.66, r: 1100, opacity: 0.8 },\n          // Bar mask (rounded-rect card). demo:true plays full-bleed -> card -> full-bleed\n          bar: {\n            demo: true, // full-bleed -> rounded card -> full-bleed showcase\n            x: 240,\n            y: 140,\n            width: 1440,\n            height: 800,\n            roundness: 40,\n          },\n          // Content opacity + frost only matter with footage beneath the block\n          contentOpacity: 1,\n          frostBlur: 0, // px; e.g. 24 for the frosted-card look over footage\n        };\n\n        var W = 1920,\n          H = 1080,\n          DUR = 10;\n\n        var root = document.getElementById(\"mk-bg-root\");\n        var card = document.getElementById(\"mk-bg-card\");\n        var blob1 = document.getElementById(\"mk-bg-blob1\");\n        var blob2 = document.getElementById(\"mk-bg-blob2\");\n\n        if (CONFIG.scheme === \"dark\") root.classList.add(\"mk-dark\");\n\n        function placeBlob(el, b) {\n          var d = b.r * 2;\n          el.style.width = d + \"px\";\n          el.style.height = d + \"px\";\n          el.style.left = b.x * W - b.r + \"px\";\n          el.style.top = b.y * H - b.r + \"px\";\n          el.style.opacity = String(b.opacity);\n        }\n        placeBlob(blob1, CONFIG.blob1);\n        placeBlob(blob2, CONFIG.blob2);\n\n        card.style.opacity = String(CONFIG.contentOpacity);\n        if (CONFIG.frostBlur > 0) {\n          card.style.backdropFilter = \"blur(\" + CONFIG.frostBlur + \"px) saturate(1.4)\";\n        }\n\n        var tl = gsap.timeline({ paused: true });\n\n        /* entrance — fade + blobs settle (power3, no bounce) */\n        if (CONFIG.animationIn) {\n          tl.from(root, { opacity: 0, duration: 0.7, ease: \"power2.out\" }, 0);\n          tl.from([blob1, blob2], { scale: 1.14, duration: 1.2, ease: \"power3.out\" }, 0);\n        }\n\n        /* ambient drift — slow sine yoyo, seek-safe timeline tweens */\n        if (CONFIG.drift) {\n          tl.to(\n            blob1,\n            { x: 70, y: 42, duration: 2.35, ease: \"sine.inOut\", yoyo: true, repeat: 3 },\n            0.3,\n          );\n          tl.to(\n            blob2,\n            { x: -84, y: -36, duration: 2.35, ease: \"sine.inOut\", yoyo: true, repeat: 3 },\n            0.3,\n          );\n        }\n\n        /* bar-mask demo: full-bleed -> rounded card over the stage -> full-bleed.\n           Offset via x/y transforms, not top/left: layout properties snap to\n           integer device pixels and stutter under seek-by-frame capture. The\n           card's CSS base is top:0/left:0, so the transform values match 1:1. */\n        if (CONFIG.bar.demo) {\n          tl.to(\n            card,\n            {\n              y: CONFIG.bar.y,\n              x: CONFIG.bar.x,\n              width: CONFIG.bar.width,\n              height: CONFIG.bar.height,\n              borderRadius: CONFIG.bar.roundness,\n              duration: 1.1,\n              ease: \"power3.inOut\",\n            },\n            3.8,\n          );\n          tl.to(\n            card,\n            {\n              y: 0,\n              x: 0,\n              width: W,\n              height: H,\n              borderRadius: 0,\n              duration: 1.0,\n              ease: \"power3.inOut\",\n            },\n            7.6,\n          );\n        }\n\n        /* exit + hard kill */\n        if (CONFIG.animationOut) {\n          tl.to(root, { opacity: 0, duration: 0.4, ease: \"power2.in\" }, DUR - 0.45);\n        }\n        tl.set(root, { visibility: \"hidden\" }, DUR - 0.02);\n\n        window.__timelines[\"mk-background\"] = tl;\n      })();\n    </script>\n  </body>\n</html>\n"}