@shower/core 3.3.1 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +22 -0
- package/lib/modules/fullscreen.js +22 -0
- package/lib/modules/install.js +2 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -182,6 +182,27 @@
|
|
|
182
182
|
shower.addEventListener('slidechange', updateLiveRegion);
|
|
183
183
|
};
|
|
184
184
|
|
|
185
|
+
var fullscreen = (shower) => {
|
|
186
|
+
const toggleFullScreen = () => {
|
|
187
|
+
if (document.fullscreenElement) {
|
|
188
|
+
document.exitFullscreen();
|
|
189
|
+
} else {
|
|
190
|
+
document.documentElement.requestFullscreen();
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
shower.container.addEventListener('keydown', (event) => {
|
|
195
|
+
if (event.defaultPrevented) return;
|
|
196
|
+
if (isInteractiveElement(event.target)) return;
|
|
197
|
+
if (event.ctrlKey || event.altKey || event.metaKey) return;
|
|
198
|
+
|
|
199
|
+
if (event.key.toUpperCase() === 'F') {
|
|
200
|
+
event.preventDefault();
|
|
201
|
+
toggleFullScreen();
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
};
|
|
205
|
+
|
|
185
206
|
var keys = (shower) => {
|
|
186
207
|
const doSlideActions = (event) => {
|
|
187
208
|
const isShowerAction = !(event.ctrlKey || event.altKey || event.metaKey);
|
|
@@ -644,6 +665,7 @@
|
|
|
644
665
|
|
|
645
666
|
var installModules = (shower) => {
|
|
646
667
|
a11y(shower);
|
|
668
|
+
fullscreen(shower);
|
|
647
669
|
progress(shower);
|
|
648
670
|
keys(shower);
|
|
649
671
|
next(shower);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { isInteractiveElement } from '../utils.js';
|
|
2
|
+
|
|
3
|
+
export default (shower) => {
|
|
4
|
+
const toggleFullScreen = () => {
|
|
5
|
+
if (document.fullscreenElement) {
|
|
6
|
+
document.exitFullscreen();
|
|
7
|
+
} else {
|
|
8
|
+
document.documentElement.requestFullscreen();
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
shower.container.addEventListener('keydown', (event) => {
|
|
13
|
+
if (event.defaultPrevented) return;
|
|
14
|
+
if (isInteractiveElement(event.target)) return;
|
|
15
|
+
if (event.ctrlKey || event.altKey || event.metaKey) return;
|
|
16
|
+
|
|
17
|
+
if (event.key.toUpperCase() === 'F') {
|
|
18
|
+
event.preventDefault();
|
|
19
|
+
toggleFullScreen();
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
};
|
package/lib/modules/install.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import a11y from './a11y.js';
|
|
2
|
+
import fullscreen from './fullscreen.js';
|
|
2
3
|
import keys from './keys.js';
|
|
3
4
|
import location from './location.js';
|
|
4
5
|
import next from './next.js';
|
|
@@ -11,6 +12,7 @@ import mouse from './mouse.js';
|
|
|
11
12
|
|
|
12
13
|
export default (shower) => {
|
|
13
14
|
a11y(shower);
|
|
15
|
+
fullscreen(shower);
|
|
14
16
|
progress(shower);
|
|
15
17
|
keys(shower);
|
|
16
18
|
next(shower);
|