about summary refs log tree commit diff stats
path: root/js/pixel-art
diff options
context:
space:
mode:
authorelioat <elioat@tilde.institute>2024-12-22 11:17:00 -0500
committerelioat <elioat@tilde.institute>2024-12-22 11:17:00 -0500
commit40db3228a23e64804cd1e901beee2f0917dbcae8 (patch)
tree21505e42726cf319c7faf97842755f6013996a8c /js/pixel-art
parent6fc5e5177d75606e7be08fe6b9767f54bbe3e72a (diff)
downloadtour-40db3228a23e64804cd1e901beee2f0917dbcae8.tar.gz
*
Diffstat (limited to 'js/pixel-art')
-rw-r--r--js/pixel-art/pixel/app.js26
1 files changed, 15 insertions, 11 deletions
diff --git a/js/pixel-art/pixel/app.js b/js/pixel-art/pixel/app.js
index 5da21b0..9dc9cd8 100644
--- a/js/pixel-art/pixel/app.js
+++ b/js/pixel-art/pixel/app.js
@@ -100,17 +100,21 @@ function handleColorChange() {
 }
 
 function handleReset() {
-    gridWidth = defaultGridWidth;
-    gridHeight = defaultGridHeight;
-    initializeGrid();
-    centerGrid();
-    drawGrid();
-    localStorage.removeItem('pixelArtConfig');
-    colorHistory = [];
-    renderColorHistory();
-    document.getElementById('gridWidth').value = gridWidth;
-    document.getElementById('gridHeight').value = gridHeight;
-    alert("Grid reset, color history cleared, and local storage cleared.");
+    const confirmReset = confirm("Are you sure you want to reset? This will clear your drawing and settings.");
+    
+    if (confirmReset) {
+        gridWidth = defaultGridWidth;
+        gridHeight = defaultGridHeight;
+        initializeGrid();
+        centerGrid();
+        drawGrid();
+        localStorage.removeItem('pixelArtConfig');
+        colorHistory = [];
+        renderColorHistory();
+        document.getElementById('gridWidth').value = gridWidth;
+        document.getElementById('gridHeight').value = gridHeight;
+        alert("Grid reset, color history cleared, and local storage cleared.");
+    }
 }
 
 function handlePan(e) {