JSFiddle - React, Tailwind, and code Playground

by xo4xypmy

HTML

<div class="social-item">
        <div class="first-slide"></div>
        <div class="second-slide"></div>
        <div class="description"></div>
    </div>
    <div class="social-item">
        <div class="first-slide"></div>
        <div class="second-slide"></div>
        <div class="description"></div>
    </div>
    <div class="social-item">
        <div class="first-slide"></div>
        <div class="second-slide"></div>
        <div class="description"></div>
    </div>
    <div class="social-item">
        <div class="first-slide"></div>
        <div class="second-slide"></div>
        <div class="description"></div>
    </div>

CSS

.social-item{
    float: left;
    width: 80px;
    height: 210px;
    cursor: pointer;
    overflow: hidden;
    margin-right: 5px;
    transition: width 0.8s;
}
.social-item:hover{
    width: auto;
}
.social-item:hover>.first-slide{
    width: 0px;
}
.social-item:hover>.description{
    width: 310px;
}
.social-item:hover>.second-slide{
    width: 80px;
}
.first-slide{
    float: left;
    width: 80px;
    height: 100%;
    background-color: #6CC3DD;
    transition: width 0.8s;   
}
.second-slide{
    float: left;
    width: 0px;
    height: 100%;
    background-color: #376DAD;
    transition: width 0.8s;  
}
.description{
    float: left;
    width: 0;
    height: 100%;
    background-color: #28a7e9;
    transition: width 0.8s;
}