@@ -0,0 +1,363 @@
5+ <meta name="author" content="$author$" />
8+ <meta name="date" content="$date$" />
10+ <title>$if(title-prefix)$$title-prefix$ - $endif$$if(pagetitle)$$pagetitle$$endif$</title>
11+$if(highlighting-css)$
12+ <style type="text/css">
18+<title>$title$</title>
34+<!-- Define the style of you presentation -->
36+<!-- Maybe a font from http://www.google.com/webfonts ? -->
37+<link href='http://fonts.googleapis.com/css?family=Oswald' rel='stylesheet'>
40+ html { background-color: black; }
41+ body { background-color: white; }
42+ /* A section is a slide. Its size is 800x600, and this will never change */
44+ /* The font from Google */
45+ font-family: 'Oswald', arial, serif;
56+ a { color: #FF0066; } a:hover { text-decoration: underline; }
57+ footer { position: absolute; bottom: 50px; right: 50px; }
64+ /* Transition effect */
65+ /* Feel free to change the transition effect for original
66+ animations. See here:
67+ https://developer.mozilla.org/en/CSS/CSS_transitions
68+ How to use CSS3 Transitions: */
70+ -moz-transition: left 400ms linear 0s;
71+ -webkit-transition: left 400ms linear 0s;
72+ -ms-transition: left 400ms linear 0s;
73+ transition: left 400ms linear 0s;
77+ section { left: -150%; }
79+ section[aria-selected] { left: 0; }
81+ section[aria-selected] ~ section { left: +150%; }
83+ /* Increment with lists */
84+ .incremental > * { opacity: 1; }
85+ .incremental > *[aria-selected] { color: red; opacity: 1; }
86+ .incremental > *[aria-selected] ~ * { opacity: 0.2; }
87+ /* Increment with images */
88+ .incremental > img[aria-selected] { box-shadow: 0 0 10px #000 }
93+<!-- {{{{ ***************** DZSlides CORE 2.0b1 *************************** -->
94+<!-- *********************************************************************** -->
95+<!-- *********************************************************************** -->
96+<!-- *********************************************************************** -->
97+<!-- *********************************************************************** -->
99+<!-- This block of code is not supposed to be edited, but if you want to change the behavior of the slides, feel free to hack it ;) -->
101+<!-- Default Style -->
103+ * { margin: 0; padding: 0; }
104+ details { display: none; }
106+ width: 800px; height: 600px;
107+ margin-left: -400px; margin-top: -300px;
108+ position: absolute; top: 50%; left: 50%;
116+ pointer-events: none;
117+ width: 95%; height: 100%;
119+ section[aria-selected] { pointer-events: auto; }
120+ body { display: none; }
121+ body.loaded { display: block; }
122+ .incremental {visibility: hidden}
123+ .incremental[active] {visibility: visible}
127+ var friendWindows = [];
133+ window.onload = function() {
134+ slides = document.querySelectorAll("body > section");
136+ document.body.className = "loaded";
143+ window.onkeydown = function(e) {
144+ // Don't intercept keyboard shortcuts
145+ if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) {
148+ if ( e.keyCode == 37 // left arrow
149+ || e.keyCode == 38 // up arrow
150+ || e.keyCode == 33 // page up
155+ if ( e.keyCode == 39 // right arrow
156+ || e.keyCode == 40 // down arrow
157+ || e.keyCode == 34 // page down
162+ if (e.keyCode == 35) { // end
166+ if (e.keyCode == 36) { // home
171+ if ( e.keyCode == 32) { // space
179+ function setupTouchEvents() {
181+ var tracking = false;
183+ var db = document.body;
184+ db.addEventListener("touchstart", start, false);
185+ db.addEventListener("touchmove", move, false);
190+ orgX = e.changedTouches[0].pageX;
194+ if (!tracking) return;
195+ newX = e.changedTouches[0].pageX;
196+ if (orgX - newX > 100) {
200+ if (orgX - newX < -100) {
208+ /* Adapt the size of the slides to the window */
210+ window.onresize = function() {
211+ var db = document.body;
212+ var sx = db.clientWidth / window.innerWidth;
213+ var sy = db.clientHeight / window.innerHeight;
214+ var transform = "scale(" + (1/Math.max(sx, sy)) + ")";
215+ db.style.MozTransform = transform;
216+ db.style.WebkitTransform = transform;
217+ db.style.OTransform = transform;
218+ db.style.msTransform = transform;
219+ db.style.transform = transform;
221+ function getDetails(idx) {
222+ var s = document.querySelector("section:nth-of-type("+ idx +")");
223+ var d = s.querySelector("details");
224+ return d?d.innerHTML:"";
226+ window.onmessage = function(e) {
229+ if (msg === "register") {
230+ friendWindows.push(win);
231+ win.postMessage(JSON.stringify({method: "registered", title: document.title, count: slides.length}), "*");
232+ win.postMessage(JSON.stringify({method: "newslide", details: getDetails(idx), idx: idx}), "*");
235+ if (msg === "back") back();
236+ if (msg === "forward") forward();
237+ if (msg === "toggleContent") toggleContent();
239+ var r = /setSlide\((\d+)\)/.exec(msg);
245+ /* If a Video is present in this new slide, play it.
246+ If a Video is present in the previous slide, stop it. */
248+ function toggleContent() {
249+ var s = document.querySelector("section[aria-selected]");
251+ var video = s.querySelector("video");
253+ if (video.ended || video.paused) {
262+ /* If the user change the slide number in the URL bar, jump
265+ function setCursor(aIdx, aStep) {
266+ aStep = (aStep != 0 && typeof aStep !== "undefined") ? "." + aStep : "";
267+ window.location.hash = "#" + aIdx + aStep;
269+ window.onhashchange = function(e) {
270+ var cursor = window.location.hash.split("#"), newidx = 1, newstep = 0;
271+ if (cursor.length == 2) {
272+ newidx = ~~cursor[1].split(".")[0];
273+ newstep = ~~cursor[1].split(".")[1];
275+ if (newidx != idx) setSlide(newidx);
276+ setIncremental(newstep);
279+ /* Slide controls */
282+ if (idx == 1 && step == 0) return;
284+ setCursor(idx - 1, slides[idx - 2].querySelectorAll('.incremental > *').length);
286+ setCursor(idx, step - 1);
288+ function forward() {
289+ if (idx >= slides.length && step >= slides[idx - 1].querySelectorAll('.incremental > *').length) return;
290+ if (step >= slides[idx - 1].querySelectorAll('.incremental > *').length)
291+ setCursor(idx + 1, 0);
293+ setCursor(idx, step + 1);
299+ var lastIdx = slides.length;
300+ var lastStep = slides[lastIdx - 1].querySelectorAll('.incremental > *').length;
301+ setCursor(lastIdx, lastStep);
304+ function setSlide(aIdx) {
306+ var old = document.querySelector("section[aria-selected]");
307+ var next = document.querySelector("section:nth-of-type("+ idx +")");
309+ old.removeAttribute("aria-selected");
310+ var video = old.querySelector("video");
311+ if (video) { video.pause(); }
314+ next.setAttribute("aria-selected", "true");
315+ var video = next.querySelector("video");
316+ if (video) { video.play(); }
319+ for (var i = 0, l = slides.length; i < l; i++) {
320+ if (slides[i].hasAttribute("aria-selected")) {
325+ for (var i = 0, l = friendWindows.length; i < l; i++) {
326+ friendWindows[i].postMessage(JSON.stringify({method: "newslide", details: getDetails(idx), idx: idx}), "*");
329+ function setIncremental(aStep) {
331+ var old = slides[idx-1].querySelector('.incremental > *[aria-selected]');
333+ old.removeAttribute('aria-selected');
334+ var incrementals = slides[idx-1].querySelectorAll('.incremental');
336+ for (var i = 0; i < incrementals.length; i++) {
337+ incrementals[i].removeAttribute('active');
341+ var next = slides[idx-1].querySelectorAll('.incremental > *')[step-1];
343+ next.setAttribute('aria-selected', true);
344+ next.parentNode.setAttribute('active', true);
346+ for (var i = 0; i < incrementals.length; i++) {
347+ if (incrementals[i] != next.parentNode)
349+ incrementals[i].removeAttribute('active');
351+ incrementals[i].setAttribute('active', true);
361+<!-- vim: set fdm=marker: }}} -->