Communitygithub.com

前端幻灯片

创建精美、动画丰富的 HTML 演示文稿,支持从头开始创建或转换 PowerPoint 文件。当用户想要构建演示文稿、将 PPT/PPTX 转换为网页或为演讲/路演创建幻灯片时使用。帮助非设计人员通过视觉探索而非抽象选择发现他们的美学风格。

前端幻灯片 是什么?

该技能旨在创建零依赖、动画丰富的 HTML 演示文稿,完全在浏览器中运行。它适用于多种场景:从头创建演讲演示、转换 PPT 或 PPTX 文件、优化现有 HTML 演示文稿,以及帮助不确定设计偏好的用户探索风格。其核心原则包括:零外部依赖(单个自包含 HTML 文件)、所有幻灯片必须适配视口且无内部滚动、通过视觉预览展示而不使用抽象问卷,以及避免通用模板化的设计。工作流程分为几个清晰步骤:检测模式(新创建/转换 PPT/增强现有演示)、发现内容(仅收集必要信息如用途和长度)、发现风格(默认使用视觉探索,生成 3 个单页预览让用户选择或组合)、构建演示(输出自包含 HTML 文件,使用 CSS 自定义属性和演示控制器类)、强制视口适配、验证(在不同分辨率下检查)以及交付(清理临时文件,生成摘要)。它还包含专门的 PPT/PPTX 转换子流程,使用 python-pptx 提取内容,然后应用与新建演示相同的工作流程。实现的 HTML/CSS 部分要求内联样式、使用 Google Fonts 或 Fontshare 字体,以及抽象背景和视觉方向。JavaScript 部分必须包含键盘导航、触摸滑动导航、鼠标滚轮导航、进度指示器和入场动画触发。可访问性要求使用语义结构、保持对比度可读、支持纯键盘导航并尊重 preferers-reduced-motion。该技能还有严格的内容密度限制(如标题页最多 1 个标题加 1 个副标题)和反模式列表(如通用启动渐变、系统字体、长项目符号列表等)。该技能适用于支持自定义技能或 AI 助手的编辑器或 CLI 环境,并与其他 ECC 技能(如前端模式、液态玻璃设计、端到端测试)协同工作。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/affaan-m/ECC/tree/main/skills/frontend-slides

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Frontend Slides

创建零依赖、动画丰富的 HTML 演示文稿,完全在浏览器中运行。

灵感来源于 zarazhangrui 展示的视觉探索方法(致谢:@zarazhangrui)。

何时激活

  • 创建演讲演示、路演演示、工作坊演示或内部演示
  • 将 .ppt 或 .pptx 幻灯片转换为 HTML 演示文稿
  • 改进现有 HTML 演示文稿的布局、动效或排版
  • 与不了解自己设计偏好的用户一起探索演示风格

不可妥协的原则

  1. 零依赖:默认生成单个自包含 HTML 文件,CSS 和 JS 内联嵌入。
  2. 视口适配是强制要求:每张幻灯片必须适配一个视口,无内部滚动。
  3. 展示而非讲述:使用视觉预览代替抽象风格问卷。
  4. 独特设计:避免通用的紫色渐变、Inter 字体配白色背景、模板化的演示文稿。
  5. 生产质量:确保代码有注释、可访问、响应式且性能良好。

在生成前,请阅读 STYLE_PRESETS.md 了解视口安全的 CSS 基础、密度限制、预设目录和 CSS 注意事项。

工作流程

1. 检测模式

选择其中一条路径:

  • 新演示文稿:用户有主题、笔记或完整草稿
  • PPT 转换:用户有 .ppt 或 .pptx 文件
  • 增强:用户已有 HTML 幻灯片并希望改进

2. 发现内容

仅询问最少必要信息:

  • 用途:路演、教学、会议演讲、内部更新
  • 长度:短(5-10 张)、中(10-20 张)、长(超过 20 张)
  • 内容状态:已完成的文案、粗略笔记、仅主题

如果用户有内容,请在样式设定前要求用户粘贴内容。

3. 发现风格

默认使用视觉探索。

如果用户已经知道想要的预设,跳过预览,直接使用该预设。

