Код HTML
<div class="preloader">
<div class="loader-text">LOADING</div>
<div class="loader"></div>
</div>
Код CSS
.preloader {
background: #222;
position: fixed;
width: 100%;
height: 100%;
left: 0;
top: 0;
z-index: 9999;
}
.loader-text {
display: block;
position: absolute;
top: 50%;
left: 50%;
color: #999;
width: 100px;
height: 30px;
margin: -7px 0 0 -45px;
text-align: center;
font-family: 'PT Sans Narrow', sans-serif;
font-size: 20px;
}
.loader {
display: block;
position: relative;
left: 50%;
top: 50%;
width: 170px;
height: 170px;
margin: -85px 0 0 -85px;
border: 3px solid #F00;
}
.loader:after {
content: "";
position: absolute;
border: 3px solid #0F0;
left: 15px;
right: 15px;
top: 15px;
bottom: 15px;
}
.loader:before {
content: "";
position: absolute;
border: 3px solid #00F;
left: 5px;
right: 5px;
top: 5px;
bottom: 5px;
}
.loader {
border: 3px solid transparent;
border-top-color: #4D658D;
border-bottom-color: #4D658D;
border-radius: 50%;
animation: loader 2s linear infinite;
}
.loader:before {
border: 3px solid transparent;
border-top-color: #D4CC6A;
border-bottom-color: #D4CC6A;
border-radius: 50%;
animation: loader 3s linear infinite;
}
.loader:after {
border: 3px solid transparent;
border-top-color: #84417C;
border-bottom-color: #84417C;
border-radius: 50%;
animation: loader 1.5s linear infinite;
}
@keyframes loader {
0% {
-webkit-transform: rotate(0deg);
-ms-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
-ms-transform: rotate(360deg);
transform: rotate(360deg);
}
}
Код JavaScript
$(window).on('load', function() {
$('.loader').delay(1000).fadeOut();
$('.preloader').delay(1000).fadeOut('slow');
})