AI CSS Animations

Crossing Lines Spinner

A single line splits into an X, closes again standing upright, then splits and lies back down. Two bars rotate in opposite directions with ease-in-out, pausing whenever they overlap.

Also known as: scissor loader, x spinner, split line loader.

HTML

<div class="ldr-crossing-lines" role="status" aria-label="Loading">
  <span></span><span></span>
</div>

CSS

.ldr-crossing-lines {
  --s: var(--ldr-size, 48px);
  --c: var(--ldr-color, #3b82f6);
  position: relative;
  width: var(--s);
  height: var(--s);
}
.ldr-crossing-lines span {
  position: absolute;
  top: calc(50% - var(--s) / 18);
  left: 0;
  width: 100%;
  height: calc(var(--s) / 9);
  border-radius: var(--s);
  background: color-mix(in srgb, var(--ldr-color, #3b82f6) 45%, transparent);
  animation: ldr-crossing-lines-b 1.8s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}
.ldr-crossing-lines span:first-child {
  z-index: 1;
  background: var(--c);
  animation-name: ldr-crossing-lines-a;
}
@keyframes ldr-crossing-lines-a {
  0%   { transform: rotate(0deg); }
  50%  { transform: rotate(90deg); }
  100% { transform: rotate(180deg); }
}
@keyframes ldr-crossing-lines-b {
  0%   { transform: rotate(0deg); }
  50%  { transform: rotate(-90deg); }
  100% { transform: rotate(-180deg); }
}

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