Skip to content
Back to search

frontend-slides-editable

Use when the user wants a single-file HTML presentation that stays editable in the browser after generation, or needs object-level layout editing, slide reordering, local save/export, or PPT/PDF-to-web conversion with continued editing.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/archlizheng--frontend-slides-editable/badge.svg)](/listings/archlizheng--frontend-slides-editable)

HTML

<a href="/listings/archlizheng--frontend-slides-editable"><img src="/api/listings/archlizheng--frontend-slides-editable/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

仓库地址:**https://github.com/archlizheng/frontend-slides-editable**

前置要求:需要先安装 **Node.js**(建议 LTS,Node 18+);`npx` 会随 Node.js 一起安装。

Prerequisite: install **Node.js** first (LTS recommended, Node 18+); `npx` is included with Node.js.

一条命令(推荐) / One command (recommended)

npx skills add archlizheng/frontend-slides-editable

如果你的环境里 `skills` CLI 版本支持 URL,也可以用:

If your `skills` CLI supports URL sources, you can also run:

npx skills add https://github.com/archlizheng/frontend-slides-editable

如果仓库里未来包含多个 skill,可指定名称安装:

If this repo contains multiple skills in the future, install by name:

npx skills add https://github.com/archlizheng/frontend-slides-editable --skill frontend-slides-editable

验证安装 / Verify installation

安装后请确认本地 skill 目录中出现 `frontend-slides-editable`,并包含 `SKILL.md`、`STYLE_PRESETS.md`、`examples/`。

After installation, confirm `frontend-slides-editable` exists in your local skills directory and contains `SKILL.md`, `STYLE_PRESETS.md`, and `examples/`.

然后在对话中直接调用:

Then invoke it in chat:

/frontend-slides-editable

方式二:手动命令行(备用) / Option B: manual shell (fallback)

当 `npx skills add` 不可用时,可用手动安装。

If `npx skills add` is unavailable, install manually.

**Codex**

mkdir -p ~/.codex/skills
git clone https://github.com/archlizheng/frontend-slides-editable.git ~/.codex/skills/frontend-slides-editable

**Claude Code**

mkdir -p ~/.claude/skills
git clone https://github.com/archlizheng/frontend-slides-editable.git ~/.claude/skills/frontend-slides-editable

若目标目录已存在,请先删除旧目录,或进入目录执行 `git pull` 更新。

If the target folder already exists, remove it first or run `git pull` inside that folder.

升级 / Upgrade

仓库更新后,重新执行安装命令即可;必要时先删除旧目录再安装。

When updates are available, re-run the install command; if needed, remove the old folder first.

<a id="toc-usage"></a>

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

