mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-01 19:42:03 +00:00
* fix(catalog): reveal Matrix Decode captions with autoAlpha so the docs preview renders The demo and snippet flipped word spans with zero-duration display sets, which the seek-driven docs player never applies after its style restore: the composition played 8s of black. autoAlpha reveals with the scrambles as same-length absolute overlays follow the keyframes contract (never tween display) and survive seeks and loop wraps. Scramble text now matches each word's length so it decodes in place instead of jumping. * chore(registry): remove the Checkout Flow component Owner-directed removal of the checkout-flow catalog item: source, demo, generated docs page and payload, and its entries in the registry manifest, catalog index, docs nav, and search vectors. The deletions are allowlisted in check-no-main-deletions.
1 line
8.8 KiB
JSON
1 line
8.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>Matrix Decode</title>\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=Space+Grotesk:wght@700&display=swap\"\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 *::before,\n *::after {\n box-sizing: border-box;\n }\n html,\n body {\n width: 1920px;\n height: 1080px;\n margin: 0;\n overflow: hidden;\n background: #000;\n }\n #matrix-decode {\n position: relative;\n width: 1920px;\n height: 1080px;\n overflow: hidden;\n background: #000;\n }\n .sc-overlay {\n position: absolute;\n inset: 0;\n background: rgba(0, 0, 0, 0.85);\n z-index: 1;\n pointer-events: none;\n }\n #sc-container {\n position: absolute;\n inset: 0;\n z-index: 10;\n pointer-events: none;\n }\n .sc-group {\n position: absolute;\n bottom: 120px;\n left: 0;\n width: 100%;\n display: flex;\n flex-wrap: wrap;\n align-items: flex-end;\n justify-content: center;\n gap: 24px;\n padding: 0 80px;\n opacity: 0;\n visibility: hidden;\n }\n .sc-word-wrap {\n font-family: \"Space Grotesk\", sans-serif;\n font-weight: 700;\n font-size: 96px;\n color: #00ff41;\n display: inline-block;\n letter-spacing: 0.04em;\n line-height: 1;\n position: relative;\n }\n .sc-real {\n opacity: 0;\n visibility: hidden;\n }\n .sc-scr0,\n .sc-scr1 {\n position: absolute;\n left: 0;\n top: 0;\n white-space: nowrap;\n opacity: 0;\n visibility: hidden;\n }\n </style>\n </head>\n <body>\n <div\n id=\"matrix-decode\"\n data-composition-id=\"caption-matrix-decode\"\n data-start=\"0\"\n data-duration=\"8\"\n data-fps=\"30\"\n data-width=\"1920\"\n data-height=\"1080\"\n >\n <div class=\"sc-overlay\"></div>\n <div id=\"sc-container\"></div>\n </div>\n\n <script>\n (function () {\n window.__timelines = window.__timelines || {};\n\n var _fitCanvas = document.createElement(\"canvas\");\n var _fitCtx = _fitCanvas.getContext(\"2d\");\n function fitFontSize(text, baseFontSize, fontWeight, fontFamily, maxWidth) {\n var size = baseFontSize;\n var minSize = Math.floor(baseFontSize * 0.45);\n while (size > minSize) {\n _fitCtx.font = fontWeight + \" \" + size + \"px \" + fontFamily;\n if (_fitCtx.measureText(text).width <= maxWidth) return size;\n size -= 2;\n }\n return minSize;\n }\n\n function mulberry32(seed) {\n return function () {\n seed |= 0;\n seed = (seed + 0x6d2b79f5) | 0;\n var t = Math.imul(seed ^ (seed >>> 15), 1 | seed);\n t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t;\n return ((t ^ (t >>> 14)) >>> 0) / 4294967296;\n };\n }\n\n var ALPHANUM = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n function scrambleChars(seed, length) {\n var rng = mulberry32(seed);\n var result = \"\";\n for (var i = 0; i < length; i++) {\n result += ALPHANUM[Math.floor(rng() * ALPHANUM.length)];\n }\n return result;\n }\n\n var WORDS = [\n { text: \"Every\", start: 0.0, end: 0.3 },\n { text: \"great\", start: 0.3, end: 0.55 },\n { text: \"video\", start: 0.55, end: 0.85 },\n { text: \"starts\", start: 0.85, end: 1.1 },\n { text: \"with\", start: 1.1, end: 1.25 },\n { text: \"a\", start: 1.25, end: 1.35 },\n { text: \"single\", start: 1.35, end: 1.65 },\n { text: \"frame.\", start: 1.65, end: 2.0 },\n { text: \"HyperFrames\", start: 2.1, end: 2.65 },\n { text: \"lets\", start: 2.65, end: 2.85 },\n { text: \"you\", start: 2.85, end: 2.95 },\n { text: \"write\", start: 2.95, end: 3.15 },\n { text: \"HTML\", start: 3.15, end: 3.55 },\n { text: \"and\", start: 3.55, end: 3.65 },\n { text: \"render\", start: 3.65, end: 3.95 },\n { text: \"professional\", start: 3.95, end: 4.45 },\n { text: \"video.\", start: 4.45, end: 4.8 },\n { text: \"No\", start: 4.9, end: 5.05 },\n { text: \"timeline.\", start: 5.05, end: 5.45 },\n { text: \"No\", start: 5.5, end: 5.65 },\n { text: \"drag\", start: 5.65, end: 5.85 },\n { text: \"and\", start: 5.85, end: 5.95 },\n { text: \"drop.\", start: 5.95, end: 6.25 },\n { text: \"Just\", start: 6.35, end: 6.55 },\n { text: \"code\", start: 6.55, end: 6.8 },\n { text: \"that\", start: 6.8, end: 6.95 },\n { text: \"becomes\", start: 6.95, end: 7.3 },\n { text: \"cinema.\", start: 7.3, end: 7.7 },\n ];\n\n var GROUPS = [\n { wordStart: 0, wordEnd: 3, start: 0.0, end: 1.35 },\n { wordStart: 4, wordEnd: 7, start: 1.1, end: 2.35 },\n { wordStart: 8, wordEnd: 8, start: 2.1, end: 2.9 },\n { wordStart: 9, wordEnd: 12, start: 2.65, end: 3.8 },\n { wordStart: 13, wordEnd: 15, start: 3.55, end: 4.7 },\n { wordStart: 16, wordEnd: 16, start: 3.95, end: 5.0 },\n { wordStart: 17, wordEnd: 19, start: 4.9, end: 5.7 },\n { wordStart: 20, wordEnd: 22, start: 5.65, end: 6.5 },\n { wordStart: 23, wordEnd: 24, start: 6.35, end: 7.05 },\n { wordStart: 25, wordEnd: 27, start: 6.8, end: 7.9 },\n ];\n\n var container = document.getElementById(\"sc-container\");\n var tl = gsap.timeline({ paused: true });\n\n GROUPS.forEach(function (g, gi) {\n var groupWords = WORDS.slice(g.wordStart, g.wordEnd + 1);\n var groupText = groupWords\n .map(function (w) {\n return w.text;\n })\n .join(\" \");\n var fontSize = fitFontSize(groupText, 96, \"700\", \"'Space Grotesk', sans-serif\", 1760);\n var grp = document.createElement(\"div\");\n grp.className = \"sc-group\";\n grp.id = \"sc-grp-\" + gi;\n\n groupWords.forEach(function (w, i) {\n var wi = g.wordStart + i;\n var wordWrap = document.createElement(\"span\");\n wordWrap.className = \"sc-word-wrap\";\n wordWrap.id = \"sc-ww-\" + wi;\n wordWrap.style.fontSize = fontSize + \"px\";\n\n var real = document.createElement(\"span\");\n real.className = \"sc-real\";\n real.id = \"sc-real-\" + wi;\n real.textContent = w.text;\n wordWrap.appendChild(real);\n\n var scr0 = document.createElement(\"span\");\n scr0.className = \"sc-scr0\";\n scr0.id = \"sc-scr0-\" + wi;\n scr0.textContent = scrambleChars(wi * 1000 + 0, w.text.length);\n wordWrap.appendChild(scr0);\n\n var scr1 = document.createElement(\"span\");\n scr1.className = \"sc-scr1\";\n scr1.id = \"sc-scr1-\" + wi;\n scr1.textContent = scrambleChars(wi * 1000 + 1, w.text.length);\n wordWrap.appendChild(scr1);\n\n grp.appendChild(wordWrap);\n });\n\n container.appendChild(grp);\n\n tl.set(grp, { visibility: \"visible\", opacity: 0 }, g.start);\n tl.fromTo(grp, { opacity: 0 }, { opacity: 1, duration: 0.1 }, g.start);\n\n groupWords.forEach(function (w, i) {\n var wi = g.wordStart + i;\n var realEl = document.getElementById(\"sc-real-\" + wi);\n var scr0El = document.getElementById(\"sc-scr0-\" + wi);\n var scr1El = document.getElementById(\"sc-scr1-\" + wi);\n\n tl.set(scr0El, { autoAlpha: 1 }, w.start);\n tl.set(scr1El, { autoAlpha: 1 }, w.start + 0.1);\n tl.set(scr0El, { autoAlpha: 0 }, w.start + 0.1);\n tl.set(realEl, { autoAlpha: 1 }, w.start + 0.2);\n tl.set(scr1El, { autoAlpha: 0 }, w.start + 0.2);\n });\n\n tl.to(grp, { opacity: 0, duration: 0.12 }, g.end - 0.12);\n tl.set(grp, { opacity: 0, visibility: \"hidden\" }, g.end);\n });\n\n window.__timelines[\"caption-matrix-decode\"] = tl;\n })();\n </script>\n </body>\n</html>\n"} |