-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpresentation.js
39 lines (33 loc) · 932 Bytes
/
presentation.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import Reveal from 'reveal.js';
import _ from 'lodash';
import SvgFragment from './reveal-svg-fragment.js'
const templates = document.querySelectorAll('template:not(.hidden)')
for (const template of templates) {
template.insertAdjacentHTML('afterend', template.innerHTML)
template.remove()
}
if (localStorage.add && document.body.querySelector('.additional')) {
document.body.querySelector('.additional').innerHTML += localStorage.add
}
let deck
const init = () => {
if (deck) deck.destroy()
deck = new Reveal()
SvgFragment(deck)
deck.initialize({
hash: true,
controlsTutorial: false,
plugins: [SvgFragment],
controls: false,
width: window.innerWidth,
height: window.innerHeight,
})
}
init()
window.addEventListener('resize', _.debounce(() => {
deck.configure({
width: window.innerWidth,
height: window.innerHeight,
})
deck.layout()
}, 300))