-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
36 lines (31 loc) · 2.77 KB
/
script.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
times = ["2797 millennia", "43 femtoseconds (or smaller)", "about seven", "96 fortnights", "Late Eocene", "91 weeks 46 days 95 hours (approximately)", "5321 millennia", "1946 geological eras", "66 femtoseconds (or smaller)", "last Thursday (except on weekends)", "next Tuesday (unless otherwise redetermined)", "12:00 am February 30, 15,354 BC", "Early December, Furongian Epoch", "39 cubic steradians", "after the heat-death of the universe", "89 inverse acers (unless otherwise redetermined)", "soon", "91 weeks", "2871 geological eras", "49 weeks", "Early Precambrian", "64 months 10 months 45 months (exactly)", "4781 millennia", "late evening, early Ordovician", "100 inverse acres (unless otherwise redetermined)", "Cave Johnson's birthday", "more like six days", "when the cows come home", "68 fortnights", "36 days before next Saturday", "precisely", "when we feel like it", "when it's done"];
activities = ["Twiddling thumbs...", "Calculating infinity...", "Determining the meaning of life...", "Questioning reality...", "Asserting dominance...", "Doing something...", "Approximating approximations...", "Paying bills...", "Baking a cake (this one's real)...", "Testing the ASHPD...", "Waiting for better days...", "Asking annoying questions...", "Progressing progressions...", "Calculating progress...", "Running JavaScript...", "Finding more things to do...", "Scripting scripts...", "Activating activities...", "Scanning for viruses...", "Contacting emergency services...", "Emptying the Recycle Bin...", "Writing code...", "Debugging...", "Restarting...", "Recursively resursing recursions...", "Shuffling cards..."];
bar = null;
activity = null;
time = null;
function changeTime() {
time.innerHTML = times[(Math.floor(Math.random()*times.length))].toUpperCase();
setTimeout(changeTime, (Math.floor(Math.random()*10)+1)*500);
}
function changeProgress() {
if (bar.style.width == "100%") {
bar.style.width = "0%";
var div = document.createElement("div");
div.innerHTML = activities[(Math.floor(Math.random()*activities.length))].toUpperCase();
activity.insertBefore(div, document.getElementById('messages-bottom'));
}
bar.style.width = (Number(bar.style.width.slice(0, -1)) + 5) + "%";
setTimeout(changeProgress, (Math.floor(Math.random()*10)+1)*1000);
}
function init() {
bar = document.getElementById('bar-inner');
activity = document.getElementById('messages-inner');
time = document.getElementById('time-inner');
bar.style.width = "0%";
setTimeout(changeTime, (Math.floor(Math.random()*10)+1)*500);
setTimeout(changeProgress, (Math.floor(Math.random()*10)+1)*1000);
setInterval(function () {
document.getElementById('messages-bottom').scrollIntoView({ behavior: 'smooth', block: 'end' });
});
}
window.onload = init;