Skip to content

Write HTML. Render video. Built for agents.

7.3 KB
Raw Blame
{"html":"<!doctype html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"UTF-8\" />\n    <meta name=\"viewport\" content=\"width=1920\" />\n    <title>3D Transitions</title>\n    <script src=\"https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js\"></script>\n    <style>\n      * {\n        margin: 0;\n        padding: 0;\n        box-sizing: border-box;\n      }\n      body {\n        background: #000;\n        overflow: hidden;\n        font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Helvetica, Arial, sans-serif;\n      }\n\n      .scene {\n        position: absolute;\n        top: 0;\n        left: 0;\n        width: 1920px;\n        height: 1080px;\n        overflow: hidden;\n        transform-style: preserve-3d;\n      }\n\n      .scene-inner {\n        width: 100%;\n        height: 100%;\n        display: flex;\n        align-items: center;\n        justify-content: center;\n        flex-direction: column;\n        backface-visibility: hidden;\n      }\n\n      #scene1 {\n        z-index: 1;\n      }\n      #scene2 {\n        z-index: 2;\n        opacity: 0;\n      }\n\n      #s1 {\n        background: #1b263b;\n      }\n      #s2 {\n        background: #e07a5f;\n      }\n\n      .big-text {\n        font-size: 200px;\n        font-weight: 900;\n        line-height: 1;\n        user-select: none;\n        pointer-events: none;\n      }\n      #s1 .big-text {\n        color: rgba(255, 255, 255, 0.08);\n      }\n      #s2 .big-text {\n        color: rgba(255, 255, 255, 0.15);\n      }\n\n      .label {\n        font-size: 32px;\n        font-weight: 600;\n        letter-spacing: 6px;\n        text-transform: uppercase;\n        margin-top: 12px;\n      }\n      #s1 .label {\n        color: #778da9;\n      }\n      #s2 .label {\n        color: #fff;\n      }\n\n      #info-bar {\n        position: absolute;\n        bottom: 0;\n        left: 0;\n        width: 1920px;\n        height: 80px;\n        background: rgba(0, 0, 0, 0.88);\n        z-index: 100;\n        display: flex;\n        align-items: center;\n        justify-content: center;\n        opacity: 0;\n      }\n      #info-bar span {\n        color: #fff;\n        font-size: 22px;\n        font-weight: 500;\n        letter-spacing: 2px;\n      }\n\n      #title-card {\n        position: absolute;\n        top: 0;\n        left: 0;\n        width: 1920px;\n        height: 1080px;\n        background: #0d1b2a;\n        z-index: 200;\n        display: flex;\n        align-items: center;\n        justify-content: center;\n        flex-direction: column;\n        opacity: 0;\n      }\n      #title-card .category {\n        font-size: 64px;\n        font-weight: 800;\n        color: #fff;\n        letter-spacing: 8px;\n        text-transform: uppercase;\n      }\n      #title-card .subtitle {\n        font-size: 24px;\n        font-weight: 400;\n        color: #778da9;\n        margin-top: 16px;\n        letter-spacing: 4px;\n      }\n\n      #outro-card {\n        position: absolute;\n        top: 0;\n        left: 0;\n        width: 1920px;\n        height: 1080px;\n        background: #0d1b2a;\n        z-index: 200;\n        display: flex;\n        align-items: center;\n        justify-content: center;\n        flex-direction: column;\n        opacity: 0;\n      }\n      #outro-card .category {\n        font-size: 48px;\n        font-weight: 700;\n        color: #778da9;\n        letter-spacing: 6px;\n        text-transform: uppercase;\n      }\n\n      /* 3D perspective wrapper */\n      #composition {\n        perspective: 1200px;\n      }\n    </style>\n  </head>\n  <body>\n    <div\n      id=\"composition\"\n      data-composition-id=\"main\"\n      data-start=\"0\"\n      data-duration=\"11\"\n      data-width=\"1920\"\n      data-height=\"1080\"\n    >\n      <div id=\"title-card\">\n        <div class=\"category\">3D Transitions</div>\n        <div class=\"subtitle\">1 Transition</div>\n      </div>\n\n      <div id=\"scene1\" class=\"scene\">\n        <div id=\"s1\" class=\"scene-inner\">\n          <div class=\"big-text\">ONE</div>\n          <div class=\"label\">Scene A</div>\n        </div>\n      </div>\n\n      <div id=\"scene2\" class=\"scene\">\n        <div id=\"s2\" class=\"scene-inner\">\n          <div class=\"big-text\">TWO</div>\n          <div class=\"label\">Scene B</div>\n        </div>\n      </div>\n\n      <div id=\"info-bar\"><span id=\"info-text\">Transition Name</span></div>\n\n      <div id=\"outro-card\">\n        <div class=\"category\">End of 3D Transitions</div>\n      </div>\n    </div>\n\n    <script>\n      window.__timelines = window.__timelines || {};\n\n      (function () {\n        var tl = gsap.timeline({ paused: true });\n        var t = 0;\n\n        function resetScenes() {\n          tl.set(\n            \"#scene1\",\n            {\n              opacity: 1,\n              x: 0,\n              y: 0,\n              scale: 1,\n              scaleX: 1,\n              rotation: 0,\n              rotationY: 0,\n              filter: \"none\",\n              clipPath: \"none\",\n              zIndex: 1,\n              skewX: 0,\n            },\n            t,\n          );\n          tl.set(\n            \"#scene2\",\n            {\n              opacity: 0,\n              x: 0,\n              y: 0,\n              scale: 1,\n              scaleX: 1,\n              rotation: 0,\n              rotationY: 0,\n              filter: \"none\",\n              clipPath: \"none\",\n              zIndex: 2,\n              skewX: 0,\n            },\n            t,\n          );\n          tl.set(\n            \"#s1\",\n            {\n              opacity: 1,\n              x: 0,\n              y: 0,\n              scale: 1,\n              rotation: 0,\n              rotationY: 0,\n              filter: \"none\",\n              skewX: 0,\n              clipPath: \"none\",\n            },\n            t,\n          );\n          tl.set(\n            \"#s2\",\n            {\n              opacity: 1,\n              x: 0,\n              y: 0,\n              scale: 1,\n              rotation: 0,\n              rotationY: 0,\n              filter: \"none\",\n              skewX: 0,\n              clipPath: \"none\",\n            },\n            t,\n          );\n        }\n\n        /* ── Title card (3s) ── */\n        tl.set(\"#title-card\", { opacity: 1 }, 0);\n        tl.to(\"#title-card\", { opacity: 0, duration: 0.5 }, 2.5);\n        t = 3;\n\n        /* ── Demo 1: 3D Card Flip ── */\n        resetScenes();\n        tl.set(\"#info-text\", { textContent: \"3D Card Flip\" }, t);\n        tl.to(\"#info-bar\", { opacity: 1, duration: 0.3 }, t);\n        t += 1.5;\n        var T = t;\n        tl.set(\"#scene2\", { opacity: 1 }, T);\n        tl.set(\"#s2\", { rotationY: -180 }, T);\n        tl.to(\"#s1\", { rotationY: 180, duration: 0.6, ease: \"power2.inOut\" }, T);\n        tl.to(\"#s2\", { rotationY: 0, duration: 0.6, ease: \"power2.inOut\" }, T);\n        tl.set(\"#scene1\", { opacity: 0 }, T + 0.65);\n        t = T + 1.5;\n        tl.to(\"#info-bar\", { opacity: 0, duration: 0.3 }, t);\n        t += 0.5;\n\n        /* ── Outro (3s) ── */\n        tl.set(\"#outro-card\", { opacity: 1 }, t);\n        tl.to(\"#outro-card\", { opacity: 0, duration: 0.5 }, t + 2.5);\n\n        window.__timelines[\"main\"] = tl;\n      })();\n    </script>\n  </body>\n</html>\n"}