<!DOCTYPE html>
<html lang="en-us">
	<head>
		<meta charset="UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" /> 
		<meta name="viewport" content="width=device-width, initial-scale=1" /> 
		<title>Page Loading Effects|Demo</title>
		<meta name="description" content="Page Loading Effects: " />
		<meta http-equiv="imagetoolbar" content="false" />
		<meta name="author" content="yaozeye.github.io" />
		<meta name="Copyright" content="Copyright yaozeye.github.io All Rights Reserved." />
		<meta name="MSSmartTagsPreventParsing" content="true" />
		<link rel="stylesheet" type="text/css" href="css/normalize.css" />
		<link rel="stylesheet" type="text/css" href="css/demo.css" />
		<link rel="stylesheet" type="text/css" href="css/component.css" />
		<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" /> 
		<link rel="apple-touch-icon" href="../favicon.ico" />
		<script src="js/snap.svg-min.js"></script>
		<script type="text/javascript" src="../js/targetblank.js"></script>
		<!--[if lte IE 9]><script type="text/javascript" src="../select/selectivizr.js"></script><![endif]-->
		<!--[if IE]>
  		<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
		<![endif]-->
	</head>
	<body>
		<div id="pagewrap" class="pagewrap">
			<div class="container show" id="page-1">
				<!-- Top Navigation -->
				<header class="codrops-header">
					<h1 style="margin-top:100px">Page Loading Effects<span></span></h1>
				</header>
				<section class="columns clearfix">
					<div class="column">
						<nav class="codrops-demos">
							<a href="index.html">Effect1</a>
							<a href="index2.html">Effect2</a>
							<a class="current-demo" href="index3.html">Effect3</a>
							<a href="index4.html">Effect4</a>
							<a href="index5.html">Effect5</a>
							<a href="index6.html">Effect6</a>
							<a href="index7.html">Effect7</a>
							<a href="index8.html">Effect8</a>
							<a href="index9.html">Effect9</a>
							<a href="index10.html">Effect10</a>
							<a href="index11.html">Effect11</a>
							<a href="index12.html">Effect12</a>
							<a href="index13.html">Effect13</a>
						</nav>
					</div>
					<div class="column">
						<p></p>
						<p><a class="pageload-link" href="#page-2">Click to preview Effect</a></p>
					</div>
				</section>
				<div class="footer-banner" style="width:728px; margin:30px auto"></div>
			</div><!-- /container -->

			<!-- The new page dummy; this would be dynamically loaded content -->
			<div class="container" id="page-2">
				<section>
					<h2>This is a sample page.</h2>
					<p><a class="pageload-link" href="#page-1">Back</a></p>
				</section>
			</div><!-- /container -->

			<div id="loader" class="pageload-overlay" data-opening="M 0,0 c 0,0 63.5,-16.5 80,0 16.5,16.5 0,60 0,60 L 0,60 Z">
				<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 80 60" preserveAspectRatio="none">
					<path d="M 0,0 c 0,0 -16.5,43.5 0,60 16.5,16.5 80,0 80,0 L 0,60 Z"/>
				</svg>
			</div><!-- /pageload-overlay -->
			
		</div><!-- /pagewrap -->
		<script src="js/classie.js"></script>
		<script src="js/svgLoader.js"></script>
		<script>
			(function() {
				var pageWrap = document.getElementById( 'pagewrap' ),
					pages = [].slice.call( pageWrap.querySelectorAll( 'div.container' ) ),
					currentPage = 0,
					triggerLoading = [].slice.call( pageWrap.querySelectorAll( 'a.pageload-link' ) ),
					loader = new SVGLoader( document.getElementById( 'loader' ), { speedIn : 400, easingIn : mina.easeinout } );

				function init() {
					triggerLoading.forEach( function( trigger ) {
						trigger.addEventListener( 'click', function( ev ) {
							ev.preventDefault();
							loader.show();
							// after some time hide loader
							setTimeout( function() {
								loader.hide();

								classie.removeClass( pages[ currentPage ], 'show' );
								// update..
								currentPage = currentPage ? 0 : 1;
								classie.addClass( pages[ currentPage ], 'show' );

							}, 2000 );
						} );
					} );	
				}

				init();
			})();
		</script>
	</body>
</html>