support for background transition overrides

edit
Hakim El Hattab 2013-06-18 08:37:06 -04:00
parent b0b6c75629
commit eb5b39e685
4 changed files with 17 additions and 10 deletions

View File

@ -1308,7 +1308,7 @@ body {
/********************************************* /*********************************************
* * PER-SLIDE BACKGROUNDS
*********************************************/ *********************************************/
.reveal>.backgrounds { .reveal>.backgrounds {
@ -1345,7 +1345,8 @@ body {
} }
/* Linear sliding transition style */ /* Linear sliding transition style */
.reveal[data-background-transition=linear]>.backgrounds .slide-background { .reveal[data-background-transition=linear]>.backgrounds .slide-background,
.reveal>.backgrounds .slide-background[data-background-transition=linear] {
opacity: 1; opacity: 1;
-webkit-backface-visibility: hidden; -webkit-backface-visibility: hidden;
@ -1359,14 +1360,16 @@ body {
-o-transition-duration: 800ms; -o-transition-duration: 800ms;
transition-duration: 800ms; transition-duration: 800ms;
} }
.reveal[data-background-transition=linear]>.backgrounds .slide-background.past { .reveal[data-background-transition=linear]>.backgrounds .slide-background.past,
.reveal>.backgrounds .slide-background.past[data-background-transition=linear] {
-webkit-transform: translate(-100%, 0); -webkit-transform: translate(-100%, 0);
-moz-transform: translate(-100%, 0); -moz-transform: translate(-100%, 0);
-ms-transform: translate(-100%, 0); -ms-transform: translate(-100%, 0);
-o-transform: translate(-100%, 0); -o-transform: translate(-100%, 0);
transform: translate(-100%, 0); transform: translate(-100%, 0);
} }
.reveal[data-background-transition=linear]>.backgrounds .slide-background.future { .reveal[data-background-transition=linear]>.backgrounds .slide-background.future,
.reveal>.backgrounds .slide-background.future[data-background-transition=linear] {
-webkit-transform: translate(100%, 0); -webkit-transform: translate(100%, 0);
-moz-transform: translate(100%, 0); -moz-transform: translate(100%, 0);
-ms-transform: translate(100%, 0); -ms-transform: translate(100%, 0);
@ -1374,14 +1377,16 @@ body {
transform: translate(100%, 0); transform: translate(100%, 0);
} }
.reveal[data-background-transition=linear]>.backgrounds .slide-background>.slide-background.past { .reveal[data-background-transition=linear]>.backgrounds .slide-background>.slide-background.past,
.reveal>.backgrounds .slide-background>.slide-background.past[data-background-transition=linear] {
-webkit-transform: translate(0, -100%); -webkit-transform: translate(0, -100%);
-moz-transform: translate(0, -100%); -moz-transform: translate(0, -100%);
-ms-transform: translate(0, -100%); -ms-transform: translate(0, -100%);
-o-transform: translate(0, -100%); -o-transform: translate(0, -100%);
transform: translate(0, -100%); transform: translate(0, -100%);
} }
.reveal[data-background-transition=linear]>.backgrounds .slide-background>.slide-background.future { .reveal[data-background-transition=linear]>.backgrounds .slide-background>.slide-background.future,
.reveal>.backgrounds .slide-background>.slide-background.future[data-background-transition=linear] {
-webkit-transform: translate(0, 100%); -webkit-transform: translate(0, 100%);
-moz-transform: translate(0, 100%); -moz-transform: translate(0, 100%);
-ms-transform: translate(0, 100%); -ms-transform: translate(0, 100%);

2
css/reveal.min.css vendored

File diff suppressed because one or more lines are too long

View File

@ -274,7 +274,8 @@ var Reveal = (function(){
backgroundSize: slide.getAttribute( 'data-background-size' ), backgroundSize: slide.getAttribute( 'data-background-size' ),
backgroundColor: slide.getAttribute( 'data-background-color' ), backgroundColor: slide.getAttribute( 'data-background-color' ),
backgroundRepeat: slide.getAttribute( 'data-background-repeat' ), backgroundRepeat: slide.getAttribute( 'data-background-repeat' ),
backgroundPosition: slide.getAttribute( 'data-background-position' ) backgroundPosition: slide.getAttribute( 'data-background-position' ),
backgroundTransition: slide.getAttribute( 'data-background-transition' )
}; };
var element = document.createElement( 'div' ); var element = document.createElement( 'div' );
@ -295,6 +296,7 @@ var Reveal = (function(){
if( data.backgroundColor ) element.style.backgroundColor = data.backgroundColor; if( data.backgroundColor ) element.style.backgroundColor = data.backgroundColor;
if( data.backgroundRepeat ) element.style.backgroundRepeat = data.backgroundRepeat; if( data.backgroundRepeat ) element.style.backgroundRepeat = data.backgroundRepeat;
if( data.backgroundPosition ) element.style.backgroundPosition = data.backgroundPosition; if( data.backgroundPosition ) element.style.backgroundPosition = data.backgroundPosition;
if( data.backgroundTransition ) element.setAttribute( 'data-background-transition', data.backgroundTransition );
container.appendChild( element ); container.appendChild( element );

4
js/reveal.min.js vendored

File diff suppressed because one or more lines are too long