web-presentation
npx skills add https://github.com/zhaoxuanzzz/skills --skill web-presentation
Agent 安装分布
Skill 文档
â ï¸ READ THIS ENTIRE FILE BEFORE CREATING A WEB PRESENTATION â ï¸
Web Presentation Skill
Create elegant, interactive presentations powered by Reveal.js that run entirely in a web browser as single HTML files. Perfect for product launches, technical talks, educational content, and any scenario requiring modern, professional slides with advanced features.
Overview
This skill creates self-contained HTML presentations with:
- ð¬ Advanced animations – Fragment animations, auto-animate, parallax effects
- ð¤ Speaker notes – Dedicated speaker view with notes and timer (press S)
- ð Overview mode – Bird’s-eye view of all slides (press ESC)
- ð¨ Professional transitions – Multiple transition effects (slide/fade/zoom/convex/concave)
- ð Multiple layouts – Title, content, two-column, image+text, quotes, sections
- ð¯ Vertical navigation – Nested slides for hierarchical content
- â¨ï¸ Keyboard shortcuts – Full keyboard control including fullscreen mode
- ð Progress tracking – Visual progress bar and slide counter
- ð± Responsive design – Works on desktop, tablet, and mobile
- ð Plugin ecosystem – Markdown, code highlighting, math equations, search
- ð Single-file output – Everything via CDN, no build process required
- ð ï¸ Full API access – Complete Reveal.js API for advanced customization
When to Use This Skill
Use for: â Product presentations and pitches â Conference talks and tech presentations â Educational slideshows and lectures â Company all-hands or team updates â Portfolio showcases â Workshop materials â Documentation walkthroughs
Don’t use for: â Static documents (use docx skill instead) â Printable handouts (use pdf skill instead) â Spreadsheet data (use xlsx skill instead) â Rich media editing (needs external tools)
Workflow
ð¯ CRITICAL: This skill uses an interactive, question-guided approach. Always ask questions to understand the user’s needs before generating any code.
Step 1: Initial Discovery (Ask Questions)
ALWAYS start by asking these questions to the user:
让æä¸ºæ¨å建ä¸ä¸ªç²¾å½©çæ¼ç¤ºæç¨¿ï¼é¦å
ï¼æéè¦äºè§£ä¸äºä¿¡æ¯ï¼
ð **å
容æ¹é¢ï¼**
1. æ¼ç¤ºæç¨¿ç䏻颿¯ä»ä¹ï¼
2. ç®æ å伿¯è°ï¼ï¼å®¢æ·ãå¢éãå¦çãæèµäººï¼ï¼
3. æ ¸å¿ä¿¡æ¯æ¯ä»ä¹ï¼ï¼3-5个主è¦è§ç¹ï¼
4. é¢è®¡éè¦å¤å°å¼ å¹»ç¯çï¼ï¼å¿«éæ¼è®²5-10å¼ / æ åæ¼ç¤º15-25å¼ / é¿ç¯è®²åº§30+å¼ ï¼
ð¨ **è§è§é£æ ¼ï¼**
5. æ¨å好ä»ä¹è§è§é£æ ¼ï¼
- â¡ ä¸ä¸åå¡ï¼æ·±è²ãç®çº¦ï¼
- â¡ åææ´»æ³¼ï¼å½©è²ã卿ï¼
- â¡ æç®ä¸»ä¹ï¼çç½ãèç¦ï¼
- â¡ ææ¯æï¼ä»£ç ãå¾è¡¨ï¼
6. æ¯å¦æåçé¢è²è¦æ±ï¼ï¼å¦ææï¼è¯·æä¾è²å¼ï¼
⨠**å¨ç»ææï¼**
7. æ¨éè¦ä»ä¹ç¨åº¦çå¨ç»ææï¼
- â¡ åºç¡ï¼ç®åæ·¡å
¥æ·¡åºï¼
- â¡ ä¸çï¼éæ¥æ¾ç¤ºè¦ç¹ï¼
- â¡ é«çº§ï¼å
ç´ åæ¢ãæ°æ®å¯è§åå¨ç»ï¼
ð¤ **ç¹æ®åè½ï¼**
8. æ¯å¦éè¦ä»¥ä¸åè½ï¼
- â¡ æ¼è®²è
夿³¨ï¼ç¨äºæ¼è®²æç¤ºï¼
- ⡠代ç é«äº®æ¾ç¤º
- â¡ æ°å¦å
¬å¼æ¯æ
- â¡ åç´åµå¥å¹»ç¯çï¼ç« èå
å主é¢ï¼
Wait for user responses before proceeding to Step 2.
Step 2: Content Planning (Collaborative Structure)
Based on user’s answers, propose a slide structure and ask for confirmation:
æ ¹æ®æ¨çéæ±ï¼æå»ºè®®ä»¥ä¸ç»æï¼
ð **建议çå¹»ç¯çç»æï¼**
1. æ é¢é¡µ - [主é¢]
2. è®®ç¨ - æ¬æ¬¡æ¼ç¤ºçå
容æ¦è§
3. ã第ä¸é¨åãç« èåé符 - [第ä¸ä¸ªä¸»è¦è¯é¢]
ââ 4. [å主é¢1]
ââ 5. [å主é¢2]
ââ 6. [å主é¢3]
4. ã第äºé¨åãç« èåé符 - [第äºä¸ªä¸»è¦è¯é¢]
ââ 7. [å主é¢1]
ââ 8. [å主é¢2]
5. æ»ç» - æ ¸å¿è¦ç¹å顾
6. ç»æé¡µ - è´è°¢ä¸é®ç
è¿ä¸ªç»æç¬¦åæ¨çéæ±åï¼æ¯å¦éè¦è°æ´ï¼
Wait for user confirmation or adjustment before proceeding.
Step 3: Animation & Feature Selection
Ask about specific animation and feature requirements:
ç°å¨è®©æä»¬ç¡®å®å¨ç»å交äºç»èï¼
ð **å¨ç»é
ç½®ï¼**
1. å¹»ç¯ç忢ææå好ï¼
- slideï¼æ»å¨ï¼é»è®¤ï¼
- fadeï¼æ·¡å
¥æ·¡åºï¼
- zoomï¼ç¼©æ¾ï¼
- convexï¼å¸åºï¼
- concaveï¼å¹é·ï¼
2. è¦ç¹å表æ¯å¦éè¦éæ¡æ¾ç¤ºï¼ï¼æ¨èï¼
â æ¯ï¼è¦ç¹éæ¡æ·¡å
¥
â å¦ï¼ä¸æ¬¡å
¨é¨æ¾ç¤º
3. æ¯å¦éè¦ç¹æ®å¨ç»ï¼
â å
ç´ èªå¨åæ¢ï¼æ°åååãå¾å½¢åå½¢ï¼
â é«äº®å¼ºè°ï¼å½åè¦ç¹é«äº®ï¼
â 代ç éè¡æ¾ç¤º
ð **æ¼è®²è
åè½ï¼**
4. æ¯å¼ å¹»ç¯çæ¯å¦éè¦æ¼è®²è
夿³¨ï¼
â æ¯ï¼æä¼æä¾æ¯é¡µç讲解æç¤º
â å¦ï¼ä»
å¹»ç¯çå
容
éæ©æ¨éè¦çéé¡¹ï¼æå°æ®æ¤å建æ¼ç¤ºæç¨¿ã
Wait for user’s selections.
Step 4: Read the Template
CRITICAL: Before writing any code, read the Reveal.js template file:
templates/viewer-reveal.html
This template contains:
- â Reveal.js integration: CDN links to Reveal.js 5.x core and plugins
- â Theme system: CSS custom properties for brand colors
- â Layout classes: Pre-built styles for all 6 layout types
- â
Configuration object:
PRESENTATION_CONFIGwith all Reveal.js options - â Plugin setup: Code highlighting, Markdown, Math, Notes, Zoom, Search
- â
Full API access: Complete Reveal.js API exposed via
window.PresentationAPI
The template is your foundation. Copy it and customize the content sections.
Step 5: Generate Slide Content
Create slides using standard HTML <section> tags within .reveal .slides:
Basic structure:
<div class="reveal">
<div class="slides">
<!-- Each <section> is a slide -->
<section class="slide-title">
<h1>Title</h1>
</section>
<section class="slide-content">
<h2>Content</h2>
<ul>
<li class="fragment">Point 1</li>
<li class="fragment">Point 2</li>
</ul>
<!-- Speaker notes -->
<aside class="notes">
This is what you'll say...
</aside>
</section>
<!-- Nested slides (vertical navigation) -->
<section>
<section><h2>Main Topic</h2></section>
<section><h3>Subtopic 1</h3></section>
<section><h3>Subtopic 2</h3></section>
</section>
</div>
</div>
Fragment animations (progressive reveal):
<ul>
<li class="fragment">Appears first</li>
<li class="fragment">Appears second</li>
<li class="fragment fade-in">Fades in</li>
<li class="fragment fade-up">Slides up</li>
<li class="fragment highlight-red">Highlights in red</li>
</ul>
Available fragment animations:
fragment– Basic fade infragment fade-in– Fade infragment fade-out– Fade outfragment fade-up– Slide upfragment fade-down– Slide downfragment grow– Grow largerfragment shrink– Shrink smallerfragment highlight-red– Highlight in redfragment highlight-blue– Highlight in bluefragment highlight-current-blue– Highlight current item
Step 6: Configure Presentation
Update the PRESENTATION_CONFIG object:
const PRESENTATION_CONFIG = {
// Basic info
title: "Your Presentation Title",
author: "Your Name",
date: "2026å¹´2æ3æ¥",
// Theme colors
theme: {
primary: "#2E86AB", // Main color
secondary: "#A23B72", // Secondary color
accent: "#F18F01", // Accent color
background: "#0a0a0a", // Background
text: "#ffffff", // Text color
textMuted: "#cccccc" // Muted text
},
// Reveal.js options
revealOptions: {
transition: 'slide', // slide/fade/zoom/convex/concave
controls: true, // Show arrow controls
progress: true, // Show progress bar
center: true, // Vertical centering
slideNumber: 'c/t', // Show slide numbers
hash: true, // URL routing
// Animation speed
transitionSpeed: 'default', // default/fast/slow
// Auto-advance (0 = disabled)
autoSlide: 0,
// Plugins (always included)
plugins: [
RevealMarkdown,
RevealHighlight,
RevealNotes,
RevealZoom,
RevealSearch,
RevealMath.KaTeX
]
}
};
Full configuration options: https://revealjs.com/config/
Step 7: Add Advanced Features (Optional)
Speaker notes (press S to open):
<section>
<h2>Slide Title</h2>
<p>Public content...</p>
<aside class="notes">
Remember to emphasize this point.
Mention the case study here.
Time: 2 minutes on this slide.
</aside>
</section>
Code highlighting with line numbers:
<section>
<h2>Code Example</h2>
<pre><code class="language-javascript" data-trim data-line-numbers="1-2|4-6">
function hello(name) {
console.log(`Hello, ${name}!`);
}
// Usage
hello('World');
</code></pre>
</section>
Math equations (KaTeX):
<section>
<h2>Mathematical Formula</h2>
<p>The quadratic formula:</p>
<p>$$x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}$$</p>
</section>
Auto-animate (element transitions):
<section data-auto-animate>
<h2 style="margin-top: 100px;">Animate</h2>
</section>
<section data-auto-animate>
<h2 style="margin-top: 400px; color: red;">Animate</h2>
</section>
Custom backgrounds:
<section data-background-color="#ff0000">
<h2>Red Background</h2>
</section>
<section data-background-image="url.jpg">
<h2>Image Background</h2>
</section>
<section data-background-gradient="linear-gradient(to bottom, #283b95, #17b2c3)">
<h2>Gradient Background</h2>
</section>
Step 8: Validate and Test
Generate the HTML file and verify:
- Open in browser – File loads correctly
- Navigate all slides – Arrow keys work (â = next, â = nested)
- Test fragments – Progressive reveals work
- Speaker view – Press S (opens in new window)
- Overview mode – Press ESC (thumbnail view)
- Fullscreen – Press F
- Search – Press Ctrl+Shift+F
- Zoom – Alt+Click to zoom in
- Help overlay – Press ? for shortcuts
Common issues:
- Slides not showing: Check
<section>tags are inside.reveal .slides - Fragments not working: Ensure
class="fragment"is set - Speaker notes not appearing: Press S, check
<aside class="notes"> - Code not highlighted: Verify
class="language-xxx"on<code>
Step 9: Deliver with Instructions
Provide the HTML file with clear instructions:
File name: [topic]-presentation.html
Usage instructions:
ð¯ æå¼æ¹å¼ï¼å¨ä»»ä½ç°ä»£æµè§å¨ä¸æå¼æ¤ HTML æä»¶
â¨ï¸ å¿«æ·é®ï¼
â / Space ä¸ä¸å¼ å¹»ç¯ç
â ä¸ä¸å¼ å¹»ç¯ç
â åä¸è¿å
¥åå¹»ç¯çï¼å¦ææï¼
â åä¸è¿å
ESC æ¦è§æ¨¡å¼ï¼æ¥çææå¹»ç¯çï¼
S æ¼è®²è
è§å¾ï¼å
å«å¤æ³¨å计æ¶å¨ï¼
F å
¨å±æ¨¡å¼
? æ¾ç¤ºææå¿«æ·é®
Ctrl+Shift+F æç´¢
Alt+Click æ¾å¤§åºå
ð± ç§»å¨ç«¯ï¼å·¦å³æ»å¨åæ¢å¹»ç¯ç
ð¤ æ¼è®²æç¤ºï¼
- æ S æå¼æ¼è®²è
è§å¾ï¼å¯ä»¥çå°å¤æ³¨ãä¸ä¸å¼ é¢è§å计æ¶å¨
- 建议使ç¨åå±ï¼ä¸ä¸ªå±å¹ç»è§ä¼ï¼ä¸ä¸ªå±å¹ç»èªå·±ï¼æ¼è®²è
è§å¾ï¼
Editing note:
å¦éä¿®æ¹å
容ï¼å¨ HTML æä»¶ä¸æ¾å° <div class="slides"> é¨åï¼
ç¼è¾å¯¹åºç <section> æ ç¾å³å¯ã
Available Layouts (with Reveal.js)
All layouts are implemented as CSS classes applied to <section> elements. Combine with Reveal.js features for enhanced interactivity.
1. Title Slide (class="slide-title")
Use for: Opening, closing, major section breaks
<section class="slide-title" data-transition="zoom">
<h1>Main Title</h1>
<p class="subtitle">Subtitle or description</p>
<p class="author">Author Name | Date</p>
</section>
Features:
- Full-screen, centered
- Gradient background (primary â secondary colors)
- White text with shadow
- Large, impactful typography
- Recommended transition:
zoomorfade
With animation:
<section class="slide-title" data-transition="zoom">
<h1 class="fragment">Main Title</h1>
<p class="subtitle fragment">Subtitle appears second</p>
<p class="author fragment">Author appears last</p>
</section>
2. Content Slide (class="slide-content")
Use for: Main content, bullet points, text, code
<section class="slide-content">
<h2>Slide Title</h2>
<p>Introduction paragraph...</p>
<ul>
<li class="fragment">Point one appears first</li>
<li class="fragment">Point two appears second</li>
<li class="fragment">Point three appears last</li>
</ul>
<aside class="notes">
Speaker notes: Emphasize point two.
</aside>
</section>
With code highlighting:
<section class="slide-content">
<h2>Code Example</h2>
<pre><code class="language-python" data-trim data-line-numbers="1-3|5-7">
def calculate_total(items):
total = sum(item.price for item in items)
return total
# Usage example
items = [Item(10), Item(20)]
result = calculate_total(items)
</code></pre>
</section>
Supported elements:
<h2>,<h3>– Headings (styled with theme colors)<p>– Paragraphs<ul>,<ol>,<li>– Lists with custom bullets<code>– Inline code (monospace font)<pre><code>– Code blocks with syntax highlighting<strong>– Bold (colored with accent)<em>– Italic (colored with primary)
3. Two-Column Layout (class="two-column")
Use for: Comparisons, before/after, pros/cons
<section>
<h2>Comparison</h2>
<div class="two-column">
<div class="fragment">
<h3>Before</h3>
<ul>
<li>Slow performance</li>
<li>Complex setup</li>
<li>Limited features</li>
</ul>
</div>
<div class="fragment">
<h3>After</h3>
<ul>
<li>2x faster â¨</li>
<li>One-click setup</li>
<li>Full-featured</li>
</ul>
</div>
</div>
</section>
Best practices:
- Balance content between columns
- Use parallel structure
- Animate columns separately with fragments
- Works great with auto-animate
4. Image + Text (class="image-text")
Use for: Product showcases, visual explanations, diagrams
<section>
<div class="image-text">
<div>
<h2>Feature Name</h2>
<p>Description of the feature...</p>
<ul>
<li class="fragment">Benefit one</li>
<li class="fragment">Benefit two</li>
<li class="fragment">Benefit three</li>
</ul>
</div>
<div class="fragment">
<img src="https://via.placeholder.com/600x400" alt="Feature screenshot">
</div>
</div>
</section>
Image options:
- External URLs: Quick and easy (requires internet)
- Data URIs: Embed for offline use
- SVG inline: Best for diagrams and icons
With auto-animate:
<section data-auto-animate>
<div class="image-text">
<div><h2>Initial State</h2></div>
<img src="before.png" data-id="product">
</div>
</section>
<section data-auto-animate>
<div class="image-text">
<div><h2>After Transformation</h2></div>
<img src="after.png" data-id="product">
</div>
</section>
5. Quote Slide (class="slide-quote")
Use for: Testimonials, impactful statements, emphasis
<section class="slide-quote" data-background-gradient="linear-gradient(135deg, #667eea 0%, #764ba2 100%)">
<blockquote class="fragment">
An impactful quote that emphasizes a key message
and inspires the audience.
</blockquote>
<cite class="fragment">â Author Name, Title</cite>
</section>
Features:
- Large italic font
- Centered layout
- Border-left accent
- Works great with background gradients
- Perfect for breaks between sections
6. Section Divider (class="slide-section")
Use for: Major topic transitions, chapter breaks
<section class="slide-section" data-background-gradient="linear-gradient(135deg, #A23B72 0%, #F18F01 100%)">
<h2 class="fragment">Part Two</h2>
</section>
Features:
- Full-screen colored background
- Large white text with shadow
- Creates visual rhythm
- Use sparingly (2-4 per presentation)
- Recommended transition:
convexorzoom
7. Nested Slides (Vertical Navigation)
Use for: Hierarchical content, deep dives, optional details
<!-- Main topic (horizontal) -->
<section>
<section>
<h2>Main Topic</h2>
<p>Press â to dive deeper</p>
</section>
<!-- Subtopic 1 (vertical) -->
<section>
<h3>Subtopic 1</h3>
<p>Detailed explanation...</p>
</section>
<!-- Subtopic 2 (vertical) -->
<section>
<h3>Subtopic 2</h3>
<p>More details...</p>
</section>
</section>
<!-- Next main topic (horizontal) -->
<section>
<h2>Next Topic</h2>
</section>
Best practices:
- Use for optional deep dives
- Main topics go horizontal (â)
- Subtopics go vertical (â)
- Visual indicator in controls
- Great for Q&A sections
Reveal.js Advanced Features
Fragment Animations
Progressive reveal of content within a slide:
Basic fragments:
<ul>
<li class="fragment">Fade in (default)</li>
<li class="fragment fade-in">Also fades in</li>
<li class="fragment fade-out">Fades out</li>
<li class="fragment fade-up">Slides in from bottom</li>
<li class="fragment fade-down">Slides in from top</li>
<li class="fragment fade-left">Slides in from right</li>
<li class="fragment fade-right">Slides in from left</li>
</ul>
Emphasis fragments:
<ul>
<li class="fragment grow">Grow larger</li>
<li class="fragment shrink">Shrink smaller</li>
<li class="fragment strike">Strike through</li>
<li class="fragment highlight-red">Highlight in red</li>
<li class="fragment highlight-blue">Highlight in blue</li>
<li class="fragment highlight-green">Highlight in green</li>
<li class="fragment highlight-current-red">Highlight current</li>
</ul>
Fragment index (control order):
<p class="fragment" data-fragment-index="3">Appears third</p>
<p class="fragment" data-fragment-index="1">Appears first</p>
<p class="fragment" data-fragment-index="2">Appears second</p>
Combining fragments:
<span class="fragment fade-in">
<span class="fragment highlight-red">
<span class="fragment fade-out">
Text fades in, highlights red, then fades out
</span>
</span>
</span>
Auto-Animate
Smooth transitions between slide states:
Basic example:
<section data-auto-animate>
<h2>Auto-Animate</h2>
</section>
<section data-auto-animate>
<h2 style="margin-top: 100px; color: red;">Auto-Animate</h2>
</section>
Element matching (using data-id):
<section data-auto-animate>
<div data-id="box" style="height: 50px; background: red;"></div>
</section>
<section data-auto-animate>
<div data-id="box" style="height: 200px; background: blue;"></div>
</section>
Code morphing:
<section data-auto-animate>
<pre><code data-trim data-line-numbers>
let x = 10;
</code></pre>
</section>
<section data-auto-animate>
<pre><code data-trim data-line-numbers>
let x = 10;
let y = 20;
let sum = x + y;
</code></pre>
</section>
Auto-animate settings:
<section data-auto-animate data-auto-animate-easing="cubic-bezier(0.770, 0.000, 0.175, 1.000)">
<section data-auto-animate data-auto-animate-duration="2.0">
Speaker Notes
Visible only in speaker view (press S):
Basic notes:
<section>
<h2>Slide Title</h2>
<p>Public content...</p>
<aside class="notes">
These notes are only visible in speaker view.
- Remember to mention the case study
- Emphasize the 2x performance improvement
- Allow 2 minutes for this slide
</aside>
</section>
Formatted notes:
<aside class="notes">
<h4>Key Points:</h4>
<ul>
<li>Point one</li>
<li>Point two</li>
</ul>
<p><strong>Time:</strong> 3 minutes</p>
</aside>
Speaker view features:
- Current slide on left
- Next slide preview on right
- Speaker notes in center
- Timer and slide counter
- Can be full-screen on second monitor
Transitions
Control slide transitions:
Per-slide transition:
<section data-transition="zoom">
<h2>This slide zooms in</h2>
</section>
<section data-transition="fade">
<h2>This slide fades</h2>
</section>
Available transitions:
none– Instant cutfade– Cross-fadeslide– Slide horizontally (default)convex– Slide at a convex angleconcave– Slide at a concave anglezoom– Scale in/out
Separate in/out transitions:
<section data-transition="slide-in fade-out">
<h2>Slides in, fades out</h2>
</section>
Transition speed:
<section data-transition-speed="fast">
<h2>Quick transition</h2>
</section>
<!-- Options: default, fast, slow -->
Backgrounds
Customize slide backgrounds:
Color backgrounds:
<section data-background-color="#ff0000">
<h2>Red background</h2>
</section>
Gradient backgrounds:
<section data-background-gradient="linear-gradient(to bottom, #283b95, #17b2c3)">
<h2>Gradient background</h2>
</section>
Image backgrounds:
<section data-background-image="url.jpg">
<h2>Image background</h2>
</section>
<section data-background-image="url.jpg" data-background-size="cover">
<section data-background-image="url.jpg" data-background-opacity="0.3">
Video backgrounds:
<section data-background-video="video.mp4" data-background-video-loop data-background-video-muted>
<h2>Video background</h2>
</section>
iframe backgrounds:
<section data-background-iframe="https://example.com" data-background-interactive>
<h2>Interactive webpage background</h2>
</section>
Code Highlighting
Syntax highlighting with Highlight.js:
Basic code block:
<pre><code class="language-javascript">
function hello(name) {
console.log(`Hello, ${name}!`);
}
</code></pre>
Line numbers:
<pre><code class="language-python" data-line-numbers>
def calculate(x, y):
result = x + y
return result
</code></pre>
Highlight specific lines:
<pre><code class="language-java" data-line-numbers="1-2|4-6|8">
public class Hello {
private String name;
public Hello(String name) {
this.name = name;
}
public void greet() {
System.out.println("Hello, " + name);
}
}
</code></pre>
Line number offset:
<pre><code data-line-numbers="10-15">
// Code starting at line 10
</code></pre>
Supported languages: JavaScript, Python, Java, C++, C#, Ruby, PHP, Go, Rust, TypeScript, SQL, HTML, CSS, Markdown, Bash, and 150+ more
Math Equations
KaTeX integration for beautiful math:
Inline math:
<p>The formula $E = mc^2$ shows energy-mass equivalence.</p>
Display math:
<p>$$\int_{0}^{\infty} e^{-x^2} dx = \frac{\sqrt{\pi}}{2}$$</p>
Complex equations:
<section>
<h2>Quadratic Formula</h2>
<p>
$$x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}$$
</p>
<aside class="notes">
Explain each component of the formula.
</aside>
</section>
Multi-line equations:
<p>
$$
\begin{aligned}
a &= b + c \\
&= d + e + f
\end{aligned}
$$
</p>
Markdown Support
Write slides in Markdown:
External Markdown file:
<section data-markdown="slides.md" data-separator="^\n---\n$" data-separator-vertical="^\n--\n$"></section>
Inline Markdown:
<section data-markdown>
<textarea data-template>
## Slide Title
- Bullet point one
- Bullet point two
**Bold text** and *italic text*
```javascript
const code = "highlighted";
```
</textarea>
</section>
Markdown with fragments:
<section data-markdown>
<textarea data-template>
## Progressive Reveal
- Item 1 <!-- .element: class="fragment" -->
- Item 2 <!-- .element: class="fragment" -->
- Item 3 <!-- .element: class="fragment" -->
</textarea>
</section>
Interactive Features
Search (Ctrl+Shift+F):
- Automatically enabled with RevealSearch plugin
- Searches all slide content
- Highlights matches
- Navigate between results
Zoom (Alt+Click):
- Click any element while holding Alt
- Zooms in to that element
- Click again to zoom out
- Great for highlighting details
Overview Mode (ESC):
- Shows all slides as thumbnails
- Click to jump to any slide
- Great for navigation during Q&A
- Shows slide hierarchy (horizontal/vertical)
Help Overlay (?):
- Shows all keyboard shortcuts
- Customizable
- Automatically includes plugin shortcuts
Reveal.js API Usage
The template exposes the full Reveal.js API via window.PresentationAPI:
Basic navigation:
// Access Reveal instance
const reveal = window.PresentationAPI.reveal;
// Navigate programmatically
reveal.slide(3); // Go to slide 3
reveal.slide(2, 1); // Go to slide 2, vertical slide 1
reveal.next(); // Next slide
reveal.prev(); // Previous slide
reveal.left(); // Navigate left
reveal.right(); // Navigate right
reveal.down(); // Navigate down (nested)
reveal.up(); // Navigate up (nested)
State management:
// Get current state
const state = reveal.getState();
console.log(state); // {indexh: 2, indexv: 0, indexf: 1}
// Get total slides
const total = reveal.getTotalSlides();
// Get current slide element
const currentSlide = reveal.getCurrentSlide();
// Check if at first/last
reveal.isFirstSlide();
reveal.isLastSlide();
Toggle features:
// Toggle overview mode
reveal.toggleOverview();
// Toggle pause
reveal.togglePause();
// Toggle help overlay
reveal.toggleHelp();
// Toggle auto-slide
reveal.toggleAutoSlide();
Event listeners:
// Slide changed event
reveal.on('slidechanged', event => {
console.log('Now on slide:', event.indexh);
// Send analytics
// Update external UI
// Trigger custom logic
});
// Fragment shown/hidden
reveal.on('fragmentshown', event => {
console.log('Fragment shown:', event.fragment);
});
reveal.on('fragmenthidden', event => {
console.log('Fragment hidden:', event.fragment);
});
// Ready event
reveal.on('ready', event => {
console.log('Presentation ready');
});
// Overview toggled
reveal.on('overviewshown', () => {
console.log('Overview mode activated');
});
reveal.on('overviewhidden', () => {
console.log('Overview mode deactivated');
});
Sync with external systems:
// Send slide changes to server
reveal.on('slidechanged', async event => {
await fetch('/api/analytics', {
method: 'POST',
body: JSON.stringify({
slide: event.indexh,
timestamp: Date.now()
})
});
});
// Multi-screen synchronization
reveal.on('slidechanged', event => {
// Broadcast to other windows
localStorage.setItem('currentSlide', JSON.stringify(event));
});
window.addEventListener('storage', e => {
if (e.key === 'currentSlide') {
const {indexh, indexv} = JSON.parse(e.newValue);
reveal.slide(indexh, indexv);
}
});
Dynamic content:
// Load slide content dynamically
reveal.on('slidechanged', async event => {
const slideId = event.currentSlide.getAttribute('data-slide-id');
if (slideId) {
const data = await fetch(`/api/slides/${slideId}`).then(r => r.json());
event.currentSlide.innerHTML = data.content;
}
});
Custom theme switching:
// Change theme colors dynamically
function changeTheme(themeName) {
const themes = {
blue: { primary: '#2E86AB', secondary: '#A23B72', accent: '#F18F01' },
green: { primary: '#2d6a4f', secondary: '#52b788', accent: '#d8f3dc' },
red: { primary: '#9d0208', secondary: '#dc2f02', accent: '#f48c06' }
};
const theme = themes[themeName];
Object.entries(theme).forEach(([key, value]) => {
const cssVar = `--color-${key}`;
document.documentElement.style.setProperty(cssVar, value);
});
}
// Usage: changeTheme('green')
Complete API reference: https://revealjs.com/api/
Advanced Customization
Custom CSS
Add custom styles in the <style> section:
/* Custom slide variant */
.slide-highlight {
background: linear-gradient(135deg, #fff5f5, #ffffff);
border-left: 8px solid var(--color-accent);
padding-left: 3em !important;
}
/* Custom animation */
@keyframes pulse {
0%, 100% { transform: scale(1); }
50% { transform: scale(1.05); }
}
.pulse-on-show.fragment.visible {
animation: pulse 0.5s ease-in-out;
}
/* Responsive grid layout */
.feature-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 2em;
}
Adding External Libraries
Charts (Chart.js):
<!-- In <head> -->
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.0"></script>
<!-- In slide -->
<section>
<h2>Sales Data</h2>
<canvas id="salesChart" width="800" height="400"></canvas>
<script>
Reveal.on('slidechanged', event => {
if (event.currentSlide.querySelector('#salesChart')) {
new Chart(document.getElementById('salesChart'), {
type: 'line',
data: {
labels: ['Jan', 'Feb', 'Mar', 'Apr'],
datasets: [{
label: 'Sales',
data: [12, 19, 3, 5],
borderColor: '#2E86AB',
tension: 0.1
}]
}
});
}
});
</script>
</section>
Diagrams (Mermaid):
<!-- In <head> -->
<script type="module">
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs';
mermaid.initialize({ startOnLoad: true });
</script>
<!-- In slide -->
<section>
<h2>Architecture</h2>
<div class="mermaid">
graph TD
A[Client] --> B[Load Balancer]
B --> C[Server 1]
B --> D[Server 2]
</div>
</section>
3D Visualizations (Three.js):
<script src="https://cdn.jsdelivr.net/npm/three@0.160.0/build/three.min.js"></script>
<section>
<h2>3D Model</h2>
<div id="three-container" style="width: 800px; height: 600px;"></div>
<script>
// Initialize Three.js scene when slide is shown
Reveal.on('slidechanged', event => {
if (event.currentSlide.querySelector('#three-container')) {
// Three.js setup code...
}
});
</script>
</section>
Keyboard Shortcuts Reference
Provide these shortcuts to users:
| Action | Shortcut | Description |
|---|---|---|
| Next slide | â or Space or N |
Move to next slide |
| Previous slide | â or P |
Move to previous slide |
| Navigate down | â |
Go to nested slide below |
| Navigate up | â |
Go to nested slide above |
| First slide | Home |
Jump to first slide |
| Last slide | End |
Jump to last slide |
| Speaker view | S |
Open speaker notes window |
| Overview mode | ESC or O |
Toggle thumbnail overview |
| Fullscreen | F |
Toggle fullscreen mode |
| Search | Ctrl+Shift+F |
Search presentation content |
| Zoom | Alt+Click |
Zoom into element |
| Help overlay | ? |
Show all shortcuts |
| Pause | . (period) or B |
Pause presentation (black screen) |
| Auto-slide | A |
Toggle auto-advance |
| Print/PDF | E |
Switch to print view (add ?print-pdf to URL) |
Mobile gestures:
- Swipe left â Next slide
- Swipe right â Previous slide
- Swipe up â Navigate down
- Swipe down â Navigate up
- Pinch â Toggle overview
Design Guidelines
Content Density
Per slide guidelines:
- Title slides: 1 title + 1-2 supporting lines
- Content slides: 1 heading + 3-7 bullet points OR 2-3 paragraphs
- Two-column: 3-5 items per column
- Image slides: 1 image + short description
The 6Ã6 rule: Maximum 6 bullets with 6 words each
Avoid:
- â Paragraphs longer than 4 lines
- â More than 7 bullet points per slide
- â Tiny font sizes (< 24px)
- â Wall of text
- â Cramped spacing
Animation Best Practices
Use fragments for:
- â Building lists progressively
- â Revealing data points step-by-step
- â Highlighting key information
- â Controlling information flow
Use auto-animate for:
- â Showing transformations
- â Morphing code examples
- â Animating diagrams
- â Data visualizations
Avoid:
- â Excessive animations (don’t animate every element)
- â Distracting transitions
- â Animations longer than 1 second
- â Too many concurrent animations
Visual Hierarchy
Create clear structure:
- Large to small: Titles (3em) â Headings (2em) â Body (1em)
- Bold to regular: Important points â Supporting details
- Color emphasis: Accent color â Primary â Body text
- Spacing: More space = more importance
Color and Accessibility
Accessibility requirements:
- Maintain 4.5:1 contrast for normal text
- Maintain 3:1 contrast for large text (18pt+)
- Don’t rely solely on color to convey information
- Test with colorblind simulators
Color usage:
- Primary: Headings, links, emphasis
- Secondary: Gradients, backgrounds
- Accent: Call-to-actions, highlights
Troubleshooting
Slides Not Displaying
Issue: Blank screen or no slides appear
Solution:
- Check browser console for JavaScript errors
- Ensure
<section>tags are inside.reveal .slides - Verify CDN links are accessible (internet required)
- Check for unclosed HTML tags
Fragments Not Working
Issue: All content appears at once
Solution:
- Verify
class="fragment"is set correctly - Check that
fragments: truein configuration - Ensure no CSS overrides are hiding fragments
- Test in different browser
Speaker Notes Not Showing
Issue: Press S but no speaker window opens
Solution:
- Check popup blocker settings
- Ensure
<aside class="notes">is inside<section> - Verify RevealNotes plugin is loaded
- Try opening in a new browser tab manually
Code Not Highlighted
Issue: Code appears as plain text
Solution:
- Add
class="language-xxx"to<code>element - Ensure RevealHighlight plugin is loaded
- Check that CDN for highlight styles is accessible
- Verify language identifier is supported
Navigation Issues
Issue: Arrow keys don’t work
Solution:
- Check if presentation has focus (click on it)
- Ensure
keyboard: truein configuration - Check for JavaScript errors in console
- Test in incognito mode (disable extensions)
Vertical Slides Not Showing
Issue: Can’t navigate down to nested slides
Solution:
- Ensure slides are properly nested (outer
<section>contains inner ones) - Check for proper HTML structure
- Look for down arrow indicator in controls
- Try pressing â or clicking down arrow
Example Presentation Structures
Product Launch (12-15 slides)
1. ð¬ Title - Product name + tagline [TITLE, zoom transition]
2. ð Agenda - What we'll cover [CONTENT, fragments]
3. ð´ Section - "The Problem" [SECTION, red background]
4. ð° Pain Points - Current challenges [CONTENT, fragment list]
5. ð¡ Solution Overview - How product solves it [CONTENT]
6. ð¢ Section - "Key Features" [SECTION, green background]
7-10. ð± Feature Deep Dives [IMAGE-TEXT, one per slide, auto-animate]
ââ 7. Performance (fragment metrics)
ââ 8. Security (diagram)
ââ 9. UX (before/after comparison)
ââ 10. Integration (code example)
11. ð° Pricing - Tiers and packages [TWO-COLUMN]
12. ð¬ Testimonial [QUOTE, gradient background]
13. ð Call to Action [TITLE, zoom transition]
14. ð Thank You + Q&A [TITLE]
Technical Talk (20-25 slides)
1. Title + Speaker Bio [TITLE]
2. Agenda [CONTENT, fragment]
3. Section - "Background" [SECTION]
4-6. Context (nested slides)
<section>
4. Main concept [CONTENT]
5. Why it matters [CONTENT]
6. Current approaches [TWO-COLUMN]
</section>
7. Section - "Deep Dive" [SECTION]
8-15. Technical Details
8. Architecture diagram [IMAGE-TEXT]
9-11. Code examples (auto-animate)
12. Performance metrics [CONTENT, fragments]
13-14. Comparison (before/after)
15. Demo transition [TITLE, fade]
16. Section - "Results" [SECTION]
17-19. Outcomes
17. Benchmark data [CONTENT, chart.js]
18. Real-world impact [QUOTE]
19. Lessons learned [CONTENT]
20. Future Work [CONTENT, fragments]
21. Resources + Links [CONTENT]
22. Q&A [TITLE]
Educational Lesson (25-30 slides)
1. Lesson Title [TITLE]
2. Learning Objectives [CONTENT, fragment]
3. Section - "Introduction" [SECTION]
4-7. Background (vertical nested)
8. Section - "Core Concepts" [SECTION]
9-20. Main Content
- One concept per slide
- Use fragments for progressive reveal
- Mix layouts: content, two-column, image-text
- Add speaker notes for teaching points
21. Section - "Practice" [SECTION]
22-25. Examples and Exercises
- Code examples with line highlighting
- Interactive elements
- Step-by-step walkthroughs
26. Summary [CONTENT, fragments]
27. Additional Resources [CONTENT]
28. Questions [TITLE]
Best Practices Checklist
Before Creating:
- Ask all discovery questions to user
- Confirm slide structure and count
- Clarify animation requirements
- Verify color/brand guidelines
- Understand special feature needs
During Creation:
- Read template file first
- Use appropriate layouts for content types
- Add fragments for progressive reveal
- Include speaker notes for key slides
- Apply consistent color scheme
- Add transitions strategically
- Nest slides for hierarchical content
- Test code highlighting
- Verify math formulas render
After Creation:
- Test in browser (open HTML file)
- Navigate through all slides
- Test speaker view (press S)
- Check overview mode (press ESC)
- Verify fragments animate correctly
- Test keyboard shortcuts
- Check mobile responsiveness
- Validate accessibility (contrast)
- Proofread content
- Test fullscreen mode
DO:
â
Ask questions before starting
â
Use fragments for progressive reveals
â
Include speaker notes for presentations
â
Keep slides focused (one idea each)
â
Test navigation thoroughly
â
Ensure good color contrast
â
Use nested slides for deep dives
â
Provide clear instructions
â
Test on different screen sizes
â
Leverage Reveal.js API when needed
DON’T:
â Skip the discovery questions
â Overcrowd slides with text
â Use too many different animations
â Forget to test speaker view
â Ignore accessibility standards
â Create slides without clear purpose
â Use more than 3 font families
â Add distracting effects
â Skip validation testing
â Forget to provide usage instructions
Additional Resources
Official Documentation:
- Reveal.js Official Docs – Complete API reference
- Reveal.js GitHub – Source code and examples
- Reveal.js Plugins – Community plugins
Reference Files (in this skill):
reference/layouts.md– Detailed layout guide with Reveal.js examplesreference/themes.md– Theme customization and color theory with Reveal.jstemplates/viewer-reveal.html– Reveal.js base template with full documentationexamples/reveal-advanced-demo.html– Advanced features showcase
Design Tools:
- Coolors.co – Color palette generator
- Google Fonts – Web font library
- SVG OMG – SVG optimizer
- WebAIM Contrast Checker – Accessibility testing
Related Libraries:
- Chart.js – Data visualization charts
- Mermaid – Diagram and flowchart generation
- KaTeX – Math equation rendering
- Highlight.js – Syntax highlighting for 190+ languages
Reveal.js Themes:
- Reveal.js Themes Gallery – Official themes
- Custom Theme Builder – Visual theme creator
Export and Sharing:
- PDF Export: Add
?print-pdfto URL and use browser print (Ctrl+P) - Hosting: Upload to GitHub Pages, Netlify, Vercel for free hosting
- Embedding: Use
<iframe>to embed in websites
Migration Guide (from Classic Template)
If you have existing presentations using viewer.html, here’s how to migrate:
Key Differences
| Feature | Classic (viewer.html) |
Reveal.js (viewer-reveal.html) |
|---|---|---|
| Framework | Custom JavaScript | Reveal.js 5.x |
| Slides | JavaScript array | HTML <section> tags |
| Animations | CSS transitions only | Fragments, auto-animate, transitions |
| Speaker Notes | â Not available | â Full speaker view (press S) |
| Overview Mode | â Not available | â Thumbnail overview (press ESC) |
| Vertical Slides | â Not available | â Nested navigation |
| Code Highlighting | Basic | Highlight.js with line numbers |
| Math Equations | â Not available | â KaTeX support |
| Search | â Not available | â Full-text search (Ctrl+Shift+F) |
| Plugins | â None | â Extensive ecosystem |
| API Access | Limited | Full Reveal.js API |
Migration Steps
- Convert slide structure:
// OLD (viewer.html)
const SLIDES = [
{
layout: "title",
content: `<h1>Title</h1>`
}
];
// NEW (viewer-reveal.html)
<section class="slide-title">
<h1>Title</h1>
</section>
- Update theme configuration:
// OLD
const PRESENTATION = {
title: "...",
theme: { primary: "#...", ... }
};
// NEW
const PRESENTATION_CONFIG = {
title: "...",
theme: { primary: "#...", ... },
revealOptions: { ... }
};
- Add new features:
- Add
class="fragment"for progressive reveals - Wrap nested content in
<section>for vertical navigation - Add
<aside class="notes">for speaker notes - Use Reveal.js transitions and animations
Summary
This skill creates modern, interactive presentations powered by Reveal.js as single HTML files. The upgraded workflow features:
Interactive Workflow
- Ask discovery questions – Gather content, style, and animation requirements
- Propose structure – Collaborative slide planning with user confirmation
- Configure features – Select animations, transitions, and special functions
- Read template – Study
templates/viewer-reveal.html - Generate slides – Create HTML content with appropriate layouts
- Configure presentation – Set theme colors and Reveal.js options
- Add advanced features – Fragments, speaker notes, nested slides, plugins
- Validate thoroughly – Test all features and navigation
- Deliver with instructions – Provide complete usage guide
Key Advantages over Classic Template
- â Advanced animations: Fragments, auto-animate, parallax
- â Speaker tools: Notes, timer, next slide preview
- â Navigation: Vertical slides, overview mode, search
- â Rich content: Code highlighting, math equations, Markdown
- â Plugin ecosystem: Extensible with hundreds of plugins
- â Full API: Complete programmatic control
- â Active development: Reveal.js is actively maintained
- â Community: Large user base and resources
Success Factors
- Always ask questions first – Don’t assume requirements
- Use appropriate layouts – Match content type to layout
- Leverage fragments – Progressive reveals keep audience engaged
- Add speaker notes – Essential for presentations
- Test thoroughly – Verify all features work
- Ensure accessibility – Good contrast, keyboard nav, semantic HTML
- Provide clear instructions – Users need to know all features
The Result
A professional, feature-rich presentation that:
- Runs in any modern browser
- Works offline (CDN resources cached)
- Supports advanced features (speaker view, overview, search)
- Offers smooth animations and transitions
- Provides full keyboard and touch control
- Scales from simple pitches to complex technical talks
- Can be easily shared, embedded, or hosted
Ready to create amazing presentations! ð
For detailed layout examples and animation techniques, see reference/layouts.md
For theme customization and color theory, see reference/themes.md
For a complete working example, see examples/reveal-advanced-demo.html