<?php 

$preloader_classes = '';

if ( !StockieSettings::get( 'page_preloader', 'global' ) || StockieSettings::get( 'page_preloader', 'global' ) === NULL ) {
	$preloader_classes .= 'hide';
} 
?>

<div class="page-preloader <?php echo esc_attr($preloader_classes) ?>" id="page-preloader">
		<?php
			switch ( StockieSettings::get( 'preloader_type', 'global' ) ) {
				case 'fading_circle':
					echo '<div class="sk-fading-circle sk-preloader">
				        <div class="sk-circle1 sk-circle"></div>
				        <div class="sk-circle2 sk-circle"></div>
				        <div class="sk-circle3 sk-circle"></div>
				        <div class="sk-circle4 sk-circle"></div>
				        <div class="sk-circle5 sk-circle"></div>
				        <div class="sk-circle6 sk-circle"></div>
				        <div class="sk-circle7 sk-circle"></div>
				        <div class="sk-circle8 sk-circle"></div>
				        <div class="sk-circle9 sk-circle"></div>
				        <div class="sk-circle10 sk-circle"></div>
				        <div class="sk-circle11 sk-circle"></div>
				        <div class="sk-circle12 sk-circle"></div>
				      </div>';
					break;
				case 'double_bounce':
					echo '<div class="sk-double-bounce sk-preloader">
				        <div class="sk-child sk-double-bounce1"></div>
				        <div class="sk-child sk-double-bounce2"></div>
				      </div>';
					break;
				case 'waves':
					echo '<div class="sk-wave sk-preloader">
					        <div class="sk-rect sk-rect1"></div>
					        <div class="sk-rect sk-rect2"></div>
					        <div class="sk-rect sk-rect3"></div>
					        <div class="sk-rect sk-rect4"></div>
					        <div class="sk-rect sk-rect5"></div>
					      </div>';
					break;
				case 'three_bounce':
					echo '<div class="sk-three-bounce sk-preloader">
				        <div class="sk-child sk-bounce1"></div>
				        <div class="sk-child sk-bounce2"></div>
				        <div class="sk-child sk-bounce3"></div>
				      </div>';
					break;
				case 'circle':
					echo '<div class="sk-circle sk-preloader">
				        <div class="sk-circle1 sk-child"></div>
				        <div class="sk-circle2 sk-child"></div>
				        <div class="sk-circle3 sk-child"></div>
				        <div class="sk-circle4 sk-child"></div>
				        <div class="sk-circle5 sk-child"></div>
				        <div class="sk-circle6 sk-child"></div>
				        <div class="sk-circle7 sk-child"></div>
				        <div class="sk-circle8 sk-child"></div>
				        <div class="sk-circle9 sk-child"></div>
				        <div class="sk-circle10 sk-child"></div>
				        <div class="sk-circle11 sk-child"></div>
				        <div class="sk-circle12 sk-child"></div>
				      </div>';
					break;
				case 'cube_loader':
					echo '<div class="sk-cube-grid sk-preloader">
				        <div class="sk-cube sk-cube1"></div>
				        <div class="sk-cube sk-cube2"></div>
				        <div class="sk-cube sk-cube3"></div>
				        <div class="sk-cube sk-cube4"></div>
				        <div class="sk-cube sk-cube5"></div>
				        <div class="sk-cube sk-cube6"></div>
				        <div class="sk-cube sk-cube7"></div>
				        <div class="sk-cube sk-cube8"></div>
				        <div class="sk-cube sk-cube9"></div>
				      </div>';
					break;
				case 'folding_cube':
					echo '<div class="sk-folding-cube sk-preloader">
				        <div class="sk-cube1 sk-cube"></div>
				        <div class="sk-cube2 sk-cube"></div>
				        <div class="sk-cube4 sk-cube"></div>
				        <div class="sk-cube3 sk-cube"></div>
				      </div>';
					break;
				case 'custom_loader':
					$preloader = StockieSettings::get( 'custom_preloader', 'global' );
					echo '<div class="custom-preloader">
							<img src="'.$preloader.'" alt="preloader" />
						</div>';
					break;
				default:
					echo '<div class="sk-fading-circle sk-preloader">
				        <div class="sk-circle1 sk-circle"></div>
				        <div class="sk-circle2 sk-circle"></div>
				        <div class="sk-circle3 sk-circle"></div>
				        <div class="sk-circle4 sk-circle"></div>
				        <div class="sk-circle5 sk-circle"></div>
				        <div class="sk-circle6 sk-circle"></div>
				        <div class="sk-circle7 sk-circle"></div>
				        <div class="sk-circle8 sk-circle"></div>
				        <div class="sk-circle9 sk-circle"></div>
				        <div class="sk-circle10 sk-circle"></div>
				        <div class="sk-circle11 sk-circle"></div>
				        <div class="sk-circle12 sk-circle"></div>
				      </div>';
		} ?>
</div>