Refactor high-complexity React components in Dify frontend. Use when `pnpm analyze-component...
npx skills add zhaoxuanZzz/skills --skill "web-presentation"
Install specific skill from multi-skill repository
# Description
Create modern, interactive web presentations as single-file HTML artifacts. Use this when users request creating slides, presentations, slide decks, web presentations, or browser-based presentations. Output .html files that can be opened directly in a browser or displayed as claude.ai artifacts.
# SKILL.md
name: web-presentation
description: Create modern, interactive web presentations as single-file HTML artifacts. Use this when users request creating slides, presentations, slide decks, web presentations, or browser-based presentations. Output .html files that can be opened directly in a browser or displayed as claude.ai artifacts.
license: Complete terms in LICENSE.txt
β οΈ READ THIS ENTIRE FILE BEFORE CREATING A WEB PRESENTATION β οΈ
Web Presentation Skill
Create elegant, interactive presentations that run entirely in a web browser as single HTML files. Perfect for product launches, technical talks, educational content, and any scenario requiring modern, shareable slides.
Overview
This skill creates self-contained HTML presentations with:
- Smooth navigation - Arrow keys, buttons, touch/swipe support
- Multiple layouts - Title, content, two-column, image+text, quotes, sections
- Customizable themes - Brand colors, fonts, gradients
- Keyboard shortcuts - Full keyboard control including fullscreen mode
- Progress tracking - Visual progress bar and slide counter
- Responsive design - Works on desktop, tablet, and mobile
- Single-file output - Everything embedded, no external dependencies (except fonts)
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
Step 1: Understand the Requirements
Before creating anything, gather:
- Topic/purpose: What is the presentation about?
- Audience: Who will view it?
- Key messages: 3-5 main takeaways
- Approximate length: How many slides needed?
- Visual style: Professional, creative, minimal, bold?
- Brand requirements: Specific colors, fonts, or guidelines?
Step 2: Plan the Structure
Organize content into logical sections:
Standard presentation flow:
1. Title slide - Opening with title, subtitle, author
2. Overview/Agenda - What will be covered
3. Section 1 - First main topic
- Supporting slides with details
4. Section 2 - Second main topic
- Supporting slides with details
5. Section 3 - Third main topic (if needed)
- Supporting slides with details
6. Summary/Conclusion - Key takeaways
7. Thank you/Q&A - Closing slide
Typical slide counts:
- Quick pitch: 5-10 slides
- Standard presentation: 15-25 slides
- Long-form talk: 30-50 slides
- Workshop: 50+ slides
Step 3: Read the Template
CRITICAL: Before writing any code, read the template file:
templates/viewer.html
This template contains:
- β
FIXED sections: Header, footer, navigation, styling (DO NOT CHANGE)
- β
VARIABLE sections: SLIDES array, PRESENTATION config (CUSTOMIZE THESE)
The template is your foundation. Copy it and modify only the marked sections.
Step 4: Define Slide Content
Create slides using the SLIDES array. Each slide is an object with:
- layout: Layout type (title, content, two-column, etc.)
- content: HTML content for the slide
Example:
const SLIDES = [
{
layout: "title",
content: `
<h1>Product Launch 2024</h1>
<div class="subtitle">Introducing the next generation</div>
<div class="author">Jane Smith, Product Lead</div>
`
},
{
layout: "content",
content: `
<h2>What's New</h2>
<p>We're excited to announce three major improvements:</p>
<ul>
<li>2x faster performance</li>
<li>Enhanced security features</li>
<li>Redesigned user interface</li>
</ul>
`
},
{
layout: "section",
content: `
<div class="section-number">Part 1</div>
<h2>Performance</h2>
`
}
// ... more slides
];
Step 5: Configure Theme
Set presentation metadata and colors in the PRESENTATION object:
const PRESENTATION = {
title: "Product Launch 2024",
author: "Jane Smith",
theme: {
primary: "#d97757", // Main color (buttons, headings)
secondary: "#6a9bcc", // Gradient accent
accent: "#788c5d" // Section backgrounds
}
};
Color selection tips:
- Use brand colors if available
- Ensure sufficient contrast for readability
- Test colors together (primary + secondary should work in gradients)
- See reference/themes.md for preset themes and guidance
Step 6: Generate and Validate
Create the HTML file with all customizations, then:
- Open in browser - Test that slides load correctly
- Navigate through all slides - Check flow and transitions
- Test keyboard shortcuts - Arrow keys, space, F for fullscreen
- Check responsive behavior - Resize window or test on mobile
- Verify content - No typos, proper formatting
- Test fullscreen mode - Press F or click fullscreen button
Common issues to check:
- Slides render correctly (no broken layouts)
- All text is readable (good contrast)
- Navigation works (buttons and keys)
- Progress bar updates
- Slide counter is accurate
- Theme colors applied correctly
Step 7: Deliver
Provide the HTML file to the user with:
- File name: Descriptive name like product-launch-2024.html
- Brief instructions: "Open in any web browser. Use arrow keys or buttons to navigate. Press F for fullscreen."
- Note about editing: If they want to make changes, they can edit the SLIDES array in the HTML file
Available Layouts
1. Title Slide (layout: "title")
Use for: Opening, closing, major section breaks
{
layout: "title",
content: `
<h1>Main Title</h1>
<div class="subtitle">Subtitle or description</div>
<div class="author">Author or date (optional)</div>
`
}
Features:
- Full-screen, centered
- Gradient background (primary β secondary)
- White text
- Large, impactful typography
2. Content Slide (layout: "content")
Use for: Main content, bullet points, text, code
{
layout: "content",
content: `
<h2>Slide Title</h2>
<p>Paragraph text...</p>
<ul>
<li>Bullet point one</li>
<li>Bullet point two</li>
</ul>
<p>More text with <code>inline code</code>.</p>
<pre>
function example() {
return "code block";
}
</pre>
`
}
Supported elements:
- <h2> - Main heading (colored with primary theme)
- <h3> - Subheading
- <p> - Paragraphs
- <ul>, <ol>, <li> - Lists
- <code> - Inline code
- <pre> - Code blocks
- <strong>, <em> - Emphasis
3. Two-Column Layout (layout: "two-column")
Use for: Comparisons, before/after, pros/cons
{
layout: "two-column",
content: `
<h2>Comparison</h2>
<div class="columns">
<div class="column">
<h3>Before</h3>
<ul>
<li>Slow performance</li>
<li>Complex setup</li>
</ul>
</div>
<div class="column">
<h3>After</h3>
<ul>
<li>2x faster</li>
<li>Simple setup</li>
</ul>
</div>
</div>
`
}
Best practices:
- Balance content between columns
- Use parallel structure
- Title spans both columns
4. Image + Text (layout: "image-text")
Use for: Product showcases, visual explanations, diagrams
{
layout: "image-text",
content: `
<img src="data:image/svg+xml,..." alt="Description">
<div class="text-content">
<h2>Feature Title</h2>
<p>Description of the feature shown in the image.</p>
<ul>
<li>Key benefit one</li>
<li>Key benefit two</li>
</ul>
</div>
`
}
Image options:
- Data URIs: Embed SVG or base64-encoded images
- External URLs: Link to images (requires internet)
- Recommended: Use SVG for diagrams, icons, illustrations
5. Quote Slide (layout: "quote")
Use for: Testimonials, impactful statements, emphasis
{
layout: "quote",
content: `
<blockquote>
An impactful quote that emphasizes a key message.
</blockquote>
<cite>β Author Name</cite>
`
}
Features:
- Large serif font
- Centered on light background
- Decorative quotation mark
- Great for breaks between sections
6. Section Divider (layout: "section")
Use for: Major topic transitions, chapter breaks
{
layout: "section",
content: `
<div class="section-number">Section 1</div>
<h2>Section Title</h2>
`
}
Features:
- Full-screen colored background (accent color)
- White text
- Creates visual rhythm
- Use sparingly (2-4 per presentation)
Design Guidelines
Visual Hierarchy
Create clear structure:
- Large to small: Titles β Headings β Body text
- Bold to regular: Important points β Supporting details
- Color emphasis: Primary color β Body text color
- Spacing: More space = more importance
Typography scale:
- Title slides: 64px titles
- Content slides: 42px headings, 20px body text
- Keep line length under 80 characters
- Use generous line height (1.6-1.8)
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
Avoid:
- β Paragraphs longer than 4 lines
- β More than 7 bullet points
- β Tiny font sizes
- β Wall of text
- β Cramped spacing
Color Usage
Best practices:
- Primary color: Headings, buttons, emphasis
- Secondary color: Gradients, accents
- Accent color: Section dividers, special elements
- Text color: Dark on light backgrounds
- Consistency: Use same colors for same purposes
Accessibility:
- Maintain 4.5:1 contrast ratio for normal text
- Maintain 3:1 contrast ratio for large text (18pt+)
- Don't rely solely on color to convey information
- Test with colorblind simulation tools
Images and Graphics
When to use:
- Diagrams explaining complex concepts
- Product screenshots
- Data visualizations
- Icons for visual interest
- Logos and branding
Best practices:
- Use high-quality images (but keep file size reasonable)
- Include descriptive alt text
- Embed as data URIs for self-contained files
- Use SVG for diagrams and icons
- Keep images relevant to content
Creating data URIs:
// For SVG:
const svgDataUri = `data:image/svg+xml,${encodeURIComponent(svgString)}`;
// For PNG/JPG (base64):
const imageDataUri = `data:image/png;base64,${base64String}`;
Animation and Transitions
Built-in transitions:
- Slide transitions are smooth and professional
- 0.5s cubic-bezier easing
- Slides enter from right, exit to left
- No customization needed
Avoid:
- β Adding custom animations (keep it simple)
- β Distracting effects
- β Auto-advancing slides
- β Sound effects
Advanced Customization
Custom CSS
Add custom styles in the <style> section:
/* Custom layout variant */
.slide.layout-content.highlight {
background: linear-gradient(135deg, #fff5f5, #ffffff);
border-left: 5px solid var(--theme-primary);
}
/* Custom text styling */
.slide h2.accent {
color: var(--theme-accent);
}
Then use in slides:
{
layout: "content highlight",
content: `<h2 class="accent">Special Slide</h2>...`
}
JavaScript Customization
Modify behavior in the <script> section:
// Auto-advance slides every 10 seconds
setInterval(() => {
if (currentSlideIndex < SLIDES.length - 1) {
nextSlide();
}
}, 10000);
// Track slide views
document.addEventListener('keydown', (e) => {
if (e.key === 'ArrowRight') {
console.log('Advanced to slide', currentSlideIndex + 1);
}
});
Adding External Libraries
For charts, diagrams, or special effects:
<!-- Add in <head> -->
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<!-- Use in slide content -->
{
layout: "content",
content: `
<h2>Sales Data</h2>
<canvas id="salesChart"></canvas>
<script>
// Initialize chart when slide is active
new Chart(document.getElementById('salesChart'), {...});
</script>
`
}
Keyboard Shortcuts Reference
Provide these to users:
| Action | Shortcut |
|---|---|
| Next slide | β or Space |
| Previous slide | β |
| First slide | Home |
| Last slide | End |
| Toggle fullscreen | F |
| Show shortcuts | ? |
| Close overlay | Esc |
Mobile: Swipe left/right to navigate
Troubleshooting
Slides Not Displaying
Issue: Blank screen or "initializing" message
Solution: Check JavaScript console for errors. Ensure SLIDES array is valid JavaScript.
Layout Broken
Issue: Content overlapping or misaligned
Solution: Verify HTML structure matches layout requirements. Check for unclosed tags.
Colors Not Applied
Issue: Default colors showing instead of custom theme
Solution: Check PRESENTATION.theme object syntax. Ensure colors are valid hex codes.
Navigation Not Working
Issue: Buttons or keyboard don't advance slides
Solution: Check browser console for JavaScript errors. Ensure no syntax errors in SLIDES array.
Images Not Showing
Issue: Broken image icons
Solution: Verify data URIs are properly formatted. Check for special characters that need encoding.
Example Presentation Structures
Product Launch (15 slides)
- Title - Product name and tagline
- Problem - Current pain points
- Solution - How product solves it
- Section - Features
5-8. Feature details (one per slide) - Section - Benefits
10-12. Benefit highlights - Pricing/Availability
- Call to action
- Thank you + contact
Technical Talk (20 slides)
- Title - Talk title and speaker
- Agenda - What will be covered
- Section - Background
4-6. Context and motivation - Section - Core Concept
8-12. Technical deep dive - Section - Demo/Examples
14-16. Code examples and walkthroughs - Section - Results/Impact
18-19. Outcomes and learnings - Q&A
Educational Lesson (25 slides)
- Title - Lesson topic
- Learning objectives
- Section - Introduction
4-7. Background concepts - Section - Core Content
9-17. Main teaching points (one concept per slide) - Section - Practice
19-22. Examples and exercises - Summary - Key takeaways
- Additional resources
- Questions
Best Practices
DO:
β
Read the entire template before starting
β
Plan slide structure before coding
β
Use appropriate layouts for content type
β
Keep slides focused (one main idea each)
β
Test navigation and responsiveness
β
Ensure good color contrast
β
Provide clear slide titles
β
Use consistent formatting
β
Include a clear opening and closing
β
Validate HTML and JavaScript syntax
DON'T:
β Overcrowd slides with too much text
β Use more than 3-4 fonts
β Create slides without clear purpose
β Forget to test on different screen sizes
β Use low-contrast color combinations
β Add unnecessary animations
β Skip the validation step
β Mix different design styles
β Rely on internet connectivity (except for fonts)
β Create presentations longer than needed
File Organization
After creation, the presentation file structure:
presentation-name.html (single file containing):
βββ <head>
β βββ Meta tags
β βββ Google Fonts link
β βββ CSS styles (inline)
β βββ Title
βββ <body>
β βββ Header (with title and controls)
β βββ Slide container
β βββ Footer (with navigation)
β βββ Keyboard shortcuts overlay
βββ <script>
βββ PRESENTATION config
βββ SLIDES array
βββ Navigation logic
Dependencies:
- Google Fonts (Poppins, Lora, JetBrains Mono) - requires internet
- All other resources are inline (CSS, JavaScript)
Additional Resources
Reference Documentation:
- reference/layouts.md - Detailed layout guide and examples
- reference/themes.md - Theme customization and color theory
- templates/viewer.html - Base template with comments
Examples:
- examples/ - Complete presentation examples (to be created)
External Tools:
- Coolors.co - Color palette generator
- Google Fonts - Web font library
- SVG OMG - SVG optimizer
- WebAIM Contrast Checker - Accessibility testing
Summary
This skill creates modern, interactive presentations as single HTML files that work in any browser. The workflow is:
- Understand requirements - Gather content and style preferences
- Plan structure - Organize slides logically
- Read template - Study
templates/viewer.html - Define slides - Create SLIDES array with appropriate layouts
- Configure theme - Set colors and metadata
- Generate file - Create complete HTML presentation
- Validate - Test thoroughly before delivery
Key success factors:
- Use appropriate layouts for content type
- Maintain clear visual hierarchy
- Keep content density reasonable
- Test navigation and responsiveness
- Ensure accessibility standards
The result: A professional, self-contained presentation that can be opened in any browser, shared easily, and navigated smoothly with keyboard or mouse.
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.