否则:

  1. 询问演示文稿应营造什么感觉:印象深刻、充满活力、聚焦、灵感迸发。
  2. 在 .ecc-design/slide-previews/ 目录下生成 3 个单页预览文件。
  3. 每个预览必须是自包含的,清晰展示排版/颜色/动效,并且幻灯片内容保持在约 100 行以内。
  4. 询问用户保留哪个预览,或者混合哪些元素。

在将情绪映射到风格时,使用 STYLE_PRESETS.md 中的预设指南。

4. 构建演示文稿

输出以下之一:

  • presentation.html
  • [presentation-name].html

仅当演示文稿包含提取的或用户提供的图片时,才使用 assets/ 文件夹。

必需结构:

  • 语义化的幻灯片部分
  • STYLE_PRESETS.md 中的视口安全 CSS 基础
  • 用于主题值的 CSS 自定义属性
  • 用于键盘、滚轮和触摸导航的演示控制器类
  • 用于揭示动画的 Intersection Observer
  • 减少动效支持

5. 强制视口适配

将此视为硬性门禁。

规则:

  • 每个 .slide 必须使用 height: 100vh; height: 100dvh; overflow: hidden;
  • 所有文字和间距必须使用 clamp() 缩放
  • 当内容无法容纳时,拆分成多张幻灯片
  • 绝不允许通过缩小文字至不可读大小来解决溢出问题
  • 绝不允许幻灯片内部出现滚动条

使用 STYLE_PRESETS.md 中的密度限制和强制 CSS 块。

6. 验证

在以下尺寸检查完成的演示文稿:

  • 1920x1080
  • 1280x720
  • 768x1024
  • 375x667
  • 667x375

如果浏览器自动化可用,请使用它验证没有幻灯片溢出且键盘导航正常工作。

7. 交付

在交接时:

  • 删除临时预览文件,除非用户希望保留
  • 如适用,使用适合平台的打开工具打开演示文稿
  • 总结文件路径、所用预设、幻灯片数量以及易于自定义主题的点

使用当前操作系统的正确打开工具:

  • macOS:open file.html
  • Linux:xdg-open file.html
  • Windows:start "" file.html

PPT / PPTX 转换

对于 PowerPoint 转换:

  1. 优先使用 python3 和 python-pptx 提取文本、图片和备注。
  2. 如果 python-pptx 不可用,询问是安装它还是回退到手动/基于导出的工作流程。
  3. 保留幻灯片顺序、演讲者备注和提取的素材。
  4. 提取后,运行与新建演示文稿相同的风格选择工作流程。

保持转换跨平台。不要依赖仅 macOS 的工具,当 Python 可以完成工作时。

实现要求

HTML / CSS

  • 除非用户明确希望多文件项目,否则使用内联 CSS 和 JS。
  • 字体可以来自 Google Fonts 或 Fontshare。
  • 偏好氛围背景、强烈的层级排版和清晰的视觉方向。
  • 使用抽象形状、渐变、网格、噪点和几何图形,而非插画。

JavaScript

包含:

  • 键盘导航
  • 触摸/滑动导航
  • 鼠标滚轮导航
  • 进度指示器或幻灯片索引
  • 入场触发动画

可访问性

  • 使用语义化结构(main、section、nav)
  • 保持对比度可读
  • 支持纯键盘导航
  • 尊重 prefers-reduced-motion

内容密度限制

使用这些最大值,除非用户明确要求更密集的幻灯片且可读性仍然保持:

幻灯片类型限制
标题1 个标题 + 1 个副标题 + 可选标语
内容1 个标题 + 4-6 个项目符号或 2 个短段落
功能网格最多 6 张卡片
代码最多 8-10 行
引用1 条引用 + 归属
图片视口约束下的 1 张图片

反模式

  • 没有视觉标识的通用启动渐变
  • 除非有意识地用于编辑风格,否则使用系统字体
  • 长的项目符号墙
  • 需要滚动的代码块
  • 在短屏幕上会破坏布局的固定高度内容框
  • 无效的否定 CSS 函数,如 -clamp(...)

相关 ECC 技能

  • frontend-patterns:用于演示文稿周围的组件和交互模式
  • liquid-glass-design:当演示文稿有意借鉴苹果玻璃美学时
  • e2e-testing:如果需要自动化浏览器验证最终演示文稿

交付清单

  • 演示文稿可在浏览器中从本地文件运行
  • 每张幻灯片适配视口且无滚动
  • 风格独特且有辨识度
  • 动画有意而非杂乱
  • 尊重减少动效
  • 在交接时解释文件路径和自定义点

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

