mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-04 16:42:27 +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.3 KiB
JSON
1 line
3.3 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: 130px;\n bottom: 120px;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 14px;\n }\n #root .lt-name {\n font-family: \"Oswald\", sans-serif;\n font-size: 76px;\n font-weight: 700;\n color: #ffffff;\n line-height: 0.96;\n letter-spacing: 0.005em;\n text-transform: uppercase;\n white-space: nowrap;\n text-shadow: 0 2px 22px rgba(0, 0, 0, 0.45);\n }\n #root .lt-rule {\n height: 6px;\n width: 100%;\n background: #46e5b7;\n border-radius: 3px;\n transform-origin: 0% 50%;\n }\n #root .lt-role {\n font-family: \"Space Mono\", monospace;\n font-size: 28px;\n font-weight: 400;\n color: #e7eaf0;\n line-height: 1.2;\n letter-spacing: 0.04em;\n white-space: nowrap;\n text-shadow: 0 2px 16px rgba(0, 0, 0, 0.45);\n }\n </style>\n </head>\n <body>\n <div\n id=\"root\"\n data-composition-id=\"lt-accent-underline\"\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-name\" class=\"lt-name\">Dr. Maya Chen</div>\n <div id=\"lt-rule\" class=\"lt-rule\"></div>\n <div id=\"lt-role\" class=\"lt-role\">Host · Neuroscientist</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 nameEl = document.getElementById(\"lt-name\");\n var rule = document.getElementById(\"lt-rule\");\n var role = document.getElementById(\"lt-role\");\n\n // Name slides up, accent rule draws left→right, role fades up under it.\n gsap.set(nameEl, { y: 28, opacity: 0 });\n gsap.set(rule, { scaleX: 0 });\n gsap.set(role, { y: 16, opacity: 0 });\n\n tl.to(nameEl, { y: 0, opacity: 1, duration: 0.55, ease: \"power3.out\" }, 0.1);\n tl.to(rule, { scaleX: 1, duration: 0.5, ease: \"power4.out\" }, 0.3);\n tl.to(role, { y: 0, opacity: 1, duration: 0.5, ease: \"power3.out\" }, 0.46);\n\n // Exit: role fades, rule retracts, name lifts, then hard kill.\n tl.to(role, { opacity: 0, duration: 0.3, ease: \"power2.in\" }, 4.25);\n tl.to(rule, { scaleX: 0, duration: 0.3, ease: \"power2.in\" }, 4.3);\n tl.to(nameEl, { y: -16, opacity: 0, duration: 0.32, ease: \"power2.in\" }, 4.35);\n tl.set(wrap, { visibility: \"hidden\" }, 4.75);\n\n window.__timelines[\"lt-accent-underline\"] = tl;\n </script>\n </body>\n</html>\n"} |