AI CSS Animations

Back In Left

Crosses from the left at 70 percent scale, pauses a beat on its mark, then swells to full size with a small overshoot keyframe. Wide travel suits hero cards and slides.

Also known as: back in left animation css, back in from left, slide in and scale up.

Back

HTML

<div class="kfa-back-in-left">Back</div>

CSS

.kfa-back-in-left {
  --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-back-in-left-kf 1s both;
}
@keyframes kfa-back-in-left-kf {
  0% {
    opacity: 0.7;
    transform: translateX(-9em) scale(0.7);
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
  }
  58%, 64% {
    opacity: 0.7;
    transform: translateX(0) scale(0.7);
    animation-timing-function: cubic-bezier(0.33, 1, 0.68, 1);
  }
  88% { opacity: 1; transform: scale(1.04); }
  100% { opacity: 1; transform: scale(1); }
}

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