Skip to content
This repository was archived by the owner on Apr 16, 2025. It is now read-only.

Commit a4e0ed5

Browse files
committed
refactor: update sidebar to be more mobile friendly
Before the sidebar wasn't very nice on smaller devices such as mobiles. This change should fix this. This also means that the map takes up the full webpage and users need to click the "Hide/Show Controls" button before they can see the controls.
1 parent d39e318 commit a4e0ed5

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

index.php

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,11 @@
182182
</div>
183183
</li>
184184

185+
<li class="nav-item">
186+
<a class="nav-link" role="button" id="sidebarTooggle" data-toggle="collapse" data-target="#sidebar" aria-controls="sidebar" aria-label="Toggle sidebar" aria-expanded="false">
187+
Hide/Show Controls
188+
</a>
189+
</li>
185190
</ul>
186191
</div>
187192
</div>
@@ -190,17 +195,17 @@
190195

191196
<div id="wrapper" class="container-fluid">
192197
<div class="row">
193-
<div id="sidebar" class="col-2 float-left width show">
198+
<div id="sidebar" class="col-md-2 col-sm-6 col-xs-12 float-left collapse">
194199
<div class="list-group border-0 card text-center text-md-left" style="padding: 8px 0;">
195200

196201
<a class="nav-header">Controls</a>
197202

198203
<a class="list-group-item d-inline-block collapsed" id="refreshBlips" href="#">
199-
<span class="d-none d-md-inline">Refresh Blips</span>
204+
<span class="d-md-inline">Refresh Blips</span>
200205
</a>
201206

202207
<a id="showBlips" href="#" class="list-group-item d-inline-block collapsed">
203-
<span class="d-none d-md-inline">Show Blips</span>
208+
<span class="d-md-inline">Show Blips</span>
204209
<span id="blips_enabled" class="badge badge-pill badge-success pull-right">on</span>
205210
</a>
206211

@@ -210,12 +215,12 @@
210215
</li>
211216
-->
212217
<a id="reconnect" href="#" class="list-group-item d-inline-block collapsed">
213-
<span class="d-none d-md-inline">Connect</span>
218+
<span class="d-md-inline">Connect</span>
214219
<span id="connection" class="badge badge-pill badge-danger pull-right">disconnected</span>
215220
</a>
216221

217222
<a class="list-group-item d-inline-block collapsed">
218-
<span class="d-none d-md-inline">Track Player</span>
223+
<span class="d-md-inline">Track Player</span>
219224

220225
<select id="playerSelect" class="input-large form-control pull-right">
221226
<option></option>
@@ -244,12 +249,12 @@
244249
<div class="list-group border-0 card text-center text-md-left" style="margin-top: 10px;">
245250
<p style="text-align: center;">This was originaly created by <a href="https://github.com/TGRHavoc">Havoc</a></p>
246251

247-
<div id="alert-holder" class="list-group-item d-inline-block collapsed" style="white-space: normal; border: none; overflow-y: scroll; max-height: 200px; width: 322px; /* Remove scroll bar */">
252+
<div id="alert-holder" class="list-group-item d-inline-block collapsed" style="white-space: normal; border: none; overflow-y: scroll; max-height: 20vh; width: 100%; /* Remove scroll bar */">
248253
</div>
249254
</div>
250255
</div>
251256

252-
<main id="map-holder" class="col-10 main" >
257+
<main id="map-holder" class="col-12 main" >
253258
<div id="map-canvas" style="position: relative; overflow: hidden; background-color: rgb(15, 168, 210);"></div>
254259
</main>
255260
</div>

style/src/style.css

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,9 @@ input[type=text] {display:inline;}
175175

176176
#sidebar {
177177
overflow: hidden;
178+
overflow-y: scroll;
178179
z-index: 3;
180+
background-color: #333;
179181
}
180182
#sidebar .list-group {
181183
background-color: #333;
@@ -240,9 +242,6 @@ input[type=text] {display:inline;}
240242

241243
@media (max-width:768px) {
242244
#sidebar {
243-
min-width: 35px;
244-
max-width: 40px;
245-
overflow-y: auto;
246245
overflow-x: visible;
247246
transition: all 0.25s ease;
248247
transform: translateX(-45px);
@@ -257,7 +256,6 @@ input[type=text] {display:inline;}
257256

258257
#sidebar, #sidebar .list-group {
259258
min-width: 35px;
260-
overflow: visible;
261259
}
262260
/* overlay sub levels on small screens */
263261
#sidebar .list-group .collapse.show, #sidebar .list-group .collapsing {
@@ -277,18 +275,19 @@ input[type=text] {display:inline;}
277275
}
278276
}
279277

280-
.collapse.show {
278+
#sidebar.collapse.show {
281279
visibility: visible;
280+
height: 100vh;
282281
}
283-
.collapsing {
282+
#sidebar.collapsing {
284283
visibility: visible;
285284
height: 0;
286285
-webkit-transition-property: height, visibility;
287286
transition-property: height, visibility;
288287
-webkit-transition-timing-function: ease-out;
289288
transition-timing-function: ease-out;
290289
}
291-
.collapsing.width {
290+
#sidebar.collapsing.width {
292291
-webkit-transition-property: width, visibility;
293292
transition-property: width, visibility;
294293
width: 0;

0 commit comments

Comments
 (0)