forked from ecosciug/PingPongTracker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
164 lines (150 loc) · 6.67 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Ping Pong Score Tracker</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" />
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
</head>
<body>
<div class="custom-display-container">
<div class="card">
<div class="card-header">
<div id="scoreKeeperBox" class="score-box">
<h1 class="card-title text-center" id="scoreKeeperTitle">Ping Pong Score Tracker</h1>
</div>
</div>
<div class="card-body">
<div class="text-center">
<span id="servingDisplay" class="round-box">Player 1</span>
</div>
<div class="text-center custom-display">
<span id="p1Display">0</span><span> : </span><span id="p2Display">0</span>
</div>
<div class="row justify-content-center">
<div class="d-flex mb-4 justify-content-center">
<button id="p1Button" class="btn btn-primary btn-lg me-4">+1 Player One</button>
<button id="p2Button" class="btn btn-danger btn-lg ms-4">+1 Player Two</button>
</div>
</div>
<div class="row justify-content-center mb-4">
<!-- Increased mb-4 for more margin-bottom -->
<button class="btn btn-primary" type="button" data-bs-toggle="collapse"
data-bs-target="#collapseForm" aria-expanded="false" aria-controls="collapseForm">
Settings
</button>
</div>
<div class="collapse" id="collapseForm">
<div class="row justify-content-center mb-4">
<!-- Increased mb-4 for more margin-bottom -->
<label class="col-form-label col-md-auto">Playing to:</label>
<div class="col-md-auto">
<select class="form-select" id="playTo">
<option selected value="11">11</option>
<option value="21">21</option>
</select>
</div>
</div>
<div class="row justify-content-center mb-4">
<!-- Increased mb-4 for more margin-bottom -->
<label class="col-form-label col-md-auto">Starting:</label>
<div class="col-md-auto">
<select class="form-select" id="startServing">
<option selected value="0">Player 1</option>
<option value="1">Player 2</option>
</select>
</div>
</div>
<div class="row justify-content-center mb-4">
<!-- Increased mb-4 for more margin-bottom -->
<label class="col-form-label col-md-auto">Sound:</label>
<div class="col-md-auto">
<select class="form-select" id="enabledSound">
<option value="0">Off</option>
<option selected value="1">On</option>
</select>
</div>
</div>
<div class="row justify-content-center mb-4">
<!-- Increased mb-4 for more margin-bottom -->
<label for="player1Name" class="col-form-label col-md-auto">Player 1 name:</label>
<div class="col-md-auto">
<input type="text" class="form-control" id="player1Name" value="Player 1">
</div>
</div>
<div class="row justify-content-center mb-4">
<!-- Increased mb-4 for more margin-bottom -->
<label for="player2Name" class="col-form-label col-md-auto">Player 2 name:</label>
<div class="col-md-auto">
<input type="text" class="form-control" id="player2Name" value="Player 2">
</div>
</div>
<div class="row justify-content-center mb-4">
<div class="col-md-auto">
<button id="reset" class="btn btn-secondary btn-lg">Reset</button>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Add the following code for the info button -->
<div class="info-button-container">
<button class="btn btn-info info-button" type="button" data-bs-toggle="modal" data-bs-target="#infoModal">
<i class="bi bi-info-circle-fill"></i> Info
</button>
</div>
<!-- Add the following code for the modal containing the rules -->
<div class="modal fade" id="infoModal" tabindex="-1" aria-labelledby="infoModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="infoModalLabel">How to Play</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<p>Welcome to the Ping Pong Score Keeper!</p>
<p>Here's how to play:</p>
<ul>
<li>Click "+1" or left and right arrows to increase a player's score.</li>
<li>Use the dropdowns to set the maximum score and determine the serving player.</li>
<li>Toggle the sound effects on/off using the "Sound" dropdown.</li>
<li>Modify the player names in the input fields.</li>
<li>Click "Reset" to clear scores and settings.</li>
</ul>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<script src="app.js"></script>
</body>
</html>
<style>
.custom-display {
font-size: calc(5rem + 5vw);
}
.custom-display-container {
width: 100%;
height: 100%;
}
.round-box {
display: inline-block;
padding: 1vw;
border-radius: 2vw;
font-size: calc(3rem + 3vw);
width: 100%;
}
.info-button-container {
position: absolute;
top: 10px;
right: 10px;
}
.info-button {
font-size: 1rem;
}
</style>