/
index.html
50 lines (49 loc) 路 1.52 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
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="manifest" href="/maxsbirthday/manifest.webmanifest">
<link rel="icon" href="/maxsbirthday/omgmog48.png" type="image/png">
<link rel="apple-touch-icon" href="/maxsbirthday/omgmog128.png">
<meta name="apple-mobile-web-app-title" content="Max's B'Day">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<title>Is it Max's Birthday?</title>
<style>
body {
text-align: center;
font-family: sans-serif;
}
.big {
font-size: 100px;
font-weight: bold;
margin: 30px 0;
}
.max {
width: 300px;
}
</style>
</head>
<body>
<h2>Is it Max's Birthday?</h2>
<p class="big" id="result">No.</p>
<img class="max" src="omgmog.jpg">
<p>A weird little demo progressive web app by <a href="https://twitter.com/danielthepope">@danielthepope</a>.</p>
<script>
var now = new Date();
if (now.getDate() === 23 && now.getMonth() === 10) {
document.getElementById('result').innerText = 'Yes.';
}
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/maxsbirthday/sw.js', {scope: '/maxsbirthday/'})
.then(function(reg) {
// registration worked
console.log('Registration succeeded. Scope is ' + reg.scope);
}).catch(function(error) {
// registration failed
console.log('Registration failed with ' + error);
});
}
</script>
</body>
</html>