-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
134 lines (120 loc) · 4.16 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial scale=1.0">
<link rel="icon" type="image/x-icon" href="https://thedoggybrad.github.io/getdatetime/resources/favicon.png">
<title>What is my current date and time?</title>
<meta name="color-scheme" content="dark light" />
<meta name="theme-color" content="" />
<link rel="manifest" href="pwa/manifest.json">
<link rel="preload" href="resources/dark.css" as="style" />
<link rel="preload" href="resources/light.css" as="style" />
<link rel="preload" href="resources/dark-mode-toggle-playground.mjs" as="script" />
<link rel="preload" href="resources/dark-mode-toggle.mjs" as="script" />
<link rel="preload" href="slider.css" as="style" />
<script>
// If `prefers-color-scheme` is not supported, fall back to light mode.
// In this case, light.css will be downloaded with `highest` priority.
if (window.matchMedia('(prefers-color-scheme)').media === 'not all') {
document.documentElement.style.display = 'none';
document.head.insertAdjacentHTML(
'beforeend',
'<link rel="stylesheet" href="https://thedoggybrad.github.io/getdatetime/resources/light.css" onload="document.documentElement.style.display = ``">',
);
}
</script>
<link
rel="stylesheet"
href="https://thedoggybrad.github.io/getdatetime/resources/dark.css"
media="(prefers-color-scheme: dark)"
/>
<link
rel="stylesheet"
href="https://thedoggybrad.github.io/getdatetime/resources/light.css"
media="(prefers-color-scheme: light)"
/>
<link rel="stylesheet" href="https://thedoggybrad.github.io/getdatetime/resources/common.css" />
<link rel="stylesheet" href="https://thedoggybrad.github.io/getdatetime/resources/slider.css" />
<script type="module" src="https://thedoggybrad.github.io/getdatetime/resources/dark-mode-toggle-playground.mjs"></script>
<script type="module" src="https://thedoggybrad.github.io/getdatetime/resources/dark-mode-toggle.mjs"></script>
</head>
<body>
<dark-mode-toggle
id="dark-mode-toggle-5"
class="slider"
legend="Dark Mode"
appearance="toggle"
remember="Remember this"
></dark-mode-toggle>
<style>
.center {text-align: center}
</style>
<style>
.imgcenter {
display: block;
margin-left: auto;
margin-right: auto;
width: 64px;
height: 64px;
}
</style>
<img src="resources/favicon.png" alt="LOGO" class="imgcenter" width="64" height="64">
<div class="center">
<h1>What is my current date and time?</h1>
<h1><span id="time"></span></h1>
<script>
`use strict`;
function refreshTime() {
const timeDisplay = document.getElementById("time");
const dateString = new Date().toLocaleTimeString();
const formattedString = dateString.replace(", ", " - ");
timeDisplay.textContent = formattedString;
}
setInterval(refreshTime, 1000);
</script>
<h1><span id="date"></span></h1>
<script>
`use strict`;
function refreshTime() {
const timeDisplay = document.getElementById("date");
const dateString = new Date().toLocaleDateString();
const formattedString = dateString.replace(", ", " - ");
timeDisplay.textContent = formattedString;
}
setInterval(refreshTime, 1000);
</script>
<h2 id="day"></h2>
<script>
const weekday = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];
const d = new Date();
let day = weekday[d.getDay()];
document.getElementById("day").innerHTML = day;
setInterval(refreshTime, 1000);
</script>
<br>
<br>
<br>
<br>
<br>
<footer>
<p>©<a href="https://github.com/thedoggybrad/">TheDoggyBrad Software Lab</a>. Provided under <a href="https://github.com/thedoggybrad/getdatetime/blob/main/License/">UPDER-FOSDL License</a>. </p>
</footer>
</div>
<script src="pwa/service_worker_check.js"></script>
<script src="pwa/service_worker_main.js"></script>
<style>
* {
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: -moz-none;
-o-user-select: none;
user-select: none;
}
</style>
<script>
window.addEventListener("contextmenu", e => e.preventDefault());
</script>
</body>
</html>