mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-03 12:17:03 +00:00
* feat(catalog): add the seven 3D-motion pieces as installable registry blocks Each piece ships as a registry block with a CDN poster and preview, a live catalog detail page and its source. Scripts travel inside the catalog payload (shared vendor libraries fetched once, item scripts inline, the one HDR as a data URI) because the docs host only serves fonts, images and JSON. NO_ESSAY_COMMENTS_OK: the long comment blocks are in vendored libraries and the ported frost source under registry/blocks, not hand-written here. HF_MAX_NONLFS_KB=6000: four hosted texture PNGs under docs/public/catalog/items are runtime assets the docs host must serve as files. fallow skipped locally: it audits against origin/main and this branch is stacked on an older main. * chore(catalog): regenerate gallery data and nav after rebasing onto main * fix(catalog): read the install manifest through the bounded project reader * fix(catalog): a script the inliner missed fails the payload instead of shipping a dead URL * refactor(catalog): the leftover-script check reuses the reference finder * fix(catalog): frost and glass textures load from the CDN and the iteration presets are gone * chore(catalog): regenerate the frost and glass payloads and nav * fix(catalog): frost and glass textures are hosted through the registry url field, not hardcoded * chore(catalog): regenerate the frost and glass payloads against the hosted texture URLs * fix(catalog): the hosted-reference rewrite refuses a bare name it cannot safely replace * ci(catalog): verify changed catalog payloads in headless Chrome and check the docs catalog * feat(catalog): every item page follows the shared layout with a Tune panel and tabs * fix(catalog): let the texture-mask item host its masks so its tile plays live * chore(catalog): regenerate item pages, gallery data and the texture-mask payload * chore(catalog): regenerate item pages after merging main * fix(catalog): declared-only variables get the Tune panel, Code and Docs tabs capped * feat(catalog): give the blend-difference caption a demo scene so its tile plays live * chore(catalog): live payload for the blend-difference caption * perf(catalog): heavy 3d pieces compile and draw before ready, not on the first visible frame * feat(catalog): the avatar promo card hosts its videos, audio and fonts on the CDN * feat(catalog): the avatar promo card tile plays live from its CDN-hosted media * chore(catalog): the avatar promo card plays live, no allowlist left * chore(catalog): shorten two comment blocks * chore(catalog): trim first-party comment blocks to the comment-check limits * chore(catalog): shorten two frost source comments * fix(catalog): the Docs tab renders as prose again, and the detail page honours reduced motion Frame-mode pages carry no prose wrapper, and the detail component sat inside not-prose, so the Docs slot's headings, paragraphs, links and lists had no styling at all. The slots now carry their own prose classes and the chrome around them keeps not-prose. The recorded clip also gets the reduced-motion guard the docs-snippet check requires, and the generator reads stability from the source metadata type so the scripts typecheck passes. * fix(catalog): docs-tab paragraphs render as blocks Mintlify emits paragraphs as inline spans, so two paragraphs in the Docs slot ran together. * fix(ci): drop the duplicate docs_catalog job output git's line-based auto-merge silently duplicated the outputs key when main and this branch each added it on non-adjacent lines during the rebase; oxfmt's yaml parser rejects the repeated map key. * fix(catalog): close four CodeQL alerts in the frost source * chore(catalog): allowlist the avatar-promo-card CDN asset deletions, format sync-docs-catalog check-no-main-deletions.mjs was rejecting 11 local mp4/font files this branch already deleted in favor of CDN hosting; scripts/sync-docs-catalog.mjs had one line over the 100-col print width from an earlier edit in this branch. * fix(catalog): detail tabs use docs prose spacing, Install first; previews skip no-WebGPU runners * fix(catalog): the docs tab scrolls with the page instead of a capped inner box * refactor(catalog): split the payload asset and verify scripts into single-purpose helpers * refactor(catalog): split the preview generator into single-purpose helpers * ci(catalog): fail when the committed catalog differs from generator output The docs host serves the committed catalog and nothing regenerates it, so a stale copy shipped silently. The catalog payloads job now generates into a temp dir and compares it with the committed tree. * chore(catalog): regenerate docs/public/catalog with the refactored scripts One full regeneration from an empty output tree with the current scripts. The tree grows from 58.4 MB to 65.1 MB. Two hosted assets are about 2 MB each (an avatar png and a wav); the same bytes are already committed under assets/, so HF_MAX_NONLFS_KB is raised for this commit only. * fix(catalog): run the catalog script tests under the runner they are written for The rebase put three node:test files in the vitest half of test:scripts, where they report "No test suite found". They now sit in the node --test list. * fix(catalog): a WebGPU item without an adapter shows its recorded clip and says why * ci(catalog): the drift check runs from a committed fetch mirror with no network Generation now serves every font and CDN script fetch from scripts/catalog-fetch-mirror and fails when a fetch is not in it, even if the caller swallowed the error. CATALOG_FETCH_MIRROR=record refreshes the mirror from the live network. The docs_catalog filter also watches packages/core, packages/producer and the mirror, and the 13 re-hashed font files are listed in ALLOWED_DELETIONS. * chore(catalog): clean up the temp font cache and sort the mirror index without a locale * fix(catalog): hide Tune when the clip stands in, time out the adapter request, share one check * fix(catalog): the adapter probe survives a sync throw and a hang; test the clip guard * fix(catalog): keep the adapter probe inside the component, Mintlify evaluates only exports * fix(catalog): run the detail and page generator tests in CI; no Tune flash while probing WebGPU * docs(catalog): credit vendored libraries and make each SKILL.md list what the block installs CREDITS.md names every vendored dependency with its upstream and licence, and flags the two leaf textures whose origin is still to be confirmed. Each SKILL.md Files table now comes from the block manifest and its install and render paths point at compositions/<name>/. A test checks that every path a SKILL.md names is a manifest file that exists. * fix(catalog): a declared WebGPU item passes verify by its manifest tag, not by console wording verify-catalog-payloads forgave a missing adapter only by matching the markup and the message, which library-reported errors and widgets never satisfy. The webgpu tag in the item manifest is now the owner: a tagged item ignores its page and console errors, an untagged one gets no forgiveness, and a marker payload with no html is listed instead of crashing the run. * docs(catalog): correct the credits per block and guard the mount and render paths CREDITS.md states the three.js version and vendored-or-CDN status per block, adds d3-delaunay, Clipper on the CDN and the Google Fonts loads, and lists every texture with no known origin. The SKILL.md test now also checks the mount and render paths against the manifest composition. * test(catalog): read each block manifest once in the SKILL.md file test The two checks shared a copied manifest read, which fallow flagged as a clone with a high score. * fix(catalog): commit the hosted item files a gitignore rule kept out, and check git not the disk The compositions/ and *-ad/ ignore rules matched folder names under docs/public/catalog/items, so 33 hosted fonts, textures and marks were generated but never committed and would 404 on the docs host. The rules now have a negation for that tree and the files are added. The drift check read the checkout, where git-ignored files still exist, so it passed locally and failed only in CI. It now unpacks HEAD with git archive and compares that. * fix(catalog): a tile keeps its poster until the composition has painted * fix(catalog): a tagged WebGPU item forgives only the adapter-absent error, and test the wiring The manifest webgpu tag now decides whether an item may lack an adapter, and the error wording decides which lines are that absence. Any other page or console error on the item, and every failed request, still fails. The per-item decision is one exported function the tests drive, marker payloads are parsed by a tested helper, and the SKILL.md variable counts are checked against their tables (cuboid-carousel said forty-nine for forty). * fix(catalog): the pinned group's posters load eagerly at high priority * fix(catalog): type the tile reveal test so the scripts typecheck passes * fix(catalog): stop the adapter signature matching an unrelated failed adapter request failed to request .*adapter also matched errors about other adapters. It now matches only a request for the WebGPU adapter, so a tagged item cannot hide an unrelated failure behind it. * test(catalog): a tagged item still fails on an error about some other adapter * feat(catalog): the install command sits above the preview, as on the live catalog * fix(catalog): find the install slot through Mintlify's child wrapper * fix(docs): catalog copy buttons keep their size when the label swaps to Copied * refactor(docs): name the shown copy label once in the catalog copy button * fix(docs): primary catalog button keeps a readable label on hover and after copy * fix(docs): inset the catalog tab strip and tab content to match the boxed panels
1 line
13 KiB
JSON
1 line
13 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>Halftone Field</title>\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 margin: 0;\n padding: 0;\n box-sizing: border-box;\n }\n body {\n background: #000;\n overflow: hidden;\n }\n #hlf-root {\n position: relative;\n width: 1920px;\n height: 1080px;\n overflow: hidden;\n }\n #hlf-backdrop {\n position: absolute;\n inset: 0;\n background: #000000;\n }\n #hlf-canvas {\n position: absolute;\n top: 0;\n left: 0;\n width: 1920px;\n height: 1080px;\n }\n </style>\n </head>\n <body>\n <div\n id=\"hlf-root\"\n data-composition-id=\"halftone-field\"\n data-root=\"true\"\n data-width=\"1920\"\n data-height=\"1080\"\n data-start=\"0\"\n data-duration=\"10\"\n data-composition-variables='[{\"id\":\"frequency\",\"type\":\"number\",\"label\":\"Field frequency\",\"default\":2,\"min\":1,\"max\":10,\"step\":0.1},{\"id\":\"speed\",\"type\":\"number\",\"label\":\"Flow speed\",\"default\":5,\"min\":0,\"max\":10,\"step\":0.1},{\"id\":\"cellSize\",\"type\":\"number\",\"label\":\"Cell size\",\"default\":54,\"min\":1,\"max\":100,\"step\":1},{\"id\":\"gamma\",\"type\":\"number\",\"label\":\"Gamma (midtone crush)\",\"default\":12,\"min\":1,\"max\":20,\"step\":0.1},{\"id\":\"paletteBias\",\"type\":\"number\",\"label\":\"Palette bias\",\"default\":2,\"min\":0,\"max\":20,\"step\":0.5},{\"id\":\"palette1\",\"type\":\"color\",\"label\":\"Palette stop 1 (lows)\",\"default\":\"#00AAFF\"},{\"id\":\"palette2\",\"type\":\"color\",\"label\":\"Palette stop 2\",\"default\":\"#C2FF67\"},{\"id\":\"palette3\",\"type\":\"color\",\"label\":\"Palette stop 3\",\"default\":\"#6600FF\"},{\"id\":\"palette4\",\"type\":\"color\",\"label\":\"Palette stop 4 (crests)\",\"default\":\"#000000\"},{\"id\":\"background\",\"type\":\"color\",\"label\":\"Background\",\"default\":\"#000000\"},{\"id\":\"quantize\",\"type\":\"boolean\",\"label\":\"Quantise to 30fps (stepped)\",\"default\":false}]'\n >\n <div id=\"hlf-backdrop\"></div>\n <canvas id=\"hlf-canvas\" width=\"1920\" height=\"1080\"></canvas>\n\n <!-- Driver clip: gives HyperFrames a timed element to own on track 0. -->\n <div\n id=\"hlf-drv\"\n class=\"clip\"\n data-start=\"0\"\n data-duration=\"10\"\n data-track-index=\"0\"\n style=\"position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none\"\n ></div>\n </div>\n\n <script>\n (function () {\n var DUR = 10;\n var W = 1920;\n var H = 1080;\n\n var V = (window.__hyperframes && window.__hyperframes.getVariables()) || {};\n var CS = getComputedStyle(document.getElementById(\"hlf-root\"));\n\n // The runtime defines every declared variable as `--<id>` on the root,\n // so a host stylesheet can override one there too. Read the custom\n // property first, fall back to the declared value when it is unset.\n function raw(id) {\n var css = CS.getPropertyValue(\"--\" + id.toLowerCase()).trim();\n return css !== \"\" ? css : V[id];\n }\n function num(id, fallback) {\n var n = parseFloat(raw(id));\n return isFinite(n) ? n : fallback;\n }\n function bool(id) {\n var v = raw(id);\n return v === true || /^(true|1|on|yes)$/i.test(String(v));\n }\n // #RGB / #RRGGBB -> [r, g, b] in 0..1. Anything else falls back.\n function rgb(id, fallback) {\n var s = String(raw(id) || \"\").trim();\n var m = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(s);\n if (!m) s = fallback;\n else s = \"#\" + m[1];\n var hex = s.slice(1);\n if (hex.length === 3) {\n hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];\n }\n var n = parseInt(hex, 16);\n return [((n >> 16) & 255) / 255, ((n >> 8) & 255) / 255, (n & 255) / 255];\n }\n // The reference exposes 1-10 / 1-100 / 1-20 dials and maps them onto\n // the ranges the shader actually wants.\n function mapLinear(x, a1, a2, b1, b2) {\n return b1 + ((x - a1) * (b2 - b1)) / (a2 - a1);\n }\n\n var FREQ = mapLinear(num(\"frequency\", 2), 1, 10, 0.3, 6);\n var SPEED = num(\"speed\", 5) * 0.05;\n var CELL = mapLinear(num(\"cellSize\", 54), 1, 100, 6, 60);\n var GAMMA = mapLinear(num(\"gamma\", 12), 1, 20, 0.5, 8);\n var BIAS = num(\"paletteBias\", 2) * 0.05;\n var PAL = [\n rgb(\"palette1\", \"#00AAFF\"),\n rgb(\"palette2\", \"#C2FF67\"),\n rgb(\"palette3\", \"#6600FF\"),\n rgb(\"palette4\", \"#000000\"),\n ];\n var BG = rgb(\"background\", \"#000000\");\n var QUANTIZE = bool(\"quantize\");\n\n document.getElementById(\"hlf-backdrop\").style.background =\n \"rgb(\" +\n BG.map(function (c) {\n return Math.round(c * 255);\n }).join(\",\") +\n \")\";\n\n var canvas = document.getElementById(\"hlf-canvas\");\n var gl =\n canvas.getContext(\"webgl\", {\n alpha: false,\n antialias: false,\n depth: false,\n stencil: false,\n preserveDrawingBuffer: true,\n powerPreference: \"high-performance\",\n }) ||\n canvas.getContext(\"experimental-webgl\", {\n alpha: false,\n preserveDrawingBuffer: true,\n });\n\n var VERT = \"attribute vec2 aPos;\\nvoid main() { gl_Position = vec4(aPos, 0.0, 1.0); }\";\n\n // Single pass. The reference renders the colour field into a target and\n // samples it at each cell centre, but the field is analytic, so\n // evaluating it at the cell centre here is the same value without the\n // round trip through a texture.\n var FRAG = `\nprecision highp float;\nuniform vec2 uRes;\nuniform float uTime;\nuniform float uFreq;\nuniform float uSpeed;\nuniform float uCell;\nuniform float uGamma;\nuniform float uBias;\nuniform vec3 uPal0;\nuniform vec3 uPal1;\nuniform vec3 uPal2;\nuniform vec3 uPal3;\nuniform vec3 uBg;\n\n// 3D simplex noise — Ashima Arts / Stefan Gustavson (MIT).\nvec3 mod289(vec3 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }\nvec4 mod289(vec4 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }\nvec4 permute(vec4 x) { return mod289(((x * 34.0) + 1.0) * x); }\nvec4 taylorInvSqrt(vec4 r) { return 1.79284291400159 - 0.85373472095314 * r; }\n\nfloat snoise(vec3 v) {\n const vec2 C = vec2(1.0 / 6.0, 1.0 / 3.0);\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\n vec3 i = floor(v + dot(v, C.yyy));\n vec3 x0 = v - i + dot(i, C.xxx);\n\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min(g.xyz, l.zxy);\n vec3 i2 = max(g.xyz, l.zxy);\n\n vec3 x1 = x0 - i1 + C.xxx;\n vec3 x2 = x0 - i2 + C.yyy;\n vec3 x3 = x0 - D.yyy;\n\n i = mod289(i);\n vec4 p = permute(permute(permute(\n i.z + vec4(0.0, i1.z, i2.z, 1.0)) +\n i.y + vec4(0.0, i1.y, i2.y, 1.0)) +\n i.x + vec4(0.0, i1.x, i2.x, 1.0));\n\n float n_ = 0.142857142857;\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z * ns.z);\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_);\n\n vec4 x = x_ * ns.x + ns.yyyy;\n vec4 y = y_ * ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4(x.xy, y.xy);\n vec4 b1 = vec4(x.zw, y.zw);\n\n vec4 s0 = floor(b0) * 2.0 + 1.0;\n vec4 s1 = floor(b1) * 2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw * sh.xxyy;\n vec4 a1 = b1.xzyw + s1.xzyw * sh.zzww;\n\n vec3 p0 = vec3(a0.xy, h.x);\n vec3 p1 = vec3(a0.zw, h.y);\n vec3 p2 = vec3(a1.xy, h.z);\n vec3 p3 = vec3(a1.zw, h.w);\n\n vec4 norm = taylorInvSqrt(vec4(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n vec4 m = max(0.6 - vec4(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3)), 0.0);\n m = m * m;\n return 42.0 * dot(m * m, vec4(dot(p0, x0), dot(p1, x1), dot(p2, x2), dot(p3, x3)));\n}\n\n// Full-saturation, full-value HSV: only the hue ramp survives.\nvec3 hue2rgb(float h) {\n return clamp(abs(mod(h * 6.0 + vec3(0.0, 4.0, 2.0), 6.0) - 3.0) - 1.0, 0.0, 1.0);\n}\n\n// Piecewise-linear ramp across the four palette stops.\nvec3 ramp(float v) {\n float x = clamp(v, 0.0, 1.0) * 3.0;\n vec3 c = mix(uPal0, uPal1, clamp(x, 0.0, 1.0));\n c = mix(c, uPal2, clamp(x - 1.0, 0.0, 1.0));\n c = mix(c, uPal3, clamp(x - 2.0, 0.0, 1.0));\n return c;\n}\n\nvoid main() {\n // One sample per cell, taken at the cell centre.\n vec2 cell = floor(gl_FragCoord.xy / uCell);\n vec2 centre = (cell + 0.5) * uCell;\n\n vec2 st = centre / uRes;\n st.x *= uRes.x / uRes.y;\n\n float hue = abs(snoise(vec3(st * uFreq, uTime * uSpeed)));\n vec3 field = hue2rgb(hue);\n\n // The gamma is the whole look: it crushes the midtones so most of the frame\n // stays background and only the crests of the field open up.\n float gray = pow(dot(field, vec3(0.2126, 0.7152, 0.0722)), uGamma);\n float v = clamp(gray + uBias, 0.0, 1.0);\n\n float radius = v * 0.5 * uCell;\n float d = length(gl_FragCoord.xy - centre);\n float mask = 1.0 - smoothstep(radius - 1.0, radius + 1.0, d);\n\n gl_FragColor = vec4(mix(uBg, ramp(v), mask), 1.0);\n}\n`;\n\n var uni = {};\n var ready = false;\n\n function compile(type, src) {\n var sh = gl.createShader(type);\n gl.shaderSource(sh, src);\n gl.compileShader(sh);\n if (!gl.getShaderParameter(sh, gl.COMPILE_STATUS)) {\n throw new Error(\"halftone-field shader: \" + gl.getShaderInfoLog(sh));\n }\n return sh;\n }\n\n if (gl) {\n var prog = gl.createProgram();\n gl.attachShader(prog, compile(gl.VERTEX_SHADER, VERT));\n gl.attachShader(prog, compile(gl.FRAGMENT_SHADER, FRAG));\n gl.linkProgram(prog);\n if (!gl.getProgramParameter(prog, gl.LINK_STATUS)) {\n throw new Error(\"halftone-field link: \" + gl.getProgramInfoLog(prog));\n }\n gl.useProgram(prog);\n\n var buf = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buf);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([-1, -1, 3, -1, -1, 3]), gl.STATIC_DRAW);\n var loc = gl.getAttribLocation(prog, \"aPos\");\n gl.enableVertexAttribArray(loc);\n gl.vertexAttribPointer(loc, 2, gl.FLOAT, false, 0, 0);\n\n [\n \"uRes\",\n \"uTime\",\n \"uFreq\",\n \"uSpeed\",\n \"uCell\",\n \"uGamma\",\n \"uBias\",\n \"uPal0\",\n \"uPal1\",\n \"uPal2\",\n \"uPal3\",\n \"uBg\",\n ].forEach(function (n) {\n uni[n] = gl.getUniformLocation(prog, n);\n });\n\n gl.viewport(0, 0, W, H);\n gl.uniform2f(uni.uRes, W, H);\n gl.uniform1f(uni.uFreq, FREQ);\n gl.uniform1f(uni.uSpeed, SPEED);\n gl.uniform1f(uni.uCell, CELL);\n gl.uniform1f(uni.uGamma, GAMMA);\n gl.uniform1f(uni.uBias, BIAS);\n gl.uniform3f(uni.uPal0, PAL[0][0], PAL[0][1], PAL[0][2]);\n gl.uniform3f(uni.uPal1, PAL[1][0], PAL[1][1], PAL[1][2]);\n gl.uniform3f(uni.uPal2, PAL[2][0], PAL[2][1], PAL[2][2]);\n gl.uniform3f(uni.uPal3, PAL[3][0], PAL[3][1], PAL[3][2]);\n gl.uniform3f(uni.uBg, BG[0], BG[1], BG[2]);\n ready = true;\n }\n\n // Every frame is computed from t alone — the field is a closed-form\n // function of position and time. No accumulator, no clock, no PRNG.\n // `quantize` snaps t to a 30fps grid for the stepped LED-wall look.\n function draw(t) {\n if (!ready) return;\n gl.uniform1f(uni.uTime, QUANTIZE ? Math.floor(t * 30) / 30 : t);\n gl.drawArrays(gl.TRIANGLES, 0, 3);\n gl.flush();\n }\n\n window.__timelines = window.__timelines || {};\n var tl = gsap.timeline({ paused: true });\n\n // The canvas is repainted from a property SETTER, not from onUpdate:\n // gsap's seek(t) suppresses events by default, so an onUpdate callback\n // silently never fires on a scrub and the canvas freezes on frame 0.\n // Tweened values are always written during render, suppressed or not,\n // so this fires on every seek — and hands us the frame time directly.\n var driver = { _t: 0 };\n Object.defineProperty(driver, \"t\", {\n get: function () {\n return this._t;\n },\n set: function (v) {\n this._t = v;\n draw(v);\n },\n });\n tl.to(driver, { t: DUR, duration: DUR, ease: \"none\" }, 0);\n window.__timelines[\"halftone-field\"] = tl;\n\n draw(0);\n })();\n </script>\n </body>\n</html>\n"} |