JSFiddle - React, Tailwind, and code Playground

by Denis Ineshin

HTML

<div class='test'>
    <div class='test-caption'>
        <div class='test-icon'></div>
    </div>
</div>

CSS

.test {
    position: relative;
    width: 200px;
    height: 200px;
    background: #000;
}
.test-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 50px;
    background: rgba(255, 255, 255, 0.5);
    
    -webkit-transition: all 250ms cubic-bezier(0.455, 0.030, 0.515, 0.955); 
    -moz-transition: all 250ms cubic-bezier(0.455, 0.030, 0.515, 0.955); 
    -o-transition: all 250ms cubic-bezier(0.455, 0.030, 0.515, 0.955); 
    transition: all 250ms cubic-bezier(0.455, 0.030, 0.515, 0.955); /* easeInOutQuad */

    -webkit-transition-timing-function: cubic-bezier(0.455, 0.030, 0.515, 0.955); 
    -moz-transition-timing-function: cubic-bezier(0.455, 0.030, 0.515, 0.955); 
    -o-transition-timing-function: cubic-bezier(0.455, 0.030, 0.515, 0.955); 
    transition-timing-function: cubic-bezier(0.455, 0.030, 0.515, 0.955); /* easeInOutQuad */
}

.test:hover .test-caption {
    height: 100%;
}

.test-icon {
    position: absolute;
    top: 50%; left: 50%;
    width: 20px; height: 20px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: #f00;
}