پیشنمایش زنده
کد HTML
<div class="loader-wrapper">
<div class="circle-loader">
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
</div>
<div class="loading-text">Loading...</div>
</div>
کد CSS
.loader-wrapper {
position: relative;
width: 100%;
height: 200px;
display: flex;
justify-content: center;
align-items: center;
}
.circle-loader {
display: flex;
gap: 15px;
}
.circle {
width: 45px;
height: 45px;
border-radius: 50%;
background: radial-gradient(circle at 30% 30%, #f5f5f5, #d5d5d5);
position: relative;
box-shadow:
6px 6px 12px rgba(0, 0, 0, 0.15),
-6px -6px 12px rgba(255, 255, 255, 0.8),
inset 2px 2px 4px rgba(0, 0, 0, 0.1),
inset -2px -2px 4px rgba(255, 255, 255, 0.9);
animation: circleRotate 2s ease-in-out infinite;
}
.circle:nth-child(1) {
animation-delay: 0s;
}
.circle:nth-child(2) {
animation-delay: 0.2s;
}
.circle:nth-child(3) {
animation-delay: 0.3s;
}
.circle:nth-child(4) {
animation-delay: 0.4s;
}
.circle:nth-child(5) {
animation-delay: 0.5s;
}
.circle:nth-child(6) {
animation-delay: 0.6s;
}
.circle:nth-child(7) {
animation-delay: 0.7s;
}
.circle::before {
content: "";
position: absolute;
top: 8px;
left: 8px;
width: 15px;
height: 15px;
background: radial-gradient(circle, rgba(255, 255, 255, 0.8), transparent);
border-radius: 50%;
}
@keyframes circleRotate {
0% {
transform: scale(1) rotateZ(0deg);
box-shadow:
6px 6px 12px rgba(0, 0, 0, 0.15),
-6px -6px 12px rgba(255, 255, 255, 0.8),
inset 2px 2px 4px rgba(0, 0, 0, 0.1),
inset -2px -2px 4px rgba(255, 255, 255, 0.9);
}
50% {
transform: scale(1.2) rotateZ(180deg);
box-shadow:
8px 8px 16px rgba(0, 0, 0, 0.2),
-8px -8px 16px rgba(255, 255, 255, 0.9),
inset 3px 3px 6px rgba(0, 0, 0, 0.15),
inset -3px -3px 6px rgba(255, 255, 255, 1);
}
100% {
transform: scale(1) rotateZ(360deg);
box-shadow:
6px 6px 12px rgba(0, 0, 0, 0.15),
-6px -6px 12px rgba(255, 255, 255, 0.8),
inset 2px 2px 4px rgba(0, 0, 0, 0.1),
inset -2px -2px 4px rgba(255, 255, 255, 0.9);
}
}
.loading-text {
position: absolute;
bottom: 30px;
left: 50%;
transform: translateX(-50%);
font-size: 24px;
font-weight: 300;
color: #444;
letter-spacing: 1px;
animation: fadeBlink 1.5s infinite;
}
@keyframes fadeBlink {
0%,
100% {
opacity: 1;
transform: translateX(-50%) translateY(0);
}
50% {
opacity: 0.4;
transform: translateX(-50%) translateY(-3px);
}
}