Hover or focus the image to see the effect.
HTML
CSS
.hover-effect.tilt-top-right img{
transform-origin: top right;
transition: transform 0.5s ease;
}
.hover-effect.tilt-top-right:hover img,
.hover-effect.tilt-top-right:focus-visible img{
transform: scale(1.4) rotate(8deg);
}
@media (prefers-reduced-motion: reduce) {
.hover-effect.tilt-top-right img{
transition: none;
}
.hover-effect.tilt-top-right:hover img,
.hover-effect.tilt-top-right:focus-visible img{
transform: scale(1.4) rotate(8deg);
}
}
The animates transform: scale(1.4) rotate(8deg) with transform-origin: top right. The slight scale prevents blank corners. Select the code and copy with Ctrl+C or ⌘C.