Prepare repository for merge

This commit is contained in:
Angelos Chalaris
2023-05-01 22:51:44 +03:00
parent 334b4dd6f8
commit e49fc829dd
100 changed files with 0 additions and 593 deletions

View File

@ -0,0 +1,38 @@
---
title: Image rotate on hover
type: snippet
tags: [animation,visual]
cover: succulent-1
dateModified: 2021-10-11T18:44:51+03:00
---
Creates a rotate effect for the image on hover.
- Use the `scale()`, `rotate()` and `transition` properties when hovering over the parent element (a `<figure>`) to animate the image.
- Use `overflow: hidden` on the parent element to hide the excess from the image transformation.
```html
<figure class="hover-rotate">
<img src="https://picsum.photos/id/669/600/800.jpg"/>
</figure>
```
```css
.hover-rotate {
overflow: hidden;
margin: 8px;
min-width: 240px;
max-width: 320px;
width: 100%;
}
.hover-rotate img {
transition: all 0.3s;
box-sizing: border-box;
max-width: 100%;
}
.hover-rotate:hover img {
transform: scale(1.3) rotate(5deg);
}
```