From 006f4d4c46f69c91a27aa8434ada2dd48fef2408 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 20 Mar 2024 01:09:14 +0100 Subject: Add restart button --- index.html | 3 +++ script.js | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/index.html b/index.html index f974e6e..b29263e 100644 --- a/index.html +++ b/index.html @@ -18,6 +18,9 @@ + + + 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(); +}); -- cgit v1.2.3