Skip to content

Instantly share code, notes, and snippets.

@brycejacobson
Last active July 19, 2017 15:33
Show Gist options
  • Save brycejacobson/84918d059406e959974c465bb46de7e7 to your computer and use it in GitHub Desktop.
Save brycejacobson/84918d059406e959974c465bb46de7e7 to your computer and use it in GitHub Desktop.
Simple Page Load Transition
<div id="loader">
<div class="spinner"></div>
</div>
$(window).load(function() {
// Fadeout loader
setTimeout(function() {
$('#loader').fadeOut('500');
}, 500);
});
#loader {
background: #ffffff;
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 1000;
}
.spinner {
width: 40px;
height: 40px;
position: absolute;
left: 50%;
top: 50%;
margin: -20px 0 0 -20px;
background-color: #630C0D;
border-radius: 100%;
-webkit-animation: sk-scaleout 1.0s infinite ease-in-out;
animation: sk-scaleout 1.0s infinite ease-in-out;
}
@-webkit-keyframes sk-scaleout {
0% { -webkit-transform: scale(0) }
100% {
-webkit-transform: scale(1.0);
opacity: 0;
}
}
@keyframes sk-scaleout {
0% {
-webkit-transform: scale(0);
transform: scale(0);
} 100% {
-webkit-transform: scale(1.0);
transform: scale(1.0);
opacity: 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment