1仕組みと動作原理
出力ショット:正方形タイルの全面がシームレスな前面見出しを保持し、仮想カーソルが表面をスイープすると、付近のタイルがガウス深度場に従って浮き上がり傾斜し、両方の見出しの輪郭と交差するセルだけが反転して背面見出しを露出させます。
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.
レンダリング実装は「1回の instanced WebGL 2 draw」+ 前後見出し共有アトラス + 一括投影シャドウパスで構成。これは「タイルごとのDOM/個別要素」アプローチの対極にあり、本ブロックが30fpsで安定動作する理由です。
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.
18個の変数はすべて clamp を経由して読み込み:まずスキーマをパースしてデフォルト値を取得し、getVariables() で上書きした上で、数値型は宣言された区間に1つずつクランプし、不正な値はデフォルトにフォールバックします。
const values = { ...defaults, ...(window.__hyperframes?.getVariables?.() || {}) }; … const clamp = (v, a = 0, b = 1) => Math.max(a, Math.min(b, v));
見出しアトラスは実行時に Canvas 2D(willReadFrequently コンテキスト)で動的に描画され、前後の見出しで一対のアトラスを共有します。
function textSurface(text) { … const canvas = document.createElement("canvas"); … const ctx = canvas.getContext("2d", { willReadFrequently: true });
WebGL2 が必須要件:webgl2 コンテキストを取得できない場合はサイレントにフォールバックせず、即座にエラーをスローします。
if (!gl) throw new Error("Code Slice Hero requires WebGL 2 for its full tile surface.");
決定論的コントラクトファミリーに準拠:paused タイムラインを window.__timelines["code-slice-hero"] に登録し、hf-seek で再同期。各フレームは t の閉形式関数となります。
One paused GSAP timeline registered as `window.__timelines["code-slice-hero"]`. … 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コア機能
3外部依存関係
| Kind | Dependency / Endpoint |
|---|---|
| cli | HyperFrames 官方 CLI(add / render) |
| package | GSAP 3.14.2(随块本地副本,非 CDN) |
| package | Geist-Bold.ttf(OFL)与 GSAP-NOTICE.txt 随块分发;本目录无任何网络依赖 |
4推奨統制措置と判定根拠
- scripts/: ローカルスクリプトまたはコマンドの実行: code-slice-hero.html(ブラウザ/レンダラー側実行:変数をパース → 前後テキストアトラスを生成 → paused GSAP タイムラインを登録 → h をリッスン
5二重目の独立検証
- [ok] 变量数与声明一致性(frontmatter 自称 18 variables) — 脚本实测:SKILL.md 变量表 18 行、html data-composition-variables 解析出 18 项、frontmatter 写 18 —— 一致。
- [ok] 「External runtime dependencies: none (served locally)」声称 — 对 html/shadows.js/surface.js 做 http(s):// 全文 grep:零命中;脚本标签只引用 assets/gsap-3.14.2.min.js 与同目录两个模块,字体为本地 Geist-Bold.ttf。
- [ok] WebGL2 硬门槛 — surface.js 中 `if (!gl) throw new Error("Code Slice Hero requires WebGL 2 for its full tile surface.");` 逐字命中,确为显式失败而非静默降级。
- [ok] registry-item 文件清单 vs 盘上文件 — 声明 8 个文件(含 shadows.js / surface.js / 字体 / 两份许可文本)全部存在于盘上,无远端 url 兜底。
- [ok] 无随机/时钟依赖 — 本目录 grep Math.random、Date.now、performance.now、requestAnimationFrame:零命中(确定性由 SKILL.md 的 Runtime contract 声明)。
- [ok] 阴影 pass 的自述与代码相符 — shadows.js 首行注释与实现一致:固定 light 向量、按 bucketSize 空间分桶、单次额外 GPU draw;非 three 阴影系统。
6結論
f4df15e71090b458…