diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f7cf2db --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.DS_Store +*.backup diff --git a/README.en.md b/README.en.md index 737013e..a94c597 100644 --- a/README.en.md +++ b/README.en.md @@ -1,6 +1,11 @@ -# Magazine Web PPT · Editorial-Style Web Slide Deck Skill +# Guizang PPT Skill · Web Decks / Images / Covers -An agent skill for Claude Code, Codex, and similar coding-agent environments. It generates **single-file HTML horizontal-swipe decks** with an "**editorial magazine × electronic ink**" aesthetic — picture *Monocle* with code stitched in. +An agent skill for Claude Code, Codex, and similar coding-agent environments. It generates **single-file HTML horizontal-swipe decks**, deck visuals, and social cover pages. + +It ships with two visual systems: + +- **Style A: editorial magazine × electronic ink**. Picture *Monocle* with code stitched in. Best for narrative talks, opinions, salons, and personal voice. +- **Style B: Swiss International Typographic Style**. Grid-first, one high-saturation anchor color, sharp rectangles, hairline rules, and extreme type contrast. Best for facts, products, analysis, and frameworks. > Distilled by [Guizang](https://x.com/op7418) from offline talks like "One-Person Company: Organizations Folded by AI" and "A New Way of Working." Every pitfall hit during those decks is logged in `checklist.md`. @@ -8,12 +13,14 @@ An agent skill for Claude Code, Codex, and similar coding-agent environments. It ## What you get -- 🖋 **Three-tier type system**: serif for headlines, sans-serif for body, mono for metadata -- 🌊 **WebGL fluid / dispersion backgrounds** — visible on hero pages, restrained on body pages +- 🖋 **Two visual systems**: editorial storytelling for Style A, factual Swiss structure for Style B - 📐 **Horizontal swipe navigation**: ← → arrows / scroll wheel / touch swipe / bottom dots / ESC for index -- 🎨 **5 curated theme presets**: Ink Classic / Indigo Porcelain / Forest Ink / Kraft Paper / Dune -- 🧩 **10 page layouts**: cover, act divider, big numbers, lead image + text, image grid, pipeline, hero question, big quote, before/after, image + text mix -- 🖼 **Optional Codex image flow**: generate documentary photos, infographics, flow diagrams, system maps, and UI scenes with GPT-M 2.0, then insert them at template-safe ratios +- 🧩 **Style A 10 layouts**: cover, divider, big numbers, image/text, image grid, pipeline, comparison, and more +- 🧱 **Style B 22 locked layouts**: Cover, Statement, KPI Tower, Loop Diagram, Duo Compare, Image Hero, Closing Manifesto, and more +- 🎨 **Curated theme presets**: 5 electronic-ink themes for Style A, 4 Swiss anchor-color themes for Style B +- 🖼 **Optional Codex image flow**: generate documentary photos, infographics, flow diagrams, system maps, and UI scenes with GPT-Image 2.0 / GPT-M 2.0, then insert them at template-safe ratios +- 📰 **Social covers**: generate 21:9 WeChat cover images, 1:1 share cards, 3:4 Xiaohongshu covers, video thumbnails, and related variants +- 📴 **Low-power static mode**: press `B` to turn WebGL / canvas animation into static visuals - 📄 **Single HTML file** — no build, no server, open directly in the browser ## Fits / Doesn't fit @@ -52,24 +59,46 @@ git clone https://github.com/op7418/guizang-ppt-skill.git ~/.claude/skills/guiza Once installed, Claude Code auto-detects the skill. Trigger phrases: - "Make me a magazine-style deck" +- "Make me a Swiss-style deck" - "Generate a horizontal swipe deck" - "Editorial magazine style presentation" - "Electronic ink slides for my talk" +- "Create a 21:9 WeChat cover from this article" +- "Create a 1:1 share card from this deck" ## Workflow The skill is a structured workflow; the agent walks you through each step: -1. **Clarify intent** — 6-question checklist: audience, duration, source material, images, theme, hard constraints -2. **Copy template** — `assets/template.html` → project folder, update ``, swap theme vars -3. **Fill content** — pick from 10 layout skeletons, paste, edit copy (with class-name pre-flight + theme rhythm plan) -4. **Optional image generation** — in Codex, ask whether to use GPT-M 2.0 images, then insert them at page-appropriate ratios -5. **Self-check** — match against `references/checklist.md`; P0 issues must all pass -6. **Preview** — open the HTML in a browser -7. **Iterate** — use inline styles to tune font size, height, spacing +1. **Choose style** — Style A editorial magazine, or Style B Swiss International +2. **Clarify intent** — 6-question checklist: audience, duration, source material, images, theme, hard constraints +3. **Copy template** — Style A uses `assets/template.html`; Style B uses `assets/template-swiss.html` +4. **Fill content** — create a rhythm plan, then choose and adapt the matching layout skeletons +5. **Optional image generation** — in Codex, ask whether to use GPT-Image 2.0 / GPT-M 2.0 images, then insert them at page-appropriate ratios +6. **Self-check** — match against `references/checklist.md`; P0 issues must all pass; Swiss decks must also pass the layout validator +7. **Preview** — open the HTML in a browser +8. **Iterate** — use inline styles to tune font size, height, spacing Full spec in [`SKILL.md`](./SKILL.md). +## Style B Swiss + +The Swiss theme is a strict layout system, not just a CSS skin. + +- **22 named layouts**: body slides must use `S01` to `S22`; do not invent new structures +- **4 anchor colors**: International Klein Blue, lemon yellow, lemon green, safety orange +- **Grid lock**: 16-column grid, sharp rectangles, 1px hairlines, no shadows, no gradients, no rounded cards +- **Chinese title scaling**: all-Chinese headlines should be one step smaller to preserve space for content and images +- **Image/text bottom alignment**: text and image blocks should align at the bottom in left/right image layouts, while staying clear of pagination controls +- **Image slots**: images must sit in template-defined `data-image-slot` regions, often generated at 21:9 or 16:10 +- **Hard validation**: the validator catches centered body titles, experimental layouts, visible SVG text, and images placed outside slots + +Swiss validation: + +```bash +node scripts/validate-swiss-deck.mjs path/to/index.html +``` + ## Codex Image Flow In Codex, after the first deck draft is ready, the agent can ask whether the user wants generated visuals. Once confirmed, choose an image type or style. Common types include: @@ -77,11 +106,27 @@ In Codex, after the first deck draft is ready, the agent can ask whether the use - Documentary photos: Fuji / Leica-like real-world scenes that add human texture - Infographics / flow diagrams / comparison charts / system maps: for concepts that cannot be explained well with photos - Screenshot redesigns / UI scenes: reshape raw screenshots into consistent slide-friendly ratios and visual density +- Data posters / charts: turn key numbers into insert-ready visual assets +- Multi-image compositions: useful for ultra-wide slots where three unrelated 16:9 images would break the grid -Generated images must follow two core rules: +Generated images must follow three core rules: - Treat the image as an embedded asset, not a standalone slide: no footer, page bottom, title, page number, corner mark, signature, or decorative border -- Match the slot ratio before generation: 16:9 / 16:10 for main visuals, 16:10 for UI scenes, fixed equal heights for image grids +- Match the deck language: Chinese decks use Chinese labels inside infographics, English decks use English labels +- Match the slot ratio before generation: 21:9 for many Swiss hero slots, 16:9 / 16:10 for common main visuals, 16:10 for UI scenes, fixed equal heights for image grids + +Image prompts live in [`references/image-prompts.md`](./references/image-prompts.md). + +## Cover Generation + +The skill can also turn an article or deck idea into platform covers: + +- **WeChat main cover**: 21:9, headline-first, with one visual anchor +- **WeChat share card**: 1:1, visually paired with the 21:9 cover +- **Xiaohongshu cover / carousel**: 3:4, large title, consistent type scale across a batch +- **Video thumbnail**: 16:9, title + subtitle + one focal visual + +The same rule applies: use a few strong keywords, keep the title as the visual center, and do not fill the canvas with body copy. ## Directory @@ -91,12 +136,18 @@ guizang-ppt-skill/ ├── README.md ← Chinese README ├── README.en.md ← this file ├── assets/ -│ └── template.html ← runnable seed HTML (CSS + WebGL + swipe JS pre-wired) +│ ├── template.html ← Style A editorial magazine template +│ └── template-swiss.html ← Style B Swiss template +├── scripts/ +│ └── validate-swiss-deck.mjs ← Swiss layout validator └── references/ ├── components.md ← component catalog (type, color, grid, icons, callout, stat, pipeline) ├── layouts.md ← 10 layout skeletons (paste-ready) + ├── layouts-swiss.md ← 22 locked Swiss layouts + ├── swiss-layout-lock.md ← Swiss fidelity and layout hard rules ├── themes.md ← 5 theme presets (pick, don't customize) - ├── image-prompts.md ← GPT-M 2.0 image types, ratios, and base prompts + ├── themes-swiss.md ← 4 Swiss anchor-color themes + ├── image-prompts.md ← GPT-Image 2.0 / GPT-M 2.0 image types, ratios, and base prompts └── checklist.md ← quality checklist (P0 / P1 / P2 / P3 tiers) ``` @@ -114,6 +165,19 @@ Pick from `references/themes.md`. **Custom hex values are not allowed** — prot Switching themes only requires replacing the 6 variables at the top of `template.html`'s `:root{}` block — all other CSS flows through `var(--...)`. +### Style B Swiss Themes + +Pick from `references/themes-swiss.md`. **Custom hex values are not allowed** here either. + +| Theme | Best for | +|------|---------| +| International Klein Blue | default, commercial launch, AI products, frameworks | +| Lemon Yellow | youth, sports, retail, Y2K retro | +| Lemon Green | ecology, sustainability, Gen Z brands | +| Safety Orange | alerts, news, energetic topics | + +If the user asks for a Swiss-style deck without specifying color, default to International Klein Blue. + ## Core design principles 1. **Restraint over flash** — WebGL backgrounds only bleed through on hero pages @@ -121,12 +185,15 @@ Switching themes only requires replacing the 6 variables at the top of `template 3. **Images are first-class citizens** — align them with the body content area, keep ratios stable, crop only from the bottom, and preserve top/sides 4. **Generated visuals are assets** — keep only the core photo / chart / UI; do not render slide titles, footers, or corner marks inside the image 5. **Rhythm lives on hero pages** — hero / non-hero alternation keeps the eye from fatiguing -6. **Terms stay consistent** — Skills is Skills; no mix-and-match translations +6. **Dynamic effects must be optional** — `B` toggles static mode so animation never becomes a reading burden +7. **Terms stay consistent** — Skills is Skills; no mix-and-match translations +8. **Swiss layouts stay locked** — Style B should restore and reuse the original 22-page layout system instead of inventing unrelated pages ## Visual references - [*Monocle*](https://monocle.com) magazine layouts - YC Garry Tan — "Thin Harness, Fat Skills" +- Massimo Vignelli / Helvetica Forever / Swiss International Typographic Style - Guizang's offline talk deck series ## Contributing @@ -134,6 +201,8 @@ Switching themes only requires replacing the 6 variables at the top of `template Bugs, layout issues, new layout requests — Issues and PRs welcome. Prioritize: - Add new classes to `template.html` first; don't let `layouts.md` reference undefined classes +- When changing `template-swiss.html`, update `layouts-swiss.md` and `swiss-layout-lock.md` together +- When adding Swiss rules, update `scripts/validate-swiss-deck.mjs` - Log pitfalls into `checklist.md` at the matching P0 / P1 / P2 / P3 tier - New theme colors go into `themes.md` with a recommended use case diff --git a/README.md b/README.md index 244b111..77f2244 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,13 @@ -# Magazine Web PPT · 电子杂志风网页 PPT Skill +# Guizang PPT Skill · 网页 PPT / 配图 / 封面 > 🌏 **English version: [README.en.md](./README.en.md)** -一个适配 Claude Code / Codex 等 Agent 环境的网页 PPT 技能,用于生成**单文件 HTML 横向翻页 PPT**,视觉基调是"**电子杂志 × 电子墨水**"——像 *Monocle* 贴上了代码的样子。 +一个适配 Claude Code / Codex 等 Agent 环境的网页 PPT 技能,用于生成**单文件 HTML 横向翻页 PPT**、PPT 配图和多平台封面。 + +内置两套视觉系统: + +- **Style A: 电子杂志 × 电子墨水**。像 *Monocle* 贴上了代码,适合叙事、观点、分享、个人风格表达。 +- **Style B: 瑞士国际主义**。网格至上、单一高饱和锚点色、直角、发丝线、极致字号对比,适合事实、产品、分析、方法论表达。 > 由 [歸藏](https://x.com/op7418) 在"一人公司:被 AI 折叠的组织"、"一种新的工作方式"等线下分享中沉淀而成,踩过的每一个坑都写进了 `checklist.md`。 @@ -10,12 +15,14 @@ ## 效果 -- 🖋 **衬线大标题 + 非衬线正文 + 等宽元数据**的三级字体分工 -- 🌊 **WebGL 流体/色散背景**,hero 页可见,正文页克制 +- 🖋 **双视觉系统**:电子杂志风负责叙事,瑞士风负责事实表达 - 📐 **横向左右翻页**:键盘 ← → / 滚轮 / 触屏滑动 / 底部圆点 / ESC 索引 -- 🎨 **5 套主题色预设**:墨水经典 / 靛蓝瓷 / 森林墨 / 牛皮纸 / 沙丘 -- 🧩 **10 种页面布局**:开场封面、章节幕封、数据大字报、左文右图、图片网格、Pipeline、悬念问题、大引用、Before/After 对比、图文混排 -- 🖼 **Codex 可选配图流程**:可用 GPT-M 2.0 生成纪实照片、信息图、流程图、系统关系图、UI 情景图,并按模板比例插入 +- 🧩 **Style A 10 种布局**:封面、章节、数据大字报、图文、图片网格、Pipeline、对比等 +- 🧱 **Style B 22 种锁定版式**:Cover、Statement、KPI Tower、Loop Diagram、Duo Compare、Image Hero、Closing Manifesto 等 +- 🎨 **主题色预设**:Style A 5 套电子墨水主题,Style B 4 套瑞士高饱和锚点色 +- 🖼 **Codex 可选配图流程**:可用 GPT-Image 2.0 / GPT-M 2.0 生成纪实照片、信息图、流程图、系统关系图、UI 情景图,并按模板比例插入 +- 📰 **多平台封面**:可用同一套视觉规则生成公众号 21:9、公众号分享卡 1:1、小红书 3:4、视频号横版等封面 +- 📴 **低性能静态模式**:按 `B` 可关闭 WebGL / canvas 动画,让动态内容退回静态背景 - 📄 **单文件 HTML**:不需要构建、不需要服务器,浏览器直接打开 ## 适合 / 不适合 @@ -54,36 +61,74 @@ git clone https://github.com/op7418/guizang-ppt-skill.git ~/.claude/skills/guiza 装好后,Claude Code 会在对话里自动发现并调用这个 skill。触发关键词: - "帮我做一份杂志风 PPT" +- "帮我做一份瑞士风 PPT" - "生成一个 horizontal swipe deck" - "editorial magazine style presentation" - "electronic ink 风格演讲 slides" +- "基于这篇文章做一张公众号 21:9 封面" +- "基于这份 PPT 生成一张 1:1 分享卡" ## 使用流程 Skill 本身是结构化工作流,Agent 会逐步引导: -1. **需求澄清** — 6 问清单:受众、时长、素材、图片、主题色、硬约束 -2. **拷贝模板** — `assets/template.html` → 项目目录,改 `<title>`,换主题色 -3. **填充内容** — 从 10 种 layout 骨架里挑、粘、改文案(先做类名预检 + 主题节奏规划) -4. **可选配图** — 在 Codex 中可询问是否用 GPT-M 2.0 生成配图,再按页面比例插入 -5. **自检** — 对照 `references/checklist.md`,P0 级问题必须全过 -6. **预览** — 浏览器直接打开 -7. **迭代** — inline style 改字号/高度/间距 +1. **选择风格** — Style A 电子杂志风,或 Style B 瑞士国际主义 +2. **需求澄清** — 6 问清单:受众、时长、素材、图片、主题色、硬约束 +3. **拷贝模板** — Style A 用 `assets/template.html`,Style B 用 `assets/template-swiss.html` +4. **填充内容** — 先做主题节奏表,再从对应 layout 骨架里挑、粘、改文案 +5. **可选配图** — 在 Codex 中询问是否用 GPT-Image 2.0 / GPT-M 2.0 生成配图,再按页面比例插入 +6. **自检** — 对照 `references/checklist.md`,P0 级问题必须全过;瑞士风还要运行版式校验器 +7. **预览** — 浏览器直接打开 +8. **迭代** — inline style 改字号/高度/间距 详细说明见 [`SKILL.md`](./SKILL.md)。 +## Style B 瑞士风 + +瑞士风是这次新增的结构化主题。它不是"换一套 CSS",而是一套更严格的版式系统。 + +- **22 个具名版式**:正文页只能从 `S01` 到 `S22` 中选择,不能临时发明页面结构 +- **4 套锚点色**:克莱因蓝 IKB、柠檬黄、柠檬绿、安全橙 +- **网格锁定**:16 列 grid、直角色块、1px 发丝线、无阴影、无渐变、无圆角 +- **中文字号收敛**:全中文大标题需要降一档,避免占掉正文和图片空间 +- **图文底对齐**:左文右图 / 左图右文场景优先让正文块与图片底部对齐,同时避开页脚翻页组件 +- **图片槽位绑定**:图片必须进入模板预留的 `data-image-slot`,常见主图按 21:9 或 16:10 生成 +- **强校验**:用脚本拦住居中标题、实验版式、SVG 内写字、图片脱离槽位等问题 + +瑞士风校验命令: + +```bash +node scripts/validate-swiss-deck.mjs path/to/index.html +``` + ## Codex 配图能力 -在 Codex 环境中,完成 deck 初稿后可以主动询问用户是否需要生成配图。用户确认后,再选择图片类型或风格,常用类型包括: +在 Codex 环境中,完成 deck 初稿后可以主动询问用户是否需要生成配图。用户确认后,再询问图片类型或风格,常用类型包括: - 人文纪实照片:富士 / 徕卡感的真实场景,增加人文表现力 - 信息图 / 流程图 / 对比图 / 系统关系图:用于解释无法用实拍照片说明的概念 - 截图再设计 / UI 情景图:把原始截图统一成适合 PPT 的比例和视觉密度 +- 数据大字报 / 数据图表:把关键数字做成可直接插入 PPT 的视觉素材 +- 多图拼贴:用于极宽图片槽位,避免把三张 16:9 图片硬塞进三列 -生成图片时要遵守两个关键规则: +生成图片时要遵守三个关键规则: - 图片是 PPT 中的嵌入素材,不要自带页脚、页底、标题、角标、页码或装饰边框 -- 图片比例必须先匹配落位:主图常用 16:9 / 16:10,截图再设计常用 16:10,多图网格统一高度 +- 图片语言跟随 deck 语言:中文 deck 的信息图用中文标签,英文 deck 用英文标签 +- 图片比例必须先匹配落位:瑞士风主图常用 21:9,通用主图常用 16:9 / 16:10,截图再设计常用 16:10,多图网格统一高度 + +配图提示词见 [`references/image-prompts.md`](./references/image-prompts.md)。 + +## 封面生成 + +这个 Skill 也可以基于文章或 PPT 核心观点生成平台封面。典型规格: + +- **公众号头图**:21:9,主标题优先,右侧或边缘保留视觉锚点 +- **公众号分享卡**:1:1,与头图共用主题色、关键词和视觉元素 +- **小红书封面 / 轮播**:3:4,大标题优先,多张时统一字号和视觉节奏 +- **视频号 / 横版封面**:16:9,适合标题 + 副标题 + 单一视觉焦点 + +封面原则和 PPT 一样:只用少量关键词,视觉重心落在大标题上,不要把正文堆满。 ## 目录结构 @@ -92,12 +137,18 @@ guizang-ppt-skill/ ├── SKILL.md ← Skill 主文件:工作流、原则、常见错误 ├── README.md ← 本文件 ├── assets/ -│ └── template.html ← 完整可运行的种子 HTML(CSS + WebGL + 翻页 JS 全配好) +│ ├── template.html ← Style A 电子杂志风模板 +│ └── template-swiss.html ← Style B 瑞士国际主义模板 +├── scripts/ +│ └── validate-swiss-deck.mjs ← 瑞士风版式校验器 └── references/ ├── components.md ← 组件手册(字体、色、网格、图标、callout、stat、pipeline) ├── layouts.md ← 10 种页面布局骨架(可直接粘贴) + ├── layouts-swiss.md ← 22 种瑞士风锁定版式 + ├── swiss-layout-lock.md ← 瑞士风还原度和版式硬约束 ├── themes.md ← 5 套主题色预设(只能选不能自定义) - ├── image-prompts.md ← GPT-M 2.0 配图类型、比例和基础提示词 + ├── themes-swiss.md ← 4 套瑞士风锚点色 + ├── image-prompts.md ← GPT-Image 2.0 / GPT-M 2.0 配图类型、比例和基础提示词 └── checklist.md ← 质量检查清单(P0 / P1 / P2 / P3 分级) ``` @@ -115,6 +166,19 @@ guizang-ppt-skill/ 切换主题只需替换 `template.html` 开头 `:root{}` 里的 6 行变量,其他 CSS 全走 `var(--...)`。 +### Style B 瑞士主题 + +瑞士风从 `references/themes-swiss.md` 里选一套,同样**不允许自定义 hex 值**。 + +| 主题 | 适合场景 | +|------|---------| +| 克莱因蓝 IKB | 通用默认、商业发布、AI 产品、方法论 | +| 柠檬黄 | 年轻、运动、零售、Y2K 复古 | +| 柠檬绿 | 生态、可持续、Z 世代品牌 | +| 安全橙 | 警示、新闻、活力主题 | + +如果用户说"瑞士风 PPT"但没有指定颜色,默认推荐克莱因蓝 IKB。 + ## 核心设计原则 1. **克制优于炫技** — WebGL 背景只在 hero 页透出 @@ -122,12 +186,15 @@ guizang-ppt-skill/ 3. **图片是第一公民** — 图片要对齐正文内容区,比例稳定,只裁底部,顶部和左右完整 4. **配图只做素材** — 生成图只保留核心照片 / 图表 / UI,不要把 PPT 页脚、标题和角标画进图片里 5. **节奏靠 hero 页** — hero / non-hero 交替,才不累眼睛 -6. **术语统一** — Skills 就是 Skills,不中英混译 +6. **低性能可退场** — 按 `B` 能切换到静态模式,动态效果不能成为阅读负担 +7. **术语统一** — Skills 就是 Skills,不中英混译 +8. **瑞士风必须守版式** — Style B 优先还原原始 22P 版式,不要为了"多样"发明不存在的页面 ## 视觉参考 - [*Monocle*](https://monocle.com) 杂志的版式 - YC Garry Tan "Thin Harness, Fat Skills" +- Massimo Vignelli / Helvetica Forever / 瑞士国际主义网格系统 - 歸藏线下分享 PPT 系列 ## 贡献 @@ -135,6 +202,8 @@ guizang-ppt-skill/ Bug、排版问题、新布局需求——欢迎开 Issue 或 PR。改动请优先: - 在 `template.html` 里补类,不要让 layouts.md 使用未定义的类 +- 在 `template-swiss.html` 里补类时,同步更新 `layouts-swiss.md` 和 `swiss-layout-lock.md` +- 瑞士风新增规则后,同步更新 `scripts/validate-swiss-deck.mjs` - 把踩过的坑写到 `checklist.md` 对应的 P0 / P1 / P2 / P3 级别 - 新主题色进 `themes.md` 并给出适合的场景 diff --git a/SKILL.md b/SKILL.md index ca55251..c0309fd 100644 --- a/SKILL.md +++ b/SKILL.md @@ -1,23 +1,32 @@ --- name: guizang-ppt-skill -description: 生成"电子杂志 × 电子墨水"风格的横向翻页网页 PPT(单 HTML 文件),含 WebGL 流体背景、衬线标题 + 非衬线正文、章节幕封、数据大字报、图片网格等模板。当用户需要制作分享 / 演讲 / 发布会风格的网页 PPT,或提到"杂志风 PPT"、"horizontal swipe deck"、"editorial magazine"、"e-ink presentation"时使用。 +description: 生成横向翻页网页 PPT(单 HTML 文件),含 WebGL 背景、章节幕封、数据大字报、图片网格等模板。提供两种风格:① "电子杂志 × 电子墨水"(衬线 + 流体背景 + 暖色) ② "瑞士国际主义"(无衬线 + 网格点阵 + IKB/柠檬黄/柠檬绿/安全橙高亮)。当用户需要制作分享 / 演讲 / 发布会风格的网页 PPT,或提到"杂志风 PPT"、"瑞士风 PPT"、"Swiss Style"、"horizontal swipe deck"时使用。 --- # Magazine Web Ppt ## 这个 Skill 做什么 -生成一份**单文件 HTML**的横向翻页 PPT,视觉基调是: +生成一份**单文件 HTML**的横向翻页 PPT,提供两种可选的视觉基调: + +### 风格 A · 电子杂志 × 电子墨水(默认) -- **电子杂志 + 电子墨水**混血风格 - **WebGL 流体 / 等高线 / 色散背景**(hero 页可见) -- **衬线标题(Noto Serif SC + Playfair Display)+ 非衬线正文(Noto Sans SC + Inter)+ 等宽元数据(IBM Plex Mono)** -- **Lucide 线性图标**(不用 emoji) -- **横向左右翻页**(键盘 ← →、滚轮、触屏滑动、底部圆点、ESC 索引) -- **主题平滑插值**:翻到 hero 页时颜色和 shader 柔顺过渡 -- **翻页入场动效**(Motion One 驱动,5 种 recipe 自动匹配布局,本地 + CDN 双保险,离线可用) +- **衬线标题(Noto Serif SC + Playfair Display)+ 非衬线正文 + 等宽元数据** +- 适合:人文分享、行业观察、商业发布、需要"杂志感"的演讲 +- 模板:`assets/template.html` · 主题色:`references/themes.md` · 布局:`references/layouts.md` +- 美学锚点:像 *Monocle* 杂志贴上了代码 -这个 skill 的美学不是"商务 PPT",也不是"消费互联网 UI"——它像 *Monocle* 杂志贴上了代码后的样子。 +### 风格 B · 瑞士国际主义(Swiss Style) + +- **WebGL 极细网格 + 点阵背景**(信息驱动设计) +- **全程无衬线(Inter + Helvetica + Noto Sans SC)+ 极致字号对比** +- **高反差功能色**:克莱因蓝 IKB / 柠檬黄 / 柠檬绿 / 安全橙(四选一) +- 适合:科技产品、数据汇报、设计/工程领域分享、年度总结 +- 模板:`assets/template-swiss.html` · 主题色:`references/themes-swiss.md` · 布局:`references/layouts-swiss.md` +- 美学锚点:像 Massimo Vignelli + Helvetica Forever + +**两种风格共享**:横向翻页(键盘 ← →、滚轮、触屏、ESC 索引)、Lucide 图标、Motion One 入场动效(本地 + CDN 双保险)。 ## 何时使用 @@ -45,16 +54,29 @@ description: 生成"电子杂志 × 电子墨水"风格的横向翻页网页 PPT - **在 Codex 中**:用普通对话直接询问用户,不要调用 Claude Code 的 `ask question` / `ask_question` 机制,也不要假设这些工具可用。一次最多问 1-3 个最关键问题;如果信息缺口不影响开工,先做合理假设并在回复里说明。 - **在 Claude Code 中**:可以继续使用原有的 `ask question` 交互方式来逐项澄清。 -#### 6 问澄清清单 +#### 7 问澄清清单 | # | 问题 | 为什么要问 | |---|------|-----------| -| 1 | **受众是谁?分享场景?**(行业内部 / 商业发布 / demo day / 私享会) | 决定语言风格和深度 | -| 2 | **分享时长?** | 15 分钟 ≈ 10 页,30 分钟 ≈ 20 页,45 分钟 ≈ 25-30 页 | -| 3 | **有没有原始素材?**(文档 / 数据 / 旧 PPT / 文章链接) | 有素材就基于素材,没有就帮他搭 | -| 4 | **有没有图片?放在哪?** | 详见下方"图片约定" | -| 5 | **想要哪套主题色?** | 见 `references/themes.md`,5 套预设挑一 | -| 6 | **有没有硬约束?**(必须包含 XX 数据 / 不能出现 YY) | 避免返工 | +| 1 | **风格 A 还是 B?**(电子杂志风 / 瑞士国际主义风) | **必须先问**,决定用哪个 template + layouts + themes 文件 | +| 2 | **受众是谁?分享场景?**(行业内部 / 商业发布 / demo day / 私享会) | 决定语言风格和深度 | +| 3 | **分享时长?** | 15 分钟 ≈ 10 页,30 分钟 ≈ 20 页,45 分钟 ≈ 25-30 页 | +| 4 | **有没有原始素材?**(文档 / 数据 / 旧 PPT / 文章链接) | 有素材就基于素材,没有就帮他搭 | +| 5 | **有没有图片?放在哪?** | 详见下方"图片约定" | +| 6 | **想要哪套主题色?** | 杂志风 5 套(`themes.md`) / 瑞士风 4 套(`themes-swiss.md`),挑一 | +| 7 | **有没有硬约束?**(必须包含 XX 数据 / 不能出现 YY) | 避免返工 | + +#### 风格选择参考(问题 1) + +| 如果用户说... | 推荐风格 | +|---|---| +| "杂志感" / "人文" / "Monocle 风" / 不指定 | **A · 电子杂志风** | +| "瑞士风" / "Swiss Style" / "Helvetica" / "极简" / "网格" / "信息图" / "数据驱动" | **B · 瑞士国际主义风** | +| 内容是 AI 产品 / 技术 / 工程 / 数据汇报 | B 更合适 | +| 内容是行业观察 / 人文 / 故事 / 文化 | A 更合适 | +| 用户给了大量 KPI 数字 / 路线图 / 流程 | B 更合适(`Data Hero` 布局是瑞士风专长) | +| 用户给了大量纪实照片 / 人文图片 | A 更合适(图片网格、左文右图是杂志风专长) | +| 用户需要 GPT-M 2.0 生成截图再设计 / 信息图 / 证据墙 | B 也很合适(P23/P24 是瑞士风图片专用版式) | #### 大纲协助(如果用户没有大纲) @@ -100,7 +122,7 @@ description: 生成"电子杂志 × 电子墨水"风格的横向翻页网页 PPT 生成配图时遵守: - 提示词保持简短,只框定主题、用途、风格和比例,不要写长篇摄影指导 -- 图片风格必须贴合本 skill 的"电子杂志 × 电子墨水"基调 +- 图片风格必须贴合当前 deck 风格:风格 A 用"电子杂志 × 电子墨水";风格 B 用"瑞士国际主义 / Swiss Style" - 信息图、图表、截图再设计里的文字语言必须跟随用户正在使用的语言;中文 deck 用中文,英文 deck 用英文 - 先看 `references/image-prompts.md` 选择图片类型和基础提示词 - 配图比例必须匹配最终落位:主视觉 16:9,左文右图 16:10 / 4:3,信息图 16:9 / 16:10,截图再设计 16:10,图文混排小图 3:2 / 3:4,网格图统一高度裁切 @@ -108,14 +130,21 @@ description: 生成"电子杂志 × 电子墨水"风格的横向翻页网页 PPT ### Step 2 · 拷贝模板 -从 `assets/template.html` 拷贝一份到目标位置(通常是 `项目/XXX/ppt/index.html`),同时在同级建一个 `images/` 文件夹准备接图片。 +**根据 Step 1 选定的风格,拷贝对应的模板**到目标位置(通常是 `项目/XXX/ppt/index.html`),同时在同级建一个 `images/` 文件夹准备接图片。 ```bash mkdir -p "项目/XXX/ppt/images" + +# 风格 A · 电子杂志风 cp "<SKILL_ROOT>/assets/template.html" "项目/XXX/ppt/index.html" + +# 或 风格 B · 瑞士国际主义风 +cp "<SKILL_ROOT>/assets/template-swiss.html" "项目/XXX/ppt/index.html" ``` -`template.html` 是一个**完整可运行**的文件——CSS、WebGL shader、翻页 JS、字体/图标 CDN 全已预设好,只有 `<main id="deck">` 里面是 3 个示例 slide(封面、章节幕封、空白填充页)。 +两个 `template*.html` 都是**完整可运行**的文件——CSS、WebGL shader、翻页 JS、字体/图标 CDN 全已预设好,只有 `<!-- SLIDES_HERE -->` 占位符等待你填充 slide 内容。 + +**注意**:风格 A 和 B **不能混用**。layouts.md 里的类(如 `.h-hero` 衬线大标题、`.display-zh` 等)只在 template.html 有定义;layouts-swiss.md 里的类(如 `.kpi-hero`、`.accent-block`、`.span-N`、`.dots` 等)只在 template-swiss.html 有定义。一份 deck 只能选一套。 #### 2.1 · 必改占位符(**容易漏**) @@ -152,20 +181,39 @@ cp "<SKILL_ROOT>/assets/template.html" "项目/XXX/ppt/index.html" ### Step 3 · 填充内容 -#### 3.0 · 预检:类名必须在 template.html 里有定义(**最重要**) +#### 3.0 · 预检:类名必须在模板的 `<style>` 里有定义(**最重要**) -**这是所有生成问题的源头**。layouts.md 的骨架使用了很多类名(`h-hero` / `h-xl` / `stat-card` / `pipeline` / `grid-2-7-5` 等),如果 `assets/template.html` 的 `<style>` 里没有对应定义,浏览器会 fallback 到默认样式——大标题变成非衬线、数据卡片挤成一团、pipeline 糊成一行、图片堆到页面底部。 +**这是所有生成问题的源头**。layouts 骨架使用了很多类名,如果模板的 `<style>` 里没有对应定义,浏览器会 fallback 到默认样式——大标题字体错、卡片挤成一团、pipeline 糊成一行、图片堆到页面底部。 + +**两种风格类名互不通用**(再次强调): +- 风格 A 模板里有 `h-hero`(衬线)、`stat-card`、`grid-2-7-5`、`frame` 等 +- 风格 B 模板里有 `h-hero`(无衬线)、`kpi-hero`、`accent-block`、`span-N`、`dots`、`grid-12` 等 +- 同名 class 在两个模板里**视觉表现完全不同**(例:风格 A 的 `h-hero` 是 Noto Serif SC 衬线,风格 B 的 `h-hero` 是 Inter 无衬线) **在写任何 slide 代码之前:** -1. **先 Read `assets/template.html`**(至少读到 `<style>` 块末尾) -2. **对照 layouts.md 的 Pre-flight 列表**,确认你要用的每个类都在 `<style>` 里存在 -3. 如果某个类缺失:**在 template.html 的 `<style>` 里补上**,不要在每个 slide 里 inline 重写 -4. **template.html 是唯一的类名来源**——不要发明新类名,如需自定义用 `style="..."` inline +1. **先 Read 当前用的模板**(至少读到 `<style>` 块末尾): + - 风格 A → `assets/template.html` + - 风格 B → `assets/template-swiss.html` +2. **对照对应 layouts 文件的 Pre-flight 列表**,确认你要用的每个类都在 `<style>` 里存在 +3. 如果某个类缺失:**在模板的 `<style>` 里补上**,不要在每个 slide 里 inline 重写 +4. **模板是唯一的类名来源**——不要发明新类名,如需自定义用 `style="..."` inline -常见容易遗漏的类(必须预先确认存在): +**风格 A 常见容易遗漏的类**: `h-hero` / `h-xl` / `h-sub` / `h-md` / `lead` / `kicker` / `meta-row` / `stat-card` / `stat-label` / `stat-nb` / `stat-unit` / `stat-note` / `pipeline-section` / `pipeline-label` / `pipeline` / `step` / `step-nb` / `step-title` / `step-desc` / `grid-2-7-5` / `grid-2-6-6` / `grid-2-8-4` / `grid-3-3` / `grid-6` / `grid-3` / `grid-4` / `frame` / `frame-img` / `img-cap` / `callout` / `callout-src` / `chrome` / `foot` +**风格 B 常见容易遗漏的类**(2026-05 重构后): +- 画布:`canvas-card` / `chrome-min` +- 排版:`h-hero`(无衬线 7.4vw weight 200) / `h-statement`(9.6vw) / `h-xl` / `h-md` / `t-cat`(SemiBold 600 小标) / `t-meta`(mono uppercase) / `lead` / `num-mega` / `mono` +- 卡片(四类互斥):`card-ink` / `card-accent` / `card-fill` / `card-outlined` +- 网格:`grid-12` / `grid-2-9` / `grid-2-9-5` / `span-N` +- 时间线:`timeline-v` + `tl-node` + `tl-axis` + `dot` / `timeline-h` + `tl-h-node` + `tl-h-axis` +- 图表:`kpi-tower-row` + `bar-tower` / `h-bar-chart` + `bar-row` + `bar-fill` / `spec-bars` + `bar-vert` +- 装饰:`dot-mat`(SVG mask 实心点)/ `ring-mat`(描边圆)/ `cross-mat`(× 网格)/ `hr-hairline` +- 版式专属:`cover-split` / `closing-split` / `duo-compare` + `vrule` / `manifesto-top` + `ink-banner-full` / `three-forces` / `loop-diagram` / `matrix-fill` + `matrix-cell` / `brief-grid` + `brief-card` / `system-diagram` / `why-now-grid` / `four-cards` / `stacked-ledger` + `ledger-row` / `tech-spec` / `image-hero` + `hero-img-wrap` + `hero-overlay-block` + `hero-stats` +- 图片混排:`frame-img` / `fit-contain` / `r-21x9` / `r-16x9` / `r-16x10` / `h-22` / `h-26` / `swiss-img-split` / `swiss-img-grid` / `swiss-img-caption` / `swiss-keyline` / `swiss-lined` +- spacing token:`--sp-3`...`--sp-13`(8/12/16/24/32/40/48/64/80/96/160 px) + #### 3.0.5 · 规划主题节奏(**和类预检同等重要**) **在挑布局之前**,必须先列出每一页的主题 class(`hero dark` / `hero light` / `light` / `dark`)并写到文档或草稿里对齐。详细规则看 `references/layouts.md` 开头的"主题节奏规划"一节。 @@ -182,7 +230,9 @@ cp "<SKILL_ROOT>/assets/template.html" "项目/XXX/ppt/index.html" #### 3.1 · 挑布局 -**不要从零写 slide**。打开 `references/layouts.md`,里面有 10 种现成布局骨架,每种都是完整可粘贴的 `<section>` 代码块: +**不要从零写 slide**。打开对应的 layouts 文件,里面有 10 种现成布局骨架,每种都是完整可粘贴的 `<section>` 代码块。 + +**风格 A** → `references/layouts.md`: | Layout | 用途 | |---|---| @@ -197,21 +247,91 @@ cp "<SKILL_ROOT>/assets/template.html" "项目/XXX/ppt/index.html" | 9. 并列对比(Before / After) | 旧模式 vs 新模式 | | 10. 图文混排(Lead Image + Side Text) | 信息密集的图文页 | +**风格 B** → 先读 `references/swiss-layout-lock.md`,再读 `references/layouts-swiss.md`。 + +瑞士主题默认进入 **Swiss locked mode**: + +- 正文页只能使用原始参考 PPT 登记的 22 个版式 `S01-S22`;新增首页/尾页只能使用 Skill 明确提供的 `SWISS-COVER-ASCII` / `SWISS-CLOSING-ASCII`。 +- 每个 `<section class="slide">` 必须写 `data-layout="Sxx"`。没有 `data-layout` 就视为未登记版式。 +- 不允许临时发明 `P23/P24`、`Swiss Image Split`、`Evidence Grid` 这类原始 22P 之外的正文结构,除非用户明确要求实验版式。 +- 顶部中文标题默认左对齐、处在左上内容轴。不要把小标题放左列、大标题放右列,造成视觉居中;只有原始 statement/split 版式允许强中心叙事。 +- SVG 只负责几何图形。不要在 SVG 里写文字标签,所有标签改用 HTML 网格/卡片/caption。 + +原始 22 个正文版式如下: + +| Layout | 用途 | +|---|---| +| S01 Index Cover | 原始索引封面 | +| S02 Vertical Timeline + KPI | 演化对比 / 年代变迁 | +| S03 Split Statement | 核心论点 / 左右分屏 | +| S04 Six Cells | 6 项概念定义 | +| S05 Three Layers | 三层架构 | +| S06 KPI Tower | 4 项数据视觉化高度差 | +| S07 H-Bar Chart | 5-10 项排名比较 | +| S08 Duo Compare | Before/After 对照 | +| S09 Dot Matrix Statement | 大引述 / statement | +| S10 Split Closing | 收束页 | +| S11 Horizontal Timeline | 4-7 步流程 | +| S12 Manifesto + Ink Banner | 阶段性结论 | +| S13 Three Forces | 3 个对等概念深化 | +| S14 Loop Form | 自学闭环 / 自动化 | +| S15 Matrix + Hero Stat | 8-12 项矩阵 + 总数据 | +| S16 Multi-card Brief | 6 项快讯小卡 | +| S17 System Diagram | 三层架构 / 生态地图 | +| S18 Why Now | 三论点 + 数据支撑 | +| S19 Four Cards | 4 项等权特性 | +| S20 Stacked KPI Ledger | 纵向账单数据 | +| S21 Tech Spec Sheet | 产品规格 / benchmark | +| S22 Image Hero | 21:9 顶图 + 标题块 + 三列 KPI | + 选对应 layout,粘过去,改文案和图片路径即可。**务必先完成 3.0 预检**。 +**风格 B 版式多样性硬规则**: +- 7-8 页 deck 至少使用 **6 个不同 S 编号版式**;10 页以上至少使用 8 个不同版式。 +- 如果用户说"测试模板 / 看看效果 / 多一点版式",必须覆盖:一个封面、一个收尾、至少 1 个对比或时间线(S08/S11/S02)、至少 1 个结构图(S14/S17/S15)、至少 1 个图片版式(S22 或 S15/S16 图片格改造)。 +- 不允许连续 3 页使用同一种主体结构,例如连续三页 `head + grid + card`。 +- 图片页不能偷懒发明新结构。2-3 张图时,用 S15/S16 的原始网格骨架改造成图片格;单张大图用 S22。 +- 开写 HTML 前先列一张 `页码 → data-layout → 选用理由 → 图片槽位` 草稿;交付前运行 `node <SKILL_ROOT>/scripts/validate-swiss-deck.mjs index.html`。 + #### 3.2 · 图片比例规范 永远用**标准比例**,不要用原图奇葩比例(如 `2592/1798`): | 场景 | 推荐比例 | |------|---------| -| 左文右图 主图 | 16:10 或 4:3 + `max-height:56vh` | -| 图片网格(多图对比) | **固定 `height:26vh`**,不用 aspect-ratio | +| S22 顶部主图 | **21:9**;照片关键主体放中央安全区 | +| S15/S16 多图格 | 统一 21:9 或统一 16:10,不能混用 | +| 左文右图 主图(风格 A) | 16:10 或 4:3 + `max-height:56vh` | +| 图片网格(风格 A) | **固定 `height:26vh`**,不用 aspect-ratio | | 左小图 + 右文字 | 1:1 或 3:2 | | 全屏主视觉 | 16:9 + `max-height:64vh` | | 图文混排小插图 | 3:2 或 3:4 | -**图片绝不使用 `align-self:end`**——会滑到 cell 底被浏览器工具栏遮挡。用 grid 容器 + `align-items:start`(template 已预设)让图片贴顶即可;左列若想贴底,用 flex column + `justify-content:space-between`。 +**默认不要让图片 `align-self:end`**——会滑到页面底部,很容易碰到分页组件。用 grid 容器 + `align-items:start`(template 已预设)让图片贴顶即可;只有风格 B 的 P23 可以用 `.swiss-img-split.align-image-bottom`,因为模板已经给它内置了 `--nav-safe-bottom` 安全区。 + +**风格 B 瑞士风额外规则**: +- 单张大图用 S22;多图测试用 S15/S16 的原始卡片网格改造,不要用未登记的 P23/P24 +- 生成图片前先写 `data-image-slot`:例如 `s22-hero-21x9` / `s15-grid-21x9` / `s16-brief-21x9` +- S22 配图默认生成 21:9,提示词必须包含 `subject centered in the safe middle area`;照片容器用 `object-position:center 35%`,不要用 `top center` +- 图片容器必须直角、无阴影、无圆角;默认背景用白色 `var(--paper)`,不要用灰底包白底信息图 +- 白底 GPT 信息图/流程图/UI 图默认不要加外框描边,不要随手套 `.swiss-keyline`;需要强调时只用 `.swiss-lined` 的顶部 accent 线 +- UI/信息图如果是用户原始截图或文字密集图,才用 `.fit-contain`;如果已按 S15/S16 槽位重生成,必须用 `.frame-img.r-21x9` / `.frame-img.r-16x10` 铺满容器,不要固定 `height:18vh` 后把图缩小 +- 多图同组必须统一图片槽位、比例和高度,不能混用 +- GPT-M 2.0 生成图使用 `image-prompts.md` 的"风格 B:瑞士国际主义配图规则" +- 任何图片、caption、timeline label、footnote 的最低处都不能进入底部分页区域;需要贴底时用 `.nav-safe-bottom` / `.nav-safe-bottom-tight`,不要手写 `bottom:2vh` + +#### 3.2.1 · 中文大标题字号分档(风格 B 必做) + +中文方块字视觉面积大,不能直接套英文 hero 的 6.8-7vw。写中文大标题前先分档: + +| 标题形态 | 推荐字号 | +|---|---| +| 1 行,≤ 8 个中文字符 | `min(6.4vw,11.2vh)` | +| 2 行,每行≤ 8 个中文字符 | `min(5.8vw,10.2vh)` | +| 2 行,任一行 9-12 个中文字符 | `min(5.2vw,9.2vh)` | +| 3 行或更长 | 优先改写标题;不得已用 `min(4.6vw,8.2vh)` | + +如果标题挤占了图片或正文区域,先压缩标题文案,再降字号;不要靠把下方内容推到底来硬塞。 组件细节(字体、颜色、网格、图标、callout、stat-card 等)在 `references/components.md`。 @@ -219,7 +339,18 @@ cp "<SKILL_ROOT>/assets/template.html" "项目/XXX/ppt/index.html" 生成完一定要打开 `references/checklist.md`,逐项对照。里面总结了**真实迭代过程中踩过的所有坑**,P0 级别的问题(emoji、图片撑破、标题换行、字体分工)必须全部通过。 -特别要注意的几条: +#### 4.0 · 不只看代码:必须打开网页做视觉核对 + +代码只能证明类名和结构存在,不能证明版式舒服。生成后必须打开网页逐页看: + +1. 同时打开原始参考 PPT、当前模板或生成页、测试 PPT;原始参考是 `/Users/guohao/Documents/op7418的仓库/项目/Thin-Harness-Fat-Skills/ppt/index.html`。 +2. 截图前等入场动效稳定(约 1-2 秒),不要把动画中间态当成版式问题。 +3. 先看视觉:大标题字重、标题与内容间距、图片是否与正文对齐、图片/说明是否碰到底部分页组件。 +4. 再看代码:确认该页选用的版式与内容形状匹配,没有把数据专用版式拿来讲概念,也没有把可选组件堆成装饰。 +5. 对照原始参考模板时,以实际页面用法为准,不要只看 CSS helper 定义;原始页面的大字实际多为 200/300,不要被 raw CSS 里的 700/800/900 带偏。 +6. 如果页面别扭,先判断是版式选错、必选组件缺失、可选组件滥用,还是间距/安全区问题;不要直接靠加 margin 硬救。 + +#### 风格 A · 电子杂志风必查 1. **大标题必须是衬线字体**——如果显示成非衬线,99% 是 Step 3.0 预检没做,`h-hero` 类在 template.html 里缺失 2. **图片网格里只用 `height:Nvh`,不用 `aspect-ratio`**(会撑破) @@ -229,6 +360,33 @@ cp "<SKILL_ROOT>/assets/template.html" "项目/XXX/ppt/index.html" 6. **用 Lucide,不用 emoji** 7. **标题用衬线,正文用非衬线,元数据用等宽** +#### 风格 B · 瑞士国际主义必查 + +1. **全程无衬线**——任何衬线字体出现都是错的(检查 `font-family` 没用 `--serif` 类变量) +2. **只有一个 accent 色**——一份 deck 不能同时出现 IKB 蓝 + 柠檬黄 + 安全橙等多个高亮色 +3. **不允许渐变 / 阴影 / 圆角**——所有色块直角纯色,任何 `box-shadow` / `linear-gradient` / `border-radius` > 0 都要砍掉(rule 横线除外) +4. **极致字号对比**——主标题与正文比例 ≥ 8:1 +5. **大字号必须双约束限高**——`font-size:min(Xvw, Yvh)`,只用 vw 在标准 16:9 屏会溢出(吸取 P15/P20/P22 教训) +6. **大字字重 200**(ExtraLight)——字号越大越细,瑞士风灵魂;**禁止** 600/700/800 大字 +7. **卡片填充类型互斥**——`card-ink` / `card-accent` / `card-fill` / `card-outlined` 四类**不能混用**(禁止"蓝底+蓝描边"、"灰底+描边"等) +8. **多卡并列时统一样式**——3-12 张卡用同一类(优先 `card-fill` 灰底);只突出一项时单独换 `card-accent`,且**只允许一张** +9. **直角到底**——任何 `border-radius` 都不允许;装饰用 8×8 直角小方块,**不要** 9px 圆形点 +10. **图标用 lucide,不自己画 SVG**——`<i data-lucide="name"></i>` + `lucide.createIcons()`,选棱角风格(避免圆胖) +11. **时间线对齐**——axis 列固定 12px + dot 绝对定位,**不要**用 grid `justify-self`(会与虚线错位) +12. **章节级标题与内容间距 ≥ 9vh**——避免拥挤(吸取 P15/P16 教训) +13. **每页一个语义化动效 recipe**——不是统一 fade-up,数字 scale 弹入、bar scaleY 拉起、SVG stroke 描线、节点序列点亮等;**禁止**所有页用同一个 generic 配方 +14. **playSlide 入口 reveal 容器**——`[data-anim]` 容器先强制 opacity:1,recipe 内再用 motion `{opacity:[0,1]}` 覆盖,否则有些页会"看不见" +15. **ESC 索引页可见性**——cloned slide 必须有 CSS override 让 `[data-anim]` 在缩略图里 opacity:1 +16. **Helvetica/Inter 兜底中文字体**——Windows 用户没有"苹方",必须 fallback 到 `"Microsoft YaHei UI", "Noto Sans SC"` +17. **字体粗细体例**:大字 200 / 正文 300 / `t-cat` SemiBold 600 / `t-meta` mono uppercase +18. **保留低功耗快捷键**——右下角必须提示 `B 静态`;按 `B` 切换 `body.low-power`,停止 WebGL/ASCII canvas RAF 和 Motion 入场动画 +19. **装饰元素严格在 grid 内**——bars 矩阵、点阵、ring-mat 不能贴边或溢出页面 +20. **底部内容预留 nav 空间**——nav 在 ~97vh,内容收尾不要过 93vh(吸取 P22 KPI 大字溢底教训) +21. **图片容器直角无阴影**——`.frame-img` 不加 `border-radius` / `box-shadow`;边界只用 hairline +22. **P23/P24 图片同组一致**——同一组图片统一比例、高度、边距、线条粗细;信息图/UI 图加 `.fit-contain` +23. **组件角色要正确**——P23/P24 的 caption 是必选信息锚点;P22 的 KPI/说明是必选;数据专用版式必须有真实数据,不能靠文案硬填 +24. **通用/非通用版式要分清**——P3/P8/P11/P19/P23 较通用;P6/P7/P20/P21/P22 是数据/案例专用;P14/P15/P17 是结构专用 + ### Step 5 · 本地预览 直接在浏览器打开 `index.html` 就行。macOS 下: @@ -249,32 +407,46 @@ open "项目/XXX/ppt/index.html" ``` guizang-ppt-skill/ -├── SKILL.md ← 你正在读 +├── SKILL.md ← 你正在读 ├── assets/ -│ ├── template.html ← 完整的可运行模板(种子文件) -│ └── motion.min.js ← Motion One 本地副本(离线兜底,约 64KB) +│ ├── template.html ← 风格 A · 电子杂志风模板(种子文件) +│ ├── template-swiss.html ← 风格 B · 瑞士国际主义风模板(种子文件) +│ └── motion.min.js ← Motion One 本地副本(离线兜底,约 64KB,共用) +├── scripts/ +│ └── validate-swiss-deck.mjs ← 风格 B 静态校验:登记版式、图片槽位、SVG 文本、标题对齐 └── references/ - ├── components.md ← 组件手册(字体、色、网格、图标、callout、stat、pipeline、动效...) - ├── layouts.md ← 10 种页面布局骨架(可直接粘贴,含动效标记) - ├── themes.md ← 5 套主题色预设(只能选不能自定义) - ├── image-prompts.md ← GPT-M 2.0 配图类型、比例和基础提示词 - └── checklist.md ← 质量检查清单(P0/P1/P2/P3 分级) + ├── components.md ← 组件手册(字体、色、网格、图标、callout、stat、pipeline、动效... 风格 A 适用) + ├── layouts.md ← 风格 A · 10 种页面布局骨架(可直接粘贴,含动效标记) + ├── swiss-layout-lock.md ← 风格 B · 原始 22P 版式锁,正文页必须按这里登记 + ├── layouts-swiss.md ← 风格 B · 原始 22P 骨架说明 + 少量明确标注的实验区 + ├── themes.md ← 风格 A · 5 套主题色预设(只能选不能自定义) + ├── themes-swiss.md ← 风格 B · 4 套瑞士风主题色预设(IKB / 柠檬黄 / 柠檬绿 / 安全橙) + ├── image-prompts.md ← GPT-M 2.0 配图类型、比例和基础提示词 + └── checklist.md ← 质量检查清单(P0/P1/P2/P3 分级) ``` **加载顺序建议**: 1. 先读完 `SKILL.md`(这个文件)了解整体 -2. Step 1 需求澄清完成后,读 `themes.md` 帮用户选定一套主题色 -3. **动手前 Read `assets/template.html` 的 `<style>` 块**——这是类名的唯一来源,缺类会导致整页样式崩 -4. 读 `layouts.md` 挑布局(顶部有 Pre-flight 类名清单、主题节奏规划、动效 recipe 决策树) +2. Step 1 需求澄清**第一问**先确定风格 A 还是 B,然后: + - 风格 A:读 `themes.md` 帮用户选一套主题色 + - 风格 B:读 `themes-swiss.md` 帮用户选一套主题色 +3. **动手前 Read 对应模板的 `<style>` 块**——这是类名的唯一来源,缺类会导致整页样式崩 + - 风格 A → `assets/template.html` + - 风格 B → `assets/template-swiss.html` +4. 读对应的 layouts 文件挑布局: + - 风格 A → `layouts.md`(顶部有 Pre-flight 类名清单、主题节奏规划、动效 recipe 决策树) + - 风格 B → **先读 `swiss-layout-lock.md`**,再读 `layouts-swiss.md`;正文页必须从 S01-S22 选择,每页写 `data-layout` 5. 如果在 Codex 中生成配图,读 `image-prompts.md` 挑图片类型、比例和基础提示词 -6. 细节调整时读 `components.md` 查组件(含 Motion 动效系统章节) -7. 生成后读 `checklist.md` 自检(顶部 P0-0 规则强制预检 + 动效自检块) +6. 细节调整时读 `components.md` 查组件(含 Motion 动效系统章节,主要服务风格 A;风格 B 的组件细节在 `layouts-swiss.md` 附录) +7. 生成后先运行 `node scripts/validate-swiss-deck.mjs path/to/index.html`,再读 `checklist.md` 自检 -**动效相关**:模板已把 Motion One 的加载和 5 种 recipe 逻辑全部内嵌到 `template.html` 底部的 module script。你不需要改 JS,只需要按 `layouts.md` 的骨架在 HTML 里加 `data-anim` / `data-animate` 即可。离线演示靠 `assets/motion.min.js`,断网时自动降级为"无动画但内容可读"。 +**动效相关**:模板已把 Motion One 的加载和 recipe 逻辑内嵌到底部 module script。你不需要改 JS,只需要按 `layouts.md` / `layouts-swiss.md` 的骨架在 HTML 里加 `data-anim` / `data-animate` 即可。离线演示靠 `assets/motion.min.js`,断网时自动降级为"无动画但内容可读"。风格 B 模板必须保留 `B` 键低功耗模式:切换后停止 WebGL/ASCII canvas RAF,取消正在运行的 Web Animations,并把当前页内容直接 reveal 到静态最终态。 ## 核心设计原则(哲学) -> 这些原则是"一人公司"分享 PPT 的 5 轮迭代总结出来的。违反其中任何一条,视觉感都会垮。 +### 风格 A · 电子杂志风(5 轮迭代总结) + +> 违反其中任何一条,杂志感都会垮。 1. **克制优于炫技** — WebGL 背景只在 hero 页透出,普通页几乎看不见 2. **结构优于装饰** — 不用阴影、不用浮动卡片、不用 padding box,一切信息靠**大字号 + 字体对比 + 网格留白** @@ -283,12 +455,31 @@ guizang-ppt-skill/ 5. **节奏靠 hero 页** — hero 和 non-hero 交替,才不累眼睛 6. **术语统一** — Skills 就是 Skills,不要中英混合翻译 +### 风格 B · 瑞士国际主义风 + +> 违反其中任何一条,画面瞬间从瑞士掉到 PowerPoint。 + +1. **单一锚点色** — 一份 deck 只用一个 accent,不允许多色高亮拼贴 +2. **极致字号对比** — 主标题与正文比例 ≥ 8:1,KPI 必须是"Data Hero"(屏幕宽度的 18-22%) +3. **无衬线只此一家** — Inter / Helvetica / Noto Sans SC,任何衬线都是错的 +4. **直角纯色** — 不允许渐变 / 阴影 / 圆角(rule 横线除外) +5. **网格至上** — 所有元素吸附到 12-col grid,左对齐 + 大幅留白做非对称美学 +6. **Hairline 是手术刀** — 1px 的极细分割线就够,不要加粗、不要加阴影 +7. **点阵装饰只在 hero 页透出** — 正文页保持纯净底色 + ## 参考作品 -本 skill 的视觉基调参考了: +本 skill 的两种风格分别参考了: +**风格 A · 电子杂志风**: - 歸藏 "一人公司:被 AI 折叠的组织" 分享(2026-04-22,27 页) - *Monocle* 杂志的版式 - YC 总裁 Garry Tan "Thin Harness, Fat Skills" 那篇博客的 demo +**风格 B · 瑞士国际主义风**: +- Massimo Vignelli 的 NYC Subway / Unimark 系统 +- *Helvetica Forever* 的字体设计语言 +- Josef Müller-Brockmann 的网格系统经典著作 +- 当代设计:Acne Studios / Off-White / IKEA / Beck Design + 可以把它们当做风格锚点。 diff --git a/assets/template-swiss.html b/assets/template-swiss.html new file mode 100644 index 0000000..26a2eb3 --- /dev/null +++ b/assets/template-swiss.html @@ -0,0 +1,2417 @@ +<!DOCTYPE html> +<html lang="zh-CN"> +<head> +<meta charset="UTF-8"> +<meta name="viewport" content="width=device-width, initial-scale=1.0"> +<title>[必填] 替换为 PPT 标题 · Deck Title + + + + + + + + + +
← → 翻页 · B 静态 · ESC 索引
+ +
+ + + + + +
+
+ +
+
[必填] Deck 标题 · Issue/Field Note 编号
+
SS · 25.05.10 · 01 / NN
+
+ + +
+
[必填] 章节英文 / Section En
+ +

