cuboid-carousel
A chain of bevelled cuboids rides a travelling wave as a content carousel. HyperFrames block, 1920×1080, 6.666666666666667s, 40 variables.
1How It Works & Mechanism
Output shot: Bevelled cuboids enter as "cards" flying in from the right as a whole, exhibit staggered rotations during transit, decelerate to a hero stop, and exit to the left—forming a travelling-wave-style 3D carousel.
Rounded, bevelled cuboids carrying card content fly in from the right as one rigid group, cruise with a per-cuboid rotation stagger, decelerate to a hero hold, then exit left.
Layout safety is geometrically derived: Spacing is computed from cuboid dimensions and "maximum achievable X half-span," ensuring cuboids never overlap—a structural guarantee rather than manually tweaked values.
Spacing is derived from the cuboid dimensions and the largest reachable X half-extent, so cuboids can never overlap.
The widest parameter surface in this batch: 40 variables follow the original DialKit schema, covering geometry, materials, lighting, shadows, background, camera, as well as durations and easings for each phase.
Forty variables carry the original DialKit schema: geometry, materials, lights, shadows, backdrop, camera and every segment duration and easing.
Dependencies are essentially localized: importmap points to bundled three.module.min.js, addons/, and a 593 KB motion data module cuboid-motion.js; the only external runtime URL is Inter from Google Fonts.
"three": "./assets/three.module.min.js", … "cuboid-carousel/motion": "./assets/cuboid-motion.js" … href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500&display=swap"
Card content is rendered dynamically onto face textures via 2D canvas, sourced either from built-in lists or the cardsJson variable—eliminating the strict need for image assets when changing content.
function faceTexture(item) { … const c = document.createElement("canvas");
Timeline features named segments and pause semantics: gsap.timeline({ paused: true }) with arrival / alternate-camera labels, where seek is driven by hf-seek events for resynchronization and redraws.
/* ---- timeline: paused, seek-safe, no rAF ---- */ … const tl = gsap.timeline({ paused: true }); … tl.addLabel("arrival", 0);
Two warmup stages ensure first-frame quality and stability: Prior to ready, it runs renderAt(0) and "draws across the timeline once and flushes the GPU," alongside a one-off setInterval polling __timelines registration completion.
Draw across the timeline and flush the GPU before ready, so shader links … var tick = setInterval(function () { … if (!ids.length) return; … clearInterval(tick);
2Core Capabilities
3External Dependencies
| Kind | Dependency / Endpoint |
|---|---|
| cli | HyperFrames 官方 CLI(add / render) |
| package | three.js 与 addons(随块本地副本;PMREM/RoomEnvironment 造环境光) |
| package | GSAP 3.14.2(随块本地副本)+ 本地运动数据模块 |
| network | Google Fonts:Inter(产物期浏览器拉取,本块唯一外链) |
4Recommended Governance & Evidence
- scripts/: Execute local script or command: cuboid-carousel.html (executed in browser/renderer: reads variables → builds three scene and card textures → registers paused timeline)
- 网络端点: Declare external network access: fonts.googleapis.com / fonts.gstatic.com (runtime: Inter font; the only external endpoint in this block)
5Second-Pass Verification
- [ok] 变量数与声明一致性(frontmatter 自称 40 variables) — 脚本实测:SKILL.md 变量表 40 行、html data-composition-variables 解析出 40 项、frontmatter 写 40 —— 一致。
- [ok] 「no rAF」注释 vs 代码里的 setInterval — 该 setInterval 是一次性的就绪轮询(等 __timelines 出现后立即 clearInterval),不是渲染循环;时间线注释也确写 seek-safe, no rAF。两者不冲突。
- [ok] 外链清点 — html 全文 http(s):// grep 仅命中三处 Google Fonts(preconnect ×2 + css2?family=Inter);three/gsap/运动数据均为 ./assets/ 本地路径。
- [ok] registry-item 文件清单 vs 盘上文件 — 声明 10 个文件全部存在于盘上(含两个 addons 与两份许可文本),无远端 url 兜底。
- [ok] 几何安全声称 — SKILL.md 明写间距由尺寸与最大 X 半展推导;html 中 cuboidWidth/Height/Depth/cornerRadius/bevel/smoothness 均按 DialKit 区间读取(变量段注释写 every one clamped to the DialKit range)。
- [ok] 时长一致性 — registry-item duration 6.67、html data-duration 6.666666666666667、SKILL.md 标题行 6.666666666666667s —— 前两者为同一精度的两种写法。
6Verdict & Scenarios
fc159be9ba802332…