AI CSS Animations

Pizza Loader

A pepperoni pizza whose eight slices get taken one by one, then come back in the same order. Each slice is a clip-path wedge with its own delay, like a pie timer you can eat.

Also known as: pizza loading animation, pizza slices loader, food loader css.

HTML

<div class="ldr-pizza" role="status" aria-label="Loading">
  <span style="--i: 0"></span><span style="--i: 1"></span><span style="--i: 2"></span><span style="--i: 3"></span>
  <span style="--i: 4"></span><span style="--i: 5"></span><span style="--i: 6"></span><span style="--i: 7"></span>
</div>

CSS

.ldr-pizza {
  --s: var(--ldr-size, 48px);
  --c: var(--ldr-color, #3b82f6);
  position: relative;
  width: var(--s);
  height: var(--s);
}
.ldr-pizza span {
  position: absolute;
  inset: 0;
  clip-path: polygon(50% 50%, 51.9% -22%, 99.6% -2.2%);
  background:
    radial-gradient(circle calc(var(--s) * 0.065) at 61% 25%, color-mix(in srgb, var(--c) 55%, #000) 92%, transparent),
    radial-gradient(closest-side, var(--c) 78%, color-mix(in srgb, var(--ldr-color, #3b82f6) 50%, transparent) 80% 97%, transparent 99%);
  transform: rotate(calc(var(--i) * 45deg));
  animation: ldr-pizza-eat 3.2s cubic-bezier(0.5, 0, 0.3, 1) calc(var(--i) * 0.2s) infinite;
}
@keyframes ldr-pizza-eat {
  0%, 4% {
    transform: rotate(calc(var(--i) * 45deg));
    opacity: 1;
  }
  14%, 50% {
    transform: rotate(calc(var(--i) * 45deg)) translate(calc(var(--s) * 0.06), calc(var(--s) * -0.15)) scale(0.7);
    opacity: 0;
  }
  60%, 100% {
    transform: rotate(calc(var(--i) * 45deg));
    opacity: 1;
  }
}

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