mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-03 04:38:33 +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
4.0 KiB
JSON
1 line
4.0 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 font-family: \"Montserrat\", sans-serif;\n }\n\n #root .lt {\n position: absolute;\n left: 130px;\n bottom: 122px;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 14px;\n }\n #root .lt-namewrap {\n position: relative;\n overflow: hidden;\n padding: 2px 0;\n }\n #root .lt-name {\n font-size: 72px;\n font-weight: 900;\n color: #ffffff;\n line-height: 0.98;\n letter-spacing: -0.02em;\n white-space: nowrap;\n text-shadow: 0 2px 22px rgba(0, 0, 0, 0.45);\n will-change: clip-path;\n }\n #root .lt-sweep {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n width: 8px;\n background: #ffd23f;\n }\n #root .lt-role {\n font-size: 28px;\n font-weight: 500;\n color: #e7eaf0;\n line-height: 1.2;\n letter-spacing: 0.02em;\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-mask-reveal\"\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 class=\"lt-namewrap\">\n <div id=\"lt-name\" class=\"lt-name\">Dr. Maya Chen</div>\n <div id=\"lt-sweep\" class=\"lt-sweep\"></div>\n </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 sweep = document.getElementById(\"lt-sweep\");\n var role = document.getElementById(\"lt-role\");\n\n // An accent sweep crosses left→right; the name is revealed by a clip-path wipe behind it; role fades up.\n // Sweep travel: left:\"100%\" was parent-relative (offsetParent = .lt-namewrap). Since the sweep is\n // only 8px wide, xPercent would travel just 8px, so translate by the container width in pixels instead.\n // The .lt-namewrap shrink-wraps the name \"Dr. Maya Chen\" to 536px (no horizontal padding/border, so\n // clientWidth == content width), which is exactly what left:\"100%\" resolved to.\n var SWEEP_TRAVEL = 536;\n gsap.set(nameEl, { clipPath: \"inset(0 100% 0 0)\" });\n gsap.set(sweep, { x: 0, opacity: 0 });\n gsap.set(role, { y: 14, opacity: 0 });\n\n tl.to(sweep, { opacity: 1, duration: 0.12, ease: \"none\" }, 0.1);\n tl.to(sweep, { x: SWEEP_TRAVEL, duration: 0.55, ease: \"power2.inOut\" }, 0.12);\n tl.to(nameEl, { clipPath: \"inset(0 0% 0 0)\", duration: 0.5, ease: \"power2.inOut\" }, 0.16);\n tl.to(sweep, { opacity: 0, duration: 0.15, ease: \"none\" }, 0.6);\n tl.to(role, { y: 0, opacity: 1, duration: 0.5, ease: \"power3.out\" }, 0.55);\n\n // Exit: name un-wipes, role fades, hard kill.\n tl.to(role, { opacity: 0, duration: 0.3, ease: \"power2.in\" }, 4.25);\n tl.to(nameEl, { clipPath: \"inset(0 0 0 100%)\", duration: 0.4, ease: \"power2.in\" }, 4.3);\n tl.set(wrap, { visibility: \"hidden\" }, 4.75);\n\n window.__timelines[\"lt-mask-reveal\"] = tl;\n </script>\n </body>\n</html>\n"} |