diff options
author | elioat <elioat@tilde.institute> | 2024-12-22 11:17:00 -0500 |
---|---|---|
committer | elioat <elioat@tilde.institute> | 2024-12-22 11:17:00 -0500 |
commit | 40db3228a23e64804cd1e901beee2f0917dbcae8 (patch) | |
tree | 21505e42726cf319c7faf97842755f6013996a8c | |
parent | 6fc5e5177d75606e7be08fe6b9767f54bbe3e72a (diff) | |
download | tour-40db3228a23e64804cd1e901beee2f0917dbcae8.tar.gz |
*
-rw-r--r-- | js/pixel-art/pixel/app.js | 26 |
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) { |