1实现原理 · 为什么它能做到
产出镜头:整片带纹理的树冠以浅景深扫过画面,随后「分开」露出第一行标题;第二批做了深度抬升的叶片把第二行标题带过镜头,最后少量叶片留在字面上继续轻摆。
A dense canopy of textured leaves sweeps across the frame with shallow depth of field, then parts to uncover the first headline; a second, depth-lifted batch carries the second headline past the camera. A handful of leaves stay behind on the type and keep a light breeze.
作为官方「积木」分发:一条 `npx hyperframes add canopy-part-title` 按 registry-item 的 files→target 映射把 composition 与贴图落到 compositions/canopy-part-title/,再由宿主 index.html 用 data-composition-src 挂载。
Install with `npx hyperframes add canopy-part-title`; by default the files above land under `compositions/canopy-part-title/`. Then mount the block from the host `index.html`: … data-composition-id="canopy-part-title" … data-composition-src="compositions/canopy-part-title/canopy-part-title.html"
参数面完全外置:11 个变量声明在 composition 根节点的 data-composition-variables(单引号属性 + 纯 JSON),运行时经 window.__hyperframes.getVariables() 读取;读取失败包在 try/catch 里,退回脚本内默认值,不让畸形声明把画面打空。
if (window.__hyperframes && window.__hyperframes.getVariables) V = window.__hyperframes.getVariables() || {}; } catch (e) { /* corrupt declarations must not blank the composition */ }
可渲染性靠确定性契约:一条 paused 的 GSAP 时间线注册在 window.__timelines["canopy-part-title"],seek 时监听 hf-seek 自定义事件重同步,每一帧都是时间的闭式函数(只用种子 PRNG,无 rAF 循环、无 Date.now)。
One paused GSAP timeline registered as `window.__timelines["canopy-part-title"]`. … Re-syncs on the `hf-seek` CustomEvent; every frame is a closed-form function of time (seeded PRNG only, no rAF loops, no Date.now).
随机性全部换成种子 PRNG:布局与主时间线脚本在 Three 模块之前同步执行,注释明写「Zero Math.random」,各叶片批次用独立常数种子(mulberry32),保证同一时刻永远同一画面。
Seeded layout + master timeline. Runs synchronously before the Three module so the timeline exists the moment the page is scriptable. Zero Math.random. … var rand = mulberry32(0x6a756e67);
渲染栈是 three.js 0.170.0(jsdelivr importmap)+ EffectComposer/BokehPass 景深 + 阴影;SKILL.md 明写单实例约 350 MB、一次只跑一个,并要求 canvas 在运行时创建(静态 markup 里放 <canvas> 会让 Studio 变量解析器失败)。
Renderer: three.js 0.170.0, GSAP 3.14.2, Canvas 2D, Post-processing, Seeded PRNG, Shadow maps. Budget roughly 350 MB per live instance; run one at a time.
2核心能力
3外部依赖
| 类型 | 依赖 |
|---|---|
| cli | HyperFrames 官方 CLI(add / render) |
| network | jsDelivr CDN:GSAP 3.14.2(产物期浏览器执行的脚本) |
| network | jsDelivr CDN:three.js 0.170.0(importmap + 三个 postprocessing addon) |
| network | Google Fonts(产物期浏览器拉取字体;Gelasio 为自带示例) |
| package | three.js 0.170.0 + GSAP 3.14.2(浏览器端运行,非本地 node 依赖) |
4风险提醒 风险提醒:蓝色 · 知晓即可
- 产物期依赖 CDN — three/gsap 与 Gelasio 字体由浏览器在渲染时拉取(html 第 10–16、333–340 行);离线或有网管限制的环境需先本地化,否则渲染期取不到依赖。
- 单实例内存较重 — SKILL.md 自述约 350 MB/实例并要求一次只跑一个;同页并列多个重块有内存与首帧编译风险。
- 变量属性格式脆弱 — SKILL.md 明写必须保持单引号 + 纯 JSON、且不要经 Studio Design 面板保存;一旦被改写,旋钮全部回默认(脚本虽有 try/catch 兜底)。
- 换字体改变构图细节 — 留驻叶片贴在字面上(stayCount 与字形相关),换字体/字重后需人工复核留驻叶片的观感。
5第二遍独立确认
- [ok] 变量数与声明一致性(frontmatter 自称 11 variables) — 脚本实测:SKILL.md 变量表 11 行、composition 的 data-composition-variables 解析出 11 项、frontmatter 写 11 —— 三者一致。
- [ok] 「无 Math.random / Date.now / rAF」声称 — 对 html 全文 grep:Math.random、Date.now、performance.now、requestAnimationFrame 零命中;注释逐字写着 Zero Math.random,随机全部来自 mulberry32 常数种子(主批次 0x6a756e67、抬升批 0x6c696674)。
- [ok] 外部依赖单真实性 — html 第 16 行 gsap 脚本、第 333–340 行 importmap 与三个 postprocessing import、第 10–13 行 Google Fonts link 均逐字命中;SKILL.md 的 External runtime dependencies 行与之一致。
- [ok] 凭证/密钥接触面 — 对 SKILL.md / html / registry-item.json 扫描 process.env、secret、token、api_key、cookie:零命中。
- [ok] registry-item 文件清单 vs 盘上文件 — 声明 4 个文件全部存在,且无远端 url 兜底(与本块不依赖远端二进制一致)。
- [ok] 时长与尺寸一致性 — registry-item duration 12 / dimensions 1920×1080 与 html data-duration="12"、SKILL.md 标题行 12s 一致。
6结论
92b16eff05db15f7…d2f0bc7f34