JSFiddle - React, Tailwind, and code Playground
by al nmeri
HTML
<aside style="width: 0px;">
<ul>
<li>
<a href="?ac=transaction">transaction details</a>
</li>
<li class="">
<a href="dashboard.php?ac=dashboard">dashboard</a>
</li>
<li class="active-display">
<a href="dashboard.php?ma=mrs+alupho&ac=account">account manager details</a>
</li>
</ul>
<p>
<a href="sign-out.php"> sign out</a>
</p>
</aside>
<main>
<header>
<nav>
<input type="search" name="search" value="search">
<span>transfer
<ul>
<li><a href="transfer.php">transfer to gt</a></li>
<li><a href="transfer.php?to=other">transfer to other banks</a></li>
</ul>
</span>
<span>bill payments
<ul>
<li><a href="#">cable</a></li>
<li><a href="#">utility</a></li>
<li><a href="#">internet</a></li>
<li><a href="#">ecommerce</a></li>
<li><a href="#">egovernment</a></li>
</ul>
</span>
<a href="contact.php">contact</a>
<a href="about.php"> about us</a>
</nav>
<h1>internet banking</h1>
<div id="menu-container" class="">
<div></div>
<div></div>
<div></div>
</div>
</header>
</main>
CSS
aside {
position: fixed;
width: 0;
height: 100%;
background: #888;
z-index: 9;
padding-top: 12%;
overflow: hidden;
display: flex;
transition: all .15s ease-in;
}
aside.open {
width: 18%;
}
aside ul {
width: 100%;
}
aside li {
background: #ff9800;
padding: 4%;
font-size: 90%;
border-bottom: 1px solid;
}
aside li:hover, .active-display {
background: #621;
}
aside p {
position: absolute;
bottom: 0;
font-size: 150%;
background: #f73122;
padding: 3% 7%;
width: 100%;
}
aside a {
color: white;
}
header {
display: flex;
flex-flow: row wrap;
justify-content: center;
border-bottom: 1px solid;
text-transform: capitalize;
position: relative;
}
nav {
background: #ff9800;
flex: 1 100%;
padding: 2px 3%;
padding-left: 5%;
display: flex;
justify-content: space-between;
}
nav input {
outline: none;
border: 1px solid;
background: inherit;
box-shadow: none;
width: 6%;
transition: all .4s ease-in-out;
}
nav input:focus {
width: initial;
transition: all .4s ease-in-out;
}
nav span {
position: relative;
}
nav ul {
visibility: hidden;
opacity: 0;
position: absolute;
top: 110%;
background: #ff9800;
transition: all .2s ease-in-out;
}
nav span:hover ul {
visibility: visible;
transition: all .2s ease-in-out;
opacity: 1;
}
nav li {
list-style: none;
padding: 7%;
border-bottom: 1px solid;
white-space: nowrap;
width: auto;
}
nav li:hover {
background: #523;
}
nav li:hover a {
color: #fff;
}
nav > a {
padding: 0 2%;
white-space: nowrap;
transition: all .2s ease-out;
}
nav > a:hover {
box-shadow: inset 0 0 5px black;
color: #fff;
padding: 0 3%;
}
h1 {
background: #000;
color: #eee;
flex: 1 100%;
padding: 3%;
text-align: center;
}
#menu-container {
width: 5%;
height: 45%;
position: absolute;
top: 40%;
left: 5%;
display:flex;
flex-flow: row wrap;
align-content: space-around;
z-index: 10;
cursor: pointer;
transition: all .15s ease-in;
}
#menu-container.open...
JavaScript
$('#menu-container').on('click', function(e) {
$('#menu-container,aside').toggleClass('open');
});