Skip to content

Write HTML. Render video. Built for agents.

9.2 KB
Raw Blame
{"html":"<!doctype html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"UTF-8\" />\n    <link rel=\"preconnect\" href=\"https://fonts.googleapis.com\" />\n    <link rel=\"preconnect\" href=\"https://fonts.gstatic.com\" crossorigin />\n    <link\n      href=\"https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;700&display=block\"\n      rel=\"stylesheet\"\n    />\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      html,\n      body {\n        background: #1a1a2e;\n        overflow: hidden;\n      }\n      body {\n        width: 1920px;\n        height: 1080px;\n        font-family: \"DM Sans\", sans-serif;\n      }\n\n      [data-composition-id=\"reddit-post\"] .reddit-card {\n        position: absolute;\n        top: 50%;\n        left: 50%;\n        transform: translate(-50%, -50%);\n        width: 860px;\n        background: #1a1a2e;\n        border-radius: 16px;\n        padding: 32px;\n        box-shadow: 0 12px 60px rgba(0, 0, 0, 0.6);\n      }\n\n      /* Header */\n      [data-composition-id=\"reddit-post\"] .post-header {\n        display: flex;\n        align-items: center;\n        gap: 14px;\n        margin-bottom: 24px;\n      }\n\n      [data-composition-id=\"reddit-post\"] .subreddit-icon {\n        width: 48px;\n        height: 48px;\n        flex-shrink: 0;\n      }\n\n      [data-composition-id=\"reddit-post\"] .subreddit-icon svg {\n        width: 48px;\n        height: 48px;\n        display: block;\n      }\n\n      [data-composition-id=\"reddit-post\"] .post-meta {\n        display: flex;\n        flex-direction: column;\n        gap: 2px;\n      }\n\n      [data-composition-id=\"reddit-post\"] .subreddit-name {\n        font-size: 28px;\n        font-weight: 700;\n        color: #d7dadc;\n        line-height: 1.3;\n      }\n\n      [data-composition-id=\"reddit-post\"] .post-author {\n        font-size: 24px;\n        font-weight: 400;\n        color: #818384;\n        line-height: 1.3;\n      }\n\n      /* Content */\n      [data-composition-id=\"reddit-post\"] .post-title {\n        font-size: 38px;\n        font-weight: 700;\n        color: #d7dadc;\n        line-height: 1.35;\n        margin-bottom: 16px;\n        display: -webkit-box;\n        -webkit-line-clamp: 3;\n        -webkit-box-orient: vertical;\n        overflow: hidden;\n      }\n\n      [data-composition-id=\"reddit-post\"] .post-body {\n        font-size: 28px;\n        font-weight: 400;\n        color: #818384;\n        line-height: 1.45;\n        margin-bottom: 28px;\n        display: -webkit-box;\n        -webkit-line-clamp: 3;\n        -webkit-box-orient: vertical;\n        overflow: hidden;\n      }\n\n      /* Action bar */\n      [data-composition-id=\"reddit-post\"] .action-bar {\n        display: flex;\n        align-items: center;\n        gap: 28px;\n        padding-top: 20px;\n        border-top: 1px solid #343536;\n      }\n\n      [data-composition-id=\"reddit-post\"] .vote-group {\n        display: flex;\n        align-items: center;\n        gap: 10px;\n        background: #272729;\n        border-radius: 24px;\n        padding: 8px 16px;\n      }\n\n      [data-composition-id=\"reddit-post\"] .vote-btn {\n        width: 32px;\n        height: 32px;\n        display: flex;\n        align-items: center;\n        justify-content: center;\n        cursor: pointer;\n      }\n\n      [data-composition-id=\"reddit-post\"] .vote-btn svg {\n        width: 28px;\n        height: 28px;\n        display: block;\n      }\n\n      [data-composition-id=\"reddit-post\"] .vote-count {\n        font-size: 26px;\n        font-weight: 700;\n        color: #d7dadc;\n        min-width: 50px;\n        text-align: center;\n      }\n\n      [data-composition-id=\"reddit-post\"] .action-btn {\n        display: flex;\n        align-items: center;\n        gap: 8px;\n        background: #272729;\n        border-radius: 24px;\n        padding: 10px 20px;\n      }\n\n      [data-composition-id=\"reddit-post\"] .action-btn svg {\n        width: 26px;\n        height: 26px;\n        display: block;\n      }\n\n      [data-composition-id=\"reddit-post\"] .action-btn span {\n        font-size: 24px;\n        font-weight: 400;\n        color: #818384;\n      }\n    </style>\n  </head>\n  <body>\n    <div\n      id=\"root\"\n      data-composition-id=\"reddit-post\"\n      data-width=\"1920\"\n      data-height=\"1080\"\n      data-start=\"0\"\n      data-duration=\"5\"\n    >\n      <div id=\"card\" class=\"clip reddit-card\" data-start=\"0\" data-duration=\"5\" data-track-index=\"0\">\n        <!-- Header -->\n        <div class=\"post-header\">\n          <div class=\"subreddit-icon\">\n            <svg viewBox=\"0 0 48 48\" fill=\"none\">\n              <circle cx=\"24\" cy=\"24\" r=\"24\" fill=\"#4A90D9\" />\n              <text\n                x=\"24\"\n                y=\"30\"\n                text-anchor=\"middle\"\n                font-family=\"DM Sans, sans-serif\"\n                font-size=\"22\"\n                font-weight=\"700\"\n                fill=\"#fff\"\n              >\n                r/\n              </text>\n            </svg>\n          </div>\n          <div class=\"post-meta\">\n            <span class=\"subreddit-name\">r/hyperframes</span>\n            <span class=\"post-author\">u/placeholder_user &middot; 3h</span>\n          </div>\n        </div>\n\n        <!-- Content -->\n        <div class=\"post-title\">Prompt to change this title to whatever you want</div>\n        <div class=\"post-body\">\n          Prompt to change this body text, the subreddit, username, and vote count to match your\n          content.\n        </div>\n\n        <!-- Action bar -->\n        <div class=\"action-bar\">\n          <div class=\"vote-group\">\n            <div id=\"upvote-btn\" class=\"vote-btn\">\n              <svg viewBox=\"0 0 24 24\" fill=\"none\">\n                <path id=\"upvote-arrow\" d=\"M12 4L3 14h5v6h8v-6h5L12 4z\" fill=\"#818384\" />\n              </svg>\n            </div>\n            <span id=\"vote-count\" class=\"vote-count\">4.2k</span>\n            <div class=\"vote-btn\">\n              <svg viewBox=\"0 0 24 24\" fill=\"none\">\n                <path d=\"M12 20l9-10h-5V4H8v6H3l9 10z\" fill=\"#818384\" />\n              </svg>\n            </div>\n          </div>\n\n          <div class=\"action-btn\">\n            <svg\n              viewBox=\"0 0 24 24\"\n              fill=\"none\"\n              stroke=\"#818384\"\n              stroke-width=\"2\"\n              stroke-linecap=\"round\"\n              stroke-linejoin=\"round\"\n            >\n              <path d=\"M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z\" />\n            </svg>\n            <span>328</span>\n          </div>\n\n          <div class=\"action-btn\">\n            <svg\n              viewBox=\"0 0 24 24\"\n              fill=\"none\"\n              stroke=\"#818384\"\n              stroke-width=\"2\"\n              stroke-linecap=\"round\"\n              stroke-linejoin=\"round\"\n            >\n              <path d=\"M4 12v8a2 2 0 002 2h12a2 2 0 002-2v-8\" />\n              <polyline points=\"16 6 12 2 8 6\" />\n              <line x1=\"12\" y1=\"2\" x2=\"12\" y2=\"15\" />\n            </svg>\n            <span>Share</span>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <script>\n      window.__timelines = window.__timelines || {};\n\n      var tl = gsap.timeline({ paused: true });\n\n      var card = document.getElementById(\"card\");\n      var upvoteBtn = document.getElementById(\"upvote-btn\");\n      var upvoteArrow = document.getElementById(\"upvote-arrow\");\n      var voteCount = document.getElementById(\"vote-count\");\n\n      // Start off-screen below\n      gsap.set(card, { y: 400, opacity: 0 });\n\n      // Slide in from bottom\n      tl.to(\n        card,\n        {\n          y: 0,\n          opacity: 1,\n          duration: 0.6,\n          ease: \"power3.out\",\n        },\n        0.1,\n      );\n\n      // Upvote press-in\n      tl.to(\n        upvoteBtn,\n        {\n          scale: 0.85,\n          duration: 0.12,\n          ease: \"power2.out\",\n        },\n        1.5,\n      );\n\n      // Upvote release with spring bounce\n      tl.to(\n        upvoteBtn,\n        {\n          scale: 1,\n          duration: 0.4,\n          ease: \"elastic.out(1, 0.4)\",\n        },\n        1.62,\n      );\n\n      // Arrow turns orange\n      tl.to(\n        upvoteArrow,\n        {\n          attr: { fill: \"#ff4500\" },\n          duration: 0.12,\n          ease: \"none\",\n        },\n        1.62,\n      );\n\n      // Vote count turns orange + increments\n      tl.to(\n        voteCount,\n        {\n          color: \"#ff4500\",\n          duration: 0.12,\n          ease: \"none\",\n          onStart: function () {\n            voteCount.textContent = \"4.3k\";\n          },\n        },\n        1.62,\n      );\n\n      // Slide out to bottom\n      tl.to(\n        card,\n        {\n          y: 400,\n          opacity: 0,\n          duration: 0.3,\n          ease: \"power3.in\",\n        },\n        4.2,\n      );\n\n      window.__timelines[\"reddit-post\"] = tl;\n    </script>\n  </body>\n</html>\n"}