From 8ff5fe4986a8f83a660c0f28a14e3542d986c884 Mon Sep 17 00:00:00 2001 From: craigsdennis Date: Fri, 16 Mar 2018 22:41:16 -0700 Subject: Updates copyright to 2018 --- css/reveal.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'css/reveal.scss') diff --git a/css/reveal.scss b/css/reveal.scss index 1a87624..6fb5419 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 */ -- cgit v1.2.3 From 531d1e8791ea6b19834426bca603a3784ba71708 Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Mon, 16 Apr 2018 09:48:37 +0200 Subject: prevent linked slide numbers from changing color --- css/reveal.css | 3 +++ css/reveal.scss | 4 ++++ js/reveal.js | 67 +++++++++++++++++++++++++++++---------------------------- 3 files changed, 41 insertions(+), 33 deletions(-) (limited to 'css/reveal.scss') diff --git a/css/reveal.css b/css/reveal.css index d79024c..bc96e1e 100644 --- a/css/reveal.css +++ b/css/reveal.css @@ -460,6 +460,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; } diff --git a/css/reveal.scss b/css/reveal.scss index 6fb5419..5992250 100644 --- a/css/reveal.scss +++ b/css/reveal.scss @@ -553,6 +553,10 @@ $controlsArrowAngleActive: 36deg; padding: 5px; } +.reveal .slide-number a { + color: currentColor; +} + .reveal .slide-number-delimiter { margin: 0 3px; } diff --git a/js/reveal.js b/js/reveal.js index a953fe2..477a1ea 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -68,7 +68,7 @@ // 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, @@ -1259,7 +1259,7 @@ document.removeEventListener( 'keypress', onDocumentKeyPress, false ); 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 ); @@ -2255,41 +2255,41 @@ return overview; } - + /** * 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 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 { - if( indexh > 0 || indexv > 0 || indexf !== undefined ) url += indexh + config.hashOneBasedIndex; - if( indexv > 0 || indexf !== undefined ) url += '/' + (indexv + config.hashOneBasedIndex); - if( indexf !== undefined ) url += '/' + indexf; - } - - return url; - } - + 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 { + if( indexh > 0 || indexv > 0 || indexf !== undefined ) url += indexh + config.hashOneBasedIndex; + if( indexv > 0 || indexf !== undefined ) url += '/' + (indexv + config.hashOneBasedIndex); + if( indexf !== undefined ) url += '/' + indexf; + } + + return url; + + } + /** * Checks if the current or specified slide is vertical * (nested within another slide). @@ -3009,6 +3009,7 @@ * @return {string} HTML string fragment */ function formatSlideNumber( a, delimiter, b ) { + var url = '#' + locationHash(); if( typeof b === 'number' && !isNaN( b ) ) { return '' + @@ -3839,10 +3840,10 @@ } else { // Read the index components of the hash - var h = parseInt( bits[0], 10 ) || 0 - config.hashOneBasedIndex, v = parseInt( bits[1], 10 ) || 0 - config.hashOneBasedIndex, f; + if( config.fragmentInURL ) { f = parseInt( bits[2], 10 ); if( isNaN( f ) ) { @@ -3856,7 +3857,7 @@ } } - + /** * Updates the page URL (hash) to reflect the current * state. -- cgit v1.2.3 From f1133f0e103d6a75f5a8d4e884052c818ea86f3a Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Tue, 17 Apr 2018 09:46:55 +0200 Subject: support interactive iframe backgrounds in vertical stacks --- css/reveal.css | 3 ++- css/reveal.scss | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'css/reveal.scss') diff --git a/css/reveal.css b/css/reveal.css index bc96e1e..05c2e8d 100644 --- a/css/reveal.css +++ b/css/reveal.css @@ -531,7 +531,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 { diff --git a/css/reveal.scss b/css/reveal.scss index 5992250..065a0a1 100644 --- a/css/reveal.scss +++ b/css/reveal.scss @@ -640,6 +640,7 @@ $controlsArrowAngleActive: 36deg; .reveal .slides>section.stack { padding-top: 0; padding-bottom: 0; + pointer-events: none; } .reveal .slides>section.present, -- cgit v1.2.3 From 4ba0d733458408ee666163792c0dc13ebec41ac4 Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Fri, 27 Apr 2018 15:53:02 +0200 Subject: add , adds wrapper element around background images/videos/iframes --- README.md | 26 ++++++++++++++------------ css/reveal.css | 9 +++++++-- css/reveal.scss | 11 +++++++++-- js/reveal.js | 34 +++++++++++++++++++++++----------- test/test.js | 8 ++++---- 5 files changed, 57 insertions(+), 31 deletions(-) (limited to 'css/reveal.scss') diff --git a/README.md b/README.md index b7bbafc..9694d52 100644 --- a/README.md +++ b/README.md @@ -624,12 +624,13 @@ 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-content-opacity | 1 | Opacity of the background image on a 0-1 scale. 0 is transparent and 1 is fully opaque. | ```html

Image

@@ -642,12 +643,13 @@ 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-content-opacity | 1 | Opacity of the background video on a 0-1 scale. 0 is transparent and 1 is fully opaque. | ```html
diff --git a/css/reveal.css b/css/reveal.css index 05c2e8d..ac095f4 100644 --- a/css/reveal.css +++ b/css/reveal.css @@ -1015,10 +1015,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; } diff --git a/css/reveal.scss b/css/reveal.scss index 065a0a1..efb4114 100644 --- a/css/reveal.scss +++ b/css/reveal.scss @@ -1091,11 +1091,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 { diff --git a/js/reveal.js b/js/reveal.js index ebdeb9f..ae1c4ae 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -933,14 +933,18 @@ 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' ), + backgroundContentOpacity: slide.getAttribute( 'data-background-content-opacity' ) }; + // Main slide background element 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/, '' ); + // Inner background element that wraps images/videos/iframes + var contentElement = document.createElement( 'div' ); + contentElement.className = 'slide-background-content'; + 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 ) ) { @@ -963,17 +967,22 @@ data.backgroundColor + data.backgroundRepeat + data.backgroundPosition + - data.backgroundTransition ); + data.backgroundTransition + + data.backgroundContentOpacity ); } // 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 ); + // 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.backgroundContentOpacity ) contentElement.style.opacity = data.backgroundContentOpacity; + + element.appendChild( contentElement ); container.appendChild( element ); // If backgrounds are being recreated, clear old classes @@ -981,6 +990,7 @@ slide.classList.remove( 'has-light-background' ); slide.slideBackgroundElement = element; + slide.slideBackgroundContentElement = contentElement; // If this slide has a background color, add a class that // signals if it is light or dark. If the slide has no background @@ -3311,10 +3321,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' ); @@ -3327,7 +3339,7 @@ // Images if( backgroundImage ) { - background.style.backgroundImage = 'url('+ encodeURI( backgroundImage ) +')'; + backgroundContent.style.backgroundImage = 'url('+ encodeURI( backgroundImage ) +')'; } // Videos else if ( backgroundVideo && !isSpeakerNotes() ) { @@ -3355,7 +3367,7 @@ video.innerHTML += ''; } ); - background.appendChild( video ); + backgroundContent.appendChild( video ); } // Iframes else if( backgroundIframe && options.excludeIframes !== true ) { @@ -3378,7 +3390,7 @@ iframe.style.maxHeight = '100%'; iframe.style.maxWidth = '100%'; - background.appendChild( iframe ); + backgroundContent.appendChild( iframe ); } } 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' ); }); -- cgit v1.2.3 From 4bea8e17e8a6dd1580286aa3b0b927e0aebae75b Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Mon, 11 Jun 2018 10:59:31 +0200 Subject: add 'fade-in-then-half-out' fragment style, 'current-visible' was renamed to 'fade-in-then-out' --- README.md | 3 ++- css/reveal.css | 12 ++++++++++++ css/reveal.scss | 16 ++++++++++++++++ demo.html | 10 ++++++++-- 4 files changed, 38 insertions(+), 3 deletions(-) (limited to 'css/reveal.scss') diff --git a/README.md b/README.md index 9d094a1..dfe6f35 100644 --- a/README.md +++ b/README.md @@ -761,7 +761,8 @@ The default fragment style is to start out invisible and fade in. This style can

shrink

fade-out

fade-up (also down, left and right!)

-

visible only once

+

fades in, then out when we move to the next step

+

fades in, then 50% out when we move to the next step

blue only once

highlight-red

highlight-green

diff --git a/css/reveal.css b/css/reveal.css index ac095f4..04b704d 100644 --- a/css/reveal.css +++ b/css/reveal.css @@ -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-half-out { + opacity: 0; + visibility: hidden; } + .reveal .slides section .fragment.fade-in-then-half-out.visible { + opacity: 0.5; + visibility: inherit; } + .reveal .slides section .fragment.fade-in-then-half-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, diff --git a/css/reveal.scss b/css/reveal.scss index efb4114..7e2701b 100644 --- a/css/reveal.scss +++ b/css/reveal.scss @@ -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-half-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, diff --git a/demo.html b/demo.html index 505bb18..df87fb2 100644 --- a/demo.html +++ b/demo.html @@ -139,8 +139,14 @@

grow

shrink

fade-out

-

fade-up (also down, left and right!)

-

current-visible

+

+ fade-right, + up, + down, + left +

+

fade-in-then-out

+

fade-in-then-half-out

Highlight red blue green

-- cgit v1.2.3 From be87adcdf8227fce0152e575c240d774408c38a3 Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Wed, 13 Jun 2018 14:12:25 +0200 Subject: rename new fragment style --- README.md | 2 +- css/reveal.css | 6 +++--- css/reveal.scss | 2 +- demo.html | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'css/reveal.scss') diff --git a/README.md b/README.md index 7a570d5..8db54c8 100644 --- a/README.md +++ b/README.md @@ -768,7 +768,7 @@ The default fragment style is to start out invisible and fade in. This style can

fade-out

fade-up (also down, left and right!)

fades in, then out when we move to the next step

-

fades in, then 50% out when we move to the next step

+

fades in, then obfuscate when we move to the next step

blue only once

highlight-red

highlight-green

diff --git a/css/reveal.css b/css/reveal.css index 04b704d..d937704 100644 --- a/css/reveal.css +++ b/css/reveal.css @@ -136,13 +136,13 @@ body { opacity: 1; visibility: inherit; } -.reveal .slides section .fragment.fade-in-then-half-out { +.reveal .slides section .fragment.fade-in-then-semi-out { opacity: 0; visibility: hidden; } - .reveal .slides section .fragment.fade-in-then-half-out.visible { + .reveal .slides section .fragment.fade-in-then-semi-out.visible { opacity: 0.5; visibility: inherit; } - .reveal .slides section .fragment.fade-in-then-half-out.current-fragment { + .reveal .slides section .fragment.fade-in-then-semi-out.current-fragment { opacity: 1; visibility: inherit; } diff --git a/css/reveal.scss b/css/reveal.scss index 7e2701b..80798d3 100644 --- a/css/reveal.scss +++ b/css/reveal.scss @@ -171,7 +171,7 @@ body { } } -.reveal .slides section .fragment.fade-in-then-half-out { +.reveal .slides section .fragment.fade-in-then-semi-out { opacity: 0; visibility: hidden; diff --git a/demo.html b/demo.html index df87fb2..8aa4aba 100644 --- a/demo.html +++ b/demo.html @@ -146,7 +146,7 @@ left

fade-in-then-out

-

fade-in-then-half-out

+

fade-in-then-semi-out

Highlight red blue green

-- cgit v1.2.3 From fd95c8c266b775227762db62c0cbed3c05955525 Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Thu, 21 Jun 2018 10:07:38 +0200 Subject: use absolute positioning for slide number --- css/reveal.css | 2 +- css/reveal.scss | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'css/reveal.scss') diff --git a/css/reveal.css b/css/reveal.css index d937704..9f2089e 100644 --- a/css/reveal.css +++ b/css/reveal.css @@ -460,7 +460,7 @@ body { * SLIDE NUMBER *********************************************/ .reveal .slide-number { - position: fixed; + position: absolute; display: block; right: 8px; bottom: 8px; diff --git a/css/reveal.scss b/css/reveal.scss index 80798d3..1fff346 100644 --- a/css/reveal.scss +++ b/css/reveal.scss @@ -556,7 +556,7 @@ $controlsArrowAngleActive: 36deg; *********************************************/ .reveal .slide-number { - position: fixed; + position: absolute; display: block; right: 8px; bottom: 8px; -- cgit v1.2.3 From b9bb353a11bb7bcd1f79a40a80e0d5dfcca05591 Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Mon, 2 Jul 2018 11:08:45 +0200 Subject: add 'resume presentation' button to pause overlay --- css/reveal.css | 15 +++++++++++++++ css/reveal.scss | 19 +++++++++++++++++++ js/reveal.js | 7 ++++++- 3 files changed, 40 insertions(+), 1 deletion(-) (limited to 'css/reveal.scss') diff --git a/css/reveal.css b/css/reveal.css index 9f2089e..eda311e 100644 --- a/css/reveal.css +++ b/css/reveal.css @@ -964,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; } diff --git a/css/reveal.scss b/css/reveal.scss index 1fff346..e6608d4 100644 --- a/css/reveal.scss +++ b/css/reveal.scss @@ -1034,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; diff --git a/js/reveal.js b/js/reveal.js index 93ed446..103fa82 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -593,7 +593,8 @@ 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', '' ); + dom.resumeButton = dom.pauseOverlay.querySelector( '.resume-button' ); dom.wrapper.setAttribute( 'role', 'application' ); @@ -1298,6 +1299,8 @@ dom.progress.addEventListener( 'click', onProgressClicked, false ); } + dom.resumeButton.addEventListener( 'click', resume, false ); + if( config.focusBodyOnPageVisibilityChange ) { var visibilityChange; @@ -1361,6 +1364,8 @@ dom.wrapper.removeEventListener( 'touchmove', onTouchMove, false ); dom.wrapper.removeEventListener( 'touchend', onTouchEnd, false ); + dom.resumeButton.removeEventListener( 'click', resume, false ); + if ( config.progress && dom.progress ) { dom.progress.removeEventListener( 'click', onProgressClicked, false ); } -- cgit v1.2.3