AI CSS Animations

Tally Marks Loader

Four slightly crooked strokes are drawn one by one, a fifth slashes across them, then the group fades and starts over. A hand drawn way to say counting, good for queues and batch jobs.

Also known as: tally count animation, counting lines loader, hand drawn tally.

HTML

<div class="ldr-tally-marks" role="status" aria-label="Loading">
  <span></span><span></span><span></span><span></span><span></span>
</div>

CSS

.ldr-tally-marks {
  --s: var(--ldr-size, 48px);
  --c: var(--ldr-color, #3b82f6);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--s) / 7);
  width: calc(var(--s) * 1.2);
  height: var(--s);
  animation: ldr-tally-marks-fade 3s -0.9s infinite;
}
.ldr-tally-marks span {
  width: calc(var(--s) / 11);
  height: var(--h);
  border-radius: var(--s);
  background: var(--c);
  transform: rotate(var(--r)) scaleY(0);
  transform-origin: 50% 0;
  animation: ldr-tally-marks-stroke 3s -0.9s infinite;
}
.ldr-tally-marks span:nth-child(1) { --r: 4deg; --h: 78%; }
.ldr-tally-marks span:nth-child(2) { --r: -2deg; --h: 84%; animation-delay: -0.75s; }
.ldr-tally-marks span:nth-child(3) { --r: 3deg; --h: 80%; animation-delay: -0.6s; }
.ldr-tally-marks span:nth-child(4) { --r: -3deg; --h: 86%; animation-delay: -0.45s; }
.ldr-tally-marks span:nth-child(5) {
  position: absolute;
  top: calc(var(--s) * 0.74);
  left: calc(var(--s) * 0.05);
  width: calc(var(--s) * 1.2);
  height: calc(var(--s) / 11);
  transform: rotate(-26deg) scaleX(0);
  transform-origin: 0 50%;
  animation-name: ldr-tally-marks-slash;
}
@keyframes ldr-tally-marks-fade {
  0%, 16%   { opacity: 0; }
  18%, 88%  { opacity: 1; }
  95%, 100% { opacity: 0; }
}
@keyframes ldr-tally-marks-stroke {
  0%, 19%   { transform: rotate(var(--r)) scaleY(0); animation-timing-function: cubic-bezier(0.3, 0.7, 0.4, 1); }
  25%, 100% { transform: rotate(var(--r)) scaleY(1); }
}
@keyframes ldr-tally-marks-slash {
  0%, 42%   { transform: rotate(-26deg) scaleX(0); animation-timing-function: cubic-bezier(0.3, 0.7, 0.4, 1); }
  49%, 100% { transform: rotate(-26deg) scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
  .ldr-tally-marks, .ldr-tally-marks *, .ldr-tally-marks::before, .ldr-tally-marks::after, .ldr-tally-marks *::before, .ldr-tally-marks *::after {
    animation-duration: 3s;
  }
}

Customizing this loader

  • Color: set --ldr-color on the element or a parent. Currently previewing #3b82f6.
  • Size: set --ldr-size. Every dimension in the snippet is derived from it. Currently previewing 64px.
  • Speed: change the duration on the animation shorthand. Delays on the children are relative, so they keep their rhythm.
  • Accessibility: the root carries role="status" and an aria-label so screen readers announce the wait. The reduced-motion rule at the end slows the animation for users who asked for less motion.

Similar loaders