Slide Reveal Left

Cover anchored to the right edge shrinks on hover, revealing the image from left to right.

Slide Reveal Left demo

Hover or focus the image to see the effect.

HTML

<div class="hover-effect slide-reveal-left">
  <img src="image.jpg" alt="description">
</div>

CSS

.hover-effect.slide-reveal-left{
  position: relative;
}
.hover-effect.slide-reveal-left::before{
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  background: #1a1a1a;
  transition: width 0.5s ease;
}
.hover-effect.slide-reveal-left:hover::before,
.hover-effect.slide-reveal-left:focus-visible::before{
  width: 0;
}
@media (prefers-reduced-motion: reduce) {
  .hover-effect.slide-reveal-left::before{
    transition: none;
  }
  .hover-effect.slide-reveal-left:hover::before,
  .hover-effect.slide-reveal-left:focus-visible::before{
    width: 0;
  }
}

The cover pseudo is anchored to the right edge and its width shrinks to zero on hover. Select the code and copy with Ctrl+C or ⌘C.