Rotate Clockwise

Image rotates slightly clockwise on hover/focus, with a small zoom to keep the viewport covered.

Rotate Clockwise demo

Hover or focus the image to see the effect.

HTML

description

CSS

.hover-effect.rotate-clockwise img{
  transition: transform 0.5s ease;
}
.hover-effect.rotate-clockwise:hover img,
.hover-effect.rotate-clockwise:focus-visible img{
  transform: scale(1.4) rotate(15deg);
}
@media (prefers-reduced-motion: reduce) {
  .hover-effect.rotate-clockwise img{
    transition: none;
  }
  .hover-effect.rotate-clockwise:hover img,
  .hover-effect.rotate-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.