How to see all slides in overview mode? #3433
Replies: 1 comment 8 replies
-
There is no way to do so using the current API, Reveal does the "zooming out" effect in overview mode by setting a reveal.js/js/controllers/overview.js Lines 121 to 122 in 92ee97f As you can see values are hard coded and thus you're not able to configure it directly. The good news is you can use a MutationObserver to track when Reveal changes the scale of the // regexp to match only the last `scale(...)` rule (there are two scale rules on the .slides element, don't know why)
const currentScaleRegexp = /scale\([^\)]*\)(?!.*(scale))/;
// prevent infinite loop https://stackoverflow.com/a/48599188
let insideInitialObserverCallback = false;
let observer = new MutationObserver( mutationsList => {
// only react when in overview mode
// could also use https://revealjs.com/overview/#events to stop/start observer when needed
if (!Reveal.isOverview()) return;
insideInitialObserverCallback = ! insideInitialObserverCallback
if ( insideInitialObserverCallback ) {
mutationsList.forEach(mutation => {
const currentTransform = mutation.target.style.transform;
// change to the scale that fits your needs
mutation.target.style.transform = currentTransform.replace(currentScaleRegexp, 'scale(.05)');
})
}
} );
observer.observe(
Reveal.getSlidesElement(),
{ attributes: true, attributesFilter: ['style'] }
); when working with small scale like this, you may want to make the "current slide" styling more visible than the default one : .reveal.overview .slides section.present {
outline-color: cyan; /* color that suits your theme */
outline-width: 20px;
outline-offset: 20px;
} liimitations :
hope this helps 🙏 |
Beta Was this translation helpful? Give feedback.
-
Is there an easy way to see all slides in the overview mode? Currently, only a few slides are shown in overview mode. I am trying to find a way that shows all of them like what flowtime.js does. Any help would be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions