Jelly Cube
Bounce · Jelly cube · playful, cool
HTML
<div class="utw-loader-jelly-cube" role="status"> <span class="utw-loader-jelly-cube__shadow"></span> <span class="utw-loader-jelly-cube__cube"></span> <span class="utw-loader-jelly-cube__sr">Loading…</span> </div>
CSS
/* Bounce loader (Jelly cube) */
.utw-loader-jelly-cube {
box-sizing: border-box;
position: relative;
display: inline-block;
width: 64px;
height: 64px;
}
.utw-loader-jelly-cube *,
.utw-loader-jelly-cube *::before,
.utw-loader-jelly-cube *::after {
box-sizing: border-box;
}
.utw-loader-jelly-cube__cube {
position: absolute;
bottom: 4px;
left: calc(50% - 10px);
width: 20px;
height: 20px;
border-radius: 4.4px;
background: #4f46e5;
transform-origin: 50% 100%;
animation: utw-loader-jelly-cube-jelly 1.2s ease-in-out infinite;
}
.utw-loader-jelly-cube__shadow {
position: absolute;
bottom: 0;
left: calc(50% - 12px);
width: 24px;
height: 4px;
border-radius: 50%;
background: #c7d2fe;
animation: utw-loader-jelly-cube-jshadow 1.2s ease-in-out infinite;
}
.utw-loader-jelly-cube__sr {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}
@keyframes utw-loader-jelly-cube-jelly {
0%,
100% {
transform: translateY(0) rotate(0deg) scale(1.15, 0.85);
}
15% {
transform: translateY(0) rotate(0deg) scale(1, 1);
}
50% {
transform: translateY(-38px) rotate(45deg) scale(1, 1);
}
85% {
transform: translateY(0) rotate(90deg) scale(1, 1);
}
}
@keyframes utw-loader-jelly-cube-jshadow {
0%,
15%,
85%,
100% {
transform: scale(1);
opacity: 0.8;
}
50% {
transform: scale(0.5);
opacity: 0.35;
}
}
@keyframes utw-loader-jelly-cube-calm {
from {
opacity: 1;
}
to {
opacity: 0.5;
}
}
@media (prefers-reduced-motion: reduce) {
.utw-loader-jelly-cube *,
.utw-loader-jelly-cube *::before,
.utw-loader-jelly-cube *::after {
animation: none !important;
}
.utw-loader-jelly-cube {
animation: utw-loader-jelly-cube-calm 2s ease-in-out infinite alternate !important;
}
}