-
Notifications
You must be signed in to change notification settings - Fork 0
/
in-real-time.html
405 lines (339 loc) · 11.9 KB
/
in-real-time.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
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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
<!DOCTYPE html>
<html>
<head>
<title>In Real Time</title>
<link rel="icon" type="image/x-icon" href="/images/in-real-time.ico">
<style>
@import url('https://fonts.googleapis.com/css2?family=Jua&display=swap');
body {
font-family: 'Jua', sans-serif;
text-align: center;
background-color: #f4f4f4;
margin: 0;
padding: 20px;
}
h1 {
color: #333;
}
h2 {
color: #dbdbdb;
}
h3 {
color: #636363;
margin-top: -25px;
}
.stat-container {
margin-bottom: 20px;
background-color: #fff;
padding: 10px;
border-radius: 10px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.stat-title {
font-size: 20px;
margin-bottom: 10px;
color: #444;
}
.section-title {
font-size: 20px;
margin: 10px;
color: #0062ff;
}
.progress-bar {
width: 100%;
background-color: #ddd;
border-radius: 5px;
overflow: hidden;
}
.progress {
height: 20px;
background-color: #4CAF50;
width: 0%;
}
.back-arrow {
display: inline-block;
margin-top: 20px;
padding: 10px 15px;
background-color: #ddd;
color: #333;
border-radius: 5px;
text-decoration: none;
font-size: 16px;
}
</style>
</head>
<body>
<h1>In Real Time</h1>
<h3>Scroll down to go home</h3>
<h2>Human</h2>
<div id="transplantStat" class="stat-container">
<div class="stat-title">Time Since Last Organ Transplant</div>
<div class="progress-bar">
<div class="progress"></div>
</div>
</div>
<div id="marriageStat" class="stat-container">
<div class="stat-title">Time Since Last Marriage</div>
<div class="progress-bar">
<div class="progress"></div>
</div>
</div>
<div id="retireStat" class="stat-container">
<div class="stat-title">Time Since Last Retirement</div>
<div class="progress-bar">
<div class="progress"></div>
</div>
</div>
<div id="migrateStat" class="stat-container">
<div class="stat-title">Time Since Last Migration Into a New County</div>
<div class="progress-bar">
<div class="progress"></div>
</div>
</div>
<div id="graduateStat" class="stat-container">
<div class="stat-title">Time Since Last University Graduate</div>
<div class="progress-bar">
<div class="progress"></div>
</div>
</div>
<div id="licenseStat" class="stat-container">
<div class="stat-title">Time Since Last Driver's License Acquired</div>
<div class="progress-bar">
<div class="progress"></div>
</div>
</div>
<div id="deathStat" class="stat-container">
<div class="stat-title">Time Since Last Death</div>
<div class="progress-bar">
<div class="progress"></div>
</div>
</div>
<div id="birthStat" class="stat-container">
<div class="stat-title">Time Since Last Birth</div>
<div class="progress-bar">
<div class="progress"></div>
</div>
</div>
<h2></h2>
<h2>Environment</h2>
<div id="ExtinctStat" class="stat-container">
<div class="stat-title">Time Since Last Species went Extinct (1/week)</div>
<div class="progress-bar">
<div class="progress"></div>
</div>
</div>
<div id="desertAcreStat" class="stat-container">
<div class="stat-title">Time Since Last Acre of Land was Desertified </div>
<div class="progress-bar">
<div class="progress"></div>
</div>
</div>
<div id="lightningStat" class="stat-container">
<div class="stat-title">Time Since Last Lightning Strike</div>
<div class="progress-bar">
<div class="progress"></div>
</div>
</div>
<div id="co2Stat" class="stat-container">
<div class="stat-title">Time Since Last 10 Tons of CO2 Were Released </div>
<div class="progress-bar">
<div class="progress"></div>
</div>
</div>
<div id="H2OStat" class="stat-container">
<div class="stat-title">Time Since Last 100,000 Gallons of Water Was Consumed </div>
<div class="progress-bar">
<div class="progress"></div>
</div>
</div>
<div id="treeChoppedStat" class="stat-container">
<div class="stat-title">Time Since Last Tree Chopped Down</div>
<div class="progress-bar">
<div class="progress"></div>
</div>
</div>
<div id="plasticOceanStat" class="stat-container">
<div class="stat-title">Time Since Piece of Plastic Entered the Ocean (93/s)</div>
<div class="progress-bar">
<div class="progress"></div>
</div>
</div>
<h2></h2>
<h2>Technology</h2>
<div id="websiteStat" class="stat-container">
<div class="stat-title">Time Since Last Website Created</div>
<div class="progress-bar">
<div class="progress"></div>
</div>
</div>
<div id="smartphoneStat" class="stat-container">
<div class="stat-title">Time Since Last Smartphone Sold</div>
<div class="progress-bar">
<div class="progress"></div>
</div>
</div>
<div id="tweetsStat" class="stat-container">
<div class="stat-title">Time Since Last 1000 Tweets</div>
<div class="progress-bar">
<div class="progress"></div>
</div>
</div>
<div id="instagramPostStat" class="stat-container">
<div class="stat-title">Time Since Last 100 Posts Uploaded to Instagram</div>
<div class="progress-bar">
<div class="progress"></div>
</div>
</div>
<div id="elonMuskStat" class="stat-container">
<div class="stat-title">Time Since Elon Musk Last Made $100</div>
<div class="progress-bar">
<div class="progress"></div>
</div>
</div>
<div id="youtubeStat" class="stat-container">
<div class="stat-title">Time Since Last Hour Worth of Video Uploaded to Youtube</div>
<div class="progress-bar">
<div class="progress"></div>
</div>
</div>
<h2></h2>
<h2>Economy and Finance</h2>
<div id="creditCardStat" class="stat-container">
<div class="stat-title">Time Since Last Credit Card Transaction</div>
<div class="progress-bar">
<div class="progress"></div>
</div>
</div>
<div id="bitcoinStat" class="stat-container">
<div class="stat-title">Time Since Last Bitcoin Transaction</div>
<div class="progress-bar">
<div class="progress"></div>
</div>
</div>
<div id="stockMarketStat" class="stat-container">
<div class="stat-title">Time Since Last 1000 Transactions on the Stock Market</div>
<div class="progress-bar">
<div class="progress"></div>
</div>
</div>
<div id="jobStat" class="stat-container">
<div class="stat-title">Time Since Last Job Application Online</div>
<div class="progress-bar">
<div class="progress"></div>
</div>
</div>
<div id="eCommerceStat" class="stat-container">
<div class="stat-title">Time Since Last $1,000,000 Worth of Products Sold Online</div>
<div class="progress-bar">
<div class="progress"></div>
</div>
</div>
<div id="startupStat" class="stat-container">
<div class="stat-title">Time Since Last Start-Up Founded</div>
<div class="progress-bar">
<div class="progress"></div>
</div>
</div>
<h2></h2>
<h2>Medicine</h2>
<div id="vaccinationStat" class="stat-container">
<div class="stat-title">Time Since Last Vaccination</div>
<div class="progress-bar">
<div class="progress"></div>
</div>
</div>
<div id="bloodDonationStat" class="stat-container">
<div class="stat-title">Time Since Last Blood Donation</div>
<div class="progress-bar">
<div class="progress"></div>
</div>
</div>
<div id="healthAppStat" class="stat-container">
<div class="stat-title">Time Since Last Surgery Performed</div>
<div class="progress-bar">
<div class="progress"></div>
</div>
</div>
<div id="surgeryStat" class="stat-container">
<div class="stat-title">Time Since Last Surgery Performed</div>
<div class="progress-bar">
<div class="progress"></div>
</div>
</div>
<div id="medPaperStat" class="stat-container">
<div class="stat-title">Time Since Last Medical Paper Published</div>
<div class="progress-bar">
<div class="progress"></div>
</div>
</div>
<div id="medicalPatentStat" class="stat-container">
<div class="stat-title">Time Since Last Medical Patent Filed</div>
<div class="progress-bar">
<div class="progress"></div>
</div>
</div>
<a href="home.html" class="back-arrow">← Back to Home</a>
<script>
function resetProgressBar(statId, timesPerSecond) {
const stat = document.querySelector(`#${statId} .progress`);
let width = 0;
const interval = 1000 / timesPerSecond; // Calculate the interval for each full cycle
const updateFrequency = 10; // Frequency of updates in milliseconds
const increment = (updateFrequency / interval) * 100; // Calculate the increment per update
return setInterval(() => {
if (width >= 100) {
width = 0; // Reset the bar when it hits 100%
}
width += increment;
stat.style.width = width + '%';
}, updateFrequency); // Update the bar at a higher frequency for smoothness
}
// Initialize progress bars
// HUMAN
resetProgressBar('birthStat', 4.26); // 4.26 times per second
resetProgressBar('deathStat', 1.83); // 1.83 times per second
resetProgressBar('licenseStat', 1200 / 60 / 60);
resetProgressBar('graduateStat', 1000 / 60 / 60);
resetProgressBar('migrateStat', 500 / 60 / 60);
resetProgressBar('retireStat', 200 / 60 / 60);
resetProgressBar('marriageStat', 110 / 60 / 60);
resetProgressBar('transplantStat', 10 / 60 / 60);
// ENVIRONMENT
resetProgressBar('treeChoppedStat', 21); // 21 times per second
resetProgressBar('co2Stat', 5.55555555556);
resetProgressBar('H2OStat', 41.6666666667);
resetProgressBar('desertAcreStat', 40 / 60 / 60);
resetProgressBar('extinctStat', 1 / 604800);
resetProgressBar('lightningStat', 100 / 60);
resetProgressBar('plasticOceanStat', 92.5925925926);
// Technology
resetProgressBar('tweetsStat', 6);
resetProgressBar('smartphoneStat', 21.6666666667 / 60);
resetProgressBar('websiteStat', 0.10555555555);
resetProgressBar('instagramPostStat', 6.94);
resetProgressBar('elonMuskStat', 8.13);
resetProgressBar('youtubeStat', 500 / 60);
// Economy
resetProgressBar('stockMarketStat', 1.38888888889);
resetProgressBar('bitcoinStat', 5);
resetProgressBar('eCommerceStat', 1 / 60);
resetProgressBar('creditCardStat', 5000 / 60);
resetProgressBar('startupStat', 0.00083333333);
resetProgressBar('jobStat', 25 / 60);
// Medicine
resetProgressBar('vaccinationStat', 100 / 60);
resetProgressBar('medPaperStat', 0.05 / 60);
resetProgressBar('surgeryStat', 3.16666666667 / 60);
resetProgressBar('healthAppStat', 16.6666666667 / 60);
resetProgressBar('bloodDonationStat', 1);
resetProgressBar('medicalPatentStat', 0.03333333333 / 60);
// Transport
resetProgressBar('flightStat', 45 / 60);
resetProgressBar('carStat', 2)
resetProgressBar('trainStat', 1000/60/60)
resetProgressBar('eCarStat', 2000/60/60)
resetProgressBar('bikeStat', 1000/60/60)
resetProgressBar('busStat', 1500/60/60)
</script>
</body>
</html>