-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
278 lines (270 loc) · 19.1 KB
/
Copy pathindex.html
File metadata and controls
278 lines (270 loc) · 19.1 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
<!-- VERSION: 1.0.0 -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Pixel Art Creator</title>
<link rel="stylesheet" href="public/css/style.css">
<link rel="stylesheet" href="public/css/bars.css">
<link rel="stylesheet" href="public/css/toolbar.css">
<link rel="stylesheet" href="public/css/color-picker.css">
<link rel="stylesheet" href="public/css/side-menus.css">
<link rel="stylesheet" href="public/css/layers.css">
<link rel="stylesheet" href="public/css/components.css">
</head>
<body>
<nav class="top-menubar bar">
<ul>
<li><span>File</span><ul class="dropdown-menu">
<li id="menu-new-project" title="Create a new project (Ctrl+N)"><span>New Project</span></li>
<li id="menu-open-project" title="Open a project from a .json file (Ctrl+O)"><span>Open Project (.json)...</span></li>
<li id="menu-open-image" title="Import an image onto a new layer"><span>Open Image...</span></li>
<li id="menu-save-project" title="Save project to a .json file (Ctrl+S)"><span>Save Project</span></li>
<li id="menu-save-project-as" title="Save project as a new .json file (Ctrl+Shift+S)"><span>Save Project As...</span></li>
<li class="submenu-parent"><span>Export As</span>
<ul class="dropdown-submenu">
<li id="menu-download-png" title="Export as a PNG image (Ctrl+E)"><span>Download PNG</span></li>
<li id="menu-download-svg" title="Export as an SVG image"><span>Download SVG</span></li>
<li id="menu-copy-svg" title="Copy SVG code to clipboard"><span>Copy SVG Code</span></li>
<li id="menu-download-ico" title="Export as a 32x32 ICO file"><span>Download ICO</span></li>
</ul>
</li>
</ul></li>
<li><span>Edit</span><ul class="dropdown-menu">
<li id="menu-undo" title="Undo last action (Ctrl+Z)"><span>Undo</span></li>
<li id="menu-redo" title="Redo last action (Ctrl+Y)"><span>Redo</span></li>
<li id="menu-cut" title="Cut selection to clipboard (Ctrl+X)"><span>Cut</span></li>
<li id="menu-copy" title="Copy selection to clipboard (Ctrl+C)"><span>Copy</span></li>
<li id="menu-paste" title="Paste clipboard to a new layer (Ctrl+V)"><span>Paste</span></li>
<li id="menu-clear-layer" title="Clear all pixels from the active layer (Delete)"><span>Clear Layer</span></li>
<li id="menu-preferences" title="Application preferences"><span>Preferences...</span></li>
</ul></li>
<li><span>View</span><ul class="dropdown-menu">
<li id="menu-zoom-in" title="Zoom In (Ctrl +)"><span>Zoom In</span></li>
<li id="menu-zoom-out" title="Zoom Out (Ctrl -)"><span>Zoom Out</span></li>
<li id="menu-fit-screen" title="Fit canvas to screen (Ctrl+0)"><span>Fit to Screen</span></li>
<li id="menu-toggle-grid" title="Show or hide the pixel grid overlay (Ctrl+')"><span>Show/Hide Grid</span></li>
<li id="menu-toggle-tiling" title="Preview how the image tiles"><span>Enable Tiling Mode</span></li>
<li id="menu-show-preview" title="Show a real-time preview window"><span>Show Preview Window</span></li>
</ul></li>
<li><span>Layer</span><ul class="dropdown-menu">
<li id="menu-new-layer" title="Add a new layer (Ctrl+Shift+N)"><span>New Layer</span></li>
<li id="menu-duplicate-layer" title="Duplicate the active layer (Ctrl+J)"><span>Duplicate Layer</span></li>
<li id="menu-delete-layer" title="Delete the active layer (Delete)"><span>Delete Layer</span></li>
<li id="menu-merge-down" title="Merge active layer with the one below (Ctrl+M)"><span>Merge Layer Down</span></li>
<li id="menu-move-layer-up" title="Move active layer up (Ctrl+])"><span>Move Layer Up</span></li>
<li id="menu-move-layer-down" title="Move active layer down (Ctrl+[)"><span>Move Layer Down</span></li>
</ul></li>
<li><span>Window</span><ul class="dropdown-menu">
<li id="menu-toggle-layers" title="Show or hide the Layers panel"><span>Show/Hide Layers Panel</span></li>
<li id="menu-toggle-history" title="Show or hide the History panel"><span>Show/Hide History Panel</span></li>
<li id="menu-toggle-timeline" title="Show or hide the Animation Timeline panel"><span>Show/Hide Animation Timeline</span></li>
</ul></li>
<li><span>Help</span><ul class="dropdown-menu">
<li id="menu-help-readme" title="About this application"><span>README</span></li>
<li id="menu-help-shortcuts" title="View keyboard shortcuts"><span>Shortcuts</span></li>
<li id="menu-help-examples" title="See usage examples"><span>Examples</span></li>
</ul></li>
<li class="menubar-controls-container">
<div class="menubar-controls">
<div class="control-group">
<label for="grid-size">Grid Size:</label>
<select id="grid-size" title="Set the dimensions of the pixel grid">
<option value="8">8 x 8</option>
<option value="16" selected>16 x 16</option>
<option value="32">32 x 32</option>
<option value="64">64 x 64</option>
<option value="128">128 x 128</option>
</select>
</div>
<div id="recent-colors" class="control-group recent-colors-container" title="Recent Colors"></div>
<div id="color-palette" class="control-group" title="Color Palette (Click to select)"></div>
<div class="control-group">
<button id="add-color-button" class="custom-color-btn" title="Open the advanced color picker">Custom Color</button>
</div>
</div>
</li>
<li class="menubar-title">Pixel Art Creator</li>
</ul>
</nav>
<div class="app-wrapper">
<div class="vertical-toolbar">
<div class="tool-group">
<button class="tool-button" id="tool-marquee" title="Marquee Select (M)">
<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2" ry="2" style="stroke-dasharray: 4, 2;"></rect></svg>
</button>
<button class="tool-button" id="tool-magic-wand" title="Magic Wand (W)">
<svg viewBox="0 0 24 24" width="20" height="20" fill="currentColor"><path d="M9.5 2L6.5 6L2 7.5L6.5 9L9.5 13L12.5 9L17 7.5L12.5 6L9.5 2M19.5 9.5L18.25 12.25L15.5 13.5L18.25 14.75L19.5 17.5L20.75 14.75L23.5 13.5L20.75 12.25L19.5 9.5Z"/></svg>
</button>
</div>
<div class="tool-group">
<div class="separator"></div>
<button class="tool-button" id="tool-brush" title="Brush (B)">
<svg viewBox="0 0 24 24" width="20" height="20" fill="currentColor"><path d="M14.06,9L15,9.94L5.92,19H5V18.08L14.06,9M17.66,3C17.41,3 17.15,3.1 16.96,3.29L15.13,5.12L18.88,8.87L20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18.17,3.09 17.92,3 17.66,3M14.06,6.19L3,17.25V21H6.75L17.81,9.94L14.06,6.19Z"/></svg>
</button>
<button class="tool-button" id="tool-dither-brush" title="Dithering Brush (D)">
<svg viewBox="0 0 24 24" width="20" height="20" fill="currentColor">
<path d="M14.06,9L15,9.94L5.92,19H5V18.08L14.06,9M17.66,3C17.41,3 17.15,3.1 16.96,3.29L15.13,5.12L18.88,8.87L20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18.17,3.09 17.92,3 17.66,3M14.06,6.19L3,17.25V21H6.75L17.81,9.94L14.06,6.19Z"/>
<path d="M4,17.5 V20.5 H7 L4,17.5 Z" fill-opacity="0.5"/>
</svg>
</button>
<button class="tool-button" id="tool-eraser" title="Eraser (E)">
<svg viewBox="0 0 24 24" width="20" height="20" fill="currentColor"><path d="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.13,5.12L18.88,8.87M3,17.25V21H6.75L17.81,9.94L14.06,6.19L3,17.25Z"/></svg>
</button>
<button class="tool-button" id="tool-fill" title="Paint Bucket (G)">
<svg viewBox="0 0 24 24" width="20" height="20" fill="currentColor"><path d="M19.2,12.04L19.04,12.23L13.62,18.5L13.41,18.73L5,10.18L4.96,10.13L19.2,12.04M20,2A2,2 0 0,0 18,4V6.43L4.43,8.83A2,2 0 0,0 3,10.75V20A2,2 0 0,0 5,22H15A2,2 0 0,0 17,20V19.4L20.6,15.03C21.39,14.07 22,12.84 22,11.5C22,6.25 17.75,2 12.5,2H12C10.84,2 9.77,2.2 8.8,2.54L11.5,5.25C11.83,5.08 12.16,5 12.5,5C15.54,5 18,7.46 18,10.5C18,11.08 17.9,11.63 17.72,12.14L20,10.43V4H20M5,20V12.21L12.21,20H5Z"/></svg>
</button>
<button class="tool-button" id="tool-line" title="Line Tool (L)">
<svg viewBox="0 0 24 24" width="20" height="20" fill="currentColor"><path d="M21.92,2.62L19.5,5.05L16.95,2.5L19.38,0.08C19.77,-0.31 20.4, -0.31 20.79,0.08L21.92,1.21C22.31,1.6 22.31,2.23 21.92,2.62M3.12,18.07L8.3,12.9L11.1,15.7L5.93,20.88C5.54,21.27 4.91,21.27 4.52,20.88L3.12,19.48C2.73,19.09 2.73,18.46 3.12,18.07M11.82,10.18L13.82,12.18L19.27,6.73L17.27,4.73L11.82,10.18Z"/></svg>
</button>
<button class="tool-button" id="tool-shape" title="Rectangle Tool (R) (Shift+Drag for filled)">
<svg viewBox="0 0 24 24" width="20" height="20" fill="currentColor"><path d="M17,17H7V7H17V17M21,3H3V21H21V3M19,5V19H5V5H19Z"/></svg>
</button>
<button class="tool-button" id="tool-circle" title="Circle Tool (O) (Shift+Drag for filled)">
<svg viewBox="0 0 24 24" width="20" height="20" fill="currentColor"><path d="M12,2C6.47,2,2,6.47,2,12s4.47,10,10,10,10-4.47,10-10S17.53,2,12,2z M12,20c-4.42,0-8-3.58-8-8s3.58-8,8-8,8,3.58,8,8S16.42,20,12,20z"/></svg>
</button>
</div>
<div class="tool-group">
<div class="separator"></div>
<button class="tool-button" id="tool-eyedropper" title="Eyedropper (I)">
<svg viewBox="0 0 24 24" width="20" height="20" fill="currentColor"><path d="M19.36,8.87C19.75,8.48 20.38,8.48 20.77,8.87L22.15,10.25C22.54,10.64 22.54,11.27 22.15,11.66L13.83,20H10V16.17L19.36,8.87M12.83,22H2V11.17L11.83,1.34C12.22,0.95 12.85,0.95 13.24,1.34L15.68,3.76C16.07,4.15 16.07,4.78 15.68,5.17L7.5,13.34L12.83,18.67L14.5,17L12,14.5L13.42,13.08L17.5,17.17L16.42,18.25L15,16.83L13.5,18.33L14.92,19.75L12.83,21.83V22Z"/></svg>
</button>
</div>
<div class="tool-group">
<div class="separator"></div>
<button class="tool-button" id="tool-zoom" title="Zoom (Z) - Click to zoom in, Alt+Click to zoom out">
<svg viewBox="0 0 24 24" width="20" height="20" fill="currentColor"><path d="M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z"/></svg>
</button>
<button class="tool-button" id="tool-pan" title="Pan/Hand (H) - Or hold Spacebar">
<svg viewBox="0 0 24 24" width="20" height="20" fill="currentColor"><path d="M18.89,11.32L15.36,7.79C15.17,7.6 14.91,7.5 14.64,7.5H9.5C8.4,7.5 7.5,8.4 7.5,9.5V11H4.5C3.4,11 2.5,11.9 2.5,13V16C2.5,17.1 3.4,18 4.5,18H5.2V19.5C5.2,20.6 6.1,21.5 7.2,21.5H10.8C11.9,21.5 12.8,20.6 12.8,19.5V18H15.32C16.41,18 17.3,17.16 17.45,16.08L19.45,12.8C19.66,12.18 19.41,11.53 18.89,11.32Z"/></svg>
</button>
</div>
</div>
<div class="canvas-wrapper">
<div id="ruler-top" class="ruler"><canvas id="ruler-top-canvas"></canvas></div>
<div id="ruler-left" class="ruler"><canvas id="ruler-left-canvas"></canvas></div>
<div id="app-container" class="app-container">
<div id="pixel-grid" class="scene"></div>
<div id="guides-container"></div>
<div id="selection-marquee" class="selection-marquee"></div>
</div>
</div>
<div id="right-side-menu" class="side-menu right">
<button id="right-menu-toggle" class="menu-toggle" title="Toggle Sidebar">‹</button>
<div class="menu-content">
<div id="history-panel" class="panel">
<h3>History</h3>
<div class="panel-controls">
<button id="undo-button" disabled title="Undo last action (Ctrl+Z)">Undo</button>
<button id="redo-button" disabled title="Redo last action (Ctrl+Y)">Redo</button>
</div>
<ul id="history-list" title="Click to jump to a history state"></ul>
</div>
<div id="layers-panel" class="panel">
<h3>Layers</h3>
<div class="panel-controls">
<button id="add-layer-button" title="Add a new layer (Ctrl+Shift+N)">Add Layer</button>
<button id="add-group-button" title="Create a new layer group">New Group</button>
<button id="delete-layer-button" disabled title="Delete the active layer or group (Delete)">Delete Item</button>
</div>
<ul id="layer-list"></ul>
</div>
</div>
</div>
</div>
<div id="preview-modal" class="component-modal-overlay">
<div id="preview-window" class="component-container draggable-window">
<div class="component-header draggable-handle">
<span class="title">Preview</span>
<span class="close-btn" id="preview-close-btn" title="Close Preview">×</span>
</div>
<div class="preview-content">
<canvas id="preview-canvas"></canvas>
</div>
<div id="preview-resize-handle" class="resize-handle"></div>
</div>
</div>
<div id="preferences-modal" class="component-modal-overlay">
<div class="preferences-modal-container component-container">
<div class="component-header">
<span class="title">Preferences</span>
<span class="close-btn" id="preferences-close-btn">×</span>
</div>
<div class="preferences-content">
<div class="form-section">
<h4>Canvas</h4>
<div class="form-row">
<label for="canvas-bg-color">Background Color</label>
<div class="color-swatch-input" id="canvas-bg-color" title="Select canvas background color"></div>
</div>
</div>
<div class="form-section">
<h4>Grid</h4>
<div class="form-row">
<label for="grid-line-color">Line Color</label>
<div class="color-swatch-input" id="grid-line-color" title="Select grid line color"></div>
</div>
<div class="form-row">
<label for="grid-line-opacity">Line Opacity</label>
<input type="range" id="grid-line-opacity" min="0" max="1" step="0.05">
</div>
</div>
</div>
</div>
</div>
<div id="readme-modal" class="component-modal-overlay">
<div class="component-container">
<div class="component-header"><span class="title">README</span><span class="close-btn" id="readme-close-btn">×</span></div>
<div class="modal-content">
<p><strong>Welcome to Pixel Art Creator v1.0!</strong></p>
<p>A powerful browser-based tool for creating pixel art, sprites, and animations with professional features.</p>
<p><strong>New in v1.0:</strong></p>
<ul>
<li>Auto-save every 3 minutes with crash recovery</li>
<li>Recent colors tracking (last 10 colors used)</li>
<li>Zoom to cursor position for precision work</li>
<li>Spacebar for temporary pan tool</li>
<li>Performance optimizations for smoother workflow</li>
<li>Preferences saved between sessions</li>
</ul>
</div>
</div>
</div>
<div id="shortcuts-modal" class="component-modal-overlay">
<div class="component-container">
<div class="component-header"><span class="title">Keyboard Shortcuts</span><span class="close-btn" id="shortcuts-close-btn">×</span></div>
<div class="modal-content">
<p><strong>Tools:</strong> B=Brush, E=Eraser, G=Fill, I=Eyedropper, L=Line, R=Rectangle, O=Circle, M=Marquee, W=Magic Wand, D=Dither Brush, Z=Zoom, H=Pan</p>
<p><strong>Navigation:</strong> Spacebar (hold)=Temporary Pan, Z+Click=Zoom In, Z+Alt+Click=Zoom Out</p>
<p><strong>Edit:</strong> Ctrl+Z=Undo, Ctrl+Y=Redo, Ctrl+C=Copy, Ctrl+X=Cut, Ctrl+V=Paste</p>
<p><strong>File:</strong> Ctrl+S=Save, Ctrl+N=New, Ctrl+O=Open, Ctrl+E=Export PNG</p>
<p><strong>View:</strong> Ctrl+=Zoom In, Ctrl+-=Zoom Out, Ctrl+0=Fit Screen, Ctrl+'=Toggle Grid</p>
</div>
</div>
</div>
<div id="examples-modal" class="component-modal-overlay">
<div class="component-container">
<div class="component-header"><span class="title">Examples</span><span class="close-btn" id="examples-close-btn">×</span></div>
<div class="modal-content"><p>Example content coming soon!</p></div>
</div>
</div>
<nav class="bottom-footerbar bar">
<div class="footer-left">Pixel Art Creator <span id="app-version">v1.0.0</span></div>
<div class="footer-center">
<p>Status: <span id="tool-status">Grid Cleared</span> | <span id="pixel-coordinates"></span></p>
</div>
<div class="footer-right">© 2025. All Rights Reserved.</div>
</nav>
<script src="public/js/utils/logger.js"></script>
<script src="public/js/utils/color-utils.js"></script>
<script src="public/js/managers/storage-manager.js"></script>
<script src="public/js/managers/color-picker.js"></script>
<script src="public/js/managers/history.js"></script>
<script src="public/js/managers/layers.js"></script>
<script src="public/js/tools/tools.js"></script>
<script src="public/js/managers/sidebars.js"></script>
<script src="public/js/events.js"></script>
<script src="public/js/script.js"></script>
</body>
</html>