-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
32 lines (29 loc) · 911 Bytes
/
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
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PWA Блокнот</title>
<link rel="stylesheet" href="style.css">
<link rel="manifest" href="manifest.json">
</head>
<body>
<h1>PWA Блокнот</h1>
<div id="new-note">
<input type="text" id="note-input" placeholder="Введите новую заметку">
<button id="add-note">Добавить</button>
</div>
<ul id="notes"></ul>
<script src="script.js"></script>
<script>
if ("serviceWorker" in navigator) {
self.addEventListener("load", async () => {
const container = navigator.serviceWorker;
if (container.controller === null) {
const reg = await container.register("service-worker.js");
}
});
}
</script>
</body>
</html>