forked from Lyliya/RocketStats
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathboost.html
More file actions
43 lines (43 loc) · 1.45 KB
/
boost.html
File metadata and controls
43 lines (43 loc) · 1.45 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>RocketStats</title>
</head>
<body>
<video autoplay muted loop src="boost.webm" id="vid1" position="absolute" z-index="1" hidden></video>
<video autoplay muted loop src="noboost.webm" id="vid2" position="absolute" z-index="2" hidden></video>
<script>
document.getElementById("vid1").currentTime = 0;
document.getElementById("vid2").currentTime = 0;
let save = "0";
window.setInterval(() => {
var rawFile = new XMLHttpRequest();
rawFile.open("GET", 'BoostState.txt', false);
rawFile.onreadystatechange = function () {
if(rawFile.readyState === 4) {
if(rawFile.status === 200 || rawFile.status == 0) {
var allText = rawFile.responseText;
if (allText == "1" && save != allText) {
// Boost
document.getElementById("vid1").hidden = false;
document.getElementById("vid2").hidden = true;
} else if (allText == "0" && save != allText) {
// No Boost
document.getElementById("vid1").hidden = true;
document.getElementById("vid2").hidden = false;
} else if (allText == "-1" && save != allText) {
document.getElementById("vid1").hidden = true;
document.getElementById("vid2").hidden = true;
}
save = allText;
}
}
}
rawFile.send(null);
}, 100)
</script>
</body>
</html>