One dot splits into two, the two split into four, and all four snap back into one while the group turns a quarter. Four stacked dots read their split direction from --x and --y signs.
Also known as: cell division loader, dividing dots animation, one to four dots.
<div class="ldr-splitting-dots" role="status" aria-label="Loading"> <span style="--x:-1;--y:-1"></span><span style="--x:-1;--y:1"></span><span style="--x:1;--y:-1"></span><span style="--x:1;--y:1"></span> </div>
.ldr-splitting-dots {
--s: var(--ldr-size, 48px);
--c: var(--ldr-color, #3b82f6);
--d: calc(var(--s) / 3.4);
--g: calc(var(--s) * 0.27);
position: relative;
width: var(--s);
height: var(--s);
animation: ldr-splitting-dots-turn 2.2s cubic-bezier(0.7, 0, 0.3, 1) infinite;
}
.ldr-splitting-dots span {
position: absolute;
top: calc(50% - var(--d) / 2);
left: calc(50% - var(--d) / 2);
width: var(--d);
height: var(--d);
border-radius: 50%;
background: var(--c);
animation: ldr-splitting-dots-split 2.2s cubic-bezier(0.7, 0, 0.25, 1.25) infinite;
}
@keyframes ldr-splitting-dots-split {
0%, 8%, 94%, 100% { transform: translate(0, 0); }
30%, 42% { transform: translate(calc(var(--x) * var(--g)), 0); }
64%, 74% { transform: translate(calc(var(--x) * var(--g)), calc(var(--y) * var(--g))); }
}
@keyframes ldr-splitting-dots-turn {
0%, 74% { transform: rotate(0deg); }
94%, 100% { transform: rotate(90deg); }
}
@media (prefers-reduced-motion: reduce) {
.ldr-splitting-dots, .ldr-splitting-dots *, .ldr-splitting-dots::before, .ldr-splitting-dots::after, .ldr-splitting-dots *::before, .ldr-splitting-dots *::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.