create PWA
This commit is contained in:
parent
027e223e7e
commit
21aefb1710
23
index.html
23
index.html
@ -2,13 +2,30 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<title>RPG Dices</title>
|
<title>RPG Dices</title>
|
||||||
|
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
<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">
|
<link rel="stylesheet" href="style.css">
|
||||||
|
|
||||||
<script src="js/libs/moment.js"></script>
|
<script src="js/libs/moment.js"></script>
|
||||||
|
|
||||||
<script src="js/libs/sidebar/sidebar.js"></script>
|
<script src="js/libs/sidebar/sidebar.js"></script>
|
||||||
<link href="js/libs/sidebar/sidebar.css" type="text/css" rel="stylesheet" />
|
<link href="js/libs/sidebar/sidebar.css" type="text/css" rel="stylesheet" />
|
||||||
<style>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<label id="sidebar-toggle" class="sidebar-toggle" for="sidebar-toggle-input"><img src="./assets/menu.svg"></label>
|
<label id="sidebar-toggle" class="sidebar-toggle" for="sidebar-toggle-input"><img src="./assets/menu.svg"></label>
|
||||||
@ -77,7 +94,7 @@
|
|||||||
<button id="history-button" onclick="clearHistory()"><img src="./assets/history.svg"> Clear
|
<button id="history-button" onclick="clearHistory()"><img src="./assets/history.svg"> Clear
|
||||||
History</button>
|
History</button>
|
||||||
<button id="roll-add-button" onclick="addSelected()"><img src="./assets/add.svg"> Add Selected</button>
|
<button id="roll-add-button" onclick="addSelected()"><img src="./assets/add.svg"> Add Selected</button>
|
||||||
<button id="roll-button" onclick="rollSelected()"><img src="./assets/roll.svg"> Roll Selected</button>
|
<button id="roll-button" onclick="rollSelected()"><img src="./assets/roll.svg"> Roll Selected</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="history" id="history"></div>
|
<div class="history" id="history"></div>
|
||||||
|
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-icon").src = "./assets/light.svg";
|
||||||
document.getElementById("dark-mode-text").innerText = "Light Mode";
|
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