SKILL.md · Manifest · 418 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. ---
  2. name: frontend-slides-editable
  3. description: Use when the user wants a single-file HTML presentation that stays editable in the browser after generation, or needs object-level layout editing, slide reordering, local save/export, or PPT/PDF-to-web conversion with continued editing.
  4. ---
  5. <objective>
  6. Frontend Slides (Editable)
  7. Create zero-dependency, animation-rich HTML presentations that run entirely in the browser **with a built-in editor**: move objects, multi-select with **Ctrl+click**, alignment snapping, simple text formatting with **font family + size controls**, **undo/redo**, a **Pages** sidebar (slide thumbnails, drag to reorder, delete), presentation tools (**Laser** pointer and **Fullscreen**), **Ctrl+S** persistence, and **export HTML**.
  8. This skill is a **copy of the `frontend-slides` skill** extended with the editable deck runtime. For read-only decks without editor weight, use the original **`frontend-slides`** skill instead (same skills directory layout).
  9. </objective>
  10. <preset_fidelity>
  11. Parity with parent `frontend-slides` (style flexibility)
  12. **Adding edit mode must not replace preset authoring.** The parent skill treats each choice in [STYLE_PRESETS.md](STYLE_PRESETS.md) as a **spec**: per preset you implement its **Layout** prose, **Signature Elements**, typography, and colors — title slides and content slides **differ across presets** (e.g. Bold Signal’s card + big numerals vs. Notebook Tabs’ paper + edge tabs vs. Swiss Modern’s grid + red bar).
  13. **Normative behavior in Phase 3:**
  14. 1. **Read STYLE_PRESETS for the chosen preset(s)** and reflect **layout + signatures** in HTML/CSS, not only `:root` colors and fonts.
  15. 2. **The editable reference** ([examples/editable-deck-reference.html](examples/editable-deck-reference.html)) supplies **JS/CSS patterns** (chrome, sidebar, objects, history) — not a **frozen slide layout** to paste on every deck. Do **not** reuse one generic “title + subtitle + corner rounded rectangle” geometry for every style.
  16. 3. **`examples/generated/presets/*.html`** are sample decks, not a layout shortcut. The 12 legacy samples are runtime smoke + visual previews; the 34 ported samples are real-template ports from `beautiful-html-templates` using the shared Swiss/reference runtime plus locked slot editing. For real deliveries, match the chosen preset/template grammar instead of reusing a generic README deck.
  17. 4. **Static chrome** (decorations that should not be draggable) may live outside `.slide-edit-layer` (e.g. background pseudo-elements, fixed nav chrome) per preset; **movable** copy and blocks stay as `[data-slide-object]` inside the layer.
  18. If runtime constraints ever conflict with a signature element, **adapt the element** (e.g. implement the same visual with CSS, or split into multiple objects) — do **not** drop preset identity for the sake of a single template.
  19. </preset_fidelity>
  20. <template_ports>
  21. Real-template ports (slot-editable)
  22. For the 34 ported presets from `beautiful-html-templates`, prefer the upstream template's **mood / tone / density** and visual grammar over color-token matching alone.
  23. Interaction baseline: ported decks must use the same Swiss/reference editor chrome and object editor as `examples/editable-deck-reference.html` / `swiss-modern.html`. Native template slots are locked-layout content slots; user-added objects are normal `[data-slide-object][data-oid]` objects.
  24. **Important interaction contract:** `data-edit-slot` is editable content, not a draggable component. In edit mode the user can click slot text/images to change their content with RTE/Undo/Redo/Save/Export, but the upstream template's layout grid, card geometry, decorative layers, and spacing stay locked. Only user-added objects in `.slide-edit-layer` become selectable, draggable, resizable components. Do not promise that every native template child will get object handles unless a separate componentization mode is explicitly requested and implemented.
  25. Template edit modes:
  26. - `data-template-edit-mode="slots"` is the default. It is template-safe: authored content is editable through slots, while layout and decoration remain locked.
  27. - `data-template-edit-mode="components"` is an optional generated mode for semantic blocks that can be represented as `[data-slide-object]`.
  28. - In delivered ported decks, **Unlock layout** componentizes the current slide on demand by moving/wrapping the original editable slot nodes into `.slide-edit-layer`. It must preserve the original element tag, classes, and computed typography, must not create duplicate content copies, and must be undoable back to the original layout position.
  29. - Never componentize every DOM node. Exclude backgrounds, grids, axes, ticks, decorative marks, texture/glitch layers, SVG paths, animation wrappers, and pure layout containers.
  30. When using or extending a ported preset:
  31. 1. Treat the matching `beautiful-html-templates/templates/{source_slug}/template.html` as the visual system: preserve fonts, CSS variables, slide-level classes, layout grid, decorative DOM, and component grammar.
  32. 2. Edit authored content through slots, not by decomposing the template into draggable boxes. Use:
  33. - `data-edit-slot`
  34. - `data-slot-type="text|image|metric|table-cell"`
  35. - `data-slot-label`
  36. - `data-slot-locked-layout="true"`
  37. 3. Keep decorative elements locked unless the user should naturally change that exact item. Grids, paper texture, hairlines, scan lines, pixel/glitch layers, ornamental marks, and layout containers should not become draggable objects.
  38. 4. Preserve `.slide-edit-layer` for user-added freeform objects. Added objects can use `[data-slide-object][data-oid]` and the normal Swiss drag/resize/multi-select runtime; native template slots use the Swiss RTE/Undo/Redo/Save/Export path but do not get move/resize handles.
  39. 5. If a needed slide type is missing, design a new slide in the same template system: same fonts, palette, spacing rhythm, chrome, and component grammar. Do not mix in another template's visual language.
  40. </template_ports>
  41. <discovery_gate>
  42. Discovery gate (do not skip)
  43. Models often jump straight to generating HTML. **For Mode A (new deck) and Mode B (PPT or PDF) after extraction, you must finish Phase 1 before Phase 2, and Phase 2 before Phase 3** — unless a narrow exception below applies.
  44. **Hard rule:** Unless the user provides **in one turn** (or one clearly scoped batch) **every** item in the **Phase 1 checklist**, you **must** run **Phase 1 first** as **one grouped message** (or a structured question UI). If the batch is incomplete, send **only** the **missing** checklist items in the next message — **do not** guess slide count, outline depth, preset, or language. **Invoking `/frontend-slides-editable` or attaching this skill does *not* waive discovery.** A one-liner (e.g. “用 skill 介绍它自己”, “做一份某某主题的演示”) is **topic / intent only**, not a brief.
  45. **Phase 1 checklist (complete brief — all required without model inference):**
  46. | # | Dimension | What “done” means |
  47. |---|-------------|-------------------|
  48. | 1 | **Purpose** | Pitch / teaching / conference / internal / meta-role (e.g. skill onboarding), etc. |
  49. | 2 | **Length** | **Slide-count band** (e.g. short 5–10 / medium 10–20 / long 20+) **or** exact count — never inferred from topic alone |
  50. | 3 | **Content** | Pasted outline, bullets, draft copy, **or** named source + extract scope (e.g. “README §X–Y only”); not “a theme” alone |
  51. | 4 | **Style direction** | Phase 1 style preference cluster **or** a **named** preset from [STYLE_PRESETS.md](STYLE_PRESETS.md) **or** explicit delegation (“you choose”) — if only “you choose”, **Phase 2** still runs to narrow via recommendations/previews unless the user also explicitly skips previews |
  52. | 5 | **Editing** | Confirm **full editable runtime** (this skill’s default) **or** explicit switch to parent **read-only** `frontend-slides` |
  53. | 6 | **Images** | No / yes / unsure; if **yes**, files may arrive later, but intent is explicit |
  54. | 7 | **Mobile** | Required answer: **Desktop-first only** (default) or **Adapt for phone portrait + landscape**; do not infer this silently |
  55. | — | **Language / locale** | When prose is audience-facing and not already stated: monolingual / bilingual / per-locale files — **ask in Phase 1** |
  56. **Images vs outline:** **Co-design outline ↔ images** (Step 1.2) only **after** the user has real assets or links to evaluate. Do **not** skip Phase 1 dimensions just because images are pending; capture “yes, will provide” in Phase 1, then run image evaluation when files exist.
  57. **Mode B (PPT / PDF):** After `extract-pptx.py` (`.pptx`) or `extract-pdf.py` (`.pdf`), present titles/summaries/asset counts and **still run Phase 1** for anything extraction does **not** decide: **length goals** if restructuring, **style direction**, **editing** scope, **locale**, and **image** handling notes on extracted assets. **Do not** jump from “here’s the extract” straight to **only** style picking — close Phase 1 gaps first, **then** Phase 2, **then** codegen.
  58. **When Phase 1 and/or Phase 2 may be shortened (narrow exceptions only):**
  59. 1. **Explicit opt-out** — User clearly skips discovery and/or previews (e.g. “跳过发现,你全部决定”, “no discovery — just generate”).
  60. 2. **Complete written brief** — Same batch already satisfies **every** Phase 1 checklist row **without you guessing**, **and** either (a) a **named preset** is chosen so Phase 2 can be a direct handoff to Phase 3, or (b) the user explicitly allows **no previews** and accepts your single recommended preset.
  61. **Default order:** **Phase 1 (grouped) → Phase 2 (show, don’t tell) → Phase 3.** Never start Phase 3 to “save turns.”
  62. **Partial answers:** Next message = **only** missing Phase 1 items, then resume Phase 2.
  63. **Never infer silence as approval.** **Mode C** (enhance existing HTML): precise change list may skip full Phase 1–2; vague “make it better” → 1–2 clarifying questions first.
  64. **Anti-pattern:** Generating HTML because the skill was attached or because you “already know” a good length or preset — **failure mode**.
  65. Skipping discovery to “save turns” is a failure mode for this skill.
  66. </discovery_gate>
  67. <core_principles>
  68. Core Principles
  69. 1. **Zero Dependencies** — Single HTML files with inline CSS/JS. No npm, no build tools.
  70. 2. **Show, Don't Tell** — Generate visual previews, not abstract choices. People discover what they want by seeing it.
  71. 3. **Distinctive Design** — No generic "AI slop." Every presentation must feel custom-crafted.
  72. 4. **Viewport Fitting (NON-NEGOTIABLE)** — Every slide MUST fit exactly within 100vh. No scrolling within slides, ever. Content overflows? Split into multiple slides.
  73. </core_principles>
  74. <design_aesthetics>
  75. Design Aesthetics
  76. You tend to converge toward generic, "on distribution" outputs. In frontend design, this creates what users call the "AI slop" aesthetic. Avoid this: make creative, distinctive frontends that surprise and delight.
  77. Focus on:
  78. - Typography: Choose fonts that are beautiful, unique, and interesting. Avoid generic fonts like Arial and Inter; opt instead for distinctive choices that elevate the frontend's aesthetics.
  79. - Color & Theme: Commit to a cohesive aesthetic. Use CSS variables for consistency. Dominant colors with sharp accents outperform timid, evenly-distributed palettes. Draw from IDE themes and cultural aesthetics for inspiration.
  80. - Motion: Use **CSS-only** animations and transitions in generated decks (this skill outputs single-file HTML, no React and no Motion library). Focus on high-impact moments: one well-orchestrated load with staggered reveals (`animation-delay`) beats scattered micro-interactions.
  81. - Backgrounds: Create atmosphere and depth rather than defaulting to solid colors. Layer CSS gradients, use geometric patterns, or add contextual effects that match the overall aesthetic.
  82. Avoid generic AI-generated aesthetics:
  83. - Overused Latin font families (Inter, Roboto, Arial, bare system defaults) — note a curated **CJK** system stack is the correct portable choice and is not "generic" in this sense (see Phase 3 §Fonts & portability)
  84. - Cliched color schemes (particularly purple gradients on white backgrounds)
  85. - Predictable layouts and component patterns
  86. - Cookie-cutter design that lacks context-specific character
  87. Interpret creatively and make unexpected choices that feel genuinely designed for the context. Vary between light and dark themes, different fonts, different aesthetics. You still tend to converge on common choices (Space Grotesk, for example) across generations. Avoid this: it is critical that you think outside the box!
  88. </design_aesthetics>
  89. <viewport_fitting_rules>
  90. Viewport Fitting Rules
  91. These invariants apply to EVERY slide in EVERY presentation:
  92. - Every `.slide` must have `height: 100vh; height: 100dvh; overflow: hidden;`
  93. - ALL font sizes and spacing must use `clamp(min, preferred, max)` — never fixed px/rem
  94. - Content containers need `max-height` constraints
  95. - Images: `max-height: min(50vh, 400px)`
  96. - Breakpoints required for heights: 700px, 600px, 500px
  97. - Include `prefers-reduced-motion` support
  98. - Never negate CSS functions directly (`-clamp()`, `-min()`, `-max()` are silently ignored) — use `calc(-1 * clamp(...))` instead
  99. **When generating, read `viewport-base.css` and include its full contents in every presentation.**
  100. Content Density Limits Per Slide
  101. | Slide Type | Maximum Content |
  102. |------------|-----------------|
  103. | Title slide | 1 heading + 1 subtitle + optional tagline |
  104. | Content slide | 1 heading + 4-6 bullet points OR 1 heading + 2 paragraphs |
  105. | Feature grid | 1 heading + 6 cards maximum (2x3 or 3x2) |
  106. | Code slide | 1 heading + 8-10 lines of code |
  107. | Quote slide | 1 quote (max 3 lines) + attribution |
  108. | Image slide | 1 heading + 1 image (max 60vh height) |
  109. **Content exceeds limits? Split into multiple slides. Never cram, never scroll.**
  110. </viewport_fitting_rules>
  111. <quick_start>
  112. <mode_detection>
  113. Phase 0: Detect Mode
  114. Determine what the user wants:
  115. - **Mode A: New Presentation** — Create from scratch. Go to Phase 1.
  116. - **Mode B: PPT / PDF conversion** — Convert a `.pptx` or `.pdf` file. Go to Phase 4.
  117. - **Mode C: Enhancement** — Improve an existing HTML presentation. Read it, understand it, enhance. **Follow Mode C modification rules below.**
  118. </mode_detection>
  119. <mode_c_modification_rules>
  120. Mode C: Modification Rules
  121. When enhancing existing presentations, viewport fitting is the biggest risk:
  122. 1. **Before adding content:** Count existing elements, check against density limits
  123. 2. **Adding images:** Must have `max-height: min(50vh, 400px)`. If slide already has max content, split into two slides
  124. 3. **Adding text:** Max 4-6 bullets per slide. Exceeds limits? Split into continuation slides
  125. 4. **After ANY modification, verify:** `.slide` has `overflow: hidden`, new elements use `clamp()`, images have viewport-relative max-height, content fits at 1280x720
  126. 5. **Proactively reorganize:** If modifications will cause overflow, automatically split content and inform the user. Don't wait to be asked
  127. **When adding images to existing slides:** Move image to new slide or reduce other content first. Never add images without checking if existing content already fills the viewport.
  128. </mode_c_modification_rules>
  129. <phase_1_content_discovery>
  130. Phase 1: Content Discovery (New deck & PPT/PDF path)
  131. **Centralize Phase 1:** For Mode A and for Mode B **after** extraction, deliver the checklist in **one grouped interaction** (see **Discovery gate** above) — not dribbled across many turns. If the user’s first message is incomplete, **only** ask missing items next.
  132. **Do not** jump to style previews or HTML until Phase 1 is satisfied (exceptions: **Discovery gate**).
  133. **Ask ALL discovery questions (1–6 below) in that grouped interaction** when starting from scratch. Use a structured question tool when available; otherwise one concise message:
  134. **Question 1 — Purpose** (header: "Purpose"):
  135. What is this presentation for? Options: Pitch deck / Teaching-Tutorial / Conference talk / Internal presentation
  136. **Question 2 — Length** (header: "Length"):
  137. Approximately how many slides? Options: Short 5-10 / Medium 10-20 / Long 20+
  138. **Question 3 — Content** (header: "Content"):
  139. Do you have content ready? Options: All content ready / Rough notes / Topic only
  140. **Question 4 — Style preference** (header: "Style Pref"):
  141. What visual direction sounds closest as a starting point? Options:
  142. - "Recommend for me" — infer from audience, topic, and content
  143. - "Clean / Professional" — restrained, polished, trustworthy
  144. - "Bold / Experimental" — high-contrast, energetic, surprising
  145. - "Editorial / Warm" — human, crafted, story-forward
  146. - "Technical / Minimal" — precise, structured, product-like
  147. - "I already know the preset" — skip to a direct preset choice
  148. **Question 5 — Editing scope** (header: "Editing"):
  149. Confirm the user wants the **full editable runtime** (default for this skill): object layout, Pages sidebar, undo/redo. If they explicitly want a **minimal read-only** file only, switch to the parent **frontend-slides** skill instead — do not strip the runtime from this skill arbitrarily.
  150. **Question 6 — Assets / images** (header: "Images"):
  151. Will this deck use image files you will provide (folder, uploads, or links)? Options: **No images** (CSS/graphics only) / **Yes — I will provide images** / **Unsure — recommend**
  152. **Question 7 — Mobile adaptation** (header: "Mobile"):
  153. Should this editable deck be adapted for phone use in both portrait and landscape? Options: **Desktop-first only** (recommended; keeps the deck optimized for presenting/editing on desktop) / **Adapt for phone portrait + landscape** (adds mobile-specific CSS hooks, sidebar behavior, and extra viewport verification). This is a required Phase 1 answer for new decks and for PPT/PDF conversions after extraction.
  154. **Language / locale (include in the same grouped message when relevant):** If the deliverable must be monolingual, bilingual, or localized (e.g. CN/EN on the same slides vs two files), ask once here when the user has not already stated it.
  155. If the user has draft content (bullets, doc, outline), ask them to **paste or attach** it in the same turn or immediately after Phase 1.
  156. <image_evaluation>
  157. Step 1.2: Image Evaluation (if images provided)
  158. If **Question 6** was **No images** or the user has not supplied any image files yet → proceed to **Phase 2** after Phase 1 is otherwise complete (you may still ask them to add images later before Phase 3 if they change their mind).
  159. If user provides an image folder (or links) **after** Phase 1 marked images as yes:
  160. 1. **Scan** — List all image files (.png, .jpg, .svg, .webp, etc.)
  161. 2. **Inspect each image** — Use the host's available image/file viewing capability
  162. 3. **Evaluate** — For each: what it shows, USABLE or NOT USABLE (with reason), what concept it represents, dominant colors
  163. 4. **Co-design the outline** — Curated images inform slide structure alongside text. This is NOT "plan slides then add images" — design around both from the start (e.g., 3 screenshots → 3 feature slides, 1 logo → title/closing slide)
  164. 5. **Confirm the outline in one grouped follow-up** (structured question UI when available): "Does this slide outline and image selection look right?" Options: Looks good / Adjust images / Adjust outline
  165. **Logo in previews:** If a usable logo was identified, embed it (base64) into each style preview in Phase 2 — the user sees their brand styled three different ways.
  166. </image_evaluation>
  167. </phase_1_content_discovery>
  168. <phase_2_style_discovery>
  169. Phase 2: Style Discovery (Show, don’t tell)
  170. **Start only after Phase 1 is complete** (see **Discovery gate**).
  171. **Purpose:** Narrow the aesthetic **visually** — most people can’t name what they want. Use **HTML previews** (and concrete anchors from [STYLE_PRESETS.md](STYLE_PRESETS.md) + repo examples: [examples/generated/presets/](examples/generated/presets/) smoke decks, [examples/editable-deck-reference.html](examples/editable-deck-reference.html) for runtime chrome) so the user picks **direction**, then **preset** or **mix**.
  172. **This is the "show, don't tell" phase.**
  173. <style_preference_first>
  174. Step 2.0: Style Preference First
  175. Start from the **style preference captured in Phase 1**. Before asking the user how they want to choose, give a short recommendation list of **2-4 presets** that best match their preference, audience, and content. Tie names to **STYLE_PRESETS** rows (and, when helpful, “see generated sample `*.html` for slug X”) so choices are grounded, not abstract.
  176. Use this mapping as the starting point:
  177. | Style preference | Suggested presets |
  178. |------|------|
  179. | Recommend for me | Infer from purpose + audience + content, then recommend 2-4 strongest fits |
  180. | Clean / Professional | Bold Signal, Electric Studio, Swiss Modern |
  181. | Bold / Experimental | Creative Voltage, Neon Cyber, Split Pastel |
  182. | Editorial / Warm | Dark Botanical, Vintage Editorial, Paper & Ink |
  183. | Technical / Minimal | Swiss Modern, Terminal Green, Notebook Tabs |
  184. | I already know the preset | Skip recommendation explanation and go straight to preset picking |
  185. Explain the recommendation briefly in concrete terms, for example: audience fit, energy level, brand tone, or content density.
  186. If the user already chose **"I already know the preset"** in Phase 1, skip Step 2.1 and go straight to the preset picker.
  187. </style_preference_first>
  188. <style_path>
  189. Step 2.1: Style Path
  190. Ask how they want to choose (header: "Style"):
  191. - "Pick from recommendations" (recommended) — Choose directly from the suggested presets (still **show** thumbnails or one-liner visual cues from presets when possible)
  192. - "Show me options" — Generate **3** single-slide HTML previews (Step 2.3) to **shrink** the search space before locking a preset
  193. - "I know what I want" — Pick from the full preset list in [STYLE_PRESETS.md](STYLE_PRESETS.md)
  194. **If direct preset name:** Confirm against STYLE_PRESETS, then Phase 3. **If "you choose" from Phase 1:** Default path = recommendations + offer previews before generating.
  195. </style_path>
  196. <mood_selection>
  197. Step 2.2: Mood Selection (Guided Discovery)
  198. Ask (header: "Vibe", multiSelect: true, max 2):
  199. What feeling should the audience have? Options:
  200. - Impressed/Confident — Professional, trustworthy
  201. - Excited/Energized — Innovative, bold
  202. - Calm/Focused — Clear, thoughtful
  203. - Inspired/Moved — Emotional, memorable
  204. Use the user's style preference and recommended preset cluster to steer this question. If the preference already strongly determines the direction, keep the previews within that neighborhood instead of scattering across unrelated aesthetics.
  205. </mood_selection>
  206. <style_previews>
  207. Step 2.3: Generate 3 Style Previews
  208. Based on mood **and the earlier style preference**, generate 3 distinct single-slide HTML previews showing typography, colors, animation, and overall aesthetic. Read [STYLE_PRESETS.md](STYLE_PRESETS.md) for available presets and their specifications.
  209. | Mood | Suggested Presets |
  210. |------|-------------------|
  211. | Impressed/Confident | Bold Signal, Electric Studio, Dark Botanical |
  212. | Excited/Energized | Creative Voltage, Neon Cyber, Split Pastel |
  213. | Calm/Focused | Notebook Tabs, Paper & Ink, Swiss Modern |
  214. | Inspired/Moved | Dark Botanical, Vintage Editorial, Pastel Geometry |
  215. Save previews under a **project-local** scratch folder (e.g. `.claude-design-slide-previews/` or `.design/slide-previews/`) as `style-a.html`, `style-b.html`, `style-c.html`. Each should be self-contained, ~50-100 lines, showing one animated title slide.
  216. Open each preview in the default browser when possible: **macOS** `open path/to/file.html`; **Linux** `xdg-open path/to/file.html`; **Windows** `start path\to\file.html`.
  217. When possible, keep at least **2 of the 3 previews** within the recommended preset family so the user sees relevant variations before they see outliers.
  218. </style_previews>
  219. <user_picks>
  220. Step 2.4: User Picks
  221. Ask (header: "Style"):
  222. Which style preview do you prefer? Options: Style A: [Name] / Style B: [Name] / Style C: [Name] / Mix elements
  223. If "Mix elements", ask for specifics.
  224. </user_picks>
  225. </phase_2_style_discovery>
  226. <phase_3_generate_presentation>
  227. Phase 3: Generate Presentation
  228. Generate the full presentation using content from Phase 1 (text, or text + curated images) and style from Phase 2.
  229. If images were provided, the slide outline already incorporates them from Step 1.2. If not, CSS-generated visuals (gradients, shapes, patterns) provide visual interest — this is a fully supported first-class path.
  230. **Before generating, read these supporting files:**
  231. - [STYLE_PRESETS.md](STYLE_PRESETS.md) — **Authoritative visual spec** for the chosen preset (layout, signature, fonts, colors) — same role as in parent `frontend-slides`
  232. - [editor-runtime.md](editor-runtime.md) — **DOM contract** (`data-slide-object`, `data-oid`, edit layer), history types, snap rules, generator checklist
  233. - [examples/editable-deck-reference.html](examples/editable-deck-reference.html) — **Copy the deck runtime** (editor + sidebar + history + persistence patterns); **do not** treat its slide markup as the only allowed layout
  234. - [html-template.md](html-template.md) — HTML architecture and integration notes
  235. - [viewport-base.css](viewport-base.css) — Mandatory CSS (include in full)
  236. - [animation-patterns.md](animation-patterns.md) — Animation reference for the chosen feeling
  237. - For ported presets, also read local `beautiful-html-templates/templates/{source_slug}/template.html` and `template.json` when available; use `STYLE_PRESETS.md` as the index, but the upstream template as the detailed design grammar.
  238. **Key requirements:**
  239. - Single self-contained HTML file, all CSS/JS inline
  240. - All authored images and videos must be embedded into the HTML as `data:` URLs by default; `assets/` paths are allowed only as temporary extraction inputs before generation, never as delivered media `src` values.
  241. - Include the FULL contents of viewport-base.css in the `&lt;style&gt;` block
  242. - **Preset fidelity:** Implement **Layout** and **Signature Elements** from [STYLE_PRESETS.md](STYLE_PRESETS.md) for the selected style. Vary structure slide-to-slide and preset-to-preset; avoid a **single repeated title-slide prototype** across all aesthetics (parent skill does not do that).
  243. - **Ported preset fidelity:** For the 34 ported presets, preserve the upstream template DOM/CSS/classes and make authored content slot-editable. Prefer locked native layout + editable `data-edit-slot` content over making every native element draggable.
  244. - **Every slide** `section.slide` must have a stable `id`; movable content lives in `.slide-edit-layer` as `[data-slide-object][data-oid]` per [editor-runtime.md](editor-runtime.md)
  245. - **Deck slide list:** Never use a global `querySelectorAll('section.slide')` when a filmstrip clones slides — use only slides under the deck wrapper (e.g. `.slides-offset` + `:scope > section.slide`). See [html-template.md](html-template.md) §Regression guard.
  246. - **Mobile adaptation:** If Phase 1 selected phone support, set `data-mobile-adaptation="enabled"` on `<html>` and include portrait + landscape media rules for the deck chrome, sidebar, and slide objects. If not selected, set `data-mobile-adaptation="desktop-default"` so validation can distinguish an explicit desktop-first choice from an omitted decision.
  247. - Embed the **editable deck runtime** (from the reference example): `SlideDeck`, object editor (select / drag / snap / RTE toolbar), `SlideSidebar`, `HistoryStack`, save/export
  248. - **Fonts (see §Fonts & portability below):** For **Latin** display/body, prefer distinctive Fontshare or Google Fonts over generic system faces. For **CJK** (Chinese/Japanese/Korean) text, use a curated **system CJK stack** — full CJK webfonts are multi-megabyte and break the single-file/self-contained promise, so a well-chosen native stack is the correct choice here, not "AI slop". Never leave Latin body text on a bare `Arial`/`Inter`/system default just to avoid a link.
  249. - Add detailed comments explaining each section
  250. - Every section needs a clear `/* === SECTION NAME === */` comment block
  251. <fonts_portability>
  252. Fonts & portability (resolve the self-contained promise deliberately)
  253. The exported file must stay **single-file and self-contained — no external font links** (see Phase 5). That constrains font choices; do not ignore it:
  254. - **Latin display/body:** A distinctive Fontshare/Google face is encouraged for character. But a plain `<link rel="stylesheet" href="https://fonts...">` makes the **export depend on the network** — open offline and the type silently falls back. Choose one:
  255. 1. **Self-host inline** — embed the Latin webfont as base64 `@font-face` `src: url(data:font/woff2;base64,...)` so it travels in the file (best fidelity, larger file), **or**
  256. 2. **Layered fallback** — link the webfont for the live/edit experience but pair it with a strong same-category system stack so an offline export degrades gracefully, not to bare Arial.
  257. The export sanitizer strips leftover external font `<link>`s, so an un-inlined webfont **will** fall back in the delivered file — pick (1) when fidelity matters.
  258. - **CJK (中文 / 日本語 / 한국어):** Do **not** chase a CJK webfont — full coverage is multiple megabytes and cannot be inlined into a single-file deck. Use a curated **native CJK stack**, e.g.
  259. `"PingFang SC","Hiragino Sans GB","Microsoft YaHei","Source Han Sans SC","Noto Sans CJK SC",sans-serif`.
  260. This is the correct, portable choice for CJK — not a quality compromise. Latin glyphs in a CJK deck can still use a webfont via an earlier family in the stack.
  261. - **Mixed CN/EN decks:** Put the Latin display face first, then the CJK stack, so headings get character while CJK body renders in a clean native face: `"Clash Display","PingFang SC",...`.
  262. </fonts_portability>
  263. </phase_3_generate_presentation>
  264. <phase_4_ppt_conversion>
  265. Phase 4: PPT / PDF conversion
  266. When converting **PowerPoint** (`.pptx`) or **PDF** (`.pdf`) files:
  267. 1. **Extract content**
  268. - **PPTX:** `python3 scripts/extract-pptx.py &lt;input.pptx&gt; &lt;output_dir&gt;` (install **python-pptx** if needed: `pip install python-pptx`)
  269. - **PDF:** `python3 scripts/extract-pdf.py &lt;input.pdf&gt; &lt;output_dir&gt;` (install **PyMuPDF** if needed: `pip install pymupdf`). Optional: `--raster-if-empty` renders a page to PNG when that page has no extractable text and no embedded images (e.g. scanned-like pages still need separate OCR; this flag only captures a bitmap of the page).
  270. - Both writers emit the same intermediate: **`extracted-slides.json`** + **`assets/`** (one record per slide/page; PDF has no speaker notes — use `notes: ""`).
  271. 2. **Confirm with user** — Present extracted slide/page titles, content summaries, and image counts
  272. 3. **Phase 1 (close gaps)** — Extraction supplies **content**, but you still need explicit answers for anything not fixed by the file: **style direction** (or preset/delegate), **full editable vs read-only**, **locale**, **length** intent if merging/splitting slides, and **image** handling on extracted assets. **One grouped follow-up** for missing items only.
  273. 4. **Phase 2** — Style discovery (previews / preset pick); see **Phase 2: Style Discovery** in this skill file
  274. 5. **Generate HTML** — Convert to chosen style, preserving all text, images (from assets/), slide order; **PPTX:** speaker notes as HTML comments. **PDF:** no notes in source — omit or leave comment placeholders only if the user supplies them separately.
  275. **PDF caveats:** Text reading order and “title vs body” are heuristic; layout is not object-level like PPTX. Image-only PDFs need `--raster-if-empty` or external OCR for usable text.
  276. </phase_4_ppt_conversion>
  277. </quick_start>
  278. <success_criteria>
  279. Phase 5: Delivery
  280. 1. **Clean up** — Delete the temporary slide-previews folder (see Phase 2) if it exists
  281. 2. **Smoke check (quick)** — Before handing off: open the file once; confirm **no in-slide scrolling** at ~1280×720; if mobile support was selected, also check ~390×844 portrait and ~844×390 landscape; in edit mode, open **Pages**, reorder one slide, **Copy** one slide, add **+New Page**, and refresh — **no duplicate slides or object ids** (regression guard); **Export HTML** opens and runs standalone
  282. 3. **Open** — Launch in default browser: **macOS** `open [filename].html`; **Linux** `xdg-open [filename].html`; **Windows** `start [filename].html`
  283. 4. **Summarize** — Tell the user:
  284. - File location, style name, slide count
  285. - Navigation: Arrow keys, Space, scroll/wheel (wheel disabled while edit mode on), click nav dots
  286. - **Presentation tools:** **Hover the top-left** to reveal **Laser** and **Fullscreen**. **Laser** shows a single laser **dot** that follows the pointer (the trailing-stroke effect was removed by design — no trail nodes are created); **Esc** turns it off, and entering edit mode closes it automatically. **Fullscreen** uses the browser Fullscreen API.
  287. - **Edit mode:** `E` enters edit mode. **Hover the top-left** to reveal **Edit**, **Pages**, and (while editing) **Undo** / **Redo** / **Done**; controls hide after the pointer leaves (~400ms). **Done** (same cluster) exits edit mode — the **Edit** button label stays **Edit**. **Esc** blurs text first, then exits edit mode when not typing in a text box
  288. - **Pages** sidebar for thumbnails, reorder (drag rows), hover **Copy** on a thumbnail to duplicate that page, delete slides, and use **+New Page** beside **Export HTML** to insert a blank style-matched page after the current slide
  289. - **Objects:** drag **⠿** to move; hover **×** on an object or use **Delete/Backspace** to remove (multi-select confirms in English); drag **corner resize** on selected objects to change width/height (text reflows); **Ctrl+click** multi-select (macOS: **Control** key)
  290. - **Add element:** **Add element** (top-left with Edit/Pages in edit mode) opens a menu: **Text**, **Image** (local file, paste, or placeholder), **Video** (local file + controls); added media is embedded as data URLs so exported decks travel as one file
  291. - **Snap:** aligns to **slide center** and **other objects** — not to the outer slide edges
  292. - **Text:** click text to type; floating toolbar: **B/I** plus **Font** · **Scale** · **Px** drawers (click to expand cards for families, scale steps, px presets + custom); **Ctrl+Z** / **Ctrl+Y** or **Ctrl+Shift+Z**; **Cmd+Z** / **Cmd+Y** / **Cmd+Shift+Z** on macOS when not typing in `contenteditable`
  293. - **Save** (`#btnSave`, top-left next to **Edit** / **Pages** when editing — same hover reveal) or **Ctrl+S** / **Cmd+S** stores a browser draft in localStorage and writes a portable HTML file when the browser supports File System Access; otherwise it downloads an updated HTML fallback. **Export HTML** remains in the Pages sidebar and must embed the current deck state plus media into the exported file while stripping transient edit state. The exported file is **portable, single-file, self-contained (no external font links), and trail-free** — it carries the latest edits and keeps Laser/Fullscreen working, but never embeds active laser state.
  294. - How to customize: slide theme `:root` variables, **`--deck-chrome-*`** for edit UI (see [STYLE_PRESETS.md](STYLE_PRESETS.md) §Deck chrome tokens), fonts (inline Latin webfonts as base64 `@font-face` or layered system stacks, and a native CJK stack — see Phase 3 §Fonts & portability; the export stays self-contained with no external font links), `.reveal` animations; keep `data-oid` unique when adding objects
  295. </success_criteria>
  296. <supporting_files>
  297. Supporting Files
  298. | File | Purpose | When to Read |
  299. |------|---------|-------------|
  300. | [editor-runtime.md](editor-runtime.md) | DOM contract, undo types, snap rules, generator checklist | Phase 3 (before codegen) |
  301. | [examples/editable-deck-reference.html](examples/editable-deck-reference.html) | Working reference: full runtime in one file | Phase 3 (copy/adapt JS/CSS) |
  302. | [STYLE_PRESETS.md](STYLE_PRESETS.md) | 46 curated visual presets with colors, fonts, and signature elements | Phase 2 (style selection) |
  303. | [viewport-base.css](viewport-base.css) | Mandatory responsive CSS — copy into every presentation | Phase 3 (generation) |
  304. | [html-template.md](html-template.md) | HTML structure, integration with editable runtime | Phase 3 (generation) |
  305. | [animation-patterns.md](animation-patterns.md) | CSS/JS animation snippets and effect-to-feeling guide | Phase 3 (generation) |
  306. | [scripts/extract-pptx.py](scripts/extract-pptx.py) | Python script for PPT content extraction | Phase 4 (PPTX) |
  307. | [scripts/extract-pdf.py](scripts/extract-pdf.py) | Python script for PDF page extraction (same JSON shape as PPTX) | Phase 4 (PDF) |
  308. | [README.md](README.md) | Bilingual extended overview, comparison table, troubleshooting | Optional (users / maintainers) |
  309. </supporting_files>
