aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Gruntfile.js5
-rw-r--r--LICENSE2
-rw-r--r--README.md338
-rw-r--r--bower.json2
-rw-r--r--css/print/pdf.css22
-rw-r--r--css/reveal.css94
-rw-r--r--css/reveal.scss103
-rw-r--r--css/theme/README.md2
-rw-r--r--css/theme/beige.css13
-rw-r--r--css/theme/black.css13
-rw-r--r--css/theme/blood.css13
-rw-r--r--css/theme/league.css13
-rw-r--r--css/theme/moon.css13
-rw-r--r--css/theme/night.css13
-rw-r--r--css/theme/serif.css13
-rw-r--r--css/theme/simple.css13
-rw-r--r--css/theme/sky.css13
-rw-r--r--css/theme/solarized.css13
-rw-r--r--css/theme/template/theme.scss13
-rw-r--r--css/theme/white.css13
-rw-r--r--demo.html10
-rw-r--r--js/reveal.js498
-rw-r--r--package.json2
-rwxr-xr-xplugin/markdown/markdown.js2
-rw-r--r--plugin/notes/notes.html26
-rw-r--r--plugin/notes/notes.js4
-rw-r--r--test/test.js8
27 files changed, 862 insertions, 412 deletions
diff --git a/Gruntfile.js b/Gruntfile.js
index ff7da2d..8d8300b 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -15,7 +15,7 @@ module.exports = function(grunt) {
' * http://revealjs.com\n' +
' * MIT licensed\n' +
' *\n' +
- ' * Copyright (C) 2017 Hakim El Hattab, http://hakim.se\n' +
+ ' * Copyright (C) 2018 Hakim El Hattab, http://hakim.se\n' +
' */'
},
@@ -78,6 +78,7 @@ module.exports = function(grunt) {
eqnull: true,
browser: true,
expr: true,
+ loopfunc: true,
globals: {
head: false,
module: false,
@@ -164,7 +165,7 @@ module.exports = function(grunt) {
grunt.loadNpmTasks( 'grunt-retire' );
grunt.loadNpmTasks( 'grunt-sass' );
grunt.loadNpmTasks( 'grunt-zip' );
-
+
// Default task
grunt.registerTask( 'default', [ 'css', 'js' ] );
diff --git a/LICENSE b/LICENSE
index c3e6e5f..1b8b5a7 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright (C) 2017 Hakim El Hattab, http://hakim.se, and reveal.js contributors
+Copyright (C) 2018 Hakim El Hattab, http://hakim.se, and reveal.js contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/README.md b/README.md
index c0d019a..20efcdf 100644
--- a/README.md
+++ b/README.md
@@ -4,8 +4,14 @@ A framework for easily creating beautiful presentations using HTML. [Check out t
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). There's also a fully featured visual editor and platform for sharing reveal.js presentations at [slides.com](https://slides.com?ref=github).
+
## Table of contents
+
- [Online Editor](#online-editor)
+- [Installation](#installation)
+ - [Basic setup](#basic-setup)
+ - [Full setup](#full-setup)
+ - [Folder Structure](#folder-structure)
- [Instructions](#instructions)
- [Markup](#markup)
- [Markdown](#markdown)
@@ -46,23 +52,71 @@ reveal.js comes with a broad range of features including [nested slides](https:/
- [Client presentation](#client-presentation)
- [Socket.io server](#socketio-server)
- [MathJax](#mathjax)
-- [Installation](#installation)
- - [Basic setup](#basic-setup)
- - [Full setup](#full-setup)
- - [Folder Structure](#folder-structure)
- [License](#license)
#### More reading
+
- [Changelog](https://github.com/hakimel/reveal.js/releases): Up-to-date version history.
- [Examples](https://github.com/hakimel/reveal.js/wiki/Example-Presentations): Presentations created with reveal.js, add your own!
- [Browser Support](https://github.com/hakimel/reveal.js/wiki/Browser-Support): Explanation of browser support and fallbacks.
- [Plugins](https://github.com/hakimel/reveal.js/wiki/Plugins,-Tools-and-Hardware): A list of plugins that can be used to extend reveal.js.
+
## Online Editor
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 [https://slides.com](https://slides.com?ref=github).
+## Installation
+
+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.
+
+### Basic setup
+
+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.
+
+1. Download the latest version of reveal.js from <https://github.com/hakimel/reveal.js/releases>
+2. Unzip and replace the example contents in index.html with your own
+3. Open index.html in a browser to view it
+
+### Full setup
+
+Some reveal.js features, like external Markdown and speaker notes, 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.
+
+1. Install [Node.js](http://nodejs.org/) (4.0.0 or later)
+
+1. Clone the reveal.js repository
+ ```sh
+ $ git clone https://github.com/hakimel/reveal.js.git
+ ```
+
+1. Navigate to the reveal.js folder
+ ```sh
+ $ cd reveal.js
+ ```
+
+1. Install dependencies
+ ```sh
+ $ npm install
+ ```
+
+1. Serve the presentation and monitor source files for changes
+ ```sh
+ $ npm start
+ ```
+
+1. Open <http://localhost:8000> to view your presentation
+
+ You can change the port by using `npm start -- --port=8001`.
+
+### Folder Structure
+
+- **css/** Core styles without which the project does not function
+- **js/** Like above but for JavaScript
+- **plugin/** Components that have been developed as extensions to reveal.js
+- **lib/** All other third party assets (JavaScript, CSS, fonts)
+
+
## Instructions
### Markup
@@ -121,22 +175,26 @@ This is based on [data-markdown](https://gist.github.com/1343518) from [Paul Iri
#### External Markdown
-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: the `data-separator` attribute defines a regular expression for horizontal slides (defaults to `^\r?\n---\r?\n$`, a newline-bounded horizontal rule) and `data-separator-vertical` defines vertical slides (disabled by default). The `data-separator-notes` attribute is a regular expression for specifying the beginning of the current slide's speaker notes (defaults to `note:`). The `data-charset` attribute is optional and specifies which charset to use when loading the external file.
+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: the `data-separator` attribute defines a regular expression for horizontal slides (defaults to `^\r?\n---\r?\n$`, a newline-bounded horizontal rule) and `data-separator-vertical` defines vertical slides (disabled by default). The `data-separator-notes` attribute is a regular expression for specifying the beginning of the current slide's speaker notes (defaults to `notes?:`, so it will match both "note:" and "notes:"). The `data-charset` attribute is optional and specifies which charset to use when loading the external file.
When used locally, this feature requires that reveal.js [runs from a local web server](#full-setup). The following example customises all available options:
```html
-<section data-markdown="example.md"
- data-separator="^\n\n\n"
- data-separator-vertical="^\n\n"
- data-separator-notes="^Note:"
+<section data-markdown="example.md"
+ data-separator="^\n\n\n"
+ data-separator-vertical="^\n\n"
+ data-separator-notes="^Note:"
data-charset="iso-8859-15">
+ <!--
+ Note that Windows uses `\r\n` instead of `\n` as its linefeed character.
+ For a regex that supports all operating systems, use `\r?\n` instead of `\n`.
+ -->
</section>
```
#### Element Attributes
-Special syntax (in html comment) is available for adding attributes to Markdown elements. This is useful for fragments, amongst other things.
+Special syntax (through HTML comments) is available for adding attributes to Markdown elements. This is useful for fragments, amongst other things.
```html
<section data-markdown>
@@ -149,7 +207,7 @@ Special syntax (in html comment) is available for adding attributes to Markdown
#### Slide Attributes
-Special syntax (in html comment) is available for adding attributes to the slide `<section>` elements generated by your Markdown.
+Special syntax (through HTML comments) is available for adding attributes to the slide `<section>` elements generated by your Markdown.
```html
<section data-markdown>
@@ -167,7 +225,7 @@ We use [marked](https://github.com/chjj/marked) to parse Markdown. To customise
```javascript
Reveal.initialize({
// Options which are passed into marked
- // See https://github.com/chjj/marked#options-1
+ // See https://marked.js.org/#/USING_ADVANCED.md#options
markdown: {
smartypants: true
}
@@ -176,7 +234,7 @@ Reveal.initialize({
### Configuration
-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.
+At the end of your page you need to initialize reveal by running the following code. Note that all configuration values are optional and will default to the values specified below.
```javascript
Reveal.initialize({
@@ -272,6 +330,8 @@ Reveal.initialize({
hideAddressBar: true,
// Opens links in an iframe preview overlay
+ // Add `data-preview-link` and `data-preview-link="false"` to customise each link
+ // individually
previewLinks: false,
// Transition style
@@ -304,8 +364,7 @@ Reveal.initialize({
});
```
-
-The configuration can be updated after initialization using the ```configure``` method:
+The configuration can be updated after initialization using the `configure` method:
```javascript
// Turn autoSlide off
@@ -315,17 +374,16 @@ Reveal.configure({ autoSlide: 0 });
Reveal.configure({ autoSlide: 5000 });
```
-
### Presentation Size
-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.
+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.
See below for a list of configuration options related to sizing, including default values:
```javascript
Reveal.initialize({
- ...
+ // ...
// The "normal" size of the presentation, aspect ratio will be preserved
// when the presentation is scaled to fit different resolutions. Can be
@@ -348,7 +406,7 @@ If you wish to disable this behavior and do your own scaling (e.g. using media q
```javascript
Reveal.initialize({
- ...
+ // ...
width: "100%",
height: "100%",
@@ -397,7 +455,7 @@ To load these dependencies, reveal.js requires [head.js](http://headjs.com/) *(a
### Ready Event
-A 'ready' event is fired when reveal.js has loaded all non-async dependencies and is ready to start navigating. To check if reveal.js is already 'ready' you can call `Reveal.isReady()`.
+A `ready` event is fired when reveal.js has loaded all non-async dependencies and is ready to start navigating. To check if reveal.js is already 'ready' you can call `Reveal.isReady()`.
```javascript
Reveal.addEventListener( 'ready', function( event ) {
@@ -417,9 +475,10 @@ Reveal.configure({
autoSlide: 5000
});
```
-When this is turned on a control element will appear that enables users to pause and resume auto-sliding. Alternatively, sliding can be paused or resumed by pressing »a« on the keyboard. Sliding is paused automatically as soon as the user starts navigating. You can disable these controls by specifying ```autoSlideStoppable: false``` in your reveal.js config.
-You can also override the slide duration for individual slides and fragments by using the ```data-autoslide``` attribute:
+When this is turned on a control element will appear that enables users to pause and resume auto-sliding. Alternatively, sliding can be paused or resumed by pressing »A« on the keyboard. Sliding is paused automatically as soon as the user starts navigating. You can disable these controls by specifying `autoSlideStoppable: false` in your reveal.js config.
+
+You can also override the slide duration for individual slides and fragments by using the `data-autoslide` attribute:
```html
<section data-autoslide="2000">
@@ -429,14 +488,13 @@ You can also override the slide duration for individual slides and fragments by
</section>
```
-To override the method used for navigation when auto-sliding, you can specify the ```autoSlideMethod``` setting. To only navigate along the top layer and ignore vertical slides, set this to ```Reveal.navigateRight```.
-
-Whenever the auto-slide mode is resumed or paused the ```autoslideresumed``` and ```autoslidepaused``` events are fired.
+To override the method used for navigation when auto-sliding, you can specify the `autoSlideMethod` setting. To only navigate along the top layer and ignore vertical slides, set this to `Reveal.navigateRight`.
+Whenever the auto-slide mode is resumed or paused the `autoslideresumed` and `autoslidepaused` events are fired.
### Keyboard Bindings
-If you're unhappy with any of the default keyboard bindings you can override them using the ```keyboard``` config option:
+If you're unhappy with any of the default keyboard bindings you can override them using the `keyboard` config option:
```javascript
Reveal.configure({
@@ -454,12 +512,11 @@ You can swipe to navigate through a presentation on any touch-enabled device. Ho
If there's some part of your content that needs to remain accessible to touch events you'll need to highlight this by adding a `data-prevent-swipe` attribute to the element. One common example where this is useful is elements that need to be scrolled.
-
### Lazy Loading
When working on presentation with a lot of media or iframe content it's important to load lazily. Lazy loading means that reveal.js will only load content for the few slides nearest to the current slide. The number of slides that are preloaded is determined by the `viewDistance` configuration option.
-To enable lazy loading all you need to do is change your "src" attributes to "data-src" as shown below. This is supported for image, video, audio and iframe elements. Lazy loaded iframes will also unload when the containing slide is no longer visible.
+To enable lazy loading all you need to do is change your `src` attributes to `data-src` as shown below. This is supported for image, video, audio and iframe elements. Lazy loaded iframes will also unload when the containing slide is no longer visible.
```html
<section>
@@ -472,10 +529,9 @@ To enable lazy loading all you need to do is change your "src" attributes to "da
</section>
```
-
### API
-The ``Reveal`` object exposes a JavaScript API for controlling navigation and reading state:
+The `Reveal` object exposes a JavaScript API for controlling navigation and reading state:
```javascript
// Navigation
@@ -514,11 +570,11 @@ Reveal.getScale();
Reveal.getPreviousSlide();
Reveal.getCurrentSlide();
-Reveal.getIndices(); // { h: 0, v: 0 } }
-Reveal.getPastSlideCount();
+Reveal.getIndices(); // { h: 0, v: 0, f: 0 }
+Reveal.getSlidePastCount();
Reveal.getProgress(); // (0 == first slide, 1 == last slide)
Reveal.getSlides(); // Array of all slides
-Reveal.getTotalSlides(); // total number of slides
+Reveal.getTotalSlides(); // Total number of slides
// Returns the speaker notes for the current slide
Reveal.getSlideNotes();
@@ -564,7 +620,7 @@ This allows plugins to add key bindings directly to Reveal so they can
### Slide Changed Event
-A '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.
+A `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.
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.
@@ -593,7 +649,7 @@ Reveal.setState( state );
### Slide States
-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.
+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.
Furthermore you can also listen to these changes in state via JavaScript:
@@ -605,10 +661,12 @@ Reveal.addEventListener( 'somestate', function() {
### Slide Backgrounds
-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 backgrounds outside of the slide area by adding a ```data-background``` attribute to your ```<section>``` elements. Four different types of backgrounds are supported: color, image, video and iframe.
+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 backgrounds outside of the slide area by adding a `data-background` attribute to your `<section>` elements. Four different types of backgrounds are supported: color, image, video and iframe.
#### Color Backgrounds
-All CSS color formats are supported, like rgba() or hsl().
+
+All CSS color formats are supported, including hex values, keywords, `rgba()` or `hsl()`.
+
```html
<section data-background-color="#ff0000">
<h2>Color</h2>
@@ -616,14 +674,17 @@ All CSS color formats are supported, like rgba() or hsl().
```
#### Image Backgrounds
+
By default, background images are resized to cover the full page. Available options:
-| Attribute | Default | Description |
-| :--------------------------- | :--------- | :---------- |
-| data-background-image | | URL of the image to show. GIFs restart when the slide opens. |
-| data-background-size | cover | See [background-size](https://developer.mozilla.org/docs/Web/CSS/background-size) on MDN. |
-| data-background-position | center | See [background-position](https://developer.mozilla.org/docs/Web/CSS/background-position) on MDN. |
-| data-background-repeat | no-repeat | See [background-repeat](https://developer.mozilla.org/docs/Web/CSS/background-repeat) on MDN. |
+| Attribute | Default | Description |
+| :------------------------------- | :--------- | :---------- |
+| data-background-image | | URL of the image to show. GIFs restart when the slide opens. |
+| data-background-size | cover | See [background-size](https://developer.mozilla.org/docs/Web/CSS/background-size) on MDN. |
+| data-background-position | center | See [background-position](https://developer.mozilla.org/docs/Web/CSS/background-position) on MDN. |
+| data-background-repeat | no-repeat | See [background-repeat](https://developer.mozilla.org/docs/Web/CSS/background-repeat) on MDN. |
+| data-background-opacity | 1 | Opacity of the background image on a 0-1 scale. 0 is transparent and 1 is fully opaque. |
+
```html
<section data-background-image="http://example.com/image.png">
<h2>Image</h2>
@@ -634,14 +695,16 @@ By default, background images are resized to cover the full page. Available opti
```
#### Video Backgrounds
+
Automatically plays a full size video behind the slide.
-| Attribute | Default | Description |
-| :--------------------------- | :------ | :---------- |
-| data-background-video | | A single video source, or a comma separated list of video sources. |
-| data-background-video-loop | false | Flags if the video should play repeatedly. |
-| data-background-video-muted | false | Flags if the audio should be muted. |
-| data-background-size | cover | Use `cover` for full screen and some cropping or `contain` for letterboxing. |
+| Attribute | Default | Description |
+| :--------------------------- | :------ | :---------- |
+| data-background-video | | A single video source, or a comma separated list of video sources. |
+| data-background-video-loop | false | Flags if the video should play repeatedly. |
+| data-background-video-muted | false | Flags if the audio should be muted. |
+| data-background-size | cover | Use `cover` for full screen and some cropping or `contain` for letterboxing. |
+| data-background-opacity | 1 | Opacity of the background video on a 0-1 scale. 0 is transparent and 1 is fully opaque. |
```html
<section data-background-video="https://s3.amazonaws.com/static.slid.es/site/homepage/v1/homepage-video-editor.mp4,https://s3.amazonaws.com/static.slid.es/site/homepage/v1/homepage-video-editor.webm" data-background-video-loop data-background-video-muted>
@@ -650,7 +713,9 @@ Automatically plays a full size video behind the slide.
```
#### Iframe Backgrounds
+
Embeds a web page as a slide background that covers 100% of the reveal.js width and height. The iframe is in the background layer, behind your slides, and as such it's not possible to interact with it by default. To make your background interactive, you can add the `data-background-interactive` attribute.
+
```html
<section data-background-iframe="https://slides.com" data-background-interactive>
<h2>Iframe</h2>
@@ -658,12 +723,13 @@ Embeds a web page as a slide background that covers 100% of the reveal.js width
```
#### Background Transitions
-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.
+
+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.
### Parallax Background
-If you want to use a parallax scrolling background, set the first two config properties below when initializing reveal.js (the other two are optional).
+If you want to use a parallax scrolling background, set the first two properties below when initializing reveal.js (the other two are optional).
```javascript
Reveal.initialize({
@@ -685,10 +751,9 @@ Reveal.initialize({
Make sure that the background size is much bigger than screen size to allow for some scrolling. [View example](http://revealjs.com/?parallaxBackgroundImage=https%3A%2F%2Fs3.amazonaws.com%2Fhakim-static%2Freveal-js%2Freveal-parallax-1.jpg&parallaxBackgroundSize=2100px%20900px).
-
-
### Slide Transitions
-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:
+
+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:
```html
<section data-transition="zoom">
@@ -719,18 +784,17 @@ You can also use different in and out transitions for the same slide:
And it starts again.
</section>
```
-
-
+You can choose from `none`, `fade`, `slide`, `convex`, `concave` and `zoom`.
### Internal links
-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">```):
+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">`):
```html
<a href="#/2/2">Link</a>
<a href="#/some-slide">Link</a>
```
-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.
+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.
```html
<a href="#" class="navigate-left">
@@ -741,9 +805,9 @@ You can also add relative navigation links, similar to the built in reveal.js co
<a href="#" class="navigate-next"> <!-- Next vertical or horizontal slide -->
```
-
### Fragments
-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://revealjs.com/#/fragments
+
+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://revealjs.com/#/fragments
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:
@@ -753,7 +817,8 @@ The default fragment style is to start out invisible and fade in. This style can
<p class="fragment shrink">shrink</p>
<p class="fragment fade-out">fade-out</p>
<p class="fragment fade-up">fade-up (also down, left and right!)</p>
- <p class="fragment current-visible">visible only once</p>
+ <p class="fragment fade-in-then-out">fades in, then out when we move to the next step</p>
+ <p class="fragment fade-in-then-semi-out">fades in, then obfuscate when we move to the next step</p>
<p class="fragment highlight-current-blue">blue only once</p>
<p class="fragment highlight-red">highlight-red</p>
<p class="fragment highlight-green">highlight-green</p>
@@ -771,7 +836,7 @@ Multiple fragments can be applied to the same element sequentially by wrapping i
</section>
```
-The display order of fragments can be controlled using the ```data-fragment-index``` attribute.
+The display order of fragments can be controlled using the `data-fragment-index` attribute.
```html
<section>
@@ -798,7 +863,18 @@ Reveal.addEventListener( 'fragmenthidden', function( event ) {
### Code syntax highlighting
-By default, Reveal is configured with [highlight.js](https://highlightjs.org/) 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. HTML will be escaped by default. To avoid this, for example if you are using `<mark>` to call out a line of code, add the `data-noescape` attribute to the `<code>` element.
+By default, Reveal is configured with [highlight.js](https://highlightjs.org/) for code syntax highlighting. To enable syntax highlighting, you'll have to load the highlight plugin ([plugin/highlight/highlight.js](plugin/highlight/highlight.js)) and a highlight.js CSS theme (Reveal comes packaged with the zenburn theme: [lib/css/zenburn.css](lib/css/zenburn.css)).
+
+```javascript
+Reveal.initialize({
+ // More info https://github.com/hakimel/reveal.js#dependencies
+ dependencies: [
+ { src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
+ ]
+});
+```
+
+Below is an example with clojure code that will be syntax highlighted. When the `data-trim` attribute is present, surrounding whitespace is automatically removed. HTML will be escaped by default. To avoid this, for example if you are using `<mark>` to call out a line of code, add the `data-noescape` attribute to the `<code>` element.
```html
<section>
@@ -813,7 +889,8 @@ By default, Reveal is configured with [highlight.js](https://highlightjs.org/) f
```
### Slide number
-If you would like to display the page number of the current slide you can do so using the ```slideNumber``` and ```showSlideNumber``` configuration values.
+
+If you would like to display the page number of the current slide you can do so using the `slideNumber` and `showSlideNumber` configuration values.
```javascript
// Shows the slide number using default formatting
@@ -831,13 +908,11 @@ Reveal.configure({ slideNumber: 'c/t' });
// "speaker": only show slide numbers on speaker notes view
// "print": only show slide numbers when printing to PDF
Reveal.configure({ showSlideNumber: 'speaker' });
-
```
-
### Overview mode
-Press "Esc" or "o" keys to toggle the overview mode on and off. While you're in this mode, you can still navigate between slides,
+Press »ESC« or »O« keys to toggle the overview mode on and off. While you're in this mode, you can still navigate between slides,
as if you were at 1,000 feet above your presentation. The overview mode comes with a few API hooks:
```javascript
@@ -848,12 +923,12 @@ Reveal.addEventListener( 'overviewhidden', function( event ) { /* ... */ } );
Reveal.toggleOverview();
```
-
### Fullscreen mode
-Just press »F« on your keyboard to show your presentation in fullscreen mode. Press the »ESC« key to exit fullscreen mode.
+Just press »F« on your keyboard to show your presentation in fullscreen mode. Press the »ESC« key to exit fullscreen mode.
### Embedded media
+
Add `data-autoplay` to your media element if you want it to automatically start playing when the slide is shown:
```html
@@ -864,14 +939,13 @@ If you want to enable or disable autoplay globally, for all embedded media, you
Note that embedded HTML5 `<video>`/`<audio>` and YouTube/Vimeo iframes are automatically paused when you navigate away from a slide. This can be disabled by decorating your element with a `data-ignore` attribute.
-
### Embedded iframes
-reveal.js automatically pushes two [post messages](https://developer.mozilla.org/en-US/docs/Web/API/Window.postMessage) to embedded iframes. ```slide:start``` when the slide containing the iframe is made visible and ```slide:stop``` when it is hidden.
-
+reveal.js automatically pushes two [post messages](https://developer.mozilla.org/en-US/docs/Web/API/Window.postMessage) to embedded iframes. `slide:start` when the slide containing the iframe is made visible and `slide:stop` when it is hidden.
### Stretching elements
-Sometimes it's desirable to have an element, like an image or video, stretch to consume as much space as possible within a given slide. This can be done by adding the ```.stretch``` class to an element as seen below:
+
+Sometimes it's desirable to have an element, like an image or video, stretch to consume as much space as possible within a given slide. This can be done by adding the `.stretch` class to an element as seen below:
```html
<section>
@@ -884,8 +958,8 @@ Limitations:
- Only direct descendants of a slide section can be stretched
- Only one descendant per slide section can be stretched
-
### postMessage API
+
The framework has a built-in postMessage API that can be used when communicating with a presentation inside of another window. Here's an example showing how you'd make a reveal.js instance in the given window proceed to slide 2:
```javascript
@@ -907,7 +981,7 @@ This cross-window messaging can be toggled on or off using configuration flags.
```javascript
Reveal.initialize({
- ...,
+ // ...
// Exposes the reveal.js API through window.postMessage
postMessage: true,
@@ -923,10 +997,17 @@ Reveal.initialize({
Presentations can be exported to PDF via a special print stylesheet. This feature requires that you use [Google Chrome](http://google.com/chrome) or [Chromium](https://www.chromium.org/Home) and to be serving the presentation from a webserver.
Here's an example of an exported presentation that's been uploaded to SlideShare: http://www.slideshare.net/hakimel/revealjs-300.
+### Separate pages for fragments
+[Fragments](#fragments) are printed on separate slides by default. Meaning if you have a slide with three fragment steps, it will generate three separate slides where the fragments appear incrementally.
+
+If you prefer printing all fragments in their visible states on the same slide you can set the `pdfSeparateFragments` config option to false.
+
### Page size
+
Export dimensions are inferred from the configured [presentation size](#presentation-size). Slides that are too tall to fit within a single page will expand onto multiple pages. You can limit how many pages a slide may expand onto using the `pdfMaxPagesPerSlide` config option, for example `Reveal.configure({ pdfMaxPagesPerSlide: 1 })` ensures that no slide ever grows to more than one printed page.
### Print stylesheet
+
To enable the PDF print capability in your presentation, the special print stylesheet at [/css/print/pdf.css](https://github.com/hakimel/reveal.js/blob/master/css/print/pdf.css) must be loaded. The default index.html file handles this for you when `print-pdf` is included in the query string. If you're using a different HTML template, you can add this to your HEAD:
```html
@@ -940,6 +1021,7 @@ To enable the PDF print capability in your presentation, the special print style
```
### Instructions
+
1. Open your presentation with `print-pdf` included in the query string i.e. http://localhost:8000/?print-pdf. You can test this with [revealjs.com?print-pdf](http://revealjs.com?print-pdf).
* If you want to include [speaker notes](#speaker-notes) in your export, you can append `showNotes=true` to the query string: http://localhost:8000/?print-pdf&showNotes=true
1. Open the in-browser print dialog (CTRL/CMD+P).
@@ -953,6 +1035,7 @@ To enable the PDF print capability in your presentation, the special print style
Alternatively you can use the [decktape](https://github.com/astefanutti/decktape) project.
+
## Theming
The framework comes with a few different themes included:
@@ -978,11 +1061,11 @@ If you want to add a theme of your own see the instructions here: [/css/theme/RE
## Speaker Notes
-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.
+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.
A speaker timer starts as soon as the speaker view is opened. You can reset it to 00:00:00 at any time by simply clicking/tapping on it.
-Notes are defined by appending an ```<aside>``` element to a slide as seen below. You can add the ```data-markdown``` attribute to the aside element if you prefer writing notes using Markdown.
+Notes are defined by appending an `<aside>` element to a slide as seen below. You can add the `data-markdown` attribute to the aside element if you prefer writing notes using Markdown.
Alternatively you can add your notes in a `data-notes` attribute on the slide. Like `<section data-notes="Something important"></section>`.
@@ -993,7 +1076,7 @@ When used locally, this feature requires that reveal.js [runs from a local web s
<h2>Some Slide</h2>
<aside class="notes">
- 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).
+ 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).
</aside>
</section>
```
@@ -1014,9 +1097,9 @@ This will only display in the notes window.
#### Share and Print Speaker Notes
-Notes are only visible to the speaker inside of the speaker view. If you wish to share your notes with others you can initialize reveal.js with the `showNotes` config value set to `true`. Notes will appear along the bottom of the presentations.
+Notes are only visible to the speaker inside of the speaker view. If you wish to share your notes with others you can initialize reveal.js with the `showNotes` configuration value set to `true`. Notes will appear along the bottom of the presentations.
-When `showNotes` is enabled notes are also included when you [export to PDF](https://github.com/hakimel/reveal.js#pdf-export). By default, notes are printed in a semi-transparent box on top of the slide. If you'd rather print them on a separate page after the slide, set `showNotes: "separate-page"`.
+When `showNotes` is enabled notes are also included when you [export to PDF](https://github.com/hakimel/reveal.js#pdf-export). By default, notes are printed in a box on top of the slide. If you'd rather print them on a separate page, after the slide, set `showNotes: "separate-page"`.
#### Speaker notes clock and timers
@@ -1035,7 +1118,7 @@ In some cases it can be desirable to run notes on a separate device from the one
```javascript
Reveal.initialize({
- ...
+ // ...
dependencies: [
{ src: 'socket.io/socket.io.js', async: true },
@@ -1047,8 +1130,8 @@ Reveal.initialize({
Then:
1. Install [Node.js](http://nodejs.org/) (4.0.0 or later)
-2. Run ```npm install```
-3. Run ```node plugin/notes-server```
+2. Run `npm install`
+3. Run `node plugin/notes-server`
## Multiplexing
@@ -1061,19 +1144,19 @@ The multiplex plugin needs the following 3 things to operate:
2. Client presentations that follow the master
3. Socket.io server to broadcast events from the master to the clients
-More details:
-
#### Master presentation
+
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:
-1. ```npm install node-static```
-2. ```static```
+1. `npm install node-static`
+2. `static`
-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.
+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.
-You can then access your master presentation at ```http://localhost:1947```
+You can then access your master presentation at `http://localhost:1947`
Example configuration:
+
```javascript
Reveal.initialize({
// other options...
@@ -1099,9 +1182,11 @@ Reveal.initialize({
```
#### Client presentation
-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.
+
+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.
Example configuration:
+
```javascript
Reveal.initialize({
// other options...
@@ -1124,14 +1209,15 @@ Reveal.initialize({
```
#### Socket.io server
-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:
-1. ```npm install```
-2. ```node plugin/multiplex```
+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:
+
+1. `npm install`
+2. `node plugin/multiplex`
Or you can use the socket.io server at [https://reveal-js-multiplex-ccjbegmaii.now.sh/](https://reveal-js-multiplex-ccjbegmaii.now.sh/).
-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 [https://reveal-js-multiplex-ccjbegmaii.now.sh/](https://reveal-js-multiplex-ccjbegmaii.now.sh/), visit [https://reveal-js-multiplex-ccjbegmaii.now.sh/token](https://reveal-js-multiplex-ccjbegmaii.now.sh/token).
+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 [https://reveal-js-multiplex-ccjbegmaii.now.sh/](https://reveal-js-multiplex-ccjbegmaii.now.sh/), visit [https://reveal-js-multiplex-ccjbegmaii.now.sh/token](https://reveal-js-multiplex-ccjbegmaii.now.sh/token).
You are very welcome to point your presentations at the Socket.io server running at [https://reveal-js-multiplex-ccjbegmaii.now.sh/](https://reveal-js-multiplex-ccjbegmaii.now.sh/), but availability and stability are not guaranteed.
@@ -1142,6 +1228,7 @@ For anything mission critical I recommend you run your own server. The easiest w
The socket.io server can play the role of static file server for your client presentation, as in the example at [https://reveal-js-multiplex-ccjbegmaii.now.sh/](https://reveal-js-multiplex-ccjbegmaii.now.sh/). (Open [https://reveal-js-multiplex-ccjbegmaii.now.sh/](https://reveal-js-multiplex-ccjbegmaii.now.sh/) in two browsers. Navigate through the slides on one, and the other will update to match.)
Example configuration:
+
```javascript
Reveal.initialize({
// other options...
@@ -1165,6 +1252,7 @@ Reveal.initialize({
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 [https://reveal-js-multiplex-ccjbegmaii.now.sh/](https://reveal-js-multiplex-ccjbegmaii.now.sh/) 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. ;)
Example configuration:
+
```javascript
Reveal.initialize({
// other options...
@@ -1187,17 +1275,17 @@ Reveal.initialize({
});
```
+
## MathJax
If you want to display math equations in your presentation you can easily do so by including this plugin. The plugin is a very thin wrapper around the [MathJax](http://www.mathjax.org/) library. To use it you'll need to include it as a reveal.js dependency, [find our more about dependencies here](#dependencies).
-The plugin defaults to using [LaTeX](http://en.wikipedia.org/wiki/LaTeX) but that can be adjusted through the ```math``` configuration object. Note that MathJax is loaded from a remote server. If you want to use it offline you'll need to download a copy of the library and adjust the ```mathjax``` configuration value.
+The plugin defaults to using [LaTeX](http://en.wikipedia.org/wiki/LaTeX) but that can be adjusted through the `math` configuration object. Note that MathJax is loaded from a remote server. If you want to use it offline you'll need to download a copy of the library and adjust the `mathjax` configuration value.
-Below is an example of how the plugin can be configured. If you don't intend to change these values you do not need to include the ```math``` config object at all.
+Below is an example of how the plugin can be configured. If you don't intend to change these values you do not need to include the `math` config object at all.
```js
Reveal.initialize({
-
// other options ...
math: {
@@ -1208,68 +1296,14 @@ Reveal.initialize({
dependencies: [
{ src: 'plugin/math/math.js', async: true }
]
-
});
```
Read MathJax's documentation if you need [HTTPS delivery](http://docs.mathjax.org/en/latest/start.html#secure-access-to-the-cdn) or serving of [specific versions](http://docs.mathjax.org/en/latest/configuration.html#loading-mathjax-from-the-cdn) for stability.
-## Installation
-
-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.
-
-### Basic setup
-
-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.
-
-1. Download the latest version of reveal.js from <https://github.com/hakimel/reveal.js/releases>
-
-2. Unzip and replace the example contents in index.html with your own
-
-3. Open index.html in a browser to view it
-
-
-### Full setup
-
-Some reveal.js features, like external Markdown and speaker notes, 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.
-
-1. Install [Node.js](http://nodejs.org/) (4.0.0 or later)
-
-1. Clone the reveal.js repository
- ```sh
- $ git clone https://github.com/hakimel/reveal.js.git
- ```
-
-1. Navigate to the reveal.js folder
- ```sh
- $ cd reveal.js
- ```
-
-1. Install dependencies
- ```sh
- $ npm install
- ```
-
-1. Serve the presentation and monitor source files for changes
- ```sh
- $ npm start
- ```
-
-1. Open <http://localhost:8000> to view your presentation
-
- You can change the port by using `npm start -- --port=8001`.
-
-
-### Folder Structure
-- **css/** Core styles without which the project does not function
-- **js/** Like above but for JavaScript
-- **plugin/** Components that have been developed as extensions to reveal.js
-- **lib/** All other third party assets (JavaScript, CSS, fonts)
-
-
## License
MIT licensed
-Copyright (C) 2017 Hakim El Hattab, http://hakim.se
+Copyright (C) 2018 Hakim El Hattab, http://hakim.se
diff --git a/bower.json b/bower.json
index 178f330..8c379d1 100644
--- a/bower.json
+++ b/bower.json
@@ -1,6 +1,6 @@
{
"name": "reveal.js",
- "version": "3.6.0",
+ "version": "3.7.0",
"main": [
"js/reveal.js",
"css/reveal.css"
diff --git a/css/print/pdf.css b/css/print/pdf.css
index aa1f7fa..752d955 100644
--- a/css/print/pdf.css
+++ b/css/print/pdf.css
@@ -72,15 +72,8 @@ ul, ol, div, p {
overflow: visible;
display: block;
- -webkit-perspective: none;
- -moz-perspective: none;
- -ms-perspective: none;
- perspective: none;
-
- -webkit-perspective-origin: 50% 50%; /* there isn't a none/auto value but 50-50 is the default */
- -moz-perspective-origin: 50% 50%;
- -ms-perspective-origin: 50% 50%;
- perspective-origin: 50% 50%;
+ perspective: none;
+ perspective-origin: 50% 50%;
}
.reveal .slides .pdf-page {
@@ -103,15 +96,8 @@ ul, ol, div, p {
opacity: 1 !important;
- -webkit-transform-style: flat !important;
- -moz-transform-style: flat !important;
- -ms-transform-style: flat !important;
- transform-style: flat !important;
-
- -webkit-transform: none !important;
- -moz-transform: none !important;
- -ms-transform: none !important;
- transform: none !important;
+ transform-style: flat !important;
+ transform: none !important;
}
.reveal section.stack {
diff --git a/css/reveal.css b/css/reveal.css
index 3392753..f4f8b88 100644
--- a/css/reveal.css
+++ b/css/reveal.css
@@ -3,7 +3,7 @@
* http://revealjs.com
* MIT licensed
*
- * Copyright (C) 2017 Hakim El Hattab, http://hakim.se
+ * Copyright (C) 2018 Hakim El Hattab, http://hakim.se
*/
/*********************************************
* RESET STYLES
@@ -127,13 +127,25 @@ body {
-webkit-transform: translate(0, 0);
transform: translate(0, 0); }
+.reveal .slides section .fragment.fade-in-then-out,
.reveal .slides section .fragment.current-visible {
opacity: 0;
visibility: hidden; }
+ .reveal .slides section .fragment.fade-in-then-out.current-fragment,
.reveal .slides section .fragment.current-visible.current-fragment {
opacity: 1;
visibility: inherit; }
+.reveal .slides section .fragment.fade-in-then-semi-out {
+ opacity: 0;
+ visibility: hidden; }
+ .reveal .slides section .fragment.fade-in-then-semi-out.visible {
+ opacity: 0.5;
+ visibility: inherit; }
+ .reveal .slides section .fragment.fade-in-then-semi-out.current-fragment {
+ opacity: 1;
+ visibility: inherit; }
+
.reveal .slides section .fragment.highlight-red,
.reveal .slides section .fragment.highlight-current-red,
.reveal .slides section .fragment.highlight-green,
@@ -448,7 +460,7 @@ body {
* SLIDE NUMBER
*********************************************/
.reveal .slide-number {
- position: fixed;
+ position: absolute;
display: block;
right: 8px;
bottom: 8px;
@@ -460,6 +472,9 @@ body {
background-color: rgba(0, 0, 0, 0.4);
padding: 5px; }
+.reveal .slide-number a {
+ color: currentColor; }
+
.reveal .slide-number-delimiter {
margin: 0 3px; }
@@ -528,7 +543,8 @@ body {
.reveal .slides > section.stack {
padding-top: 0;
- padding-bottom: 0; }
+ padding-bottom: 0;
+ pointer-events: none; }
.reveal .slides > section.present,
.reveal .slides > section > section.present {
@@ -948,6 +964,21 @@ body {
z-index: 100;
transition: all 1s ease; }
+.reveal .pause-overlay .resume-button {
+ position: absolute;
+ bottom: 20px;
+ right: 20px;
+ color: #ccc;
+ border-radius: 2px;
+ padding: 6px 14px;
+ border: 2px solid #ccc;
+ font-size: 16px;
+ background: transparent;
+ cursor: pointer; }
+ .reveal .pause-overlay .resume-button:hover {
+ color: #fff;
+ border-color: #fff; }
+
.reveal.paused .pause-overlay {
visibility: visible;
opacity: 1; }
@@ -1011,10 +1042,15 @@ body {
visibility: hidden;
overflow: hidden;
background-color: transparent;
+ transition: all 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); }
+
+.reveal .slide-background-content {
+ position: absolute;
+ width: 100%;
+ height: 100%;
background-position: 50% 50%;
background-repeat: no-repeat;
- background-size: cover;
- transition: all 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); }
+ background-size: cover; }
.reveal .slide-background.stack {
display: block; }
@@ -1258,9 +1294,9 @@ body {
transition-duration: 1200ms; }
/*********************************************
- * LINK PREVIEW OVERLAY
+ * OVERLAY FOR LINK PREVIEWS AND HELP
*********************************************/
-.reveal .overlay {
+.reveal > .overlay {
position: absolute;
top: 0;
left: 0;
@@ -1272,11 +1308,11 @@ body {
visibility: hidden;
transition: all 0.3s ease; }
-.reveal .overlay.visible {
+.reveal > .overlay.visible {
opacity: 1;
visibility: visible; }
-.reveal .overlay .spinner {
+.reveal > .overlay .spinner {
position: absolute;
display: block;
top: 50%;
@@ -1290,7 +1326,7 @@ body {
opacity: 0.6;
transition: all 0.3s ease; }
-.reveal .overlay header {
+.reveal > .overlay header {
position: absolute;
left: 0;
top: 0;
@@ -1299,7 +1335,7 @@ body {
z-index: 2;
border-bottom: 1px solid #222; }
-.reveal .overlay header a {
+.reveal > .overlay header a {
display: inline-block;
width: 40px;
height: 40px;
@@ -1309,10 +1345,10 @@ body {
opacity: 0.6;
box-sizing: border-box; }
-.reveal .overlay header a:hover {
+.reveal > .overlay header a:hover {
opacity: 1; }
-.reveal .overlay header a .icon {
+.reveal > .overlay header a .icon {
display: inline-block;
width: 20px;
height: 20px;
@@ -1320,13 +1356,13 @@ body {
background-size: 100%;
background-repeat: no-repeat; }
-.reveal .overlay header a.close .icon {
+.reveal > .overlay header a.close .icon {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABkklEQVRYR8WX4VHDMAxG6wnoJrABZQPYBCaBTWAD2g1gE5gg6OOsXuxIlr40d81dfrSJ9V4c2VLK7spHuTJ/5wpM07QXuXc5X0opX2tEJcadjHuV80li/FgxTIEK/5QBCICBD6xEhSMGHgQPgBgLiYVAB1dpSqKDawxTohFw4JSEA3clzgIBPCURwE2JucBR7rhPJJv5OpJwDX+SfDjgx1wACQeJG1aChP9K/IMmdZ8DtESV1WyP3Bt4MwM6sj4NMxMYiqUWHQu4KYA/SYkIjOsm3BXYWMKFDwU2khjCQ4ELJUJ4SmClRArOCmSXGuKma0fYD5CbzHxFpCSGAhfAVSSUGDUk2BWZaff2g6GE15BsBQ9nwmpIGDiyHQddwNTMKkbZaf9fajXQca1EX44puJZUsnY0ObGmITE3GVLCbEhQUjGVt146j6oasWN+49Vph2w1pZ5EansNZqKBm1txbU57iRRcZ86RWMDdWtBJUHBHwoQPi1GV+JCbntmvok7iTX4/Up9mgyTc/FJYDTcndgH/AA5A/CHsyEkVAAAAAElFTkSuQmCC); }
-.reveal .overlay header a.external .icon {
+.reveal > .overlay header a.external .icon {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAcElEQVRYR+2WSQoAIQwEzf8f7XiOMkUQxUPlGkM3hVmiQfQR9GYnH1SsAQlI4DiBqkCMoNb9y2e90IAEJPAcgdznU9+engMaeJ7Azh5Y1U67gAho4DqBqmB1buAf0MB1AlVBek83ZPkmJMGc1wAR+AAqod/B97TRpQAAAABJRU5ErkJggg==); }
-.reveal .overlay .viewport {
+.reveal > .overlay .viewport {
position: absolute;
display: -webkit-box;
display: -ms-flexbox;
@@ -1336,7 +1372,7 @@ body {
bottom: 0;
left: 0; }
-.reveal .overlay.overlay-preview .viewport iframe {
+.reveal > .overlay.overlay-preview .viewport iframe {
width: 100%;
height: 100%;
max-width: 100%;
@@ -1346,11 +1382,11 @@ body {
visibility: hidden;
transition: all 0.3s ease; }
-.reveal .overlay.overlay-preview.loaded .viewport iframe {
+.reveal > .overlay.overlay-preview.loaded .viewport iframe {
opacity: 1;
visibility: visible; }
-.reveal .overlay.overlay-preview.loaded .viewport-inner {
+.reveal > .overlay.overlay-preview.loaded .viewport-inner {
position: absolute;
z-index: -1;
left: 0;
@@ -1359,46 +1395,46 @@ body {
text-align: center;
letter-spacing: normal; }
-.reveal .overlay.overlay-preview .x-frame-error {
+.reveal > .overlay.overlay-preview .x-frame-error {
opacity: 0;
transition: opacity 0.3s ease 0.3s; }
-.reveal .overlay.overlay-preview.loaded .x-frame-error {
+.reveal > .overlay.overlay-preview.loaded .x-frame-error {
opacity: 1; }
-.reveal .overlay.overlay-preview.loaded .spinner {
+.reveal > .overlay.overlay-preview.loaded .spinner {
opacity: 0;
visibility: hidden;
-webkit-transform: scale(0.2);
transform: scale(0.2); }
-.reveal .overlay.overlay-help .viewport {
+.reveal > .overlay.overlay-help .viewport {
overflow: auto;
color: #fff; }
-.reveal .overlay.overlay-help .viewport .viewport-inner {
+.reveal > .overlay.overlay-help .viewport .viewport-inner {
width: 600px;
margin: auto;
padding: 20px 20px 80px 20px;
text-align: center;
letter-spacing: normal; }
-.reveal .overlay.overlay-help .viewport .viewport-inner .title {
+.reveal > .overlay.overlay-help .viewport .viewport-inner .title {
font-size: 20px; }
-.reveal .overlay.overlay-help .viewport .viewport-inner table {
+.reveal > .overlay.overlay-help .viewport .viewport-inner table {
border: 1px solid #fff;
border-collapse: collapse;
font-size: 16px; }
-.reveal .overlay.overlay-help .viewport .viewport-inner table th,
-.reveal .overlay.overlay-help .viewport .viewport-inner table td {
+.reveal > .overlay.overlay-help .viewport .viewport-inner table th,
+.reveal > .overlay.overlay-help .viewport .viewport-inner table td {
width: 200px;
padding: 14px;
border: 1px solid #fff;
vertical-align: middle; }
-.reveal .overlay.overlay-help .viewport .viewport-inner table th {
+.reveal > .overlay.overlay-help .viewport .viewport-inner table th {
padding-top: 20px;
padding-bottom: 20px; }
diff --git a/css/reveal.scss b/css/reveal.scss
index 1a87624..c82a297 100644
--- a/css/reveal.scss
+++ b/css/reveal.scss
@@ -3,7 +3,7 @@
* http://revealjs.com
* MIT licensed
*
- * Copyright (C) 2017 Hakim El Hattab, http://hakim.se
+ * Copyright (C) 2018 Hakim El Hattab, http://hakim.se
*/
@@ -160,6 +160,7 @@ body {
}
}
+.reveal .slides section .fragment.fade-in-then-out,
.reveal .slides section .fragment.current-visible {
opacity: 0;
visibility: hidden;
@@ -170,6 +171,21 @@ body {
}
}
+.reveal .slides section .fragment.fade-in-then-semi-out {
+ opacity: 0;
+ visibility: hidden;
+
+ &.visible {
+ opacity: 0.5;
+ visibility: inherit;
+ }
+
+ &.current-fragment {
+ opacity: 1;
+ visibility: inherit;
+ }
+}
+
.reveal .slides section .fragment.highlight-red,
.reveal .slides section .fragment.highlight-current-red,
.reveal .slides section .fragment.highlight-green,
@@ -540,7 +556,7 @@ $controlsArrowAngleActive: 36deg;
*********************************************/
.reveal .slide-number {
- position: fixed;
+ position: absolute;
display: block;
right: 8px;
bottom: 8px;
@@ -553,6 +569,10 @@ $controlsArrowAngleActive: 36deg;
padding: 5px;
}
+.reveal .slide-number a {
+ color: currentColor;
+}
+
.reveal .slide-number-delimiter {
margin: 0 3px;
}
@@ -636,6 +656,7 @@ $controlsArrowAngleActive: 36deg;
.reveal .slides>section.stack {
padding-top: 0;
padding-bottom: 0;
+ pointer-events: none;
}
.reveal .slides>section.present,
@@ -1013,6 +1034,25 @@ $controlsArrowAngleActive: 36deg;
z-index: 100;
transition: all 1s ease;
}
+
+.reveal .pause-overlay .resume-button {
+ position: absolute;
+ bottom: 20px;
+ right: 20px;
+ color: #ccc;
+ border-radius: 2px;
+ padding: 6px 14px;
+ border: 2px solid #ccc;
+ font-size: 16px;
+ background: transparent;
+ cursor: pointer;
+
+ &:hover {
+ color: #fff;
+ border-color: #fff;
+ }
+}
+
.reveal.paused .pause-overlay {
visibility: visible;
opacity: 1;
@@ -1086,11 +1126,18 @@ $controlsArrowAngleActive: 36deg;
overflow: hidden;
background-color: rgba( 0, 0, 0, 0 );
+
+ transition: all 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985);
+ }
+
+ .reveal .slide-background-content {
+ position: absolute;
+ width: 100%;
+ height: 100%;
+
background-position: 50% 50%;
background-repeat: no-repeat;
background-size: cover;
-
- transition: all 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985);
}
.reveal .slide-background.stack {
@@ -1369,10 +1416,10 @@ $controlsArrowAngleActive: 36deg;
/*********************************************
- * LINK PREVIEW OVERLAY
+ * OVERLAY FOR LINK PREVIEWS AND HELP
*********************************************/
-.reveal .overlay {
+.reveal > .overlay {
position: absolute;
top: 0;
left: 0;
@@ -1384,12 +1431,12 @@ $controlsArrowAngleActive: 36deg;
visibility: hidden;
transition: all 0.3s ease;
}
- .reveal .overlay.visible {
+ .reveal > .overlay.visible {
opacity: 1;
visibility: visible;
}
- .reveal .overlay .spinner {
+ .reveal > .overlay .spinner {
position: absolute;
display: block;
top: 50%;
@@ -1405,7 +1452,7 @@ $controlsArrowAngleActive: 36deg;
transition: all 0.3s ease;
}
- .reveal .overlay header {
+ .reveal > .overlay header {
position: absolute;
left: 0;
top: 0;
@@ -1414,7 +1461,7 @@ $controlsArrowAngleActive: 36deg;
z-index: 2;
border-bottom: 1px solid #222;
}
- .reveal .overlay header a {
+ .reveal > .overlay header a {
display: inline-block;
width: 40px;
height: 40px;
@@ -1425,10 +1472,10 @@ $controlsArrowAngleActive: 36deg;
box-sizing: border-box;
}
- .reveal .overlay header a:hover {
+ .reveal > .overlay header a:hover {
opacity: 1;
}
- .reveal .overlay header a .icon {
+ .reveal > .overlay header a .icon {
display: inline-block;
width: 20px;
height: 20px;
@@ -1437,14 +1484,14 @@ $controlsArrowAngleActive: 36deg;
background-size: 100%;
background-repeat: no-repeat;
}
- .reveal .overlay header a.close .icon {
+ .reveal > .overlay header a.close .icon {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABkklEQVRYR8WX4VHDMAxG6wnoJrABZQPYBCaBTWAD2g1gE5gg6OOsXuxIlr40d81dfrSJ9V4c2VLK7spHuTJ/5wpM07QXuXc5X0opX2tEJcadjHuV80li/FgxTIEK/5QBCICBD6xEhSMGHgQPgBgLiYVAB1dpSqKDawxTohFw4JSEA3clzgIBPCURwE2JucBR7rhPJJv5OpJwDX+SfDjgx1wACQeJG1aChP9K/IMmdZ8DtESV1WyP3Bt4MwM6sj4NMxMYiqUWHQu4KYA/SYkIjOsm3BXYWMKFDwU2khjCQ4ELJUJ4SmClRArOCmSXGuKma0fYD5CbzHxFpCSGAhfAVSSUGDUk2BWZaff2g6GE15BsBQ9nwmpIGDiyHQddwNTMKkbZaf9fajXQca1EX44puJZUsnY0ObGmITE3GVLCbEhQUjGVt146j6oasWN+49Vph2w1pZ5EansNZqKBm1txbU57iRRcZ86RWMDdWtBJUHBHwoQPi1GV+JCbntmvok7iTX4/Up9mgyTc/FJYDTcndgH/AA5A/CHsyEkVAAAAAElFTkSuQmCC);
}
- .reveal .overlay header a.external .icon {
+ .reveal > .overlay header a.external .icon {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAcElEQVRYR+2WSQoAIQwEzf8f7XiOMkUQxUPlGkM3hVmiQfQR9GYnH1SsAQlI4DiBqkCMoNb9y2e90IAEJPAcgdznU9+engMaeJ7Azh5Y1U67gAho4DqBqmB1buAf0MB1AlVBek83ZPkmJMGc1wAR+AAqod/B97TRpQAAAABJRU5ErkJggg==);
}
- .reveal .overlay .viewport {
+ .reveal > .overlay .viewport {
position: absolute;
display: flex;
top: 40px;
@@ -1453,7 +1500,7 @@ $controlsArrowAngleActive: 36deg;
left: 0;
}
- .reveal .overlay.overlay-preview .viewport iframe {
+ .reveal > .overlay.overlay-preview .viewport iframe {
width: 100%;
height: 100%;
max-width: 100%;
@@ -1465,12 +1512,12 @@ $controlsArrowAngleActive: 36deg;
transition: all 0.3s ease;
}
- .reveal .overlay.overlay-preview.loaded .viewport iframe {
+ .reveal > .overlay.overlay-preview.loaded .viewport iframe {
opacity: 1;
visibility: visible;
}
- .reveal .overlay.overlay-preview.loaded .viewport-inner {
+ .reveal > .overlay.overlay-preview.loaded .viewport-inner {
position: absolute;
z-index: -1;
left: 0;
@@ -1479,26 +1526,26 @@ $controlsArrowAngleActive: 36deg;
text-align: center;
letter-spacing: normal;
}
- .reveal .overlay.overlay-preview .x-frame-error {
+ .reveal > .overlay.overlay-preview .x-frame-error {
opacity: 0;
transition: opacity 0.3s ease 0.3s;
}
- .reveal .overlay.overlay-preview.loaded .x-frame-error {
+ .reveal > .overlay.overlay-preview.loaded .x-frame-error {
opacity: 1;
}
- .reveal .overlay.overlay-preview.loaded .spinner {
+ .reveal > .overlay.overlay-preview.loaded .spinner {
opacity: 0;
visibility: hidden;
transform: scale(0.2);
}
- .reveal .overlay.overlay-help .viewport {
+ .reveal > .overlay.overlay-help .viewport {
overflow: auto;
color: #fff;
}
- .reveal .overlay.overlay-help .viewport .viewport-inner {
+ .reveal > .overlay.overlay-help .viewport .viewport-inner {
width: 600px;
margin: auto;
padding: 20px 20px 80px 20px;
@@ -1506,25 +1553,25 @@ $controlsArrowAngleActive: 36deg;
letter-spacing: normal;
}
- .reveal .overlay.overlay-help .viewport .viewport-inner .title {
+ .reveal > .overlay.overlay-help .viewport .viewport-inner .title {
font-size: 20px;
}
- .reveal .overlay.overlay-help .viewport .viewport-inner table {
+ .reveal > .overlay.overlay-help .viewport .viewport-inner table {
border: 1px solid #fff;
border-collapse: collapse;
font-size: 16px;
}
- .reveal .overlay.overlay-help .viewport .viewport-inner table th,
- .reveal .overlay.overlay-help .viewport .viewport-inner table td {
+ .reveal > .overlay.overlay-help .viewport .viewport-inner table th,
+ .reveal > .overlay.overlay-help .viewport .viewport-inner table td {
width: 200px;
padding: 14px;
border: 1px solid #fff;
vertical-align: middle;
}
- .reveal .overlay.overlay-help .viewport .viewport-inner table th {
+ .reveal > .overlay.overlay-help .viewport .viewport-inner table th {
padding-top: 20px;
padding-bottom: 20px;
}
diff --git a/css/theme/README.md b/css/theme/README.md
index 1bca121..8ae164b 100644
--- a/css/theme/README.md
+++ b/css/theme/README.md
@@ -4,7 +4,7 @@ Themes are written using Sass to keep things modular and reduce the need for rep
## Creating a Theme
-To create your own theme, start by duplicating a ```.scss``` file in [/css/theme/source](https://github.com/hakimel/reveal.js/blob/master/css/theme/source). It will be automatically compiled by Grunt from Sass to CSS (see the [Gruntfile](https://github.com/hakimel/reveal.js/blob/master/Gruntfile.js)) when you run `grunt css-themes`.
+To create your own theme, start by duplicating a ```.scss``` file in [/css/theme/source](https://github.com/hakimel/reveal.js/blob/master/css/theme/source). It will be automatically compiled by Grunt from Sass to CSS (see the [Gruntfile](https://github.com/hakimel/reveal.js/blob/master/Gruntfile.js)) when you run `npm run build -- css-themes`.
Each theme file does four things in the following order:
diff --git a/css/theme/beige.css b/css/theme/beige.css
index 1c4adf5..fb5f137 100644
--- a/css/theme/beige.css
+++ b/css/theme/beige.css
@@ -193,10 +193,12 @@ body {
border-bottom: none; }
.reveal sup {
- vertical-align: super; }
+ vertical-align: super;
+ font-size: smaller; }
.reveal sub {
- vertical-align: sub; }
+ vertical-align: sub;
+ font-size: smaller; }
.reveal small {
display: inline-block;
@@ -266,3 +268,10 @@ body {
-webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
-moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); }
+
+/*********************************************
+ * PRINT BACKGROUND
+ *********************************************/
+@media print {
+ .backgrounds {
+ background-color: #f7f3de; } }
diff --git a/css/theme/black.css b/css/theme/black.css
index 5819669..dec6385 100644
--- a/css/theme/black.css
+++ b/css/theme/black.css
@@ -189,10 +189,12 @@ body {
border-bottom: none; }
.reveal sup {
- vertical-align: super; }
+ vertical-align: super;
+ font-size: smaller; }
.reveal sub {
- vertical-align: sub; }
+ vertical-align: sub;
+ font-size: smaller; }
.reveal small {
display: inline-block;
@@ -262,3 +264,10 @@ body {
-webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
-moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); }
+
+/*********************************************
+ * PRINT BACKGROUND
+ *********************************************/
+@media print {
+ .backgrounds {
+ background-color: #222; } }
diff --git a/css/theme/blood.css b/css/theme/blood.css
index f7335d9..15e6c20 100644
--- a/css/theme/blood.css
+++ b/css/theme/blood.css
@@ -192,10 +192,12 @@ body {
border-bottom: none; }
.reveal sup {
- vertical-align: super; }
+ vertical-align: super;
+ font-size: smaller; }
.reveal sub {
- vertical-align: sub; }
+ vertical-align: sub;
+ font-size: smaller; }
.reveal small {
display: inline-block;
@@ -266,6 +268,13 @@ body {
-moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); }
+/*********************************************
+ * PRINT BACKGROUND
+ *********************************************/
+@media print {
+ .backgrounds {
+ background-color: #222; } }
+
.reveal p {
font-weight: 300;
text-shadow: 1px 1px #222; }
diff --git a/css/theme/league.css b/css/theme/league.css
index 1470d33..9dfa2ce 100644
--- a/css/theme/league.css
+++ b/css/theme/league.css
@@ -195,10 +195,12 @@ body {
border-bottom: none; }
.reveal sup {
- vertical-align: super; }
+ vertical-align: super;
+ font-size: smaller; }
.reveal sub {
- vertical-align: sub; }
+ vertical-align: sub;
+ font-size: smaller; }
.reveal small {
display: inline-block;
@@ -268,3 +270,10 @@ body {
-webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
-moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); }
+
+/*********************************************
+ * PRINT BACKGROUND
+ *********************************************/
+@media print {
+ .backgrounds {
+ background-color: #2b2b2b; } }
diff --git a/css/theme/moon.css b/css/theme/moon.css
index 066876b..52b3f67 100644
--- a/css/theme/moon.css
+++ b/css/theme/moon.css
@@ -193,10 +193,12 @@ body {
border-bottom: none; }
.reveal sup {
- vertical-align: super; }
+ vertical-align: super;
+ font-size: smaller; }
.reveal sub {
- vertical-align: sub; }
+ vertical-align: sub;
+ font-size: smaller; }
.reveal small {
display: inline-block;
@@ -266,3 +268,10 @@ body {
-webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
-moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); }
+
+/*********************************************
+ * PRINT BACKGROUND
+ *********************************************/
+@media print {
+ .backgrounds {
+ background-color: #002b36; } }
diff --git a/css/theme/night.css b/css/theme/night.css
index 7f24d16..51a3dd3 100644
--- a/css/theme/night.css
+++ b/css/theme/night.css
@@ -187,10 +187,12 @@ body {
border-bottom: none; }
.reveal sup {
- vertical-align: super; }
+ vertical-align: super;
+ font-size: smaller; }
.reveal sub {
- vertical-align: sub; }
+ vertical-align: sub;
+ font-size: smaller; }
.reveal small {
display: inline-block;
@@ -260,3 +262,10 @@ body {
-webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
-moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); }
+
+/*********************************************
+ * PRINT BACKGROUND
+ *********************************************/
+@media print {
+ .backgrounds {
+ background-color: #111; } }
diff --git a/css/theme/serif.css b/css/theme/serif.css
index 03661fc..ea01066 100644
--- a/css/theme/serif.css
+++ b/css/theme/serif.css
@@ -189,10 +189,12 @@ body {
border-bottom: none; }
.reveal sup {
- vertical-align: super; }
+ vertical-align: super;
+ font-size: smaller; }
.reveal sub {
- vertical-align: sub; }
+ vertical-align: sub;
+ font-size: smaller; }
.reveal small {
display: inline-block;
@@ -262,3 +264,10 @@ body {
-webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
-moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); }
+
+/*********************************************
+ * PRINT BACKGROUND
+ *********************************************/
+@media print {
+ .backgrounds {
+ background-color: #F0F1EB; } }
diff --git a/css/theme/simple.css b/css/theme/simple.css
index 21777fc..8432d84 100644
--- a/css/theme/simple.css
+++ b/css/theme/simple.css
@@ -192,10 +192,12 @@ body {
border-bottom: none; }
.reveal sup {
- vertical-align: super; }
+ vertical-align: super;
+ font-size: smaller; }
.reveal sub {
- vertical-align: sub; }
+ vertical-align: sub;
+ font-size: smaller; }
.reveal small {
display: inline-block;
@@ -265,3 +267,10 @@ body {
-webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
-moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); }
+
+/*********************************************
+ * PRINT BACKGROUND
+ *********************************************/
+@media print {
+ .backgrounds {
+ background-color: #fff; } }
diff --git a/css/theme/sky.css b/css/theme/sky.css
index 951129a..6f60a1d 100644
--- a/css/theme/sky.css
+++ b/css/theme/sky.css
@@ -196,10 +196,12 @@ body {
border-bottom: none; }
.reveal sup {
- vertical-align: super; }
+ vertical-align: super;
+ font-size: smaller; }
.reveal sub {
- vertical-align: sub; }
+ vertical-align: sub;
+ font-size: smaller; }
.reveal small {
display: inline-block;
@@ -269,3 +271,10 @@ body {
-webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
-moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); }
+
+/*********************************************
+ * PRINT BACKGROUND
+ *********************************************/
+@media print {
+ .backgrounds {
+ background-color: #f7fbfc; } }
diff --git a/css/theme/solarized.css b/css/theme/solarized.css
index 006606f..fe81f09 100644
--- a/css/theme/solarized.css
+++ b/css/theme/solarized.css
@@ -193,10 +193,12 @@ body {
border-bottom: none; }
.reveal sup {
- vertical-align: super; }
+ vertical-align: super;
+ font-size: smaller; }
.reveal sub {
- vertical-align: sub; }
+ vertical-align: sub;
+ font-size: smaller; }
.reveal small {
display: inline-block;
@@ -266,3 +268,10 @@ body {
-webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
-moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); }
+
+/*********************************************
+ * PRINT BACKGROUND
+ *********************************************/
+@media print {
+ .backgrounds {
+ background-color: #fdf6e3; } }
diff --git a/css/theme/template/theme.scss b/css/theme/template/theme.scss
index e06fe7a..a8f142d 100644
--- a/css/theme/template/theme.scss
+++ b/css/theme/template/theme.scss
@@ -217,9 +217,11 @@ body {
.reveal sup {
vertical-align: super;
+ font-size: smaller;
}
.reveal sub {
vertical-align: sub;
+ font-size: smaller;
}
.reveal small {
@@ -310,7 +312,14 @@ body {
.reveal .progress span {
-webkit-transition: width 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985);
-moz-transition: width 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985);
- transition: width 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985);
+ transition: width 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985);
}
-
+/*********************************************
+ * PRINT BACKGROUND
+ *********************************************/
+ @media print {
+ .backgrounds {
+ background-color: $backgroundColor;
+ }
+}
diff --git a/css/theme/white.css b/css/theme/white.css
index 9a15f22..27e44a1 100644
--- a/css/theme/white.css
+++ b/css/theme/white.css
@@ -189,10 +189,12 @@ body {
border-bottom: none; }
.reveal sup {
- vertical-align: super; }
+ vertical-align: super;
+ font-size: smaller; }
.reveal sub {
- vertical-align: sub; }
+ vertical-align: sub;
+ font-size: smaller; }
.reveal small {
display: inline-block;
@@ -262,3 +264,10 @@ body {
-webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
-moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); }
+
+/*********************************************
+ * PRINT BACKGROUND
+ *********************************************/
+@media print {
+ .backgrounds {
+ background-color: #fff; } }
diff --git a/demo.html b/demo.html
index 505bb18..8aa4aba 100644
--- a/demo.html
+++ b/demo.html
@@ -139,8 +139,14 @@
<p class="fragment grow">grow</p>
<p class="fragment shrink">shrink</p>
<p class="fragment fade-out">fade-out</p>
- <p class="fragment fade-up">fade-up (also down, left and right!)</p>
- <p class="fragment current-visible">current-visible</p>
+ <p>
+ <span style="display: inline-block;" class="fragment fade-right">fade-right, </span>
+ <span style="display: inline-block;" class="fragment fade-up">up, </span>
+ <span style="display: inline-block;" class="fragment fade-down">down, </span>
+ <span style="display: inline-block;" class="fragment fade-left">left</span>
+ </p>
+ <p class="fragment fade-in-then-out">fade-in-then-out</p>
+ <p class="fragment fade-in-then-semi-out">fade-in-then-semi-out</p>
<p>Highlight <span class="fragment highlight-red">red</span> <span class="fragment highlight-blue">blue</span> <span class="fragment highlight-green">green</span></p>
</section>
</section>
diff --git a/js/reveal.js b/js/reveal.js
index 12d67bf..4946df5 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -3,7 +3,7 @@
* http://revealjs.com
* MIT licensed
*
- * Copyright (C) 2017 Hakim El Hattab, http://hakim.se
+ * Copyright (C) 2018 Hakim El Hattab, http://hakim.se
*/
(function( root, factory ) {
if( typeof define === 'function' && define.amd ) {
@@ -26,7 +26,7 @@
var Reveal;
// The reveal.js version
- var VERSION = '3.6.0';
+ var VERSION = '3.7.0';
var SLIDES_SELECTOR = '.slides section',
HORIZONTAL_SLIDES_SELECTOR = '.slides>section',
@@ -69,6 +69,10 @@
// Display the page number of the current slide
slideNumber: false,
+ // Use 1 based indexing for # links to match slide number (default is zero
+ // based)
+ hashOneBasedIndex: false,
+
// Determine which displays to show the slide number on
showSlideNumber: 'all',
@@ -84,6 +88,10 @@
// Enable the slide overview mode
overview: true,
+ // Disables the default reveal.js slide layout so that you can use
+ // custom CSS layout
+ disableLayout: false,
+
// Vertical centering of slides
center: true,
@@ -154,6 +162,8 @@
hideAddressBar: true,
// Opens links in an iframe preview overlay
+ // Add `data-preview-link` and `data-preview-link="false"` to customise each link
+ // individually
previewLinks: false,
// Exposes the reveal.js API through window.postMessage
@@ -180,6 +190,12 @@
// Parallax background size
parallaxBackgroundSize: '', // CSS syntax, e.g. "3000px 2000px"
+ // Parallax background repeat
+ parallaxBackgroundRepeat: '', // repeat/repeat-x/repeat-y/no-repeat/initial/inherit
+
+ // Parallax background position
+ parallaxBackgroundPosition: '', // CSS syntax, e.g. "top left"
+
// Amount of pixels to move the parallax background per slide step
parallaxBackgroundHorizontal: null,
parallaxBackgroundVertical: null,
@@ -188,6 +204,9 @@
// to PDF, unlimited by default
pdfMaxPagesPerSlide: Number.POSITIVE_INFINITY,
+ // Prints each fragment on a separate slide
+ pdfSeparateFragments: true,
+
// Offset used to reduce the height of content within exported PDF pages.
// This exists to account for environment differences based on how you
// print to PDF. CLI printing options, like phantomjs and wkpdf, can end
@@ -299,7 +318,7 @@
'F': 'Fullscreen',
'ESC, O': 'Slide overview'
},
-
+
// Holds custom key code mappings
registeredKeyBindings = {};
@@ -574,7 +593,7 @@
dom.speakerNotes.setAttribute( 'tabindex', '0' );
// Overlay graphic which is displayed during the paused mode
- createSingletonNode( dom.wrapper, 'div', 'pause-overlay', null );
+ dom.pauseOverlay = createSingletonNode( dom.wrapper, 'div', 'pause-overlay', config.controls ? '<button class="resume-button">Resume presentation</button>' : null );
dom.wrapper.setAttribute( 'role', 'application' );
@@ -771,13 +790,58 @@
numberElement.innerHTML = formatSlideNumber( slideNumberH, '.', slideNumberV );
page.appendChild( numberElement );
}
- }
- } );
+ // Copy page and show fragments one after another
+ if( config.pdfSeparateFragments ) {
+
+ // Each fragment 'group' is an array containing one or more
+ // fragments. Multiple fragments that appear at the same time
+ // are part of the same group.
+ var fragmentGroups = sortFragments( page.querySelectorAll( '.fragment' ), true );
+
+ var previousFragmentStep;
+ var previousPage;
+
+ fragmentGroups.forEach( function( fragments ) {
+
+ // Remove 'current-fragment' from the previous group
+ if( previousFragmentStep ) {
+ previousFragmentStep.forEach( function( fragment ) {
+ fragment.classList.remove( 'current-fragment' );
+ } );
+ }
+
+ // Show the fragments for the current index
+ fragments.forEach( function( fragment ) {
+ fragment.classList.add( 'visible', 'current-fragment' );
+ } );
+
+ // Create a separate page for the current fragment state
+ var clonedPage = page.cloneNode( true );
+ page.parentNode.insertBefore( clonedPage, ( previousPage || page ).nextSibling );
+
+ previousFragmentStep = fragments;
+ previousPage = clonedPage;
+
+ } );
+
+ // Reset the first/original page so that all fragments are hidden
+ fragmentGroups.forEach( function( fragments ) {
+ fragments.forEach( function( fragment ) {
+ fragment.classList.remove( 'visible', 'current-fragment' );
+ } );
+ } );
+
+ }
+ // Show all fragments
+ else {
+ toArray( page.querySelectorAll( '.fragment:not(.fade-out)' ) ).forEach( function( fragment ) {
+ fragment.classList.add( 'visible' );
+ } );
+ }
+
+ }
- // Show all fragments
- toArray( dom.wrapper.querySelectorAll( SLIDES_SELECTOR + ' .fragment' ) ).forEach( function( fragment ) {
- fragment.classList.add( 'visible' );
} );
// Notify subscribers that the PDF layout is good to go
@@ -877,6 +941,8 @@
dom.background.style.backgroundImage = 'url("' + config.parallaxBackgroundImage + '")';
dom.background.style.backgroundSize = config.parallaxBackgroundSize;
+ dom.background.style.backgroundRepeat = config.parallaxBackgroundRepeat;
+ dom.background.style.backgroundPosition = config.parallaxBackgroundPosition;
// Make sure the below properties are set on the element - these properties are
// needed for proper transitions to be set on the element via CSS. To remove
@@ -906,6 +972,57 @@
*/
function createBackground( slide, container ) {
+
+ // Main slide background element
+ var element = document.createElement( 'div' );
+ element.className = 'slide-background ' + slide.className.replace( /present|past|future/, '' );
+
+ // Inner background element that wraps images/videos/iframes
+ var contentElement = document.createElement( 'div' );
+ contentElement.className = 'slide-background-content';
+
+ element.appendChild( contentElement );
+ container.appendChild( element );
+
+ slide.slideBackgroundElement = element;
+ slide.slideBackgroundContentElement = contentElement;
+
+ // Syncs the background to reflect all current background settings
+ syncBackground( slide );
+
+ return element;
+
+ }
+
+ /**
+ * Renders all of the visual properties of a slide background
+ * based on the various background attributes.
+ *
+ * @param {HTMLElement} slide
+ */
+ function syncBackground( slide ) {
+
+ var element = slide.slideBackgroundElement,
+ contentElement = slide.slideBackgroundContentElement;
+
+ // Reset the prior background state in case this is not the
+ // initial sync
+ slide.classList.remove( 'has-dark-background' );
+ slide.classList.remove( 'has-light-background' );
+
+ element.removeAttribute( 'data-loaded' );
+ element.removeAttribute( 'data-background-hash' );
+ element.removeAttribute( 'data-background-size' );
+ element.removeAttribute( 'data-background-transition' );
+ element.style.backgroundColor = '';
+
+ contentElement.style.backgroundSize = '';
+ contentElement.style.backgroundRepeat = '';
+ contentElement.style.backgroundPosition = '';
+ contentElement.style.backgroundImage = '';
+ contentElement.style.opacity = '';
+ contentElement.innerHTML = '';
+
var data = {
background: slide.getAttribute( 'data-background' ),
backgroundSize: slide.getAttribute( 'data-background-size' ),
@@ -915,14 +1032,10 @@
backgroundColor: slide.getAttribute( 'data-background-color' ),
backgroundRepeat: slide.getAttribute( 'data-background-repeat' ),
backgroundPosition: slide.getAttribute( 'data-background-position' ),
- backgroundTransition: slide.getAttribute( 'data-background-transition' )
+ backgroundTransition: slide.getAttribute( 'data-background-transition' ),
+ backgroundOpacity: slide.getAttribute( 'data-background-opacity' )
};
- var element = document.createElement( 'div' );
-
- // Carry over custom classes from the slide to the background
- element.className = 'slide-background ' + slide.className.replace( /present|past|future/, '' );
-
if( data.background ) {
// Auto-wrap image urls in url(...)
if( /^(http|file|\/\/)/gi.test( data.background ) || /\.(svg|png|jpg|jpeg|gif|bmp)([?#\s]|$)/gi.test( data.background ) ) {
@@ -945,24 +1058,20 @@
data.backgroundColor +
data.backgroundRepeat +
data.backgroundPosition +
- data.backgroundTransition );
+ data.backgroundTransition +
+ data.backgroundOpacity );
}
// Additional and optional background properties
- if( data.backgroundSize ) element.style.backgroundSize = data.backgroundSize;
if( data.backgroundSize ) element.setAttribute( 'data-background-size', data.backgroundSize );
if( data.backgroundColor ) element.style.backgroundColor = data.backgroundColor;
- if( data.backgroundRepeat ) element.style.backgroundRepeat = data.backgroundRepeat;
- if( data.backgroundPosition ) element.style.backgroundPosition = data.backgroundPosition;
if( data.backgroundTransition ) element.setAttribute( 'data-background-transition', data.backgroundTransition );
- container.appendChild( element );
-
- // If backgrounds are being recreated, clear old classes
- slide.classList.remove( 'has-dark-background' );
- slide.classList.remove( 'has-light-background' );
-
- slide.slideBackgroundElement = element;
+ // Background image options are set on the content wrapper
+ if( data.backgroundSize ) contentElement.style.backgroundSize = data.backgroundSize;
+ if( data.backgroundRepeat ) contentElement.style.backgroundRepeat = data.backgroundRepeat;
+ if( data.backgroundPosition ) contentElement.style.backgroundPosition = data.backgroundPosition;
+ if( data.backgroundOpacity ) contentElement.style.opacity = data.backgroundOpacity;
// If this slide has a background color, add a class that
// signals if it is light or dark. If the slide has no background
@@ -984,8 +1093,6 @@
}
}
- return element;
-
}
/**
@@ -1162,13 +1269,8 @@
window.addEventListener( 'resize', onWindowResize, false );
if( config.touch ) {
- dom.wrapper.addEventListener( 'touchstart', onTouchStart, false );
- dom.wrapper.addEventListener( 'touchmove', onTouchMove, false );
- dom.wrapper.addEventListener( 'touchend', onTouchEnd, false );
-
- // Support pointer-style touch interaction as well
- if( window.navigator.pointerEnabled ) {
- // IE 11 uses un-prefixed version of pointer events
+ if( 'onpointerdown' in window ) {
+ // Use W3C pointer events
dom.wrapper.addEventListener( 'pointerdown', onPointerDown, false );
dom.wrapper.addEventListener( 'pointermove', onPointerMove, false );
dom.wrapper.addEventListener( 'pointerup', onPointerUp, false );
@@ -1179,6 +1281,12 @@
dom.wrapper.addEventListener( 'MSPointerMove', onPointerMove, false );
dom.wrapper.addEventListener( 'MSPointerUp', onPointerUp, false );
}
+ else {
+ // Fall back to touch events
+ dom.wrapper.addEventListener( 'touchstart', onTouchStart, false );
+ dom.wrapper.addEventListener( 'touchmove', onTouchMove, false );
+ dom.wrapper.addEventListener( 'touchend', onTouchEnd, false );
+ }
}
if( config.keyboard ) {
@@ -1190,6 +1298,8 @@
dom.progress.addEventListener( 'click', onProgressClicked, false );
}
+ dom.pauseOverlay.addEventListener( 'click', resume, false );
+
if( config.focusBodyOnPageVisibilityChange ) {
var visibilityChange;
@@ -1241,22 +1351,19 @@
window.removeEventListener( 'hashchange', onWindowHashChange, false );
window.removeEventListener( 'resize', onWindowResize, false );
+ dom.wrapper.removeEventListener( 'pointerdown', onPointerDown, false );
+ dom.wrapper.removeEventListener( 'pointermove', onPointerMove, false );
+ dom.wrapper.removeEventListener( 'pointerup', onPointerUp, false );
+
+ dom.wrapper.removeEventListener( 'MSPointerDown', onPointerDown, false );
+ dom.wrapper.removeEventListener( 'MSPointerMove', onPointerMove, false );
+ dom.wrapper.removeEventListener( 'MSPointerUp', onPointerUp, false );
+
dom.wrapper.removeEventListener( 'touchstart', onTouchStart, false );
dom.wrapper.removeEventListener( 'touchmove', onTouchMove, false );
dom.wrapper.removeEventListener( 'touchend', onTouchEnd, false );
- // IE11
- if( window.navigator.pointerEnabled ) {
- dom.wrapper.removeEventListener( 'pointerdown', onPointerDown, false );
- dom.wrapper.removeEventListener( 'pointermove', onPointerMove, false );
- dom.wrapper.removeEventListener( 'pointerup', onPointerUp, false );
- }
- // IE10
- else if( window.navigator.msPointerEnabled ) {
- dom.wrapper.removeEventListener( 'MSPointerDown', onPointerDown, false );
- dom.wrapper.removeEventListener( 'MSPointerMove', onPointerMove, false );
- dom.wrapper.removeEventListener( 'MSPointerUp', onPointerUp, false );
- }
+ dom.pauseOverlay.removeEventListener( 'click', resume, false );
if ( config.progress && dom.progress ) {
dom.progress.removeEventListener( 'click', onProgressClicked, false );
@@ -1583,6 +1690,15 @@
}
/**
+ * Check if this instance is being used to print a PDF with fragments.
+ */
+ function isPrintingPDFFragments() {
+
+ return ( /print-pdf-fragments/gi ).test( window.location.search );
+
+ }
+
+ /**
* Hides the address bar if we're on a mobile device.
*/
function hideAddressBar() {
@@ -1843,76 +1959,80 @@
if( dom.wrapper && !isPrintingPDF() ) {
- var size = getComputedSlideSize();
+ if( !config.disableLayout ) {
- // Layout the contents of the slides
- layoutSlideContents( config.width, config.height );
+ var size = getComputedSlideSize();
- dom.slides.style.width = size.width + 'px';
- dom.slides.style.height = size.height + 'px';
+ // Layout the contents of the slides
+ layoutSlideContents( config.width, config.height );
- // Determine scale of content to fit within available space
- scale = Math.min( size.presentationWidth / size.width, size.presentationHeight / size.height );
+ dom.slides.style.width = size.width + 'px';
+ dom.slides.style.height = size.height + 'px';
- // Respect max/min scale settings
- scale = Math.max( scale, config.minScale );
- scale = Math.min( scale, config.maxScale );
+ // Determine scale of content to fit within available space
+ scale = Math.min( size.presentationWidth / size.width, size.presentationHeight / size.height );
- // Don't apply any scaling styles if scale is 1
- if( scale === 1 ) {
- dom.slides.style.zoom = '';
- dom.slides.style.left = '';
- dom.slides.style.top = '';
- dom.slides.style.bottom = '';
- dom.slides.style.right = '';
- transformSlides( { layout: '' } );
- }
- else {
- // Prefer zoom for scaling up so that content remains crisp.
- // Don't use zoom to scale down since that can lead to shifts
- // in text layout/line breaks.
- if( scale > 1 && features.zoom ) {
- dom.slides.style.zoom = scale;
+ // Respect max/min scale settings
+ scale = Math.max( scale, config.minScale );
+ scale = Math.min( scale, config.maxScale );
+
+ // Don't apply any scaling styles if scale is 1
+ if( scale === 1 ) {
+ dom.slides.style.zoom = '';
dom.slides.style.left = '';
dom.slides.style.top = '';
dom.slides.style.bottom = '';
dom.slides.style.right = '';
transformSlides( { layout: '' } );
}
- // Apply scale transform as a fallback
else {
- dom.slides.style.zoom = '';
- dom.slides.style.left = '50%';
- dom.slides.style.top = '50%';
- dom.slides.style.bottom = 'auto';
- dom.slides.style.right = 'auto';
- transformSlides( { layout: 'translate(-50%, -50%) scale('+ scale +')' } );
+ // Prefer zoom for scaling up so that content remains crisp.
+ // Don't use zoom to scale down since that can lead to shifts
+ // in text layout/line breaks.
+ if( scale > 1 && features.zoom ) {
+ dom.slides.style.zoom = scale;
+ dom.slides.style.left = '';
+ dom.slides.style.top = '';
+ dom.slides.style.bottom = '';
+ dom.slides.style.right = '';
+ transformSlides( { layout: '' } );
+ }
+ // Apply scale transform as a fallback
+ else {
+ dom.slides.style.zoom = '';
+ dom.slides.style.left = '50%';
+ dom.slides.style.top = '50%';
+ dom.slides.style.bottom = 'auto';
+ dom.slides.style.right = 'auto';
+ transformSlides( { layout: 'translate(-50%, -50%) scale('+ scale +')' } );
+ }
}
- }
- // Select all slides, vertical and horizontal
- var slides = toArray( dom.wrapper.querySelectorAll( SLIDES_SELECTOR ) );
+ // Select all slides, vertical and horizontal
+ var slides = toArray( dom.wrapper.querySelectorAll( SLIDES_SELECTOR ) );
- for( var i = 0, len = slides.length; i < len; i++ ) {
- var slide = slides[ i ];
+ for( var i = 0, len = slides.length; i < len; i++ ) {
+ var slide = slides[ i ];
- // Don't bother updating invisible slides
- if( slide.style.display === 'none' ) {
- continue;
- }
+ // Don't bother updating invisible slides
+ if( slide.style.display === 'none' ) {
+ continue;
+ }
- if( config.center || slide.classList.contains( 'center' ) ) {
- // Vertical stacks are not centred since their section
- // children will be
- if( slide.classList.contains( 'stack' ) ) {
- slide.style.top = 0;
+ if( config.center || slide.classList.contains( 'center' ) ) {
+ // Vertical stacks are not centred since their section
+ // children will be
+ if( slide.classList.contains( 'stack' ) ) {
+ slide.style.top = 0;
+ }
+ else {
+ slide.style.top = Math.max( ( size.height - slide.scrollHeight ) / 2, 0 ) + 'px';
+ }
}
else {
- slide.style.top = Math.max( ( size.height - slide.scrollHeight ) / 2, 0 ) + 'px';
+ slide.style.top = '';
}
- }
- else {
- slide.style.top = '';
+
}
}
@@ -2239,6 +2359,41 @@
}
/**
+ * Return a hash URL that will resolve to the current slide location.
+ */
+ function locationHash() {
+
+ var url = '/';
+
+ // Attempt to create a named link based on the slide's ID
+ var id = currentSlide ? currentSlide.getAttribute( 'id' ) : null;
+ if( id ) {
+ id = encodeURIComponent( id );
+ }
+
+ var indexf;
+ if( config.fragmentInURL ) {
+ indexf = getIndices().f;
+ }
+
+ // If the current slide has an ID, use that as a named link,
+ // but we don't support named links with a fragment index
+ if( typeof id === 'string' && id.length && indexf === undefined ) {
+ url = '/' + id;
+ }
+ // Otherwise use the /h/v index
+ else {
+ var hashIndexBase = config.hashOneBasedIndex ? 1 : 0;
+ if( indexh > 0 || indexv > 0 || indexf !== undefined ) url += indexh + hashIndexBase;
+ if( indexv > 0 || indexf !== undefined ) url += '/' + (indexv + hashIndexBase );
+ if( indexf !== undefined ) url += '/' + indexf;
+ }
+
+ return url;
+
+ }
+
+ /**
* Checks if the current or specified slide is vertical
* (nested within another slide).
*
@@ -2470,7 +2625,7 @@
// Solves an edge case where the previous slide maintains the
// 'present' class when navigating between adjacent vertical
// stacks
- if( previousSlide ) {
+ if( previousSlide && previousSlide !== currentSlide ) {
previousSlide.classList.remove( 'present' );
previousSlide.setAttribute( 'aria-hidden', 'true' );
@@ -2576,6 +2731,41 @@
}
/**
+ * Updates reveal.js to keep in sync with new slide attributes. For
+ * example, if you add a new `data-background-image` you can call
+ * this to have reveal.js render the new background image.
+ *
+ * Similar to #sync() but more efficient when you only need to
+ * refresh a specific slide.
+ *
+ * @param {HTMLElement} slide
+ */
+ function syncSlide( slide ) {
+
+ syncBackground( slide );
+ syncFragments( slide );
+
+ updateBackground();
+ updateNotes();
+
+ loadSlide( slide );
+
+ }
+
+ /**
+ * Formats the fragments on the given slide so that they have
+ * valid indices. Call this if fragments are changed in the DOM
+ * after reveal.js has already initialized.
+ *
+ * @param {HTMLElement} slide
+ */
+ function syncFragments( slide ) {
+
+ sortFragments( slide.querySelectorAll( '.fragment' ) );
+
+ }
+
+ /**
* Resets all vertical slides so that only the first
* is visible.
*/
@@ -2903,6 +3093,7 @@
}
+
/**
* Updates the slide number div to reflect the current slide.
*
@@ -2925,6 +3116,12 @@
format = config.slideNumber;
}
+ // If there are ONLY vertical slides in this deck, always use
+ // a flattened slide number
+ if( !/c/.test( format ) && dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ).length === 1 ) {
+ format = 'c';
+ }
+
switch( format ) {
case 'c':
value.push( getSlidePastCount() + 1 );
@@ -2957,13 +3154,18 @@
*/
function formatSlideNumber( a, delimiter, b ) {
+ var url = '#' + locationHash();
if( typeof b === 'number' && !isNaN( b ) ) {
- return '<span class="slide-number-a">'+ a +'</span>' +
+ return '<a href="' + url + '">' +
+ '<span class="slide-number-a">'+ a +'</span>' +
'<span class="slide-number-delimiter">'+ delimiter +'</span>' +
- '<span class="slide-number-b">'+ b +'</span>';
+ '<span class="slide-number-b">'+ b +'</span>' +
+ '</a>';
}
else {
- return '<span class="slide-number-a">'+ a +'</span>';
+ return '<a href="' + url + '">' +
+ '<span class="slide-number-a">'+ a +'</span>' +
+ '</a>';
}
}
@@ -3114,13 +3316,18 @@
startEmbeddedContent( currentBackground );
- var backgroundImageURL = currentBackground.style.backgroundImage || '';
+ var currentBackgroundContent = currentBackground.querySelector( '.slide-background-content' );
+ if( currentBackgroundContent ) {
+
+ var backgroundImageURL = currentBackgroundContent.style.backgroundImage || '';
+
+ // Restart GIFs (doesn't work in Firefox)
+ if( /\.gif/i.test( backgroundImageURL ) ) {
+ currentBackgroundContent.style.backgroundImage = '';
+ window.getComputedStyle( currentBackgroundContent ).opacity;
+ currentBackgroundContent.style.backgroundImage = backgroundImageURL;
+ }
- // Restart GIFs (doesn't work in Firefox)
- if( /\.gif/i.test( backgroundImageURL ) ) {
- currentBackground.style.backgroundImage = '';
- window.getComputedStyle( currentBackground ).opacity;
- currentBackground.style.backgroundImage = backgroundImageURL;
}
// Don't transition between identical backgrounds. This
@@ -3252,10 +3459,12 @@
// Show the corresponding background element
- var background = getSlideBackground( slide );
+ var background = slide.slideBackgroundElement;
if( background ) {
background.style.display = 'block';
+ var backgroundContent = slide.slideBackgroundContentElement;
+
// If the background contains media, load it
if( background.hasAttribute( 'data-loaded' ) === false ) {
background.setAttribute( 'data-loaded', 'true' );
@@ -3268,7 +3477,7 @@
// Images
if( backgroundImage ) {
- background.style.backgroundImage = 'url('+ encodeURI( backgroundImage ) +')';
+ backgroundContent.style.backgroundImage = 'url('+ encodeURI( backgroundImage ) +')';
}
// Videos
else if ( backgroundVideo && !isSpeakerNotes() ) {
@@ -3296,7 +3505,7 @@
video.innerHTML += '<source src="'+ source +'">';
} );
- background.appendChild( video );
+ backgroundContent.appendChild( video );
}
// Iframes
else if( backgroundIframe && options.excludeIframes !== true ) {
@@ -3319,7 +3528,7 @@
iframe.style.maxHeight = '100%';
iframe.style.maxWidth = '100%';
- background.appendChild( iframe );
+ backgroundContent.appendChild( iframe );
}
}
@@ -3488,9 +3697,16 @@
if( autoplay && typeof el.play === 'function' ) {
+ // If the media is ready, start playback
if( el.readyState > 1 ) {
startEmbeddedMedia( { target: el } );
}
+ // Mobile devices never fire a loaded event so instead
+ // of waiting, we initiate playback
+ else if( isMobileDevice ) {
+ el.play();
+ }
+ // If the media isn't loaded, wait before playing
else {
el.removeEventListener( 'loadeddata', startEmbeddedMedia ); // remove first to avoid dupes
el.addEventListener( 'loadeddata', startEmbeddedMedia );
@@ -3749,18 +3965,21 @@
var bits = hash.slice( 2 ).split( '/' ),
name = hash.replace( /#|\//gi, '' );
- // If the first bit is invalid and there is a name we can
- // assume that this is a named link
- if( isNaN( parseInt( bits[0], 10 ) ) && name.length ) {
+ // If the first bit is not fully numeric and there is a name we
+ // can assume that this is a named link
+ if( !/^[0-9]*$/.test( bits[0] ) && name.length ) {
var element;
// Ensure the named link is a valid HTML ID attribute
- if( /^[a-zA-Z][\w:.-]*$/.test( name ) ) {
- // Find the slide with the specified ID
- element = document.getElementById( name );
+ try {
+ element = document.getElementById( decodeURIComponent( name ) );
}
+ catch ( error ) { }
- if( element ) {
+ // Ensure that we're not already on a slide with the same name
+ var isSameNameAsCurrentSlide = currentSlide ? currentSlide.getAttribute( 'id' ) === name : false;
+
+ if( element && !isSameNameAsCurrentSlide ) {
// Find the position of the named slide and navigate to it
var indices = Reveal.getIndices( element );
slide( indices.h, indices.v );
@@ -3771,10 +3990,13 @@
}
}
else {
+ var hashIndexBase = config.hashOneBasedIndex ? 1 : 0;
+
// Read the index components of the hash
- var h = parseInt( bits[0], 10 ) || 0,
- v = parseInt( bits[1], 10 ) || 0,
+ var h = ( parseInt( bits[0], 10 ) - hashIndexBase ) || 0,
+ v = ( parseInt( bits[1], 10 ) - hashIndexBase ) || 0,
f;
+
if( config.fragmentInURL ) {
f = parseInt( bits[2], 10 );
if( isNaN( f ) ) {
@@ -3808,32 +4030,7 @@
writeURLTimeout = setTimeout( writeURL, delay );
}
else if( currentSlide ) {
- var url = '/';
-
- // Attempt to create a named link based on the slide's ID
- var id = currentSlide.getAttribute( 'id' );
- if( id ) {
- id = id.replace( /[^a-zA-Z0-9\-\_\:\.]/g, '' );
- }
-
- var indexf;
- if( config.fragmentInURL ) {
- indexf = getIndices().f;
- }
-
- // If the current slide has an ID, use that as a named link,
- // but we don't support named links with a fragment index
- if( typeof id === 'string' && id.length && indexf === undefined ) {
- url = '/' + id;
- }
- // Otherwise use the /h/v index
- else {
- if( indexh > 0 || indexv > 0 || indexf !== undefined ) url += indexh;
- if( indexv > 0 || indexf !== undefined ) url += '/' + indexv;
- if( indexf !== undefined ) url += '/' + indexf;
- }
-
- window.location.hash = url;
+ window.location.hash = locationHash();
}
}
@@ -4059,9 +4256,11 @@
* the fragment within the fragments list.
*
* @param {object[]|*} fragments
+ * @param {boolean} grouped If true the returned array will contain
+ * nested arrays for all fragments with the same index
* @return {object[]} sorted Sorted array of fragments
*/
- function sortFragments( fragments ) {
+ function sortFragments( fragments, grouped ) {
fragments = toArray( fragments );
@@ -4104,7 +4303,7 @@
index ++;
} );
- return sorted;
+ return grouped === true ? ordered : sorted;
}
@@ -5190,7 +5389,10 @@
initialize: initialize,
configure: configure,
+
sync: sync,
+ syncSlide: syncSlide,
+ syncFragments: syncFragments,
// Navigation methods
slide: slide,
diff --git a/package.json b/package.json
index 9bb5d29..cb8a711 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "reveal.js",
- "version": "3.6.0",
+ "version": "3.7.0",
"description": "The HTML Presentation Framework",
"homepage": "http://revealjs.com",
"subdomain": "revealjs",
diff --git a/plugin/markdown/markdown.js b/plugin/markdown/markdown.js
index aa08ee5..31029ae 100755
--- a/plugin/markdown/markdown.js
+++ b/plugin/markdown/markdown.js
@@ -273,7 +273,7 @@
/**
* Check if a node value has the attributes pattern.
* If yes, extract it and add that value as one or several attributes
- * the the terget element.
+ * to the target element.
*
* You need Cache Killer on Chrome to see the effect on any FOM transformation
* directly on refresh (F5)
diff --git a/plugin/notes/notes.html b/plugin/notes/notes.html
index a6bd5e2..56f5187 100644
--- a/plugin/notes/notes.html
+++ b/plugin/notes/notes.html
@@ -34,6 +34,22 @@
z-index: 2;
}
+ #connection-status {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ z-index: 20;
+ padding: 30% 20% 20% 20%;
+ font-size: 18px;
+ color: #222;
+ background: #fff;
+ text-align: center;
+ box-sizing: border-box;
+ line-height: 1.4;
+ }
+
.overlay-element {
height: 34px;
line-height: 34px;
@@ -288,6 +304,8 @@
<body>
+ <div id="connection-status">Loading speaker view...</div>
+
<div id="current-slide"></div>
<div id="upcoming-slide"><span class="overlay-element label">Upcoming</span></div>
<div id="speaker-controls">
@@ -342,8 +360,16 @@
setupLayout();
+ var connectionStatus = document.querySelector( '#connection-status' );
+ var connectionTimeout = setTimeout( function() {
+ connectionStatus.innerHTML = 'Error connecting to main window.<br>Please try closing and reopening the speaker view.';
+ }, 5000 );
+
window.addEventListener( 'message', function( event ) {
+ clearTimeout( connectionTimeout );
+ connectionStatus.style.display = 'none';
+
var data = JSON.parse( event.data );
// The overview mode is only useful to the reveal.js instance
diff --git a/plugin/notes/notes.js b/plugin/notes/notes.js
index dce9b4e..552a6fe 100644
--- a/plugin/notes/notes.js
+++ b/plugin/notes/notes.js
@@ -21,6 +21,10 @@ var RevealNotes = (function() {
var notesPopup = window.open( notesFilePath, 'reveal.js - Notes', 'width=1100,height=700' );
+ if( !notesPopup ) {
+ alert( 'Speaker view popup failed to open. Please make sure popups are allowed and reopen the speaker view.' );
+ return;
+ }
/**
* Connect to the notes window through a postmessage handshake.
diff --git a/test/test.js b/test/test.js
index 042e4e8..f8515a0 100644
--- a/test/test.js
+++ b/test/test.js
@@ -130,8 +130,8 @@ Reveal.addEventListener( 'ready', function() {
QUnit.test( 'Reveal.getSlideBackground', function( assert ) {
assert.equal( Reveal.getSlideBackground( 0 ), document.querySelector( '.reveal .backgrounds>.slide-background:first-child' ), 'gets correct first background' );
assert.equal( Reveal.getSlideBackground( 1 ), document.querySelector( '.reveal .backgrounds>.slide-background:nth-child(2)' ), 'no v index returns stack' );
- assert.equal( Reveal.getSlideBackground( 1, 0 ), document.querySelector( '.reveal .backgrounds>.slide-background:nth-child(2) .slide-background:nth-child(1)' ), 'v index 0 returns first vertical child' );
- assert.equal( Reveal.getSlideBackground( 1, 1 ), document.querySelector( '.reveal .backgrounds>.slide-background:nth-child(2) .slide-background:nth-child(2)' ), 'v index 1 returns second vertical child' );
+ assert.equal( Reveal.getSlideBackground( 1, 0 ), document.querySelector( '.reveal .backgrounds>.slide-background:nth-child(2) .slide-background:nth-child(2)' ), 'v index 0 returns first vertical child' );
+ assert.equal( Reveal.getSlideBackground( 1, 1 ), document.querySelector( '.reveal .backgrounds>.slide-background:nth-child(2) .slide-background:nth-child(3)' ), 'v index 1 returns second vertical child' );
assert.strictEqual( Reveal.getSlideBackground( 100 ), undefined, 'undefined when out of horizontal bounds' );
assert.strictEqual( Reveal.getSlideBackground( 1, 100 ), undefined, 'undefined when out of vertical bounds' );
@@ -523,8 +523,8 @@ Reveal.addEventListener( 'ready', function() {
var imageSource2 = Reveal.getSlide( 1, 0 ).getAttribute( 'data-background' );
// check that the images are applied to the background elements
- assert.ok( Reveal.getSlideBackground( 0 ).style.backgroundImage.indexOf( imageSource1 ) !== -1, 'data-background-image worked' );
- assert.ok( Reveal.getSlideBackground( 1, 0 ).style.backgroundImage.indexOf( imageSource2 ) !== -1, 'data-background worked' );
+ assert.ok( Reveal.getSlideBackground( 0 ).querySelector( '.slide-background-content' ).style.backgroundImage.indexOf( imageSource1 ) !== -1, 'data-background-image worked' );
+ assert.ok( Reveal.getSlideBackground( 1, 0 ).querySelector( '.slide-background-content' ).style.backgroundImage.indexOf( imageSource2 ) !== -1, 'data-background worked' );
});