-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
47 lines (42 loc) · 1.61 KB
/
index.html
File metadata and controls
47 lines (42 loc) · 1.61 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
36
37
38
39
40
41
42
43
44
45
46
47
<!DOCTYPE html>
<html>
<head>
<title>My New PWA</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;900&display=swap" rel="stylesheet" />
<link rel="apple-touch-icon" sizes="180x180" href="assets/images/icon.png" />
<link rel="icon" type="image/png" href="assets/images/icon.png" sizes="32x32" />
<link rel="icon" type="image/png" href="assets/images/icon.png" sizes="16x16" />
<link rel="manifest" href="manifest.json" />
<link rel="stylesheet" type="text/css" href="src/app.css" />
</head>
<body>
<div class="container">
<h1>You are Online!</h1>
<p>It's time to create an amazing Progressive Web App!</p>
<br>
<h3>Share data</h3>
<input type= "text" id="textShare"/>
<input type= "text" id="titleShare"/>
<input type= "text" id="urlShare"/>
<button id="sharebtn">Share </button>
</div>
</body>
<script src="src/app.js"></script>
<script type="text/javascript">
const registerSW = async () => {
if ("serviceWorker" in navigator) {
try {
await navigator.serviceWorker.register(`${window.location.href}service-worker.js`);
console.log("Service Worker Registered");
} catch (e) {
console.error("Error registering Service Worker...", e);
}
}
};
registerSW();
</script>
</html>