index.html 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438
  1. <!doctype html>
  2. <!--
  3. Welcome to the light side of the source, young padawan.
  4. One step closer to learn something interesting you are...
  5. ____
  6. _.' : `._
  7. .-.'`. ; .'`.-.
  8. __ / : ___\ ; /___ ; \ __
  9. ,'_ ""--.:__;".-.";: :".-.":__;.--"" _`,
  10. :' `.t""--.. '<@.`;_ ',@:` ..--""j.' `;
  11. `:-.._J '-.-'L__ `-- ' L_..-;'
  12. "-.__ ; .-" "-. : __.-"
  13. L ' /.------.\ ' J
  14. "-. "--" .-"
  15. __.l"-:_JL_;-";.__
  16. .-j/'.; ;"""" / .'\"-.
  17. .' /:`. "-.: .-" .'; `.
  18. .-" / ; "-. "-..-" .-" : "-.
  19. .+"-. : : "-.__.-" ;-._ \
  20. ; \ `.; ; : : "+. ;
  21. : ; ; ; : ; : \:
  22. ; : ; : ;: ; :
  23. : \ ; : ; : ; / ::
  24. ; ; : ; : ; : ;:
  25. : : ; : ; : : ; : ;
  26. ;\ : ; : ; ; ; ;
  27. : `."-; : ; : ; / ;
  28. ; -: ; : ; : .-" :
  29. :\ \ : ; : \.-" :
  30. ;`. \ ; : ;.'_..-- / ;
  31. : "-. "-: ; :/." .' :
  32. \ \ : ;/ __ :
  33. \ .-`.\ /t-"" ":-+. :
  34. `. .-" `l __/ /`. : ; ; \ ;
  35. \ .-" .-"-.-" .' .'j \ / ;/
  36. \ / .-" /. .'.' ;_:' ;
  37. :-""-.`./-.' / `.___.'
  38. \ `t ._ /
  39. "-.t-._:'
  40. -->
  41. <!--
  42. So you'd like to know how to use impress.js?
  43. You've made the first, very important step -- you're reading the source code.
  44. And that's how impress.js presentations are built -- with HTML and CSS code.
  45. Believe me, you need quite decent HTML and CSS skills to be able to use impress.js effectively.
  46. And what is even more important, you need to be a designer, too, because there are no default
  47. styles for impress.js presentations, there is no default or automatic layout for them.
  48. You need to design and build it by hand.
  49. So...
  50. Would you still like to know how to use impress.js?
  51. -->
  52. <html lang="en">
  53. <head>
  54. <meta charset="utf-8" />
  55. <meta name="viewport" content="width=1024" />
  56. <meta name="apple-mobile-web-app-capable" content="yes" />
  57. <title>impress.js | presentation tool based on the power of CSS3 transforms and transitions in modern browsers | by Bartek Szopka @bartaz</title>
  58. <meta name="description" content="impress.js is a presentation tool based on the power of CSS3 transforms and transitions in modern browsers and inspired by the idea behind prezi.com." />
  59. <meta name="author" content="Bartek Szopka" />
  60. <link href="http://fonts.googleapis.com/css?family=Open+Sans:regular,semibold,italic,italicsemibold|PT+Sans:400,700,400italic,700italic|PT+Serif:400,700,400italic,700italic" rel="stylesheet" />
  61. <!--
  62. Impress.js doesn't depend on any external stylesheet. Script adds all styles it needs for
  63. presentation to work.
  64. This style below contains styles only for demo presentation. Browse it to see how impress.js
  65. classes are used to style presentation steps, or how to apply fallback styles, but I don't want
  66. you to use them directly in your presentation.
  67. Be creative, build your own. We don't really want all impress.js presentations to look the same,
  68. do we?
  69. When creating your own presentation get rid of this file. Start from scratch, it's fun!
  70. -->
  71. <link href="css/impress-demo.css" rel="stylesheet" />
  72. <link rel="shortcut icon" href="favicon.png" />
  73. <link rel="apple-touch-icon" href="apple-touch-icon.png" />
  74. </head>
  75. <!--
  76. Body element is used by impress.js to set some useful class names, that will allow you to detect
  77. the support and state of the presentation in CSS or other scripts.
  78. First very useful class name is `impress-not-supported`. This class means, that browser doesn't
  79. support features required by impress.js, so you should apply some fallback styles in your CSS.
  80. It's not necessary to add it manually on this element. If the script detects that browser is not
  81. good enough it will add this class, but keeping it in HTML means that users without JavaScript
  82. will also get fallback styles.
  83. When impress.js script detects that browser supports all required features, this class name will
  84. be removed.
  85. The class name on body element also depends on currently active presentation step. More details about
  86. it can be found later, when `hint` element is being described.
  87. -->
  88. <body class="impress-not-supported">
  89. <!--
  90. For example this fallback message is only visible when there is `impress-not-supported` class on body.
  91. -->
  92. <div class="fallback-message">
  93. <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>
  94. <p>For the best experience please use the latest <b>Chrome</b>, <b>Safari</b> or <b>Firefox</b> browser.</p>
  95. </div>
  96. <!--
  97. Now that's the core element used by impress.js.
  98. That's the wrapper for your presentation steps. In this element all the impress.js magic happens.
  99. It doesn't have to be a `<div>`. Only `id` is important here as that's how the script find it.
  100. You probably won't need it now, but there are some configuration options that can be set on this element.
  101. To change the duration of the transition between slides use `data-transition-duration="2000"` giving it
  102. a number of ms. It defaults to 1000 (1s).
  103. You can also control the perspective with `data-perspective="500"` giving it a number of pixels.
  104. It defaults to 1000. You can set it to 0 if you don't want any 3D effects.
  105. If you are willing to change this value make sure you understand how CSS perspective works:
  106. https://developer.mozilla.org/en/CSS/perspective
  107. But as I said, you won't need it for now, so don't worry - there are some simple but interesing things
  108. right around the corner of this tag ;)
  109. -->
  110. <div id="impress">
  111. <!--
  112. Here is where interesting thing start to happen.
  113. Each step of the presentation should be an element inside the `#impress` with a class name
  114. of `step`. These step elements are positioned, rotated and scaled by impress.js, and
  115. the 'camera' shows them on each step of the presentation.
  116. Positioning information is passed through data attributes.
  117. In the example below we only specify x and y position of the step element with `data-x="-1000"`
  118. and `data-y="-1500` attributes. This means that **the center** of the element (yes, the center)
  119. will be positioned in point x = -1000px and y = -1500px of the presentation 'canvas'.
  120. It will not be rotated or scaled.
  121. -->
  122. <div id="bored" class="step slide" data-x="-1000" data-y="-1500">
  123. <q>Aren't you just <b>bored</b> with all those slides-based presentations?</q>
  124. </div>
  125. <!--
  126. The `id` attribute of the step element is used to identify it in the URL, but it's optional.
  127. If it is not defined, it will get a default value of `step-N` where N is a number of slide.
  128. So in the example below it'll be `step-2`.
  129. The hash part of the url when this step is active will be `#/step-2`.
  130. You can also use `#step-2` in a link, to point directly to this particular step.
  131. Please note, that while `#/step-2` (with slash) would also work in a link it's not recommended.
  132. Using classic `id`-based links like `#step-2` makes these links usable also in fallback mode.
  133. -->
  134. <div class="step slide" data-x="0" data-y="-1500">
  135. <q>Don't you think that presentations given <strong>in modern browsers</strong> shouldn't <strong>copy the limits</strong> of 'classic' slide decks?</q>
  136. </div>
  137. <div class="step slide" data-x="1000" data-y="-1500">
  138. <q>Would you like to <strong>impress your audience</strong> with <strong>stunning visualization</strong> of your talk?</q>
  139. </div>
  140. <!--
  141. This is an example of step element being scaled.
  142. Again, we use a `data-` attribute, this time it's `data-scale="4"`, so it means that this
  143. element will be 4 times larger than the others.
  144. From presentation and transitions point of view it means, that it will have to be scaled
  145. down (4 times) to make it back to it's correct size.
  146. -->
  147. <div id="title" class="step" data-x="0" data-y="0" data-scale="4">
  148. <span class="try">then you should try</span>
  149. <h1>impress.js<sup>*</sup></h1>
  150. <span class="footnote"><sup>*</sup> no rhyme intended</span>
  151. </div>
  152. <!--
  153. This element introduces rotation.
  154. Notation shouldn't be a surprise. We use `data-rotate="90"` attribute, meaning that this
  155. element should be rotated by 90 degrees clockwise.
  156. -->
  157. <div id="its" class="step" data-x="850" data-y="3000" data-rotate="90" data-scale="5">
  158. <p>It's a <strong>presentation tool</strong> <br/>
  159. inspired by the idea behind <a href="http://prezi.com">prezi.com</a> <br/>
  160. and based on the <strong>power of CSS3 transforms and transitions</strong> in modern browsers.</p>
  161. </div>
  162. <div id="big" class="step" data-x="3500" data-y="2100" data-rotate="180" data-scale="6">
  163. <p>visualize your <b>big</b> <span class="thoughts">thoughts</span></p>
  164. </div>
  165. <!--
  166. And now it gets really exiting! We move into third dimension!
  167. Along with `data-x` and `data-y`, you can define the position on third (Z) axis, with
  168. `data-z`. In the example below we use `data-z="-3000"` meaning that element should be
  169. positioned far away from us (by 3000px).
  170. -->
  171. <div id="tiny" class="step" data-x="2825" data-y="2325" data-z="-3000" data-rotate="300" data-scale="1">
  172. <p>and <b>tiny</b> ideas</p>
  173. </div>
  174. <!--
  175. This step here doesn't introduce anything new when it comes to data attributes, but you
  176. should notice in the demo that some words of this text are being animated.
  177. It's a very basic CSS transition that is applied to the elements when this step element is
  178. reached.
  179. At the very beginning of the presentation all step elements are given the class of `future`.
  180. It means that they haven't been visited yet.
  181. When the presentation moves to given step `future` is changed to `present` class name.
  182. That's how animation on this step works - text moves when the step has `present` class.
  183. Finally when the step is left the `present` class is removed from the element and `past`
  184. class is added.
  185. So basically every step element has one of three classes: `future`, `present` and `past`.
  186. Only one current step has the `present` class.
  187. -->
  188. <div id="ing" class="step" data-x="3500" data-y="-850" data-rotate="270" data-scale="6">
  189. <p>by <b class="positioning">positioning</b>, <b class="rotating">rotating</b> and <b class="scaling">scaling</b> them on an infinite canvas</p>
  190. </div>
  191. <div id="imagination" class="step" data-x="6700" data-y="-300" data-scale="6">
  192. <p>the only <b>limit</b> is your <b class="imagination">imagination</b></p>
  193. </div>
  194. <div id="source" class="step" data-x="6300" data-y="2000" data-rotate="20" data-scale="4">
  195. <p>want to know more?</p>
  196. <q><a href="http://github.com/bartaz/impress.js">use the source</a>, Luke!</q>
  197. </div>
  198. <div id="one-more-thing" class="step" data-x="6000" data-y="4000" data-scale="2">
  199. <p>one more thing...</p>
  200. </div>
  201. <!--
  202. And the last one shows full power and flexibility of impress.js.
  203. You can not only position element in 3D, but also rotate it around any axis.
  204. So this one here will get rotated by -40 degrees (40 degrees anticlockwise) around X axis and
  205. 10 degrees (clockwise) around Y axis.
  206. You can of course rotate it around Z axis with `data-rotate-z` - it has exactly the same effect
  207. as `data-rotate` (these two are basically aliases).
  208. -->
  209. <div id="its-in-3d" class="step" data-x="6200" data-y="4300" data-z="-100" data-rotate-x="-40" data-rotate-y="10" data-scale="2">
  210. <p><span class="have">have</span> <span class="you">you</span> <span class="noticed">noticed</span> <span class="its">it's</span> <span class="in">in</span> <b>3D<sup>*</sup></b>?</p>
  211. <span class="footnote">* beat that, prezi ;)</span>
  212. </div>
  213. <!--
  214. So to make a summary of all the possible attributes used to position presentation steps, we have:
  215. * `data-x`, `data-y`, `data-z` -- they define the position of **the center** of step element on
  216. the canvas in pixels; their default value is 0;
  217. * `data-rotate-x`, `data-rotate-y`, 'data-rotate-z`, `data-rotate` -- they define the rotation of
  218. the element around given axis in degrees; their default value is 0; `data-rotate` and `data-rotate-z`
  219. are exactly the same;
  220. * `data-scale` -- defines the scale of step element; default value is 1
  221. These values are used by impress.js in CSS transformation functions, so for more information consult
  222. CSS transfrom docs: https://developer.mozilla.org/en/CSS/transform
  223. -->
  224. <div id="overview" class="step" data-x="3000" data-y="1500" data-scale="10">
  225. </div>
  226. </div>
  227. <!--
  228. Hint is not related to impress.js in any way.
  229. But it can show you how to use impress.js features in creative way.
  230. When the presentation step is shown (selected) its element gets the class of "active" and the body element
  231. gets the class based on active step id `impress-on-ID` (where ID is the step's id)... It may not be
  232. so clear because of all these "ids" in previous sentence, so for example when the first step (the one with
  233. the id of `bored`) is active, body element gets a class of `impress-on-bored`.
  234. This class is used by this hint below. Check CSS file to see how it's shown with delayed CSS animation when
  235. the first step of presentation is visible for a couple of seconds.
  236. ...
  237. And when it comes to this piece of JavaScript below ... kids, don't do this at home ;)
  238. It's just a quick and dirty workaround to get different hint text for touch devices.
  239. In a real world it should be at least placed in separate JS file ... and the touch content should be
  240. probably just hidden somewhere in HTML - not hard-coded in the script.
  241. Just sayin' ;)
  242. -->
  243. <div class="hint">
  244. <p>Use a spacebar or arrow keys to navigate</p>
  245. </div>
  246. <script>
  247. if ("ontouchstart" in document.documentElement) {
  248. document.querySelector(".hint").innerHTML = "<p>Tap on the left or right to navigate</p>";
  249. }
  250. </script>
  251. <!--
  252. Last, but not least.
  253. To make all described above really work, you need to include impress.js in the page.
  254. I strongly encourage to minify it first.
  255. In here I just include full source of the script to make it more readable.
  256. You also need to call a `impress().init()` function to initialize impress.js presentation.
  257. And you should do it in the end of your document. Not only because it's a good practice, but also
  258. because it should be done when the whole document is ready.
  259. Of course you can wrap it in any kind of "DOM ready" event, but I was too lazy to do so ;)
  260. -->
  261. <script src="js/impress.js"></script>
  262. <script>impress().init();</script>
  263. <!--
  264. The `impress()` function also gives you access to the API that controls the presentation.
  265. Just store the result of the call:
  266. var api = impress();
  267. and you will get three functions you can call:
  268. `api.init()` - initializes the presentation,
  269. `api.next()` - moves to next step of the presentation,
  270. `api.prev()` - moves to previous step of the presentation,
  271. `api.goto( idx | id | element, [duration] )` - moves the presentation to the step given by its index number
  272. id or the DOM element; second parameter can be used to define duration of the transition in ms,
  273. but it's optional - if not provided default transition duration for the presentation will be used.
  274. You can also simply call `impress()` again to get the API, so `impress().next()` is also allowed.
  275. Don't worry, it wont initialize the presentation again.
  276. For some example uses of this API check the last part of the source of impress.js where the API
  277. is used in event handlers.
  278. -->
  279. </body>
  280. </html>
  281. <!--
  282. Now you know more or less everything you need to build your first impress.js presentation, but before
  283. you start...
  284. Oh, you've already cloned the code from GitHub?
  285. You have it open in text editor?
  286. Stop right there!
  287. That's not how you create awesome presentations. This is only a code. Implementation of the idea that
  288. first needs to grow in your mind.
  289. So if you want to build great presentation take a pencil and piece of paper. And turn off the computer.
  290. Sketch, draw and write. Brainstorm your ideas on a paper. Try to build a mind-map of what you'd like
  291. to present. It will get you closer and closer to the layout you'll build later with impress.js.
  292. Get back to the code only when you have your presentation ready on a paper. It doesn't make sense to do
  293. it earlier, because you'll only waste your time fighting with positioning of useless points.
  294. If you think I'm crazy, please put your hands on a book called "Presentation Zen". It's all about
  295. creating awesome and engaging presentations.
  296. Think about it. 'Cause impress.js may not help you, if you have nothing interesting to say.
  297. -->
  298. <!--
  299. Are you still reading this?
  300. For real?
  301. I'm impressed! Feel free to let me know that you got that far (I'm @bartaz on Twitter), 'cause I'd like
  302. to congratulate you personally :)
  303. But you don't have to do it now. Take my advice and take some time off. Make yourself a cup of coffee, tea,
  304. or anything you like to drink. And raise a glass for me ;)
  305. Cheers!
  306. -->