A lightweight, dependency-free ES6 package that turns a plain HTML page into a full-featured slide presentation — no build step, no framework, no bundler required.
<script> block — protocol-aware, works on http:// and file://
Write your slides as <section class="slide"> elements.
Whakerexa Slides scans the page, wires up every control, and handles
navigation, progress tracking, and view switching for you.
The package exposes a single public object — window.app —
and fires a wexa:slides:ready event when initialisation is complete,
so you can hook in your own code without timing gymnastics.
You write the content. The package handles everything else.
Drop one <script> before </body>.
Works on http:// and file:// — same code, same result.
<script>
(function () {
const s = document.createElement('script');
s.dataset.themes = 'wexa:wexa_theme.css,aurora:wexa_theme_aurora.css';
s.dataset.default = 'wexa';
s.dataset.themesPath = 'wexa_statics/css/themes/';
s.dataset.logo = 'images/logo.png';
if (window.location.protocol === 'file:') {
s.src = 'wexa_statics/js/wexa.bundle.js';
} else {
s.type = 'module';
s.src = 'wexa_statics/js/extras/slides/slides.init.js';
}
document.head.appendChild(s);
})();
</script>
data-themes — omit to skip ThemeManager entirelydata-logo — omit to disable the logo overlaydata-progress="false" — hides the progress bar
Write any of these elements in the page with the exact id;
the initializer will use yours instead of creating a default one.
nav-content — navigation bar (Prev / Next / … / Fullscreen + view-mode radios)progress-container + progress-bar — progress baroverview-container — overview panelaccessibility-controls — theme-switcher + color-scheme buttonlogo-container — logo overlay (only when data-logo is set)Import Slides and pass the elements you wrote.
import Slides from 'wexa_statics/js/extras/slides/slides.js';
const app = new Slides({
slides: document.querySelectorAll('section.slide'),
controls: document.getElementById('nav-content'),
controlsView: document.getElementById('slides-controls-view'),
overviewContainer: document.getElementById('overview-container'),
progressBarContainer: document.getElementById('progress-container'),
progressBar: document.getElementById('progress-bar'),
logo: document.getElementById('logo-container'),
accessibility: document.getElementById('accessibility-controls'),
mode: 'presentation' // 'presentation' | 'overview' | 'handout' | 'note'
});
app.init();
Plain wexa.css only. No ThemeManager, no switcher button.
Examples below show the http:// form. For file://, use
the detection block from the Integration slide and set data-* on s.
<script type="module" src="slides.init.js"></script>
All themes share the same folder → use data-themes-path as prefix.
<script type="module" src="slides.init.js"
data-themes="wexa:wexa_theme.css,
aurora:wexa_theme_aurora.css,
highcontrast:wexa_theme_highcontrast.css"
data-default="wexa"
data-themes-path="wexa_statics/css/themes/">
</script>
Write overrides in @layer theme directly in the page.
Always active, no ThemeManager needed.
<style>
@layer theme {
:root { --a-color: rgb(200, 0, 0); }
.dark { --a-color: rgb(255, 120, 80); }
}
</style>
<script type="module" src="slides.init.js"></script>
Load the theme as a static CSS link. No data-themes, no switcher.
<link rel="stylesheet" href="my_theme.css">
<script type="module" src="slides.init.js"></script>
Themes are in different folders → omit data-themes-path,
write each path in full.
<script type="module" src="slides.init.js"
data-themes="mine:./my_theme.css,
wexa:wexa_statics/css/themes/wexa_theme.css,
aurora:wexa_statics/css/themes/wexa_theme_aurora.css"
data-default="mine">
</script>
The Whakerexa Slides package is designed so that accessibility is not an add-on, but a built-in principle. Every component, interaction and visual element aims to be usable by as many people as possible.
The Web is fundamentally designed to work for all people, whatever their hardware, software, language, location, or ability. When the Web meets this goal, it is accessible to people with a diverse range of hearing, movement, sight, and cognitive ability. World Wide Web Consortium (W3C), Web Accessibility Initiative (WAI) — "Introduction to Web Accessibility".
This slide contains a nested figure inside a paragraph. It must follow normal document flow (not the full-page layout).
These slides are powered by the Whakerexa ES6 Slides module.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla ac dui eu est feugiat lacinia sit amet nec leo. Mauris eu ipsum leo. Nulla mi odio, cursus sed sollicitudin non, fringilla id magna. Suspendisse sit amet posuere elit. Maecenas iaculis, turpis a placerat imperdiet, libero lorem feugiat nisi, nec tincidunt diam nibh sit amet massa. Vestibulum quis adipiscing tellus. Maecenas sollicitudin sodales pulvinar. Donec dui ipsum, bibendum facilisis consequat interdum, tempus ut mauris. Aliquam ut dolor nec odio scelerisque bibendum quis in neque. Aliquam dui dui, pulvinar quis fermentum quis, gravida eu augue. Nunc tristique dolor a urna pulvinar bibendum. Curabitur mollis cursus neque, in scelerisque metus porta non. Donec tempor enim in nibh vestibulum et convallis nisi malesuada. Duis ut lectus sed metus venenatis porttitor id pharetra quam. Suspendisse sapien turpis, ornare in molestie et, gravida eget turpis.
A documentation here...
| Description | |||
|---|---|---|---|
| Sarah | Connor | 1984-05-12 | Terminator's target |
| John | Connor | 2029-07-11 | Leader of the human resistance |
| Kyle | Reese | 1984-05-12 | Sent back to protect Sarah Connor |
| Skynet | Activation | 1997-08-29 | Skynet becomes self-aware |
| Judgment Day | Event | 1997-08-29 | Skynet launches a nuclear attack |
| T-800 | Arrival | 1984-05-12 | Sent to kill Sarah Connor |
Check that fullscreen mode works correctly.
Very large and tall image:
Very tall block:
#5.1 in the URL bar → slide 5, step 1.#5.2 → slide 5, step 2.#5.0 → slide 5, no incremental active.This block should not crash the slide engine.
The slide should remain stable even without list items.
This slide contains almost nothing. It must still display correctly.
Press o to enter overview mode.
Press Escape or s to return to presentation.
In overview, click a GoTo button → must navigate to that slide and return to presentation mode automatically.
Press d to enter handout mode.
Press Escape or s to return to presentation.
Handout mode prints all slides as a scrollable, printable document — no incremental reveals, no per-slide navigation.
Press m to enter note mode.
Press Escape or s to return to presentation.
Note mode lists every slide as a scrollable, printable document,
each one paired with its speaker notes from a matching
<aside for="slide-id">.
Navigate away from this slide, then return to it.
If autoPlayEnabled: true is set in the config, playback starts automatically on arrival.
The video must also pause automatically when leaving this slide.
|
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. Attribution: please credit the Whakerexa project. |