-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
88 lines (73 loc) · 2.07 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script
async
src="https://www.googletagmanager.com/gtag/js?id=UA-178277593-1"
></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag("js", new Date());
gtag("config", "UA-178277593-1");
</script>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Is almodo time yet?</title>
<style>
.text {
text-align: center;
font-size: 4rem;
padding-top: 40vh;
}
</style>
</head>
<body>
<div id="text" class="text"></div>
<script>
const now = new Date();
const text = document.getElementById("text");
function rollDice(min = 1, max = 6) {
return min + Math.floor(Math.random() * (max - min + 1));
}
function getText() {
const dice = rollDice();
const day = now.getDay();
const hour = now.getHours();
const minutes = now.getMinutes();
if (day <= 5 && hour === 9 && minutes >= 55) {
return "Daily-Time! Open Zoom up!";
}
if (day === 2) {
return "Nope. But is it planning day???";
}
if (day === 4) {
return "Nope. But tomorrow is Friday!";
}
if (day === 5) {
if (hour < 8) {
return "Hang in there mate, it's going to be beer-time soon!";
}
if (hour < 11) {
return "Not yet! But maybe a coffee?";
}
if (hour < 12) {
return "Nope. Now it's more lunch-time";
}
if (hour < 13) {
return "Not yet! Lunch time!";
}
if (hour < 16) {
return "Hang in there mate, it's going to be beer-time soon!";
}
return "Yeees! Almodotime!";
}
return "Nope. Next Friday!";
}
text.innerHTML = getText();
</script>
</body>
</html>