added new transitions (box/page) and a ui theme (neon)

This commit is contained in:
Hakim El Hattab
2011-12-26 00:00:38 -08:00
parent 1ac6386eef
commit c7c7735e7a
3 changed files with 511 additions and 196 deletions

View File

@ -62,6 +62,9 @@
* version 1.1:
* - Optional progress bar UI element
* - Slide overview available via SPACE
* - Added 'transition' option for specifying transition styles
* - Added 'theme' option for specifying UI styles
* - Slides that contain nested-slides are given the 'stack' class
*
* TODO:
* - Touch/swipe interactions
@ -83,6 +86,7 @@ var Reveal = (function(){
// > {Boolean} controls
// > {Boolean} progress
// > {String} theme
// > {String} transition
// > {Boolean} rollingLinks
config = {},
@ -122,11 +126,12 @@ var Reveal = (function(){
config.rollingLinks = options.rollingLinks === undefined ? true : options.rollingLinks;
config.controls = options.controls === undefined ? false : options.controls;
config.progress = options.progress === undefined ? false : options.progress;
config.transition = options.transition === undefined ? 'default' : options.transition;
config.theme = options.theme === undefined ? 'default' : options.theme;
// Fall back on the 2D transform theme 'linear'
if( supports3DTransforms === false ) {
config.theme = 'linear';
config.transition = 'linear';
}
if( config.controls ) {
@ -137,6 +142,10 @@ var Reveal = (function(){
dom.progress.style.display = 'block';
}
if( config.transition !== 'default' ) {
document.body.classList.add( config.transition );
}
if( config.theme !== 'default' ) {
document.body.classList.add( config.theme );
}
@ -417,6 +426,11 @@ var Reveal = (function(){
// Any element subsequent to index is given the 'future' class
slide.setAttribute('class', 'future');
}
// If this element contains vertical slides
if( slide.querySelector( 'section' ) ) {
slide.classList.add( 'stack' );
}
}
}
else {