<div class="nav-bar">
<div class="overflow-container">
<button class="open-nav">
<i class="fa fa-bars"></i>
<i class="fa fa-close"></i>
</button>
<div class="content">
<div class="links">
<a class="link" href="link">
<i class="fa fa-home">
</i>
</a>
<a class="link" href="link">
<i class="fa fa-user">
</i>
</a>
<a class="link" href="link">
<i class="fa fa-info-circle">
</i>
</a>
</div>
<input type="text" class="search-bar" placeholder="search me.">
<button class="search">
<i class="fa fa-search"></i>
</button>
</div>
</div>
</div>
html,body{
margin:0;
height:100%;
--nav-height:50px;
font-family:Roboto;
--nav-half:calc(var(--nav-height) / 2);
}
.nav-bar{
width:400px;
height:var(--nav-height);
line-height: var(--nav-height);
position:absolute;
overflow:hidden;
top:50%;
left:50%;
transform:translate(-50%,-50%);
background:transparent;
transition:0.5s;
}
.overflow-container{
height:100%;
width:100%;
overflow:hidden;
}
.links{
display:inline-block;
position: absolute;
width:0;
transition:all 0.5s;
overflow:hidden;
background:rgb(56,186,56);
color:#fff;
line-height: var(--nav-height);
border-radius:var(--nav-half);
}
.nav-bar.active .links{
width:calc(100% - var(--nav-height));
border-radius:0;
border-bottom-right-radius:var(--nav-half);
}
.content{
border-radius:var(--nav-half);
width:calc(100% - var(--nav-height));
transition: 0.5s;
height:100%;
display: inline-block;
overflow: hidden;
}
.nav-bar.active .content{
border-radius:0;
border-bottom-right-radius:var(--nav-half);
}
.link{
display:block;
line-height: var(--nav-height);
padding:0 30px;
text-decoration: none;
color:inherit;
text-align:center;
float:left;
transition:0.3s;
font-size:20px;
}
.link:hover{
background:rgb(86,206,86);
}
.open-nav,.search{
width:var(--nav-height);
height:100%;
background:rgb(56,186,56);
color:#fff;
border-radius:50%;
border:0;
float:left;
outline:0;
transition:0.5s;
}
.nav-bar.active .open-nav{
background:rgb(86,206,86);
border-radius:0;
border-top-left-radius:var(--nav-half);
}
.nav-bar.active .search{
border-radius:0;
border-bottom-right-radius: var(--nav-half);
}
.nav-bar.active .search,.search:hover{
background:rgb(6,156,250);
}
.search-bar{
height:100%;
border:0;
padding:20px;
box-sizing:border-box;
background:#f8f8f8;
outline:0;
width:calc(100% - var(--nav-height));
display:block;
font-size:15px;
float:left;
transition:0.5s;
}
.search-bar:focus{
background:#efefef;
}
.search{
border-top-left-radius: 0;
border-bottom-left-radius: 0;
background:rgb(56,96,250);
}
.nav-bar.active .fa-bars,.nav-bar .fa-close{display: none;}
.nav-bar.active .fa-close,.nav-bar .fa-bars{display: inline-block;}