2
2
< html >
3
3
< head >
4
4
< meta charset ="utf-8 ">
5
+ <!-- Ensure mobile devices render the page correctly -->
6
+ < meta name ="viewport " content ="width=device-width, initial-scale=1 ">
7
+
5
8
< title > MIDI Quiz Game - Host</ title >
6
9
< style >
10
+ /* Basic styling and responsive container */
7
11
body {
8
12
font-family : Arial, sans-serif;
9
13
padding : 20px ;
14
+ margin : 0 ;
15
+ background : # f4f4f4 ;
16
+ }
17
+ h1 , h2 {
18
+ text-align : center;
10
19
}
11
20
# status {
12
21
margin-bottom : 15px ;
13
22
font-weight : bold;
23
+ text-align : center;
14
24
}
15
- .player {
16
- margin : 5px 0 ;
25
+ # controls {
26
+ text-align : center;
27
+ margin-bottom : 15px ;
17
28
}
18
29
button {
19
30
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 ;
24
45
}
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 );
29
53
}
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 ;
33
58
}
34
- /* Scrollable log area with fixed height */
59
+ /* Scrollable log area */
35
60
# messages {
36
61
max-height : 150px ;
37
62
overflow-y : auto;
38
63
border : 1px solid # ccc ;
39
64
padding : 5px ;
40
65
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
+ }
42
86
}
43
87
</ style >
44
88
</ head >
@@ -47,7 +91,6 @@ <h1>MIDI Quiz Game - Host</h1>
47
91
< div id ="status "> Initializing...</ div >
48
92
49
93
< div id ="controls ">
50
- <!-- Host Buttons -->
51
94
< button id ="time "> Time</ button >
52
95
< button id ="correct "> Correct</ button >
53
96
< button id ="wrong "> Wrong</ button >
@@ -258,11 +301,11 @@ <h2>Players</h2>
258
301
saveGameState ( ) ;
259
302
}
260
303
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.
262
305
function resetGame ( ) {
263
306
stopTimer ( ) ;
264
307
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.
266
309
resetRound ( ) ;
267
310
logMessage ( "Reset Game: All player scores set to 0 and nominal set to 10." ) ;
268
311
updatePlayersUI ( ) ;
@@ -333,8 +376,7 @@ <h2>Players</h2>
333
376
p . ignored = false ;
334
377
p . answeredDuringTimer = false ;
335
378
} ) ;
336
- resetActiveState ( )
337
- activePlayer = null ;
379
+ resetActiveState ( ) ;
338
380
updatePlayersUI ( ) ;
339
381
updateHostControls ( ) ;
340
382
}
0 commit comments