-
Notifications
You must be signed in to change notification settings - Fork 1
/
browser2.html
46 lines (41 loc) · 1.19 KB
/
browser2.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Scoreboard</title>
<link rel="stylesheet" type="text/css" href="css/browser2.css" />
<link
href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500;600;700;800&display=swap"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css2?family=Bayon&display=swap"
rel="stylesheet"
/>
</head>
<body>
<div class="scoreboard">
<div class="team1 score">
<label id="team1">14</label>
</div>
<div class="team2 score">
<label id="team2">13</label>
</div>
</div>
<script>
const bc = new BroadcastChannel("scoreboard");
var data;
bc.onmessage = (message) => {
data = message.data;
if (data == "refresh") {
location.reload();
}
};
var team1score = localStorage.getItem("team1");
var team2score = localStorage.getItem("team2");
document.getElementById("team1").innerHTML = team1score;
document.getElementById("team2").innerHTML = team2score;
</script>
</body>
</html>