AI CSS Animations

Thinking Shimmer Label

A Thinking label with a soft band of light sweeping through its letters while a four point sparkle turns a quarter and breathes. The sweep is a gradient clipped to the text.

Also known as: ai thinking animation css, thinking text shimmer, chatgpt thinking animation, shimmer text loading.

Thinking

HTML

<div class="aia-thinking-shimmer" role="status" aria-label="Thinking">
  <svg class="aia-thinking-shimmer-mark" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2c.6 5.2 3.8 8.4 10 10-6.2 1.6-9.4 4.8-10 10-.6-5.2-3.8-8.4-10-10 6.2-1.6 9.4-4.8 10-10Z"/></svg>
  <span class="aia-thinking-shimmer-text">Thinking</span>
</div>

CSS

.aia-thinking-shimmer {
  --c: var(--aia-color, #7c5cff);
  font-size: var(--aia-size, 16px);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.4;
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
}
.aia-thinking-shimmer-mark {
  width: 1.9em;
  height: 1.9em;
  fill: var(--c);
  filter: drop-shadow(0 0 0.4em color-mix(in srgb, var(--c) 45%, transparent));
  animation: aia-thinking-shimmer-turn 2.4s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}
.aia-thinking-shimmer-text {
  font-size: 1.6em;
  font-weight: 500;
  letter-spacing: -0.01em;
  background: linear-gradient(
      100deg,
      color-mix(in srgb, currentColor 42%, transparent) 38%,
      color-mix(in srgb, var(--c) 40%, currentColor) 50%,
      color-mix(in srgb, currentColor 42%, transparent) 62%
    )
    0 0 / 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: aia-thinking-shimmer-sweep 2.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes aia-thinking-shimmer-turn {
  0%   { transform: rotate(0deg) scale(1); }
  50%  { transform: rotate(45deg) scale(0.8); }
  100% { transform: rotate(90deg) scale(1); }
}
@keyframes aia-thinking-shimmer-sweep {
  0%        { background-position: 100% 0; }
  75%, 100% { background-position: 0% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .aia-thinking-shimmer-mark,
  .aia-thinking-shimmer-text { animation: none; }
  .aia-thinking-shimmer-text { background-position: 50% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .aia-thinking-shimmer, .aia-thinking-shimmer *, .aia-thinking-shimmer::before, .aia-thinking-shimmer::after, .aia-thinking-shimmer *::before, .aia-thinking-shimmer *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

Customizing this snippet

  • Color: set --aia-color on the element or a parent. Currently previewing #3b82f6.
  • Base size: set --aia-size. Every other dimension is in em, so the whole thing scales together. Currently previewing 16px.
  • Speed: change the duration on the transition or animation shorthand. Staggered delays are relative, so they keep their rhythm.
  • Reduced motion: the rule at the end of the CSS turns the motion off for people who asked their OS for less of it. Keep it.

Similar ai animations