Hover or focus the image to see the effect.
HTML
<div class="hover-effect pan-bottom-left">
<img src="image.jpg" alt="description">
</div>
CSS
.hover-effect.pan-bottom-left{
overflow: hidden;
}
.hover-effect.pan-bottom-left img{
transform: scale(1.2);
transition: transform 0.5s ease;
}
.hover-effect.pan-bottom-left:hover img,
.hover-effect.pan-bottom-left:focus-visible img{
transform: scale(1.2) translate(-25px, 25px);
}
@media (prefers-reduced-motion: reduce) {
.hover-effect.pan-bottom-left img{
transition: none;
}
.hover-effect.pan-bottom-left:hover img,
.hover-effect.pan-bottom-left:focus-visible img{
transform: scale(1.2);
}
}
Select the code and copy with Ctrl+C or ⌘C.