Hover or focus the image to see the effect.
HTML
CSS
.hover-effect.perspective-zoom img{
transition: transform 0.5s ease;
}
.hover-effect.perspective-zoom:hover img,
.hover-effect.perspective-zoom:focus-visible img{
transform: perspective(800px) translateZ(60px) scale(1.25);
}
@media (prefers-reduced-motion: reduce) {
.hover-effect.perspective-zoom img{
transition: none;
}
.hover-effect.perspective-zoom:hover img,
.hover-effect.perspective-zoom:focus-visible img{
transform: perspective(800px) translateZ(60px) scale(1.25);
}
}
The animates transform: perspective(800px) translateZ(60px) scale(1.25) for a 3D pop-forward effect. Select the code and copy with Ctrl+C or ⌘C.