-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.html
151 lines (134 loc) · 5.71 KB
/
template.html
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>{{{title}}}</title>
{{#absoluteUrl}}
<meta property="og:title" content="{{{title}}}" />
<meta property="og:type" content="website" />
<meta property="og:image" content="{{{absoluteUrl}}}/featured-slide.jpg" />
<meta property="og:url" content="{{{absoluteUrl}}}" />
<meta name="description" content="{{{title}}}">
<meta property="og:description" content="{{{title}}}">
{{/absoluteUrl}}
<link rel="stylesheet" href="{{{base}}}/css/reveal.css" />
<link rel="stylesheet" href="{{{base}}}/{{{themeUrl}}}" id="theme" />
<!-- <link rel="stylesheet" href="{{{base}}}{{{highlightThemeUrl}}}" /> -->
<link rel="stylesheet" href="{{{base}}}/css/print/{{#print}}pdf{{/print}}{{^print}}paper{{/print}}.css" type="text/css" media="print" />
{{#cssPaths}}
<link rel="stylesheet" href="{{{base}}}/{{{.}}}" />
{{/cssPaths}}
{{#watch}}
<script>
document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1"></' + 'script>');
</script>
{{/watch}}
<script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/2.0.2/anime.min.js"></script>
</head>
<body>
<div class="reveal">
<div class="slides">{{{slides}}}</div>
</div>
<script src="{{{base}}}/js/reveal.js"></script>
<script>
function extend() {
var target = {};
for (var i = 0; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (source.hasOwnProperty(key)) {
target[key] = source[key];
}
}
}
return target;
}
// Optional libraries used to extend on reveal.js
var deps = [
{ src: '{{{base}}}/plugin/markdown/marked.js', condition: function() { return !!document.querySelector('[data-markdown]'); } },
{ src: '{{{base}}}/plugin/markdown/markdown.js', condition: function() { return !!document.querySelector('[data-markdown]'); } },
// { src: '{{{base}}}/plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
{ src: '{{{base}}}/plugin/zoom-js/zoom.js', async: true },
{ src: '{{{base}}}/plugin/notes/notes.js', async: true },
{ src: '{{{base}}}/plugin/math/math.js', async: true },
{ src: '{{{base}}}/prism/plugin.js', async: true }
];
// default options to init reveal.js
var defaultOptions = {
controls: true,
progress: true,
history: true,
center: true,
transition: 'default', // none/fade/slide/convex/concave/zoom
dependencies: deps
};
// options from URL query string
var queryOptions = Reveal.getQueryHash() || {};
var options = extend(defaultOptions, {{{revealOptionsStr}}}, queryOptions);
</script>
{{#scriptPaths}}
<script src="{{{base}}}/{{{.}}}"></script>
{{/scriptPaths}}
<script>
Reveal.initialize(options);
// Define default background
// for (var slide of document.getElementsByTagName('section')){
// if (!(slide.getAttribute('data-background') ||
// slide.getAttribute('data-background-video') ||
// slide.getAttribute('data-background-iframe') ||
// slide.getAttribute('data-background-image'))){
// slide.setAttribute('data-background', 'images/bg-2.png');
// slide.setAttribute('data-background-image', 'images/bg-2.png');
// }
// }
Reveal.addEventListener('ready', function(event) {
addEventListener("message", function(event) {
if (event.data && event.data.type === "fullscreen") {
if (document.webkitCurrentFullScreenElement) {
document.webkitExitFullscreen();
return;
}
var iframes = document.querySelectorAll("iframe");
for (var i = 0; i < iframes.length; i++) {
var iframe = iframes[i];
if (iframe.contentWindow === event.source) {
iframe.webkitRequestFullscreen();
return;
}
}
}
});
var playButtons = document.querySelectorAll('[data-play-frame]');
for (var i = 0; i < playButtons.length; i++) {
playButtons[i].addEventListener('click', (function(frameName, argument) {
return function(event) {
event.stopPropagation();
event.preventDefault();
window.frames[frameName].contentWindow.postMessage({ play: true, argument: argument }, '*');
};
})(playButtons[i].getAttribute('data-play-frame'), playButtons[i].getAttribute("data-play-argument")));
playButtons[i].addEventListener('mousedown', function(event) {
event.preventDefault();
event.stopPropagation();
});
}
});
Reveal.addEventListener( 'slide-animation-title', function() {
var textWrapper = document.getElementById('letters');
textWrapper.innerHTML = textWrapper.textContent.replace(/\S/g, "<span class='letter'>$&</span>");
var textWrapper = document.getElementById('animation');
textWrapper.innerHTML = textWrapper.textContent.replace(/\S/g, "<span class='letter'>$&</span>");
anime({
targets: '.letter',
scale: [0.3,1],
opacity: [0,1],
translateZ: 0,
easing: "easeOutExpo",
duration: 600,
delay: (el, i) => 1000 + 70 * (i+1)
});
} );
</script>
</body>
</html>