1实现原理 · 为什么它能做到
产出镜头:用随包 Geist 字形经 TTF 解析与多边形偏移建出挤出的线框字形,再从「传送门爆开」中揭示(爆开混沌度可调);第二拍把字母换成替代短语。
registry/blocks/wireframe-portal-title/SKILL.md
Extruded wireframe letterforms are built from the bundled Geist face with a TTF loader and polygon offsetting, then revealed through a portal burst whose chaos is a variable. … A second beat swaps the letters into a replacement phrase with whole-word wrapping and auto type size, staggered with a tunable easing curve and settle glitch, with optional depth fog.
注:这里在做什么:字形不是贴图而是几何(可线框、可挤出、可逐字母变形);同一镜头塞两次信息(主题词 → 行动短语),是同族里唯一的两段式标题块。
双画布分层:立体层(wpt-three)与扭曲层(wpt-warp)都在运行时创建,静态 markup 里不出现 <canvas>。
registry/blocks/wireframe-portal-title/wireframe-portal-title.html
["wpt-three", "wpt-warp"].forEach(function (id) { var canvas = document.createElement("canvas"); canvas.id = id; canvas.width = 1920; canvas.height = 1080;
注:这里在做什么:分层渲染让线框世界与扭曲/后处理互不干扰,同时满足 Studio 解析器对静态 canvas 的限制。
排版靠离屏 canvas 实测字宽:按 Geist 700 176px 逐字量宽并加 3% 字距,再做整词换行与自适应字号。
registry/blocks/wireframe-portal-title/wireframe-portal-title.html
const measure = document.createElement("canvas").getContext("2d"); measure.font = "700 176px Geist"; const tracking = 176 * 0.03; const advance = (char) => measure.measureText(char).width + tracking;
注:这里在做什么:换词要「保住每个词」,所以必须真量文字宽度而不是估——这样才能自动换行与缩字号。
字体是本地资产:经宿主提供的 assetUrl("assets/fonts/Geist-Bold.ttf") 取回 ArrayBuffer,再交给 TTFLoader/FontLoader 解析。
registry/blocks/wireframe-portal-title/wireframe-portal-title.html
const ttfBuffer = await fetch(assetUrl("assets/fonts/Geist-Bold.ttf")).then((r) => r.arrayBuffer(), ); const font = new FontLoader().parse(new TTFLoader().parse(ttfBuffer));
注:这里在做什么:字体走宿主 assetUrl 解析(挂载后路径才正确),不是硬编码相对路径;也解释了字体加载与几何构建的先后。
随机性用两个独立种子替换了原实验的 Math.random:场景一份(20260824)、短语错峰一份(20260831),保证换词与爆开都可复现。
registry/blocks/wireframe-portal-title/wireframe-portal-title.html
// ---------- seeded PRNG (replaces the experiment's Math.random) ---------- … const rand = mulberry32(20260824); const phraseRand = mulberry32(20260831);
注:这里在做什么:原工程是交互实验,搬进渲染管线时必须把随机改成种子化,否则每帧结果不稳定。
首帧预热有明确理由:t=0 时传送门关闭、什么都不画,若等到播放中第一次真绘制,会把所有 shader 链接塞进播放期间。
registry/blocks/wireframe-portal-title/wireframe-portal-title.html
The portal is closed at t=0 and draws nothing, so the first real draw would link every shader mid-playback. Draw across the timeline and flush the GPU
注:这里在做什么:解释「为什么要在 ready 前把时间线整条预绘一遍」——避免首帧后卡顿,属逐帧渲染流水线的必要步骤。
确定性契约同族:paused 时间线注册到 window.__timelines["wireframe-portal-title"],hf-seek 重同步,每帧是 t 的闭式函数。
registry/blocks/wireframe-portal-title/SKILL.md
One paused GSAP timeline registered as `window.__timelines["wireframe-portal-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).
注:这里在做什么:同批所有块的共性契约,保证逐帧渲染可复现。
2核心能力
01线框传送门 + 标题揭示 + 字母换词(1920×1080、8s、9 变量)
02几何化字形:TTF 解析 + 多边形偏移(Clipper)构建挤出线框字母,配合后处理与 GLSL
03两拍节奏可调:传送门爆开混沌度 0–2、字母落定抖动 0–4、换词时长 0.65–2.9s 与缓动 1–8
04可选的深度雾,并带副标题与强调色(accent 默认 #F5C518)
05替词的排版纪律:整词保留、整词换行、字号自适应(离屏 canvas 实测字宽)
06本地字体(Geist Regular/SemiBold/Bold + OFL 文本)随块分发
07脱离 Studio 也能出片:直接渲染并覆盖标题与替词
3外部依赖
| 类型 | 依赖 |
|---|---|
| cli | HyperFrames 官方 CLI(add / render) |
| network | jsDelivr CDN:GSAP 3.14.2(产物期脚本) |
| network | jsDelivr CDN:clipper-lib 6.4.2(多边形偏移,构建线框字形轮廓) |
| network | jsDelivr CDN:three.js 0.181.2 与 examples/jsm(importmap 解析,含后处理模块) |
| package | 本地字体(Geist ×3,OFL)随块分发;其余依赖见上(三个 CDN 脚本) |
4风险提醒 风险提醒:蓝色 · 知晓即可
风险提醒:蓝色 · 知晓即可
- 外链最多 — gsap、clipper-lib、three + examples/jsm 都从 jsdelivr 拉取;离线或受限网络下必须预先本地化,否则字形几何构建失败。
- 标题长度上限 18 字符 — title maxLength 18(SKILL.md 变量表),长标题需改代码或缩字号。
- 几何构建成本随字形复杂度上升 — 逐字母 TTF 轮廓 + 多边形偏移在首次加载时完成,字体/文案变化会重跑;同页多实例需评估。
- 单实例内存较重 — SKILL.md 自述约 350 MB/实例、run one at a time。
风险提醒:蓝色,知晓即可。判级对象=本 block 目录(SKILL.md + composition HTML + 随包 Geist 字体):无凭证/env 读取、无 shell 脚本、无写盘代码、无数据外发。三个外链(jsdelivr 的 gsap、clipper-lib、three + examples/jsm)均属产物期浏览器拉取,按范式附录A第2条不判级,仅列出端点。安装/渲染走官方 CLI 生态。据此取 blue。注意:本块外链最多,离线渲染前需把三个脚本本地化,否则线框字形无法构建。
5第二遍独立确认
- [ok] 变量数与声明一致性(frontmatter 自称 9 variables) — 脚本实测:SKILL.md 变量表 9 行、html data-composition-variables 解析出 9 项、frontmatter 写 9 —— 一致。
- [ok] 外链清单与 SKILL.md 声称一致 — html 命中三处 jsdelivr(gsap、clipper-lib、three importmap + addons 前缀),与 SKILL.md 的 External runtime dependencies 逐项对应。
- [ok] 字体加载路径 — 字体经 assetUrl("assets/fonts/Geist-Bold.ttf") 取回;assets/fonts/ 三枚 ttf 与 OFL 文本都在盘上,registry-item 也全列(6/6 文件存在)。
- [ok] 种子化声称 — mulberry32 定义与两个常数种子(20260824 / 20260831)逐字命中;全文 grep Math.random / Date.now / requestAnimationFrame 零命中。
- [ok] 双画布与 Studio 解析器约束 — 静态 markup 中无 <canvas>;两块 canvas 由 forEach 在运行时创建(wpt-three / wpt-warp),与 SKILL.md 编辑纪律第 2 条一致。
- [ok] 首帧预热的理由是否成立 — html 注释给出可核查的理由(t=0 传送门关闭、不绘制 → 首次真绘制会链接全部 shader),且代码确在注册时间线后按 tl.time() 预绘一遍。
6结论
适合:需要「科技感线框 + 传送门揭示 + 二段文案」的标题卡(8s),例如发布会主题词 → 行动短语的镜头。
不适合:要求零外链离线渲染且不愿本地化三个 CDN 脚本的流水线;标题超过 18 字符、需要长句排印的场合。
安装 agent 直装可复制
① 本站镜像 更新 2026-09-28
方式 A · 人下载镜像包下载 wireframe-portal-title.tar.gz
sha256:
方式 B · JSON 格式安装指南,复制给 agent7c548c8702b7c0cf…agent 读 JSON 指南后会自动从本站下载安装,无需更多说明。
② 上游 GitHub · 原始来源
来源信息 GitHub 原始
作者 / 仓库heygen-com / heygen-com/hyperframes
原始 GitHubheygen-com/hyperframes ↗
Stars44283
最近推送2026-09-06
本 skill commit
d2f0bc7f34许可Apache-2.0(仓库根 LICENSE = Apache License Version 2.0;块内随带第三方许可文本:three.js MIT、GSAP 标准许可、Geist/Archivo/Cormorant Garamond OFL 等)
本站信息
收录日期2026-09-06
分类内容创作
侦查报告AI 侦查 · 2 遍 · 2026-09-06
本站镜像与 GitHub 原始是不同来源:本站锁定 commit 快照经 /r2 分发;GitHub 为实时上游,内容可能已更新。