Tilt Top-Right

Image tilts on hover/focus with the top-right corner as the rotation pivot, plus a small zoom to keep the viewport covered.

Tilt Top-Right demo

Hover or focus the image to see the effect.

HTML

description

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.