AI CSS Animations

Tracking In

Letters start spread far apart and slide together as they fade in. Animating letter-spacing gives it a cinematic title-card feel.

Also known as: letter spacing animation, expand letters, kinetic typography.

PREMIERE

HTML

<div class="txt-tracking-in">PREMIERE</div>

CSS

.txt-tracking-in {
  --c: var(--txt-color, #3b82f6);
  font-size: var(--txt-size, 32px);
  font-family: system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.2;
  color: var(--c);
  opacity: 0;
  letter-spacing: 0.5em;
  animation: txt-tracking-in-contract 0.9s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;}
@keyframes txt-tracking-in-contract {
  from { opacity: 0; letter-spacing: 0.5em; }
  to   { opacity: 1; letter-spacing: 0.08em; }
}

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

Customizing this snippet

  • Color: set --txt-color on the element or a parent. Currently previewing #3b82f6.
  • Font size: set --txt-size. Every other dimension is in em, so the whole thing scales together. Currently previewing 40px.
  • 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 text animations