PageRenderTime 49ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/README.md

https://gitlab.com/mtellezgalindo/reveal.js-1
Markdown | 730 lines | 517 code | 213 blank | 0 comment | 0 complexity | 5f4a76acc8a252e277863caba78d55f4 MD5 | raw file
  1. # reveal.js [![Build Status](https://travis-ci.org/hakimel/reveal.js.png?branch=master)](https://travis-ci.org/hakimel/reveal.js)
  2. A framework for easily creating beautiful presentations using HTML. [Check out the live demo](http://lab.hakim.se/reveal-js/).
  3. reveal.js comes with a broad range of features including [nested slides](https://github.com/hakimel/reveal.js#markup), [markdown contents](https://github.com/hakimel/reveal.js#markdown), [PDF export](https://github.com/hakimel/reveal.js#pdf-export), [speaker notes](https://github.com/hakimel/reveal.js#speaker-notes) and a [JavaScript API](https://github.com/hakimel/reveal.js#api). It's best viewed in a browser with support for CSS 3D transforms but [fallbacks](https://github.com/hakimel/reveal.js/wiki/Browser-Support) are available to make sure your presentation can still be viewed elsewhere.
  4. #### More reading:
  5. - [Installation](#installation): Step-by-step instructions for getting reveal.js running on your computer.
  6. - [Changelog](https://github.com/hakimel/reveal.js/releases): Up-to-date version history.
  7. - [Examples](https://github.com/hakimel/reveal.js/wiki/Example-Presentations): Presentations created with reveal.js, add your own!
  8. - [Browser Support](https://github.com/hakimel/reveal.js/wiki/Browser-Support): Explanation of browser support and fallbacks.
  9. ## Slides
  10. Presentations are written using HTML or markdown but there's also an online editor for those of you who prefer a graphical interface. Give it a try at [http://slid.es](http://slid.es).
  11. ## Instructions
  12. ### Markup
  13. Markup hierarchy needs to be ``<div class="reveal"> <div class="slides"> <section>`` where the ``<section>`` represents one slide and can be repeated indefinitely. If you place multiple ``<section>``'s inside of another ``<section>`` they will be shown as vertical slides. The first of the vertical slides is the "root" of the others (at the top), and it will be included in the horizontal sequence. For example:
  14. ```html
  15. <div class="reveal">
  16. <div class="slides">
  17. <section>Single Horizontal Slide</section>
  18. <section>
  19. <section>Vertical Slide 1</section>
  20. <section>Vertical Slide 2</section>
  21. </section>
  22. </div>
  23. </div>
  24. ```
  25. ### Markdown
  26. It's possible to write your slides using Markdown. To enable Markdown, add the ```data-markdown``` attribute to your ```<section>``` elements and wrap the contents in a ```<script type="text/template">``` like the example below.
  27. This is based on [data-markdown](https://gist.github.com/1343518) from [Paul Irish](https://github.com/paulirish) modified to use [marked](https://github.com/chjj/marked) to support [Github Flavoured Markdown](https://help.github.com/articles/github-flavored-markdown). Sensitive to indentation (avoid mixing tabs and spaces) and line breaks (avoid consecutive breaks).
  28. ```html
  29. <section data-markdown>
  30. <script type="text/template">
  31. ## Page title
  32. A paragraph with some text and a [link](http://hakim.se).
  33. </script>
  34. </section>
  35. ```
  36. #### External Markdown
  37. You can write your content as a separate file and have reveal.js load it at runtime. Note the separator arguments which determine how slides are delimited in the external file.
  38. ```html
  39. <section data-markdown="example.md" data-separator="^\n\n\n" data-vertical="^\n\n"></section>
  40. ```
  41. ### Configuration
  42. At the end of your page you need to initialize reveal by running the following code. Note that all config values are optional and will default as specified below.
  43. ```javascript
  44. Reveal.initialize({
  45. // Display controls in the bottom right corner
  46. controls: true,
  47. // Display a presentation progress bar
  48. progress: true,
  49. // Push each slide change to the browser history
  50. history: false,
  51. // Enable keyboard shortcuts for navigation
  52. keyboard: true,
  53. // Enable touch events for navigation
  54. touch: true,
  55. // Enable the slide overview mode
  56. overview: true,
  57. // Vertical centering of slides
  58. center: true,
  59. // Loop the presentation
  60. loop: false,
  61. // Change the presentation direction to be RTL
  62. rtl: false,
  63. // Number of milliseconds between automatically proceeding to the
  64. // next slide, disabled when set to 0, this value can be overwritten
  65. // by using a data-autoslide attribute on your slides
  66. autoSlide: 0,
  67. // Enable slide navigation via mouse wheel
  68. mouseWheel: false,
  69. // Apply a 3D roll to links on hover
  70. rollingLinks: true,
  71. // Transition style
  72. transition: 'default', // default/cube/page/concave/zoom/linear/fade/none
  73. // Transition speed
  74. transitionSpeed: 'default', // default/fast/slow
  75. // Transition style for full page backgrounds
  76. backgroundTransition: 'default' // default/linear
  77. });
  78. ```
  79. Note that the new default vertical centering option will break compatibility with slides that were using transitions with backgrounds (`cube` and `page`). To restore the previous behavior, set `center` to `false`.
  80. The configuration can be updated after initialization using the ```configure``` method:
  81. ```javascript
  82. // Turn autoSlide off
  83. Reveal.configure({ autoSlide: 0 });
  84. // Start auto-sliding every 5s
  85. Reveal.configure({ autoSlide: 5000 });
  86. ```
  87. ### Dependencies
  88. Reveal.js doesn't _rely_ on any third party scripts to work but a few optional libraries are included by default. These libraries are loaded as dependencies in the order they appear, for example:
  89. ```javascript
  90. Reveal.initialize({
  91. dependencies: [
  92. // Cross-browser shim that fully implements classList - https://github.com/eligrey/classList.js/
  93. { src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } },
  94. // Interpret Markdown in <section> elements
  95. { src: 'plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
  96. { src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
  97. // Syntax highlight for <code> elements
  98. { src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
  99. // Zoom in and out with Alt+click
  100. { src: 'plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } },
  101. // Speaker notes
  102. { src: 'plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } },
  103. // Remote control your reveal.js presentation using a touch device
  104. { src: 'plugin/remotes/remotes.js', async: true, condition: function() { return !!document.body.classList; } }
  105. ]
  106. });
  107. ```
  108. You can add your own extensions using the same syntax. The following properties are available for each dependency object:
  109. - **src**: Path to the script to load
  110. - **async**: [optional] Flags if the script should load after reveal.js has started, defaults to false
  111. - **callback**: [optional] Function to execute when the script has loaded
  112. - **condition**: [optional] Function which must return true for the script to be loaded
  113. ### Presentation Size
  114. All presentations have a normal size, that is the resolution at which they are authored. The framework will automatically scale presentations uniformly based on this size to ensure that everything fits on any given display or viewport.
  115. See below for a list of configuration options related to sizing, including default values:
  116. ```javascript
  117. Reveal.initialize({
  118. ...
  119. // The "normal" size of the presentation, aspect ratio will be preserved
  120. // when the presentation is scaled to fit different resolutions. Can be
  121. // specified using percentage units.
  122. width: 960,
  123. height: 700,
  124. // Factor of the display size that should remain empty around the content
  125. margin: 0.1,
  126. // Bounds for smallest/largest possible scale to apply to content
  127. minScale: 0.2,
  128. maxScale: 1.0
  129. });
  130. ```
  131. ### Keyboard Bindings
  132. If you're unhappy with any of the default keyboard bindings you can override them using the ```keyboard``` config option:
  133. ```javascript
  134. Reveal.configure({
  135. keyboard: {
  136. 13: 'next', // go to the next slide when the ENTER key is pressed
  137. 27: function() {}, // do something custom when ESC is pressed
  138. 32: null // don't do anything when SPACE is pressed (i.e. disable a reveal.js default binding)
  139. }
  140. });
  141. ```
  142. ### API
  143. The ``Reveal`` class provides a JavaScript API for controlling navigation and reading state:
  144. ```javascript
  145. // Navigation
  146. Reveal.slide( indexh, indexv, indexf );
  147. Reveal.left();
  148. Reveal.right();
  149. Reveal.up();
  150. Reveal.down();
  151. Reveal.prev();
  152. Reveal.next();
  153. Reveal.prevFragment();
  154. Reveal.nextFragment();
  155. Reveal.toggleOverview();
  156. Reveal.togglePause();
  157. // Retrieves the previous and current slide elements
  158. Reveal.getPreviousSlide();
  159. Reveal.getCurrentSlide();
  160. Reveal.getIndices(); // { h: 0, v: 0 } }
  161. // State checks
  162. Reveal.isFirstSlide();
  163. Reveal.isLastSlide();
  164. Reveal.isOverview();
  165. Reveal.isPaused();
  166. ```
  167. ### Ready Event
  168. The 'ready' event is fired when reveal.js has loaded all (synchronous) dependencies and is ready to start navigating.
  169. ```javascript
  170. Reveal.addEventListener( 'ready', function( event ) {
  171. // event.currentSlide, event.indexh, event.indexv
  172. } );
  173. ```
  174. ### Slide Changed Event
  175. An 'slidechanged' event is fired each time the slide is changed (regardless of state). The event object holds the index values of the current slide as well as a reference to the previous and current slide HTML nodes.
  176. Some libraries, like MathJax (see [#226](https://github.com/hakimel/reveal.js/issues/226#issuecomment-10261609)), get confused by the transforms and display states of slides. Often times, this can be fixed by calling their update or render function from this callback.
  177. ```javascript
  178. Reveal.addEventListener( 'slidechanged', function( event ) {
  179. // event.previousSlide, event.currentSlide, event.indexh, event.indexv
  180. } );
  181. ```
  182. ### States
  183. If you set ``data-state="somestate"`` on a slide ``<section>``, "somestate" will be applied as a class on the document element when that slide is opened. This allows you to apply broad style changes to the page based on the active slide.
  184. Furthermore you can also listen to these changes in state via JavaScript:
  185. ```javascript
  186. Reveal.addEventListener( 'somestate', function() {
  187. // TODO: Sprinkle magic
  188. }, false );
  189. ```
  190. ### Slide Backgrounds
  191. Slides are contained within a limited portion of the screen by default to allow them to fit any display and scale uniformly. You can apply full page background colors or images by applying a ```data-background``` attribute to your ```<section>``` elements. Below are a few examples.
  192. ```html
  193. <section data-background="#ff0000">
  194. <h2>All CSS color formats are supported, like rgba() or hsl().</h2>
  195. </section>
  196. <section data-background="http://example.com/image.png">
  197. <h2>This slide will have a full-size background image.</h2>
  198. </section>
  199. <section data-background="http://example.com/image.png" data-background-size="100px" data-background-repeat="repeat">
  200. <h2>This background image will be sized to 100px and repeated.</h2>
  201. </section>
  202. ```
  203. Backgrounds transition using a fade animation by default. This can be changed to a linear sliding transition by passing ```backgroundTransition: 'slide'``` to the ```Reveal.initialize()``` call. Alternatively you can set ```data-background-transition``` on any section with a background to override that specific transition.
  204. ### Slide Transitions
  205. The global presentation transition is set using the ```transition``` config value. You can override the global transition for a specific slide by using the ```data-transition``` attribute:
  206. ```html
  207. <section data-transition="zoom">
  208. <h2>This slide will override the presentation transition and zoom!</h2>
  209. </section>
  210. <section data-transition-speed="fast">
  211. <h2>Choose from three transition speeds: default, fast or slow!</h2>
  212. </section>
  213. ```
  214. Note that this does not work with the page and cube transitions.
  215. ### Internal links
  216. It's easy to link between slides. The first example below targets the index of another slide whereas the second targets a slide with an ID attribute (```<section id="some-slide">```):
  217. ```html
  218. <a href="#/2/2">Link</a>
  219. <a href="#/some-slide">Link</a>
  220. ```
  221. You can also add relative navigation links, similar to the built in reveal.js controls, by appending one of the following classes on any element. Note that each element is automatically given an ```enabled``` class when it's a valid navigation route based on the current slide.
  222. ```html
  223. <a href="#" class="navigate-left">
  224. <a href="#" class="navigate-right">
  225. <a href="#" class="navigate-up">
  226. <a href="#" class="navigate-down">
  227. <a href="#" class="navigate-prev"> <!-- Previous vertical or horizontal slide -->
  228. <a href="#" class="navigate-next"> <!-- Next vertical or horizontal slide -->
  229. ```
  230. ### Fragments
  231. Fragments are used to highlight individual elements on a slide. Every element with the class ```fragment``` will be stepped through before moving on to the next slide. Here's an example: http://lab.hakim.se/reveal-js/#/16
  232. The default fragment style is to start out invisible and fade in. This style can be changed by appending a different class to the fragment:
  233. ```html
  234. <section>
  235. <p class="fragment grow">grow</p>
  236. <p class="fragment shrink">shrink</p>
  237. <p class="fragment roll-in">roll-in</p>
  238. <p class="fragment fade-out">fade-out</p>
  239. <p class="fragment highlight-red">highlight-red</p>
  240. <p class="fragment highlight-green">highlight-green</p>
  241. <p class="fragment highlight-blue">highlight-blue</p>
  242. </section>
  243. ```
  244. Multiple fragments can be applied to the same element sequentially by wrapping it, this will fade in the text on the first step and fade it back out on the second.
  245. ```html
  246. <section>
  247. <span class="fragment fade-in">
  248. <span class="fragment fade-out">I'll fade in, then out</span>
  249. </span>
  250. </section>
  251. ```
  252. The display order of fragments can be controlled using the ```data-fragment-index``` attribute.
  253. ```html
  254. <section>
  255. <p class="fragment" data-fragment-index="3">Appears last</p>
  256. <p class="fragment" data-fragment-index="1">Appears first</p>
  257. <p class="fragment" data-fragment-index="2">Appears second</p>
  258. </section>
  259. ```
  260. ### Fragment events
  261. When a slide fragment is either shown or hidden reveal.js will dispatch an event.
  262. ```javascript
  263. Reveal.addEventListener( 'fragmentshown', function( event ) {
  264. // event.fragment = the fragment DOM element
  265. } );
  266. Reveal.addEventListener( 'fragmenthidden', function( event ) {
  267. // event.fragment = the fragment DOM element
  268. } );
  269. ```
  270. ### Code syntax highlighting
  271. By default, Reveal is configured with [highlight.js](http://softwaremaniacs.org/soft/highlight/en/) for code syntax highlighting. Below is an example with clojure code that will be syntax highlighted. When the `data-trim` attribute is present surrounding whitespace is automatically removed.
  272. ```html
  273. <section>
  274. <pre><code data-trim>
  275. (def lazy-fib
  276. (concat
  277. [0 1]
  278. ((fn rfib [a b]
  279. (lazy-cons (+ a b) (rfib b (+ a b)))) 0 1)))
  280. </code></pre>
  281. </section>
  282. ```
  283. ### Overview mode
  284. Press "Esc" key to toggle the overview mode on and off. While you're in this mode, you can still navigate between slides,
  285. as if you were at 1,000 feet above your presentation. The overview mode comes with a few API hooks:
  286. ```javascript
  287. Reveal.addEventListener( 'overviewshown', function( event ) { /* ... */ } );
  288. Reveal.addEventListener( 'overviewhidden', function( event ) { /* ... */ } );
  289. // Toggle the overview mode programmatically
  290. Reveal.toggleOverview();
  291. ```
  292. ### Fullscreen mode
  293. Just press »F« on your keyboard to show your presentation in fullscreen mode. Press the »ESC« key to exit fullscreen mode.
  294. ### Embedded media
  295. Embedded HTML5 `<video>`/`<audio>` and YouTube iframes are automatically paused when your navigate away from a slide. This can be disabled by decorating your element with a `data-ignore` attribute.
  296. Add `data-autoplay` to your media element if you want it to automatically start playing when the slide is shown:
  297. ```html
  298. <video data-autoplay src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"></video>
  299. ```
  300. ## PDF Export
  301. Presentations can be exported to PDF via a special print stylesheet. This feature requires that you use [Google Chrome](http://google.com/chrome).
  302. Here's an example of an exported presentation that's been uploaded to SlideShare: http://www.slideshare.net/hakimel/revealjs-13872948.
  303. 1. Open your presentation with [css/print/pdf.css](https://github.com/hakimel/reveal.js/blob/master/css/print/pdf.css) included on the page. The default index HTML lets you add *print-pdf* anywhere in the query to include the stylesheet, for example: [lab.hakim.se/reveal-js?print-pdf](http://lab.hakim.se/reveal-js?print-pdf).
  304. 2. Open the in-browser print dialog (CMD+P).
  305. 3. Change the **Destination** setting to **Save as PDF**.
  306. 4. Change the **Layout** to **Landscape**.
  307. 5. Change the **Margins** to **None**.
  308. 6. Click **Save**.
  309. ![Chrome Print Settings](https://s3.amazonaws.com/hakim-static/reveal-js/pdf-print-settings.png)
  310. ## Theming
  311. The framework comes with a few different themes included:
  312. - default: Gray background, white text, blue links
  313. - beige: Beige background, dark text, brown links
  314. - sky: Blue background, thin white text, blue links
  315. - night: Black background, thick white text, orange links
  316. - serif: Cappuccino background, gray text, brown links
  317. - simple: White background, black text, blue links
  318. Each theme is available as a separate stylesheet. To change theme you will need to replace **default** below with your desired theme name in index.html:
  319. ```html
  320. <link rel="stylesheet" href="css/theme/default.css" id="theme">
  321. ```
  322. If you want to add a theme of your own see the instructions here: [/css/theme/README.md](https://github.com/hakimel/reveal.js/blob/master/css/theme/README.md).
  323. ## Speaker Notes
  324. reveal.js comes with a speaker notes plugin which can be used to present per-slide notes in a separate browser window. The notes window also gives you a preview of the next upcoming slide so it may be helpful even if you haven't written any notes. Press the 's' key on your keyboard to open the notes window.
  325. By default notes are written using standard HTML, see below, but you can add a ```data-markdown``` attribute to the ```<aside>``` to write them using Markdown.
  326. ```html
  327. <section>
  328. <h2>Some Slide</h2>
  329. <aside class="notes">
  330. Oh hey, these are some notes. They'll be hidden in your presentation, but you can see them if you open the speaker notes window (hit 's' on your keyboard).
  331. </aside>
  332. </section>
  333. ```
  334. ## Server Side Speaker Notes
  335. In some cases it can be desirable to run notes on a separate device from the one you're presenting on. The Node.js-based notes plugin lets you do this using the same note definitions as its client side counterpart. Include the required scripts by adding the following dependencies:
  336. ```javascript
  337. Reveal.initialize({
  338. ...
  339. dependencies: [
  340. { src: 'socket.io/socket.io.js', async: true },
  341. { src: 'plugin/notes-server/client.js', async: true }
  342. ]
  343. });
  344. ```
  345. Then:
  346. 1. Install [Node.js](http://nodejs.org/)
  347. 2. Run ```npm install```
  348. 3. Run ```node plugin/notes-server```
  349. ## Multiplexing
  350. The multiplex plugin allows your audience to view the slides of the presentation you are controlling on their own phone, tablet or laptop. As the master presentation navigates the slides, all client presentations will update in real time. See a demo at [http://revealjs.jit.su/](http://revealjs.jit.su).
  351. The multiplex plugin needs the following 3 things to operate:
  352. 1. Master presentation that has control
  353. 2. Client presentations that follow the master
  354. 3. Socket.io server to broadcast events from the master to the clients
  355. More details:
  356. #### Master presentation
  357. Served from a static file server accessible (preferably) only to the presenter. This need only be on your (the presenter's) computer. (It's safer to run the master presentation from your own computer, so if the venue's Internet goes down it doesn't stop the show.) An example would be to execute the following commands in the directory of your master presentation:
  358. 1. ```npm install node-static```
  359. 2. ```static```
  360. If you want to use the speaker notes plugin with your master presentation then make sure you have the speaker notes plugin configured correctly along with the configuration shown below, then execute ```node plugin/notes-server``` in the directory of your master presentation. The configuration below will cause it to connect to the socket.io server as a master, as well as launch your speaker-notes/static-file server.
  361. You can then access your master presentation at ```http://localhost:1947```
  362. Example configuration:
  363. ```javascript
  364. Reveal.initialize({
  365. // other options
  366. multiplex: {
  367. // Example values. Generate your own.
  368. secret: '13652805320794272084', // Obtained from the socket.io server. Gives this (the master) control of the presentation
  369. id: '1ea875674b17ca76', // Obtained from socket.io server
  370. url: 'revealjs.jit.su:80' // Location of socket.io server
  371. },
  372. // Optional libraries used to extend on reveal.js
  373. dependencies: [
  374. // other deps
  375. { src: '//cdnjs.cloudflare.com/ajax/libs/socket.io/0.9.10/socket.io.min.js', async: true },
  376. { src: 'plugin/multiplex/master.js', async: true },
  377. // and if you want speaker notes
  378. { src: 'plugin/notes-server/client.js', async: true }
  379. ]
  380. });
  381. ```
  382. #### Client presentation
  383. Served from a publicly accessible static file server. Examples include: GitHub Pages, Amazon S3, Dreamhost, Akamai, etc. The more reliable, the better. Your audience can then access the client presentation via ```http://example.com/path/to/presentation/client/index.html```, with the configuration below causing them to connect to the socket.io server as clients.
  384. Example configuration:
  385. ```javascript
  386. Reveal.initialize({
  387. // other options
  388. multiplex: {
  389. // Example values. Generate your own.
  390. secret: null, // null so the clients do not have control of the master presentation
  391. id: '1ea875674b17ca76', // id, obtained from socket.io server
  392. url: 'revealjs.jit.su:80' // Location of socket.io server
  393. },
  394. // Optional libraries used to extend on reveal.js
  395. dependencies: [
  396. // other deps
  397. { src: '//cdnjs.cloudflare.com/ajax/libs/socket.io/0.9.10/socket.io.min.js', async: true },
  398. { src: 'plugin/multiplex/client.js', async: true }
  399. ]
  400. });
  401. ```
  402. #### Socket.io server
  403. Server that receives the slideChanged events from the master presentation and broadcasts them out to the connected client presentations. This needs to be publicly accessible. You can run your own socket.io server with the commands:
  404. 1. ```npm install```
  405. 2. ```node plugin/multiplex```
  406. Or you use the socket.io server at [http://revealjs.jit.su](http://revealjs.jit.su).
  407. You'll need to generate a unique secret and token pair for your master and client presentations. To do so, visit ```http://example.com/token```, where ```http://example.com``` is the location of your socket.io server. Or if you're going to use the socket.io server at [http://revealjs.jit.su](http://revealjs.jit.su), visit [http://revealjs.jit.su/token](http://revealjs.jit.su/token).
  408. You are very welcome to point your presentations at the Socket.io server running at [http://revealjs.jit.su](http://revealjs.jit.su), but availability and stability are not guaranteed. For anything mission critical I recommend you run your own server. It is simple to deploy to nodejitsu, heroku, your own environment, etc.
  409. ##### socket.io server as file static server
  410. The socket.io server can play the role of static file server for your client presentation, as in the example at [http://revealjs.jit.su](http://revealjs.jit.su). (Open [http://revealjs.jit.su](http://revealjs.jit.su) in two browsers. Navigate through the slides on one, and the other will update to match.)
  411. Example configuration:
  412. ```javascript
  413. Reveal.initialize({
  414. // other options
  415. multiplex: {
  416. // Example values. Generate your own.
  417. secret: null, // null so the clients do not have control of the master presentation
  418. id: '1ea875674b17ca76', // id, obtained from socket.io server
  419. url: 'example.com:80' // Location of your socket.io server
  420. },
  421. // Optional libraries used to extend on reveal.js
  422. dependencies: [
  423. // other deps
  424. { src: '//cdnjs.cloudflare.com/ajax/libs/socket.io/0.9.10/socket.io.min.js', async: true },
  425. { src: 'plugin/multiplex/client.js', async: true }
  426. ]
  427. ```
  428. It can also play the role of static file server for your master presentation and client presentations at the same time (as long as you don't want to use speaker notes). (Open [http://revealjs.jit.su](http://revealjs.jit.su) in two browsers. Navigate through the slides on one, and the other will update to match. Navigate through the slides on the second, and the first will update to match.) This is probably not desirable, because you don't want your audience to mess with your slides while you're presenting. ;)
  429. Example configuration:
  430. ```javascript
  431. Reveal.initialize({
  432. // other options
  433. multiplex: {
  434. // Example values. Generate your own.
  435. secret: '13652805320794272084', // Obtained from the socket.io server. Gives this (the master) control of the presentation
  436. id: '1ea875674b17ca76', // Obtained from socket.io server
  437. url: 'example.com:80' // Location of your socket.io server
  438. },
  439. // Optional libraries used to extend on reveal.js
  440. dependencies: [
  441. // other deps
  442. { src: '//cdnjs.cloudflare.com/ajax/libs/socket.io/0.9.10/socket.io.min.js', async: true },
  443. { src: 'plugin/multiplex/master.js', async: true },
  444. { src: 'plugin/multiplex/client.js', async: true }
  445. ]
  446. });
  447. ```
  448. ## Leap Motion
  449. The Leap Motion plugin lets you utilize your [Leap Motion](https://www.leapmotion.com/) device to control basic navigation of your presentation. The gestures currently supported are:
  450. ##### 1 to 2 fingers
  451. * Pointer &mdash; Point to anything on screen. Move your finger past the device to expand the pointer.
  452. ##### 1 hand + 3 or more fingers
  453. * Left
  454. * Right
  455. * Up
  456. * down
  457. Navigate through your slides. See config options to invert movements.
  458. ##### 2 hands
  459. * Up
  460. Toggle the overview mode. Do it a second time to exit the overview.
  461. #### Config Options
  462. You can edit the following options:
  463. * autoCenter: Defaults to true. Center the pointer based on where you put your finger into the leap motions detection field.
  464. * gestureDelay: Defaults to 500. How long to delay between gestures in milliseconds.
  465. * naturalSwipe: Defaults to true. Swipe as though you were touching a touch screen. Set to false to invert.
  466. * pointerColor: Defaults to #00aaff. The color of the pointer.
  467. * pointerOpacity: Defaults to 0.7. The opacity of the pointer.
  468. * pointerSize: Defaults to 15. The minimum height and width of the pointer.
  469. * pointerTolerance: Defaults to 120. Bigger = slower pointer.
  470. Example configuration:
  471. ```js
  472. Reveal.initialize({
  473. // other options
  474. leap: {
  475. naturalSwipe : false, // Invert swipe gestures
  476. pointerOpacity : 0.5, // Set pointer opacity to 0.5
  477. pointerColor : '#d80000' // Red pointer
  478. }
  479. // Optional libraries used to extend on reveal.js
  480. { src: 'plugin/leap/leap.js', async: true }
  481. ```
  482. ## Installation
  483. The **basic setup** is for authoring presentations only. The **full setup** gives you access to all reveal.js features and plugins such as speaker notes as well as the development tasks needed to make changes to the source.
  484. ### Basic setup
  485. The core of reveal.js is very easy to install. You'll simply need to download a copy of this repository and open the index.html file directly in your browser.
  486. 1. Download the latest version of reveal.js from <https://github.com/hakimel/reveal.js/releases>
  487. 2. Unzip and replace the example contents in index.html with your own
  488. 3. Open index.html in a browser to view it
  489. ### Full setup
  490. Some reveal.js features, like external markdown, require that presentations run from a local web server. The following instructions will set up such a server as well as all of the development tasks needed to make edits to the reveal.js source code.
  491. 1. Install [Node.js](http://nodejs.org/)
  492. 2. Install [Grunt](http://gruntjs.com/getting-started#installing-the-cli)
  493. 4. Clone the reveal.js repository
  494. ```
  495. $ git clone git@github.com:hakimel/reveal.js.git
  496. ```
  497. 5. Navigate to the reveal.js folder
  498. ```
  499. $ cd reveal.js
  500. ```
  501. 6. Install dependencies
  502. ```
  503. $ npm install
  504. ```
  505. 7. Serve the presentation and monitor source files for changes
  506. ```
  507. $ grunt serve
  508. ```
  509. 8. Open <http://localhost:8000> to view your presentation
  510. ### Folder Structure
  511. - **css/** Core styles without which the project does not function
  512. - **js/** Like above but for JavaScript
  513. - **plugin/** Components that have been developed as extensions to reveal.js
  514. - **lib/** All other third party assets (JavaScript, CSS, fonts)
  515. ## License
  516. MIT licensed
  517. Copyright (C) 2013 Hakim El Hattab, http://hakim.se