Skip to content

Commit 50044cf

Browse files
committed
Add mobile sidebar toggle and live map link in README
Collapsible sidebar on screens <=768px with a hamburger toggle button. Starts collapsed on mobile so the map is usable. Add link to the live map at the top of the README.
1 parent be7247e commit 50044cf

4 files changed

Lines changed: 69 additions & 0 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
Interactive, spoiler-free map of [The Wandering Inn](https://wanderinginn.com) web serial. Explore Innworld as you read — the map reveals locations only as they appear in the story.
88

9+
**[View the live map](https://intelligrit.com/the-wandering-inn-map/)**
10+
911
## Features
1012

1113
- **Spoiler-free chapter slider** — set your reading progress and the map only shows what you've encountered so far

internal/web/static/app.css

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,10 @@ body {
199199
background: #1a3a5c;
200200
}
201201

202+
#sidebar-toggle {
203+
display: none;
204+
}
205+
202206
#sidebar {
203207
width: 300px;
204208
background: #16213e;
@@ -207,6 +211,50 @@ body {
207211
padding: 12px;
208212
}
209213

214+
@media (max-width: 768px) {
215+
#sidebar-toggle {
216+
display: block;
217+
position: absolute;
218+
top: auto;
219+
bottom: 16px;
220+
right: 16px;
221+
z-index: 1000;
222+
background: #16213e;
223+
color: #e0e0e0;
224+
border: 1px solid #0f3460;
225+
border-radius: 6px;
226+
width: 40px;
227+
height: 40px;
228+
font-size: 20px;
229+
cursor: pointer;
230+
box-shadow: 0 2px 8px rgba(0,0,0,0.4);
231+
line-height: 1;
232+
}
233+
234+
#sidebar-toggle:hover {
235+
background: #1a1a3e;
236+
}
237+
238+
#map-container {
239+
position: relative;
240+
}
241+
242+
#sidebar {
243+
position: absolute;
244+
top: 0;
245+
right: 0;
246+
bottom: 0;
247+
width: 280px;
248+
z-index: 999;
249+
box-shadow: -4px 0 12px rgba(0,0,0,0.4);
250+
transition: transform 0.2s ease;
251+
}
252+
253+
#sidebar.collapsed {
254+
transform: translateX(100%);
255+
}
256+
}
257+
210258
#sidebar h2 {
211259
font-size: 18px;
212260
margin-bottom: 4px;

internal/web/static/app.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,4 +1072,22 @@ function distToSegment(p, a, b) {
10721072
return Math.hypot(p.x - (a.x + t * dx), p.y - (a.y + t * dy));
10731073
}
10741074

1075+
// Sidebar toggle for mobile
1076+
(function () {
1077+
const toggle = document.getElementById('sidebar-toggle');
1078+
const sidebar = document.getElementById('sidebar');
1079+
if (!toggle || !sidebar) return;
1080+
1081+
// Start collapsed on mobile
1082+
if (window.innerWidth <= 768) {
1083+
sidebar.classList.add('collapsed');
1084+
toggle.setAttribute('aria-expanded', 'false');
1085+
}
1086+
1087+
toggle.addEventListener('click', () => {
1088+
const collapsed = sidebar.classList.toggle('collapsed');
1089+
toggle.setAttribute('aria-expanded', String(!collapsed));
1090+
});
1091+
})();
1092+
10751093
init();

internal/web/static/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ <h1>The Wandering Inn <span class="title-sep">&mdash;</span> <span class="title-
5252

5353
<div id="map-container" role="main">
5454
<div id="map" role="application" aria-label="Interactive map of Innworld locations. Tab through markers to explore, or use the sidebar location list." aria-roledescription="interactive map"></div>
55+
<button id="sidebar-toggle" aria-label="Toggle location list" aria-expanded="true">&#9776;</button>
5556
<aside id="sidebar" aria-label="Location list">
5657
<h2>Locations</h2>
5758
<input type="search" id="location-search" placeholder="Search locations..." aria-label="Search locations">

0 commit comments

Comments
 (0)