summaryrefslogtreecommitdiffstats
path: root/assets/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'assets/index.js')
-rw-r--r--assets/index.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/assets/index.js b/assets/index.js
new file mode 100644
index 0000000..f2f8def
--- /dev/null
+++ b/assets/index.js
@@ -0,0 +1,12 @@
+document.getElementById("nav-toogle").addEventListener("click", async() => {
+ const navlinks = Array.from(document.getElementsByClassName("navlinks"));
+ for (const navlink of navlinks) {
+ navlink.classList.toggle("navopen");
+ }
+ return false;
+});
+window.addEventListener("load", async() => {
+ if ("serviceWorker" in navigator) {
+ navigator.serviceWorker.register("/sw.js", { type: "module" });
+ }
+}); \ No newline at end of file