CSSmediumCSS

CSS Morphing Shape Loader

Create smooth morphing shape animations for loading indicators.

01

The problem

You need an eye-catching loading animation with smooth shape transformations.

02

The solution

CSS
.morph-loader {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(45deg, #3a7bff, #8b5cf6);
  animation: morph 3s ease-in-out infinite;
}

@keyframes morph {
  0%, 100% {
    border-radius: 50%;
    transform: rotate(0deg);
  }
  25% {
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    transform: rotate(90deg);
  }
  50% {
    border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%;
    transform: rotate(180deg);
  }
  75% {
    border-radius: 40% 60% 60% 40% / 60% 40% 60% 40%;
    transform: rotate(270deg);
  }
}

/* Pulsing variant */
.morph-pulse {
  animation: morph 3s ease-in-out infinite, pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

/* Multiple shapes */
.morph-group {
  display: flex;
  gap: 20px;
  align-items: center;
}

.morph-group .morph-loader {
  animation-delay: calc(var(--i) * 0.2s);
}

03

See it live

Isolated previewSandboxed
04

Put it to work

Example
<!-- Single morphing loader -->
<div class="morph-loader"></div>

<!-- Multiple synchronized loaders -->
<div class="morph-group">
  <div class="morph-loader" style="--i: 0"></div>
  <div class="morph-loader" style="--i: 1"></div>
  <div class="morph-loader" style="--i: 2"></div>
</div>

Worth knowing

Complex border-radius values create organic shapes. Combine with rotation for fluid motion.