AI CSS Animations

Waving Hand Link Hover

A waving hand emoji pops out beside a contact link on hover and keeps waving from the wrist. The pop is a transition on transform, the wave animates the separate rotate property.

Also known as: emoji pop on hover, waving hand animation css, say hello link.

HTML

<a class="hfx-link-emoji-wave" href="#">Say hello<span class="hfx-link-emoji-wave-hand" aria-hidden="true">&#x1F44B;</span></a>

CSS

.hfx-link-emoji-wave {
  --c: var(--hfx-color, #3b82f6);
  position: relative;
  display: inline-block;
  color: var(--c);
  font: 600 calc(var(--hfx-size, 16px) * 1.25)/1.3 system-ui, sans-serif;
  text-decoration: none;
  margin-right: 1.3em;}
.hfx-link-emoji-wave-hand {
  position: absolute;
  left: 100%;
  top: 0;
  opacity: 0;
  transform: translate(-0.7em, 0.3em) scale(0.3) rotate(-40deg);
  transform-origin: 70% 85%;
  transition: opacity 0.2s ease, transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: hfx-link-emoji-wave-wave 1.4s ease-in-out infinite paused;
}
.hfx-link-emoji-wave:is(:hover, :focus-visible) .hfx-link-emoji-wave-hand {
  opacity: 1;
  transform: translate(0.3em, 0) scale(1) rotate(0);
  animation-play-state: running;
}
@keyframes hfx-link-emoji-wave-wave {
  0%, 60%, 100% { rotate: 0deg; }
  10%           { rotate: 16deg; }
  20%           { rotate: -8deg; }
  30%           { rotate: 16deg; }
  40%           { rotate: -4deg; }
  50%           { rotate: 10deg; }
}

@media (prefers-reduced-motion: reduce) {
  .hfx-link-emoji-wave, .hfx-link-emoji-wave *, .hfx-link-emoji-wave::before, .hfx-link-emoji-wave::after, .hfx-link-emoji-wave *::before, .hfx-link-emoji-wave *::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

Underline Grow Link
Underline from Center Link
Highlighter Link
Slide Up Text Link