accessibility

Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA. Use when building or auditing UI that must meet WCAG 2.2 Level AA, or when reviewing a change for keyboard, contrast, or screen-reader support.

affaan-m/content-engine

Create platform-native content systems for X, LinkedIn, TikTok, YouTube, newsletters, and repurposed multi-platform campaigns. Use when the user wants social posts, threads, scripts, content calendars, or one source asset adapted cleanly across platforms.

affaan-m/ECC

Multi-platform content distribution across X, LinkedIn, Threads, and Bluesky. Adapts content per platform using content-engine patterns. Never posts identical content cross-platform. Use when the user wants to distribute content across social platforms.

affaan-m/fal-ai-media

Unified media generation via fal.ai MCP — image, video, and audio. Covers text-to-image (Nano Banana), text/image-to-video (Seedance, Kling, Veo 3), text-to-speech (CSM-1B), and video-to-audio (ThinkSound). Use when the user wants to generate images, videos, or audio with AI.

affaan-m/manim-video

日本語翻訳:このファイルは manim-video 用の日本語翻訳が必要です

affaan-m/remotion-video-creation

Remotion のベストプラクティス - React で動画を作成する。3D、アニメーション、音声、字幕、チャート、トランジションなどをカバーするドメイン固有の29のルール。

affaan-m/video-editing

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

agent-architecture-audit

Full-stack diagnostic for agent and LLM applications. Audits the 12-layer agent stack for wrapper regression, memory pollution, tool discipline failures, hidden repair loops, and rendering corruption. Produces severity-ranked findings with code-first fixes. Essential for developers building agent applications, autonomous loops, or any LLM-powered feature. Use when an agent or LLM feature misbehaves and the failing layer is unknown, or before shipping an agent stack.

agent-eval

Head-to-head comparison of coding agents (Claude Code, Aider, Codex, etc.) on custom tasks with pass rate, cost, time, and consistency metrics. Use when choosing between coding agents, or when a change to an agent setup needs measured pass rate, cost, and time rather than an impression.

agent-harness-construction

Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates. Use when defining or revising an agent

agentic-engineering

Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing. Use when planning or executing engineering work that agents will carry out end to end.

agentic-os

Build persistent multi-agent operating systems on Claude Code. Covers kernel architecture, specialist agents, slash commands, file-based memory, scheduled automation, and state management without external databases. Use when building a persistent multi-agent system on Claude Code with its own memory, commands, and scheduling.

agent-introspection-debugging

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports. Use when an agent run fails and you need a reproducible diagnosis instead of a retry.

agent-payment-x402

Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk and X Layer through OKX Payments / OKX Agent Payments Protocol. Use when an agent must pay for something itself and needs per-task budgets, spending controls, and a non-custodial wallet.

agent-self-evaluation

Use after completing any non-trivial task. The agent self-rates its output on 5 axes — accuracy, completeness, clarity, actionability, conciseness — with concrete evidence per criterion. Produces a structured 1-5 scorecard with specific improvement suggestions.

agent-sort

Build an evidence-backed ECC install plan for a specific repo by sorting skills, commands, rules, hooks, and extras into DAILY vs LIBRARY buckets using parallel repo-aware review passes. Use when ECC should be trimmed to what a project actually needs instead of loading the full bundle.

ai-first-engineering

Engineering operating model for teams where AI agents generate a large share of implementation output. Use when setting team process, review gates, or ownership rules for a codebase largely written by agents.

ai-regression-testing

Regression testing strategies for AI-assisted development. Sandbox-mode API testing without database dependencies, automated bug-check workflows, and patterns to catch AI blind spots where the same model writes and reviews code. Use when adding regression coverage to AI-assisted code, or when the same model both wrote and reviewed a change.

android-clean-architecture

Clean Architecture patterns for Android and Kotlin Multiplatform projects — module structure, dependency rules, UseCases, Repositories, and data layer patterns. Use when structuring modules, layers, or data flow in an Android or KMP project.

angular-developer

Generates Angular code and provides architectural guidance. Trigger when creating projects, components, or services, or for best practices on reactivity (signals, linkedSignal, resource), forms, dependency injection, routing, SSR, accessibility (ARIA), animations, styling (component styles, Tailwind CSS), testing, or CLI tooling.

相关技能