hyperframes-core
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseHyperFrames Core
HyperFrames Core
HyperFrames renders video from HTML. A composition is an HTML file whose DOM declares timing with attributes, whose animation runtime is seekable, and whose media playback is owned by the framework.
data-*This skill is the technical contract — how to build one hyperframes project. The body below is the build guide; per-topic detail lives in (index next), read on demand. Other concerns live in the sibling domain skills — , , , , . The capability map in says what each one covers.
references/hyperframes-animationhyperframes-creativehyperframes-mediahyperframes-clihyperframes-registry/hyperframesHyperFrames 从 HTML 渲染视频。Composition(合成)是一个 HTML 文件,其 DOM 通过 属性声明时间信息,动画 runtime(运行时)支持 seek(定位),媒体播放由框架掌控。
data-*本 Skill 是技术契约——说明如何构建一个 HyperFrames 项目。以下正文是构建指南;各主题的详细说明位于 (接下来是索引),可按需阅读。其他关注点由同级领域 Skill 负责——、、、、。 中的能力映射说明了每个 Skill 的覆盖范围。
references/hyperframes-animationhyperframes-creativehyperframes-mediahyperframes-clihyperframes-registry/hyperframesReferences
参考资料(References)
| File | Read it to… |
|---|---|
| start from the smallest renderable composition skeleton |
| choose monolithic vs modular; structure a modular |
| look up any |
| pick |
| wire a sub-composition (host attrs, |
| declare variables; place |
| build a seekable timeline; determinism bans; the animatable-property allowlist; layout / text fit |
| author full-frame motion with shared backgrounds |
| author a |
| author the optional |
| map subagent dispatch verbs (parallel fan-out / background / wait) to your harness |
| work in a Tailwind v4 project ( |
For animation runtime specifics (GSAP API, Lottie, Three.js, etc.) go to → .
hyperframes-animationadapters/<runtime>.md| 文件 | 阅读它以… |
|---|---|
| 从最小可渲染 Composition 骨架开始 |
| 在单体与模块化之间选择;搭建模块化 |
| 查找任意 |
| 选择 |
| 连接 sub-composition(host 属性、 |
| 声明变量;放置 |
| 构建可 seek 的时间轴;确定性禁用项;可动画属性允许列表;布局 / 文本适配 |
| 使用共享背景创作全屏运动 |
| 编写 |
| 编写可选的 |
| 将 subagent 调度动词(并行 fan-out / background / wait)映射到你的 harness |
| 在 Tailwind v4 项目中工作( |
有关动画 runtime 的具体内容(GSAP API、Lottie、Three.js 等),请转到 → 。
hyperframes-animationadapters/<runtime>.mdBuilding a composition
构建 Composition
Two root forms (not interchangeable)
两种根形式(不可互换)
- Standalone (top-level ) — root
index.htmlsits directly in<div data-composition-id="…">, no<body>wrapper (wrapping it hides all content and breaks rendering).<template> - Sub-composition (loaded via ) — root must be wrapped in
data-composition-src.<template>
⚠ Transport rule: the runtime only clonescontents; everything outside (incl.<template>styles/scripts) is discarded — put<head>/<style>inside the template. ⚠ Host-id rule: the host slot's<script>must exactly equal the inner template'sdata-composition-idand thedata-composition-idkey — nowindow.__timelines["<id>"]/-mount/-slotsuffix.-host
File shape, host wiring, and the pre-render checklist → .
references/sub-compositions.md- Standalone(顶层 )——根
index.html直接位于<div data-composition-id="…">中,不得使用<body>包装(包装后会隐藏所有内容并导致渲染失败)。<template> - Sub-composition(通过 加载)——根元素必须用
data-composition-src包装。<template>
⚠ 传输规则:runtime 只克隆的内容;外部的所有内容(包括<template>中的样式/脚本)都会被丢弃——请将<head>/<style>放在 template 内部。 ⚠ Host-id 规则:host 插槽的<script>必须与 template 内部的data-composition-id完全一致,并且必须与data-composition-id的 key 完全一致——不能添加window.__timelines["<id>"]/-mount/-slot后缀。-host
文件结构、host 连接方式和预渲染检查清单 → 。
references/sub-compositions.mdRoot must be sized (silent layout bug)
根元素必须有明确尺寸(静默布局错误)
The standalone root needs an explicit sized box (/ in px), and every ancestor down to a element must have a resolved height — otherwise a flex/ child collapses to ~0 and content piles into the top-left corner. // do not catch this. Skeleton → .
widthheightheight:100%100%lintvalidateinspectreferences/minimal-composition.mdStandalone 根元素需要一个明确设有尺寸的盒子(/ 使用 px),并且从根元素到 元素这一路径上的每个祖先元素都必须具有已解析的高度——否则 flex/ 子元素会塌缩到约 0,内容会堆叠在左上角。// 无法检测到这个问题。骨架 → 。
widthheightheight:100%100%lintvalidateinspectreferences/minimal-composition.mdOne paused timeline
一个暂停的时间轴
Each composition registers exactly one at (key = root ), built synchronously at page load. Render duration = root , not timeline length. Don't manually nest sub-timelines into the host. Full contract (incl. non-GSAP runtimes) → + .
gsap.timeline({ paused: true })window.__timelines["<id>"]data-composition-iddata-durationreferences/determinism-rules.mdhyperframes-animation/adapters/每个 Composition 必须在 注册恰好一个 (key = 根元素的 ),并在页面加载时同步创建。渲染时长 = 根元素的 ,而不是时间轴长度。不要手动将子时间轴嵌套到 host 中。完整契约(包括非 GSAP runtime)→ + 。
window.__timelines["<id>"]gsap.timeline({ paused: true })data-composition-iddata-durationreferences/determinism-rules.mdhyperframes-animation/adapters/Non-negotiable rules (silent bugs lint
/validate
/inspect
won't catch)
lintvalidateinspect不可协商的规则(lint
/validate
/inspect
无法发现的静默错误)
lintvalidateinspectSurfaced here; full rationale in the linked reference. Do not violate:
- No render-time clocks / unseeded / network / input-state; no
Math.random(use a finite count). →repeat: -1determinism-rules.md - Animate only the visual-property allowlist; never /
display; novisibilityon later-scene clips. →gsap.setdeterminism-rules.md - No in body text; transformed elements must be block-level + sized; pulsing absolute decoratives need peak clearance. →
<br>determinism-rules.md - /
<video>must be a direct child of the host root (never inside a sub-comp<audio>/wrapper); the framework owns playback. →<template>variables-and-media.md - Every must be unique across the assembled page; inside a sub-comp, prefix ids with the composition id (
id). Duplicate#<id>-hero/<video>ids render blank — the producer injects frames by<img>, and cross-file dupes slip pastgetElementById. →lintcomposition-patterns.md - A full-screen scene fill goes on a full-bleed child (), never on the composition root itself — the producer's frame compositing can drop the root element's own
position:absolute; inset:0(the frame renders black) even though preview/backgroundshow it correctly. →snapshotcomposition-patterns.md
这里列出这些规则;完整原因见链接的参考文档。不得违反:
- 禁止使用渲染时时钟 / 未设定种子的 / 网络 / 输入状态;禁止
Math.random(请使用有限次数)。→repeat: -1determinism-rules.md - 只能动画化视觉属性允许列表中的属性;绝不能使用 /
display;不得对较后场景的 clip 使用visibility。→gsap.setdeterminism-rules.md - 正文文本中不得使用 ;带 transform 的元素必须是块级且具有尺寸;脉动的绝对定位装饰元素在峰值时必须留出足够空间。→
<br>determinism-rules.md - /
<video>必须是 host 根元素的直接子元素(绝不能放在 sub-composition 的<audio>/包装元素内);播放由框架掌控。→<template>variables-and-media.md - 每个 在组装后的页面中都必须唯一;在 sub-composition 内,使用 Composition id 作为 id 前缀(
id)。重复的#<id>-hero/<video>id 会渲染为空白——producer 通过<img>注入帧,而跨文件重复 id 能绕过getElementById。→lintcomposition-patterns.md - 全屏场景填充应放在铺满画面的子元素上(),绝不能放在 Composition 根元素自身上——producer 的帧合成可能会丢弃根元素自身的
position:absolute; inset:0(帧会渲染为黑色),即使 preview/background显示正确。→snapshotcomposition-patterns.md
Editing existing compositions
编辑现有 Composition
- Read the files first. Preserve unrelated timing, tracks, IDs, variables, media paths.
- Match existing composition IDs and timeline keys.
- Adding a clip: pick a non-overlapping or adjust surrounding timing intentionally.
data-track-index - Adding a sub-composition: verify its internal before wiring the host.
data-composition-id
- 先阅读相关文件。保留不相关的时序、轨道、ID、变量和媒体路径。
- 匹配现有 Composition ID 和时间轴 key。
- 添加 clip:选择不会重叠的 ,或有意识地调整周边时序。
data-track-index - 添加 sub-composition:连接 host 前,先验证其内部 。
data-composition-id
Validation
验证
Use for command details
hyperframes-cli- passes (0 errors)
npx hyperframes lint - passes (0 console errors)
npx hyperframes validate - passes (0 errors)
npx hyperframes inspect - Projects with sub-compositions: and eyeball each frame
npx hyperframes snapshot --at <midpoints> - for review (the user can edit anything in Studio's timeline)
npx hyperframes preview - only after the user approves
npx hyperframes render
有关命令详情,请使用
hyperframes-cli- 通过(0 个错误)
npx hyperframes lint - 通过(0 个控制台错误)
npx hyperframes validate - 通过(0 个错误)
npx hyperframes inspect - 包含 sub-composition 的项目:运行 ,并逐一检查每个帧
npx hyperframes snapshot --at <midpoints> - 使用 审阅(用户可以在 Studio 的时间轴中编辑任何内容)
npx hyperframes preview - 仅在用户批准后运行
npx hyperframes render