AI CSS Animations

Waving Hand

Waves hello from the wrist: a few big arcs from the bottom corner, then a rest before the next hello. Great next to a greeting in an onboarding screen. The transform-origin sits low and to the right.

Also known as: waving hand animation css, hand wave animation, hello wave.

HTML

<div class="kfa-waving-hand"><svg class="kfa-waving-hand-icon" viewBox="0 0 24 24" aria-hidden="true"><rect x="6.6" y="10.5" width="11" height="11" rx="4.4" /><rect x="6.6" y="4.4" width="2.5" height="10" rx="1.25" /><rect x="9.5" y="2.6" width="2.5" height="11" rx="1.25" /><rect x="12.4" y="3.2" width="2.5" height="10.5" rx="1.25" /><rect x="15.2" y="5.6" width="2.4" height="8.5" rx="1.2" /><rect x="4.5" y="9.5" width="2.5" height="8.5" rx="1.25" transform="rotate(-32 5.75 16)" /></svg></div>

CSS

.kfa-waving-hand {
  --c: var(--kfa-color, #3b82f6);
  font-size: var(--kfa-size, 16px);
  display: grid;
  place-items: center;
  width: 5.5em;
  height: 5.5em;
  border-radius: 1em;
  background: var(--c);
  color: #fff;
  font-family: system-ui, sans-serif;
  font-weight: 700;
  box-shadow: 0 0.6em 1.4em -0.6em color-mix(in srgb, var(--c) 70%, transparent);
  transform-origin: 70% 90%;
  animation: kfa-waving-hand-hello 2.4s ease-in-out infinite;
}
.kfa-waving-hand-icon {
  width: 2.8em;
  height: 2.8em;
  fill: currentColor;
}
@keyframes kfa-waving-hand-hello {
  0%, 60%, 100% { transform: rotate(0); }
  8% { transform: rotate(16deg); }
  16% { transform: rotate(-9deg); }
  24% { transform: rotate(16deg); }
  32% { transform: rotate(-6deg); }
  40% { transform: rotate(12deg); }
  50% { transform: rotate(-2deg); }
}

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

Customizing this snippet

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