AI CSS Animations

Jello

The box jiggles like gelatin: it leans into a parallelogram one way, then the other, squishing slightly as it goes, and firms up. Built from skew() plus a little scale, no rotation.

Also known as: jello animation css, jelly wobble, jiggle effect.

Jello

HTML

<div class="kfa-jello">Jello</div>

CSS

.kfa-jello {
  --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);
  animation: kfa-jello-jiggle 1s ease-in-out both;
}
@keyframes kfa-jello-jiggle {
  0%, 100% { transform: skew(0, 0) scale(1, 1); }
  12% { transform: skew(-14deg, -4deg) scale(1.05, 0.95); }
  26% { transform: skew(10deg, 3deg) scale(0.97, 1.03); }
  40% { transform: skew(-6deg, -2deg) scale(1.02, 0.98); }
  54% { transform: skew(3.5deg, 1deg) scale(1, 1); }
  68% { transform: skew(-1.6deg, -0.5deg) scale(1, 1); }
  82% { transform: skew(0.6deg, 0.2deg) scale(1, 1); }
}

@media (prefers-reduced-motion: reduce) {
  .kfa-jello, .kfa-jello *, .kfa-jello::before, .kfa-jello::after, .kfa-jello *::before, .kfa-jello *::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