mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-01 19:42:03 +00:00
* feat(catalog): play the real composition on catalog pages Catalog previews were uploaded MP4s, published by hand to the CDN. Each page now embeds the composition itself, running in <hyperframes-player>, so a preview is the block rather than a recording of it. The composition is delivered as JSON under docs/public/catalog, and the player is mounted inside an iframe. Both are forced: the docs host publishes only JSON and images out of docs/public, and its MDX renderer strips unknown custom elements, so a player written into the page never reaches the DOM and an .html payload 404s in production. Assets are inlined as data URIs, which sidesteps the file-type restriction for fonts, scripts and models alike. 164 of 168 items build a payload; the rest keep their MP4 and say so. * chore: rebuild docs preview * chore: route isolation probe * chore: drop the route isolation probe page * chore: probe which asset types the docs host publishes * refactor(catalog): host preview assets instead of inlining them Fonts were being base64'd into every payload that used them, so a handful of files cost tens of megabytes in the repository to say the same thing over and over. Assets are now written once, content-addressed, under docs/public/catalog/assets and linked. Which types can be hosted was settled by fetching one file of each from a deployed preview: woff2, wav, mp4, svg and the image formats are published, glb is not. Types the host drops still travel inside the payload, because a link that 404s is worse than a larger payload. Also fixes the four type errors the scripts typecheck caught, all of them unchecked index access on a split() result. * refactor(catalog): share preview assets instead of repeating them * style: format the asset module
1 line
3.2 KiB
JSON
1 line
3.2 KiB
JSON
{"html":"<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <script src=\"https://cdn.jsdelivr.net/npm/gsap@3.14.2/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: transparent;\n overflow: hidden;\n }\n body {\n width: 1920px;\n height: 1080px;\n }\n\n #root .lt {\n position: absolute;\n left: 120px;\n bottom: 116px;\n }\n #root .lt-block {\n background: #141518;\n padding: 18px 34px 22px 30px;\n display: inline-flex;\n flex-direction: column;\n gap: 12px;\n will-change: clip-path;\n }\n #root .lt-name {\n font-family: \"Archivo Black\", sans-serif;\n font-size: 58px;\n font-weight: 400;\n color: #ffffff;\n line-height: 0.98;\n letter-spacing: -0.015em;\n text-transform: uppercase;\n white-space: nowrap;\n }\n #root .lt-tagwrap {\n overflow: hidden;\n }\n #root .lt-tag {\n display: inline-block;\n background: #ffd23f;\n color: #141518;\n font-family: \"Space Mono\", monospace;\n font-size: 24px;\n font-weight: 700;\n letter-spacing: 0.06em;\n text-transform: uppercase;\n padding: 7px 16px;\n white-space: nowrap;\n }\n </style>\n </head>\n <body>\n <div\n id=\"root\"\n data-composition-id=\"lt-bold-block\"\n data-width=\"1920\"\n data-height=\"1080\"\n data-start=\"0\"\n data-duration=\"4.8\"\n >\n <div id=\"lt-clip\" class=\"clip\" data-start=\"0\" data-duration=\"4.8\" data-track-index=\"0\">\n <div id=\"lt\" class=\"lt\">\n <div id=\"lt-block\" class=\"lt-block\">\n <div id=\"lt-name\" class=\"lt-name\">Maya Chen</div>\n <div class=\"lt-tagwrap\">\n <span id=\"lt-tag\" class=\"lt-tag\">Host · Neuroscientist</span>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <script>\n window.__timelines = window.__timelines || {};\n var tl = gsap.timeline({ paused: true });\n\n var wrap = document.getElementById(\"lt\");\n var block = document.getElementById(\"lt-block\");\n var nameEl = document.getElementById(\"lt-name\");\n var tag = document.getElementById(\"lt-tag\");\n\n // Solid block wipes in from the left, name slams up inside it, tag pops up after.\n gsap.set(block, { clipPath: \"inset(0 100% 0 0)\" });\n gsap.set(nameEl, { y: 30, opacity: 0 });\n gsap.set(tag, { y: 40 });\n\n tl.to(block, { clipPath: \"inset(0 0% 0 0)\", duration: 0.5, ease: \"power4.out\" }, 0.1);\n tl.to(nameEl, { y: 0, opacity: 1, duration: 0.42, ease: \"back.out(1.6)\" }, 0.26);\n tl.to(tag, { y: 0, duration: 0.45, ease: \"back.out(2)\" }, 0.5);\n\n // Exit: block wipes out to the left, then hard kill.\n tl.to(block, { clipPath: \"inset(0 0 0 100%)\", duration: 0.4, ease: \"power3.in\" }, 4.3);\n tl.set(wrap, { visibility: \"hidden\" }, 4.75);\n\n window.__timelines[\"lt-bold-block\"] = tl;\n </script>\n </body>\n</html>\n"} |