پیشنمایش زنده
کد HTML
<div class="loader">
<div class="nucleus"></div>
<div class="ring"></div>
<div class="ring"></div>
<div class="ring"></div>
<div class="ring"></div>
<div class="ring"></div>
<div class="ring"></div>
</div>
کد CSS
.loader {
display: flex;
justify-content: center;
align-items: center;
position: relative;
animation: pulse 2s infinite ease-in-out;
}
.ring {
position: absolute;
width: 190px;
height: 190px;
border: px solid transparent;
border-radius: 50%;
--color: #fe53bb;
border-bottom: 8px solid var(--color);
animation: rotate1 1s ease-in-out infinite;
box-shadow: 0 0 4px #8e8e8e;
}
@keyframes rotate1 {
from {
transform: rotateX(50deg) rotateZ(110deg);
}
to {
transform: rotateX(50deg) rotateZ(470deg);
}
}
.ring:nth-child(2) {
--color: #8f51ea;
animation-name: rotate2;
}
@keyframes rotate2 {
from {
transform: rotateX(20deg) rotateY(50deg) rotateZ(20deg);
}
to {
transform: rotateX(20deg) rotateY(50deg) rotateZ(380deg);
}
}
.ring:nth-child(3) {
--color: #0044ff;
animation-name: rotate3;
}
@keyframes rotate3 {
from {
transform: rotateX(40deg) rotateY(130deg) rotateZ(450deg);
}
to {
transform: rotateX(40deg) rotateY(130deg) rotateZ(90deg);
}
}
.ring:nth-child(4) {
--color: #fe53bb;
animation-name: rotate4;
width: 380px;
height: 380px;
border: 2px solid transparent;
border-bottom: 16px solid var(--color);
}
@keyframes rotate4 {
from {
transform: rotateX(50deg) rotateZ(470deg);
}
to {
transform: rotateX(50deg) rotateZ(110deg);
}
}
.ring:nth-child(5) {
--color: #8f51ea;
animation-name: rotate5;
width: 380px;
height: 380px;
border: 2px solid transparent;
border-bottom: 16px solid var(--color);
}
@keyframes rotate5 {
from {
transform: rotateX(20deg) rotateY(50deg) rotateZ(380deg);
}
to {
transform: rotateX(20deg) rotateY(50deg) rotateZ(20deg);
}
}
.ring:nth-child(6) {
--color: #0044ff;
animation-name: rotate6;
width: 380px;
height: 380px;
border: 2px solid transparent;
border-bottom: 16px solid var(--color);
}
@keyframes rotate6 {
from {
transform: rotateX(40deg) rotateY(130deg) rotateZ(90deg);
}
to {
transform: rotateX(40deg) rotateY(130deg) rotateZ(450deg);
}
}
/* Pulsing animation for nucleus */
@keyframes pulse {
0%,
100% {
transform: translate(-50%, -50%) scale(1);
box-shadow:
0 0 20px #fe53bb,
0 0 40px #8f51ea;
}
50% {
transform: translate(-50%, -50%) scale(1.2);
box-shadow:
0 0 30px #fe53bb,
0 0 60px #8f51ea;
}
}
.nucleus {
width: 20px;
height: 20px;
background: radial-gradient(circle, #fe53bb, #8f51ea);
border-radius: 50%;
box-shadow:
0px 0 20px #fe53bb,
0 0 40px #8f51ea;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
animation: pulse 1s ease-in-out infinite;
}