AI CSS Animations

Buzz Out Hover Effect

A call button that buzzes like a phone on vibrate: fast little shifts and twists that fade out over three quarters of a second. For a buzz that never stops, set the iteration count to infinite.

Also known as: hvr-buzz-out, vibrate button css, phone ring hover.

HTML

<button class="hfx-buzz-out"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 4h3.5l1.5 4.5-2.2 1.4a11 11 0 0 0 6.3 6.3l1.4-2.2L20 15.5V19a1.5 1.5 0 0 1-1.6 1.5A16.5 16.5 0 0 1 3.5 5.6 1.5 1.5 0 0 1 5 4z"/></svg>Call now</button>

CSS

.hfx-buzz-out {
  --c: var(--hfx-color, #3b82f6);
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.7em 1.6em;
  border-radius: 0.5em;
  font: 600 var(--hfx-size, 16px) system-ui, sans-serif;
  cursor: pointer;
  border: 0;
  background: var(--c);
  color: #fff;
}
.hfx-buzz-out svg {
  width: 1.1em;
  height: 1.1em;
}
.hfx-buzz-out:is(:hover, :focus-visible) {
  animation: hfx-buzz-out-buzz 0.75s linear;
}
@keyframes hfx-buzz-out-buzz {
  10% { transform: translateX(0.2em) rotate(2deg); }
  20% { transform: translateX(-0.2em) rotate(-2deg); }
  30% { transform: translateX(0.18em) rotate(2deg); }
  40% { transform: translateX(-0.18em) rotate(-2deg); }
  50% { transform: translateX(0.13em) rotate(1deg); }
  60% { transform: translateX(-0.13em) rotate(-1deg); }
  70% { transform: translateX(0.08em) rotate(1deg); }
  80% { transform: translateX(-0.08em) rotate(-1deg); }
  90% { transform: translateX(0.04em) rotate(0); }
}

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

Customizing this snippet

  • Color: set --hfx-color on the element or a parent. Currently previewing #3b82f6.
  • Base size: set --hfx-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 hover effects