CSS Preloader
A small CSS preloader example that is a little different than the traditional spinner
by Emily Humphrey
HTML
<body>
<div id="spinner" class="active">
<span id="ball_1" class="spinner_ball"></span>
<span id="ball_2" class="spinner_ball"></span>
<span id="ball_3" class="spinner_ball"></span>
</div>
</body>
CSS
body {
background-color: black;
}
#spinner.active {
display: block;
}
#spinner {
display: none;
position: absolute;
height: 60px;
width: 60px;
top: 40%;
left: 48%;
z-index: 1;
}
.spinner_ball {
position: absolute;
display: block;
background-color: white;
left: 24px;
width: 12px;
height: 12px;
border-radius: 6px;
}
#ball_1 {
-webkit-animation-timing-function: cubic-bezier(0.5, 0.3, 0.9, 0.9);
-webkit-animation-name: rotate;
-webkit-animation-duration: 2s;
-webkit-animation-iteration-count: infinite;
-webkit-transform-origin: 6px 30px;
}
#ball_2 {
-webkit-animation-timing-function: cubic-bezier(0.5, 0.5, 0.9, 0.9);
-webkit-animation-name: rotate;
-webkit-animation-duration: 2s;
-webkit-animation-iteration-count: infinite;
-webkit-transform-origin: 6px 30px;
}
#ball_3 {
-webkit-animation-timing-function: cubic-bezier(0.5, 0.7, 0.9, 0.9);
-webkit-animation-name: rotate;
-webkit-animation-duration: 2s;
-webkit-animation-iteration-count: infinite;
-webkit-transform-origin: 6px 30px;
}
@-webkit-keyframes rotate {
0% {
-webkit-transform: rotate(0deg) scale(1);
}
100% {
-webkit-transform: rotate(1440deg) scale(1);
}
}