Skip to content

Commit b9f518d

Browse files
committed
Fix bottom bar button/status overlap and improve mobile layout
- Separate HUD bottom bar into buttons container + status message - Fix join row overflow on mobile (min-width: 0 on input, shrink button) - Add scroll support to screen overlays for small viewports - Reduce mobile spacing for tighter menu layout - Prevent title text wrapping with white-space: nowrap
1 parent 871614d commit b9f518d

File tree

2 files changed

+50
-20
lines changed

2 files changed

+50
-20
lines changed

static/index.html

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,16 @@ <h2>Game Created</h2>
8585
<span id="latencyInfo" class="latency-text"></span>
8686
</div>
8787
<div id="bottomBar" class="hud-bottom">
88-
<button id="undoBtn" class="btn btn-secondary" style="display:none">UNDO</button>
89-
<button id="confirmBtn" class="btn btn-confirm" style="display:none">CONFIRM</button>
90-
<button id="launchMineBtn" class="btn btn-ordnance" style="display:none">MINE</button>
91-
<button id="launchTorpedoBtn" class="btn btn-ordnance" style="display:none">TORPEDO</button>
92-
<button id="launchNukeBtn" class="btn btn-ordnance btn-nuke" style="display:none">NUKE</button>
93-
<button id="skipOrdnanceBtn" class="btn btn-confirm" style="display:none">SKIP</button>
94-
<button id="attackBtn" class="btn btn-attack" style="display:none">ATTACK</button>
95-
<button id="skipCombatBtn" class="btn btn-confirm" style="display:none">SKIP COMBAT</button>
88+
<div class="hud-bottom-buttons">
89+
<button id="undoBtn" class="btn btn-secondary" style="display:none">UNDO</button>
90+
<button id="confirmBtn" class="btn btn-confirm" style="display:none">CONFIRM</button>
91+
<button id="launchMineBtn" class="btn btn-ordnance" style="display:none">MINE</button>
92+
<button id="launchTorpedoBtn" class="btn btn-ordnance" style="display:none">TORPEDO</button>
93+
<button id="launchNukeBtn" class="btn btn-ordnance btn-nuke" style="display:none">NUKE</button>
94+
<button id="skipOrdnanceBtn" class="btn btn-confirm" style="display:none">SKIP</button>
95+
<button id="attackBtn" class="btn btn-attack" style="display:none">ATTACK</button>
96+
<button id="skipCombatBtn" class="btn btn-confirm" style="display:none">SKIP COMBAT</button>
97+
</div>
9698
<div id="statusMsg" class="status-msg"></div>
9799
</div>
98100
</div>

static/style.css

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,20 @@ body {
3030
width: 100%;
3131
height: 100%;
3232
display: flex;
33-
align-items: center;
3433
justify-content: center;
3534
z-index: 10;
3635
background: rgba(10, 10, 26, 0.85);
3736
overflow-y: auto;
3837
-webkit-overflow-scrolling: touch;
38+
padding: 1rem 0;
3939
}
4040

4141
.menu-content {
4242
text-align: center;
4343
max-width: 360px;
4444
padding: 2rem;
45-
margin: auto; /* Center when screen scrolls */
45+
margin: auto;
46+
flex-shrink: 0;
4647
}
4748

4849
.title {
@@ -51,6 +52,7 @@ body {
5152
letter-spacing: 0.3em;
5253
color: #fff;
5354
margin-bottom: 0.2em;
55+
white-space: nowrap;
5456
}
5557

5658
.subtitle {
@@ -155,8 +157,15 @@ body {
155157
gap: 0.5rem;
156158
}
157159

160+
.join-row .btn {
161+
flex-shrink: 0;
162+
padding-left: 1rem;
163+
padding-right: 1rem;
164+
}
165+
158166
.code-input {
159167
flex: 1;
168+
min-width: 0;
160169
padding: 0.75rem 1rem;
161170
background: rgba(255, 255, 255, 0.05);
162171
border: 1px solid rgba(255, 255, 255, 0.2);
@@ -216,16 +225,24 @@ body {
216225
left: 0;
217226
right: 0;
218227
display: flex;
219-
justify-content: center;
228+
flex-direction: column;
220229
align-items: center;
221-
padding: 1rem;
230+
gap: 0.5rem;
231+
padding: 0.75rem 1rem;
222232
z-index: 5;
223233
}
224234

235+
.hud-bottom-buttons {
236+
display: flex;
237+
gap: 0.5rem;
238+
align-items: center;
239+
}
240+
225241
.status-msg {
226-
font-size: 0.9rem;
227-
color: #aaa;
242+
font-size: 0.85rem;
243+
color: #888;
228244
text-align: center;
245+
max-width: 90vw;
229246
}
230247

231248
/* Scenario selection */
@@ -690,14 +707,22 @@ body {
690707

691708
.subtitle {
692709
font-size: 0.75rem;
693-
margin-bottom: 1.5rem;
710+
margin-bottom: 1rem;
694711
}
695712

696713
.menu-content {
697-
padding: 1.2rem;
714+
padding: 1rem;
698715
max-width: 300px;
699716
}
700717

718+
.divider {
719+
margin: 0.8rem 0;
720+
}
721+
722+
.btn {
723+
padding: 0.6rem 1.5rem;
724+
}
725+
701726
.hud-bar {
702727
flex-wrap: wrap;
703728
gap: 0.2rem 0.5rem;
@@ -709,10 +734,14 @@ body {
709734
}
710735

711736
.hud-bottom {
737+
gap: 0.3rem;
738+
padding: 0.4rem 0.5rem;
739+
padding-bottom: max(0.4rem, env(safe-area-inset-bottom));
740+
}
741+
742+
.hud-bottom-buttons {
712743
flex-wrap: wrap;
713-
gap: 0.4rem;
714-
padding: 0.5rem;
715-
padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
744+
justify-content: center;
716745
}
717746

718747
/* Larger touch targets for mobile */
@@ -723,7 +752,6 @@ body {
723752

724753
.status-msg {
725754
font-size: 0.7rem;
726-
width: 100%;
727755
}
728756

729757
.btn-confirm, .btn-attack {

0 commit comments

Comments
 (0)