/
index.html
70 lines (48 loc) · 1.83 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Progressive Web App: PhotoBooth</title>
<link rel="stylesheet" href="assets/css/styles.css">
<!-- Meta tag for changing browser colors. -->
<meta id="theme-color" name="theme-color" content="#37474F">
<!-- Meta tag for App-like behaviour in iOS -->
<meta name=”apple-mobile-web-app-capable” content=”yes”>
<!-- Web Manifest -->
<link rel="manifest" href="manifest.json">
</head>
<body>
<h3>Progressive Web App: PhotoBooth</h3>
<div class="container">
<div class="app">
<a href="#" id="start-camera" class="visible">Touch here to start the app.</a>
<video muted id="camera-stream"></video>
<img id="snap">
<p id="error-message"></p>
<div class="controls">
<a href="#" id="delete-photo" title="Delete Photo" class="disabled"><i class="material-icons">delete</i></a>
<a href="#" id="take-photo" title="Take Photo"><i class="material-icons">camera_alt</i></a>
<a href="#" id="download-photo" download="selfie.png" title="Save Photo" class="disabled"><i class="material-icons">file_download</i></a>
</div>
<!-- Hidden canvas element. Used for taking snapshot of video. -->
<canvas></canvas>
</div>
</div>
<script>
// Register Service Worker.
if ('serviceWorker' in navigator) {
// Path is relative to the origin, not project root.
navigator.serviceWorker.register('/pwa-photobooth/sw.js')
.then(function(reg) {
console.log('Registration succeeded. Scope is ' + reg.scope);
})
.catch(function(error) {
console.error('Registration failed with ' + error);
});
}
</script>
<script src="assets/js/script.js"></script>
</body>
</html>