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
4.8 KiB
JSON
1 line
4.8 KiB
JSON
{"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>Shimmer Sweep — Demo</title>\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 margin: 0;\n width: 1920px;\n height: 1080px;\n overflow: hidden;\n }\n </style>\n </head>\n <body>\n <div\n id=\"demo\"\n data-composition-id=\"shimmer-sweep-demo\"\n data-width=\"1920\"\n data-height=\"1080\"\n data-duration=\"6\"\n >\n <div class=\"demo-canvas\">\n <!-- Example 1: Large heading -->\n <div class=\"shimmer-sweep-target\" style=\"--shimmer-color: rgba(255, 255, 255, 0.5)\">\n <div\n class=\"demo-heading\"\n style=\"font-size: 120px; font-weight: 800; color: #ffffff; opacity: 0\"\n >\n AI-Powered\n </div>\n </div>\n\n <!-- Example 2: Subheading -->\n <div class=\"shimmer-sweep-target\" style=\"--shimmer-color: rgba(100, 200, 255, 0.4)\">\n <div\n class=\"demo-subheading\"\n style=\"font-size: 48px; font-weight: 400; color: #888888; opacity: 0\"\n >\n Video generation, reimagined\n </div>\n </div>\n\n <!-- Example 3: Pill badge -->\n <div\n class=\"shimmer-sweep-target\"\n style=\"--shimmer-color: rgba(255, 255, 255, 0.3); --shimmer-width: 30%\"\n >\n <div\n class=\"demo-pill\"\n style=\"\n background: linear-gradient(135deg, #1a1a2e, #2a2a4e);\n border: 1px solid #333;\n border-radius: 100px;\n padding: 16px 40px;\n font-size: 20px;\n color: #aaa;\n opacity: 0;\n \"\n >\n Try it free →\n </div>\n </div>\n </div>\n\n <!-- Shimmer Sweep component -->\n <style>\n .demo-canvas {\n width: 1920px;\n height: 1080px;\n background: #0a0a0f;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: 60px;\n font-family: \"Inter\", sans-serif;\n }\n\n .shimmer-sweep-target {\n position: relative;\n display: inline-block;\n }\n\n .shimmer-sweep-target .shimmer-mask {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n background: linear-gradient(\n var(--shimmer-angle, 120deg),\n transparent 0%,\n transparent calc(var(--shimmer-pos, -20%) - var(--shimmer-width, 20%) / 2),\n var(--shimmer-color, rgba(255, 255, 255, 0.6)) var(--shimmer-pos, -20%),\n transparent calc(var(--shimmer-pos, -20%) + var(--shimmer-width, 20%) / 2),\n transparent 100%\n );\n mix-blend-mode: overlay;\n }\n </style>\n\n <script>\n (function () {\n // Inject shimmer masks\n document.querySelectorAll(\".shimmer-sweep-target\").forEach((el) => {\n if (!el.querySelector(\".shimmer-mask\")) {\n const mask = document.createElement(\"div\");\n mask.className = \"shimmer-mask\";\n el.appendChild(mask);\n }\n });\n\n const tl = gsap.timeline({ paused: true });\n\n // Fade in elements\n tl.to(\".demo-heading\", { opacity: 1, duration: 0.6, ease: \"power2.out\" }, 0.3);\n tl.to(\".demo-subheading\", { opacity: 1, duration: 0.6, ease: \"power2.out\" }, 0.6);\n tl.to(\".demo-pill\", { opacity: 1, duration: 0.6, ease: \"power2.out\" }, 0.9);\n\n // First shimmer sweep across all targets\n tl.fromTo(\n \".shimmer-sweep-target\",\n { \"--shimmer-pos\": \"-20%\" },\n {\n \"--shimmer-pos\": \"120%\",\n duration: 1.2,\n ease: \"power2.inOut\",\n stagger: 0.15,\n },\n 1.5,\n );\n\n // Second sweep\n tl.fromTo(\n \".shimmer-sweep-target\",\n { \"--shimmer-pos\": \"-20%\" },\n {\n \"--shimmer-pos\": \"120%\",\n duration: 1.0,\n ease: \"power2.inOut\",\n stagger: 0.1,\n },\n 3.5,\n );\n\n window.__timelines = window.__timelines || {};\n window.__timelines[\"shimmer-sweep-demo\"] = tl;\n })();\n </script>\n </div>\n </body>\n</html>\n"} |