JSFiddle - React, Tailwind, and code Playground
by Teuta Koraqi
HTML
<div class="profile">
<img src="http://www.bwinex.com/upload/team/john-doe_1466770844-b.jpg" alt="">
<div class="upload-image">
<img src="https://image.freepik.com/free-icon/upload-arrow_318-26670.jpg" alt="">
</div>
</div>
CSS
.upload-image img {
width: 20px;
height: 20px;
margin-bottom: -30px;
-webkit-transition: margin 0.375s cubic-bezier(0.4, 0, 0.2, 1);
-moz-transition: margin 0.375s cubic-bezier(0.4, 0, 0.2, 1);
-o-transition: margin 0.375s cubic-bezier(0.4, 0, 0.2, 1);
transition: margin 0.375s cubic-bezier(0.4, 0, 0.2, 1);
}
.profile {
position: relative;
height: 300px;
width: 300px;
}
.upload-image {
position: absolute;
top: 0;
left: 0;
background-color: rgba(0,0,0,0.5);
height: 100%;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
opacity: 0;
-webkit-transition: opacity 0.375s cubic-bezier(0.4, 0, 0.2, 1);
-moz-transition: opacity 0.375s cubic-bezier(0.4, 0, 0.2, 1);
-o-transition: opacity 0.375s cubic-bezier(0.4, 0, 0.2, 1);
transition: opacity 0.375s cubic-bezier(0.4, 0, 0.2, 1);
}
.profile:hover .upload-image img {
margin-bottom: 0;
}
.profile:hover .upload-image {
opacity: 1;
}