-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathloading.html
More file actions
157 lines (142 loc) · 4.29 KB
/
loading.html
File metadata and controls
157 lines (142 loc) · 4.29 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="/assets/data/styles.css">
<style>
body {
text-align: center;
padding: 100px 20px;
max-width: 800px;
user-select: none;
}
#music-player {
position: fixed;
top: 10px;
left: 10px;
cursor: pointer;
width: 20px;
height: 20px;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
}
#loader {
position: absolute;
left: 50%;
top: 50%;
z-index: 1;
width: 120px;
height: 120px;
margin: -76px 0 0 -76px;
border: 16px solid #000;
border-radius: 50%;
border-top: 16px solid #fff;
border-bottom: 16px solid #fff;
-webkit-animation: spin 2s linear infinite;
animation: spin 2s linear infinite;
pointer-events: none;
}
@-webkit-keyframes spin {
0% { -webkit-transform: rotate(0deg); }
100% { -webkit-transform: rotate(360deg); }
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
.dots::after {
content: "";
animation: dots 2s steps(4, end) infinite;
}
@keyframes dots {
0% {content: "";}
25% {content: ".";}
50% {content: "..";}
75% {content: "...";}
100% {content: "";}
}
#reanimated {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 125px;
z-index: 0;
cursor: pointer;
}
#click-count, #timer, #online, #credit {
position: absolute;
bottom: 10px;
left: 10px;
font-size: 14px;
color: #555;
font-family: monospace;
}
#click-count { bottom: 30px; }
#online { bottom: 50px; }
#credit {
left: unset;
right: 10px;
}
</style>
<script src="/assets/data/mobile.js"></script>
<script src="/assets/data/music-player.js" defer></script>
<script src="/assets/data/firebase-init.js"></script>
</head>
<body>
<h1>Loading<span class="dots"></span></h1>
<p>sorry we're having a traffic jam going on here pls wait</p>
<div id="loader"></div>
<div id="online">0</div>
<div id="click-count">0</div>
<div id="timer">0</div>
<div id="credit">by Reanimated</div>
<img id="reanimated" src="/assets/images/T7R_spin.gif" title="[T7R_spin.gif]">
<audio id="background-music" src="/assets/audio/elevator.mp3" autoplay loop preload="auto"></audio>
<button id="music-player" data-song-title=""Local Forecast - Elevator" by Kevin MacLeod" title="Play Background Music"></button>
<script>
let time = 0;
const timer = document.getElementById("timer");
const timerInterval = setInterval(() => {
time++;
timer.textContent = `${time}s`;
}, 1000);
</script>
<script>
let clicks = 0;
const clicker = document.getElementById("reanimated");
const clickCount = document.getElementById("click-count");
let previousColor = null;
function clickR() {
clicks++;
clickCount.textContent = `${clicks} clicks`;
}
clicker.addEventListener("click", clickR);
</script>
<script>
document.addEventListener("firebase-ready", () => {
const onlineUsersRef = db.ref('online/loading');
const onlineDiv = document.getElementById('online');
// Tracks online users
const myConnectionRef = db.ref('.info/connected');
myConnectionRef.on('value', (snapshot) => {
if (snapshot.val() === true) {
// User connected
const userRef = onlineUsersRef.push();
userRef.set(true);
// Remove when disconnected
userRef.onDisconnect().remove();
}
});
// Display number of online users
onlineUsersRef.on('value', (snapshot) => {
const onlineCount = snapshot.numChildren();
onlineDiv.textContent = `${onlineCount} ${onlineCount === 1 ? 'person' : 'people'} in queue`;
});
});
</script>
</body>
</html>