code-slice-hero
它能做什么
这是一个现成的 HyperFrames 标题模块,带有分块的三维表面效果。适合希望制作现代、动态标题揭示效果并可自行定制的视频制作者。
适用场景
- ✓当你希望标题通过分块翻转显示出第二条信息时。
- ✓当你需要一个带有纵深感和光影运动的现代标题场景时。
- ✓当你希望有一个可以用自己的文字和时序调整的现成模块时。
技能链接
https://github.com/heygen-com/hyperframes/blob/main/registry/blocks/code-slice-hero/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请把分块翻转标题用于我的产品发布,并替换成我的标题文字。”
每周 5 个新技能,1 分钟读完。
工作原理
该模块以可编辑的源文件形式安装。一个跟随光标的效果会抬起并倾斜附近的方块,只有标题下方的方块会翻转,显示第二条信息。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Code Slice Hero
A full square-tile surface carries one seamless headline. An imaginary cursor crosses the surface; nearby tiles respond to its Gaussian depth field with lift and tilt, and only the cells intersecting either headline silhouette turn over to reveal the rear headline. The whole grid is one instanced WebGL 2 draw with a shared front/rear texture pair, plus a batched projected-shadow pass. Copy, text size and square cell size are independent, so tiles never stretch. Sweep direction, easing strength, cursor radius, falloff, depth, bounce and shadow are all variables.
Composition id: code-slice-hero. Duration 8 s at 30 fps, 1920×1080.
Files
code-slice-hero.html(24 KB)assets/Geist-Bold.ttf(65 KB)assets/Geist-OFL.txt(4 KB)assets/gsap-3.14.2.min.js(128 KB)assets/GSAP-NOTICE.txt(1 KB)shadows.js(10 KB)surface.js(8 KB)
Install
Install with npx hyperframes add code-slice-hero; by default the files above land under compositions/code-slice-hero/. Then mount the block from the host index.html:
<div
data-composition-id="code-slice-hero"
data-composition-src="compositions/code-slice-hero/code-slice-hero.html"
data-start="0"
data-duration="8"
data-track-index="1"
data-width="1920"
data-height="1080"
></div>
Render with custom values by targeting the composition file directly:
npx --yes hyperframes@0.8.12 render 'compositions/code-slice-hero/code-slice-hero.html' --variables '{"headline":"MAKE IT","reverseHeadline":"MATTER."}'
Variables
Read at runtime via window.__hyperframes.getVariables(); declared on the composition root as data-composition-variables (single-quoted attribute, plain JSON).
| id | type | default | label / range |
| ------------------- | ------ | ----------------- | ------------------------------------------------- | -------------- |
| headline | string | "MAKE IT" | Copy · Front headline max 32 chars |
| reverseHeadline | string | "MATTER." | Copy · Rear headline max 32 chars |
| direction | enum | "left-to-right" | Motion · Sweep direction (left-to-right | right-to-left) |
| sweepDuration | number | 4.2 | Motion · Sweep duration 2.6–4.5 step 0.05 |
| sweepEaseStrength | number | 3 | Motion · Sweep easing strength 0–3 step 0.05 |
| flipDuration | number | 0.75 | Motion · Each tile flip 0.65–1.65 step 0.05 |
| cursorRadius | number | 210 | Cursor · Influence radius 160–480 step 10 |
| cursorFalloff | number | 1.4 | Cursor · Influence falloff 0.4–3.5 step 0.05 |
| cursorDepth | number | 80 | Cursor · Depth (+ toward camera) -320–320 step 10 |
| tiltStrength | number | 55 | Cursor · Pull / tilt strength 0–55 step 1 |
| noiseStrength | number | 2 | Motion · Organic variation 0–2 step 0.05 |
| flipBounce | number | 0.15 | Motion · Elastic flip bounce 0–0.8 step 0.05 |
| cellSize | number | 112 | Slices · Square cell size 24–120 step 4 |
| formationScale | number | 1 | Slices · Local formation scale 0.94–1 step 0.001 |
| fontSize | number | 310 | Type · Maximum size 160–480 step 5 |
| behindColor | color | "#212121" | Surface · Behind-tile background |
| shadowStrength | number | 0.19 | Surface · Cast shadow strength 0–0.65 step 0.01 |
| shadowSoftness | number | 4 | Surface · Cast shadow softness 0.5–4 step 0.1 |
Runtime contract
- One paused GSAP timeline registered as
window.__timelines["code-slice-hero"]. - Re-syncs on the
hf-seekCustomEvent; every frame is a closed-form function of time (seeded PRNG only, no rAF loops, no Date.now). - Renderer: GSAP, Canvas 2D, Seeded PRNG.
- External runtime dependencies: none (served locally).
- Local fonts: assets/Geist-Bold.ttf.
Editing rules (from the source project)
- Keep
data-composition-variablesa single-quoted attribute with plain"JSON. Never save it through Studio's Design panel. - Do not put
<canvas>in static markup; create it at runtime. - Keep every visual state
常见问题
这个场景有多长?
场景时长为 8 秒,每秒 30 帧,分辨率 1920 × 1080。
我更改文字时,文字会被拉伸吗?
不会。文字大小和方块大小是分别设置的,因此方块保持正方形。
我能调整什么?
你可以修改文案、文字大小、扫过方向、光标半径、深度和阴影等设置。
详情
作者的原始描述
A tiled headline surface flips cell by cell under a sweeping depth field to reveal the rear headline. HyperFrames block, 1920×1080, 8s, 18 variables.
repo: heygen-com/hyperframes
热度
- GitHub 星标
- 78k
- 排名
- #1733
- 许可证
- Apache-2.0
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
captions-overlay
78k指导你的智能体以叠加方式为视频添加字幕,决定哪些口播内容需要删除、放在字幕条上,或作为重点突出显示。
cut-the-curve
78k教你的智能体使用 HyperFrames 视频中的转场效果,例如流畅的场景切换、推进式穿越和错落的文字入场。
motion-doctrine
78k为你的智能体提供核心规则,使多场景视频像一个连续的镜头移动,而不是一张张分开的幻灯片。
oversized-cursor
78k教你的智能体在视频中加入一个大号的动画指针,引导观众的视线,并让点击看起来像是引发了下一步动作。