website/reveal/js/reveal.js
/**
	 * Creates the slide background elements and appends them
	 * to the background container. One element is created per
	 * slide no matter if the given slide has visible background.
	 */
Creates the slide background elements and appends them
to the background container. One element is created per
slide no matter if the given slide has visible background.
Creates the slide background elements and appends them to the background container . One element is created per slide no matter if the given slide has visible background .
function createBackgrounds() {
		if( isPrintingPDF() ) {
			document.body.classList.add( 'print-pdf' );
		}
		dom.background.innerHTML = '';
		dom.background.classList.add( 'no-transition' );
		function _createBackground( slide, container ) {
			var data = {
				background: slide.getAttribute( 'data-background' ),
				backgroundSize: slide.getAttribute( 'data-background-size' ),
				backgroundImage: slide.getAttribute( 'data-background-image' ),
				backgroundColor: slide.getAttribute( 'data-background-color' ),
				backgroundRepeat: slide.getAttribute( 'data-background-repeat' ),
				backgroundPosition: slide.getAttribute( 'data-background-position' ),
				backgroundTransition: slide.getAttribute( 'data-background-transition' )
			};
			var element = document.createElement( 'div' );
			element.className = 'slide-background';
			if( data.background ) {
				if( /^(http|file|\/\/)/gi.test( data.background ) || /\.(svg|png|jpg|jpeg|gif|bmp)$/gi.test( data.background ) ) {
					element.style.backgroundImage = 'url('+ data.background +')';
				}
				else {
					element.style.background = data.background;
				}
			}
			if( data.background || data.backgroundColor || data.backgroundImage ) {
				element.setAttribute( 'data-background-hash', data.background + data.backgroundSize + data.backgroundImage + data.backgroundColor + data.backgroundRepeat + data.backgroundPosition + data.backgroundTransition );
			}
			if( data.backgroundSize ) element.style.backgroundSize = data.backgroundSize;
			if( data.backgroundImage ) element.style.backgroundImage = 'url("' + data.backgroundImage + '")';
			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 );
			container.appendChild( element );
			return element;
		}
		toArray( document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) ).forEach( function( slideh ) {
			var backgroundStack;
			if( isPrintingPDF() ) {
				backgroundStack = _createBackground( slideh, slideh );
			}
			else {
				backgroundStack = _createBackground( slideh, dom.background );
			}
			toArray( slideh.querySelectorAll( 'section' ) ).forEach( function( slidev ) {
				if( isPrintingPDF() ) {
					_createBackground( slidev, slidev );
				}
				else {
					_createBackground( slidev, backgroundStack );
				}
			} );
		} );
		if( config.parallaxBackgroundImage ) {
			dom.background.style.backgroundImage = 'url("' + config.parallaxBackgroundImage + '")';
			dom.background.style.backgroundSize = config.parallaxBackgroundSize;
			setTimeout( function() {
				dom.wrapper.classList.add( 'has-parallax-background' );
			}, 1 );
		}
		else {
			dom.background.style.backgroundImage = '';
			dom.wrapper.classList.remove( 'has-parallax-background' );
		}
	}
function createBackgrounds ( ) { if ( isPrintingPDF ( ) ) { document . body . classList . add ( 'print-pdf' ) ; } dom . background . innerHTML = '' ; dom . background . classList . add ( 'no-transition' ) ; function _createBackground ( slide , container ) { var data = { background : slide . getAttribute ( 'data-background' ) , backgroundSize : slide . getAttribute ( 'data-background-size' ) , backgroundImage : slide . getAttribute ( 'data-background-image' ) , backgroundColor : slide . getAttribute ( 'data-background-color' ) , backgroundRepeat : slide . getAttribute ( 'data-background-repeat' ) , backgroundPosition : slide . getAttribute ( 'data-background-position' ) , backgroundTransition : slide . getAttribute ( 'data-background-transition' ) } ; var element = document . createElement ( 'div' ) ; element . className = 'slide-background' ; if ( data . background ) { if ( / ^(http|file|\/\/) / gi . test ( data . background ) || / \.(svg|png|jpg|jpeg|gif|bmp)$ / gi . test ( data . background ) ) { element . style . backgroundImage = 'url(' + data . background + ')' ; } else { element . style . background = data . background ; } } if ( data . background || data . backgroundColor || data . backgroundImage ) { element . setAttribute ( 'data-background-hash' , data . background + data . backgroundSize + data . backgroundImage + data . backgroundColor + data . backgroundRepeat + data . backgroundPosition + data . backgroundTransition ) ; } if ( data . backgroundSize ) element . style . backgroundSize = data . backgroundSize ; if ( data . backgroundImage ) element . style . backgroundImage = 'url("' + data . backgroundImage + '")' ; 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 ) ; container . appendChild ( element ) ; return element ; } toArray ( document . querySelectorAll ( HORIZONTAL_SLIDES_SELECTOR ) ) . forEach ( function ( slideh ) { var backgroundStack ; if ( isPrintingPDF ( ) ) { backgroundStack = _createBackground ( slideh , slideh ) ; } else { backgroundStack = _createBackground ( slideh , dom . background ) ; } toArray ( slideh . querySelectorAll ( 'section' ) ) . forEach ( function ( slidev ) { if ( isPrintingPDF ( ) ) { _createBackground ( slidev , slidev ) ; } else { _createBackground ( slidev , backgroundStack ) ; } } ) ; } ) ; if ( config . parallaxBackgroundImage ) { dom . background . style . backgroundImage = 'url("' + config . parallaxBackgroundImage + '")' ; dom . background . style . backgroundSize = config . parallaxBackgroundSize ; setTimeout ( function ( ) { dom . wrapper . classList . add ( 'has-parallax-background' ) ; } , 1 ) ; } else { dom . background . style . backgroundImage = '' ; dom . wrapper . classList . remove ( 'has-parallax-background' ) ; } }
Creates the slide background elements and appends them
 to the background container.
Creates the slide background elements and appends them to the background container .
// Clear prior backgrounds // Helper method for creating a background element for the // given slide // Auto-wrap image urls in url(...) // Additional and optional background properties // Iterate over all horizontal slides // Iterate over all vertical slides // Add parallax background if specified // Make sure the below properties are set on the element - these properties are // needed for proper transitions to be set on the element via CSS. To remove // annoying background slide-in effect when the presentation starts, apply // these properties after short time delay