-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
42 lines (38 loc) · 1.33 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
<!DOCTYPE html>
<html>
<head>
<title>ReCode PWA Boilerplate</title>
<!-- Various metadata for our app -->
<meta name="description" content="Boilerplate code for a PWA with p5.js."/>
<link rel="icon" type="image/x-icon" href="./images/favicon.ico">
<link rel="apple-touch-icon" sizes="180x180" href="./images/apple-touch-icon.png">
<link rel="stylesheet" href="./style.css">
<link rel="manifest" href="./manifest.json">
<base href="./">
<script type="text/javascript" src="./p5.min.js"></script>
<script type="text/javascript" src="./sketch.js"></script>
</head>
<body>
<script>
// register service worker
if ('serviceWorker' in navigator) {
navigator.serviceWorker
.register('./sw.js')
.then(function (reg) {
if (reg.installing) {
console.log('Service worker installing');
} else if (reg.waiting) {
console.log('Service worker installed');
} else if (reg.active) {
console.log('Service worker active');
}
})
.catch(function (error) {
// registration failed
console.log('Registration failed with ' + error);
});
}
</script>
<div id="sketch-holder"></div>
</body>
</html>