-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmini-render.html
68 lines (64 loc) · 1.8 KB
/
mini-render.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Mini-Killer Streak</title>
<style>
body {
font-family: Verdana, serif;
color: #fff;
font-size: 22px;
}
.bg {
margin: 8px;
width: 290px;
height: 51px;
background-color: rgba(20, 20, 20, 0.6);
border-radius: 20px 0 0 20px;
position: relative;
}
.bg > span {
position: absolute;
}
.top {
left: 9px
}
.bottom {
bottom: 0;
right: 34px;
}
.killer {
position: absolute;
right: -18px;
height: 56px;
top: -3px;
}
</style>
</head>
<body>
<div class="bg">
<span class="top"><span id="killer">__KILLER__</span> Streak</span>
<span class="bottom">Wins in a row: <span id="number">0</span></span>
<img class="killer" id="killer-image" src="/img/__KILLER__.png" alt="">
</div>
</body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.1.2/socket.io.min.js" integrity="sha512-2ho+gY0H62N4Z9oxD422L2ZYXiOMq9l+Aub1QNz4Z4UDOtDVxz4vk6O6R3Hqqc9Y7qSvZFl7cy3+eZ/ITnUrLA==" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.26.0/axios.min.js" integrity="sha512-bPh3uwgU5qEMipS/VOmRqynnMXGGSRv+72H/N260MQeXZIK4PG48401Bsby9Nq5P5fz7hy5UGNmC/W1Z51h2GQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script> // https://jsfiddle.net/bc_rikko/qwbfkv6y/2/
(async () => {
const killer = document.getElementById("killer");
const number = document.getElementById("number");
const killerImage = document.getElementById("killer-image");
const result = await axios.get("/data");
number.innerText = result.data.__KILLER__.c;
const socket = io();
socket.on('data', function (data) {
if (data === "refresh") {
location.reload();
} else if(data.__KILLER__){
number.innerText = data.__KILLER__.c;
}
});
})()
</script>
</html>