README.md · README · 978 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. <div align="center">
  2. # Frontend Slides - Editable
  3. **把 AI 生成的演示文稿,变成可以继续编辑的单文件 HTML。**<br/>
  4. **Create stunning single-file HTML decks that stay editable after generation.**
  5. 一个适用于 Claude Code / Codex 的技能,用来生成惊艳、带动画、单文件的 HTML 演示文稿,并内置浏览器编辑器:可拖拽对象、调整大小、编辑文本、重排页面、本地保存,并导出干净的独立 HTML。
  6. A Claude Code / Codex skill for creating stunning, animation-rich, single-file HTML presentations with a built-in browser editor: drag objects, resize blocks, edit text, reorder slides, save locally, and export a clean standalone HTML.
  7. <p>
  8. <a href="https://github.com/archlizheng/frontend-slides-editable/stargazers"><img alt="GitHub stars" src="https://img.shields.io/github/stars/archlizheng/frontend-slides-editable?style=social" /></a>
  9. <a href="https://github.com/archlizheng/frontend-slides-editable/blob/main/LICENSE"><img alt="License" src="https://img.shields.io/github/license/archlizheng/frontend-slides-editable?color=22c55e" /></a>
  10. <a href="https://github.com/archlizheng/frontend-slides-editable/commits/main"><img alt="Last commit" src="https://img.shields.io/github/last-commit/archlizheng/frontend-slides-editable?color=2563eb" /></a>
  11. <img alt="Claude Code and Codex skill" src="https://img.shields.io/badge/Skill-Claude%20Code%20%2F%20Codex-111827" />
  12. <img alt="Single-file HTML output" src="https://img.shields.io/badge/Output-single--file%20HTML-f97316" />
  13. <img alt="46 presets" src="https://img.shields.io/badge/Presets-46-8b5cf6" />
  14. </p>
  15. <p>
  16. <a href="#toc-installation"><strong>快速安装 / Install</strong></a>
  17. ·
  18. <a href="#toc-gallery">样式图库 / Gallery</a>
  19. ·
  20. <a href="#toc-try">试用参考 / Try it</a>
  21. ·
  22. <a href="#toc-star-history">Star History</a>
  23. </p>
  24. <sub>如果这个 skill 帮你把 deck 从“一次性生成”变成“可继续打磨”,欢迎点一个 Star 支持。<br/>If this helps your decks stay editable instead of disposable, a Star helps more people find it.</sub>
  25. <br/>
  26. <br/>
  27. <p>
  28. <a title="Cobalt Grid" href="examples/generated/presets/cobalt-grid.html"><img src="docs/preset-previews/cobalt-grid-cover.png" width="32%" alt="Cobalt Grid editable deck preview" /></a>
  29. <a title="Studio" href="examples/generated/presets/studio-volt.html"><img src="docs/preset-previews/studio-volt-cover.png" width="32%" alt="Studio editable deck preview" /></a>
  30. <a title="Soft Editorial" href="examples/generated/presets/soft-editorial.html"><img src="docs/preset-previews/soft-editorial-cover.png" width="32%" alt="Soft Editorial editable deck preview" /></a>
  31. </p>
  32. </div>
  33. ## 目录 · Table of contents
  34. - [v2.0 更新摘要 · Release 2.0 highlights](#toc-highlights)
  35. - [这个 Skill 是做什么的 · What this does](#toc-what)
  36. - [安装 · Installation](#toc-installation)
  37. - [用法 · Usage](#toc-usage)
  38. - [样式预览图库 · Style preview gallery](#toc-gallery)
  39. - [文档结构 · Documentation map](#toc-docs)
  40. - [依赖要求 · Requirements](#toc-requirements)
  41. - [试用参考 · Try the reference](#toc-try)
  42. - [Star History](#toc-star-history)
  43. <a id="toc-highlights"></a>
  44. ## v2.0 更新摘要 · Release 2.0 Highlights
  45. 本轮将可编辑运行时与交付体验整体推进到 **2.0**:更强媒体工作流、更顺手的排版工具栏,以及更明确的缩放与导出行为。
  46. This release bumps the editable runtime and authoring workflow to **2.0**: stronger media workflows, a smoother formatting toolbar, and clearer resize + export behavior.
  47. - **Add element(添加对象)**:编辑模式下可从当前页插入文本 / 图片 / 视频占位,并与撤销栈联动。
  48. **Add element**: insert text / image / video placeholders on the current slide from edit mode, wired into undo/redo.
  49. - **图片与视频(Images & video)**:支持本地文件选择、`FileReader` 写入 data URL(单文件自包含);图片支持剪贴板 **Ctrl+V / ⌘V** 粘贴(非富文本焦点时);双击已有图/视频可重新选择文件。
  50. **Images & video**: pick local files and embed as data URLs (single-file friendly); **paste images** with Ctrl/Cmd+V when not typing in rich text; **double-click** existing media to replace.
  51. - **缩放与媒体框(Resize & media box)**:选中对象后除右下角外,增加**右侧 / 底边**手柄,便于沿单边调整;幻灯片内图片/视频取消不当的 `max-height` 限制,缩放框体时画面会随对象尺寸填满(`object-fit: contain`)。
  52. **Resize & media box**: corner handle plus **right and bottom edge** handles; in-slide images/videos no longer clamp to a global `max-height`, so resizing the frame actually scales the visible media (`object-fit: contain`).
  53. - **富文本工具栏(RTE)**:字体 / 字号档位收纳为抽屉;自定义像素字号改为**内联数字输入 + Apply**(避免嵌入环境 `prompt` 不可用);在工具栏上改字体/字号时会**尽量保留文本选区**。
  54. **RTE toolbar**: font / size controls live in drawers; custom px size uses an **inline numeric field + Apply** (no `prompt`); **selection is preserved** when applying font/size from the toolbar where possible.
  55. - **对象与页面(Objects & pages)**:每个对象带删除控件;Pages 删页等有更稳妥的确认与文案;导出 HTML 时会剥离仅编辑器用的上传按钮与 `file` 输入。
  56. **Objects & pages**: per-object delete control; safer slide-delete confirmation copy; **export strips** editor-only upload UI and file inputs.
  57. - **演示工具(Presentation tools)**:左上角热区新增 **Laser** 与 **Fullscreen**;Laser 提供一个**纯激光点**(轨迹效果已按设计移除),激光点跟随指针移动,进入编辑模式或按 Esc 会自动关闭,Fullscreen 使用浏览器 Fullscreen API。
  58. **Presentation tools**: the top-left hover cluster now includes **Laser** and **Fullscreen**; Laser is a **dot only** (the trailing-stroke effect was removed by design) — the dot follows the pointer, it exits on edit mode or Esc, and no trail nodes are ever created. Fullscreen uses the browser Fullscreen API.
  59. - **预设与构建(Presets & build)**:`examples/generated/presets/` 现在分两层维护:12 套 legacy preset 仍由 `scripts/build-preset-decks.py` 生成,用于 runtime smoke + 风格预览;34 套 ported preset 由 `scripts/build-template-port-decks.py` 从真实上游模板移植,保留原始 CSS、字体、slide classes、装饰语言,并统一注入 Swiss/reference 编辑器 + locked slot adapter。重名输出由 ported 层覆盖,以保持 46 个最终 preset 文件。
  60. **Presets & build**: `examples/generated/presets/` now has two build layers: 12 legacy presets still come from `scripts/build-preset-decks.py` for runtime smoke + visual preview, while 34 ported presets are generated by `scripts/build-template-port-decks.py` from real upstream templates, preserving original CSS, fonts, slide classes, decorative vocabulary, and using the shared Swiss/reference editor plus a locked slot adapter. Overlapping output names are intentionally replaced by the ported layer, keeping 46 final preset files.
  61. - **真实模板移植(Template ports)**:当前 ported 覆盖本地 `beautiful-html-templates` 索引中的 **34** 套模板。输出 slug 默认沿用上游 slug,早期 7 套保留兼容别名(如 `signal-gold.html`、`studio-volt.html`、`monochrome-ledger.html`)。这些文件复制并改造本地 `beautiful-html-templates/templates/{source_slug}/template.html`;`data-edit-slot` 内容槽位使用 Swiss 的 RTE/Undo/Redo/Save/Export 体验,网格、纹理、hairlines、glitch、纸张质感等设计骨架锁定,用户新增对象仍可自由拖拽缩放。
  62. **Template ports**: ported coverage now includes all **34** templates in the local `beautiful-html-templates` index. Output slugs default to upstream slugs, while the original seven keep compatibility aliases such as `signal-gold.html`, `studio-volt.html`, and `monochrome-ledger.html`. These files adapt local `beautiful-html-templates/templates/{source_slug}/template.html`; `data-edit-slot` content uses the Swiss RTE/Undo/Redo/Save/Export experience, while grids, textures, hairlines, glitch treatments, and paper systems remain locked. User-added objects remain freely draggable/resizable.
  63. - **槽位与对象的区别(Slots vs objects)**:真实模板的原生标题、正文、指标、图片等通过 `data-edit-slot` 原地编辑,保持原模板布局不被拖散;只有通过 Add element 新增到 `.slide-edit-layer` 的内容会成为带手柄的 `data-slide-object`,可拖拽、缩放、删除和多选。
  64. **Slots vs objects**: native template titles, body copy, metrics, and images are edited in place through `data-edit-slot` while the original layout stays locked. Only content added through **Add element** into `.slide-edit-layer` becomes a handled `data-slide-object` that can be dragged, resized, deleted, and multi-selected.
  65. - **解锁布局(Unlock layout)**:ported decks 默认使用 `data-template-edit-mode="slots"`。如果需要自由移动原生模板内容,可在编辑模式点击 **Unlock layout**,当前页的可编辑槽位会移动/包装成可拖拽/缩放的 `data-slide-object`,保留原始 tag、class 与计算后的字体样式,并支持 Undo 恢复到原布局位置;背景、网格、轴线、纹理、glitch、SVG 细节和纯布局容器仍保持锁定。
  66. **Unlock layout**: ported decks default to `data-template-edit-mode="slots"`. When users need free placement, click **Unlock layout** in edit mode; editable slots on the current slide are moved/wrapped into draggable/resizable `data-slide-object` components while preserving the original tag, classes, and computed typography, with Undo restoring the original layout position. Backgrounds, grids, axes, textures, glitch layers, SVG internals, and pure layout wrappers remain locked.
  67. 参考实现仍以单文件 **`examples/editable-deck-reference.html`** 为契约;生成新 deck 时请继续遵循本仓库 `SKILL.md` 与 `editor-runtime.md`。
  68. The reference contract remains the single file **`examples/editable-deck-reference.html`**; follow `SKILL.md` and `editor-runtime.md` when generating new decks.
  69. <a id="toc-what"></a>
  70. ## 这个 Skill 是做什么的 / What This Does
  71. **Frontend Slides - Editable** 是 **frontend-slides** 的可编辑分支。它保留了原始 skill 的风格探索流程、视口适配规则和 **PPT / PDF** 转换能力,并在此基础上加入完整的浏览器内编辑运行时。**交付用的幻灯片仍应按 `STYLE_PRESETS.md` 实现各预设的布局与签名元素**;可编辑只是增加运行时,不是把多套风格压成同一套版式原型。`examples/generated/presets/` 是运行时自检 + 风格预览样例。
  72. **Frontend Slides - Editable** is the editable fork of **frontend-slides**. It preserves style discovery, viewport discipline, and **PPT / PDF** conversion from the original skill, then adds a full in-browser editing runtime. **Real decks should still implement each preset’s layout and signature elements from `STYLE_PRESETS.md`** — edit mode is an add-on, not permission to reuse one generic slide prototype for every aesthetic. `examples/generated/presets/` is for runtime smoke tests and visual previews.
  73. ### 操作演示(1.0 录屏) · Demo screencast (1.0 era)
  74. **中文**:以下为 **1.0 时期**在浏览器中的操作录屏,便于快速感受可编辑运行时;**2.0** 的变更请见上文「v2.0 更新摘要」与下文「样式预览图库」中的静态截图。若 GitHub 页面未内嵌播放视频,请直接打开下方链接在浏览器中观看。
  75. **English**: This is a **1.0-era** walkthrough (not a full 2.0 feature tour). See **Release 2.0 highlights** above and the **Style preview gallery** screenshots below for **2.0** deltas. If the embedded player does not load, open the URL directly.
  76. https://github.com/user-attachments/assets/dc1db494-5e8c-4bbc-9c4a-d02be74c8e89
  77. 它适合“生成后还要继续改”的场景,例如:
  78. It is designed for workflows where the generated output must remain editable:
  79. - 直接在幻灯片上移动对象
  80. - 使用 **Ctrl+点击** 多选
  81. - 调整文本框大小并让文字自动重排
  82. - 对文本进行 **粗体 / 斜体 / 字体 / 字号** 编辑(工具栏抽屉 + 自定义 px;改格式时尽量保留选区)
  83. - 使用 **Undo / Redo**
  84. - 在 **Pages** 侧栏重排或删除页面
  85. - 用 **Laser** 临时指示内容,或点击 **Fullscreen** 进入浏览器全屏
  86. - **添加** 文本 / 图片 / 视频对象;图片可本地文件或 **粘贴**;视频可本地文件
  87. - 将完整 deck 结构保存为浏览器草稿,并在支持时写入/覆盖用户选择的 HTML 文件
  88. - 导出清理过临时编辑状态、内含当前 deck 状态与媒体素材的独立 `.html`
  89. - move objects directly on slides
  90. - use **Ctrl+click** multi-select
  91. - resize text blocks with automatic reflow; **edge + corner** handles for media objects
  92. - edit text inline with **bold / italic / font / size** (drawer toolbar + custom px; **selection preserved** when possible)
  93. - use **Undo / Redo**
  94. - reorder and delete slides from the **Pages** sidebar
  95. - use **Laser** for temporary pointing, or **Fullscreen** for browser fullscreen presenting
  96. - **add** text / image / video objects; images via local file or **paste**; video via local file
  97. - persist full deck structure as a browser draft and, when supported, write/overwrite the chosen HTML file
  98. - export a sanitized standalone `.html` that embeds the current deck state and media assets
  99. 如果只需要更轻量的只读输出,请使用父 skill [**frontend-slides**](https://github.com/zarazhangrui/frontend-slides)(仓库见链接)。
  100. If you only need the smallest read-only output, use the parent [**frontend-slides**](https://github.com/zarazhangrui/frontend-slides) skill (repository link).
  101. ## Skill 对照表 / Skill Comparison
  102. | 维度 / Dimension | `frontend-slides` | `frontend-slides-editable` |
  103. |------|------|------|
  104. | 核心定位 / Primary job | 生成更轻量的只读 HTML 演示 / Generate lighter read-only HTML decks | 生成可继续编辑的 HTML 演示 / Generate editable HTML decks |
  105. | 输出重量 / Output weight | 更小、更干净 / Smaller and lighter | 更重,但包含完整编辑器 / Heavier, with full editor runtime |
  106. | 样式流程 / Style flow | 依赖父 skill 当前安装版本 / Depends on the installed parent-skill version | 先问样式偏好,再推荐预设,再决定直选或看预览 / Ask style preference first, recommend presets, then choose direct pick or previews |
  107. | 预设表现 / Preset fidelity | 按 `STYLE_PRESETS` 逐套实现版式与签名元素 / Implement layout + signatures per preset | **同上,不得因可编辑而统一成单一首屏模板** / **Same — do not collapse all styles into one title-slide template** |
  108. | 浏览器内编辑 / In-browser editing | 可选文本编辑 / Optional text editing | 默认完整编辑运行时 / Full editing runtime by default |
  109. | 页面管理 / Slide management | 无 Pages 侧栏 / No Pages sidebar | 有缩略图侧栏、重排、删除 / Sidebar with thumbnails, reorder, delete |
  110. | 对象操作 / Object manipulation | 不支持对象级拖拽缩放 / No object-level drag or resize | 支持拖拽、边角/边缘缩放、吸附、多选、添加与删除对象 / Drag, corner/edge resize, snap, multi-select, add & delete objects |
  111. | 历史记录 / Undo and redo | 无完整对象历史 / No full object history | 内置 Undo / Redo / Built-in undo and redo |
  112. | 本地保存 / Local persistence | 仅在启用编辑时保存文本改动 / Save text edits when editing is enabled | 保存浏览器草稿,并导出/写入可迁移 HTML / Save a browser draft and export/write portable HTML |
  113. | 适合场景 / Best for | 交付成品、体积敏感、只读展示 / Final delivery, size-sensitive, read-only decks | 评审后继续改稿、团队协作、客户反馈迭代 / Post-review edits, collaboration, iterative feedback |
  114. | 什么时候选它 / When to choose it | 你已经接近定稿 / You are close to final | 你预期还会持续改布局和内容 / You expect continued layout and content changes |
  115. ## 核心特性 / Key Features
  116. - **零依赖**:单个 HTML 文件,CSS/JS 内联,无需 npm、构建工具或框架
  117. - **可视化风格探索**:通过预览选风格,而不是抽象描述
  118. - **完整可编辑运行时**:拖拽、多选、边角/边缘缩放、对象删除、**添加**图/文/视频、缩略图侧栏与历史记录
  119. - **PPT / PDF 转换**:将 `.pptx` 或 `.pdf` 抽成与 PPT 相同的中间 JSON(`extracted-slides.json` + `assets/`),再生成可编辑网页幻灯片
  120. - **视口安全**:每一页都要求适配视口,不允许内部滚动
  121. - **持久化与导出**:`Ctrl+S` 保存浏览器草稿,并在支持时写入用户选择的 HTML;导出时剥离临时编辑态,并把当前 deck 状态与媒体素材嵌入文件
  122. - **反模板感**:通过精选风格预设,避免千篇一律
  123. - **Zero dependencies**: Single-file HTML with inline CSS/JS, no npm/build/framework
  124. - **Visual style discovery**: pick by preview, not design jargon
  125. - **Full editable runtime**: drag, multi-select, corner/edge resize, object delete, **add** text/image/video, filmstrip, history
  126. - **PPT / PDF conversion**: extract `.pptx` or `.pdf` to the same intermediate JSON (`extracted-slides.json` + `assets/`), then build editable web slides
  127. - **Viewport-safe output**: every slide must fit the viewport without internal scrolling
  128. - **Persistence + export**: `Ctrl+S` saves a browser draft and writes the chosen HTML when supported; export removes transient edit state and embeds the current deck state plus media
  129. - **Anti-generic aesthetics**: curated presets over bland default templates
  130. ## 适合什么场景 / When To Use This
  131. 适合 **frontend-slides-editable**:
  132. Use **frontend-slides-editable** when you want:
  133. - 生成后仍可在浏览器继续微调
  134. - 支持客户/团队评审后的布局修订
  135. - 单文件、零构建的可交付结果
  136. - PowerPoint / PDF 转网页后继续编辑(PDF 为抽取层 + 再设计版式,非像素级还原)
  137. - a generated deck you can continue refining in browser
  138. - post-generation layout iteration during reviews
  139. - a single-file deliverable with no build step
  140. - PowerPoint- or PDF-to-web conversion with continued editing (PDF: extract-then-redesign, not pixel-perfect layout)
  141. 适合 **frontend-slides**:
  142. Use **frontend-slides** when you want:
  143. - 更小更轻的只读输出
  144. - 不需要编辑器界面
  145. - 最轻量的生成文件
  146. - a smaller read-only output
  147. - presentation-only HTML without editor chrome
  148. - the lightest possible generated file
  149. <a id="toc-installation"></a>
  150. ## 安装 / Installation
  151. 仓库地址:**https://github.com/archlizheng/frontend-slides-editable**
  152. 前置要求:需要先安装 **Node.js**(建议 LTS,Node 18+);`npx` 会随 Node.js 一起安装。
  153. Prerequisite: install **Node.js** first (LTS recommended, Node 18+); `npx` is included with Node.js.
  154. ### 一条命令(推荐) / One command (recommended)
  155. ```bash
  156. npx skills add archlizheng/frontend-slides-editable
  157. ```
  158. 如果你的环境里 `skills` CLI 版本支持 URL,也可以用:
  159. If your `skills` CLI supports URL sources, you can also run:
  160. ```bash
  161. npx skills add https://github.com/archlizheng/frontend-slides-editable
  162. ```
  163. 如果仓库里未来包含多个 skill,可指定名称安装:
  164. If this repo contains multiple skills in the future, install by name:
  165. ```bash
  166. npx skills add https://github.com/archlizheng/frontend-slides-editable --skill frontend-slides-editable
  167. ```
  168. ### 验证安装 / Verify installation
  169. 安装后请确认本地 skill 目录中出现 `frontend-slides-editable`,并包含 `SKILL.md`、`STYLE_PRESETS.md`、`examples/`。
  170. After installation, confirm `frontend-slides-editable` exists in your local skills directory and contains `SKILL.md`, `STYLE_PRESETS.md`, and `examples/`.
  171. 然后在对话中直接调用:
  172. Then invoke it in chat:
  173. ```text
  174. /frontend-slides-editable
  175. ```
  176. ### 方式二:手动命令行(备用) / Option B: manual shell (fallback)
  177. 当 `npx skills add` 不可用时,可用手动安装。
  178. If `npx skills add` is unavailable, install manually.
  179. **Codex**
  180. ```bash
  181. mkdir -p ~/.codex/skills
  182. git clone https://github.com/archlizheng/frontend-slides-editable.git ~/.codex/skills/frontend-slides-editable
  183. ```
  184. **Claude Code**
  185. ```bash
  186. mkdir -p ~/.claude/skills
  187. git clone https://github.com/archlizheng/frontend-slides-editable.git ~/.claude/skills/frontend-slides-editable
  188. ```
  189. 若目标目录已存在,请先删除旧目录,或进入目录执行 `git pull` 更新。
  190. If the target folder already exists, remove it first or run `git pull` inside that folder.
  191. ### 升级 / Upgrade
  192. 仓库更新后,重新执行安装命令即可;必要时先删除旧目录再安装。
  193. When updates are available, re-run the install command; if needed, remove the old folder first.
  194. <a id="toc-usage"></a>
  195. ## 用法 / Usage
  196. ### 新建可编辑演示 / Create a new editable presentation
  197. ```text
  198. /frontend-slides-editable
  199. > "帮我做一个关于 AI agents for product teams 的分享"
  200. ```
  201. 这个 skill 会:
  202. The skill will:
  203. 1. **Phase 1(内容发现)— 先集中问齐**:除非用户**同一条消息里**已给齐 **目的、篇幅(页数量级或精确页数)、内容或大纲(非仅主题)、风格偏好方向、是否确认完整可编辑运行时、图片资源意向**,以及需要时的**语言/双语**,否则**一次成组提问**;缺啥就只补问缺失项。**仅调用 `/frontend-slides-editable` 不算答完**。有素材后再做配图评估,并与大纲一起敲定(非「先瞎写页再插图」)。详见 `SKILL.md` 的 **Discovery gate**。
  204. 2. **Phase 2(风格发现)— Show, don’t tell**:结合 `STYLE_PRESETS.md` 与仓库内样例(如 `examples/generated/presets/`)缩小范围;推荐 2–4 个预设后,让用户**直选**或**生成预览**再定稿,然后进入生成。
  205. 3. 若 Phase 1 确认有图:评估素材并与幻灯片结构共同设计;若无图则跳过图片评估。
  206. 4. 产出带编辑运行时的单文件 HTML,并在浏览器中打开。
  207. 1. **Phase 1 (content discovery) — batch first:** Unless the user supplies **in one message** **purpose, length band (or exact count), content or outline (not topic-only), style direction, confirmation of full editable runtime vs read-only parent skill, image intent**, and **language/locale** when relevant, send **one grouped Phase 1**; next turn asks **only** missing items. Invoking the skill **does not** satisfy discovery. After assets exist, run image evaluation and **co-design outline ↔ images**. See **Discovery gate** in `SKILL.md`.
  208. 2. **Phase 2 (style discovery) — show, don’t tell:** Narrow choices using [STYLE_PRESETS.md](STYLE_PRESETS.md) and repo examples (e.g. `examples/generated/presets/`); recommend presets, then **direct pick** or **HTML previews**, then generate.
  209. 3. If Phase 1 says images: evaluate assets and align outline; otherwise skip image evaluation.
  210. 4. Build a single-file editable HTML deck and open it in the browser.
  211. ### 增强现有 HTML / Enhance an existing HTML deck
  212. ```text
  213. /frontend-slides-editable
  214. > "Improve this HTML deck and keep it editable"
  215. ```
  216. 这个 skill 会:
  217. The skill will:
  218. 1. 读取现有演示文稿。
  219. 2. 修改前检查内容密度与视口适配。
  220. 3. 保护编辑运行时契约(如 `section.slide`、`.slide-edit-layer`、`data-oid`)。
  221. 4. 在保持编辑/持久化/导出能力的前提下更新 deck。
  222. 1. Read the current deck.
  223. 2. Validate density and viewport fit before edits.
  224. 3. Preserve runtime contracts (`section.slide`, `.slide-edit-layer`, `data-oid`, etc.).
  225. 4. Update content while keeping edit/persist/export intact.
  226. ### 转换 PowerPoint / Convert a PowerPoint
  227. ```text
  228. /frontend-slides-editable
  229. > "Convert presentation.pptx into an editable web slideshow"
  230. ```
  231. 这个 skill 会:
  232. The skill will:
  233. 1. 运行 `scripts/extract-pptx.py`:提取文字、图片和演讲者备注。
  234. 2. 与你确认提取结果(标题、要点、图片数量等)。
  235. 3. **Phase 1 补全**:提取结果≠完整 brief;仍需一次性确认或补问 **风格方向、可编辑 vs 只读、语言/地区、是否重组页数目标、提取图片的使用方式** 等缺失项。
  236. 4. **Phase 2**:用预设/预览缩小风格(Show, don’t tell),再定预设或混合方向。
  237. 5. 生成可编辑 HTML deck 并保留内容与资源。
  238. 1. Run `scripts/extract-pptx.py`: extract text, images, and speaker notes.
  239. 2. Confirm the extraction (titles, content, image counts).
  240. 3. **Phase 1 gap-fill:** extraction is **not** the full brief; batch any missing **style direction, editable vs read-only, locale, restructuring goals, how to use extracted images**, etc.
  241. 4. **Phase 2:** narrow style with presets/previews (show, don’t tell), then lock preset or mix.
  242. 5. Generate an editable HTML deck with preserved assets.
  243. ### 转换 PDF / Convert a PDF
  244. ```text
  245. /frontend-slides-editable
  246. > "Convert deck.pdf into an editable web slideshow"
  247. ```
  248. **依赖:** Python + **PyMuPDF**(`pip install pymupdf`)。抽取命令:
  249. **Dependency:** Python + **PyMuPDF** (`pip install pymupdf`). Extraction command:
  250. ```bash
  251. python3 scripts/extract-pdf.py path/to/file.pdf path/to/output_dir
  252. # 可选:无文字且无内嵌图的页面整页渲染为 PNG / Optional: rasterize empty pages
  253. python3 scripts/extract-pdf.py path/to/file.pdf path/to/output_dir --raster-if-empty
  254. ```
  255. 与 PPT 相同,输出 **`extracted-slides.json`** 与 **`assets/`**;**每一 PDF 页对应一页「幻灯片」**;PDF 无演讲者备注字段。纯扫描件默认抽不出可选文字,需 `--raster-if-empty` 或外部 OCR。
  256. Same as PPT: writes **`extracted-slides.json`** + **`assets/`**; **one PDF page = one slide**; PDFs have no speaker-notes field. Scanned PDFs need **`--raster-if-empty`** or external OCR for usable text.
  257. 然后同样走 Phase 1 补全 → Phase 2 风格 → Phase 3 生成可编辑 HTML(与 pptx 流程一致,并非「单步机械编译」)。
  258. Then follow the same Phase 1 → 2 → 3 pipeline as PPTX (not a one-step mechanical compile).
  259. ## 编辑体验 / Editing Experience
  260. 生成后的 deck 默认包含:
  261. Generated decks include:
  262. - **编辑模式 / Edit mode**:按 `E` 或从左上角呼出控件
  263. - **Pages 侧栏 / Pages sidebar**:缩略图导航、重排、删除(短英文确认 `Delete slide?`)
  264. - **对象编辑 / Object editing**:用 **⠿** 拖动,角点缩放,吸附线对齐;悬停或选中时 **×** 可删除单个对象
  265. - **添加元素 / Add element**:编辑模式下左上角 **Add element** → Text / Image(本地文件、粘贴或占位)/ Video(本地文件)
  266. - **富文本工具栏 / Rich text toolbar**:首行仅 **B / I** 与 **Font / Scale / Px** 抽屉按钮;点击展开对应卡片(字体族、相对字号、像素字号与其他);支持光标折叠与选区;点击空白处或 **Esc**(非输入时)收起抽屉
  267. - **历史记录 / History**:`Ctrl+Z`、`Ctrl+Y`、`Ctrl+Shift+Z` 及 macOS 等价键
  268. - **持久化 / Persistence**:`Ctrl+S` 保存完整 `.slides-offset` 到 `localStorage` 作为浏览器草稿;Chromium 支持时可写入用户选择的 HTML 文件,不支持时下载更新版
  269. - **导出 / Export**:下载不含临时编辑态与选中态类名、但内含 `#deck-persisted-state` 与 data URL 媒体的干净 `.html`
  270. ## 内置风格 / Included Styles
  271. ### 深色主题 / Dark Themes
  272. - **Bold Signal** - 自信、高冲击力 / Confident, high-impact
  273. - **Electric Studio** - 干净、专业 / Clean, professional
  274. - **Creative Voltage** - 高能霓虹 / Energetic neon
  275. - **Dark Botanical** - 优雅精致 / Elegant, refined
  276. ### 浅色主题 / Light Themes
  277. - **Notebook Tabs** - 编辑感与纸张感 / Editorial paper feel
  278. - **Pastel Geometry** - 友好轻快 / Friendly pastel geometry
  279. - **Split Pastel** - 活泼双色分割 / Playful two-tone split
  280. - **Vintage Editorial** - 杂志感与个性化 / Personality-driven editorial
  281. ### 特殊风格 / Specialty
  282. - **Neon Cyber** - 未来感霓虹 / Futuristic neon glow
  283. - **Terminal Green** - 开发者终端风 / Hacker-terminal aesthetic
  284. - **Swiss Modern** - 包豪斯极简 / Bauhaus-inspired minimal
  285. - **Paper & Ink** - 文艺排版 / Literary paper-and-ink
  286. ### 扩展画廊 / Extended gallery(见 `STYLE_PRESETS.md` 第 13–46 节)
  287. - **8-Bit Orbit** (`8-bit-orbit`) - Pixel-art neon arcade aesthetic on a deep navy void.
  288. - **Biennale Yellow** (`biennale-yellow`) - Solar yellow on warm parchment with deep indigo serif and atmospheric sun-glow gradients.
  289. - **BlockFrame** (`block-frame`) - Neobrutalist deck with pastel-neon color blocks and chunky black borders.
  290. - **Blue Professional** (`blue-professional`) - Cream paper background with electric cobalt blue accents; clean modern professional.
  291. - **Bold Poster** (`bold-poster`) - Editorial poster aesthetic with massive Shrikhand display and a single fire-engine red accent.
  292. - **Broadside** (`broadside`) - Dark editorial canvas with a single fire orange accent and bilingual Latin/Chinese type stack.
  293. - **Capsule** (`capsule`) - Modular pill-shaped cards on warm bone with a full pastel-pop palette.
  294. - **Cartesian** (`cartesian`) - Quiet warm-neutral palette with classical Playfair serifs; tasteful and unhurried.
  295. - **Cobalt Grid** (`cobalt-grid`) - Electric cobalt italic serifs on a graph-paper canvas, anchored by stair-stepped pixel-glitch decorations and slim hairline rules.
  296. - **Coral** (`coral`) - Cream and coral on near-black, set in oversized Bebas Neue.
  297. - **Creative Mode** (`creative-mode`) - Cream paper canvas with confident multi-color (green, pink, orange, yellow) accents and Archivo Black display.
  298. - **Daisy Days** (`daisy-days`) - Cheerful pastel deck with hand-drawn daisies, stars, and rainbows. Friendly, soft, and warm.
  299. - **Editorial Forest** (`editorial-forest`) - Forest green, dusty pink, and warm cream meet Source Serif 4 in a quiet, intentional quarterly-review deck.
  300. - **Editorial Tri-Tone** (`editorial-tri-tone`) - Three-color editorial system: dusty pink, mustard cream, and deep burgundy, set in Bricolage + Instrument Serif.
  301. - **Emerald Editorial** (`emerald-editorial`) - A magazine-cover business deck: emerald + navy + paper, double-rule masthead ornaments, and a bold Bodoni-style display serif.
  302. - **Grove** (`grove`) - Forest-green canvas with cream type, classical Playfair serifs, and a single rust accent.
  303. - **Long Table** (`long-table`) - Warm cream and rust-red supper-club aesthetic with bold uppercase grotesk headlines, italic Fraunces, and pill-shaped outlined buttons.
  304. - **Mat** (`mat`) - Dark sage canvas with bone paper and burnt-orange accent; mid-century modern with wood undertones.
  305. - **Monochrome** (`monochrome-ledger`) - Ivory ledger paper with all-black type; Lora serif headlines, Jost body, no color at all.
  306. - **Neo-Grid Bold** (`neo-grid-yellow`) - Editorial neo-brutalism with a single neon yellow accent on off-white paper.
  307. - **People's Platform (Block & Bold)** (`peoples-platform`) - Activist poster energy: blue, orange, red on cream, with Alfa Slab + Caveat Brush.
  308. - **Pin & Paper** (`pin-and-paper`) - Yellow paper with safety-pin illustrations, ink-blue handwritten Caveat, paper-grain texture.
  309. - **Pink Script — After Hours** (`pink-script`) - Black canvas, hot pink accent, pearl-cream paper, Instrument Serif headlines: late-night editorial luxury.
  310. - **Playful** (`playful`) - Sun-warm peach background with Syne display: a friendly indie launch deck.
  311. - **Raw Grid** (`raw-grid`) - Neo-brutalist deck with thick borders, offset shadows, and a pink/sage/ink palette.
  312. - **Retro Windows** (`retro-windows`) - Windows 95 chrome: gray title bars, MS Sans Serif, pixel typography, full nostalgia.
  313. - **Retro Zine** (`retro-zine`) - Beige paper with green accent and Bebas Neue + Caveat: a riso-printed zine in HTML form.
  314. - **Sakura Chroma** (`sakura-chroma`) - Vintage Japanese cassette-package aesthetic: cream paper, diagonal rainbow ribbons, condensed bold type, JIS-style spec checkboxes.
  315. - **Scatterbrain** (`scatterbrain`) - Post-it inspired: pastel sticky notes, Caveat handwriting, Shrikhand and Zilla Slab type stack.
  316. - **Signal** (`signal-gold`) - Deep navy canvas with bone paper and a single muted-gold accent; institutional with quiet weight.
  317. - **Soft Editorial** (`soft-editorial`) - Cormorant Garamond serif on warm paper with sage, blush, and lemon accents.
  318. - **Stencil & Tablet** (`stencil-tablet`) - Bone paper with stencil-cut headlines and a six-color earth palette: archaeology meets brand.
  319. - **Studio** (`studio-volt`) - Black canvas with electric-yellow type; high-voltage design studio aesthetic.
  320. - **Vellum** (`vellum-navy`) - Deep navy canvas with warm-yellow italic Cormorant serifs and a single dusty teal accent. A quiet, scholarly aesthetic.
  321. ### 扩展画廊自检 · Extended gallery audit
  322. - **双构建层**:`STYLE_PRESETS.md` 中 **46** 套预设与 `examples/generated/presets/*.html` **一一对应**。其中 12 套 legacy preview 由 `scripts/build-preset-decks.py` 生成;34 套 ported preview 由 `scripts/build-template-port-decks.py` 从本地 `beautiful-html-templates` 真实模板生成,并覆盖同名 legacy 输出。改 legacy archetype 后跑前者;改 ported 模板或 slot runtime 后跑后者。
  323. - **Two build layers**: all **46** presets in `STYLE_PRESETS.md` map one-to-one to `examples/generated/presets/*.html`. The 12 legacy previews come from `scripts/build-preset-decks.py`; the 34 ported previews come from `scripts/build-template-port-decks.py` and local `beautiful-html-templates` source templates, replacing same-name legacy outputs. Run the legacy builder after archetype changes; run the port builder after template-port or slot-runtime changes.
  324. - **与上游覆盖范围**:[beautiful-html-templates](https://github.com/zarazhangrui/beautiful-html-templates) 当前本地索引为 **34** 套独立 HTML 模板;本仓库已全部移植为 slot-editable preset。每套都有 `STYLE_PRESETS.md` 条目、builder 映射、生成样例,以及 cover / mid / later 截图目标。
  325. - **Upstream coverage**: the local [beautiful-html-templates](https://github.com/zarazhangrui/beautiful-html-templates) index currently lists **34** standalone HTML templates; this repo now ports all of them as slot-editable presets. Each has a `STYLE_PRESETS.md` entry, builder mapping, generated sample, and cover / mid / later screenshot target.
  326. | 扩展画廊名 / Preset title | Source slug | 样例文件 / Sample slug |
  327. |---------------------------|-------------|-------------------------|
  328. | 8-Bit Orbit | `8-bit-orbit` | `8-bit-orbit.html` |
  329. | Biennale Yellow | `biennale-yellow` | `biennale-yellow.html` |
  330. | BlockFrame | `block-frame` | `block-frame.html` |
  331. | Blue Professional | `blue-professional` | `blue-professional.html` |
  332. | Bold Poster | `bold-poster` | `bold-poster.html` |
  333. | Broadside | `broadside` | `broadside.html` |
  334. | Capsule | `capsule` | `capsule.html` |
  335. | Cartesian | `cartesian` | `cartesian.html` |
  336. | Cobalt Grid | `cobalt-grid` | `cobalt-grid.html` |
  337. | Coral | `coral` | `coral.html` |
  338. | Creative Mode | `creative-mode` | `creative-mode.html` |
  339. | Daisy Days | `daisy-days` | `daisy-days.html` |
  340. | Editorial Forest | `editorial-forest` | `editorial-forest.html` |
  341. | Editorial Tri-Tone | `editorial-tri-tone` | `editorial-tri-tone.html` |
  342. | Emerald Editorial | `emerald-editorial` | `emerald-editorial.html` |
  343. | Grove | `grove` | `grove.html` |
  344. | Long Table | `long-table` | `long-table.html` |
  345. | Mat | `mat` | `mat.html` |
  346. | Monochrome | `monochrome` | `monochrome-ledger.html` |
  347. | Neo-Grid Bold | `neo-grid-bold` | `neo-grid-yellow.html` |
  348. | People's Platform (Block & Bold) | `peoples-platform` | `peoples-platform.html` |
  349. | Pin & Paper | `pin-and-paper` | `pin-and-paper.html` |
  350. | Pink Script — After Hours | `pink-script` | `pink-script.html` |
  351. | Playful | `playful` | `playful.html` |
  352. | Raw Grid | `raw-grid` | `raw-grid.html` |
  353. | Retro Windows | `retro-windows` | `retro-windows.html` |
  354. | Retro Zine | `retro-zine` | `retro-zine.html` |
  355. | Sakura Chroma | `sakura-chroma` | `sakura-chroma.html` |
  356. | Scatterbrain | `scatterbrain` | `scatterbrain.html` |
  357. | Signal | `signal` | `signal-gold.html` |
  358. | Soft Editorial | `soft-editorial` | `soft-editorial.html` |
  359. | Stencil & Tablet | `stencil-tablet` | `stencil-tablet.html` |
  360. | Studio | `studio` | `studio-volt.html` |
  361. | Vellum | `vellum` | `vellum-navy.html` |
  362. <a id="toc-gallery"></a>
  363. ## 样式预览图库 · Style preview gallery
  364. 下列 PNG 存放在 **`docs/preset-previews/`**。legacy preset 展示首页截图;34 套 ported preset 展示 cover / mid / later 三张截图,来源于真实 `beautiful-html-templates` 模板并叠加 Swiss/reference runtime + locked slot adapter。这样 README 既能做 runtime smoke,也能作为真实风格入口,而不是只展示同一套骨架换皮。
  365. These PNGs live under **`docs/preset-previews/`**. Legacy presets show first-slide screenshots; the 34 ported presets show cover / mid / later screenshots generated from real `beautiful-html-templates` source templates plus the Swiss/reference runtime and locked slot adapter. The gallery is now both a runtime smoke surface and a real style entry point, not just a repeated skeleton with different colors.
  366. **重新生成截图 / Regenerate captures**(需本机 **Chrome** 或 **Chromium** 无头模式):
  367. ```bash
  368. python3 scripts/build-preset-decks.py
  369. python3 scripts/capture-preset-previews.py
  370. BEAUTIFUL_TEMPLATES_DIR=./beautiful-html-templates python3 scripts/build-template-port-decks.py
  371. python3 scripts/capture-template-port-previews.py
  372. python3 scripts/validate-template-ports.py
  373. python3 scripts/validate-editable-decks.py
  374. python3 scripts/test-editable-contract-fixtures.py
  375. python3 scripts/validate-skill-workflow.py
  376. python3 scripts/smoke-editable-decks.py
  377. ```
  378. 详见 [`docs/preset-previews/README.md`](docs/preset-previews/README.md)。维护说明与 `CHROME_PATH`、`PREVIEW_VIEWPORT` 见该文件。
  379. ### 冒烟测试模式 · Smoke test modes
  380. `scripts/smoke-editable-decks.py` 通过 `SMOKE_PRESET_MATRIX` 选择测试范围,互动检查与边界检查是两套独立信号——互动矩阵通过并不代表边界矩阵通过:
  381. `scripts/smoke-editable-decks.py` selects its scope via the `SMOKE_PRESET_MATRIX` environment variable. Interaction checks and bounds checks are **two independent signals** — a passing interaction matrix does **not** imply the bounds matrix passes:
  382. | `SMOKE_PRESET_MATRIX` | 模式 / Mode | 检查 / Checks |
  383. |------------------------|-------------|----------------|
  384. | *(unset)* | Sample interaction smoke (default) | 在抽样样例(reference + 少量 preset)上验证编辑、Pages、保存/导出、移动端溢出 / Interaction checks on a small sample (reference + a few presets) |
  385. | `ported` | Ported interaction smoke | 在全部 ported 模板上跑同样的轻量互动检查 / Same lightweight interaction checks across every ported template |
  386. | `bounds` | Bounds-only smoke | 仅做布局可见性检查:所有 preset 的可编辑 slot / object 是否溢出所属 slide / Layout-visibility only: do editable slots/objects overflow their slide |
  387. | `all` | Full matrix | 全部 preset 同时跑互动与边界检查 / Interaction **and** bounds checks across all presets |
  388. **边界报告(Bounds reporting)**:边界失败现在按边(per-edge)报告溢出量——`top` / `right` / `bottom` / `left` 各自给出**正数**像素值(不再出现自相矛盾的负数 `overBottom`),触发失败的那条边才会出现。完整清单(所有溢出元素、各失败边、豁免状态)写入 **`.smoke-artifacts/bounds-report.json`**,控制台只打印简短摘要。
  389. **Bounds reporting**: bounds failures now report overflow **per edge** — `top` / `right` / `bottom` / `left` each carry a **positive** pixel value (no more self-contradictory negative `overBottom`), and only the edge that actually overflowed is listed. The full list (every overflowing element, each failed edge, and exemption status) is written to **`.smoke-artifacts/bounds-report.json`**; the console keeps a short summary.
  390. **有意豁免(Intentional exemptions)**:对刻意放在画布外或旋转的元素,在该元素上加 `data-bounds-exempt="<reason>"`,bounds smoke 会跳过它并计入"已豁免"计数;**reason 为空是硬错误**——每条豁免都必须写明原因。
  391. **Intentional exemptions**: for elements intentionally off-canvas or rotated, add `data-bounds-exempt="<reason>"` to that element. The bounds smoke skips it and counts it as an explicit exemption; **an empty reason is a hard error** — every exemption must state why.
  392. ### 深色主题 · Dark themes
  393. <p>
  394. <a title="Bold Signal" href="examples/generated/presets/bold-signal.html"><img src="docs/preset-previews/bold-signal-cover.png" width="32%" alt="Bold Signal — first slide" /></a>
  395. <a title="Electric Studio" href="examples/generated/presets/electric-studio.html"><img src="docs/preset-previews/electric-studio-cover.png" width="32%" alt="Electric Studio — first slide" /></a>
  396. <a title="Creative Voltage" href="examples/generated/presets/creative-voltage.html"><img src="docs/preset-previews/creative-voltage-cover.png" width="32%" alt="Creative Voltage — first slide" /></a>
  397. </p>
  398. <p>
  399. <a title="Dark Botanical" href="examples/generated/presets/dark-botanical.html"><img src="docs/preset-previews/dark-botanical-cover.png" width="32%" alt="Dark Botanical — first slide" /></a>
  400. </p>
  401. ### 浅色主题 · Light themes
  402. <p>
  403. <a title="Notebook Tabs" href="examples/generated/presets/notebook-tabs.html"><img src="docs/preset-previews/notebook-tabs-cover.png" width="32%" alt="Notebook Tabs — first slide" /></a>
  404. <a title="Pastel Geometry" href="examples/generated/presets/pastel-geometry.html"><img src="docs/preset-previews/pastel-geometry-cover.png" width="32%" alt="Pastel Geometry — first slide" /></a>
  405. <a title="Split Pastel" href="examples/generated/presets/split-pastel.html"><img src="docs/preset-previews/split-pastel-cover.png" width="32%" alt="Split Pastel — first slide" /></a>
  406. </p>
  407. <p>
  408. <a title="Vintage Editorial" href="examples/generated/presets/vintage-editorial.html"><img src="docs/preset-previews/vintage-editorial-cover.png" width="32%" alt="Vintage Editorial — first slide" /></a>
  409. </p>
  410. ### 特殊风格 · Specialty
  411. <p>
  412. <a title="Neon Cyber" href="examples/generated/presets/neon-cyber.html"><img src="docs/preset-previews/neon-cyber-cover.png" width="32%" alt="Neon Cyber — first slide" /></a>
  413. <a title="Terminal Green" href="examples/generated/presets/terminal-green.html"><img src="docs/preset-previews/terminal-green-cover.png" width="32%" alt="Terminal Green — first slide" /></a>
  414. <a title="Swiss Modern" href="examples/generated/presets/swiss-modern.html"><img src="docs/preset-previews/swiss-modern-cover.png" width="32%" alt="Swiss Modern — first slide" /></a>
  415. </p>
  416. <p>
  417. <a title="Paper &amp; Ink" href="examples/generated/presets/paper-ink.html"><img src="docs/preset-previews/paper-ink-cover.png" width="32%" alt="Paper and Ink — first slide" /></a>
  418. </p>
  419. ### 扩展画廊(beautiful-html-templates 对齐)· Extended gallery
  420. <p>
  421. <a title="8-Bit Orbit cover" href="examples/generated/presets/8-bit-orbit.html"><img src="docs/preset-previews/8-bit-orbit-cover.png" width="32%" alt="8-Bit Orbit — cover slide" /></a>
  422. <a title="8-Bit Orbit mid" href="examples/generated/presets/8-bit-orbit.html"><img src="docs/preset-previews/8-bit-orbit-mid.png" width="32%" alt="8-Bit Orbit — mid slide" /></a>
  423. <a title="8-Bit Orbit later" href="examples/generated/presets/8-bit-orbit.html"><img src="docs/preset-previews/8-bit-orbit-later.png" width="32%" alt="8-Bit Orbit — later slide" /></a>
  424. </p>
  425. <p>
  426. <a title="Biennale Yellow cover" href="examples/generated/presets/biennale-yellow.html"><img src="docs/preset-previews/biennale-yellow-cover.png" width="32%" alt="Biennale Yellow — cover slide" /></a>
  427. <a title="Biennale Yellow mid" href="examples/generated/presets/biennale-yellow.html"><img src="docs/preset-previews/biennale-yellow-mid.png" width="32%" alt="Biennale Yellow — mid slide" /></a>
  428. <a title="Biennale Yellow later" href="examples/generated/presets/biennale-yellow.html"><img src="docs/preset-previews/biennale-yellow-later.png" width="32%" alt="Biennale Yellow — later slide" /></a>
  429. </p>
  430. <p>
  431. <a title="BlockFrame cover" href="examples/generated/presets/block-frame.html"><img src="docs/preset-previews/block-frame-cover.png" width="32%" alt="BlockFrame — cover slide" /></a>
  432. <a title="BlockFrame mid" href="examples/generated/presets/block-frame.html"><img src="docs/preset-previews/block-frame-mid.png" width="32%" alt="BlockFrame — mid slide" /></a>
  433. <a title="BlockFrame later" href="examples/generated/presets/block-frame.html"><img src="docs/preset-previews/block-frame-later.png" width="32%" alt="BlockFrame — later slide" /></a>
  434. </p>
  435. <p>
  436. <a title="Blue Professional cover" href="examples/generated/presets/blue-professional.html"><img src="docs/preset-previews/blue-professional-cover.png" width="32%" alt="Blue Professional — cover slide" /></a>
  437. <a title="Blue Professional mid" href="examples/generated/presets/blue-professional.html"><img src="docs/preset-previews/blue-professional-mid.png" width="32%" alt="Blue Professional — mid slide" /></a>
  438. <a title="Blue Professional later" href="examples/generated/presets/blue-professional.html"><img src="docs/preset-previews/blue-professional-later.png" width="32%" alt="Blue Professional — later slide" /></a>
  439. </p>
  440. <p>
  441. <a title="Bold Poster cover" href="examples/generated/presets/bold-poster.html"><img src="docs/preset-previews/bold-poster-cover.png" width="32%" alt="Bold Poster — cover slide" /></a>
  442. <a title="Bold Poster mid" href="examples/generated/presets/bold-poster.html"><img src="docs/preset-previews/bold-poster-mid.png" width="32%" alt="Bold Poster — mid slide" /></a>
  443. <a title="Bold Poster later" href="examples/generated/presets/bold-poster.html"><img src="docs/preset-previews/bold-poster-later.png" width="32%" alt="Bold Poster — later slide" /></a>
  444. </p>
  445. <p>
  446. <a title="Broadside cover" href="examples/generated/presets/broadside.html"><img src="docs/preset-previews/broadside-cover.png" width="32%" alt="Broadside — cover slide" /></a>
  447. <a title="Broadside mid" href="examples/generated/presets/broadside.html"><img src="docs/preset-previews/broadside-mid.png" width="32%" alt="Broadside — mid slide" /></a>
  448. <a title="Broadside later" href="examples/generated/presets/broadside.html"><img src="docs/preset-previews/broadside-later.png" width="32%" alt="Broadside — later slide" /></a>
  449. </p>
  450. <p>
  451. <a title="Capsule cover" href="examples/generated/presets/capsule.html"><img src="docs/preset-previews/capsule-cover.png" width="32%" alt="Capsule — cover slide" /></a>
  452. <a title="Capsule mid" href="examples/generated/presets/capsule.html"><img src="docs/preset-previews/capsule-mid.png" width="32%" alt="Capsule — mid slide" /></a>
  453. <a title="Capsule later" href="examples/generated/presets/capsule.html"><img src="docs/preset-previews/capsule-later.png" width="32%" alt="Capsule — later slide" /></a>
  454. </p>
  455. <p>
  456. <a title="Cartesian cover" href="examples/generated/presets/cartesian.html"><img src="docs/preset-previews/cartesian-cover.png" width="32%" alt="Cartesian — cover slide" /></a>
  457. <a title="Cartesian mid" href="examples/generated/presets/cartesian.html"><img src="docs/preset-previews/cartesian-mid.png" width="32%" alt="Cartesian — mid slide" /></a>
  458. <a title="Cartesian later" href="examples/generated/presets/cartesian.html"><img src="docs/preset-previews/cartesian-later.png" width="32%" alt="Cartesian — later slide" /></a>
  459. </p>
  460. <p>
  461. <a title="Cobalt Grid cover" href="examples/generated/presets/cobalt-grid.html"><img src="docs/preset-previews/cobalt-grid-cover.png" width="32%" alt="Cobalt Grid — cover slide" /></a>
  462. <a title="Cobalt Grid mid" href="examples/generated/presets/cobalt-grid.html"><img src="docs/preset-previews/cobalt-grid-mid.png" width="32%" alt="Cobalt Grid — mid slide" /></a>
  463. <a title="Cobalt Grid later" href="examples/generated/presets/cobalt-grid.html"><img src="docs/preset-previews/cobalt-grid-later.png" width="32%" alt="Cobalt Grid — later slide" /></a>
  464. </p>
  465. <p>
  466. <a title="Coral cover" href="examples/generated/presets/coral.html"><img src="docs/preset-previews/coral-cover.png" width="32%" alt="Coral — cover slide" /></a>
  467. <a title="Coral mid" href="examples/generated/presets/coral.html"><img src="docs/preset-previews/coral-mid.png" width="32%" alt="Coral — mid slide" /></a>
  468. <a title="Coral later" href="examples/generated/presets/coral.html"><img src="docs/preset-previews/coral-later.png" width="32%" alt="Coral — later slide" /></a>
  469. </p>
  470. <p>
  471. <a title="Creative Mode cover" href="examples/generated/presets/creative-mode.html"><img src="docs/preset-previews/creative-mode-cover.png" width="32%" alt="Creative Mode — cover slide" /></a>
  472. <a title="Creative Mode mid" href="examples/generated/presets/creative-mode.html"><img src="docs/preset-previews/creative-mode-mid.png" width="32%" alt="Creative Mode — mid slide" /></a>
  473. <a title="Creative Mode later" href="examples/generated/presets/creative-mode.html"><img src="docs/preset-previews/creative-mode-later.png" width="32%" alt="Creative Mode — later slide" /></a>
  474. </p>
  475. <p>
  476. <a title="Daisy Days cover" href="examples/generated/presets/daisy-days.html"><img src="docs/preset-previews/daisy-days-cover.png" width="32%" alt="Daisy Days — cover slide" /></a>
  477. <a title="Daisy Days mid" href="examples/generated/presets/daisy-days.html"><img src="docs/preset-previews/daisy-days-mid.png" width="32%" alt="Daisy Days — mid slide" /></a>
  478. <a title="Daisy Days later" href="examples/generated/presets/daisy-days.html"><img src="docs/preset-previews/daisy-days-later.png" width="32%" alt="Daisy Days — later slide" /></a>
  479. </p>
  480. <p>
  481. <a title="Editorial Forest cover" href="examples/generated/presets/editorial-forest.html"><img src="docs/preset-previews/editorial-forest-cover.png" width="32%" alt="Editorial Forest — cover slide" /></a>
  482. <a title="Editorial Forest mid" href="examples/generated/presets/editorial-forest.html"><img src="docs/preset-previews/editorial-forest-mid.png" width="32%" alt="Editorial Forest — mid slide" /></a>
  483. <a title="Editorial Forest later" href="examples/generated/presets/editorial-forest.html"><img src="docs/preset-previews/editorial-forest-later.png" width="32%" alt="Editorial Forest — later slide" /></a>
  484. </p>
  485. <p>
  486. <a title="Editorial Tri-Tone cover" href="examples/generated/presets/editorial-tri-tone.html"><img src="docs/preset-previews/editorial-tri-tone-cover.png" width="32%" alt="Editorial Tri-Tone — cover slide" /></a>
  487. <a title="Editorial Tri-Tone mid" href="examples/generated/presets/editorial-tri-tone.html"><img src="docs/preset-previews/editorial-tri-tone-mid.png" width="32%" alt="Editorial Tri-Tone — mid slide" /></a>
  488. <a title="Editorial Tri-Tone later" href="examples/generated/presets/editorial-tri-tone.html"><img src="docs/preset-previews/editorial-tri-tone-later.png" width="32%" alt="Editorial Tri-Tone — later slide" /></a>
  489. </p>
  490. <p>
  491. <a title="Emerald Editorial cover" href="examples/generated/presets/emerald-editorial.html"><img src="docs/preset-previews/emerald-editorial-cover.png" width="32%" alt="Emerald Editorial — cover slide" /></a>
  492. <a title="Emerald Editorial mid" href="examples/generated/presets/emerald-editorial.html"><img src="docs/preset-previews/emerald-editorial-mid.png" width="32%" alt="Emerald Editorial — mid slide" /></a>
  493. <a title="Emerald Editorial later" href="examples/generated/presets/emerald-editorial.html"><img src="docs/preset-previews/emerald-editorial-later.png" width="32%" alt="Emerald Editorial — later slide" /></a>
  494. </p>
  495. <p>
  496. <a title="Grove cover" href="examples/generated/presets/grove.html"><img src="docs/preset-previews/grove-cover.png" width="32%" alt="Grove — cover slide" /></a>
  497. <a title="Grove mid" href="examples/generated/presets/grove.html"><img src="docs/preset-previews/grove-mid.png" width="32%" alt="Grove — mid slide" /></a>
  498. <a title="Grove later" href="examples/generated/presets/grove.html"><img src="docs/preset-previews/grove-later.png" width="32%" alt="Grove — later slide" /></a>
  499. </p>
  500. <p>
  501. <a title="Long Table cover" href="examples/generated/presets/long-table.html"><img src="docs/preset-previews/long-table-cover.png" width="32%" alt="Long Table — cover slide" /></a>
  502. <a title="Long Table mid" href="examples/generated/presets/long-table.html"><img src="docs/preset-previews/long-table-mid.png" width="32%" alt="Long Table — mid slide" /></a>
  503. <a title="Long Table later" href="examples/generated/presets/long-table.html"><img src="docs/preset-previews/long-table-later.png" width="32%" alt="Long Table — later slide" /></a>
  504. </p>
  505. <p>
  506. <a title="Mat cover" href="examples/generated/presets/mat.html"><img src="docs/preset-previews/mat-cover.png" width="32%" alt="Mat — cover slide" /></a>
  507. <a title="Mat mid" href="examples/generated/presets/mat.html"><img src="docs/preset-previews/mat-mid.png" width="32%" alt="Mat — mid slide" /></a>
  508. <a title="Mat later" href="examples/generated/presets/mat.html"><img src="docs/preset-previews/mat-later.png" width="32%" alt="Mat — later slide" /></a>
  509. </p>
  510. <p>
  511. <a title="Monochrome cover" href="examples/generated/presets/monochrome-ledger.html"><img src="docs/preset-previews/monochrome-ledger-cover.png" width="32%" alt="Monochrome — cover slide" /></a>
  512. <a title="Monochrome mid" href="examples/generated/presets/monochrome-ledger.html"><img src="docs/preset-previews/monochrome-ledger-mid.png" width="32%" alt="Monochrome — mid slide" /></a>
  513. <a title="Monochrome later" href="examples/generated/presets/monochrome-ledger.html"><img src="docs/preset-previews/monochrome-ledger-later.png" width="32%" alt="Monochrome — later slide" /></a>
  514. </p>
  515. <p>
  516. <a title="Neo-Grid Bold cover" href="examples/generated/presets/neo-grid-yellow.html"><img src="docs/preset-previews/neo-grid-yellow-cover.png" width="32%" alt="Neo-Grid Bold — cover slide" /></a>
  517. <a title="Neo-Grid Bold mid" href="examples/generated/presets/neo-grid-yellow.html"><img src="docs/preset-previews/neo-grid-yellow-mid.png" width="32%" alt="Neo-Grid Bold — mid slide" /></a>
  518. <a title="Neo-Grid Bold later" href="examples/generated/presets/neo-grid-yellow.html"><img src="docs/preset-previews/neo-grid-yellow-later.png" width="32%" alt="Neo-Grid Bold — later slide" /></a>
  519. </p>
  520. <p>
  521. <a title="People's Platform (Block & Bold) cover" href="examples/generated/presets/peoples-platform.html"><img src="docs/preset-previews/peoples-platform-cover.png" width="32%" alt="People's Platform (Block & Bold) — cover slide" /></a>
  522. <a title="People's Platform (Block & Bold) mid" href="examples/generated/presets/peoples-platform.html"><img src="docs/preset-previews/peoples-platform-mid.png" width="32%" alt="People's Platform (Block & Bold) — mid slide" /></a>
  523. <a title="People's Platform (Block & Bold) later" href="examples/generated/presets/peoples-platform.html"><img src="docs/preset-previews/peoples-platform-later.png" width="32%" alt="People's Platform (Block & Bold) — later slide" /></a>
  524. </p>
  525. <p>
  526. <a title="Pin & Paper cover" href="examples/generated/presets/pin-and-paper.html"><img src="docs/preset-previews/pin-and-paper-cover.png" width="32%" alt="Pin & Paper — cover slide" /></a>
  527. <a title="Pin & Paper mid" href="examples/generated/presets/pin-and-paper.html"><img src="docs/preset-previews/pin-and-paper-mid.png" width="32%" alt="Pin & Paper — mid slide" /></a>
  528. <a title="Pin & Paper later" href="examples/generated/presets/pin-and-paper.html"><img src="docs/preset-previews/pin-and-paper-later.png" width="32%" alt="Pin & Paper — later slide" /></a>
  529. </p>
  530. <p>
  531. <a title="Pink Script — After Hours cover" href="examples/generated/presets/pink-script.html"><img src="docs/preset-previews/pink-script-cover.png" width="32%" alt="Pink Script — After Hours — cover slide" /></a>
  532. <a title="Pink Script — After Hours mid" href="examples/generated/presets/pink-script.html"><img src="docs/preset-previews/pink-script-mid.png" width="32%" alt="Pink Script — After Hours — mid slide" /></a>
  533. <a title="Pink Script — After Hours later" href="examples/generated/presets/pink-script.html"><img src="docs/preset-previews/pink-script-later.png" width="32%" alt="Pink Script — After Hours — later slide" /></a>
  534. </p>
  535. <p>
  536. <a title="Playful cover" href="examples/generated/presets/playful.html"><img src="docs/preset-previews/playful-cover.png" width="32%" alt="Playful — cover slide" /></a>
  537. <a title="Playful mid" href="examples/generated/presets/playful.html"><img src="docs/preset-previews/playful-mid.png" width="32%" alt="Playful — mid slide" /></a>
  538. <a title="Playful later" href="examples/generated/presets/playful.html"><img src="docs/preset-previews/playful-later.png" width="32%" alt="Playful — later slide" /></a>
  539. </p>
  540. <p>
  541. <a title="Raw Grid cover" href="examples/generated/presets/raw-grid.html"><img src="docs/preset-previews/raw-grid-cover.png" width="32%" alt="Raw Grid — cover slide" /></a>
  542. <a title="Raw Grid mid" href="examples/generated/presets/raw-grid.html"><img src="docs/preset-previews/raw-grid-mid.png" width="32%" alt="Raw Grid — mid slide" /></a>
  543. <a title="Raw Grid later" href="examples/generated/presets/raw-grid.html"><img src="docs/preset-previews/raw-grid-later.png" width="32%" alt="Raw Grid — later slide" /></a>
  544. </p>
  545. <p>
  546. <a title="Retro Windows cover" href="examples/generated/presets/retro-windows.html"><img src="docs/preset-previews/retro-windows-cover.png" width="32%" alt="Retro Windows — cover slide" /></a>
  547. <a title="Retro Windows mid" href="examples/generated/presets/retro-windows.html"><img src="docs/preset-previews/retro-windows-mid.png" width="32%" alt="Retro Windows — mid slide" /></a>
  548. <a title="Retro Windows later" href="examples/generated/presets/retro-windows.html"><img src="docs/preset-previews/retro-windows-later.png" width="32%" alt="Retro Windows — later slide" /></a>
  549. </p>
  550. <p>
  551. <a title="Retro Zine cover" href="examples/generated/presets/retro-zine.html"><img src="docs/preset-previews/retro-zine-cover.png" width="32%" alt="Retro Zine — cover slide" /></a>
  552. <a title="Retro Zine mid" href="examples/generated/presets/retro-zine.html"><img src="docs/preset-previews/retro-zine-mid.png" width="32%" alt="Retro Zine — mid slide" /></a>
  553. <a title="Retro Zine later" href="examples/generated/presets/retro-zine.html"><img src="docs/preset-previews/retro-zine-later.png" width="32%" alt="Retro Zine — later slide" /></a>
  554. </p>
  555. <p>
  556. <a title="Sakura Chroma cover" href="examples/generated/presets/sakura-chroma.html"><img src="docs/preset-previews/sakura-chroma-cover.png" width="32%" alt="Sakura Chroma — cover slide" /></a>
  557. <a title="Sakura Chroma mid" href="examples/generated/presets/sakura-chroma.html"><img src="docs/preset-previews/sakura-chroma-mid.png" width="32%" alt="Sakura Chroma — mid slide" /></a>
  558. <a title="Sakura Chroma later" href="examples/generated/presets/sakura-chroma.html"><img src="docs/preset-previews/sakura-chroma-later.png" width="32%" alt="Sakura Chroma — later slide" /></a>
  559. </p>
  560. <p>
  561. <a title="Scatterbrain cover" href="examples/generated/presets/scatterbrain.html"><img src="docs/preset-previews/scatterbrain-cover.png" width="32%" alt="Scatterbrain — cover slide" /></a>
  562. <a title="Scatterbrain mid" href="examples/generated/presets/scatterbrain.html"><img src="docs/preset-previews/scatterbrain-mid.png" width="32%" alt="Scatterbrain — mid slide" /></a>
  563. <a title="Scatterbrain later" href="examples/generated/presets/scatterbrain.html"><img src="docs/preset-previews/scatterbrain-later.png" width="32%" alt="Scatterbrain — later slide" /></a>
  564. </p>
  565. <p>
  566. <a title="Signal cover" href="examples/generated/presets/signal-gold.html"><img src="docs/preset-previews/signal-gold-cover.png" width="32%" alt="Signal — cover slide" /></a>
  567. <a title="Signal mid" href="examples/generated/presets/signal-gold.html"><img src="docs/preset-previews/signal-gold-mid.png" width="32%" alt="Signal — mid slide" /></a>
  568. <a title="Signal later" href="examples/generated/presets/signal-gold.html"><img src="docs/preset-previews/signal-gold-later.png" width="32%" alt="Signal — later slide" /></a>
  569. </p>
  570. <p>
  571. <a title="Soft Editorial cover" href="examples/generated/presets/soft-editorial.html"><img src="docs/preset-previews/soft-editorial-cover.png" width="32%" alt="Soft Editorial — cover slide" /></a>
  572. <a title="Soft Editorial mid" href="examples/generated/presets/soft-editorial.html"><img src="docs/preset-previews/soft-editorial-mid.png" width="32%" alt="Soft Editorial — mid slide" /></a>
  573. <a title="Soft Editorial later" href="examples/generated/presets/soft-editorial.html"><img src="docs/preset-previews/soft-editorial-later.png" width="32%" alt="Soft Editorial — later slide" /></a>
  574. </p>
  575. <p>
  576. <a title="Stencil & Tablet cover" href="examples/generated/presets/stencil-tablet.html"><img src="docs/preset-previews/stencil-tablet-cover.png" width="32%" alt="Stencil & Tablet — cover slide" /></a>
  577. <a title="Stencil & Tablet mid" href="examples/generated/presets/stencil-tablet.html"><img src="docs/preset-previews/stencil-tablet-mid.png" width="32%" alt="Stencil & Tablet — mid slide" /></a>
  578. <a title="Stencil & Tablet later" href="examples/generated/presets/stencil-tablet.html"><img src="docs/preset-previews/stencil-tablet-later.png" width="32%" alt="Stencil & Tablet — later slide" /></a>
  579. </p>
  580. <p>
  581. <a title="Studio cover" href="examples/generated/presets/studio-volt.html"><img src="docs/preset-previews/studio-volt-cover.png" width="32%" alt="Studio — cover slide" /></a>
  582. <a title="Studio mid" href="examples/generated/presets/studio-volt.html"><img src="docs/preset-previews/studio-volt-mid.png" width="32%" alt="Studio — mid slide" /></a>
  583. <a title="Studio later" href="examples/generated/presets/studio-volt.html"><img src="docs/preset-previews/studio-volt-later.png" width="32%" alt="Studio — later slide" /></a>
  584. </p>
  585. <p>
  586. <a title="Vellum cover" href="examples/generated/presets/vellum-navy.html"><img src="docs/preset-previews/vellum-navy-cover.png" width="32%" alt="Vellum — cover slide" /></a>
  587. <a title="Vellum mid" href="examples/generated/presets/vellum-navy.html"><img src="docs/preset-previews/vellum-navy-mid.png" width="32%" alt="Vellum — mid slide" /></a>
  588. <a title="Vellum later" href="examples/generated/presets/vellum-navy.html"><img src="docs/preset-previews/vellum-navy-later.png" width="32%" alt="Vellum — later slide" /></a>
  589. </p>
  590. <a id="toc-docs"></a>
  591. ## 文档结构 / Documentation Map
  592. | 文件 File | 作用 Purpose |
  593. |------|------|
  594. | `SKILL.md` | 核心流程与交付规则 / Workflow and delivery behavior |
  595. | `editor-runtime.md` | 运行时 DOM 契约与检查项 / Runtime DOM contracts and checklist |
  596. | `examples/editable-deck-reference.html` | 标准参考实现 / Canonical runtime reference |
  597. | `examples/demos/frontend-slides-editable-readme-demo.html` | README 配套演示 deck(手工维护,非构建脚本输出)/ README companion deck (hand-maintained, not from build script) |
  598. | `examples/frontend-slides-editable-skill-intro-bilingual.html` | 双语 Skill 介绍 deck / Bilingual skill intro deck |
  599. | `examples/pitch-deck-readme-editable-fork.html` | 可编辑分支 pitch 样例 / Editable-fork pitch sample |
  600. | `STYLE_PRESETS.md` | 46 个精选风格 / 46 curated style presets |
  601. | `viewport-base.css` | 视口适配基础样式 / Viewport-fit base CSS |
  602. | `html-template.md` | HTML 基础结构说明 / Base HTML integration notes |
  603. | `animation-patterns.md` | 动画参考 / CSS/JS animation reference |
  604. | `docs/editable-preset-runtime-tdd-plan.md` | 可编辑 preset 稳定性与 Pages 增强的 TDD 开发方案 / TDD implementation plan for editable preset stability and Pages enhancements |
  605. | `scripts/extract-pptx.py` | PPT 内容提取脚本 / PPT extraction script |
  606. | `scripts/extract-pdf.py` | PDF 按页抽取(与 PPT 相同 JSON 形状)/ PDF per-page extraction (same JSON shape as PPT) |
  607. | `examples/generated/presets/*.html` | 46 个单风格可编辑样例;34 个为真实模板 port / One editable visual-preview deck per preset; 34 are real template ports |
  608. | `docs/preset-previews/*.png` | legacy 首页图 + ported 三图图库 / Legacy cover PNGs plus ported cover/mid/later gallery |
  609. | `scripts/build-preset-decks.py` | 生成 12 个 legacy runtime smoke + visual preview 样例 / Build the 12 legacy runtime smoke + visual preview samples |
  610. | `scripts/build-template-port-decks.py` | 从本地 `beautiful-html-templates` 生成 34 个 Swiss runtime + locked slot 真实模板 port / Build 34 Swiss-runtime + locked-slot real-template ports from local `beautiful-html-templates` |
  611. | `scripts/validate-editable-decks.py` | 全量静态验证可编辑 runtime 契约 / Static validation for editable runtime contracts |
  612. | `scripts/test-editable-contract-fixtures.py` | 确认坏 fixture 会被 validator 抓到 / Negative fixture tests for validator coverage |
  613. | `scripts/validate-skill-workflow.py` | 验证 skill workflow 文档包含移动端必问与 runtime 入口 / Validate workflow docs for mobile and runtime decisions |
  614. | `scripts/smoke-editable-decks.py` | Chrome 抽样验证 Pages、保存、导出与移动端横向溢出;`SMOKE_PRESET_MATRIX` 选择 sample(默认)/ported/bounds/all 模式 / Sampled Chrome smoke for Pages, save/export, and mobile horizontal overflow; `SMOKE_PRESET_MATRIX` selects sample(default)/ported/bounds/all |
  615. | `scripts/capture-preset-previews.py` | 用无头 Chrome 生成 legacy/全量 `*-cover.png` / Headless Chrome capture for legacy/all `*-cover.png` |
  616. | `scripts/capture-template-port-previews.py` | 用无头 Chrome 生成 34 套 ported `*-cover.png`、`*-mid.png`、`*-later.png` / Headless Chrome capture for 34 ported cover/mid/later PNGs |
  617. ## 架构说明 / Architecture
  618. 这个 skill 延续父项目“渐进式披露”策略:
  619. This skill follows the parent project's progressive-disclosure approach:
  620. - `SKILL.md` 承载流程和规则 / `SKILL.md` carries workflow and rules
  621. - 支撑文件按需加载 / supporting docs load on demand
  622. - 可编辑运行时保持唯一参考实现 / one canonical runtime implementation
  623. - 生成结果零依赖且可移植 / generated decks stay dependency-free and portable
  624. 运行时有几个不可破坏的约束:
  625. The runtime depends on non-negotiable contracts:
  626. - 每页必须是带稳定 `id` 的 `section.slide`
  627. - 可移动内容位于 `.slide-edit-layer`
  628. - 可编辑块使用 `[data-slide-object][data-oid]`
  629. - 页面枚举必须限定真实 deck 根,不能包含缩略图克隆
  630. - each slide is a `section.slide` with stable `id`
  631. - movable content lives in `.slide-edit-layer`
  632. - editable blocks use `[data-slide-object][data-oid]`
  633. - slide enumeration must stay scoped to the true deck root
  634. ## 设计理念 / Philosophy
  635. 1. **通过“看见选项”建立审美。** 风格预览比抽象问卷更有效。
  636. 2. **生成不是定稿。** 第一版必须天然可编辑。
  637. 3. **依赖就是债务。** 单文件 HTML 应该多年后仍可用。
  638. 4. **尊重视口。** 放不下就拆页,而不是隐藏溢出。
  639. 5. **有辨识度优先。** 工具应帮助产出可记忆的内容。
  640. 1. **People discover taste by seeing options.** Previews beat abstract questionnaires.
  641. 2. **Generated is not final.** The first draft should remain editable.
  642. 3. **Dependencies are debt.** A single HTML should still work years later.
  643. 4. **Respect the viewport.** Split slides instead of hiding overflow.
  644. 5. **Distinctiveness wins.** Presentation tools should produce memorable output.
  645. <a id="toc-requirements"></a>
  646. ## 依赖要求 / Requirements
  647. - [Claude Code](https://claude.ai/claude-code) 或任意将 skill 安装到 **`~/.claude/skills/`** 的兼容客户端;**OpenAI Codex** 使用 **`~/.codex/skills/`**;**Cursor** 等请按各产品文档中的 skills 目录或技能加载方式配置
  648. - 如需 PPT 转换:Python + `python-pptx`
  649. - 如需 PDF 抽取(转 HTML 前的中间层):Python + **PyMuPDF**(`pip install pymupdf`);扫描件/纯图 PDF 默认无可靠文本,见上文「转换 PDF」
  650. - 如需浏览器编辑/导出:现代 Chromium、Safari 或 Firefox
  651. - [Claude Code](https://claude.ai/claude-code) or any runner that loads skills from **`~/.claude/skills/`**; **OpenAI Codex** uses **`~/.codex/skills/`**; **Cursor** and others: follow that product’s documented skills directory or skill-loading flow
  652. - For PPT conversion: Python + `python-pptx`
  653. - For PDF extraction (intermediate step before HTML): Python + **PyMuPDF** (`pip install pymupdf`); scanned/image-only PDFs need raster/OCR — see **Convert a PDF** above
  654. - For editing/export: modern Chromium, Safari, or Firefox-class browser
  655. <a id="toc-try"></a>
  656. ## 试用参考 / Try The Reference
  657. 打开:
  658. Open:
  659. ```text
  660. examples/editable-deck-reference.html
  661. ```
  662. **其它手工维护样例(非 `build-preset-decks.py` 产物) / Other hand-maintained samples (not produced by `build-preset-decks.py`):**
  663. ```text
  664. examples/demos/frontend-slides-editable-readme-demo.html
  665. examples/frontend-slides-editable-skill-intro-bilingual.html
  666. examples/pitch-deck-readme-editable-fork.html
  667. ```
  668. **46 个独立可编辑样例(每种风格一个 HTML):**
  669. **Forty-six separate editable decks (one file per preset):**
  670. ```text
  671. examples/generated/presets/bold-signal.html
  672. examples/generated/presets/electric-studio.html
  673. examples/generated/presets/creative-voltage.html
  674. examples/generated/presets/dark-botanical.html
  675. examples/generated/presets/notebook-tabs.html
  676. examples/generated/presets/pastel-geometry.html
  677. examples/generated/presets/split-pastel.html
  678. examples/generated/presets/vintage-editorial.html
  679. examples/generated/presets/neon-cyber.html
  680. examples/generated/presets/terminal-green.html
  681. examples/generated/presets/swiss-modern.html
  682. examples/generated/presets/paper-ink.html
  683. examples/generated/presets/8-bit-orbit.html
  684. examples/generated/presets/biennale-yellow.html
  685. examples/generated/presets/block-frame.html
  686. examples/generated/presets/blue-professional.html
  687. examples/generated/presets/bold-poster.html
  688. examples/generated/presets/broadside.html
  689. examples/generated/presets/capsule.html
  690. examples/generated/presets/cartesian.html
  691. examples/generated/presets/cobalt-grid.html
  692. examples/generated/presets/coral.html
  693. examples/generated/presets/creative-mode.html
  694. examples/generated/presets/daisy-days.html
  695. examples/generated/presets/editorial-forest.html
  696. examples/generated/presets/editorial-tri-tone.html
  697. examples/generated/presets/emerald-editorial.html
  698. examples/generated/presets/grove.html
  699. examples/generated/presets/long-table.html
  700. examples/generated/presets/mat.html
  701. examples/generated/presets/monochrome-ledger.html
  702. examples/generated/presets/neo-grid-yellow.html
  703. examples/generated/presets/peoples-platform.html
  704. examples/generated/presets/pin-and-paper.html
  705. examples/generated/presets/pink-script.html
  706. examples/generated/presets/playful.html
  707. examples/generated/presets/raw-grid.html
  708. examples/generated/presets/retro-windows.html
  709. examples/generated/presets/retro-zine.html
  710. examples/generated/presets/sakura-chroma.html
  711. examples/generated/presets/scatterbrain.html
  712. examples/generated/presets/signal-gold.html
  713. examples/generated/presets/soft-editorial.html
  714. examples/generated/presets/stencil-tablet.html
  715. examples/generated/presets/studio-volt.html
  716. examples/generated/presets/vellum-navy.html
  717. ```
  718. 重新生成上述 HTML 与 README 中的预览图:
  719. Regenerate preset HTML **and** README gallery PNGs:
  720. ```bash
  721. python3 scripts/build-preset-decks.py
  722. python3 scripts/capture-preset-previews.py
  723. BEAUTIFUL_TEMPLATES_DIR=./beautiful-html-templates python3 scripts/build-template-port-decks.py
  724. python3 scripts/capture-template-port-previews.py
  725. python3 scripts/validate-template-ports.py
  726. ```
  727. (只改 legacy 时跑前两行;只改 ported 模板时跑后两行;截图需本机 Chrome/Chromium。)
  728. (Run the first two lines for legacy-only changes; run the last two for ported-template changes; screenshots require local Chrome/Chromium.)
  729. 然后试试:
  730. Then try:
  731. - 按 `E` / press `E`
  732. - 点击 `data-edit-slot` 文本槽位编辑(不显示移动/缩放手柄);点击新增对象继续拖拽缩放 / click `data-edit-slot` text slots to edit (no move/resize handles); added objects remain draggable/resizable
  733. - 使用浮动工具栏 / use the floating toolbar
  734. - 用 **⠿** 拖拽对象 / drag objects with **⠿**
  735. - 缩放选中对象 / resize a selected object
  736. - 在 **Pages** 重排 / reorder in **Pages**
  737. - 用 **×** 删对象或删页(页删除会确认)/ delete objects or slides (slide delete confirms)
  738. - **Add element** 添加文本/图/视频 / use **Add element** for text, image, or video
  739. - 按 `Ctrl+S` 保存 / press `Ctrl+S`
  740. - 导出 deck / export the deck
  741. <a id="toc-star-history"></a>
  742. ## Star History
  743. 如果你喜欢这个项目,欢迎在 GitHub 上给它一个 Star;这会帮助更多需要可编辑 HTML 演示文稿的人发现它。
  744. If you like this project, consider starring it on GitHub so more people can discover editable HTML decks.
  745. <a href="https://www.star-history.com/#archlizheng/frontend-slides-editable&amp;Date">
  746. <picture>
  747. <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=archlizheng/frontend-slides-editable&amp;type=Date&amp;theme=dark" />
  748. <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=archlizheng/frontend-slides-editable&amp;type=Date" />
  749. <img alt="Star History Chart" src="https://api.star-history.com/svg?repos=archlizheng/frontend-slides-editable&amp;type=Date" />
  750. </picture>
  751. </a>
  752. ## 致谢 / Credits
  753. 基于 [@zarazhangrui](https://github.com/zarazhangrui/frontend-slides) 的 **frontend-slides** 扩展而来,本分支新增可编辑运行时。34 套 ported preset 复制并改造 [beautiful-html-templates](https://github.com/zarazhangrui/beautiful-html-templates) 的本地模板作为 slot-editable 样例;许可沿用上游仓库声明,本仓库的风格索引仍以 `STYLE_PRESETS.md` 为入口。
  754. Based on **frontend-slides** by [@zarazhangrui](https://github.com/zarazhangrui/frontend-slides), with editable runtime added in this fork. Thirty-four ported presets adapt local templates from [beautiful-html-templates](https://github.com/zarazhangrui/beautiful-html-templates) as slot-editable samples; licensing follows the upstream repository, and `STYLE_PRESETS.md` remains this skill's style index.
  755. ## 许可证 / License
  756. MIT(与父项目一致,除非另有说明)。
  757. MIT (same as the parent project unless otherwise noted).

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.