Skip to content

Write HTML. Render video. Built for agents.

6.7 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>Tracking In - 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      body {\n        font-family: Inter, system-ui, sans-serif;\n        background: #fafafa;\n      }\n      #demo {\n        position: relative;\n        width: 1920px;\n        height: 1080px;\n        display: grid;\n        place-items: center;\n        background: linear-gradient(135deg, #fafafa, #f4f4f5);\n        color: #18181b;\n      }\n      .panel {\n        text-align: center;\n        width: 1260px;\n      }\n      .label {\n        font-size: 28px;\n        font-weight: 600;\n        color: #71717a;\n        text-transform: uppercase;\n        letter-spacing: 0.18em;\n      }\n      .headline {\n        margin-top: 28px;\n        font-size: 118px;\n        line-height: 1;\n        font-weight: 900;\n      }\n      .hf-tracking-in {\n        opacity: 0;\n        letter-spacing: var(--hf-tracking-value, 0.28em);\n        transform: translateY(8px);\n        will-change: opacity, letter-spacing, transform;\n      }\n    </style>\n  </head>\n  <body>\n    <div\n      id=\"demo\"\n      data-composition-id=\"tracking-in-demo\"\n      data-width=\"1920\"\n      data-height=\"1080\"\n      data-duration=\"4\"\n      data-composition-variables='[\n    { \"id\": \"tracking\", \"type\": \"enum\", \"role\": \"style\", \"label\": \"Tracking\", \"description\": \"Multiplies the letter-spacing the timeline drives, so the reveal starts and settles proportionally wider or tighter.\", \"default\": \"standard\", \"options\": [{ \"value\": \"tight\", \"label\": \"Tight\" }, { \"value\": \"standard\", \"label\": \"Standard\" }, { \"value\": \"wide\", \"label\": \"Wide\" }] },\n    { \"id\": \"rise\", \"type\": \"enum\", \"role\": \"motion\", \"label\": \"Rise\", \"description\": \"Vertical offset the text starts from, which the timeline reads as the start of its travel and eases to zero.\", \"default\": \"standard\", \"options\": [{ \"value\": \"subtle\", \"label\": \"Subtle\" }, { \"value\": \"standard\", \"label\": \"Standard\" }, { \"value\": \"bold\", \"label\": \"Bold\" }] },\n    { \"id\": \"tone\", \"type\": \"enum\", \"role\": \"style\", \"label\": \"Tone\", \"description\": \"Text colour: inherit keeps the surrounding page colour, ink suits light frames, paper dark ones, accent rides --brand.\", \"default\": \"inherit\", \"options\": [{ \"value\": \"inherit\", \"label\": \"Inherit\" }, { \"value\": \"ink\", \"label\": \"Ink\" }, { \"value\": \"paper\", \"label\": \"Paper\" }, { \"value\": \"accent\", \"label\": \"Accent\" }] }\n  ]'\n    >\n      <div class=\"panel\">\n        <div class=\"label hf-tracking-in\">Editorial motion</div>\n        <div class=\"headline hf-tracking-in\">TRACKING IN</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          var reaches = { tight: 0.6, standard: 1, wide: 1.8 };\n          var rises = { subtle: \"4px\", standard: \"8px\", bold: \"18px\" };\n          var tones = {\n            inherit: \"inherit\",\n            ink: \"#18181b\",\n            paper: \"#fafafa\",\n            accent: \"var(--brand, #34d399)\",\n          };\n\n          function pick(table, value, fallback) {\n            return Object.prototype.hasOwnProperty.call(table, value) ? value : fallback;\n          }\n\n          var reach = reaches[pick(reaches, vars.tracking, \"standard\")];\n          var rise = rises[pick(rises, vars.rise, \"standard\")];\n          var tone = tones[pick(tones, vars.tone, \"inherit\")];\n\n          // The class is applied to arbitrary host elements, so the resolved values\n          // ride the document root and inherit down to every one of them.\n          var host = document.documentElement;\n          host.style.setProperty(\"--hf-tracking-reach\", String(reach));\n          host.style.setProperty(\"--hf-tracking-y\", rise);\n          host.style.setProperty(\"--hf-tracking-color\", tone);\n        })();\n      </script>\n      <script>\n        const tl = gsap.timeline({ paused: true });\n        tl.to(\n          \".hf-tracking-in\",\n          {\n            opacity: 1,\n            \"--hf-tracking-value\": \"0.02em\",\n            y: 0,\n            duration: 0.9,\n            ease: \"power3.out\",\n            stagger: 0.16,\n          },\n          0.45,\n        );\n        window.__timelines = window.__timelines || {};\n        window.__timelines[\"tracking-in-demo\"] = tl;\n      </script>\n    </div>\n    <style\n      data-composition-variables='[\n    { \"id\": \"tracking\", \"type\": \"enum\", \"role\": \"style\", \"label\": \"Tracking\", \"description\": \"Multiplies the letter-spacing the timeline drives, so the reveal starts and settles proportionally wider or tighter.\", \"default\": \"standard\", \"options\": [{ \"value\": \"tight\", \"label\": \"Tight\" }, { \"value\": \"standard\", \"label\": \"Standard\" }, { \"value\": \"wide\", \"label\": \"Wide\" }] },\n    { \"id\": \"rise\", \"type\": \"enum\", \"role\": \"motion\", \"label\": \"Rise\", \"description\": \"Vertical offset the text starts from, which the timeline reads as the start of its travel and eases to zero.\", \"default\": \"standard\", \"options\": [{ \"value\": \"subtle\", \"label\": \"Subtle\" }, { \"value\": \"standard\", \"label\": \"Standard\" }, { \"value\": \"bold\", \"label\": \"Bold\" }] },\n    { \"id\": \"tone\", \"type\": \"enum\", \"role\": \"style\", \"label\": \"Tone\", \"description\": \"Text colour: inherit keeps the surrounding page colour, ink suits light frames, paper dark ones, accent rides --brand.\", \"default\": \"inherit\", \"options\": [{ \"value\": \"inherit\", \"label\": \"Inherit\" }, { \"value\": \"ink\", \"label\": \"Ink\" }, { \"value\": \"paper\", \"label\": \"Paper\" }, { \"value\": \"accent\", \"label\": \"Accent\" }] }\n  ]'\n    >\n      .hf-tracking-in {\n        opacity: 0;\n        color: var(--hf-tracking-color, inherit);\n        letter-spacing: calc(var(--hf-tracking-value, 0.28em) * var(--hf-tracking-reach, 1));\n        transform: translateY(var(--hf-tracking-y, 8px));\n        will-change: opacity, letter-spacing, transform;\n      }\n    </style>\n  </body>\n</html>\n"}