reveal.js Presentations
Create web-based presentations as single HTML files using reveal.js v5 via CDN.
Quick Start
- 1. Copy
assets/template.html to the project directory - Replace
{{TITLE}}, {{SUBTITLE}}, {{THEME}} placeholders - Add slides as
<section> elements inside INLINECODE5 - Open in browser or deploy to Vercel/GitHub Pages
Slide Structure
CODEBLOCK0
Key Features
Fragments (click-to-reveal)
<p class="fragment fade-up">Appears on click</p>
<p class="fragment fade-up">Then this</p>
Styles:
fade-in (default),
fade-up,
fade-down,
fade-left,
fade-right,
fade-out,
fade-in-then-out,
grow,
shrink,
strike, INLINECODE16
Auto-Animate
Add
data-auto-animate to adjacent sections — matching elements animate automatically:
CODEBLOCK2
Backgrounds
CODEBLOCK3
Speaker Notes
CODEBLOCK4
Viewport Sizing
Set width and height in Reveal.initialize(). reveal.js scales the content to fit the browser window. Use larger values (e.g. 1400×800) if content looks too large on screen — the framework scales down automatically.
CODEBLOCK5
Custom Styling
Use a separate style.css file or inline <style> block. Override reveal.js defaults:
CODEBLOCK6
For grid backgrounds (like danielgrobelny.de):
CODEBLOCK7
Themes
Built-in: black, white, league, beige, night, serif, simple, solarized, moon, dracula, sky, blood
Change via CDN link: INLINECODE23
For fully custom themes, use black as base and override with custom CSS.
Plugins (via CDN)
Enable code highlighting, speaker notes, math, search, zoom:
CODEBLOCK8
For code blocks with line highlighting:
CODEBLOCK9
Deployment
Vercel (static)
Just push the HTML + CSS + assets. No build step needed — Vercel serves static files.
GitHub Pages
Push to repo, enable Pages from Settings → deploy from
main branch root or
/docs.
PDF Export
Append
?print-pdf to URL, then browser Print → Save as PDF.
Full API Reference
Read
references/revealjs-api.md for complete config options, fragment types, JS API methods, keyboard shortcuts, and plugin details.
reveal.js 演示文稿
使用 reveal.js v5 通过 CDN 创建基于网页的演示文稿,每个演示文稿为单个 HTML 文件。
快速开始
- 1. 将 assets/template.html 复制到项目目录
- 替换 {{TITLE}}、{{SUBTITLE}}、{{THEME}} 占位符
- 在
内添加
元素作为幻灯片- 在浏览器中打开,或部署到 Vercel/GitHub Pages
幻灯片结构
html
主要功能
片段(点击显示)
html
点击时出现
然后出现这个
样式:fade-in(默认)、fade-up、fade-down、fade-left、fade-right、fade-out、fade-in-then-out、grow、shrink、strike、highlight-red/green/blue
自动动画
为相邻的 section 添加 data-auto-animate 属性——匹配的元素会自动动画:
html
背景
html
演讲者备注
html
视口尺寸设置
在 Reveal.initialize() 中设置 width 和 height。reveal.js 会自动缩放内容以适应浏览器窗口。如果内容在屏幕上显得过大,请使用更大的数值(例如 1400×800)——框架会自动缩小。
js
Reveal.initialize({
width: 1400,
height: 800,
margin: 0.04,
});
自定义样式
使用单独的 style.css 文件或内联