Five bars bounce from a shared baseline at their own tempo, like a now playing icon. Every bar runs the same keyframes at a different duration, so the pattern never visibly repeats.
Also known as: equalizer animation css, now playing animation, audio bars loader.
<div class="ldr-music-equalizer" role="status" aria-label="Loading"> <span></span><span></span><span></span><span></span><span></span> </div>
.ldr-music-equalizer {
--s: var(--ldr-size, 48px);
--c: var(--ldr-color, #3b82f6);
display: flex;
align-items: flex-end;
gap: calc(var(--s) / 12);
width: var(--s);
height: var(--s);
}
.ldr-music-equalizer span {
flex: 1;
height: 100%;
border-radius: calc(var(--s) / 24);
background: var(--c);
transform-origin: 50% 100%;
animation: ldr-music-equalizer-play 1.3s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
.ldr-music-equalizer span:nth-child(2) { animation-duration: 0.9s; animation-delay: -0.4s; }
.ldr-music-equalizer span:nth-child(3) { animation-duration: 1.5s; animation-delay: -1.1s; }
.ldr-music-equalizer span:nth-child(4) { animation-duration: 1.1s; animation-delay: -0.2s; }
.ldr-music-equalizer span:nth-child(5) { animation-duration: 1.7s; animation-delay: -0.8s; }
@keyframes ldr-music-equalizer-play {
0%, 100% { transform: scaleY(0.25); }
15% { transform: scaleY(0.9); }
30% { transform: scaleY(0.45); }
48% { transform: scaleY(1); }
62% { transform: scaleY(0.35); }
80% { transform: scaleY(0.75); }
}
@media (prefers-reduced-motion: reduce) {
.ldr-music-equalizer, .ldr-music-equalizer *, .ldr-music-equalizer::before, .ldr-music-equalizer::after, .ldr-music-equalizer *::before, .ldr-music-equalizer *::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.