side nav bar for admin dashboard

This commit is contained in:
2020-04-03 20:05:32 -05:00
parent 7320fe363d
commit d7dafdaeab
2 changed files with 60 additions and 78 deletions

View File

@@ -1,37 +1,16 @@
.sidenav { .wrapper {
height: 100%; /* Full-height: remove this if you want "auto" height */ display: flex;
width: 160px; /* Set the width of the sidebar */ width: 100%;
position: fixed; /* Fixed Sidebar (stay in place on scroll) */ }
z-index: 1; /* Stay on top */
top: 0; /* Stay at the top */ #sidebar {
width: 100px;
position: fixed;
top: 0;
left: 0; left: 0;
background-color: #111; /* Black */ height: 100vh;
overflow-x: hidden; /* Disable horizontal scroll */ z-index: 999;
padding-top: 20px; background: #7386D5;
} color: #fff;
transition: all 0.3s;
/* The navigation menu links */ }
.sidenav a {
padding: 6px 8px 6px 16px;
text-decoration: none;
font-size: 25px;
color: #818181;
display: block;
}
/* When you mouse over the navigation links, change their color */
.sidenav a:hover {
color: #f1f1f1;
}
/* Style page content */
.main {
margin-left: 160px; /* Same as the width of the sidebar */
padding: 0px 10px;
}
/* On smaller screens, where height is less than 450px, change the style of the sidebar (less padding and a smaller font size) */
@media screen and (max-height: 450px) {
.sidenav {padding-top: 15px;}
.sidenav a {font-size: 18px;}
}

View File

@@ -1,4 +1,6 @@
<div class="sidenav">
<nav class="col-md-1 d-none d-md-block bg-light sidebar">
<div class="sidebar-sticky">
<ul class="nav flex-column"> <ul class="nav flex-column">
@if(auth()->user()->hasRole('Admin')) @if(auth()->user()->hasRole('Admin'))
<li class="nav-item dropdown"> <li class="nav-item dropdown">
@@ -39,4 +41,5 @@
</li> </li>
@endif @endif
</ul> </ul>
</div> </div>
</nav>