Gallery · 07 of 33

Clip Path Morph

Circle to rounded rectangle

HTML · CSS · No dependencies · MIT

HTML

<div class="clip-shape">
  <img src="https://picsum.photos/id/40/800/600" alt="Cat">
</div>

CSS

.clip-shape {
  width: 400px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 12px;
  background: #000;
}

.clip-shape img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  clip-path: circle(40% at 50% 50%);
  transition: clip-path 0.6s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.clip-shape:hover img {
  clip-path: circle(75% at 50% 50%);
  transform: scale(1.05);
}