Commit 71ce0474 authored by Vadim Makeev's avatar Vadim Makeev

Updates

parent 33d0d930
No preview for this file type
/** /**
* Core for Shower HTML presentation engine * Core for Shower HTML presentation engine
* @shower/core v3.1.0, https://github.com/shower/core * @shower/core v3.2.0, https://github.com/shower/core
* @copyright 2010–2021 Vadim Makeev, https://pepelsbey.net * @copyright 2010–2021 Vadim Makeev, https://pepelsbey.net
* @license MIT * @license MIT
*/ */
...@@ -36,6 +36,8 @@ ...@@ -36,6 +36,8 @@
stepSelector: '.next', stepSelector: '.next',
fullModeClass: 'full', fullModeClass: 'full',
listModeClass: 'list', listModeClass: 'list',
mouseHiddenClass: 'pointless',
mouseInactivityTimeout: 5000,
slideSelector: '.slide', slideSelector: '.slide',
slideTitleSelector: 'h2', slideTitleSelector: 'h2',
...@@ -596,6 +598,48 @@ ...@@ -596,6 +598,48 @@
}); });
}; };
var mouse = (shower) => {
const { mouseHiddenClass, mouseInactivityTimeout } = shower.options;
let hideMouseTimeoutId = null;
const cleanUp = () => {
shower.container.classList.remove(mouseHiddenClass);
clearTimeout(hideMouseTimeoutId);
hideMouseTimeoutId = null;
};
const hideMouseIfInactive = () => {
if (hideMouseTimeoutId !== null) {
cleanUp();
}
hideMouseTimeoutId = setTimeout(() => {
shower.container.classList.add(mouseHiddenClass);
}, mouseInactivityTimeout);
};
const initHideMouseIfInactiveModule = () => {
shower.container.addEventListener('mousemove', hideMouseIfInactive);
};
const destroyHideMouseIfInactiveModule = () => {
shower.container.removeEventListener('mousemove', hideMouseIfInactive);
cleanUp();
};
const handleModeChange = () => {
if (shower.isFullMode) {
initHideMouseIfInactiveModule();
} else {
destroyHideMouseIfInactiveModule();
}
};
shower.addEventListener('start', handleModeChange);
shower.addEventListener('modechange', handleModeChange);
};
var installModules = (shower) => { var installModules = (shower) => {
a11y(shower); a11y(shower);
progress(shower); progress(shower);
...@@ -606,6 +650,7 @@ ...@@ -606,6 +650,7 @@
location$1(shower); // should come after `title` location$1(shower); // should come after `title`
view(shower); view(shower);
touch(shower); touch(shower);
mouse(shower);
// maintains invariant: active slide always exists in `full` mode // maintains invariant: active slide always exists in `full` mode
if (shower.isFullMode && !shower.activeSlide) { if (shower.isFullMode && !shower.activeSlide) {
...@@ -788,4 +833,4 @@ ...@@ -788,4 +833,4 @@
shower.start(); shower.start();
}); });
}()); })();
/* Shower Pontless */
.shower.pointless {
cursor: none;
}
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
@import 'shower-list.css' screen; @import 'shower-list.css' screen;
@import 'shower-full.css' screen; @import 'shower-full.css' screen;
@import 'shower-pointless.css' screen;
@import 'shower-grid.css' screen; @import 'shower-grid.css' screen;
@import 'shower-print.css' print; @import 'shower-print.css' print;
......
...@@ -15,15 +15,15 @@ Wait for the installation and choose the **ribbon** option in the wizard and you ...@@ -15,15 +15,15 @@ Wait for the installation and choose the **ribbon** option in the wizard and you
## Features ## Features
All theme’s features are demonstrated in the [index.html](index.html) file, [see it live](https://shwr.me/shower/themes/ribbon/). Use it as a reference while building your presentation. See more detailed [features overview](https://github.com/shower/shower/blob/master/docs/features.md). All theme’s features are demonstrated in the [index.html](index.html) file, [see it live](https://shwr.me/shower/themes/ribbon/). Use it as a reference while building your presentation. See more detailed [features overview](https://github.com/shower/shower/blob/main/docs/features.md).
## Ratios ## Ratios
Ribbon theme supports any slide ratio you want. But it’s optimized for the most common ones: 16×9 and 4×3. It’s 16×9 by default, but you can change it by adjusting `--slide-ratio` property for `.shower`, [see example](https://github.com/shower/ribbon/blob/master/index.html#L10) in `index.html`. Ribbon theme supports any slide ratio you want. But it’s optimized for the most common ones: 16×9 and 4×3. It’s 16×9 by default, but you can change it by adjusting `--slide-ratio` property for `.shower`, [see example](https://github.com/shower/ribbon/blob/main/index.html#L10) in `index.html`.
## PDF ## PDF
You can export slides to PDF by printing it via built-in dialog in Chromium-based browsers or via CLI tool. See [printing documentation](https://github.com/shower/shower/blob/master/docs/pdf.md) for more options. You can export slides to PDF by printing it via built-in dialog in Chromium-based browsers or via CLI tool. See [printing documentation](https://github.com/shower/shower/blob/main/docs/pdf.md) for more options.
## Development ## Development
......
/* Shower Pontless */
.shower.pointless {
cursor: none;
}
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
@import 'shower-list.css' screen; @import 'shower-list.css' screen;
@import 'shower-full.css' screen; @import 'shower-full.css' screen;
@import 'shower-pointless.css' screen;
@import 'shower-grid.css' screen; @import 'shower-grid.css' screen;
@import 'shower-print.css' print; @import 'shower-print.css' print;
......
/* Basic */ /* Basic */
.slide h2 { .slide h2 {
margin-top: 6px; margin-top: 9px;
margin-bottom: 34px; margin-bottom: 33px;
color: var(--color-grey); color: var(--color-grey);
font: bold 50px/1 'PT Sans Narrow', sans-serif; font: bold 50px/1 'PT Sans Narrow', sans-serif;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment