-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJoel_A.html
41 lines (41 loc) · 1.23 KB
/
Joel_A.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
<html>
<head>
<title>Joel_A</title>
<style>
body.night {
font-size: 20em;
color: red;
}
</style>
</head>
<body class="main">
<iframe height="auto" width="100%" style="border:none;" src="navbar.html" class="navbar"></iframe>
<script>
var today = new Date();
var hourNow = today.getHours();
var greeting;
var name = prompt("Please enter your name! - this is for a JS demo.");
if (hourNow > 21) {
greeting = "Good night, ";
$("body.main").hide();
} else if (hourNow > 18) {
greeting = "Good Evening, ";
} else if (hourNow > 12) {
greeting = "Good Afternoon, ";
} else if (hourNow > 0) {
greeting = "Good Morning, ";
} else {
greeting = "Hello,";
}
if (name == "matthew") {
name = "Matthew. Please do not play the clarinet";
}
document.write("<h3>" + greeting + name + ".</h3>");
</script>
</body>
<body class="night">
<img src="2.png" width="50%" height="auto">
<hr />
</h1><u><i>Goodnight!</i></u></h1>
</body>
</html>