diff options
author | Marvin Borner | 2024-03-20 01:09:14 +0100 |
---|---|---|
committer | Marvin Borner | 2024-03-20 01:09:14 +0100 |
commit | 006f4d4c46f69c91a27aa8434ada2dd48fef2408 (patch) | |
tree | 56a6bcb454f9e7ab4af72688cc87a69044650c13 | |
parent | a749494211511c6a8681bffd59549bf1294477f6 (diff) |
Add restart button
-rw-r--r-- | index.html | 3 | ||||
-rw-r--r-- | script.js | 11 |
2 files changed, 14 insertions, 0 deletions
@@ -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> @@ -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(); +}); |