Skip to content

Write HTML. Render video. Built for agents.

6.5 KB
Raw Blame
{"html":"<!doctype html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"UTF-8\" />\n    <meta name=\"viewport\" content=\"width=1920, height=1080\" />\n    <title>Line-by-Line Slide - Demo</title>\n    <script src=\"https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js\"></script>\n    <style>\n      * {\n        box-sizing: border-box;\n      }\n      html,\n      body {\n        margin: 0;\n        width: 1920px;\n        height: 1080px;\n        overflow: hidden;\n      }\n      #demo {\n        width: 1920px;\n        height: 1080px;\n        display: grid;\n        place-items: center;\n        background: #f7f7f8;\n        font-family: Inter, system-ui, sans-serif;\n      }\n      .demo-frame {\n        display: grid;\n        place-items: center;\n        min-width: 900px;\n        min-height: 500px;\n        padding: 64px;\n        /* ponytail: scale wrapper — not a GSAP target, so CSS transform is safe */\n        transform: scale(2.8);\n        transform-origin: center center;\n      }\n      .hf-catalog-line-by-line-slide {\n        color: #18181b;\n        font-family: Inter, system-ui, sans-serif;\n        font-weight: 900;\n        letter-spacing: -0.04em;\n      }\n      .hf-catalog-line-by-line-slide {\n        display: grid;\n        gap: 10px;\n        font-size: 64px;\n        line-height: 1.05;\n        overflow: hidden;\n      }\n      .hf-catalog-line-by-line-slide span {\n        display: block;\n        transform: translate(var(--hf-line-x, 0px), var(--hf-line-y, 0px));\n        filter: blur(var(--hf-line-blur, 0px));\n        will-change: transform, filter, opacity;\n      }\n    </style>\n  </head>\n  <body>\n    <div\n      id=\"demo\"\n      data-composition-id=\"line-by-line-slide-demo\"\n      data-start=\"0\"\n      data-width=\"1920\"\n      data-height=\"1080\"\n      data-duration=\"5\"\n    >\n      <div class=\"demo-frame\">\n        <div\n          class=\"hf-catalog-line-by-line-slide\"\n          data-composition-variables='[\n    {\"id\": \"size\", \"type\": \"enum\", \"role\": \"layout\", \"label\": \"Size\", \"description\": \"Type size of the whole stack.\", \"default\": \"standard\", \"options\": [{\"value\": \"compact\", \"label\": \"Compact\"}, {\"value\": \"standard\", \"label\": \"Standard\"}, {\"value\": \"display\", \"label\": \"Display\"}]},\n    {\"id\": \"tone\", \"type\": \"enum\", \"role\": \"style\", \"label\": \"Tone\", \"description\": \"Line colour: ink for light frames, paper for dark ones, accent rides the brand token.\", \"default\": \"ink\", \"options\": [{\"value\": \"ink\", \"label\": \"Ink\"}, {\"value\": \"paper\", \"label\": \"Paper\"}, {\"value\": \"accent\", \"label\": \"Accent\"}]},\n    {\"id\": \"density\", \"type\": \"enum\", \"role\": \"layout\", \"label\": \"Density\", \"description\": \"The gap between lines, from a tight block to an airy stack.\", \"default\": \"standard\", \"options\": [{\"value\": \"fine\", \"label\": \"Fine\"}, {\"value\": \"standard\", \"label\": \"Standard\"}, {\"value\": \"coarse\", \"label\": \"Coarse\"}]},\n    {\"id\": \"direction\", \"type\": \"enum\", \"role\": \"motion\", \"label\": \"Direction\", \"description\": \"Which side the lines slide in from as the timeline drives the offset.\", \"default\": \"left\", \"options\": [{\"value\": \"left\", \"label\": \"Left\"}, {\"value\": \"right\", \"label\": \"Right\"}]}\n  ]'\n        >\n          <span>Design faster</span><span>Render cleaner</span><span>Ship louder</span>\n        </div>\n      </div>\n      <script>\n        (function () {\n          \"use strict\";\n\n          var vars =\n            window.__hyperframes && window.__hyperframes.getVariables\n              ? window.__hyperframes.getVariables()\n              : {};\n\n          // Unrecognised overrides return to their declared defaults.\n          function pick(table, value, fallback) {\n            return Object.prototype.hasOwnProperty.call(table, value) ? value : fallback;\n          }\n\n          var sizes = { compact: \"40px\", standard: \"52px\", display: \"68px\" };\n          var tones = {\n            ink: \"#18181b\",\n            paper: \"#fafafa\",\n            accent: \"var(--brand, #34d399)\",\n          };\n          var gaps = { fine: \"4px\", standard: \"10px\", coarse: \"20px\" };\n          var axes = { left: 1, right: -1 };\n\n          var size = sizes[pick(sizes, vars.size, \"standard\")];\n          var tone = tones[pick(tones, vars.tone, \"ink\")];\n          var gap = gaps[pick(gaps, vars.density, \"standard\")];\n          var axis = axes[pick(axes, vars.direction, \"left\")];\n\n          var roots = document.querySelectorAll(\".hf-catalog-line-by-line-slide\");\n          for (var i = 0; i < roots.length; i += 1) {\n            var root = roots[i];\n            root.style.setProperty(\"--hf-line-size\", size);\n            root.style.setProperty(\"--hf-line-color\", tone);\n            root.style.setProperty(\"--hf-line-gap\", gap);\n            root.style.setProperty(\"--hf-line-axis-x\", String(axis));\n          }\n        })();\n      </script>\n      <script>\n        const tl = gsap.timeline({ paused: true });\n        const startTime = 0.5;\n        tl.fromTo(\n          \".hf-catalog-line-by-line-slide span\",\n          { opacity: 0, \"--hf-line-x\": \"-36px\", \"--hf-line-y\": \"18px\", \"--hf-line-blur\": \"6px\" },\n          {\n            opacity: 1,\n            \"--hf-line-x\": \"0px\",\n            \"--hf-line-y\": \"0px\",\n            \"--hf-line-blur\": \"0px\",\n            duration: 0.34,\n            stagger: 0.08,\n            ease: \"power3.out\",\n          },\n          startTime,\n        );\n        tl.set({}, {}, 5);\n        window.__timelines = window.__timelines || {};\n        window.__timelines[\"line-by-line-slide-demo\"] = tl;\n      </script>\n    </div>\n    <style>\n      .hf-catalog-line-by-line-slide {\n        color: var(--hf-line-color, #18181b);\n        font-family: Inter, system-ui, sans-serif;\n        font-weight: 900;\n        letter-spacing: -0.04em;\n      }\n      .hf-catalog-line-by-line-slide {\n        display: grid;\n        gap: var(--hf-line-gap, 10px);\n        font-size: var(--hf-line-size, 52px);\n        line-height: 1;\n        overflow: hidden;\n      }\n      .hf-catalog-line-by-line-slide span {\n        display: block;\n        transform: translate(\n          calc(var(--hf-line-x, 0px) * var(--hf-line-axis-x, 1)),\n          var(--hf-line-y, 0px)\n        );\n        filter: blur(var(--hf-line-blur, 0px));\n        will-change: transform, filter, opacity;\n      }\n    </style>\n  </body>\n</html>\n"}