Gallery · 19 of 33

Flash Overlay

Bright flash transition

HTML · CSS · No dependencies · MIT

HTML

<div class="flash-overlay">
  <img src="https://picsum.photos/id/120/800/600" alt="Shoes">
  <div class="flash"></div>
</div>

CSS

.flash-overlay {
  position: relative;
  width: 400px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 12px;
}

.flash-overlay img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.flash {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}

/* Bright flash that immediately fades out */
.flash-overlay:hover .flash {
  animation: flash-anim 0.4s forwards;
}

@keyframes flash-anim {
  0% { opacity: 0.6; }
  100% { opacity: 0; }
}