about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorelioat <elioat@tilde.institute>2024-12-22 11:20:44 -0500
committerelioat <elioat@tilde.institute>2024-12-22 11:20:44 -0500
commit5f170cb9bc24c3c2456538d433ffe59e90124f48 (patch)
treec82beda4a32ffcadcb76131cf0b4b86f4b4f5c76
parent073d4a120186fc1e6d7e85dafe2d0f48841ea266 (diff)
downloadtour-5f170cb9bc24c3c2456538d433ffe59e90124f48.tar.gz
*
-rw-r--r--js/pixel-art/pixel/app.js8
-rw-r--r--js/pixel-art/pixel/index.html8
2 files changed, 15 insertions, 1 deletions
diff --git a/js/pixel-art/pixel/app.js b/js/pixel-art/pixel/app.js
index 1fab676..e99b542 100644
--- a/js/pixel-art/pixel/app.js
+++ b/js/pixel-art/pixel/app.js
@@ -40,6 +40,7 @@ document.getElementById('panUpBtn').addEventListener('click', () => handlePanBut
 document.getElementById('panDownBtn').addEventListener('click', () => handlePanButton('down'));
 document.getElementById('panLeftBtn').addEventListener('click', () => handlePanButton('left'));
 document.getElementById('panRightBtn').addEventListener('click', () => handlePanButton('right'));
+document.getElementById('centerViewBtn').addEventListener('click', resetView);
 
 // Initialization
 resizeCanvas();
@@ -316,4 +317,11 @@ function handlePanButton(direction) {
             break;
     }
     drawGrid();
+}
+
+function resetView() {
+    cellSize = 16; // Reset to default zoom
+    centerGrid();
+    drawGrid();
+    saveToLocalStorage();
 }
\ No newline at end of file
diff --git a/js/pixel-art/pixel/index.html b/js/pixel-art/pixel/index.html
index cc04595..68d754f 100644
--- a/js/pixel-art/pixel/index.html
+++ b/js/pixel-art/pixel/index.html
@@ -147,6 +147,10 @@
         .pan-middle button {
             flex: 1;
         }
+
+        #centerViewBtn {
+            margin-top: 10px;
+        }
     </style>
 </head>
 <body>
@@ -161,7 +165,6 @@
         <label for="colorPicker">Select Color:</label>
         <input type="color" id="colorPicker" value="#000000">
         <div id="colorHistory" class="color-history"></div>
-        <button id="exportBtn">Export as PNG</button>
         <div class="zoom-controls">
             <button id="zoomInBtn">🔍+</button>
             <button id="zoomOutBtn">🔍-</button>
@@ -174,6 +177,9 @@
             </div>
             <button id="panDownBtn">⬇️</button>
         </div>
+        <button id="centerViewBtn">🎯 Center View</button>
+        <hr>
+        <button id="exportBtn">Export as PNG</button>
         <button id="resetBtn">Reset</button>
     </div>
     <script src="app.js"></script>
idmenu working' href='/acidbong/suckless/dwm/commit/util.c?h=5.8.2&id=39677ec76616fe4165ef92afb14db2bef2488e30'>39677ec ^
39677ec ^
ca65478 ^
adaa28a ^
dc5d967 ^
adaa28a ^


849e631 ^
adaa28a ^


ca65478 ^
9955ddc ^
dc5d967 ^
9955ddc ^

9955ddc ^
439e15d ^
4230932 ^

439e15d ^



16c67f3 ^
7711ab6 ^
e48de30 ^
439e15d ^

0464e42 ^
439e15d ^


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54