AI CSS Animations

Frosted Glass Loader

Two colored blobs orbit behind a pane of frosted glass, crisp where they poke past the edge and soft behind it. Built on backdrop-filter, so it is glassmorphism in one small loader.

Also known as: glassmorphism loader, glass spinner, backdrop blur loader.

HTML

<div class="ldr-frosted-glass" role="status" aria-label="Loading">
  <span class="ldr-frosted-glass-orbit"></span>
  <span class="ldr-frosted-glass-pane"></span>
</div>

CSS

.ldr-frosted-glass {
  --s: var(--ldr-size, 48px);
  --c: var(--ldr-color, #3b82f6);
  position: relative;
  width: var(--s);
  height: var(--s);
}
.ldr-frosted-glass-orbit {
  position: absolute;
  inset: 0;
  animation: ldr-frosted-glass-spin 2.4s linear infinite;
}
.ldr-frosted-glass-orbit::before,
.ldr-frosted-glass-orbit::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(var(--s) * 0.44);
  height: calc(var(--s) * 0.44);
  margin: calc(var(--s) * -0.22);
  border-radius: 50%;
  background: var(--c);
  transform: translateX(calc(var(--s) * 0.3));
}
.ldr-frosted-glass-orbit::after {
  background: oklch(from var(--c) l c calc(h + 90));
  transform: translateX(calc(var(--s) * -0.3));
}
.ldr-frosted-glass-pane {
  position: absolute;
  inset: 10%;
  border: 1px solid color-mix(in srgb, var(--ldr-color, #3b82f6) 45%, transparent);
  border-radius: 30%;
  background: color-mix(in srgb, var(--ldr-color, #3b82f6) 10%, transparent);
  -webkit-backdrop-filter: blur(calc(var(--s) / 8));
  backdrop-filter: blur(calc(var(--s) / 8));
}
@keyframes ldr-frosted-glass-spin {
  to { transform: rotate(360deg); }
}

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

Tailwind CSS version

The same loader using only Tailwind's built-in animation utilities. No custom keyframes or config needed.

<div class="relative h-12 w-12" role="status" aria-label="Loading">
  <div class="absolute inset-0 animate-spin [animation-duration:2.4s]">
    <span class="absolute left-[28px] top-[13px] h-[21px] w-[21px] rounded-full bg-blue-500"></span>
    <span class="absolute left-[-1px] top-[13px] h-[21px] w-[21px] rounded-full bg-pink-500"></span>
  </div>
  <div class="absolute inset-[10%] rounded-[30%] border border-blue-500/45 bg-blue-500/10 backdrop-blur-[6px]"></div>
</div>

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