Repository navigation
Expand file tree
/
Copy pathportable.js
More file actions
89 lines (84 loc) · 5.21 KB
/
Copy pathportable.js
File metadata and controls
89 lines (84 loc) · 5.21 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
const system = {
"ignite": function () {
document.body.innerHTML = '<input id="dater" type="datetime" value="09-11-2011-18:56"><hr><div id="calculationDiv"></div>';
document.body.style.background = 'white';
document.body.style.fontFamily = 'Arial';
system.main();
},
"secondsSinceBirth": function(date) {
let sec = Math.floor((new Date() - new Date(date)) / 1000);
if (isNaN(sec) || sec < 0) return "Ungültiges Datum";
sec = Number(sec.toFixed(2));
const fixRate = 2;
let formatNumber = (num) => Math.floor(num).toLocaleString('de-DE');
let result = Object.freeze({
"1 Seconds": formatNumber(sec),
"2 Minutes": formatNumber((sec / 60).toFixed(fixRate)),
"3 Hours": formatNumber((sec / 3600).toFixed(fixRate)),
"4 Days": formatNumber((sec / 84600).toFixed(fixRate)),
"5 Weeks": formatNumber((sec / 604800).toFixed(fixRate)),
"6 Months": formatNumber((sec / 2629800).toFixed(fixRate)),
"7 Years": formatNumber((sec / 31557600).toFixed(fixRate)),
"8 Percent of Lightspeed if the seconds would be km/h": formatNumber(((sec / 1079252849) * 100).toFixed(fixRate)) + ' %',
"9 one Moment (90s)": formatNumber((sec / 90).toFixed(fixRate)),
"10 turns if 1s = 1°": formatNumber((sec / 360).toFixed(fixRate)),
"11 Age on Mars (687 Earthdays)": formatNumber(((sec / 86400) / 687).toFixed(fixRate)) + ' j',
"12 Money in € (1 Cent per second)": formatNumber((sec / 100).toFixed(2)) + '€',
"13 How often you could watch ALL Harry Potter movies": formatNumber((sec / 70740).toFixed(fixRate)),
"14 How long you had slepet if you had daily...": {
"14... slept for 9 houres": formatNumber((sec * (9 / 24) / 3600).toFixed(fixRate)) + ' h',
"14... slept for 8 houres": formatNumber((sec * (8 / 24) / 3600).toFixed(fixRate)) + ' h',
"14... slept for 7 houres": formatNumber((sec * (7 / 24) / 3600).toFixed(fixRate)) + ' h',
"14... slept for 6 houres": formatNumber((sec * (6 / 24) / 3600).toFixed(fixRate)) + ' h',
"14... slept for 5 houres": formatNumber((sec * (5 / 24) / 3600).toFixed(fixRate)) + ' h',
"14... slept for 4 houres": formatNumber((sec * (4 / 24) / 3600).toFixed(fixRate)) + ' h',
"14... slept for 3 houres": formatNumber((sec * (3 / 24) / 3600).toFixed(fixRate)) + ' h',
"14... slept for 2 houres": formatNumber((sec * (2 / 24) / 3600).toFixed(fixRate)) + ' h',
"14... slept for 1 houres": formatNumber((sec * (1 / 24) / 3600).toFixed(fixRate)) + ' h',
"14... slept for 0 houres": "How are you still alive?"
},
"15 unlocked your phone (~60/day)": formatNumber(((sec/86400)*60).toFixed(fixRate)),
"16 length of uncut fingernails": formatNumber(((sec/2629800)/3).toFixed(fixRate)) + 'mm',
"17 amount of heartbeats by 70bpm": formatNumber(sec*(70/60).toFixed(fixRate)) + 'bpl (beats per (current) live)',
"18 length of uncut hair": formatNumber(sec*0.0000003.toFixed(fixRate)) +'km',
"19 drank coffee": {
"19 1 cup/Tag": formatNumber(((sec/84600)*1).toFixed(fixRate)),
"19 2 cup/Tag": formatNumber(((sec/84600)*2).toFixed(fixRate)),
"19 3 cup/Tag": formatNumber(((sec/84600)*3).toFixed(fixRate)),
"19 4 cup/Tag": formatNumber(((sec/84600)*4).toFixed(fixRate)),
"19 5 cup/Tag": formatNumber(((sec/84600)*5).toFixed(fixRate)),
"19 6 cup/Tag": formatNumber(((sec/84600)*6).toFixed(fixRate)),
"19 7 cup/Tag": formatNumber(((sec/84600)*7).toFixed(fixRate)),
"19 8 cup/Tag": 'No Coffee for you anymore',
},
"20 ~ Amount of humans you have outlived": formatNumber((sec*2).toFixed(0)),
"21 ~ passed the chance to die": formatNumber((sec*0.00001).toFixed(0)),
"22 ~ Chance to die in the next Houre": '2%',
"23 Seconds since youre here": system['here'],
});
system['here']++;
return result;
},
// 07-22-1976-08:31
"inter": null,
"main": function (date) {
globalThis["inter"] = setInterval(() => {
if(this.contin === true) {
document.getElementById('calculationDiv').innerText = JSON.stringify(this.secondsSinceBirth(document.getElementById('dater').value))
.replaceAll(',','\n')
.replaceAll('{','\n')
.replaceAll('}','')
.replaceAll('"','')
.replaceAll(':',': ')
.replace(/^\d+\b/gm,' ')
.replace(/^.#/gm,'');
} else {
clearInterval(inter);
}
},1000);
},
"contin": true,
"here": 0,
}
system.ignite();
// Just Paste it in any Website Console and you can use it