A circle slowly fills with liquid whose surface rocks like real water. Two rotating rounded squares, clipped by the circle, make the wave.
Also known as: water fill animation, wave fill circle.
<div class="ldr-liquid-fill" role="status" aria-label="Loading"></div>
.ldr-liquid-fill {
--s: var(--ldr-size, 48px);
--c: var(--ldr-color, #3b82f6);
position: relative;
width: var(--s);
height: var(--s);
border: calc(var(--s) / 16) solid var(--c);
border-radius: 50%;
overflow: hidden;
}
.ldr-liquid-fill::before,
.ldr-liquid-fill::after {
content: "";
position: absolute;
left: 50%;
top: 100%;
width: 200%;
aspect-ratio: 1;
border-radius: 42%;
background: var(--c);
animation: ldr-liquid-fill-wave 4s linear infinite, ldr-liquid-fill-rise 5s ease-in-out infinite alternate;
}
.ldr-liquid-fill::after {
border-radius: 40%;
background: color-mix(in srgb, var(--ldr-color, #3b82f6) 55%, transparent);
animation-duration: 6s, 5s;
}
@keyframes ldr-liquid-fill-wave {
from { transform: translateX(-50%) rotate(0deg); }
to { transform: translateX(-50%) rotate(360deg); }
}
@keyframes ldr-liquid-fill-rise {
from { top: 95%; }
to { top: 30%; }
}
@media (prefers-reduced-motion: reduce) {
.ldr-liquid-fill, .ldr-liquid-fill *, .ldr-liquid-fill::before, .ldr-liquid-fill::after {
animation-duration: 3s;
}
}--ldr-color on the element or a parent.
Currently previewing #3b82f6.--ldr-size. Every dimension in the snippet is
derived from it. Currently previewing 64px.animation shorthand.
Delays on the children are relative, so they keep their rhythm.role="status" and an
aria-label so screen readers announce the wait. The reduced-motion rule
at the end slows the animation for users who asked for less motion.