Код HTML
<div class="preloader">
<div class="loader">
<div>G</div>
<div>N</div>
<div>I</div>
<div>D</div>
<div>A</div>
<div>O</div>
<div>L</div>
</div>
</div>
Код CSS
.preloader {
background: #000;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1000;
}
.loader {
position: absolute;
width: 600px;
height: 36px;
left: 50%;
top: 50%;
margin-left: -300px;
overflow: visible;
user-select: none;
cursor: default;
}
.loader div {
position: absolute;
width: 20px;
height: 36px;
opacity: 0;
font-family: Helvetica, Arial, sans-serif;
animation: move 2s linear infinite;
transform: rotate(180deg);
color: #35C4F0;
}
.loader div:nth-child(2) {
animation-delay: 0.2s;
}
.loader div:nth-child(3) {
animation-delay: 0.4s;
}
.loader div:nth-child(4) {
animation-delay: 0.6s;
}
.loader div:nth-child(5) {
animation-delay: 0.8s;
}
.loader div:nth-child(6) {
animation-delay: 1s;
}
.loader div:nth-child(7) {
animation-delay: 1.2s;
}
@keyframes move {
0% {
left: 0;
opacity: 0;
}
35% {
left: 41%;
transform: rotate(0deg);
opacity: 1;
}
65% {
left: 59%;
transform: rotate(0deg);
opacity: 1;
}
100% {
left: 100%;
transform: rotate(-180deg);
opacity: 0;
}
}
Код JavaScript
$(window).on('load', function() {
$('.loader').delay(2000).fadeOut();
$('.preloader').delay(2000).fadeOut('slow');
})