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