<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Sidebar menu</title>
  <!--  JQuery CDN link  -->
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js" ></script>
  <!--  Box Icon CDN link  -->
  <link href='https://unpkg.com/boxicons@2.0.7/css/boxicons.min.css' rel='stylesheet'>
</head>
<body>
  <div class="sidebar">
    <ul>
      <li><a href="#" ><i class='bx bx-home-alt'></i></a></li>
      <li><a href="#" ><i class='bx bxs-folder-open'></i></a></li>
      <li><a href="#" ><i class='bx bx-library'></i></a></li>
      <li><a href="#" ><i class='bx bx-bookmark-heart'></i></a></li>
      <li><a href="#" ><i class='bx bxs-backpack'></i></a></li>
      <li><a href="#" ><i class='bx bx-barcode-reader'></i></a></li>
      <li><a href="#" ><i class='bx bx-log-in-circle'></i></a></li>
    </ul>
  </div>
  
  <div class="btn">
    <span class="bar1"></span>
    <span class="bar2"></span>
    <span class="bar3"></span>
  </div>
</body>
</html>
/* --------- Imported Poppins font from Google font ---------- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;400;600;700;800;900&display=swap');

/* ------------ overall body and page styling ------------ */
body,html
{
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  font-family: 'Poppins', sans-serif;
}

/* ----------- sidebar styling --------------- */
.sidebar
{
  float: left;
  width: 60px;
  margin-left: -60px;
  height: 100%;
  background: #fa8231;
  overflow: hidden;
  transition: .6s all;
}

.sidebar-open
{
  margin-left: 0;
}

.sidebar ul
{
  margin: 0;
  padding: 0;
}

.sidebar ul li
{
  list-style: none;
}

.sidebar ul li a
{
  text-decoration: none;
  color: #313131;
  height: 80px;
  width: 100%;
  font-size: 26px;
  line-height: 50px;
  display: block;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
}

.sidebar ul li a i
{
/*   border: 1px solid #000; */
  border-radius: 6px;
  padding: 8px;
  transition: .5s ease-in-out;
}

.sidebar ul li a i:hover
{
  background: #fff;
  border: 1px solid #fff;
}


/* -------------- Burgur styling ----------------- */
.btn
{
  float: left;
  height: 30px;
  width: 30px;
  padding: 6px;
  background: #fff;
  border: 1px solid #fa8231;
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  flex-direction: column;
  cursor: pointer;
}

.btn .bar1, .btn .bar2, .btn .bar3
{
  height: 3px;
  width: 100%;
  display: block;
  background: #000;
}

/* ----------- close btn ------------- */
.close-btn
{
  top: 0;
  right: 0;
  height: 30px;
  width: 30px;
  padding: 6px;
  background: #fff;
  border: 1px solid #fa8231;
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  flex-direction: column;
  cursor: pointer;
  position: relative;
}

.close-btn .bar1
{
  transform: rotate(-130deg);
  height: 3px;
  width: 70%;
  display: block;
  background: #000;
  position: absolute;
}

.close-btn .bar2
{
  display: none;
}

.close-btn .bar3
{
  transform: rotateZ(130deg);
  height: 3px;
  width: 70%;
  display: block;
  background: #000;
  position: absolute;
}
$('.btn').on("click", function(){
  $('.btn').toggleClass('close-btn');
  $('.sidebar').toggleClass('sidebar-open');
});

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.