AI CSS Animations

Dot Tunnel Loader

Rings of dots rush toward you out of a vanishing point and twist as they pass, like flying down a tunnel. Each ring is a dotted border, so the dots grow with perspective for free.

Also known as: warp speed loader, hyperspace tunnel animation, dotted rings zoom.

HTML

<div class="ldr-dot-tunnel" role="status" aria-label="Loading">
  <span></span><span></span><span></span>
</div>

CSS

.ldr-dot-tunnel {
  --s: var(--ldr-size, 48px);
  --c: var(--ldr-color, #3b82f6);
  position: relative;
  width: var(--s);
  height: var(--s);
}
.ldr-dot-tunnel::before {
  content: "";
  position: absolute;
  top: calc(50% - var(--s) / 24);
  left: calc(50% - var(--s) / 24);
  width: calc(var(--s) / 12);
  height: calc(var(--s) / 12);
  border-radius: 50%;
  background: color-mix(in srgb, var(--ldr-color, #3b82f6) 45%, transparent);
}
.ldr-dot-tunnel span {
  position: absolute;
  inset: 0;
  border: calc(var(--s) / 11) dotted var(--c);
  border-radius: 50%;
  opacity: 0;
  animation: ldr-dot-tunnel-zoom 1.8s cubic-bezier(0.6, 0, 0.9, 0.5) infinite;
}
.ldr-dot-tunnel span:nth-child(2) { animation-delay: -0.6s; }
.ldr-dot-tunnel span:nth-child(3) { animation-delay: -1.2s; }
@keyframes ldr-dot-tunnel-zoom {
  0%   { transform: scale(0.12) rotate(0deg); opacity: 0; }
  30%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { transform: scale(1.15) rotate(60deg); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .ldr-dot-tunnel, .ldr-dot-tunnel *, .ldr-dot-tunnel::before, .ldr-dot-tunnel::after, .ldr-dot-tunnel *::before, .ldr-dot-tunnel *::after {
    animation-duration: 3s;
  }
}

Customizing this loader

  • Color: set --ldr-color on the element or a parent. Currently previewing #3b82f6.
  • Size: set --ldr-size. Every dimension in the snippet is derived from it. Currently previewing 64px.
  • Speed: change the duration on the animation shorthand. Delays on the children are relative, so they keep their rhythm.
  • Accessibility: the root carries 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.

Similar loaders