-
Notifications
You must be signed in to change notification settings - Fork 0
/
journal-greetings-red-colour.html
74 lines (64 loc) · 1.68 KB
/
journal-greetings-red-colour.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
<html>
<head>
<title>Date Widget Notion</title>
<style>
#lbl {
display: flex;
font-family: sans-serif;
font-size: 18pt;
color: #ff5757;
padding: 5px;
border: 1px solid #ffffff;
justify-content: left;
line-height: 1.5;
height:85%;
font-weight: bold;
flex-direction: row;
}
#container {
display: flex;
align-items: flex-start;
}
#date{
font-size:12pt;
font-weight: bold;
}
body{
background-color: #ffffff;
}
</style>
</head>
<body>
<div id="lbl"></div>
</body>
<script>
var weekday = new Array(7);
weekday[0] = "sunday";
weekday[1] = "monday";
weekday[2] = "tuesday";
weekday[3] = "wednesday";
weekday[4] = "thursday";
weekday[5] = "friday";
weekday[6] = "saturday";
const monthNames = ["january", "february", "march", "april", "may", "june",
"july", "august", "september", "october", "november", "december"
];
var today = new Date();
var hrs = today.getHours();
var dayOfWeek = weekday[today.getDay()];
var date = `${dayOfWeek}, ${monthNames[today.getMonth()]} ${today.getDate()}, ${today.getFullYear()}`;
var greet;
if (hrs < 12)
greet = 'good morning, sof. ';
else if (hrs >= 12 && hrs <= 17)
greet = 'good afternoon, sof. ';
else if (hrs >= 17 && hrs <= 24)
greet = 'good evening, sof. ';
document.getElementById('lbl').innerHTML = `
<div class="container">
<div id="date"> ${date}</div>
<div class="greeting">${greet}</div>
<div/>
`;
</script>
</html>