Skip to content

Commit

Permalink
Fixed the sidebar not clonsing on click of the hambar button after op…
Browse files Browse the repository at this point in the history
…ening it
  • Loading branch information
rajveeerr authored Oct 3, 2024
1 parent bce8b43 commit e42c1e9
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 e42c1e9

Please sign in to comment.