corrections to vertical centering (#70), added to docs, upgrade to 2.2
This commit is contained in:
parent
691099c6a2
commit
794ad86809
|
@ -71,6 +71,9 @@ Reveal.initialize({
|
|||
// Enable the slide overview mode
|
||||
overview: true,
|
||||
|
||||
// Vertical centering of slides
|
||||
center: false,
|
||||
|
||||
// Loop the presentation
|
||||
loop: false,
|
||||
|
||||
|
|
|
@ -490,10 +490,10 @@ body {
|
|||
*********************************************/
|
||||
|
||||
.reveal {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
min-height: 600px;
|
||||
position: relative;
|
||||
min-height: 640px; /* min height + 40 to account for padding */
|
||||
}
|
||||
|
||||
.reveal .slides {
|
||||
|
@ -504,9 +504,9 @@ body {
|
|||
left: 50%;
|
||||
top: 50%;
|
||||
padding: 20px 0px;
|
||||
|
||||
overflow: visible;
|
||||
z-index: 1;
|
||||
|
||||
text-align: center;
|
||||
|
||||
-webkit-transition: -webkit-perspective .4s ease;
|
||||
|
@ -520,10 +520,10 @@ body {
|
|||
-ms-perspective: 600px;
|
||||
perspective: 600px;
|
||||
|
||||
-webkit-perspective-origin: 0% 0%;
|
||||
-moz-perspective-origin: 0% 0%;
|
||||
-ms-perspective-origin: 0% 0%;
|
||||
perspective-origin: 0% 0%;
|
||||
-webkit-perspective-origin: 0% -25%;
|
||||
-moz-perspective-origin: 0% -25%;
|
||||
-ms-perspective-origin: 0% -25%;
|
||||
perspective-origin: 0% -25%;
|
||||
}
|
||||
|
||||
.reveal .slides>section,
|
||||
|
@ -566,14 +566,14 @@ body {
|
|||
}
|
||||
|
||||
.reveal .slides>section {
|
||||
margin-left: -50%;
|
||||
margin-top: -50%;
|
||||
left: -50%;
|
||||
top: -50%;
|
||||
}
|
||||
|
||||
.reveal.center,
|
||||
.reveal.center .slides {
|
||||
padding: 0;
|
||||
min-height: auto;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -350,6 +350,7 @@ function linkify( selector ) {
|
|||
controls: true,
|
||||
progress: true,
|
||||
history: true,
|
||||
center: true,
|
||||
|
||||
theme: Reveal.getQueryHash().theme, // available themes are in /css/theme
|
||||
transition: Reveal.getQueryHash().transition || 'default', // default/cube/page/concave/zoom/linear/none
|
||||
|
|
11
js/reveal.js
11
js/reveal.js
|
@ -1,5 +1,5 @@
|
|||
/*!
|
||||
* reveal.js 2.1 r37
|
||||
* reveal.js 2.2 r38
|
||||
* http://lab.hakim.se/reveal-js
|
||||
* MIT licensed
|
||||
*
|
||||
|
@ -29,6 +29,7 @@ var Reveal = (function(){
|
|||
// Enable the slide overview mode
|
||||
overview: true,
|
||||
|
||||
// Vertical centering of slides
|
||||
center: false,
|
||||
|
||||
// Loop the presentation
|
||||
|
@ -465,6 +466,7 @@ var Reveal = (function(){
|
|||
* presentation.
|
||||
*/
|
||||
function layout() {
|
||||
|
||||
if( config.center ) {
|
||||
|
||||
// Select all slides, vertical and horizontal
|
||||
|
@ -476,15 +478,18 @@ var Reveal = (function(){
|
|||
for( var i = 0, len = slides.length; i < len; i++ ) {
|
||||
var slide = slides[ i ];
|
||||
|
||||
// Vertical stacks are not centered since their section
|
||||
// children will be
|
||||
if( slide.classList.contains( 'stack' ) ) {
|
||||
slide.style.marginTop = 0;
|
||||
slide.style.top = 0;
|
||||
}
|
||||
else {
|
||||
slide.style.marginTop = Math.max( - ( slide.offsetHeight / 2 ) - 20, minTop ) + 'px';
|
||||
slide.style.top = Math.max( - ( slide.offsetHeight / 2 ) - 20, minTop ) + 'px';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
151
js/reveal.min.js
vendored
151
js/reveal.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user