پیشنمایش زنده
کد HTML
<div class="loader">
<div class="stick"></div>
<div class="container">
<div class="pin"></div>
<div class="paper-container red">
<div class="paper-leaf-1 red-1"></div>
<div class="paper-leaf-2 red-2"></div>
</div>
<div class="paper-container rotate-90">
<div class="paper-leaf-1 yellow-1"></div>
<div class="paper-leaf-2 yellow-2"></div>
</div>
<div class="paper-container rotate-180">
<div class="paper-leaf-1 green-1"></div>
<div class="paper-leaf-2 green-2"></div>
</div>
<div class="paper-container rotate-270">
<div class="paper-leaf-1 blue-1"></div>
<div class="paper-leaf-2 blue-2"></div>
</div>
</div>
<div class="line"></div>
</div>
کد CSS
.loader {
position: relative;
width: 20px;
height: 20px;
}
.stick {
width: 5px;
height: 150px;
background-color: #a3541c;
position: absolute;
top: 0;
left: 50%;
transform: translate(-50%, 0%);
z-index: -1;
}
.container {
position: relative;
width: 20px;
height: 20px;
transform: rotate(30deg) scale(0.77);
animation: rotateAnimation 3s infinite linear;
}
.pin {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 8px;
height: 8px;
background-color: white;
z-index: 10;
border-radius: 999px;
}
.paper-container {
position: absolute;
scale: 1.5;
}
.paper-leaf-1 {
position: relative;
width: 0;
height: 0;
clip-path: ellipse(50% 50% at 50% 109%);
border-left: 30px solid transparent;
border-right: 30px solid transparent;
border-top-left-radius: 222px;
border-top-right-radius: 222px;
}
.paper-leaf-2 {
position: absolute;
right: -1px;
bottom: 0;
width: 30px;
height: 20.5px;
border-bottom-right-radius: 2px;
z-index: 2;
}
.paper-leaf-2::before {
content: "";
position: absolute;
right: 1/2;
bottom: 0;
width: 24.5px;
height: 20.5px;
clip-path: ellipse(100% 100% at 0% 100%);
border-top-right-radius: 999px;
box-shadow:
inset -5px 0px 3px -3px rgba(0, 0, 0, 0.2),
10px -10px 10px 0px rgba(255, 255, 255, 0.1);
z-index: 1;
}
.red {
top: 50%;
left: 50%;
transform: translate(-80%, -85%);
z-index: 2;
}
.red-1 {
border-bottom: 50px solid #ff5733;
}
.red-2 {
background-color: #ff5733;
}
.rotate-90 {
transform: rotate(90deg) translate(-75%, -10%);
top: 50%;
left: 50%;
z-index: 3;
}
.yellow-1 {
border-bottom: 50px solid #ffc300;
}
.yellow-2 {
background-color: #ffc300;
}
.rotate-180 {
transform: rotate(180deg) translate(-16%, -17%);
top: 50%;
left: 50%;
z-index: 4;
}
.green-1 {
border-bottom: 50px solid #2ecc71;
}
.green-2 {
background-color: #2ecc71;
}
.rotate-270 {
transform: rotate(270deg) translate(-22%, -90%);
top: 50%;
left: 50%;
z-index: 5;
}
.blue-1 {
border-bottom: 50px solid #3498db;
}
.blue-2 {
background-color: #3498db;
}
.grass-container {
position: absolute;
top: 500%;
display: flex;
align-items: end;
justify-content: center;
z-index: -2;
}
.line {
position: absolute;
right: 150px;
top: 150px;
z-index: -2;
}
.line:before {
content: "";
position: absolute;
background-color: #6a994e;
width: 100px;
height: 50px;
border-radius: 50px 50px 0 0;
top: -50px;
left: 50px;
box-shadow: 100px 0 #78a85b;
}
.line:after {
content: "";
position: absolute;
background-color: #78a85b;
width: 50px;
height: 25px;
border-radius: 50px 50px 0 0;
top: -25px;
left: 10px;
box-shadow:
50px 0 #55803c,
105px 0 #6a994e,
195px 0 #6a994e,
225px 0 #a7c957;
}
@keyframes rotateAnimation {
from {
transform: rotate(30deg) scale(0.77);
}
to {
transform: rotate(390deg) scale(0.77);
}
}