Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions app/static/css/sidebar.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,77 @@
color:black;

}
#sidebar-toggle svg {
fill: #fff;
}

@media (min-width: 992px) {
.footer {
padding-left: 0 !important;
}
}

#sidebar-toggle {
display: none;
}

#sidebar-toggle svg {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicate function

fill: #fff;
}

#sidebar-overlay {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.45);
z-index: 99;
}

#sidebar-overlay.active {
display: block;
}

@media (max-width: 991px) {


#sidebar-toggle {
display: block;
position: fixed;
top: 15px;
left: 0;
z-index: 200;
background-color: #275881;
border: none;
border-radius: 0 4px 4px 0;
padding: 10px 10px 5px 10px;
cursor: pointer;
transition: left 0.3s ease;
}

body.sidebar-is-open #sidebar-toggle {
left: 280px;
}

#sidebar {
left: -280px;
transition: left 0.3s ease;
z-index: 150;
}

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

.sidebar-push {
left: 0 !important;
width: 100vw !important;
margin-right: 0 !important;
}

.footer {
padding-left: 0 !important;
}
}
26 changes: 26 additions & 0 deletions app/static/js/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,30 @@ $(document).ready(function() {
$('.navbar li').removeAttr('tabindex');
$('.navbar div').removeAttr('tabindex');
}
$('#sidebar-toggle').on('click', function() {
if ($('#sidebar').hasClass('sidebar-open')) {
closeSidebar();
} else {
openSidebar();
}
});
$('#sidebar-overlay').on('click', function() {
closeSidebar();
});
});

function openSidebar() {
$('#sidebar').addClass('sidebar-open');
$('#sidebar-overlay').addClass('active');
$('body').addClass('sidebar-is-open');
$('#sidebar-toggle').attr('aria-expanded', true);
}
function closeSidebar() {
$('#sidebar').removeClass('sidebar-open');
$('#sidebar-overlay').removeClass('active');
$('body').removeClass('sidebar-is-open');
$('#sidebar-toggle').attr('aria-expanded', false);
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra blank spaces



7 changes: 7 additions & 0 deletions app/templates/sidebar.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
<button id="sidebar-toggle" aria-label="Toggle navigation" aria-expanded="false" aria-controls="sidebar">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#FFFFFF" class="bi bi-list" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M2.5 12a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5"/>
</svg>
</button>
<div id="sidebar-overlay"></div>

<div id="sidebar" class="col-sm-2">
<nav class="navbar">
<!-- Logo -->
Expand Down