Skip to content

Commit

Permalink
Merge pull request #1129 from rajveeerr/main
Browse files Browse the repository at this point in the history
Fix: Sidebar Collapse via Hamburger Menu on Smaller Screens
  • Loading branch information
SurajPratap10 authored Oct 3, 2024
2 parents 9e56923 + e42c1e9 commit bb55693
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions views/includes/sidebar.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<i class="bi bi-list"></i>
</div>
<div class="sidebar">
<div class="crossicon" onclick="sidbarinvissible()">x</div>
<div class="crossicon">x</div>
<div class="content">
<a class="white-color hover-effect <%= path === '/' ? 'active' : '' %>" href="/">HOME</a>
<a class="white-color hover-effect <%= path === '/generateImg' ? 'active' : '' %>"
Expand Down Expand Up @@ -98,13 +98,18 @@ const hamburgere1=document.querySelector(".hamburger");
const sidebarE1=document.querySelector(".sidebar");
function sidebartoggle(){
// hamburgere1.style.setProperty('display', 'none');
sidebarE1.style.setProperty('transform', 'translateX(0)');
if(sidebarE1.style.transform==='translateX(100%)'){
sidebarE1.style.setProperty('transform', 'translateX(0)');
}
else{
sidebarE1.style.setProperty('transform', 'translateX(100%)');
}
}
function sidbarinvissible(){
// hamburgere1.style.setProperty('display', 'block');
// function sidbarinvissible(){
// // hamburgere1.style.setProperty('display', 'block');
sidebarE1.style.setProperty('transform', 'translateX(100%)');
// sidebarE1.style.setProperty('transform', 'translateX(100%)');
}
// }
</script>

0 comments on commit bb55693

Please sign in to comment.