Demo
Lihat teks HTML
<div class="labu">
<div class="papan">
<div class="bola"></div>
</div>
</div>
<style>
.labu {
display: flex;
justify-content: center;
align-items: center;
height: 60vh;
background: #0081cb33;
}
.bola {
position: relative;
bottom: 100px;
left: calc(100% - 70px);
width: 100px;
height: 100px;
background: #200022;
border-radius: 50%;
animation: bolagrk 2s ease-in-out 1.5s infinite alternate;
}
.bola::after {
position: absolute;
content: '';
top: 50px;
right: 10px;
width: 10px;
height: 10px;
background: #fff;
border-radius: 50%;
}
.papan {
width: 500px;
height: 25px;
background: linear-gradient(45deg, #666, #444, #888, #aaa, #ccc) fixed;
border-radius: 30px;
transform: rotate(-15deg);
filter: drop-shadow(20px 10px 4px gray);
animation: naikt 2s ease-in-out 1.5s infinite alternate;
}
@media screen and (max-width: 600px) {
.bola {
position: relative;
bottom: 80px;
width: 80px;
height: 80px;
}
}
@keyframes naikt {
from {transform: rotate(-15deg);}
to {transform: rotate(15deg);}
}
@keyframes bolagrk {
from {left: calc(100% - 70px); transform: rotate(360deg);}
to {left: calc(0% - 35px); transform: rotate(0deg);}
}
</style>
Tutup
Rujukan CSS di codepen.io/aniketkudale/full/GREgYXy
Ulasan