JSFiddle - React, Tailwind, and code Playground
by Avijit Kumar
HTML
<section class="white-sec">
<div class="icon-parent">
<div class="icon-hover"><div class="icon"></div></div>
<div class="icon-sheen"></div>
</div>
</section>
<section class="purple-sec"></section>
CSS
.icon-parent {
position: relative;
bottom: -70px;
display: inline-block;
}
.icon-parent:hover .icon-hover {
bottom:-30px;
}
.icon-parent:hover .icon-sheen {
top:30px;
height:48px;
z-index:400;
}
.icon {
width: 50px;
height: 50px;
border:2px solid #000;
display: inline-block;
margin-top:0px;
transition:all ease 0.3s;
}
/* .icon {
margin-top:30px;
}
*/
.icon-hover {
display:inline-block;
position: relative;
bottom: -5px;
z-index: 300;
transition: all ease 0.3s;
}
.icon-hover:hover {
/* bottom:-30px; */
}
/* .icon-hover:hover .icon-parent .icon {margin-top:30px;} */
.icon-sheen {
position: absolute;
left: 2px;
width: 46px;
height: 44px;
top: -18px;
border: 2px solid rgba(0, 0, 0, 0);
background-color: #fff;
z-index: 200;
transition: all ease 0.3s;
}
.white-sec {
background-color: #fff;
float: left;
width: 100%;
min-height: 100px;
text-align: center;
}
.purple-sec {
background-color: blue;
float: left;
width: 100%;
min-height: 100px;
}