[必填] 中文主标题
(≤ 12 字,可在某字加 italic 微强调)

+ +
+
[必填] 一段 1-2 行的副标 / 引子,定调全场.
+
+
[选填] 作者 · 日期 · 出处
+
→ swipe / arrow keys
+
+
+
+
+
+ + +
+
+
+ +
+ +
+
NN / NN
+
CLOSING
+
+ +
+
MANIFESTO
+

[必填] Build a model.
Run forever.

+
[必填] 一句 1-2 行的中文/英文注脚,把宣言落地.
+
+ +
+
[选填] 作者 · 头衔
+
YY.MM.DD
+
+
+ + +
+
+
TAKEAWAYS
+
03 RULES
+
+ +
+
+
01
+
+

[必填] takeaway 标题 01

+

[必填] 1-2 行展开说明.

+
+
+
+
02
+
+

[必填] takeaway 标题 02

+

[必填] 1-2 行展开说明.

+
+
+
+
03
+
+

[必填] takeaway 标题 03 · accent 强调

+

[必填] 最后一条用 IKB 强调,与封面色彩首尾闭环.

+
+
+
+ +
→ 完 · END OF FIELD NOTE
+
+
+
+
+ +
+ + + + + + + + + + + + + diff --git a/assets/template.html b/assets/template.html index eb6f51a..3140850 100644 --- a/assets/template.html +++ b/assets/template.html @@ -36,6 +36,7 @@ canvas#bg-dark{opacity:1} body.light-bg canvas#bg-light{opacity:1} body.light-bg canvas#bg-dark{opacity:0} + body.low-power canvas.bg{display:none!important} /* ============ Deck 容器 + 翻页 ============ */ /* width: NSLIDES * 100vw,会在 JS 里动态矫正 */ @@ -194,6 +195,8 @@ body.light-bg #nav .dot{background:rgba(var(--ink-rgb),.25)} body.light-bg #nav .dot.active{background:rgba(var(--ink-rgb),.9)} #hint{position:fixed;bottom:3vh;right:3vw;z-index:30;font-family:var(--mono);font-size:10px;letter-spacing:.2em;text-transform:uppercase;opacity:.4;mix-blend-mode:difference;color:#aaa} + body.low-power #hint{opacity:.72;color:var(--paper);mix-blend-mode:normal} + body.light-bg.low-power #hint{color:var(--ink)} /* ============================================================ ============ LAYOUTS API · 面向 agent 的类(v2)============ @@ -423,6 +426,12 @@ body.motion-ready [data-anim="right"]{transform:translateX(24px)} body.motion-ready [data-anim="line"]{opacity:0;transform:translateY(10px)} body.motion-ready [data-animate="pipeline"] [data-anim]{opacity:.15} + body.low-power #deck{transition:none!important} + body.low-power *, + body.low-power *::before, + body.low-power *::after{animation:none!important;transition:none!important} + body.low-power.motion-ready [data-anim], + body.low-power [data-anim]{opacity:1!important;transform:none!important} /* ---------- 响应式降级 ---------- */ @media (max-width:900px){ @@ -437,10 +446,35 @@ + -
← → 翻页 · ESC 索引
+
← → 翻页 · B 静态 · ESC 索引
@@ -564,14 +598,26 @@ function bootGL(canvasId, fsSrc){ return true; }; } -const drawDark=bootGL('bg-dark',FS_DARK); -const drawLight=bootGL('bg-light',FS_LIGHT); -const t0=Date.now(); -(function loop(){ - const t=(Date.now()-t0)/1000; - drawDark(t);drawLight(t); - requestAnimationFrame(loop); -})(); +let drawDark=null, drawLight=null, glRAF=0, glT0=Date.now(); +function startGL(){ + if(window.__lowPowerMode || glRAF) return; + if(!drawDark) drawDark=bootGL('bg-dark',FS_DARK); + if(!drawLight) drawLight=bootGL('bg-light',FS_LIGHT); + glT0=Date.now(); + function loop(){ + if(window.__lowPowerMode){glRAF=0;return;} + const t=(Date.now()-glT0)/1000; + drawDark(t);drawLight(t); + glRAF=requestAnimationFrame(loop); + } + glRAF=requestAnimationFrame(loop); +} +function stopGL(){ + if(glRAF) cancelAnimationFrame(glRAF); + glRAF=0; +} +startGL(); +addEventListener('ppt-low-power-change', e=>{e.detail.on ? stopGL() : startGL();}); // =============== 导航(翻页 / 圆点 / 键盘 / 滚轮 / 触屏) =============== const deck=document.getElementById('deck'); @@ -592,6 +638,7 @@ slides.forEach((s,i)=>{ function go(n){ if(lock)return; idx=Math.max(0,Math.min(total-1,n)); + window.__currentSlideIndex = idx; deck.style.transform=`translateX(${-idx*100}vw)`; nav.querySelectorAll('.dot').forEach((d,i)=>d.classList.toggle('active',i===idx)); /* 主题切换:优先读 data-theme,其次从 class(light/dark)推断 */ @@ -643,6 +690,11 @@ function toggleOverview(){ addEventListener('keydown',e=>{ if(e.key==='Escape'){e.preventDefault();toggleOverview();return;} + if(e.key && e.key.toLowerCase()==='b' && !e.metaKey && !e.ctrlKey && !e.altKey){ + e.preventDefault(); + window.__setLowPowerMode(!window.__lowPowerMode); + return; + } if(overviewOn)return; if(e.key==='ArrowRight'||e.key==='PageDown'||e.key===' '||e.key==='ArrowDown'){ if(window.__pipeAdvance && window.__pipeAdvance()) return; @@ -718,12 +770,26 @@ if(motion){ }); } + function revealStatic(slide){ + resetAnims(slide); + document.getAnimations?.().forEach(a=>a.cancel()); + slide.querySelectorAll('[data-anim]').forEach(el=>{ + el.style.opacity='1'; + el.style.transform='none'; + }); + } + function playSlide(i){ const slide = slides[i]; if(!slide) return; lastIdx = i; const recipe = slide.dataset.animate || (slide.classList.contains('hero') ? 'hero' : 'cascade'); + if(window.__lowPowerMode){ + revealStatic(slide); + return; + } + if(recipe === 'pipeline'){ pipeStep = -1; slide.querySelectorAll('[data-anim]').forEach(el=>{ @@ -767,6 +833,7 @@ if(motion){ } function pipeAdvance(){ + if(window.__lowPowerMode) return false; const slide = slides[lastIdx]; if(!slide || slide.dataset.animate !== 'pipeline') return false; const steps = [...slide.querySelectorAll('[data-anim="step"]')]; diff --git a/references/checklist.md b/references/checklist.md index bdf86eb..a2e6be8 100644 --- a/references/checklist.md +++ b/references/checklist.md @@ -8,16 +8,202 @@ ## 🔴 P0 · 一定不能犯的错 +### 0-S. Swiss locked mode:正文页必须来自原始 22P + +**现象**:颜色、字体看起来像 Swiss,但标题跑到中间、图片不在网格上、页面结构和原始 22P 完全不是一套东西。 + +**根因**:生成时把 Swiss 当成风格包,自由组合了新的 P23/P24/自绘 SVG 页面,没有从原始参考 PPT 的 22 个登记版式里选。 + +**做法**: +- 先读 `references/swiss-layout-lock.md` +- 正文页只能使用 `S01-S22`;新增首页/尾页只能使用 `SWISS-COVER-ASCII` / `SWISS-CLOSING-ASCII` +- 每个 `
` 必须写 `data-layout="Sxx"` +- 生成后必须运行: + +```bash +node /scripts/validate-swiss-deck.mjs path/to/index.html +``` + +**校验会拦截**: +- 未登记版式 / 缺少 `data-layout` +- P23/P24 实验结构 +- SVG 里写可见文字 +- S22 图片未绑定 `s22-hero-21x9` +- S22 照片使用 `object-position:top center` + +### 0-S-2. Swiss 顶部标题默认左上,不是居中 + +**现象**:最顶上的中文标题在页面中间,像一页自制海报,不再像原始 PPT。 + +**做法**: +- 除 `S03/S09/S10` 这类 statement/split 版式外,顶部标题必须贴原始模板的左上内容轴。 +- 不要把小标题放左列、大标题放右侧大列,这会导致标题视觉居中。 +- 如果需要标题 + 说明两列,必须复制原始 `S11` 或 `S17` 的骨架,不要自写 `4fr 8fr`。 + +### 0-A. 瑞士风画布对齐法则(每一页必查 · 最常踩) + +**现象**:页眉 chrome-min 和底部 footer 都靠在 5vw 的边线上,但中间区域往内缩了一截,左右对不齐。 + +**根因**:`.canvas-card` 已经自带 `padding:5.6vh 5vw 4.4vh`。如果在主体区再写 `padding:5vh 5vw 4vh`,水平方向就变成 `5vw + 5vw = 10vw`,主体比 chrome-min 多内缩 5vw。 + +**做法**: +- 主体那层 `padding:0`,只用 grid `gap` 控垂直间距 +- chrome-min 与主体之间的间距由 `.chrome-min{margin-bottom:48px}` 提供,**不要**在主体顶部叠 `margin-top` / `padding-top` +- split 模式例外:`.slide.split .canvas-card{padding:0}`,两个 `.half` 自己定 `padding:5.6vh 3.6vw 4.4vh` + +```html + +
+
...
+
主体
+
+ +
+
...
+
主体
+
+``` + +**自检命令**:`grep "padding:.*5vw" index.html`,如果命中 `padding:Xvh 5vw Yvh` 在 canvas-card 直系子元素里,就是错的(.half / 装饰层除外)。 + +### 0-B. 瑞士风 head 区:kicker 必须在大标题"上方"(不要左右排) + +**现象**:小标题(`.t-meta` / `.t-cat`)和大标题被挤在同一行,左侧一坨小字、右侧一坨大字,头部失去层级。 + +**根因**:`grid-template-columns:auto 1fr` 把两个本该上下叠的元素压成左右两列。 + +**做法**: +```html + +
+
METHODOLOGY · 03
+

