AI CSS Animations

Echo Ping Text Effect

A copy of the word swells out from the text and fades, like a sonar ping or a live indicator. It is the same keyframe as Tailwind's animate-ping, applied to a word instead of a dot.

Also known as: sonar ping text, text echo animation, radiating text.

LIVE

HTML

<div class="txt-echo-ping-text">LIVE<span class="txt-echo-ping-text-echo" aria-hidden="true">LIVE</span></div>

CSS

.txt-echo-ping-text {
  --c: var(--txt-color, #3b82f6);
  font-size: var(--txt-size, 32px);
  font-family: system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.2;
  position: relative;
  display: inline-block;
  color: var(--c);
  letter-spacing: 0.06em;}
.txt-echo-ping-text-echo {
  position: absolute;
  inset: 0;
  color: color-mix(in srgb, var(--c) 50%, transparent);
  animation: txt-echo-ping-text-ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes txt-echo-ping-text-ping {
  75%, 100% { transform: scale(2); opacity: 0; }
}

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

Tailwind CSS version

The same effect using Tailwind utility classes. No custom CSS or config needed.

<div class="relative inline-block text-4xl font-bold tracking-wider text-blue-500">
  LIVE
  <span class="absolute inset-0 animate-ping text-blue-500/50" aria-hidden="true">LIVE</span>
</div>

Customizing this snippet

  • Color: set --txt-color on the element or a parent. Currently previewing #3b82f6.
  • Font size: set --txt-size. Every other dimension is in em, so the whole thing scales together. Currently previewing 40px.
  • 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 text animations