پیشنمایش زنده
کد HTML
<span class="loader"></span>
کد CSS
.loader {
width: 48px;
height: 48px;
display: block;
margin: 15px auto;
position: relative;
color: #6ebeff;
box-sizing: border-box;
animation: rotation 1s linear infinite;
}
.loader::after,
.loader::before {
content: "";
box-sizing: border-box;
position: absolute;
width: 24px;
height: 24px;
top: 0;
background-color: #6ebeff;
border-radius: 50%;
animation: scale50 1s infinite ease-in-out;
}
.loader::before {
top: auto;
bottom: 0;
background-color: #337ab7;
animation-delay: 0.5s;
}
@keyframes rotation {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
@keyframes scale50 {
0%,
100% {
transform: scale(0);
}
50% {
transform: scale(1);
}
}