AI CSS Animations

Assembling Cube Loader

The three visible faces of an isometric cube fly in from three sides, lock together with a small pop, then drift apart and fade. Three clip-path rhombuses share one box, so no 3D context is needed.

Also known as: isometric cube loader, cube build animation, building block loader.

HTML

<div class="ldr-cube-assemble" role="status" aria-label="Loading">
  <span style="--x: 0; --y: -1; --i: 0"></span>
  <span style="--x: 0.87; --y: 0.5; --i: 1"></span>
  <span style="--x: -0.87; --y: 0.5; --i: 2"></span>
</div>

CSS

.ldr-cube-assemble {
  --s: var(--ldr-size, 48px);
  --c: var(--ldr-color, #3b82f6);
  position: relative;
  width: calc(var(--s) * 0.8);
  height: calc(var(--s) * 0.924);
  animation: ldr-cube-assemble-pop 2.8s infinite;
}
.ldr-cube-assemble span {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--c) 55%, #fff);
  clip-path: polygon(50% 0, 100% 25%, 50% 50%, 0 25%);
  animation: ldr-cube-assemble-fly 2.8s infinite both;
  animation-delay: calc(var(--i) * 0.12s);
}
.ldr-cube-assemble span:nth-child(2) {
  background: var(--c);
  clip-path: polygon(100% 25%, 100% 75%, 50% 100%, 50% 50%);
}
.ldr-cube-assemble span:nth-child(3) {
  background: color-mix(in srgb, var(--c) 62%, #000);
  clip-path: polygon(0 25%, 50% 50%, 50% 100%, 0 75%);
}
@keyframes ldr-cube-assemble-fly {
  0%        { transform: translate(calc(var(--x) * var(--s) * 0.5), calc(var(--y) * var(--s) * 0.5)); opacity: 0; animation-timing-function: cubic-bezier(0.2, 0.9, 0.3, 1); }
  24%, 62%  { transform: translate(0, 0); opacity: 1; animation-timing-function: cubic-bezier(0.55, 0, 0.8, 0.3); }
  86%, 100% { transform: translate(calc(var(--x) * var(--s) * 0.5), calc(var(--y) * var(--s) * 0.5)); opacity: 0; }
}
@keyframes ldr-cube-assemble-pop {
  0%, 32%, 46%, 100% { transform: scale(1); }
  38%                { transform: scale(1.08); }
}

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