-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
64 lines (55 loc) · 1.86 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>News Reader | Second PWA Training</title>
<meta name="description" content="My Second PWA" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#F6F7F8" />
<!-- CONNECT FAVICON -->
<link rel="shortcut icon" href="/images/maskable_icon_192.png" type="image/x-icon" />
<!-- CONNECT CSS -->
<link rel="stylesheet" href="css/materialize.min.css" />
<!-- CONNECT MANIFEST -->
<link rel="manifest" href="/manifest.json" />
</head>
<body>
<!-- START NAVIGATION -->
<nav class="blue lighten-1" role="navigation">
<div class="nav-wrapper container">
<a href="/index.html" class="brand-logo" id="logo-container">News Reader</a>
<a href="#" class="sidenav-trigger" data-target="nav-mobile">☰</a>
<ul class="topnav right hide-on-med-and-down"></ul>
<ul class="sidenav" id="nav-mobile"></ul>
</div>
</nav>
<!-- END NAVIGATION -->
<!-- CONTENT SECTION -->
<div class="container" id="body-content"></div>
<!-- CONNECT JAVASCRIPT -->
<script src="js/materialize.min.js"></script>
<script src="js/nav.js"></script>
<script src="js/api.js"></script>
</body>
<script>
// REGISTER SERVICE WORKER
if ('serviceWorker' in navigator) {
window.addEventListener('load', function () {
navigator.serviceWorker
.register('/service-worker.js')
.then(function () {
console.log('Pendaftaran Service Worker Berhasil.');
})
.catch(function () {
console.log('Pendaftaran Service Worker Gagal.');
});
});
} else {
console.log('Service Worker belum didukung browser ini.');
}
// REQUEST API UNTUK PERTAMA KALI
document.addEventListener('DOMContentLoaded', function () {
getArticles();
});
</script>
</html>