<div class="loader">
<span></span>
<span></span>
<span></span>
</div>
*{
box-sizing:border-box;
margin:0;
padding:0;
}
html,
body {
height:100vh;
display:flex;
align-items:center;
justify-content:center;
background-color: #212121;
font-family:arial;
}
.loader {
position: relative;
width: 180px;
height: 180px;
display: flex;
justify-content: center;
align-items: center;
transform-style: preserve-3d;
transform: perspective(500px) rotateX(45deg);
}
.loader span {
position: absolute;
display: block;
border: 15px solid #fff;
box-sizing: border-box;
border-radius: 50%;
box-shadow: 0 10px 0 #e0e0e0, inset 0 10px 0 #e0e0e0;
animation: animate_5013 4.5s ease-in-out infinite;
}
.loader span:nth-child(1) {
animation-delay: 0s;
}
.loader span:nth-child(2) {
animation-delay: 1.5s;
}
.loader span:nth-child(3) {
animation-delay: 3s;
}
@keyframes animate_5013 {
0% {
transform: translateZ(-100px);
width: 100%;
height: 100%;
}
25% {
transform: translateZ(100px);
width: 100%;
height: 100%;
}
50% {
transform: translateZ(100px);
width: 35%;
height: 35%;
}
75% {
transform: translateZ(-100px);
width: 35%;
height: 35%;
}
100% {
transform: translateZ(-100px);
width: 100%;
height: 100%;
}
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.