-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
35 lines (33 loc) · 1.52 KB
/
Copy pathindex.html
File metadata and controls
35 lines (33 loc) · 1.52 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
<html>
<head>
<title>It's Always Sunny in Philadelphia Title Card</title>
<meta charset="UTF-8">
<link href="https://fonts.googleapis.com/css?family=Courier+Prime&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<link href="styles.css" rel="stylesheet">
<script type="text/javascript" src="https://momentjs.com/downloads/moment.js"></script>
<script type="text/javascript" src="https://momentjs.com/downloads/moment-timezone-with-data-10-year-range.js"></script>
</head>
<body>
<div class="container">
<div class="row h-100">
<div class="col-12 my-auto text-center">
<p id="time"></p>
<p id="day"></p>
<p>Philadelphia, PA</p>
</div>
</div>
</div>
</body>
<script>
function updateTime() {
const now = moment().tz('America/New_York');
const isEven = now.seconds() % 2 === 0;
const formatStr = isEven ? 'h:mm A' : 'h mm A';
document.getElementById("time").innerHTML = now.format(formatStr);
document.getElementById("day").innerHTML = moment().tz('America/New_York').format('[On a ] dddd');
}
updateTime();
setInterval(updateTime, 1000);
</script>
</html>