-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
78 lines (68 loc) · 2.84 KB
/
index.html
File metadata and controls
78 lines (68 loc) · 2.84 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
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
<h1>Today is <span id="date"></span></h1>
<h2>It is <span id="day"></span><br /><br />
Let's call it (looks outside) <span id="time"></span> o'clock</h2>
<script>
const oneDay = 24 * 60 * 60 * 1000;
const firstDate = new Date(2020, 1, 29);
const now = new Date();
const secondDate = new Date(now.getFullYear(), now.getMonth(), now.getDate());
var weekday = new Array(7);
weekday[0] = "Bathday";
weekday[1] = "Pantsday";
weekday[2] = "Trashday";
weekday[3] = "Dishesday";
weekday[4] = "Beddingday";
weekday[5] = "Friday";
weekday[6] = "Apathyday";
var weekdayDesc = new Array(7);
weekdayDesc[0] = "Consider taking a Shower today.";
weekdayDesc[1] = "Time to change your sweat pants.";
weekdayDesc[2] = "Go around the house and pick up the last week's worth of filth.";
weekdayDesc[3] = "Either wash some dishes or pick up more paper plates.";
weekdayDesc[4] = "Smell Bedding to see if it needs changing.";
weekdayDesc[5] = "Hey, let's pretend the old ways still matter, and congrats, you made it to the end of the week.";
weekdayDesc[6]= "Fuck it, do nothing Day.";
const diffDays = Math.round(Math.abs((firstDate - secondDate) / oneDay));
document.getElementById("date").innerHTML = "March " + diffDays + ", 2020";
document.getElementById("day").innerHTML = weekday[secondDate.getDay()] + ". "+weekdayDesc[secondDate.getDay()];
hour = now.getHours();
if(hour >4 && hour < 9)
{
document.getElementById("time").innerHTML = "Early Morning";
}
else if(hour >8 && hour < 12)
{
document.getElementById("time").innerHTML = "Late Morning";
}
else if (hour==12)
{
document.getElementById("time").innerHTML = "Noon";
}
else if(hour >12 && hour < 16)
{
document.getElementById("time").innerHTML = "Early Afternoon";
}
else if(hour >15 && hour < 18)
{
document.getElementById("time").innerHTML = "Late Afternoon";
}
else if(hour >17 && hour < 20)
{
document.getElementById("time").innerHTML = "Early Evening";
}
else if(hour >19 && hour < 22)
{
document.getElementById("time").innerHTML = "Late Evening";
}
else
{
document.getElementById("time").innerHTML = "Night";
}
</script>
</body>
</html>