Skip to content

Commit d2f215f

Browse files
committed
Adapt for mobile
1 parent 8403394 commit d2f215f

File tree

1 file changed

+62
-20
lines changed

1 file changed

+62
-20
lines changed

midi.html

+62-20
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,87 @@
22
<html>
33
<head>
44
<meta charset="utf-8">
5+
<!-- Ensure mobile devices render the page correctly -->
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
7+
58
<title>MIDI Quiz Game - Host</title>
69
<style>
10+
/* Basic styling and responsive container */
711
body {
812
font-family: Arial, sans-serif;
913
padding: 20px;
14+
margin: 0;
15+
background: #f4f4f4;
16+
}
17+
h1, h2 {
18+
text-align: center;
1019
}
1120
#status {
1221
margin-bottom: 15px;
1322
font-weight: bold;
23+
text-align: center;
1424
}
15-
.player {
16-
margin: 5px 0;
25+
#controls {
26+
text-align: center;
27+
margin-bottom: 15px;
1728
}
1829
button {
1930
margin: 5px;
20-
padding: 5px 10px;
21-
}
22-
#controls {
23-
margin-bottom: 15px;
31+
padding: 10px 15px;
32+
font-size: 1em;
33+
border: none;
34+
border-radius: 4px;
35+
background-color: #4285F4;
36+
color: white;
37+
}
38+
button:disabled {
39+
background-color: #aaa;
40+
}
41+
#nominal, #timer {
42+
text-align: center;
43+
font-size: 1.2em;
44+
margin: 10px 0;
2445
}
25-
#timer {
26-
font-size: 20px;
27-
font-weight: bold;
28-
color: red;
46+
#players {
47+
margin: 0 auto;
48+
max-width: 600px;
49+
padding: 10px;
50+
background: white;
51+
border-radius: 4px;
52+
box-shadow: 0 0 5px rgba(0,0,0,0.1);
2953
}
30-
#nominal {
31-
font-size: 18px;
32-
margin: 10px 0;
54+
.player {
55+
margin: 5px 0;
56+
padding: 8px;
57+
border-bottom: 1px solid #ddd;
3358
}
34-
/* Scrollable log area with fixed height */
59+
/* Scrollable log area */
3560
#messages {
3661
max-height: 150px;
3762
overflow-y: auto;
3863
border: 1px solid #ccc;
3964
padding: 5px;
4065
list-style: none;
41-
margin: 10px 0;
66+
margin: 10px auto;
67+
max-width: 600px;
68+
background: white;
69+
border-radius: 4px;
70+
}
71+
/* Media query for smaller screens */
72+
@media (max-width: 600px) {
73+
body {
74+
padding: 10px;
75+
font-size: 16px;
76+
}
77+
button {
78+
padding: 10px;
79+
font-size: 1em;
80+
width: 100%;
81+
margin: 5px 0;
82+
}
83+
#players, #messages {
84+
width: 100%;
85+
}
4286
}
4387
</style>
4488
</head>
@@ -47,7 +91,6 @@ <h1>MIDI Quiz Game - Host</h1>
4791
<div id="status">Initializing...</div>
4892

4993
<div id="controls">
50-
<!-- Host Buttons -->
5194
<button id="time">Time</button>
5295
<button id="correct">Correct</button>
5396
<button id="wrong">Wrong</button>
@@ -258,11 +301,11 @@ <h2>Players</h2>
258301
saveGameState();
259302
}
260303

261-
// "Reset Game" button: Set all player scores to 0, set nominal back to 10, and reset timer.
304+
// "Reset Game" button: Set all player scores to 0, set nominal to 10, and reset timer.
262305
function resetGame() {
263306
stopTimer();
264307
players.forEach(p => p.score = 0);
265-
currentNominalIndex = 0; // This makes the displayed nominal 10.
308+
currentNominalIndex = 0; // This resets the displayed nominal to 10.
266309
resetRound();
267310
logMessage("Reset Game: All player scores set to 0 and nominal set to 10.");
268311
updatePlayersUI();
@@ -333,8 +376,7 @@ <h2>Players</h2>
333376
p.ignored = false;
334377
p.answeredDuringTimer = false;
335378
});
336-
resetActiveState()
337-
activePlayer = null;
379+
resetActiveState();
338380
updatePlayersUI();
339381
updateHostControls();
340382
}

0 commit comments

Comments
 (0)