JSFiddle - React, Tailwind, and code Playground
by mikapon
HTML
<div class="image">
<img src="http://farm5.static.flickr.com/4005/4706825697_c0367e6dee_b.jpg" alt="">
</div>
CSS
.image {
width: 150px;
height: 150px;
}
.image img {
width: 100%;
height: 100%;
object-fit: contain;
clip-path: polygon(0 50%, 100% 50%, 100% 50%, 0 50%);
}
.image:hover img {
clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
transition: all 0.5s ease-in-out;
}
.button {
position: absolute;
bottom: 0;
}