Last active
July 19, 2017 15:33
-
-
Save brycejacobson/84918d059406e959974c465bb46de7e7 to your computer and use it in GitHub Desktop.
Simple Page Load Transition
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="loader"> | |
<div class="spinner"></div> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(window).load(function() { | |
// Fadeout loader | |
setTimeout(function() { | |
$('#loader').fadeOut('500'); | |
}, 500); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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