Merge branch 'dev' into jh/print-optimize

master
Jeroen Hermans 2020-12-20 17:44:20 +01:00 committed by GitHub
commit acafabf023
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 12826 additions and 2448 deletions

View File

@ -249,17 +249,17 @@
<p>
reveal.js comes with a few themes built in: <br>
<!-- Hacks to swap themes after the page has loaded. Not flexible and only intended for the reveal.js demo deck. -->
<a href="#" onclick="document.getElementById('theme').setAttribute('href','css/theme/black.css'); return false;">Black (default)</a> -
<a href="#" onclick="document.getElementById('theme').setAttribute('href','css/theme/white.css'); return false;">White</a> -
<a href="#" onclick="document.getElementById('theme').setAttribute('href','css/theme/league.css'); return false;">League</a> -
<a href="#" onclick="document.getElementById('theme').setAttribute('href','css/theme/sky.css'); return false;">Sky</a> -
<a href="#" onclick="document.getElementById('theme').setAttribute('href','css/theme/beige.css'); return false;">Beige</a> -
<a href="#" onclick="document.getElementById('theme').setAttribute('href','css/theme/simple.css'); return false;">Simple</a> <br>
<a href="#" onclick="document.getElementById('theme').setAttribute('href','css/theme/serif.css'); return false;">Serif</a> -
<a href="#" onclick="document.getElementById('theme').setAttribute('href','css/theme/blood.css'); return false;">Blood</a> -
<a href="#" onclick="document.getElementById('theme').setAttribute('href','css/theme/night.css'); return false;">Night</a> -
<a href="#" onclick="document.getElementById('theme').setAttribute('href','css/theme/moon.css'); return false;">Moon</a> -
<a href="#" onclick="document.getElementById('theme').setAttribute('href','css/theme/solarized.css'); return false;">Solarized</a>
<a href="#" onclick="document.getElementById('theme').setAttribute('href','dist/theme/black.css'); return false;">Black (default)</a> -
<a href="#" onclick="document.getElementById('theme').setAttribute('href','dist/theme/white.css'); return false;">White</a> -
<a href="#" onclick="document.getElementById('theme').setAttribute('href','dist/theme/league.css'); return false;">League</a> -
<a href="#" onclick="document.getElementById('theme').setAttribute('href','dist/theme/sky.css'); return false;">Sky</a> -
<a href="#" onclick="document.getElementById('theme').setAttribute('href','dist/theme/beige.css'); return false;">Beige</a> -
<a href="#" onclick="document.getElementById('theme').setAttribute('href','dist/theme/simple.css'); return false;">Simple</a> <br>
<a href="#" onclick="document.getElementById('theme').setAttribute('href','dist/theme/serif.css'); return false;">Serif</a> -
<a href="#" onclick="document.getElementById('theme').setAttribute('href','dist/theme/blood.css'); return false;">Blood</a> -
<a href="#" onclick="document.getElementById('theme').setAttribute('href','dist/theme/night.css'); return false;">Night</a> -
<a href="#" onclick="document.getElementById('theme').setAttribute('href','dist/theme/moon.css'); return false;">Moon</a> -
<a href="#" onclick="document.getElementById('theme').setAttribute('href','dist/theme/solarized.css'); return false;">Solarized</a>
</p>
</section>

2
dist/reveal.css vendored
View File

@ -1,5 +1,5 @@
/*!
* reveal.js 4.0.2
* reveal.js 4.1.0
* https://revealjs.com
* MIT licensed
*

4
dist/reveal.esm.js vendored

File diff suppressed because one or more lines are too long

4
dist/reveal.js vendored

File diff suppressed because one or more lines are too long

View File

@ -32,6 +32,8 @@ const banner = `/*!
* Copyright (C) 2020 Hakim El Hattab, https://hakim.se
*/\n`
sass.compiler = require('node-sass');
// Prevents warnings from opening too many test pages
process.setMaxListeners(20);

View File

@ -50,6 +50,12 @@ export default class Print {
await new Promise(requestAnimationFrame);
this.Reveal.layoutSlideContents( slideWidth, slideHeight );
slides.forEach( function( slide ) {
// Re-run the slide layout so that r-fit-text is applied based on
// the printed slide size
this.Reveal.slideContent.layout( slide );
});
// Batch scrollHeight access to prevent layout thrashing
await new Promise(requestAnimationFrame);
const slideScrollHeights = []

View File

@ -88,14 +88,16 @@ export default class Progress {
event.preventDefault();
let slidesTotal = this.Reveal.getHorizontalSlides().length;
let slides = this.Reveal.getSlides();
let slidesTotal = slides.length;
let slideIndex = Math.floor( ( event.clientX / this.getMaxWidth() ) * slidesTotal );
if( this.Reveal.getConfig().rtl ) {
slideIndex = slidesTotal - slideIndex;
}
this.Reveal.slide( slideIndex );
let targetIndices = this.Reveal.getIndices(slides[slideIndex]);
this.Reveal.slide( targetIndices.h, targetIndices.v );
}

View File

@ -167,11 +167,20 @@ export default class SlideContent {
}
this.layout( slide );
}
/**
* Applies JS-dependent layout helpers for the given slide,
* if there are any.
*/
layout( slide ) {
// Autosize text with the r-fit-text class based on the
// size of its container. This needs to happen after the
// slide is visible in order to measure the text.
Array.from( slide.querySelectorAll( '.r-fit-text:not([data-fitted])' ) ).forEach( element => {
element.dataset.fitted = '';
Array.from( slide.querySelectorAll( '.r-fit-text' ) ).forEach( element => {
fitty( element, {
minSize: 24,
maxSize: this.Reveal.getConfig().height * 0.8,

15192
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -47,12 +47,13 @@
"gulp-connect": "^5.7.0",
"gulp-eslint": "^6.0.0",
"gulp-header": "^2.0.9",
"gulp-sass": "^4.0.2",
"gulp-sass": "^4.1.0",
"gulp-tap": "^2.0.0",
"gulp-zip": "^5.0.1",
"highlight.js": "^10.0.3",
"marked": "^1.1.0",
"node-qunit-puppeteer": "^2.0.1",
"node-sass": "^5.0.0",
"qunit": "^2.10.0",
"rollup": "^2.26.4",
"rollup-plugin-terser": "^7.0.0",

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long