Scale animation boxes
by badfreja
HTML
<div class="top">
<div class="middle">
<div class="box">
<img src="http://placehold.it/200x200" alt="">
</div>
<div class="box">
<img src="http://placehold.it/200x200" alt="">
</div>
<div class="box">
<img src="http://placehold.it/200x200" alt="">
</div>
</div>
</div>
CSS
.top {
display: flex;
flex-wrap: wrap;
align-content: center;
}
.middle {
display: flex;
flex-direction: column;
justify-content: center;
margin-top: 10px;
margin-right: 10px;
align-items: center;
}
.box {
text-align: center;
position: relative;
width: 100px;
height: 80px;
overflow: hidden;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
margin-top: 10px;
border-radius: 10%;
}
.box:hover {
transform: scale(.95);
transition: transform ease-in .1s;
cursor: pointer;
}
.box img {
transition: transform ease-in .1s;
position: relative;
transform: translateY(-50%);
top: 50%;
left: 0;
width: 100%;
}