deck-magazine-web
Digital magazine × E-ink aesthetic, WebGL fluid background + serif display
1How It Works & Mechanism
Horizontal slide switching is implemented as "a single flex track + translateX(-idx*100vw)": all slides are placed side by side, and paging only alters the transform with a 700ms transition. This is smoother than toggling display page by page and provides greater leeway for touch-dragging.
deck.style.transform = 'translateX(' + (-idx * 100) + 'vw)';
The navigation model is explicitly declared as borrowed from the guizang-ppt template in the same repository (identical flex track + translateX, identical key/wheel/touch handlers), indicating that this template is a reskin built atop an existing implementation.
* Navigation model is borrowed from skills/guizang-ppt — same flex
The typographic language originates from the kami design system: comments specify the adoption of kami tokens (warm parchment background, ink blue accent, single-weight serif, no italics), magnifying macro tokens by ~1.6× and tightening letter spacing by ~0.6× relative to the print baseline.
* tokens are scaled × ~1.6 vs. print baseline; letter-spacing scaled
Explicit contract with the host: comments note that .slide.active is read by Open Design's host bridge (findActiveByClass in src/runtime/srcdoc.ts) to drive page numbering. No CSS rules reference it, and it is marked as load-bearing and not to be deleted.
/* load-bearing: .slide.active is read by Open Design's host bridge
Interactions feature a throttle lock: go(n) returns immediately when lock is true; only wheel/key/touch interactions go through throttle, whereas programmatic synchronization (host messages, restoring initial page) bypasses the lock—preventing rapid inputs from queueing consecutive page transitions during a single 700ms transition.
function go(n) {
Slide types are annotated with data-slide-kind (cover / chapter / content / stats / quote / cta / end). The 9-slide example covers cover, chapter divider, body content, big stat callout, pull quote, CTA, and end slides—faithfully fulfilling the layout checklist in SKILL.md.
<section class='slide s-stats' data-slide-kind='stats'>
Both the "big stat callout slide" and "pull quote slide" are showcased in the example: the stats slide features a giant number accompanied by an explanatory phrase, while the quote slide employs a Sunday-paper style quote layout.
<section class='slide s-quote' data-slide-kind='quote'>
Runtime execution is handled by the host: the template directory contains no standalone script files; the prompt is assembled by the host and passed to the local agent CLI. The JS in the example belongs strictly to the generated artifact content.
import { spawn, type ChildProcessWithoutNullStreams } from "node:child_process";
2Core Capabilities
3External Dependencies
| Kind | Dependency / Endpoint |
|---|---|
| network | Google Fonts(Source Serif 4 / Source Sans 3 / JetBrains Mono) |
| network | Google Fonts 静态域(preconnect 预连接) |
| network | 产物示例 CTA 页的 GitHub 外链(指引用户去项目仓库 Star / 提 issue) |
| network | 宿主共享指令声明的 Tailwind CDN(宿主侧要求,非本模板要求) |
4Recommended Governance & Evidence
- SKILL.md: Pure prompt instructions and rule text; contains no script execution or external side effects
5Second-Pass Verification
- [discrepancy] 「WebGL 流体背景」是否存在于示例 — 不存在。example.html 内 canvas / getContext / WebGL / shader 关键字计数为 0(文件里唯一 <script> 是翻页逻辑),封面是暖羊皮纸底 + 墨蓝章节页的静态排版。SKILL.md 的「WebGL 流体背景」在示例中未落地,属描述超出现有预览稿(宿主共享指令也禁止引用外部图片、优先 CSS/SVG 内联,实际生成时是否引入 WebGL 取决于模型与所加库)。
- [discrepancy] 「键盘 ← / → 切换; hash 同步」是否兑现 — 键盘兑现(方向键 / PageUp / PageDown / 空格 / Home / End 全套 + Escape 总览);但示例脚本内没有 location.hash 读写,「hash 同步」这条在示例中未实现(截图与核对范围内未发现 hashchange 监听)。
- [ok] 导航是否真有节流 — go(n) 在 lock 为真时直接 return;滚动 / 键盘 / 触摸走 throttle,程序化同步绕过锁(注释说明原因)。
- [ok] 与宿主的 .slide.active 契约是否存在 — 注释声明 host bridge(src/runtime/srcdoc.ts findActiveByClass)读取该 class 驱动页码,并标注 load-bearing;宿主 deck.ts 亦按 <section class="slide"> 约定解析。
- [ok] 目录内是否有脚本文件 / 凭证读取 / 写盘 — 目录仅 SKILL.md + example.html 两个文件,无独立脚本文件;示例 JS 不读取 env / 凭证、不写盘、无 fetch/XHR 请求(唯一外链是 <link> 字体与 CTA 的 <a href>)。
- [ok] pin commit 与路径 — HEAD = 553ed98c283f9c0f489902d035416a972d6a9699;skill.path = next/src/lib/templates/skills/deck-magazine-web,含 SKILL.md。
- [ok] README 收录一致性 — README deck 表列出 deck-magazine-web(Magazine-style web deck),与目录内容相符。
6Verdict & Scenarios
44c08bb9682d2bdc…