Files
hyperframes/docs/public/catalog/blocks/macos-notification.json
Miguel Ángel 536165b6ef feat(catalog): play the real composition on catalog pages (#3168)
* 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
2026-08-10 17:54:48 -04:00

1 line
5.5 KiB
JSON

{"html":"<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <link rel=\"preconnect\" href=\"https://fonts.googleapis.com\" />\n <link rel=\"preconnect\" href=\"https://fonts.gstatic.com\" crossorigin />\n <link\n href=\"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=block\"\n rel=\"stylesheet\"\n />\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: #1a1a2e;\n overflow: hidden;\n }\n body {\n width: 1920px;\n height: 1080px;\n font-family: \"Inter\", sans-serif;\n }\n\n [data-composition-id=\"macos-notification\"] .notification-card {\n position: absolute;\n top: 24px;\n right: 24px;\n width: 380px;\n background: rgba(30, 30, 30, 0.82);\n backdrop-filter: blur(40px);\n -webkit-backdrop-filter: blur(40px);\n border-radius: 16px;\n padding: 16px;\n box-shadow:\n 0 8px 32px rgba(0, 0, 0, 0.4),\n inset 0 0 0 0.5px rgba(255, 255, 255, 0.1);\n display: flex;\n gap: 12px;\n align-items: flex-start;\n }\n\n [data-composition-id=\"macos-notification\"] .app-icon {\n width: 36px;\n height: 36px;\n border-radius: 8px;\n flex-shrink: 0;\n overflow: hidden;\n }\n\n [data-composition-id=\"macos-notification\"] .app-icon svg {\n width: 36px;\n height: 36px;\n display: block;\n }\n\n [data-composition-id=\"macos-notification\"] .notification-content {\n flex: 1;\n min-width: 0;\n }\n\n [data-composition-id=\"macos-notification\"] .notification-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 2px;\n }\n\n [data-composition-id=\"macos-notification\"] .app-name {\n font-size: 13px;\n font-weight: 600;\n color: rgba(255, 255, 255, 0.5);\n text-transform: uppercase;\n letter-spacing: 0.02em;\n }\n\n [data-composition-id=\"macos-notification\"] .time-label {\n font-size: 13px;\n font-weight: 400;\n color: rgba(255, 255, 255, 0.35);\n }\n\n [data-composition-id=\"macos-notification\"] .notification-title {\n font-size: 15px;\n font-weight: 600;\n color: #ffffff;\n line-height: 1.3;\n margin-bottom: 2px;\n }\n\n [data-composition-id=\"macos-notification\"] .notification-body {\n font-size: 13px;\n font-weight: 400;\n color: rgba(255, 255, 255, 0.6);\n line-height: 1.35;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n </style>\n </head>\n <body>\n <div\n id=\"root\"\n data-composition-id=\"macos-notification\"\n data-width=\"1920\"\n data-height=\"1080\"\n data-start=\"0\"\n data-duration=\"5\"\n >\n <div\n id=\"notification\"\n class=\"clip notification-card\"\n data-start=\"0\"\n data-duration=\"5\"\n data-track-index=\"0\"\n >\n <div class=\"app-icon\">\n <svg viewBox=\"0 0 36 36\" fill=\"none\">\n <defs>\n <linearGradient\n id=\"icon-grad\"\n x1=\"0\"\n y1=\"0\"\n x2=\"36\"\n y2=\"36\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop offset=\"0%\" stop-color=\"#6366f1\" />\n <stop offset=\"100%\" stop-color=\"#8b5cf6\" />\n </linearGradient>\n </defs>\n <rect width=\"36\" height=\"36\" rx=\"8\" fill=\"url(#icon-grad)\" />\n <text\n x=\"18\"\n y=\"23\"\n text-anchor=\"middle\"\n font-family=\"Inter, sans-serif\"\n font-size=\"14\"\n font-weight=\"700\"\n fill=\"#fff\"\n >\n HF\n </text>\n </svg>\n </div>\n <div class=\"notification-content\">\n <div class=\"notification-header\">\n <span class=\"app-name\">HyperFrames</span>\n <span class=\"time-label\">now</span>\n </div>\n <div class=\"notification-title\">Prompt to replace this title</div>\n <div class=\"notification-body\">\n Prompt to change this body text, the app icon, and the app name to match your content.\n </div>\n </div>\n </div>\n </div>\n\n <script>\n window.__timelines = window.__timelines || {};\n\n var tl = gsap.timeline({ paused: true });\n var notification = document.getElementById(\"notification\");\n\n // Start off-screen to the right\n gsap.set(notification, { x: 420, opacity: 0 });\n\n // Slide in from right\n tl.to(\n notification,\n {\n x: 0,\n opacity: 1,\n duration: 0.5,\n ease: \"power3.out\",\n },\n 0.2,\n );\n\n // Slide out to right\n tl.to(\n notification,\n {\n x: 420,\n opacity: 0,\n duration: 0.3,\n ease: \"power3.in\",\n },\n 4.2,\n );\n\n window.__timelines[\"macos-notification\"] = tl;\n </script>\n </body>\n</html>\n"}