AI CSS Animations

Split Ring Spinner

A ring cracks into two halves that drift apart while it makes a half turn, then snap back together. The halves are the same bordered circle clipped with clip-path inset, one per side.

Also known as: two halves spinner, breaking circle loader, separating ring animation.

HTML

<div class="ldr-split-ring" role="status" aria-label="Loading">
  <span style="--d: -1"></span><span style="--d: 1"></span>
</div>

CSS

.ldr-split-ring {
  --s: var(--ldr-size, 48px);
  --c: var(--ldr-color, #3b82f6);
  position: relative;
  width: var(--s);
  height: var(--s);
  animation: ldr-split-ring-turn 1.6s cubic-bezier(0.7, 0, 0.3, 1) infinite;
}
.ldr-split-ring span {
  position: absolute;
  inset: 0;
  border: calc(var(--s) / 8) solid var(--c);
  border-radius: 50%;
  clip-path: inset(0 calc(50% + var(--s) / 32) 0 0);
  animation: ldr-split-ring-part 1.6s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}
.ldr-split-ring span + span {
  border-color: color-mix(in srgb, var(--ldr-color, #3b82f6) 55%, transparent);
  clip-path: inset(0 0 0 calc(50% + var(--s) / 32));
}
@keyframes ldr-split-ring-turn {
  0%, 15%   { transform: rotate(0deg); }
  85%, 100% { transform: rotate(180deg); }
}
@keyframes ldr-split-ring-part {
  0%, 100% { transform: translateX(0); }
  35%, 65% { transform: translateX(calc(var(--d) * var(--s) / 7)); }
}

@media (prefers-reduced-motion: reduce) {
  .ldr-split-ring, .ldr-split-ring *, .ldr-split-ring::before, .ldr-split-ring::after, .ldr-split-ring *::before, .ldr-split-ring *::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