slide-deck
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSlide Deck Builder — Technical Instructions
幻灯片构建器——技术说明
You are building a browser-based presentation slide deck as a React + Vite app. Your job is to produce slides that feel handcrafted and intentional — never generic or AI-generated looking.
Before you begin coding any slides, you MUST ask the user for the presentation content/topic if it has not been provided. Do not invent content. You may scaffold the app shell and styling system first, but all actual slide content must come from the user or from in this directory.
slide-guidelines.md你将以React + Vite应用的形式构建基于浏览器的演示幻灯片。你的任务是制作出看起来像是手工精心设计的幻灯片——绝对不能有通用或AI生成的廉价感。
在开始编写任何幻灯片代码之前,如果用户尚未提供演示内容/主题,你必须先向用户询问。 不要自行编造内容。你可以先搭建应用框架和样式系统,但所有实际的幻灯片内容必须来自用户或此目录下的文件。
slide-guidelines.md1. Tech Stack
1. 技术栈
| Layer | Choice |
|---|---|
| Build | Vite |
| Framework | React 18+ with TypeScript |
| Animation | Framer Motion (motion/react) |
| Styling | Tailwind CSS v4 |
| Charts | Recharts |
| Icons | Lucide React |
| Routing | Keyboard/click navigation (no router needed) |
| Code highlighting | (only if needed) Prism React Renderer |
Install only what you need. Do not add libraries speculatively.
| 层级 | 选择 |
|---|---|
| 构建工具 | Vite |
| 框架 | React 18+ 搭配 TypeScript |
| 动画 | Framer Motion (motion/react) |
| 样式 | Tailwind CSS v4 |
| 图表 | Recharts |
| 图标 | Lucide React |
| 路由 | 键盘/点击导航(无需路由器) |
| 代码高亮 | (仅在需要时使用)Prism React Renderer |
仅安装所需的依赖,不要随意添加库。
2. Project Structure
2. 项目结构
slides/
├── index.html
├── package.json
├── vite.config.ts
├── tailwind.config.ts
├── tsconfig.json
├── public/
│ └── images/ # All slide images go here
├── src/
│ ├── main.tsx
│ ├── App.tsx # Slide deck shell, navigation, keyboard controls
│ ├── index.css # Tailwind imports + custom fonts + base styles
│ ├── slides/
│ │ ├── index.ts # Export ordered array of all slides
│ │ ├── 01-intro.tsx
│ │ ├── 02-problem.tsx
│ │ └── ... # One file per slide or small group of related slides
│ ├── components/
│ │ ├── SlideLayout.tsx # Shared slide wrapper (scaling, padding, background)
│ │ ├── AnimatedText.tsx # Reusable text entrance animations
│ │ ├── Chart.tsx # Recharts wrapper
│ │ ├── ImageSlide.tsx # Image display component
│ │ ├── InteractiveBlock.tsx # For custom interactive UI per slide
│ │ └── ...
│ └── lib/
│ ├── animations.ts # Shared Framer Motion variants and transitions
│ ├── theme.ts # Color palette, font sizes, spacing tokens
│ └── useSlideScale.ts # Hook for viewport-fitting scaleslides/
├── index.html
├── package.json
├── vite.config.ts
├── tailwind.config.ts
├── tsconfig.json
├── public/
│ └── images/ # 所有幻灯片图片存放于此
├── src/
│ ├── main.tsx
│ ├── App.tsx # 幻灯片框架、导航、键盘控制
│ ├── index.css # Tailwind 导入 + 自定义字体 + 基础样式
│ ├── slides/
│ │ ├── index.ts # 导出所有幻灯片的有序数组
│ │ ├── 01-intro.tsx
│ │ ├── 02-problem.tsx
│ │ └── ... # 每个幻灯片或相关小分组对应一个文件
│ ├── components/
│ │ ├── SlideLayout.tsx # 共享幻灯片包装器(缩放、内边距、背景)
│ │ ├── AnimatedText.tsx # 可复用的文本入场动画
│ │ ├── Chart.tsx # Recharts 包装器
│ │ ├── ImageSlide.tsx # 图片展示组件
│ │ ├── InteractiveBlock.tsx # 用于单张幻灯片的自定义交互UI
│ │ └── ...
│ └── lib/
│ ├── animations.ts # 共享的 Framer Motion 变体和过渡效果
│ ├── theme.ts # 调色板、字体大小、间距令牌
│ └── useSlideScale.ts # 适配视口缩放的 Hook3. Style Discovery — Mood & Presets
3. 风格探索——氛围与预设
Step 1: Ask the User for Mood
步骤1:询问用户期望的氛围
Before choosing colors and fonts, ask the user what feeling the audience should have:
| Mood | Description |
|---|---|
| Impressed / Confident | Professional, trustworthy, bold |
| Excited / Energized | Innovative, bold, creative |
| Calm / Focused | Clear, thoughtful, minimal |
| Inspired / Moved | Emotional, memorable, elegant |
在选择颜色和字体之前,询问用户希望给观众带来什么样的感受:
| 氛围 | 描述 |
|---|---|
| 印象深刻 / 自信 | 专业、可靠、大胆 |
| 兴奋 / 充满活力 | 创新、大胆、有创意 |
| 平静 / 专注 | 清晰、深思熟虑、极简 |
| 受启发 / 被打动 | 富有情感、令人难忘、优雅 |
Step 2: Pick a Style Preset
步骤2:选择风格预设
Based on mood, suggest 2-3 presets from the table below. Each preset defines fonts, colors, and signature visual elements. Do NOT mix and match randomly — commit to one preset fully.
根据氛围,从下表中推荐2-3个预设。每个预设定义了字体、颜色和标志性视觉元素。不要随意混搭——完全遵循一个预设。
Dark Presets
深色预设
| Preset | Mood | Display Font | Body Font | Colors | Signature |
|---|---|---|---|---|---|
| Bold Signal | Confident | Archivo Black (900) | Space Grotesk (400) | | Colored card as focal, large section numbers, grid layout |
| Electric Studio | Confident | Manrope (800) | Manrope (400) | | Two-panel vertical split, accent bar on edge |
| Creative Voltage | Energized | Syne (700) | Space Mono (400) | | Electric blue + neon yellow, halftone textures |
| Dark Botanical | Inspired | Cormorant (400) serif | IBM Plex Sans (300) | | Abstract blurred gradient circles, thin accent lines |
| 预设 | 氛围 | 标题字体 | 正文字体 | 颜色 | 标志性元素 |
|---|---|---|---|---|---|
| Bold Signal | 自信 | Archivo Black (900) | Space Grotesk (400) | | 彩色卡片作为焦点,大尺寸章节编号,网格布局 |
| Electric Studio | 自信 | Manrope (800) | Manrope (400) | | 垂直双面板布局,边缘强调条 |
| Creative Voltage | 充满活力 | Syne (700) | Space Mono (400) | | 电光蓝+霓虹黄,半色调纹理 |
| Dark Botanical | 受启发 | Cormorant (400) 衬线字体 | IBM Plex Sans (300) | | 抽象模糊渐变圆形,细强调线 |
Light Presets
浅色预设
| Preset | Mood | Display Font | Body Font | Colors | Signature |
|---|---|---|---|---|---|
| Notebook Tabs | Organized | Bodoni Moda (700) serif | DM Sans (400) | | Paper card on dark bg, colored section tabs |
| Pastel Geometry | Friendly | Plus Jakarta Sans (700) | Plus Jakarta Sans (400) | | Rounded card, vertical pills, soft shadow |
| Vintage Editorial | Inspired | Fraunces (700) serif | Work Sans (400) | | Geometric shapes (circle + line + dot), bold borders |
| Swiss Modern | Focused | Archivo (800) | Nunito (400) | Pure white, pure black, | Visible grid, asymmetric layouts, geometric shapes |
| 预设 | 氛围 | 标题字体 | 正文字体 | 颜色 | 标志性元素 |
|---|---|---|---|---|---|
| Notebook Tabs | 有条理 | Bodoni Moda (700) 衬线字体 | DM Sans (400) | | 深色背景上的纸质卡片,彩色章节标签 |
| Pastel Geometry | 友好 | Plus Jakarta Sans (700) | Plus Jakarta Sans (400) | | 圆角卡片,垂直色块,柔和阴影 |
| Vintage Editorial | 受启发 | Fraunces (700) 衬线字体 | Work Sans (400) | | 几何形状(圆形+线条+点),粗边框 |
| Swiss Modern | 专注 | Archivo (800) | Nunito (400) | 纯白、纯黑, | 可见网格,不对称布局,几何形状 |
Specialty Presets
特殊预设
| Preset | Mood | Font | Colors | Signature |
|---|---|---|---|---|
| Neon Cyber | Techy | Clash Display + Satoshi | | Neon glow, grid patterns, particle-like effects |
| Terminal Green | Hacker | JetBrains Mono | | Scan lines, blinking cursor, code aesthetic |
| Paper & Ink | Editorial | Cormorant Garamond + Source Serif 4 | | Drop caps, pull quotes, elegant horizontal rules |
| 预设 | 氛围 | 字体 | 颜色 | 标志性元素 |
|---|---|---|---|---|
| Neon Cyber | 科技感 | Clash Display + Satoshi | | 霓虹发光效果,网格图案,粒子状效果 |
| Terminal Green | 极客风 | JetBrains Mono | | 扫描线,闪烁光标,代码美学 |
| Paper & Ink | 编辑风 | Cormorant Garamond + Source Serif 4 | | 首字下沉,引语,优雅的水平分隔线 |
Step 3: Apply the Preset
步骤3:应用预设
Once chosen, define the full theme in and as CSS custom properties in :
src/lib/theme.tssrc/index.css- All colors from the preset
- Font families loaded from Google Fonts or Fontshare
- CSS variables for backgrounds, accents, text colors
- Use the preset's signature elements in at least the title slide and section transitions
一旦选定预设,在中定义完整主题,并在中作为CSS自定义属性:
src/lib/theme.tssrc/index.css- 预设中的所有颜色
- 从Google Fonts或Fontshare加载的字体族
- 背景、强调色、文本颜色的CSS变量
- 在标题幻灯片和章节过渡中至少使用预设的标志性元素
4. Design System — Anti AI-Slop Rules
4. 设计系统——反AI廉价感规则
Typography
排版
- Use the font pairing from your chosen preset. Load from Google Fonts or Fontshare via in CSS.
@import - No more than 2 font families.
- Headlines: large and bold. Body text: scarce.
- Never center-align body paragraphs. Left-align or use deliberate layout.
- ALL font sizes must use — never fixed px/rem for text. This ensures readability across viewport sizes.
clamp(min, preferred, max)
css
/* Example clamp values */
--title-size: clamp(2rem, 6vw, 5rem);
--subtitle-size: clamp(0.875rem, 2vw, 1.25rem);
--body-size: clamp(0.75rem, 1.2vw, 1rem);- 使用所选预设的字体配对。通过CSS中的从Google Fonts或Fontshare加载。
@import - 字体族不超过2种。
- 标题:大字号、粗体。正文:精简。
- 绝对不要居中对齐正文段落。左对齐或使用精心设计的布局。
- 所有字体大小必须使用——文本绝对不要使用固定的px/rem单位。这确保在不同视口尺寸下都能清晰可读。
clamp(min, preferred, max)
css
/* 示例clamp值 */
--title-size: clamp(2rem, 6vw, 5rem);
--subtitle-size: clamp(0.875rem, 2vw, 1.25rem);
--body-size: clamp(0.75rem, 1.2vw, 1rem);Color & Backgrounds
颜色与背景
- Commit fully to your preset's palette. Define as CSS custom properties.
- Create atmosphere, not flat colors. Layer CSS gradients for depth instead of a single solid background color:
css
/* Layered gradient for depth */
background:
radial-gradient(ellipse at 20% 80%, rgba(120, 0, 255, 0.15) 0%, transparent 50%),
radial-gradient(ellipse at 80% 20%, rgba(0, 255, 200, 0.1) 0%, transparent 50%),
var(--bg-primary);
/* Subtle grid pattern for structure */
background-image:
linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
background-size: 50px 50px;- Dominant colors with sharp accents outperform timid, evenly-distributed palettes.
- 完全遵循预设的调色板。定义为CSS自定义属性。
- 营造氛围,而非平淡的颜色。使用CSS渐变分层来增加深度,而不是单一的纯色背景:
css
/* 分层渐变增加深度 */
background:
radial-gradient(ellipse at 20% 80%, rgba(120, 0, 255, 0.15) 0%, transparent 50%),
radial-gradient(ellipse at 80% 20%, rgba(0, 255, 200, 0.1) 0%, transparent 50%),
var(--bg-primary);
/* 微妙的网格图案增加结构感 */
background-image:
linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
background-size: 50px 50px;- 主色调搭配鲜明的强调色比平淡、均匀分布的调色板效果更好。
Layout — Scaled Slide Container
布局——缩放的幻灯片容器
- The slide is a fixed 1280×720px container scaled via CSS to fit the viewport (like reveal.js). All content is authored at 1280×720 and uniformly scaled.
transform: scale() - Because of transform scaling, Tailwind's rem-based spacing appears smaller on screen. For any element that needs visible padding (cards, chips, buttons with backgrounds), use inline with px values instead of Tailwind padding classes.
style={{}} - Minimum padding for elements with a background: for horizontal chips,
style={{ padding: '20px 48px' }}for content cards,style={{ padding: '24px 32px' }}for buttons.style={{ padding: '16px 32px' }} - Generous whitespace. Content should breathe.
- Max 60% of the slide area should contain content. The rest is intentional empty space.
- Use CSS Grid or Flexbox. Avoid absolute positioning unless for decorative elements.
- The component handles the scaling + centering.
SlideLayout
- 幻灯片是一个固定1280×720px的容器,通过CSS 缩放以适配视口(类似reveal.js)。所有内容都以1280×720为基准创作,然后统一缩放。
transform: scale() - 由于使用了transform缩放,Tailwind基于rem的间距在屏幕上会显得更小。对于任何需要可见内边距的元素(卡片、色块、带背景的按钮),使用内联并设置px值,而不是Tailwind的内边距类。
style={{}} - 带背景元素的最小内边距:水平色块使用,内容卡片使用
style={{ padding: '20px 48px' }},按钮使用style={{ padding: '24px 32px' }}。style={{ padding: '16px 32px' }} - 充足的留白。内容需要呼吸空间。
- 幻灯片区域最多60%用于放置内容。其余部分是刻意留出的空白。
- 使用CSS Grid或Flexbox。除非是装饰元素,否则避免绝对定位。
- 组件负责处理缩放和居中。
SlideLayout
Content Density Limits (NON-NEGOTIABLE)
内容密度限制(必须遵守)
Every slide MUST fit within the 1280×720 container. Content overflows? Split into multiple slides. Never cram, never scroll.
| Slide Type | Maximum Content |
|---|---|
| Title slide | 1 heading + 1 subtitle + optional tagline |
| Content slide | 1 heading + 4-6 bullet points OR 1 heading + 2 short paragraphs |
| Feature grid | 1 heading + 6 cards maximum (2×3 or 3×2) |
| Chart slide | 1 heading + 1 chart |
| Quote slide | 1 quote (max 3 lines) + attribution |
| Image slide | 1 heading + 1 image (max 60% slide height) |
| Interactive slide | 1 heading + interactive element (keep controls minimal) |
每张幻灯片必须适配1280×720的容器。内容溢出?拆分成多张幻灯片。绝对不要拥挤,不要滚动。
| 幻灯片类型 | 最大内容量 |
|---|---|
| 标题幻灯片 | 1个标题 + 1个副标题 + 可选标语 |
| 内容幻灯片 | 1个标题 + 4-6个项目符号 或 1个标题 + 2段短文本 |
| 功能网格幻灯片 | 1个标题 + 最多6个卡片(2×3或3×2布局) |
| 图表幻灯片 | 1个标题 + 1个图表 |
| 引语幻灯片 | 1条引语(最多3行) + 署名 |
| 图片幻灯片 | 1个标题 + 1张图片(最大占幻灯片高度的60%) |
| 交互幻灯片 | 1个标题 + 交互元素(控制项尽量精简) |
Visual Rules — Backgrounds & Borders
视觉规则——背景与边框
- Do NOT wrap text content in background cards. Let text sit directly on the slide background. Use spacing and typography for hierarchy, not boxes.
- No nested backgrounds. Never put one colored box inside another.
- When an element MUST have a background (interactive buttons, chips, tags): use with
bg-white/5— never solid surface colors.border border-white/10 - Borders must be subtle. Use for left accents, never
border-l border-muted/20. Useborder-l-2for containers.border border-white/10 - No drop shadows unless it's a hard shadow (offset, no blur) as a specific design choice.
- No rounded-full badges with gradient backgrounds.
- No decorative blobs, waves, or mesh gradients.
- Geometric accents are OK: lines, dots, simple shapes.
- 不要将文本内容包裹在背景卡片中。让文本直接放在幻灯片背景上。使用间距和排版来体现层级,而不是盒子。
- 不要嵌套背景。绝对不要在一个彩色盒子里再放另一个彩色盒子。
- 当元素必须有背景时(交互按钮、色块、标签):使用搭配
bg-white/5——绝对不要使用纯色背景。border border-white/10 - 边框必须微妙。使用作为左侧强调线,绝对不要使用
border-l border-muted/20。容器使用border-l-2。border border-white/10 - 除非是特定设计选择的硬阴影(有偏移、无模糊),否则不要使用投影。
- 不要使用带渐变背景的全圆角徽章。
- 不要使用装饰性的 blob、波浪或网格渐变。
- 几何强调元素是允许的:线条、点、简单形状。
DO NOT USE — Banned AI Patterns
禁止使用——AI常见烂俗模式
| Category | Banned |
|---|---|
| Fonts | Inter, Roboto, Arial, system fonts as display. Also avoid converging on Space Grotesk for every deck — vary your choices. |
| Colors | |
| Layouts | Everything centered in a vertical stack, identical card grids, generic hero sections |
| Decorations | Realistic illustrations, gratuitous glassmorphism, drop shadows without purpose, gradient mesh backgrounds |
| 类别 | 禁止内容 |
|---|---|
| 字体 | Inter、Roboto、Arial、系统字体作为标题字体。还要避免所有幻灯片都使用Space Grotesk——要多样化选择。 |
| 颜色 | |
| 布局 | 所有内容垂直居中堆叠、相同的卡片网格、通用的 hero 区域 |
| 装饰 | 写实插图、无意义的毛玻璃效果、无目的的投影、网格渐变背景 |
What Makes It NOT Feel AI-Slop
如何避免AI廉价感
- Asymmetric layouts (not everything centered in a stack)
- Oversized typography for emphasis
- Deliberate use of negative space
- Content that has opinion and edge, not generic filler
- Consistent but not monotonous — vary slide layouts across the deck
- Real images and data, not placeholder illustrations
- Surprise the viewer — make at least 1-2 unexpected layout choices per deck
- 不对称布局(不要所有内容都垂直居中堆叠)
- 超大号排版以强调重点
- 刻意使用负空间
- 有观点和棱角的内容,而非通用填充内容
- 一致但不单调——整个幻灯片的布局要多样化
- 真实的图片和数据,而非占位插图
- 给观众惊喜——每套幻灯片至少要有1-2个出乎意料的布局选择
5. Animation — Feeling-Driven Motion
5. 动画——基于感受的动效
Match Animation to Mood
动画风格匹配氛围
| Feeling | Animation Style | Visual Cues |
|---|---|---|
| Dramatic / Cinematic | Slow fade-ins (0.8-1.2s), large scale transitions (0.9→1) | Dark backgrounds, spotlight effects |
| Techy / Futuristic | Neon glow, text scramble/reveal effects | Grid patterns, monospace accents, cyan/magenta |
| Playful / Friendly | Bouncy easing (gentle spring), floating motion | Rounded corners, bright colors |
| Professional | Subtle fast animations (200-300ms), clean slides | Precise spacing, data visualization focus |
| Calm / Minimal | Very slow subtle motion, gentle fades | High whitespace, muted palette, serif type |
| Editorial | Staggered text reveals, image-text interplay | Strong type hierarchy, pull quotes, grid-breaking |
| 感受 | 动画风格 | 视觉线索 |
|---|---|---|
| 戏剧性 / 电影感 | 缓慢淡入(0.8-1.2秒)、大尺度过渡(0.9→1) | 深色背景、聚光灯效果 |
| 科技感 / 未来感 | 霓虹发光、文本打乱/揭示效果 | 网格图案等宽字体、青色/品红色 |
| 活泼 / 友好 | 弹性缓动(柔和弹簧效果)、浮动动效 | 圆角、明亮颜色 |
| 专业 | 微妙的快速动画(200-300毫秒)、简洁幻灯片 | 精确间距、数据可视化重点 |
| 平静 / 极简 | 非常缓慢的微妙动效、柔和淡入 | 大量留白、柔和调色板、衬线字体 |
| 编辑风 | 文本 stagger 揭示、图文互动 | 强烈的排版层级、引语、打破网格布局 |
Framer Motion Defaults
Framer Motion 默认设置
- Default duration: 0.4–0.6s. Avoid animations longer than 0.8s (unless cinematic mood).
- Default easing: (smooth deceleration, equivalent to
[0.25, 0.1, 0.25, 1])ease-out-expo - Stagger children by 0.08–0.12s, not more
- 默认时长:0.4–0.6秒。避免动画时长超过0.8秒(除非是电影感氛围)。
- 默认缓动:(平滑减速,等效于
[0.25, 0.1, 0.25, 1])ease-out-expo - 子元素 stagger 间隔为0.08–0.12秒,不要更长
Slide Transitions
幻灯片过渡
- Use with
AnimatePresencefor slide changesmode="wait" - Slide enter: fade in + subtle translateY (20px) or translateX (30px)
- Slide exit: fade out quickly (0.2s)
- Do not use 3D transforms, rotations, or scale bounces for slide transitions
- 使用并设置
AnimatePresence来处理幻灯片切换mode="wait" - 幻灯片入场:淡入 + 微妙的 translateY(20px)或 translateX(30px)
- 幻灯片退场:快速淡出(0.2秒)
- 幻灯片过渡不要使用3D变换、旋转或缩放弹跳效果
Content Animations (within a slide)
内容动画(单张幻灯片内)
- Headline: fade in + translateY, arrives first
- Supporting content: staggered fade in after headline
- Charts/images: fade in + subtle scale from 0.95 to 1
- Use pattern for orchestrated animations:
variants
tsx
const container = {
hidden: { opacity: 0 },
show: {
opacity: 1,
transition: { staggerChildren: 0.1 }
}
};
const item = {
hidden: { opacity: 0, y: 20 },
show: { opacity: 1, y: 0, transition: { duration: 0.5, ease: [0.25, 0.1, 0.25, 1] } }
};- 标题:淡入 + translateY,最先出现
- 辅助内容:在标题之后 stagger 淡入
- 图表/图片:淡入 + 从0.95到1的微妙缩放
- 使用模式来编排动画:
variants
tsx
const container = {
hidden: { opacity: 0 },
show: {
opacity: 1,
transition: { staggerChildren: 0.1 }
}
};
const item = {
hidden: { opacity: 0, y: 20 },
show: { opacity: 1, y: 0, transition: { duration: 0.5, ease: [0.25, 0.1, 0.25, 1] } }
};Progressive Reveal
渐进式揭示
- Some slides should reveal content in steps (click to advance within a slide)
- Track a state per slide when needed
step - Animate items in/out based on current step
- Show a subtle progress indicator (dots or a thin bar) when a slide has multiple steps
- 有些幻灯片应该分步骤揭示内容(点击在单张幻灯片内推进)
- 必要时为每张幻灯片跟踪状态
step - 根据当前步骤动画显示/隐藏项目
- 当幻灯片有多个步骤时,显示微妙的进度指示器(圆点或细条)
What NOT to Do
禁止操作
- No with high bounce (underdamped springs look toyish)
spring - No animations on text
rotate - No continuous looping animations (except very subtle pulsing on interactive elements)
- No parallax scrolling within slides
- No animation on every single element — some things should just be there
- One well-orchestrated entrance per slide beats scattered micro-interactions
- 不要使用高弹跳的(欠阻尼弹簧看起来像玩具)
spring - 不要对文本使用动画
rotate - 不要使用持续循环的动画(除了交互元素上非常微妙的脉动效果)
- 不要在幻灯片内使用视差滚动
- 不要给每个元素都添加动画——有些元素应该直接显示
- 一次精心编排的入场动画胜过零散的微交互
prefers-reduced-motion
Support
prefers-reduced-motionprefers-reduced-motion
支持
prefers-reduced-motionAlways include reduced-motion support. Wrap animation variants:
tsx
const prefersReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
const item = prefersReducedMotion
? { hidden: { opacity: 0 }, show: { opacity: 1 } }
: { hidden: { opacity: 0, y: 20 }, show: { opacity: 1, y: 0, transition: { duration: 0.5 } } };始终包含减少动效的支持。包裹动画变体:
tsx
const prefersReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
const item = prefersReducedMotion
? { hidden: { opacity: 0 }, show: { opacity: 1 } }
: { hidden: { opacity: 0, y: 20 }, show: { opacity: 1, y: 0, transition: { duration: 0.5 } } };6. Slide Types & Components
6. 幻灯片类型与组件
Title Slide
标题幻灯片
- Oversized headline using
clamp(2.5rem, 6vw, 5rem) - Optional subtitle
- Optional date or presenter name
- Minimal, dramatic layout
- Use preset's signature element (colored card, split panel, geometric shape, etc.)
- 使用设置超大号标题
clamp(2.5rem, 6vw, 5rem) - 可选副标题
- 可选日期或演讲者姓名
- 极简、戏剧性的布局
- 使用预设的标志性元素(彩色卡片、分栏面板、几何形状等)
Content Slide (Text)
内容幻灯片(文本)
- Headline + 2–5 short bullet points or a short paragraph
- Bullets should animate in with stagger
- Left-aligned text, right side can have supporting visual
- Max 4-6 bullets. Exceeds? Split into two slides.
- 标题 + 2–5个短项目符号或一段短文本
- 项目符号 stagger 入场动画
- 文本左对齐,右侧可放置辅助视觉元素
- 最多4-6个项目符号。超过则拆分成两张幻灯片。
Image Slide
图片幻灯片
- Full-bleed or large contained image
- Images are placed in by the user
public/images/ - Reference as
/images/filename.ext - Image max-height: 60% of slide height (432px at 720px)
- Support caption text below or overlaid with semi-transparent background
- Lazy load images
- 全屏或大尺寸包含式图片
- 用户将图片放置在中
public/images/ - 引用路径为
/images/filename.ext - 图片最大高度:幻灯片高度的60%(720px时为432px)
- 支持图片下方或半透明背景上的说明文字
- 图片懒加载
Chart Slide
图表幻灯片
- Use Recharts (BarChart, LineChart, PieChart, AreaChart)
- Style charts to match the deck theme — custom colors from preset, no default Recharts styling
- Animate chart entrance with Framer Motion wrapper
- Include clear labels and a headline
- 使用Recharts(BarChart、LineChart、PieChart、AreaChart)
- 调整图表样式以匹配幻灯片主题——使用预设的自定义颜色,不要使用Recharts默认样式
- 用Framer Motion包装器实现图表入场动画
- 包含清晰的标签和标题
Comparison Slide
对比幻灯片
- Side-by-side or before/after layout
- Use a clear visual separator (accent line, not a heavy border)
- Animate left then right panel
- 并排或前后对比布局
- 使用清晰的视觉分隔线(强调线,不要粗边框)
- 先左面板后右面板的入场动画
Quote / Callout Slide
引语 / 提示幻灯片
- Large text using , centered or left-aligned
clamp(1.5rem, 3vw, 2.5rem) - Accent color or background
- Attribution below in smaller text
- Max 3 lines for the quote.
- 使用设置大字号文本,居中或左对齐
clamp(1.5rem, 3vw, 2.5rem) - 强调色或背景
- 下方用小字号文本署名
- 引语最多3行
Interactive Slide
交互幻灯片
- For slides that need custom UI (polls, toggles, demos, games)
- Build as self-contained components with local state
- Add attribute to prevent accidental slide navigation on click
data-interactive - Add clear visual affordance that something is interactive (hover states, cursor)
- 用于需要自定义UI的幻灯片(投票、切换、演示、游戏)
- 构建为带本地状态的独立组件
- 添加属性以防止点击时意外切换幻灯片
data-interactive - 添加清晰的视觉提示表明元素可交互(悬停状态、光标变化)
Link References
链接引用
- External URLs: render as styled links that open in new tab ()
target="_blank" - Local folder links: render as protocol links with a folder icon
file:/// - Style links distinctly — underline + accent color, not default blue
- 外部URL:渲染为在新标签页打开的样式化链接()
target="_blank" - 本地文件夹链接:渲染为协议链接并搭配文件夹图标
file:/// - 链接样式要与众不同——下划线+强调色,不要默认蓝色
7. Navigation & Controls
7. 导航与控制
- Keyboard: Right arrow / Space / Enter = next, Left arrow = previous
- Click/Tap: Click right half = next, click left half = previous (skip elements with ,
data-interactive,button)input - Progress bar: Thin bar at bottom showing position in deck
- Slide counter: Small "3 / 28" indicator in bottom-right corner
- Support sub-navigation within slides before advancing to next slide
step - Escape key: Toggle overview mode (grid of slide thumbnails) — nice to have, not required for v1
- 键盘:右箭头 / 空格 / 回车 = 下一页,左箭头 = 上一页
- 点击/触摸:点击右半部分 = 下一页,点击左半部分 = 上一页(跳过带有、
data-interactive、button的元素)input - 进度条:底部的细条显示在幻灯片中的位置
- 幻灯片计数器:右下角显示小的“3 / 28”指示器
- 支持在单张幻灯片内通过子导航,然后再切换到下一张幻灯片
step - ESC键:切换概览模式(幻灯片缩略图网格)——v1版本可选,非必须
8. Content Guidelines
8. 内容指南
Refer to in this directory for the pedagogical structure:
slide-guidelines.md- Problem → Discussion → Concept → Example → Takeaway cycle
- One idea per slide
- Visual-first, minimal text
- Short headlines (6–8 words)
- Progressive reveal for complex information
- 60-70% visual slides, 10-15% charts/diagrams, 15-20% text explanation
You MUST ask the user for the actual content/topic before creating slides. The content guidelines above describe structure, not what goes in the slides.
参考此目录下的了解教学结构:
slide-guidelines.md- 问题 → 讨论 → 概念 → 示例 → 总结 循环
- 每张幻灯片一个核心观点
- 视觉优先,文本极简
- 短标题(6-8个单词)
- 复杂信息渐进式揭示
- 60-70% 视觉幻灯片,10-15% 图表/图表,15-20% 文字说明
在创建幻灯片之前,你必须向用户询问实际内容/主题。 上述内容指南描述的是结构,而非具体内容。
9. Build & Run
9. 构建与运行
bash
npm create vite@latest . -- --template react-ts # Only if starting fresh
npm install
npm run devThe app should run with and be viewable at localhost. No build errors. No TypeScript errors.
npm run devbash
npm create vite@latest . -- --template react-ts # 仅在从零开始时使用
npm install
npm run dev应用应能通过启动,并可在localhost访问。无构建错误,无TypeScript错误。
npm run dev10. Quality Checklist
10. 质量检查清单
Before delivering any batch of slides, verify:
- starts without errors
npm run dev - TypeScript compiles cleanly ()
npx tsc --noEmit - succeeds
npx vite build - All animations are smooth at 60fps
- Slides fit within 1280×720 — no content overflow, no scrolling
- Content density within limits per slide type
- No placeholder text like "Lorem ipsum" or "Your content here"
- Color palette is consistent and matches chosen preset
- Fonts are loading correctly from Google Fonts / Fontshare
- Images referenced in slides exist in
public/images/ - Interactive elements have hover/focus states
- Navigation works: keyboard, click, and progress bar are in sync
- No text content wrapped in background cards — text sits on slide directly
- No nested backgrounds (box inside box)
- All elements with backgrounds have generous padding via inline `style={{}}``, not Tailwind classes
- Borders are subtle — ,
border-white/10, never solid surface colorsborder-muted/20 - All font sizes use — no fixed px/rem for text
clamp() - Backgrounds have depth — layered gradients or patterns, not flat solid colors
在交付任何一批幻灯片之前,验证:
- 启动无错误
npm run dev - TypeScript 编译无错误()
npx tsc --noEmit - 执行成功
npx vite build - 所有动画在60fps下流畅运行
- 幻灯片适配1280×720——无内容溢出,无滚动
- 内容密度符合每种幻灯片类型的限制
- 无占位文本如"Lorem ipsum"或"Your content here"
- 调色板一致且匹配所选预设
- 字体从Google Fonts / Fontshare加载正确
- 幻灯片中引用的图片存在于中
public/images/ - 交互元素有悬停/聚焦状态
- 导航正常工作:键盘、点击和进度条同步
- 没有文本内容包裹在背景卡片中——文本直接放在幻灯片上
- 没有嵌套背景(盒子套盒子)
- 所有带背景的元素通过内联设置了充足的内边距,而非Tailwind类
style={{}} - 边框微妙——、
border-white/10,绝对不要使用纯色边框border-muted/20 - 所有字体大小使用——文本没有固定的px/rem值
clamp() - 背景有深度——分层渐变或图案,而非平淡的纯色
11. Workflow
11. 工作流程
- Ask the user for mood and content — what feeling? What topic? How many modules?
- Pick a style preset — suggest 2-3 based on mood, let user choose
- Scaffold the app — set up Vite, Tailwind, Framer Motion, project structure, theme from preset, shared components
- Build slides in batches — implement 5–10 slides at a time, then ask for review
- Iterate — adjust based on feedback
- Images — when a slide needs an image, tell the user what image is needed and where to place it (). Use a visible placeholder with the filename so they know what's missing.
public/images/
Always keep the app in a runnable state. Never leave broken imports or missing files.
- 询问用户氛围和内容——想要什么感受?什么主题?有多少模块?
- 选择风格预设——根据氛围推荐2-3个,让用户选择
- 搭建应用框架——设置Vite、Tailwind、Framer Motion、项目结构、预设主题、共享组件
- 分批构建幻灯片——每次实现5-10张幻灯片,然后请求审核
- 迭代——根据反馈调整
- 图片——当幻灯片需要图片时,告诉用户需要什么样的图片以及放置位置()。使用带文件名的可见占位符,让用户知道缺少什么。
public/images/
始终保持应用处于可运行状态。绝对不要留下损坏的导入或缺失的文件。