create PWA
This commit is contained in:
parent
027e223e7e
commit
21aefb1710
21
index.html
21
index.html
@ -2,13 +2,30 @@
|
||||
<html lang="en">
|
||||
<meta charset="UTF-8">
|
||||
<title>RPG Dices</title>
|
||||
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
|
||||
<meta name="theme-color" content="#ffffff" />
|
||||
<meta name="apple-mobile-web-app-status-bar" content="#ffffff" />
|
||||
|
||||
<link rel="apple-touch-icon" href="assets/icons/icon-72x72.png" />
|
||||
<link rel="apple-touch-icon" href="assets/icons/icon-96x96.png" />
|
||||
<link rel="apple-touch-icon" href="assets/icons/icon-128x128.png" />
|
||||
<link rel="apple-touch-icon" href="assets/icons/icon-144x144.png" />
|
||||
<link rel="apple-touch-icon" href="assets/icons/icon-152x152.png" />
|
||||
<link rel="apple-touch-icon" href="assets/icons/icon-192x192.png" />
|
||||
<link rel="apple-touch-icon" href="assets/icons/icon-384x384.png" />
|
||||
<link rel="apple-touch-icon" href="assets/icons/icon-512x512.png" />
|
||||
|
||||
<link rel="manifest" href="manifest.json" />
|
||||
|
||||
<link rel="stylesheet" href="style.css">
|
||||
|
||||
<script src="js/libs/moment.js"></script>
|
||||
|
||||
<script src="js/libs/sidebar/sidebar.js"></script>
|
||||
<link href="js/libs/sidebar/sidebar.css" type="text/css" rel="stylesheet" />
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
<body>
|
||||
<label id="sidebar-toggle" class="sidebar-toggle" for="sidebar-toggle-input"><img src="./assets/menu.svg"></label>
|
||||
|
10
script.js
10
script.js
@ -472,3 +472,13 @@ if (darkMode) {
|
||||
document.getElementById("dark-mode-icon").src = "./assets/light.svg";
|
||||
document.getElementById("dark-mode-text").innerText = "Light Mode";
|
||||
}
|
||||
|
||||
if ("serviceWorker" in navigator) {
|
||||
window.addEventListener("load", function() {
|
||||
navigator.serviceWorker
|
||||
.register("/sw.js")
|
||||
.then(res => console.trace("service worker registered"))
|
||||
.catch(err => console.error("service worker not registered", err))
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user