-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscore.html
More file actions
470 lines (420 loc) · 17.5 KB
/
Copy pathscore.html
File metadata and controls
470 lines (420 loc) · 17.5 KB
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Live Soccer Scoring App</title>
<style>
body { font-family: Inter, system-ui, -apple-system, sans-serif; margin: 0; background: #0f172a; color: #e6eef8; }
.app { display: grid; grid-template-columns: 1fr 360px; gap: 12px; height: 100vh; padding: 12px; position: relative; }
.panel { background: linear-gradient(180deg, #0b1220, #071022); border-radius: 12px; padding: 12px; box-shadow: 0 6px 18px rgba(2,6,23,.6); }
.controls { display: flex; gap: 8px; flex-wrap: wrap; }
button { background: #2563eb; border: none; padding: 8px 10px; border-radius: 8px; color: white; cursor: pointer; }
button.secondary { background: #1f2937; }
.score { font-size: 18px; margin-bottom: 8px; }
.badge { background: #0b1220; padding: 6px 8px; border-radius: 999px; display: inline-block; }
.keypad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 20px; }
.keypad button { background-color: #2563eb; padding: 10px; color: white; font-size: 18px; cursor: pointer; border-radius: 8px; }
.keypad button:hover { background-color: #1e40af; }
.keypad button.clear { background-color: #dc2626; }
.keypad button.submit { background-color: #22c55e; }
.score-display { margin-bottom: 20px; }
table { width: 100%; border-collapse: collapse; }
table th, table td { padding: 10px; text-align: center; border: 1px solid #e6eef8; }
iframe { width: 100%; height: 400px; border: none; }
/* Sponsor logos styling */
.sponsors {
position: absolute;
top: 0;
width: 100%;
display: flex;
justify-content: center;
padding: 10px;
gap: 20px;
z-index: 999;
}
.sponsor-logo img {
height: 50px;
}
</style>
</head>
<body>
<!-- Sponsor Logos -->
<div class="sponsors">
<div class="sponsor-logo"><img src="logo1.png" alt="Sponsor 1"></div>
<div class="sponsor-logo"><img src="logo2.png" alt="Sponsor 2"></div>
<div class="sponsor-logo"><img src="logo3.png" alt="Sponsor 3"></div>
</div>
<section id="scoreboard">
<h2>Match Details</h2>
<form id="matchDetailsForm">
<label for="competition">Competition:</label>
<input type="text" id="competition" name="competition" required>
<label for="matchType">Match Type:</label>
<select id="matchType" name="matchType">
<option value="home">Home</option>
<option value="away">Away</option>
</select>
<label for="date">Date:</label>
<input type="date" id="date" name="date" required>
<label for="venue">Venue:</label>
<input type="text" id="venue" name="venue" required>
<button type="submit">Save Match Details</button>
</form>
</section>
<section id="ballByBall">
<h2>Live Soccer Scoring</h2>
<div class="score-display">
<p id="score">Score: 0 - 0 | Current Player: N/A | Time: 0:00</p>
</div>
<!-- Scoring Pad Section -->
<div class="keypad">
<button class="run" data-value="1">Goal</button>
<button class="run" data-value="2">Foul</button>
<button class="run" data-value="3">Yellow Card</button>
<button class="run" data-value="4">Red Card</button>
<button class="submit" data-value="submit">Submit</button>
<button class="clear" data-value="clear">Clear</button>
</div>
<!-- Ball-by-Ball Table (or event log) -->
<h3>Match Events</h3>
<table id="eventDetailsTable">
<thead>
<tr>
<th>Time</th>
<th>Player</th>
<th>Event</th>
</tr>
</thead>
<tbody id="eventDetailsRows">
<!-- Match events will be inserted here dynamically -->
</tbody>
</table>
</section>
<section id="liveStream">
<h2>Live Stream</h2>
<!-- Embed the live stream from YouTube -->
<iframe id="youtubeStream" src="https://www.youtube.com/embed/VIDEO_ID?autoplay=1" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</section>
<section id="summary">
<h2>Match Summary</h2>
<div id="matchSummary">
<!-- Match summary will be displayed here -->
</div>
<button id="downloadReport">Download Match Summary</button>
</section>
<footer>
<p>© 2026 Soccer Scoring System. All rights reserved.</p>
</footer>
<script>
// Accessing the tablet's camera (if necessary for input)
if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
navigator.mediaDevices.getUserMedia({ video: true })
.then(function(stream) {
// Display the camera feed if needed (for example, to capture match events)
const video = document.createElement('video');
video.srcObject = stream;
video.autoplay = true;
document.body.appendChild(video);
})
.catch(function(error) {
console.log("Camera not accessible: ", error);
});
}
// YouTube Live stream embed (replace with actual stream)
const videoId = "VIDEO_ID"; // Replace with actual video ID
const youtubeEmbedUrl = `https://www.youtube.com/embed/${videoId}?autoplay=1`;
document.getElementById('youtubeStream').src = youtubeEmbedUrl;
// Scoring System Logic
let scoreHome = 0;
let scoreAway = 0;
let matchTime = 0;
const scoreDisplay = document.getElementById('score');
const eventDetailsTable = document.getElementById('eventDetailsRows');
// Handle event scoring
document.querySelectorAll(".keypad button").forEach(button => {
button.addEventListener("click", () => {
const value = button.dataset.value;
let eventDetail = '';
if (value === "1") { // Goal
scoreHome++;
eventDetail = `Goal for Home Team`;
} else if (value === "2") { // Foul
eventDetail = `Foul by Player`;
} else if (value === "3") { // Yellow Card
eventDetail = `Yellow Card for Player`;
} else if (value === "4") { // Red Card
eventDetail = `Red Card for Player`;
}
matchTime += 1; // Increment time by 1 minute
updateScoreboard(eventDetail);
});
});
// Update the scoreboard and log events
function updateScoreboard(eventDetail) {
// Update match time and score display
let minutes = Math.floor(matchTime / 60);
let seconds = matchTime % 60;
let timeDisplay = `${minutes}:${seconds < 10 ? '0' + seconds : seconds}`;
scoreDisplay.textContent = `Score: ${scoreHome} - ${scoreAway} | Time: ${timeDisplay}`;
// Log the event in the table
const row = document.createElement("tr");
row.innerHTML = `
<td>${timeDisplay}</td>
<td>Player</td>
<td>${eventDetail}</td>
`;
eventDetailsTable.appendChild(row);
}
// Handle match event submissions
document.querySelector(".submit").addEventListener("click", () => {
// Capture the event and update the scoreboard
let eventDetail = '';
if (scoreHome > scoreAway) {
eventDetail = `Home Team wins with a score of ${scoreHome} - ${scoreAway}`;
} else if (scoreAway > scoreHome) {
eventDetail = `Away Team wins with a score of ${scoreAway} - ${scoreHome}`;
} else {
eventDetail = `The match is a draw at ${scoreHome} - ${scoreAway}`;
}
updateScoreboard(eventDetail);
});
// Reset scoring inputs
document.querySelector(".clear").addEventListener("click", () => {
scoreHome = 0;
scoreAway = 0;
matchTime = 0;
scoreDisplay.textContent = `Score: ${scoreHome} - ${scoreAway} | Time: 0:00`;
eventDetailsTable.innerHTML = ''; // Clear event log
});
// Function to download match summary as a report
document.getElementById("downloadReport").addEventListener("click", () => {
let matchSummary = `Match Summary\n\nHome Team: ${scoreHome}\nAway Team: ${scoreAway}\nFinal Time: ${Math.floor(matchTime / 60)}:${matchTime % 60 < 10 ? '0' + (matchTime % 60) : matchTime % 60}\n\nEvents Log:\n`;
// Add event details to the report
document.querySelectorAll("#eventDetailsTable tr").forEach(row => {
const cells = row.querySelectorAll("td");
const time = cells[0].textContent;
const player = cells[1].textContent;
const event = cells[2].textContent;
matchSummary += `${time} - ${player}: ${event}\n`;
});
// Create a downloadable text file
const blob = new Blob([matchSummary], { type: 'text/plain' });
const link = document.createElement("a");
link.href = URL.createObjectURL(blob);
link.download = `match_summary_${new Date().toISOString()}.txt`;
link.click();
});
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Live Soccer Scoring App</title>
<style>
body { font-family: Inter, system-ui, -apple-system, sans-serif; margin: 0; background: #0f172a; color: #e6eef8; }
.app { display: grid; grid-template-columns: 1fr 360px; gap: 12px; height: 100vh; padding: 12px; position: relative; }
.panel { background: linear-gradient(180deg, #0b1220, #071022); border-radius: 12px; padding: 12px; box-shadow: 0 6px 18px rgba(2,6,23,.6); }
.controls { display: flex; gap: 8px; flex-wrap: wrap; }
button { background: #2563eb; border: none; padding: 8px 10px; border-radius: 8px; color: white; cursor: pointer; }
button.secondary { background: #1f2937; }
.score { font-size: 18px; margin-bottom: 8px; }
.badge { background: #0b1220; padding: 6px 8px; border-radius: 999px; display: inline-block; }
.keypad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 20px; }
.keypad button { background-color: #2563eb; padding: 10px; color: white; font-size: 18px; cursor: pointer; border-radius: 8px; }
.keypad button:hover { background-color: #1e40af; }
.keypad button.clear { background-color: #dc2626; }
.keypad button.submit { background-color: #22c55e; }
.score-display { margin-bottom: 20px; }
table { width: 100%; border-collapse: collapse; }
table th, table td { padding: 10px; text-align: center; border: 1px solid #e6eef8; }
iframe { width: 100%; height: 400px; border: none; }
/* Sponsor logos styling */
.sponsors {
position: absolute;
top: 0;
width: 100%;
display: flex;
justify-content: center;
padding: 10px;
gap: 20px;
z-index: 999;
}
.sponsor-logo img {
height: 50px;
}
</style>
</head>
<body>
<!-- Sponsor Logos -->
<div class="sponsors">
<div class="sponsor-logo"><img src="logo1.png" alt="Sponsor 1"></div>
<div class="sponsor-logo"><img src="logo2.png" alt="Sponsor 2"></div>
<div class="sponsor-logo"><img src="logo3.png" alt="Sponsor 3"></div>
</div>
<section id="scoreboard">
<h2>Match Details</h2>
<form id="matchDetailsForm">
<label for="competition">Competition:</label>
<input type="text" id="competition" name="competition" required>
<label for="matchType">Match Type:</label>
<select id="matchType" name="matchType">
<option value="home">Home</option>
<option value="away">Away</option>
</select>
<label for="date">Date:</label>
<input type="date" id="date" name="date" required>
<label for="venue">Venue:</label>
<input type="text" id="venue" name="venue" required>
<button type="submit">Save Match Details</button>
</form>
</section>
<section id="ballByBall">
<h2>Live Soccer Scoring</h2>
<div class="score-display">
<p id="score">Score: 0 - 0 | Current Player: N/A | Time: 0:00</p>
</div>
<!-- Scoring Pad Section -->
<div class="keypad">
<button class="run" data-value="1">Goal</button>
<button class="run" data-value="2">Foul</button>
<button class="run" data-value="3">Yellow Card</button>
<button class="run" data-value="4">Red Card</button>
<button class="submit" data-value="submit">Submit</button>
<button class="clear" data-value="clear">Clear</button>
</div>
<!-- Event Log Table -->
<h3>Match Events</h3>
<table id="eventDetailsTable">
<thead>
<tr>
<th>Time</th>
<th>Player</th>
<th>Event</th>
</tr>
</thead>
<tbody id="eventDetailsRows">
<!-- Match events will be inserted here dynamically -->
</tbody>
</table>
</section>
<section id="liveStream">
<h2>Live Stream</h2>
<!-- Embed the live stream from YouTube -->
<iframe id="youtubeStream" src="https://www.youtube.com/embed/VIDEO_ID?autoplay=1" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</section>
<section id="summary">
<h2>Match Summary</h2>
<div id="matchSummary">
<!-- Match summary will be displayed here -->
</div>
<button id="downloadReport">Download Match Summary</button>
</section>
<footer>
<p>© 2026 Soccer Scoring System. All rights reserved.</p>
</footer>
<script>
// Accessing the tablet's camera (if necessary for input)
if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
navigator.mediaDevices.getUserMedia({ video: true })
.then(function(stream) {
// Display the camera feed if needed (for example, to capture match events)
const video = document.createElement('video');
video.srcObject = stream;
video.autoplay = true;
document.body.appendChild(video);
})
.catch(function(error) {
console.log("Camera not accessible: ", error);
});
}
// YouTube Live stream embed (replace with actual stream)
const videoId = "VIDEO_ID"; // Replace with actual video ID
const youtubeEmbedUrl = `https://www.youtube.com/embed/${videoId}?autoplay=1`;
document.getElementById('youtubeStream').src = youtubeEmbedUrl;
// Scoring System Logic
let scoreHome = 0;
let scoreAway = 0;
let matchTime = 0;
const scoreDisplay = document.getElementById('score');
const eventDetailsTable = document.getElementById('eventDetailsRows');
// Handle event scoring
document.querySelectorAll(".keypad button").forEach(button => {
button.addEventListener("click", () => {
const value = button.dataset.value;
let eventDetail = '';
if (value === "1") { // Goal
scoreHome++;
eventDetail = `Goal for Home Team`;
} else if (value === "2") { // Foul
eventDetail = `Foul by Player`;
} else if (value === "3") { // Yellow Card
eventDetail = `Yellow Card for Player`;
} else if (value === "4") { // Red Card
eventDetail = `Red Card for Player`;
}
matchTime += 1; // Increment time by 1 minute
updateScoreboard(eventDetail);
});
});
// Update the scoreboard and log events
function updateScoreboard(eventDetail) {
// Update match time and score display
let minutes = Math.floor(matchTime / 60);
let seconds = matchTime % 60;
let timeDisplay = `${minutes}:${seconds < 10 ? '0' + seconds : seconds}`;
scoreDisplay.textContent = `Score: ${scoreHome} - ${scoreAway} | Time: ${timeDisplay}`;
// Log the event in the table
const row = document.createElement("tr");
row.innerHTML = `
<td>${timeDisplay}</td>
<td>Player</td>
<td>${eventDetail}</td>
`;
eventDetailsTable.appendChild(row);
}
// Handle match event submissions
document.querySelector(".submit").addEventListener("click", () => {
// Capture the event and update the scoreboard
let eventDetail = '';
if (scoreHome > scoreAway) {
eventDetail = `Home Team wins with a score of ${scoreHome} - ${scoreAway}`;
} else if (scoreAway > scoreHome) {
eventDetail = `Away Team wins with a score of ${scoreAway} - ${scoreHome}`;
} else {
eventDetail = `The match is a draw at ${scoreHome} - ${scoreAway}`;
}
updateScoreboard(eventDetail);
});
// Reset scoring inputs
document.querySelector(".clear").addEventListener("click", () => {
scoreHome = 0;
scoreAway = 0;
matchTime = 0;
scoreDisplay.textContent = `Score: ${scoreHome} - ${scoreAway} | Time: 0:00`;
eventDetailsTable.innerHTML = ''; // Clear event log
});
// Function to download match summary as a report
document.getElementById("downloadReport").addEventListener("click", () => {
let matchSummary = `Match Summary\n\nHome Team: ${scoreHome}\nAway Team: ${scoreAway}\nFinal Time: ${Math.floor(matchTime / 60)}:${matchTime % 60 < 10 ? '0' + (matchTime % 60) : matchTime % 60}\n\nEvents Log:\n`;
// Add event details to the report
document.querySelectorAll("#eventDetailsTable tr").forEach(row => {
const cells = row.querySelectorAll("td");
const time = cells[0].textContent;
const player = cells[1].textContent;
const event = cells[2].textContent;
matchSummary += `${time} - ${player}: ${event}\n`;
});
// Create a downloadable text file
const blob = new Blob([matchSummary], { type: 'text/plain' });
const link = document.createElement("a");
link.href = URL.createObjectURL(blob);
link.download = `match_summary_${new Date().toISOString()}.txt`;
link.click();
});
</script>
</body>
</html>