Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
189 lines (141 loc) · 8.24 KB
/
Copy pathindex.html
File metadata and controls
189 lines (141 loc) · 8.24 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Pixelator - pixelate your image and handle colors</title>
<style>
</style>
<link rel="stylesheet" href="./src/style.css">
<script type="module" src="./src/main.js"></script>
</head>
<body>
<div class="app-container">
<div id="downloadModal">
<div class="modal-content">
<h2>Download Image</h2>
<div class="form-row">
<label for="downloadWidth">Width:</label>
<input id="downloadWidth" type="number" />
</div>
<div class="form-row">
<label for="downloadHeight">Height:</label>
<input id="downloadHeight" type="number" />
</div>
<div class="form-row">
<label>
<input id="lockAspect" type="checkbox" checked /> Maintain aspect ratio
</label>
</div>
<div class="button-row">
<button id="cancelDownload">Cancel</button>
<button id="confirmDownload">Download</button>
</div>
</div>
</div>
<!-- CANVAS WORKSPACE -->
<div id="canvas-container">
<div id="canvas-wrapper">
<canvas id="canvas"></canvas>
</div>
</div>
<!-- RESIZER -->
<div id="resizer" class="resizer"></div>
<!-- SIDEBAR -->
<div id="sidebar"
title="Pixelation is the primary purpose. Using a tileSize of 1 for full image quantization can be slow on large images.">
<!-- File SECTION -->
<div class="sidebar-section" title="Load an image to start pixelating">
<h3 title="Click to collapse/expand or drag this section">File</h3>
<div class="section-content">
<input type="file" id="raw-image-input" accept="image/*" class="file-btn"
title="Select an image file">
<button id="downloadBtn">Download Image</button>
</div>
</div>
<!-- HISTORY SECTION -->
<div class="sidebar-section" title="Undo or redo your actions">
<h3 title="Click to collapse/expand or drag this section">History</h3>
<div class="section-content">
<button id="undoBtn" title="Undo last action">Undo</button>
<button id="redoBtn" title="Redo last undone action">Redo</button>
</div>
</div>
<!-- SETTINGS & APPLY SECTION -->
<div class="sidebar-section" title="Adjust pixelation settings and apply">
<h3 title="Click to collapse/expand or drag this section">Settings & Apply</h3>
<div class="section-content">
<div class="label-input">
<label for="kMeans-iter" title="Number of kMeans iterations">Color Accuracy:</label>
<input type="number" id="kMeans-iter" value="1" min="1" max="50" step="1"
title="Set kMeans iterations">
</div>
<div class="label-input">
<label for="tile-size-input" title="Size of each tile">Tile Size:</label>
<input type="number" id="tile-size-input" value="1" min="1" title="Set tile size">
</div>
<div class="label-input">
<label for="color-count-input" title="Number of colors to use">Colors:</label>
<input type="number" id="color-count-input" value="16" min="1" max="256"
title="Set number of colors">
</div>
<label for="liveUpdateInput" title="Size of each tile">
<input type="checkbox" id="liveUpdateInput"
title="choose whether image gets updated on tilesize change">Update Live</label>
<label title="Make All Opaque"><input type="checkbox" id="alpha"> All Opaque</label>
<label title="Toggle grid overlay"><input type="checkbox" id="toggleGrid"> Show Grid</label>
<button id="quantize-tile-btn" disabled title="Quantize and tile the image">Quantize &
Tile</button>
<input type="range" id="zoom" min=".1" max="3" step=".1" value="1" title="Zoom level">
</div>
</div>
<!-- TOOLS SECTION -->
<div class="sidebar-section" title="Select drawing tools and modes">
<h3 title="Click to collapse/expand or drag this section">Drawing Tools</h3>
<div class="section-content">
<div id="controls">
<label title="Use brush"><input type="radio" name="toolMode" value="brush"> Brush</label>
<label title="Use eraser"><input type="radio" name="toolMode" value="eraser">
Eraser</label>
<label><input type="radio" name="toolMode" value="fillRegion"> Flood Fill</label>
<select id="modeSelect" title="Choose drawing mode">
<option value="N" title="Normal mode">Normal</option>
<option value="H" title="Horizontal Mirror">Horizontal Mirror</option>
<option value="V" title="Vertical Mirror">Vertical Mirror</option>
<option value="B" title="Mirror Both H+V">Both H+V</option>
<option value="D" title="Diagonal mirror">Diagonal</option>
</select>
<div id="display" title="Tool preview"></div>
</div>
</div>
</div>
<!-- COLORS / PALETTE SECTION -->
<div class="sidebar-section" title="Create and edit your color palette">
<h3 title="Click to collapse/expand or drag this section">Colors & Palette</h3>
<div class="section-content">
<button id="createPalette" title="Create a new color palette">Create Palette</button>
<button id="eraseBtn" title="Erase the selected color">Erase Selected Color</button>
<input type="color" id="colorPicker" class="circle-picker" value="#ff0000"
title="Pick a color">
<div id="hexDisplay" title="Click to copy"
style="display: flex; justify-content: space-between; width: 95%; border: 1px solid #cccccc1f; padding: 5px;">
<span id="hexValue">#ff0000</span>
<span id="copyLabel">Copy to Clipboard</span>
</div>
<div id="color-palette" title="Palette display"></div>
<div class="swatches" id="swatchesContainer" title="Saved color swatches"></div>
</div>
</div>
<!-- LOGS SECTION -->
<div class="sidebar-section" title="View application logs">
<h3 title="Click to collapse/expand or drag this section">Logs</h3>
<div class="section-content">
<label style="color:limegreen; font-family:monospace;" title="Toggle logs display">
<input type="checkbox" id="show-logs-checkbox" checked> Show Logs
</label>
<div id="log-panel" title="Log output">LOGS</div>
</div>
</div>
</div>
</div>
</body>
</html>