The back dot crouches, springs over the other two and lands at the front with a squash while they shuffle along underneath. A tiny conveyor of hops that never drifts off center.
Also known as: hopping dots loader, jumping over dots, dots jumping animation.
<div class="ldr-leapfrog-dots" role="status" aria-label="Loading"> <span></span><span></span><span></span> </div>
.ldr-leapfrog-dots {
--s: var(--ldr-size, 48px);
--c: var(--ldr-color, #3b82f6);
--d: calc(var(--s) / 4.5);
--g: calc(var(--s) / 2.6);
position: relative;
width: calc(var(--g) * 2 + var(--d));
height: var(--s);
}
.ldr-leapfrog-dots span {
position: absolute;
bottom: calc(var(--s) / 8);
left: 0;
width: var(--d);
height: var(--d);
animation: ldr-leapfrog-dots-x 1.8s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
.ldr-leapfrog-dots span::before {
content: "";
position: absolute;
inset: 0;
border-radius: 50%;
background: var(--c);
transform-origin: 50% 100%;
animation: ldr-leapfrog-dots-y 1.8s infinite;
}
.ldr-leapfrog-dots span:nth-child(2),
.ldr-leapfrog-dots span:nth-child(2)::before { animation-delay: -0.6s; }
.ldr-leapfrog-dots span:nth-child(3),
.ldr-leapfrog-dots span:nth-child(3)::before { animation-delay: -1.2s; }
@keyframes ldr-leapfrog-dots-x {
0%, 90%, 100% { transform: translateX(calc(var(--g) * 2)); }
23.33%, 33.33% { transform: translateX(var(--g)); }
56.67%, 66.67% { transform: translateX(0); }
}
@keyframes ldr-leapfrog-dots-y {
0%, 58%, 100% { transform: translateY(0) scale(1, 1); animation-timing-function: ease-in-out; }
66.67% { transform: translateY(0) scale(1.25, 0.72); animation-timing-function: cubic-bezier(0.2, 0.7, 0.4, 1); }
78.33% { transform: translateY(calc(var(--s) * -0.55)) scale(0.9, 1.12); animation-timing-function: cubic-bezier(0.6, 0, 0.8, 0.4); }
90% { transform: translateY(0) scale(1.3, 0.7); animation-timing-function: cubic-bezier(0.3, 1.5, 0.6, 1); }
96% { transform: translateY(0) scale(1, 1); }
}
@media (prefers-reduced-motion: reduce) {
.ldr-leapfrog-dots, .ldr-leapfrog-dots *, .ldr-leapfrog-dots::before, .ldr-leapfrog-dots::after, .ldr-leapfrog-dots *::before, .ldr-leapfrog-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.