aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMarvin Borner2024-03-20 01:09:14 +0100
committerMarvin Borner2024-03-20 01:09:14 +0100
commit006f4d4c46f69c91a27aa8434ada2dd48fef2408 (patch)
tree56a6bcb454f9e7ab4af72688cc87a69044650c13
parenta749494211511c6a8681bffd59549bf1294477f6 (diff)
Add restart button
-rw-r--r--index.html3
-rw-r--r--script.js11
2 files changed, 14 insertions, 0 deletions
diff --git a/index.html b/index.html
index f974e6e..b29263e 100644
--- a/index.html
+++ b/index.html
@@ -18,6 +18,9 @@
<svg id="clean" class="feather">
<use href="feather-sprite.svg#trash" />
</svg>
+ <svg id="restart" class="feather">
+ <use href="feather-sprite.svg#refresh-ccw" />
+ </svg>
<svg id="help" class="feather">
<use href="feather-sprite.svg#help-circle" />
</svg>
diff --git a/script.js b/script.js
index e3ab6e7..4c1ec73 100644
--- a/script.js
+++ b/script.js
@@ -302,3 +302,14 @@ window.github.addEventListener("click", () => {
window.support.addEventListener("click", () => {
window.open("https://ko-fi.com/marvinborner", "_blank");
});
+
+window.restart.addEventListener("click", () => {
+ if (
+ !confirm(
+ "Are you sure you want to restart? You will lose your entire inventory.",
+ )
+ )
+ return;
+ localStorage.clear();
+ window.location.reload();
+});