-
Notifications
You must be signed in to change notification settings - Fork 3
/
template.js
74 lines (63 loc) · 1.87 KB
/
template.js
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
async function plate(id) {
return `
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Live subscriber count for @${id}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto+Mono&display=swap"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css" />
<style>
* {
box-sizing: border-box;
}
body {
background: linear-gradient(to right, #1a14b8, #000000);
font-family: "Roboto Mono", sans-serif;
margin: 0;
color: #fff;
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
overflow: hidden;
}
.counter-container {
display: flex;
flex-direction: column;
justify-content: center;
margin: 30px 50px;
text-align: center;
}
.counter {
font-size: 60px;
margin-top: 10px;
}
@media (max-width: 630px) {
body {
flex-direction: column;
}
}
</style>
</head>
<body>
<div class="counter-container">
<i style="color: rgb(10, 202, 250)" class="fab fa-telegram fa-5x"></i>
<div class="counter" id="subs"></div>
<span>@${id}</span>
</div>
</body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/3.0.4/socket.io.js"></script>
<script>
const socket = io();
socket.on('${id}', function(on) {
document.getElementById('subs').innerHTML = on.subs
});
</script>
</html>
`
}
module.exports = {
plate
}