Pan Right

Image slides right, revealing more of the left side of the picture.

Pan Right demo

Hover or focus the image to see the effect.

HTML

<div class="hover-effect pan-right">
  <img src="image.jpg" alt="description">
</div>

CSS

.hover-effect.pan-right{
  overflow: hidden;
}
.hover-effect.pan-right img{
  transform: scale(1.2);
  transition: transform 0.5s ease;
}
.hover-effect.pan-right:hover img,
.hover-effect.pan-right:focus-visible img{
  transform: scale(1.2) translateX(25px);
}
@media (prefers-reduced-motion: reduce) {
  .hover-effect.pan-right img{
    transition: none;
  }
  .hover-effect.pan-right:hover img,
  .hover-effect.pan-right:focus-visible img{
    transform: scale(1.2);
  }
}

Select the code and copy with Ctrl+C or ⌘C.