Debian Codegraph @

examples/classic-slides/index.html

raw
1 <!doctype html>
2
3 <!--
4 This is a simple example / template impress.js slide show. The goal is to be
5 easier to read for a first timer than the official and very feature rich
6 demo by bartaz (http://bartaz.github.io/impress.js/). It's also a very
7 traditional presentation that looks like slides (square screens with bullet
8 points...), again to make a first timer feel more at home. From this simple
9 presentation you can then go on to more powerful impress.js presentations!
10
11 This example is hopefully helpful for people that want to create both
12 simple and (eventually) awesome presentations in impress.js and comfortable
13 doing that directly in HTML.
14
15 By: @henrikingo (Still based on the HTML from bartaz' demo.)
16
17 -->
18
19 <html lang="en">
20 <head>
21 <meta charset="utf-8" />
22 <title>Classic Slides with impress.js | Simple example impress.js slide show | by Henrik Ingo @henrikingo</title>
23
24 <meta name="description" content="Simple example impress.js slide show" />
25 <meta name="author" content="Henrik Ingo" />
26 <!--
27 Impress.js doesn't depend on any external stylesheets. It adds all of the styles it needs for the
28 presentation to work.
29
30 However, some of the `extras/` modules do come with their own CSS, and we load
31 them here. You can read about each extras module separately in their directory.
32 -->
33 <link rel="stylesheet" href="../../extras/highlight/styles/github.css">
34 <link rel="stylesheet" href="../../extras/mermaid/mermaid.forest.css">
35
36 <!-- This file contains common styles for example presentations. -->
37 <link href="..\..\css\impress-common.css" rel="stylesheet" />
38 <!--
39 This file contains styles specific for this example presentation.
40 -->
41 <link href="css/classic-slides.css" rel="stylesheet" />
42
43 </head>
44
45 <!--
46
47 Body element is used by impress.js to set some useful class names, that will allow you to detect
48 the support and state of the presentation in CSS or other scripts.
49
50 First very useful class name is `impress-not-supported`. This class means, that browser doesn't
51 support features required by impress.js, so you should apply some fallback styles in your CSS.
52 It's not necessary to add it manually on this element. If the script detects that browser is not
53 good enough it will add this class, but keeping it in HTML means that users without JavaScript
54 will also get fallback styles.
55
56 When impress.js script detects that browser supports all required features, this class name will
57 be removed.
58
59 Another class name on body element also depends on currently active presentation step.
60 -->
61 <body class="impress-not-supported">
62 <!--
63 This fallback message is only visible when there is `impress-not-supported` class on body.
64 -->
65 <div class="fallback-message">
66 <p>Your browser <b>doesn't support the features required</b> by impress.js, so you are presented with a simplified version of this presentation.</p>
67 <p>For the best experience please use the latest <b>Chrome</b>, <b>Safari</b> or <b>Firefox</b> browser.</p>
68 </div>
69
70 <!--
71 This is the core element used by impress.js: the wrapper for your presentation steps.
72 In this element all the impress.js magic happens.
73
74 data-transition-duration sets the time in microseconds that is used for the
75 animation when transtitioning between slides.
76
77 The width, height, scale and perspective options define a target screen size that you should
78 design your CSS against. impress.js will automatically scale all content to different screen
79 sizes. See DOCUMENTATION.md for details. Below, I have targeted full HD screen resolution.
80
81 data-autoplay can be used to set the time in seconds, after which presentation
82 automatically moves to next slide. It can also be set individually for each
83 slide, but here we just set a common duration for all slides.
84 -->
85 <div id="impress"
86 data-transition-duration="1000"
87
88 data-width="1920"
89 data-height="1080"
90 data-max-scale="3"
91 data-min-scale="0"
92 data-perspective="1000"
93
94 data-autoplay="10">
95
96 <!--
97 Each step of the presentation should be an element inside the `#impress` with a class name
98 of `step`. These step elements are positioned, rotated and scaled by impress.js, and
99 the 'camera' shows them on each step of the presentation.
100
101 The `id` attribute of the step element is used to identify it in the URL, but it's optional.
102 If it is not defined, it will get a default value of `step-N` where N is a number of slide.
103 This step is auto-assigned the id "step-1". You can also use `#step-1` in a link, to
104 point directly to this particular step.
105
106 Positioning information is passed through data-* attributes.
107
108 In the example below we only specify x and y position of the step element with `data-x="-1000"`
109 and `data-y="-1500"` attributes. This means that **the center** of the element (yes, the center)
110 will be positioned in point x = -1000px and y = -1500px of the presentation 'canvas'. It will not
111 be rotated or scaled.
112
113 The "step" class is what *must* be used for every "slide". In this example we also use the "slide"
114 class, which adds a rectangle with some background and makes this presentation look like a traditional
115 powerpoint slide show. The "slide" class is entirely optional and indeed you wouldn't use it for
116 your cooler impress.js presentations.
117 -->
118 <div class="step slide title" data-x="-2200" data-y="-3000">
119 <h1>Example Presentation: <br />
120 Classic Slides</h1>
121 <h2>Henrik Ingo</h2>
122 <h3>2015</h3>
123
124 <div class="notes">
125 Any element with the class="notes" will not be displayed. This can
126 be used for speaker notes. In fact, the impressConsole plugin will
127 show it in the speaker console!
128 </div>
129 </div>
130
131 <div id="toc" class="step slide" data-rel-x="2200" data-rel-y="0">
132 <h1>Table of Contents</h1>
133 <ul>
134 <li><a href="#step-1">A title slide</a></li>
135 <li><a href="#step-2">Table of Contents</a></li>
136 <li><a href="#step-3">Text slide</a></li>
137 <li><a href="#step-4">Bullet points</a></li>
138 <li><a href="#step-5">Blockquote &amp; image</a></li>
139 <li><a href="#step-6">More basic text styles</a></li>
140 <li><a href="#step-7">Motion effects 101</a></li>
141 <li><a href="#addons">Add-ons</a></li>
142 <li><a href="#moreinfo">More info</a></li>
143 </ul>
144
145 <div class="notes">
146 <p>Table of Contents, with links to other slides of this same presentation.</p>
147
148 <p>Note that instead of absolute positioning we use relative positioning,
149 with the data-rel-x and data-rel-y attributes. This means the step is
150 positioned relative to the foregoing step. In other words, this is
151 equivalent to data-x="0" data-y="-3000".</p>
152 </div>
153 </div>
154
155 <div class="step slide">
156 <h1>A slide with text</h1>
157 <p>This slide has a few paragraphs <br />(p element) of normal text.</p>
158 <p>Personally I like centered or even justified text, as it looks less boring. This can of course be set in <a href="css/classic-slides.css">the css file</a>.</p>
159 <p>I really like the style on links in these presentations. I modified the border to be beveled, but it's mostly from <a href="http://impress.github.io/impress.js/">@bartaz' original demo</a>. <a href="https://twitter.com/bartaz">@bartaz</a> is the creator of impress.js.</p>
160
161 <div class="notes">
162 In this slide, we don't even specify the relative position, rather
163 that too is inherited. So this slide will again be 1000px to the
164 right of the previous one.
165 </div>
166 </div>
167
168 <div class="step slide">
169 <h1>Bullet points</h1>
170 <ul>
171 <li>A slide with bullet points. This is the first point.</li>
172 <li>Second point</li>
173 <li>Third point. Under this point we also have some sub-bullets:
174 <ul>
175 <li>Sub-bullet 1</li>
176 <li>Sub-bullet 2</li>
177 </ul>
178 </li>
179 </ul>
180
181 <div class="notes">
182 </div>
183 </div>
184
185 <!--
186 This element introduces rotation.
187
188 Notation shouldn't be a surprise. We use `data-rotate="30"` attribute, meaning that this
189 element should be rotated by 30 degrees clockwise.
190 -->
191 <div class="step slide" data-rel-x="2200" data-rel-y="600" data-rotate="30">
192 <h1>A blockquote &amp; image</h1>
193 <img src="images/3476636111_c551295ca4_b.jpg"
194 alt="Mother Teresa holding a newborn baby"
195 class="right"/>
196 <blockquote>
197 Spread love everywhere you go. <br />Let no one ever come to you without leaving happier.
198 <p style="text-align: right">Mother Teresa</p>
199 <p class="left bottom"><small>Image credit: <a href="https://www.flickr.com/photos/peta-de-aztlan/3476636111/">Peta_de_Aztlan</a>@Flickr. CC-BY 2.0</small></p>
200 </blockquote>
201
202 <div class="notes">
203 </div>
204 </div>
205
206 <div class="step slide" data-rel-x="1600" data-rel-y="1600" data-rotate="60">
207 <h1>More text styles</h1>
208 <p>As usual, use <em>em</em> to emphasize, <br />
209 <strong>strong</strong> for strong, <u>u</u> for underline,<br />
210 <strike>strike</strike> for strikethrough and <q>q for inline quotations</q>.</p>
211
212 <p>If you're a software engineer like me, you will often use the
213 <code>&lt;code&gt;</code> tag for monospaced inline text.</p>
214
215 <div class="notes">
216 </div>
217 </div>
218
219 <div class="step slide" data-rel-x="600" data-rel-y="2200" data-rotate="90">
220 <h1>Motion effects 101</h1>
221 <p>Items on the slide can</p>
222 <p class="fly-in fly-out">Fly in</p>
223 <p class="fade-in fade-out" style="transition-delay: 2s">Fade in</p>
224 <p class="zoom-in zoom-out" style="transition-delay: 4s">And zoom in</p>
225
226 <p class="left bottom"><small>...just like in PowerPoint. Yeah, I know I'm being lame, but it was fun to learn to do this in CSS3.</small></p>
227
228 <div class="notes">
229 <p>This step here doesn't introduce anything new when it comes to data attributes, but you
230 should notice in the demo that some words of this text are being animated.
231 It's a very basic CSS transition that is applied to the elements when this step element is
232 reached.
233 </p><p>
234 At the very beginning of the presentation all step elements are given the class of `future`.
235 It means that they haven't been visited yet.
236 </p><p>
237 When the presentation moves to given step `future` is changed to `present` class name.
238 That's how animation on this step works - text moves when the step has `present` class.
239 </p><p>
240 Finally when the step is left the `present` class is removed from the element and `past`
241 class is added.
242 </p><p>
243 So basically every step element has one of three classes: `future`, `present` and `past`.
244 Only one current step has the `present` class.
245 </p>
246 </div>
247 </div>
248
249 <div id="addons" class="step slide title" data-rel-x="-600" data-rel-y="2200" data-rotate="120">
250 <h2>Add-ons</h2>
251 <div class="notes">
252 <p>This version of impress.js includes several add-ons, striving to make this a
253 full featured presentation app.</p>
254 </div>
255 </div>
256
257 <div class="step slide" data-rel-x="-1600" data-rel-y="1600" data-rotate="150" data-autoplay="3">
258 <h1>Impress.js plugins</h1>
259 <ul>
260 <li>A new <a href="https://github.com/impress/impress.js/blob/master/src/plugins/README.md">plugin framework</a> allows for rich extensibility,
261 without bloating the core rendering library.
262 <ul>
263 <li class="substep">Press 'P' to open a presenter console.</li>
264 <li class="substep">When you move the mouse, navigation controls are visible on your bottom left</li>
265 <li class="substep">Autoplay makes the slides advance after a timeout</li>
266 <li class="substep">Relative positioning plugin is often a more convenient way to position your slides when editing. (<a href="https://github.com/impress/impress.js/blob/master/examples/classic-slides/index.html">See html for this presentation.</a>)</li>
267 </ul>
268 </li>
269 </ul>
270 <div class="notes">
271 <p>This presentation also uses speaker notes. They are not visible in the presentation, but shown in the impress console.</p>
272
273 <p>If you pressed P only now, this is the first time you see these notes. In fact, there has been notes on preceding slides as well.
274 You can use the navigation controls at the bottom of the impress console to browse back to them.</p>
275
276 <p>And did you notice how those bullet points appear one by one as you press space/arrow? That's another plugin, called substeps.</p>
277 </div>
278 </div>
279
280 <div class="step slide" data-rel-x="-2200" data-rel-y="600" data-rotate="180">
281 <h1>Highlight.js</h1>
282 <pre><code>
283 // `init` API function that initializes (and runs) the presentation.
284 var init = function () {
285 if (initialized) { return; }
286 execPreInitPlugins();
287
288 // First we set up the viewport for mobile devices.
289 // For some reason iPad goes nuts when it is not done properly.
290 var meta = $("meta[name='viewport']") || document.createElement("meta");
291 meta.content = "width=device-width, minimum-scale=1, maximum-scale=1, user-scalable=no";
292 if (meta.parentNode !== document.head) {
293 meta.name = 'viewport';
294 document.head.appendChild(meta);
295 }
296 </code></pre>
297 <div class="notes">
298 <p>The Highlight.js library provides really nice color coding of source code.
299 It automatically applies to any code inside a &lt;pre&gt;&lt;code&gt; element.</p>
300 <p>Highlight.js is found under the <a href="https://github.com/impress/impress.js/tree/master/extras">extras/</a>
301 directory, since it is an independent third party plugin, not really an impress.js plugin. You have
302 to include it via it's own &lt;link&gt; and &lt;script&gt; tags.</p>
303 </div>
304 </div>
305
306 <div class="step slide" data-rel-x="-2200" data-rel-y="-600" data-rotate="210">
307 <h1>Mermaid.js</h1>
308 <div class="mermaid">
309 %% This is a comment in mermaid markup
310 graph LR
311 A(Support for<br />diagrams)
312 B[Provided by<br />mermaid.js]
313 C{Already<br />know<br />mermaid?}
314 D(<a href=&quot;http://knsv.github.io/mermaid/index.html#usage&quot;>Tutorial</a>)
315 E(Great, hope you enjoy!)
316 A-->B
317 B-->C
318 C--No-->D
319 C--Yes-->E
320 classDef startEnd fill:#fcc,stroke:#353,stroke-width:2px;
321 class A,D,E startEnd;
322 </div>
323
324 <h1><a href="http://docs.mathjax.org/en/latest/start.html">MathJax.js</a></h1>
325 <p>Use \(\LaTeX\), MathML or AsciiMath to properly show mathematical formula.</p>
326 <div class="notes">
327 Mermaid.js, likewise in a href="https://github.com/impress/impress.js/tree/master/extras">extras/</a>
328 directory, draws SVG diagrams from a MarkDown-like syntax. To learn
329 more about it <a href="http://knsv.github.io/mermaid/index.html#usage">read the fine manual</a>.
330 </div>
331 </div>
332
333 <div id="markdown" class="step slide markdown" data-rel-x="-1600" data-rel-y="-1600" data-rotate="240">
334 # Markdown.js
335
336 * [Markdown.js](https://github.com/evilstreak/markdown-js) integration: for authors in a hurry!
337 * ...or lazy ;-)
338 * Jot down bullet points in *Markdown*
339 * ...have it automatically converted to HTML
340 * Markdown is converted into a presentation client side, in the browser. This is unlike
341 existing tools like [Hovercraft](https://github.com/regebro/hovercraft) and
342 markdown-impress where you generate a new
343 html file on the command line.
344 * [A more advanced Markdown presentation is here.](../markdown/)
345 </div>
346
347 <div id="acme" class="step slide" data-rel-x="-600" data-rel-y="-2200" data-rotate="270">
348 <ul>
349 <li>Remember, in <em>impress.js</em> the full power of HTML5, CSS3 &amp; JavaScript is always at your fingertips!</li>
350 <li>For example, you can use tables, forms, or dynamic charts as you would on any web page:</li>
351 </ul>
352 <h2>Acme Inc Quarterly Profits</h2>
353
354 <!-- Improvised bar graph of divs, to avoid copying something like NVD3 into the repo. -->
355 <div id="acme-graph">
356 <div id="acme-graph-bars">
357 <div id="acme-graph-q1"></div>
358 <div id="acme-graph-q2"></div>
359 <div id="acme-graph-q3"></div>
360 <div id="acme-graph-q4"></div>
361 </div>
362 <div id="acme-graph-bottom"></div>
363 </div>
364
365 <table border="1">
366 <tr><td>Q1</td><td id="acme-q1">234€</td></tr>
367 <tr><td>Q2</td><td id="acme-q2">255€</td></tr>
368 <tr><td>Q3</td><td><input id="acme-q3" size="5" oninput="acmeDrawGraph();" />€ <small>(insert here)</small></td></tr>
369 <tr><td>Q4</td><td><input id="acme-q4" size="5" oninput="acmeDrawGraph();" />€</td></tr>
370 </table>
371 <div class="notes">
372 </div>
373 </div>
374 <script type="text/javascript">
375 var acmeDrawGraph = function() {
376 var profits = {};
377
378 // Q1-Q2: get innerHTML, remove €
379 var value = document.getElementById('acme-q1').innerHTML;
380 if( value[value.length-1] == "€" ) value = value.substring(0, value.length-1);
381 profits['q1'] = value;
382 var value = document.getElementById('acme-q2').innerHTML;
383 if( value[value.length-1] == "€" ) value = value.substring(0, value.length-1);
384 profits['q2'] = value;
385
386 // Q3-Q4: get input.value
387 profits['q3'] = document.getElementById('acme-q3').value;
388 profits['q4'] = document.getElementById('acme-q4').value;
389
390 // Convert all to numeric value, and remember max value for scaling purposes.
391 var max = profits['q1'];
392 for ( var q in profits ) {
393 profits[q] = isNaN(profits[q]) ? 0 : Number(profits[q]);
394 if( profits[q] > max ) {
395 max = profits[q];
396 }
397 }
398
399 // Draw the bar graph
400 for ( var q in profits ) {
401 var h = 300 * profits[q] / max;
402 var div = document.getElementById('acme-graph-'+q);
403 div.style = 'height: ' + h + 'px';
404 }
405 };
406 // This draws the first 2 bars during page load
407 acmeDrawGraph();
408 </script>
409
410 <!--
411 This step also sets a custom data-transition-duration. All of the above steps used the value set
412 in the root div#impress element, but it is also allowed to set it for each step. Since transitioning
413 to this step will rotate twice around it's axis, we give the transition a bit more time here.
414 -->
415 <div id="moreinfo" class="step slide" data-x="4400" data-y="1200" data-rotate="720" data-transition-duration="2000">
416 <h1>More info</h1>
417 <ul>
418 <li><a href="https://github.com/impress/impress.js/blob/master/DOCUMENTATION.md">DOCUMENTATION.md</a> is the API reference.
419 </li>
420 <li><a href="https://github.com/impress/impress.js/blob/master/examples/classic-slides/index.html">Source of this presentation itself</a> is commented</li>
421 <li><a href="http://impress.github.io/impress.js/">Advanced Impress.js demo</a> by <a href="http://twitter.com/bartaz">@bartaz</a>
422 <ul>
423 <li>Again, the <a href="http://github.com/impress/impress.js/blob/master/index.html">html</a>
424 and <a href="https://github.com/impress/impress.js/blob/master/css/impress-demo.css">css</a> source is well commented.</li>
425 </ul>
426 </li>
427 <li>More examples and demos:
428 <ul>
429 <li><a href="https://github.com/impress/impress.js/tree/master/examples">examples/</a> in this repository</li>
430 <li><a href="https://github.com/impress/impress.js/wiki/Examples-and-demos">on the impress.js wiki</a></li>
431 </ul>
432 </li>
433 <li>Check out <a href="https://github.com/impress/impressionist">Impressionist</a>: a 3D GUI to create impress.js presentations</li>
434 </ul>
435
436 <div class="notes">
437 </div>
438 </div>
439
440 <!-- This last, empty "slide" is set to be very large using the data-scale attribute,
441 so that it covers all the other slides you just saw.
442 It's a common way of zooming out at the end, to show the whole presentation.
443 In CSS, we set pointer-events:none to make this slide non-clickable.
444 It makes a difference at least for SVG content, such as the mermaid diagram. -->
445 <div id="overview" class="step" data-x="4500" data-y="1500" data-scale="10" style="pointer-events: none;">
446 </div>
447 </div>
448
449 <!--
450 Add navigation-ui controls: back, forward and a select list.
451 Add a progress indicator bar (current step / all steps)
452 Add the help popup plugin
453 -->
454 <div id="impress-toolbar"></div>
455
456 <div class="impress-progressbar"><div></div></div>
457 <div class="impress-progress"></div>
458
459 <div id="impress-help"></div>
460
461 <!-- Extra modules
462 Load highlight.js, mermaid.js, markdown.js and MathJax.js from extras.
463 If you're curious about details, these are initialized in src/plugins/extras/extras.js -->
464 <script type="text/javascript" src="../../extras/highlight/highlight.pack.js"></script>
465 <script type="text/javascript" src="../../extras/mermaid/mermaid.min.js"></script>
466 <script type="text/javascript" src="../../extras/markdown/markdown.js"></script>
467 <script type="text/javascript" src="../../extras/mathjax/MathJax.js?config=TeX-AMS_CHTML"></script>
468 <!--
469 To make all described above really work, you need to include impress.js in the page.
470 You also need to call a `impress().init()` function to initialize impress.js presentation.
471 And you should do it in the end of your document.
472 -->
473 <script type="text/javascript" src="../../js/impress.js"></script>
474 <script>impress().init();</script>
475
476 </body>
477 </html>