Communitygithub.com

前端幻灯片

从零创建或通过转换PowerPoint文件,生成动画丰富的HTML演示文稿。当用户需要构建演示、将PPT/PPTX转换为网页或为演讲/推介制作幻灯片时使用。帮助非设计师通过视觉探索而非抽象选择来发现其审美偏好。

前端幻灯片 是什么?

这是一个用于生成零依赖、动画丰富的HTML幻灯片的前端技能,适用于演讲、推介、教学等场景。它支持从零创建或从PPT/PPTX文件转换,并强调视觉探索设计风格,帮助不确定审美偏好的用户快速找到合适的样式。该技能强制每个幻灯片必须适应视口(无内部滚动),并使用内联CSS和JS生成单文件HTML,同时确保生产级质量(可访问、响应式、高性能)。工作流程包括检测模式、内容收集、风格预览(生成3个单页预览供用户选择)、构建(使用预设CSS基础)、视口适配验证以及交付(清理临时文件并打开幻灯片)。支持跨平台PPT转换(优先使用python-pptx),并包含无障碍支持(语义结构、减少运动偏好)。相关技能包括frontend-patterns、liquid-glass-design和e2e-testing。

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

在你喜欢的 AI 中提问

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

文档

前端幻灯片 是做什么的?

创建零依赖、动画丰富的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/ 文件夹。

必需的结构:

  • 语义化的幻灯片节(section)
  • 来自 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. 提取后,执行与新建演示文稿相同的风格选择工作流。

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

实现要求

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/claude-api

Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.

affaan-m/everything-claude-code

End-to-end marketing campaign planning and execution. Covers audience research, positioning, campaign angle definition, landing page copy, email sequences, social posts, ad copy, short-form video scripts, and content calendars. Use as the orchestration layer for multi-channel product launches. Use when planning or executing a multi-channel product launch, or producing landing page, email, social, or ad copy.

affaan-m/everything-claude-code

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/everything-claude-code-conventions

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use when the user asks to build web components, pages, or applications and the visual direction matters as much as the code quality.

affaan-m/gget

gget CLI and Python workflow for quick genomic database queries, sequence lookup, BLAST-style searches, enrichment checks, and reproducible bioinformatics evidence logs.

affaan-m/literature-review

Systematic literature-review workflow for academic, biomedical, technical, and scientific topics, including search planning, source screening, synthesis, citation checks, and evidence logging.

affaan-m/motion-ui

Production-ready UI motion system for React/Next.js. Use when implementing animations, transitions, or motion patterns.

affaan-m/project-guidelines-example

Example project-specific skill template based on a real production application.

affaan-m/pubmed-database

Direct PubMed and NCBI E-utilities search workflows for biomedical literature, MeSH queries, PMID lookup, citation retrieval, and API-backed literature monitoring.

affaan-m/scholar-evaluation

Structured scholarly-work evaluation for papers, proposals, literature reviews, methods sections, evidence quality, citation support, and research-writing feedback.

affaan-m/uspto-database

USPTO patent and trademark data workflow for official record lookup, PatentSearch queries, TSDR checks, assignment data, and reproducible IP research logs.

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.

相关技能