Skip to content

Commit

Permalink
button to toggle left sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
viliusle committed Jun 19, 2021
1 parent 1c35680 commit 43088b1
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 13 deletions.
3 changes: 3 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ <h2 class="trn">Layers</h2>
</div>
</div>
<div class="mobile_menu">
<button class="left_mobile_menu" id="left_mobile_menu_button" type="button">
<span class="sr_only">Toggle Menu</span>
</button>
<button class="right_mobile_menu" id="mobile_menu_button" type="button">
<span class="sr_only">Toggle Menu</span>
</button>
Expand Down
26 changes: 17 additions & 9 deletions src/css/layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,22 @@ IMPORTANT: any new icon should also must be added on /service-worker.js + its ve
}

@media screen and (max-width:700px){
body{
padding-top:50px;
}
.wrapper{
top: 50px;
}
.sidebar_left{
position: absolute;
left: -90px;
background: var(--background);
}
.sidebar_left.active{
box-shadow: -5px 0px 10px 0px rgba(0,0,0,0.75);
left: 0;
z-index: 3;
}
.sidebar_right{
position: absolute;
height: 100%;
Expand Down Expand Up @@ -646,20 +662,12 @@ canvas{
background-color: #ddd;
}

@media screen and (max-width:700px){
body{
padding-top:50px;
}
.wrapper{
top: 50px;
}
}
@media screen and (max-width:550px){
.canvas_wrapper{
margin-left: 0px;
}
}
@media screen and (max-height: 740px){
@media screen and (max-height: 690px){
.sidebar_left{
width: 75px;
}
Expand Down
5 changes: 1 addition & 4 deletions src/css/menu.css
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,9 @@
.mobile_menu {
display: block;
}
.left_mobile_menu {
display: none;
}
.main_menu > ul.menu_bar {
height: 50px;
padding-left: 0;
padding-left: 50px;
padding-right: 50px;
}
}
3 changes: 3 additions & 0 deletions src/js/core/base-gui.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,9 @@ class Base_gui_class {
});
}

document.getElementById('left_mobile_menu_button').addEventListener('click', function (event) {
document.querySelector('.sidebar_left').classList.toggle('active');
});
document.getElementById('mobile_menu_button').addEventListener('click', function (event) {
document.querySelector('.sidebar_right').classList.toggle('active');
});
Expand Down

0 comments on commit 43088b1

Please sign in to comment.