为什么是 N+1

+
+ +
+
METHODOLOGY · 03
+

为什么是 N+1

+
+``` + +例外:head 一行同时承载"左:kicker+大标题(自己上下叠)"和"右:小注脚",外层可以用 `display:grid;grid-template-columns:1fr auto`,但**内层**仍要保持 flex column。 + +### 0-B-2. 瑞士风封面 / 封底默认:IKB 满屏 + ASCII 呼吸场 + 白色 weight 200(强制) + +**现象**:封面用 `slide light` 白底 + 黑字 + 一个大大的"01"——同时 chrome 角标已经写了 `01 / 07`,屏幕上出现两个"01",视觉重复;白底太普通,完全没有"开场打招呼"的仪式感。 + +**根因**:layouts-swiss.md 旧版默认推荐左 ink + 右 paper 对开,实操中容易写成"白底 + 黑大字 + 编号大字",失去 IKB 这个标志色的开场冲击。 + +**做法**(瑞士风必守): +- **封面强制 `
`**(满屏 IKB),不要 `slide.light`,也不要 `slide.dark`;在 `.canvas-card` 内**第一个子元素**插入 ``(ASCII 字符呼吸场,模板自带 IIFE 自动激活) +- **不要再写"01"等编号大字**:`.chrome-min` 已经显示 `01 / N`,封面再放一个巨大的"01"=同义重复,直接删掉 +- **强调字必须用斜体**:`font-style:italic;font-weight:300`,**禁止**用 `color:var(--accent)`——IKB 蓝压 IKB 蓝,人眼看不见任何强调 +- **封底强制 `slide.split`** 双半屏,左半 `.half.b-accent` + ASCII canvas(与封面色彩闭环),右半 paper 白底放 3 条 takeaway;**第 03 条**用 `var(--accent)` 上色,完成"开场全 IKB ↔ 收尾半 IKB"的色彩闭环 +- ASCII canvas 在模板的 `