AI CSS Animations

Solar System Loader

A glowing sun with two planets on faint orbits, spinning at different speeds and in opposite directions. Slow and calm enough for a long wait.

Also known as: planet orbit loader, orbiting planets.

HTML

<div class="ldr-solar-system" role="status" aria-label="Loading">
  <span></span><span></span>
</div>

CSS

.ldr-solar-system {
  --s: var(--ldr-size, 48px);
  --c: var(--ldr-color, #3b82f6);
  position: relative;
  display: grid;
  place-items: center;
  width: var(--s);
  height: var(--s);
}
.ldr-solar-system::before {
  content: "";
  width: calc(var(--s) / 4);
  height: calc(var(--s) / 4);
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 calc(var(--s) / 6) color-mix(in srgb, var(--ldr-color, #3b82f6) 60%, transparent);
}
.ldr-solar-system span {
  position: absolute;
  border: 1px solid color-mix(in srgb, var(--ldr-color, #3b82f6) 30%, transparent);
  border-radius: 50%;
  animation: ldr-solar-system-orbit linear infinite;
}
.ldr-solar-system span:nth-child(1) { inset: 0;   animation-duration: 3s; }
.ldr-solar-system span:nth-child(2) { inset: 24%; animation-duration: 1.4s; animation-direction: reverse; }
.ldr-solar-system span::before {
  content: "";
  position: absolute;
  top: calc(var(--s) / -20);
  left: calc(50% - var(--s) / 20);
  width: calc(var(--s) / 10);
  height: calc(var(--s) / 10);
  border-radius: 50%;
  background: var(--c);
}
@keyframes ldr-solar-system-orbit {
  to { transform: rotate(360deg); }
}

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