4<title>The Title Of Your Presentation</title>
7<!-- One section is one slide -->
10 <!-- This is the first slide -->
11 <h1>My Presentation</h1>
12 <footer>by John Doe</footer>
16 <p>Some random text: But I've never been to the moon! You can see how I lived before I met you. Also Zoidberg.
17 I could if you hadn't turned on the light and shut off my stereo.</p>
21 <h3>An incremental list</h3>
22 <ul class="incremental">
26 <ul class="incremental">
31 <div role="note">Some notes. They are only visible using onstage shell.</div>
36 Who's brave enough to fly into something we all keep calling a death sphere?
39 <p>In the onstage shell, notes scroll rather than overflow:</p>
40 <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla ac dui eu est feugiat lacinia sit amet nec leo. Mauris eu ipsum leo. Nulla mi odio, cursus sed sollicitudin non, fringilla id magna. Suspendisse sit amet posuere elit. Maecenas iaculis, turpis a placerat imperdiet, libero lorem feugiat nisi, nec tincidunt diam nibh sit amet massa. Vestibulum quis adipiscing tellus. Maecenas sollicitudin sodales pulvinar. Donec dui ipsum, bibendum facilisis consequat interdum, tempus ut mauris. Aliquam ut dolor nec odio scelerisque bibendum quis in neque. Aliquam dui dui, pulvinar quis fermentum quis, gravida eu augue. Nunc tristique dolor a urna pulvinar bibendum. Curabitur mollis cursus neque, in scelerisque metus porta non. Donec tempor enim in nibh vestibulum et convallis nisi malesuada. Duis ut lectus sed metus venenatis porttitor id pharetra quam. Suspendisse sapien turpis, ornare in molestie et, gravida eget turpis.
50 <figure> <!-- Figures are used to display images and videos fullpage -->
51 <img src="http://placekitten.com/g/800/600">
52 <figcaption>An image</figcaption>
54 <div role="note">Kittens are so cute!</div>
58 <figure> <!-- Videos are automatically played -->
59 <video src="http://videos-cdn.mozilla.net/brand/Mozilla_Firefox_Manifesto_v0.2_640.webm" poster="http://www.mozilla.org/images/about/poster.jpg"></video>
60 <figcaption>A video</figcaption>
69<!-- Define the style of your presentation -->
71<!-- Maybe a font from http://www.google.com/webfonts ? -->
72<link href='http://fonts.googleapis.com/css?family=Oswald' rel='stylesheet'>
75 html, .view body { background-color: black; counter-reset: slideidx; }
76 body, .view section { background-color: white; border-radius: 12px }
77 /* A section is a slide. It's size is 800x600, and this will never change */
78 section, .view head > title {
79 /* The font from Google */
80 font-family: 'Oswald', arial, serif;
85 counter-increment: slideidx;
86 content: counter(slideidx, decimal-leading-zero);
87 position: absolute; bottom: -80px; right: 100px;
103 margin: 100px 0 50px 100px;
120 background-color: black;
129 content: close-quote;
132 /* Figures are displayed full-page, with the caption
133 on top of the image/video */
135 background-color: black;
142 figure > img, figure > video {
143 width: 100%; height: 100%;
156 background-color: #F3F4F8;
157 border-top: 1px solid #CCC;
160 /* Transition effect */
161 /* Feel free to change the transition effect for original
162 animations. See here:
163 https://developer.mozilla.org/en/CSS/CSS_transitions
164 How to use CSS3 Transitions: */
166 -moz-transition: left 400ms linear 0s;
167 -webkit-transition: left 400ms linear 0s;
168 -ms-transition: left 400ms linear 0s;
169 transition: left 400ms linear 0s;
172 -moz-transition: none;
173 -webkit-transition: none;
174 -ms-transition: none;
178 .view section[aria-selected] {
179 border: 5px red solid;
183 section { left: -150%; }
185 section[aria-selected] { left: 0; }
187 section[aria-selected] ~ section { left: +150%; }
189 /* Incremental elements */
191 /* By default, visible */
192 .incremental > * { opacity: 1; }
194 /* The current item */
195 .incremental > *[aria-selected] { opacity: 1; }
197 /* The items to-be-selected */
198 .incremental > *[aria-selected] ~ * { opacity: 0; }
200 /* The progressbar, at the bottom of the slides, show the global
201 progress of the presentation. */
208<!-- {{{{ dzslides core
211# __ __ __ . __ ___ __
212# | \ / /__` | | | \ |__ /__`
213# |__/ /_ .__/ |___ | |__/ |___ .__/ core :€
216# The following block of code is not supposed to be edited.
217# But if you want to change the behavior of these slides,
218# feel free to hack it!
222<div id="progress-bar"></div>
224<!-- Default Style -->
226 * { margin: 0; padding: 0; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }
227 [role="note"] { display: none; }
229 width: 800px; height: 600px;
230 margin-left: -400px; margin-top: -300px;
231 position: absolute; top: 50%; left: 50%;
237 margin: 0; padding: 0;
238 width: 100%; height: 100%;
239 display: inline-block;
240 overflow: visible; overflow-x: hidden;
241 /* undo Dz.onresize */
242 transform: none !important;
243 -moz-transform: none !important;
244 -webkit-transform: none !important;
245 -o-transform: none !important;
246 -ms-transform: none !important;
248 .view head, .view head > title { display: block }
251 pointer-events: none;
252 width: 100%; height: 100%;
255 pointer-events: auto;
257 width: 800px; height: 600px;
258 margin: -150px -200px;
261 transform: scale(.4);
262 -moz-transform: scale(.4);
263 -webkit-transform: scale(.4);
264 -o-transform: scale(.4);
265 -ms-transform: scale(.4);
267 .view section > * { pointer-events: none; }
268 section[aria-selected] { pointer-events: auto; }
269 html { overflow: hidden; }
270 html.view { overflow: visible; }
271 body.loaded { display: block; }
272 .incremental {visibility: hidden; }
273 .incremental[active] {visibility: visible; }
277 -moz-transition: width 400ms linear 0s;
278 -webkit-transition: width 400ms linear 0s;
279 -ms-transition: width 400ms linear 0s;
280 transition: width 400ms linear 0s;
282 .view #progress-bar {
300 Dz.init = function() {
301 document.body.className = "loaded";
302 this.slides = Array.prototype.slice.call($$("body > section"));
303 this.progressBar = $("#progress-bar");
304 this.html = document.body.parentNode;
307 this.setupTouchEvents();
312 Dz.setupParams = function() {
313 var p = window.location.search.substr(1).split('&');
314 p.forEach(function(e, i, a) {
315 var keyVal = e.split('=');
316 Dz.params[keyVal[0]] = decodeURIComponent(keyVal[1]);
318 // Specific params handling
319 if (!+this.params.autoplay)
320 $$.forEach($$("video"), function(v){ v.controls = true });
323 Dz.onkeydown = function(aEvent) {
324 // Don't intercept keyboard shortcuts
328 || aEvent.shiftKey) {
331 if ( aEvent.keyCode == 37 // left arrow
332 || aEvent.keyCode == 38 // up arrow
333 || aEvent.keyCode == 33 // page up
335 aEvent.preventDefault();
338 if ( aEvent.keyCode == 39 // right arrow
339 || aEvent.keyCode == 40 // down arrow
340 || aEvent.keyCode == 34 // page down
342 aEvent.preventDefault();
345 if (aEvent.keyCode == 35) { // end
346 aEvent.preventDefault();
349 if (aEvent.keyCode == 36) { // home
350 aEvent.preventDefault();
353 if (aEvent.keyCode == 32) { // space
354 aEvent.preventDefault();
355 this.toggleContent();
357 if (aEvent.keyCode == 70) { // f
358 aEvent.preventDefault();
361 if (aEvent.keyCode == 79) { // o
362 aEvent.preventDefault();
369 Dz.setupTouchEvents = function() {
371 var tracking = false;
373 var db = document.body;
374 db.addEventListener("touchstart", start.bind(this), false);
375 db.addEventListener("touchmove", move.bind(this), false);
377 function start(aEvent) {
378 aEvent.preventDefault();
380 orgX = aEvent.changedTouches[0].pageX;
383 function move(aEvent) {
384 if (!tracking) return;
385 newX = aEvent.changedTouches[0].pageX;
386 if (orgX - newX > 100) {
390 if (orgX - newX < -100) {
398 Dz.setupView = function() {
399 document.body.addEventListener("click", function ( e ) {
400 if (!Dz.html.classList.contains("view")) return;
401 if (!e.target || e.target.nodeName != "SECTION") return;
403 Dz.html.classList.remove("view");
404 Dz.setCursor(Dz.slides.indexOf(e.target) + 1);
408 /* Adapt the size of the slides to the window */
410 Dz.onresize = function() {
411 var db = document.body;
412 var sx = db.clientWidth / window.innerWidth;
413 var sy = db.clientHeight / window.innerHeight;
414 var transform = "scale(" + (1/Math.max(sx, sy)) + ")";
416 db.style.MozTransform = transform;
417 db.style.WebkitTransform = transform;
418 db.style.OTransform = transform;
419 db.style.msTransform = transform;
420 db.style.transform = transform;
424 Dz.getNotes = function(aIdx) {
425 var s = $("section:nth-of-type(" + aIdx + ")");
426 var d = s.$("[role='note']");
427 return d ? d.innerHTML : "";
430 Dz.onmessage = function(aEvent) {
431 var argv = aEvent.data.split(" "), argc = argv.length;
432 argv.forEach(function(e, i, a) { a[i] = decodeURIComponent(e) });
433 var win = aEvent.source;
434 if (argv[0] === "REGISTER" && argc === 1) {
435 this.remoteWindows.push(win);
436 this.postMsg(win, "REGISTERED", document.title, this.slides.length);
437 this.postMsg(win, "CURSOR", this.idx + "." + this.step);
440 if (argv[0] === "BACK" && argc === 1)
442 if (argv[0] === "FORWARD" && argc === 1)
444 if (argv[0] === "START" && argc === 1)
446 if (argv[0] === "END" && argc === 1)
448 if (argv[0] === "TOGGLE_CONTENT" && argc === 1)
449 this.toggleContent();
450 if (argv[0] === "SET_CURSOR" && argc === 2)
451 window.location.hash = "#" + argv[1];
452 if (argv[0] === "GET_CURSOR" && argc === 1)
453 this.postMsg(win, "CURSOR", this.idx + "." + this.step);
454 if (argv[0] === "GET_NOTES" && argc === 1)
455 this.postMsg(win, "NOTES", this.getNotes(this.idx));
458 Dz.toggleContent = function() {
459 // If a Video is present in this new slide, play it.
460 // If a Video is present in the previous slide, stop it.
461 var s = $("section[aria-selected]");
463 var video = s.$("video");
465 if (video.ended || video.paused) {
474 Dz.setCursor = function(aIdx, aStep) {
475 // If the user change the slide number in the URL bar, jump
477 aStep = (aStep != 0 && typeof aStep !== "undefined") ? "." + aStep : ".0";
478 window.location.hash = "#" + aIdx + aStep;
481 Dz.onhashchange = function() {
482 var cursor = window.location.hash.split("#"),
485 if (cursor.length == 2) {
486 newidx = ~~cursor[1].split(".")[0];
487 newstep = ~~cursor[1].split(".")[1];
488 if (newstep > Dz.slides[newidx - 1].$$('.incremental > *').length) {
493 this.setProgress(newidx, newstep);
494 if (newidx != this.idx) {
495 this.setSlide(newidx);
497 if (newstep != this.step) {
498 this.setIncremental(newstep);
500 for (var i = 0; i < this.remoteWindows.length; i++) {
501 this.postMsg(this.remoteWindows[i], "CURSOR", this.idx + "." + this.step);
505 Dz.back = function() {
506 if (this.idx == 1 && this.step == 0) {
509 if (this.step == 0) {
510 this.setCursor(this.idx - 1,
511 this.slides[this.idx - 2].$$('.incremental > *').length);
513 this.setCursor(this.idx, this.step - 1);
517 Dz.forward = function() {
518 if (this.idx >= this.slides.length &&
519 this.step >= this.slides[this.idx - 1].$$('.incremental > *').length) {
522 if (this.step >= this.slides[this.idx - 1].$$('.incremental > *').length) {
523 this.setCursor(this.idx + 1, 0);
525 this.setCursor(this.idx, this.step + 1);
529 Dz.goStart = function() {
530 this.setCursor(1, 0);
533 Dz.goEnd = function() {
534 var lastIdx = this.slides.length;
535 var lastStep = this.slides[lastIdx - 1].$$('.incremental > *').length;
536 this.setCursor(lastIdx, lastStep);
539 Dz.toggleView = function() {
540 this.html.classList.toggle("view");
542 if (this.html.classList.contains("view")) {
543 $("section[aria-selected]").scrollIntoView(true);
547 Dz.setSlide = function(aIdx) {
549 var old = $("section[aria-selected]");
550 var next = $("section:nth-of-type("+ this.idx +")");
552 old.removeAttribute("aria-selected");
553 var video = old.$("video");
559 next.setAttribute("aria-selected", "true");
560 if (this.html.classList.contains("view")) {
561 next.scrollIntoView();
563 var video = next.$("video");
564 if (video && !!+this.params.autoplay) {
568 // That should not happen
570 // console.warn("Slide doesn't exist.");
574 Dz.setIncremental = function(aStep) {
576 var old = this.slides[this.idx - 1].$('.incremental > *[aria-selected]');
578 old.removeAttribute('aria-selected');
580 var incrementals = $$('.incremental');
581 if (this.step <= 0) {
582 $$.forEach(incrementals, function(aNode) {
583 aNode.removeAttribute('active');
587 var next = this.slides[this.idx - 1].$$('.incremental > *')[this.step - 1];
589 next.setAttribute('aria-selected', true);
590 next.parentNode.setAttribute('active', true);
592 $$.forEach(incrementals, function(aNode) {
593 if (aNode != next.parentNode)
595 aNode.removeAttribute('active');
597 aNode.setAttribute('active', true);
602 setCursor(this.idx, 0);
607 Dz.goFullscreen = function() {
608 var html = $('html'),
609 requestFullscreen = html.requestFullscreen || html.requestFullScreen || html.mozRequestFullScreen || html.webkitRequestFullScreen;
610 if (requestFullscreen) {
611 requestFullscreen.apply(html);
615 Dz.setProgress = function(aIdx, aStep) {
616 var slide = $("section:nth-of-type("+ aIdx +")");
619 var steps = slide.$$('.incremental > *').length + 1,
620 slideSize = 100 / (this.slides.length - 1),
621 stepSize = slideSize / steps;
622 this.progressBar.style.width = ((aIdx - 1) * slideSize + aStep * stepSize) + '%';
625 Dz.postMsg = function(aWin, aMsg) { // [arg0, [arg1...]]
627 for (var i = 2; i < arguments.length; i++)
628 aMsg.push(encodeURIComponent(arguments[i]));
629 aWin.postMessage(aMsg.join(" "), "*");
634 window.onkeydown = Dz.onkeydown.bind(Dz);
635 window.onresize = Dz.onresize.bind(Dz);
636 window.onhashchange = Dz.onhashchange.bind(Dz);
637 window.onmessage = Dz.onmessage.bind(Dz);
640 window.onload = init;
645 if (!Function.prototype.bind) {
646 Function.prototype.bind = function (oThis) {
648 // closest thing possible to the ECMAScript 5 internal IsCallable
650 if (typeof this !== "function")
652 "Function.prototype.bind - what is trying to be fBound is not callable"
655 var aArgs = Array.prototype.slice.call(arguments, 1),
657 fNOP = function () {},
658 fBound = function () {
659 return fToBind.apply( this instanceof fNOP ? this : oThis || window,
660 aArgs.concat(Array.prototype.slice.call(arguments)));
663 fNOP.prototype = this.prototype;
664 fBound.prototype = new fNOP();
670 var $ = (HTMLElement.prototype.$ = function(aQuery) {
671 return this.querySelector(aQuery);
674 var $$ = (HTMLElement.prototype.$$ = function(aQuery) {
675 return this.querySelectorAll(aQuery);
678 $$.forEach = function(nodeList, fun) {
679 Array.prototype.forEach.call(nodeList, fun);
683<!-- vim: set fdm=marker: }}} -->
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list