Slightly improve styling on mobile devices

This commit is contained in:
Chandler Swift 2023-07-03 22:41:24 -05:00
parent fd7dca3b11
commit 2ff3e61060
Signed by: chandlerswift
GPG key ID: A851D929D52FB93F
2 changed files with 28 additions and 5 deletions

View file

@ -10,6 +10,9 @@
<noscript>Sorry, but you'll need JavaScript enabled for any of this to work!</noscript>
<aside>
<h1>Chandler's Maps</h1>
<div class="ol-unselectable ol-control close" style="pointer-events: auto;">
<button onclick="document.body.classList.toggle('nav-open')">&lsaquo;</button>
</div>
</aside>
<div id="map"></div>
<script type="module" src="./main.js"></script>

View file

@ -1,10 +1,5 @@
@import "node_modules/ol/ol.css";
html, body {
margin: 0;
height: 100%;
}
#map {
position: absolute;
top: 0;
@ -41,3 +36,28 @@ aside ul li {
h1 {
text-align: center;
}
aside .close {
display: none;
}
@media (max-width: 400px) {
.nav-open #map {
left: 100%;
}
aside {
margin-left: calc(-100% + 2em);
width: calc(100% - 2em);
}
aside .close {
display: initial;
}
.nav-open aside .close {
position: absolute;
top: 0.5em;
right: 0.5em;
}
}