Skip to content

Commit

Permalink
Move sidebar toggle out of the top menu (close #88)
Browse files Browse the repository at this point in the history
  • Loading branch information
quincylvania committed Sep 5, 2024
1 parent 231ff49 commit 17e077f
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 1 deletion.
54 changes: 54 additions & 0 deletions css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,41 @@ body.sidebar-open #map-wrap {
bottom: 10px;
z-index: 100;
}
#inspect-toggle {
display: block;
position: absolute;
top: calc(50% - 20px);
right: 10px;
height: 40px;
width: 20px;
background: white;
border-radius: 20px 0 0 20px;
border: 1px solid #aaa;
border-right: 0;
box-shadow: 0 0 2px rgba(0, 0, 0, 0.2);
color: inherit;
text-decoration: none;
z-index: 9999;
}
#inspect-toggle:before {
content: "";
height: 100%;
width: 100%;
position: relative;
margin-left: 2px;
display: inline-block;
background-image: url(/img/arrow-right.png) !important;
background-size: 8px;
background-repeat: no-repeat !important;
background-position-x: 50% !important;
background-position-y: 50% !important;
}
body.sidebar-open #inspect-toggle {
right: 0;
}
body:not(.sidebar-open) #inspect-toggle:before {
rotate: 180deg;
}
#sidebar {
display: none;
flex-direction: column;
Expand Down Expand Up @@ -290,6 +325,7 @@ body.sidebar-open #sidebar {
min-width: 100%;
}
#map-wrap {
position: relative;
display: flex;
flex-direction: column;
padding: 0;
Expand All @@ -301,4 +337,22 @@ body.sidebar-open #sidebar {
top: 0 !important;
left: 0;
}
#inspect-toggle {
top: auto;
border-radius: 20px 20px 0 0;
border-right: 1px solid #aaa;;
border-bottom: none;
left: calc(50% - 20px);
bottom: 0;
height: 20px;
width: 40px;
}
#inspect-toggle:before {
rotate: 90deg;
margin-left: auto;
margin-top: 2px;
}
body:not(.sidebar-open) #inspect-toggle:before {
rotate: 270deg;
}
}
Binary file added img/arrow-right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
<li><a href="https://openstreetmap.us/our-work/trails/" target="_blank">About</a></li>
<li><a href="https://github.com/osmus/OpenTrailMap" target="_blank">GitHub</a></li>
<li><a href="https://openstreetmap.app.neoncrm.com/forms/trails-stewardship-initiative" target="_blank">Donate</a></li>
<li><a href="" id="inspect-toggle">Inspect</a></li>
</ul>
</div>
<div id="body">
Expand All @@ -40,6 +39,7 @@ <h1 style="display:flex;"><span style="flex-basis: 100%;"><span class="swatch"><
</div>
</div>
<div id="map-wrap">
<a href="" id="inspect-toggle" title="Toggle sidebar"></a>
<div id="controls">
<select id="travel-mode">
<option value="all" selected>All Trails</option>
Expand Down

0 comments on commit 17e077f

Please sign in to comment.