15 Pure CSS Loading Animations

Floor-by-Floor

A vertical luxury-building loader. Floors light up bottom-to-top like an elevator passing each level, room silhouettes flicker on inside, and a penthouse glow crowns the building when `.ready` is added. Turns waiting time into an architectural narrative — perfect for residential developments and high-end real estate.

CSS + JS MIT licensed

Floor-by-Floor the 5th of 15 designs in the 15 Pure CSS Loading Animations collection. The design pairs CSS styling with a small amount of JavaScript for interactivity. Copy the HTML, CSS and JavaScript panels below into your project — the JS is self-contained, has zero dependencies, and is safe to drop into any framework (React, Vue, Svelte, plain HTML). The design honours prefers-reduced-motion and uses real semantic markup, so it ships accessibility-ready out of the box.

Live preview

Open in playground

The code

<figure class="fb-loader" role="status" aria-label="Loading building tour">
  <span class="fb-building" aria-hidden="true">
    <span class="fb-roof"></span>
    <span class="fb-penthouse">
      <span class="fb-pent-light"></span>
    </span>
    <span class="fb-floor" data-floor="6"
      ><span class="fb-room"></span><span class="fb-room"></span><span class="fb-room"></span
    ></span>
    <span class="fb-floor" data-floor="5"
      ><span class="fb-room"></span><span class="fb-room"></span><span class="fb-room"></span
    ></span>
    <span class="fb-floor" data-floor="4"
      ><span class="fb-room"></span><span class="fb-room"></span><span class="fb-room"></span
    ></span>
    <span class="fb-floor" data-floor="3"
      ><span class="fb-room"></span><span class="fb-room"></span><span class="fb-room"></span
    ></span>
    <span class="fb-floor" data-floor="2"
      ><span class="fb-room"></span><span class="fb-room"></span><span class="fb-room"></span
    ></span>
    <span class="fb-floor" data-floor="1"
      ><span class="fb-room"></span><span class="fb-room"></span><span class="fb-room"></span
    ></span>
    <span class="fb-base"></span>
  </span>
  <figcaption class="fb-caption">Touring residences…</figcaption>
</figure>
.fb-loader {
  position: relative;
  width: 110px;
  height: 200px;
  margin: 0;
  padding: 0;
  display: grid;
  place-items: end center;
  font-family: system-ui, sans-serif;
}

.fb-building {
  position: relative;
  width: 84px;
  display: flex;
  flex-direction: column;
  border-radius: 4px 4px 0 0;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.55));
}

.fb-roof {
  height: 4px;
  background: linear-gradient(90deg, transparent 8%, #d4af37 8%, #d4af37 92%, transparent 92%);
  border-radius: 2px 2px 0 0;
  margin-bottom: 1px;
}

.fb-penthouse {
  position: relative;
  height: 22px;
  background: linear-gradient(180deg, #1f2433 0%, #161b2a 100%);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-bottom: 0;
  display: grid;
  place-items: center;
}

.fb-pent-light {
  width: 60%;
  height: 8px;
  border-radius: 2px;
  background: rgba(255, 212, 121, 0.08);
  transition:
    background 0.6s ease,
    box-shadow 0.6s ease;
}

.fb-floor {
  position: relative;
  height: 22px;
  background: linear-gradient(180deg, #1a1f2e 0%, #14182a 100%);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-bottom: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px 6px;
  box-sizing: border-box;
}

.fb-room {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 1.5px;
  transition:
    background 0.4s ease,
    box-shadow 0.4s ease;
}

.fb-base {
  height: 6px;
  background: #2a1f1a;
  border-radius: 0 0 4px 4px;
}

.fb-floor[data-floor="1"] .fb-room {
  animation: fbWindow 7s ease-in-out infinite;
  animation-delay: 0s;
}

.fb-floor[data-floor="2"] .fb-room {
  animation: fbWindow 7s ease-in-out infinite;
  animation-delay: 0.7s;
}

.fb-floor[data-floor="3"] .fb-room {
  animation: fbWindow 7s ease-in-out infinite;
  animation-delay: 1.4s;
}

.fb-floor[data-floor="4"] .fb-room {
  animation: fbWindow 7s ease-in-out infinite;
  animation-delay: 2.1s;
}

.fb-floor[data-floor="5"] .fb-room {
  animation: fbWindow 7s ease-in-out infinite;
  animation-delay: 2.8s;
}

.fb-floor[data-floor="6"] .fb-room {
  animation: fbWindow 7s ease-in-out infinite;
  animation-delay: 3.5s;
}

.fb-floor[data-floor="1"] .fb-room:nth-child(2) {
  animation-delay: 0.15s;
}

.fb-floor[data-floor="1"] .fb-room:nth-child(3) {
  animation-delay: 0.3s;
}

.fb-floor[data-floor="2"] .fb-room:nth-child(2) {
  animation-delay: 0.85s;
}

.fb-floor[data-floor="2"] .fb-room:nth-child(3) {
  animation-delay: 1s;
}

.fb-floor[data-floor="3"] .fb-room:nth-child(2) {
  animation-delay: 1.55s;
}

.fb-floor[data-floor="3"] .fb-room:nth-child(3) {
  animation-delay: 1.7s;
}

.fb-floor[data-floor="4"] .fb-room:nth-child(2) {
  animation-delay: 2.25s;
}

.fb-floor[data-floor="4"] .fb-room:nth-child(3) {
  animation-delay: 2.4s;
}

.fb-floor[data-floor="5"] .fb-room:nth-child(2) {
  animation-delay: 2.95s;
}

.fb-floor[data-floor="5"] .fb-room:nth-child(3) {
  animation-delay: 3.1s;
}

.fb-floor[data-floor="6"] .fb-room:nth-child(2) {
  animation-delay: 3.65s;
}

.fb-floor[data-floor="6"] .fb-room:nth-child(3) {
  animation-delay: 3.8s;
}

.fb-caption {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  color: #d4af37;
  white-space: nowrap;
  animation: fbCap 2.6s ease-in-out infinite;
}

.fb-loader.ready .fb-room {
  animation: none;
  background: #ffd479;
  box-shadow:
    0 0 4px rgba(255, 212, 121, 0.55),
    inset 0 0 3px rgba(255, 212, 121, 0.45);
}

.fb-loader.ready .fb-pent-light {
  background: #ffd479;
  box-shadow:
    0 0 14px rgba(255, 212, 121, 0.7),
    inset 0 0 8px rgba(255, 212, 121, 0.5);
}

.fb-loader.ready .fb-caption {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .fb-room,
  .fb-caption {
    animation: none;
  }
  .fb-room {
    background: rgba(255, 212, 121, 0.45);
  }
}
@keyframes fbWindow {
  0%,
  5% {
    background: rgba(255, 255, 255, 0.03);
    box-shadow: none;
  }
  15%,
  60% {
    background: #ffd479;
    box-shadow:
      0 0 4px rgba(255, 212, 121, 0.55),
      inset 0 0 3px rgba(255, 212, 121, 0.45);
  }
  80%,
  100% {
    background: rgba(255, 255, 255, 0.03);
    box-shadow: none;
  }
}
@keyframes fbCap {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}
// Drives the elevator/penthouse "ready" reveal. Replace with your real load trigger.
document.querySelectorAll(".fb-loader").forEach(function (b) {
  var ready = false;
  function tick() {
    ready = !ready;
    b.classList.toggle("ready", ready);
    setTimeout(tick, ready ? 2400 : 5400);
  }
  setTimeout(tick, 5400);
});

Search CodeFronts

Loading…