-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
377 lines (344 loc) · 22.5 KB
/
Copy pathindex.html
File metadata and controls
377 lines (344 loc) · 22.5 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
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Image Border Overlay Tool</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="container">
<h1>Badges-Be-Done</h1>
<p class="subtitle">Fire. Forget. Give the Gauntlet fiends something to do.</p>
<!-- ─── SECTION 1: BORDER ────────────────────────────────────────── -->
<div class="upload-section">
<h2>1. Upload Border Image or Generate Simple Border</h2>
<div class="border-option">
<label class="radio-label">
<input type="radio" name="borderMode" value="upload" id="borderUpload" checked>
<span class="radio-text">Upload Border Image</span>
</label>
<div class="file-input-wrapper" id="uploadSection">
<input type="file" id="borderInput" accept="image/png,image/webp">
<label for="borderInput" class="file-button">Choose or drop Border Image</label>
</div>
<span class="file-info" id="borderInfo">No file selected</span>
<div class="border-preview" id="borderPreview">
<p style="color:#666;margin-bottom:8px;font-size:0.9em;">Border Preview:</p>
<img id="borderPreviewImg" alt="Border preview">
</div>
</div>
<div class="border-option" style="margin-top:20px;">
<label class="radio-label">
<input type="radio" name="borderMode" value="generate" id="borderGenerate">
<span class="radio-text">Generate Simple Border</span>
</label>
<div id="generateSection" style="display:none;">
<div style="margin-bottom:15px;">
<label class="field-label">Optional: Upload Image for Color Ideas</label>
<div class="file-input-wrapper">
<input type="file" id="borderSourceInput" accept="image/*">
<label for="borderSourceInput" class="file-button">Choose or drop Source Image (Optional)</label>
</div>
<span class="file-info" id="borderSourceInfo">No file selected</span>
</div>
<div style="margin-bottom:15px;">
<label class="field-label">Border Width: <span id="borderWidthValue">3</span> pixels</label>
<input type="range" id="borderWidth" min="2" max="5" value="3" style="width:200px;">
</div>
<div style="margin-bottom:15px;">
<label class="field-label">Border Style:</label>
<select id="borderStyle" class="styled-select">
<optgroup label="Classic">
<option value="solid">Solid</option>
<option value="dashed">Dashed</option>
<option value="dotted">Dotted</option>
<option value="dotdash">Dot-Dash Pattern</option>
<option value="shadow">Drop Shadow</option>
<option value="checkerboard">Checkerboard</option>
<option value="multiring">Multi-Color Rings</option>
</optgroup>
<optgroup label="Math Pattern">
<option value="axial">Axial Stripe</option>
<option value="bitplane">Bitplane Slice</option>
<option value="constant">Constant Field</option>
<option value="edge">Edge Gradient Band</option>
<option value="manhattan">Manhattan Distance</option>
<option value="parity">Parity Field</option>
<option value="prime">Prime Modulation</option>
<option value="radial">Ring Distance Field</option>
<option value="sawtooth">Sawtooth Edge</option>
<option value="xor">XOR Interference</option>
</optgroup>
<optgroup label="Pixel Art">
<option value="px-bracket">Px: Corner Brackets</option>
<option value="px-chamfer">Px: Chamfered Corners</option>
<option value="px-rivet">Px: Corner Rivets</option>
<option value="px-open">Px: Open Corners</option>
<option value="px-pip">Px: Corner Pips</option>
<option value="px-double">Px: Double Rule</option>
<option value="px-stitch">Px: Cross-Stitch</option>
<option value="px-zigzag">Px: Zigzag Teeth</option>
<option value="px-brick">Px: Brick Course</option>
</optgroup>
</select>
</div>
<!-- Corner picker — shown only for corner-aware pixel styles -->
<div id="cornerPickerSection" style="display:none;margin-bottom:15px;">
<label class="field-label">Apply corner style to:</label>
<div class="corner-picker">
<div class="corner-grid">
<label class="corner-btn"><input type="checkbox" id="cornerTL" checked><span>TL</span></label>
<label class="corner-btn"><input type="checkbox" id="cornerTR" checked><span>TR</span></label>
<label class="corner-btn"><input type="checkbox" id="cornerBL" checked><span>BL</span></label>
<label class="corner-btn"><input type="checkbox" id="cornerBR" checked><span>BR</span></label>
</div>
<p class="corner-hint" id="cornerHint"></p>
</div>
</div>
<div style="margin-bottom:15px;">
<label class="field-label">Number of Colors:</label>
<select id="colorCount" class="styled-select">
<option value="1">1 Color</option>
<option value="2">2 Colors</option>
<option value="3">3 Colors</option>
</select>
</div>
<div style="margin-bottom:15px;">
<label class="field-label">Color Mode:</label>
<select id="colorMode" class="styled-select">
<option value="manual">Manual Colors</option>
<option value="extract">Extract from Image</option>
<option value="random">Random Colors</option>
</select>
</div>
<div id="manualColorSection" style="margin-bottom:15px;">
<label class="field-label">Border Colors:</label>
<div class="color-row">
<div class="color-swatch">
<input type="color" id="borderColor1" value="#ffffff">
<span>Color 1</span>
</div>
<div id="color2Container" class="color-swatch" style="display:none;">
<input type="color" id="borderColor2" value="#ff0000">
<span>Color 2</span>
</div>
<div id="color3Container" class="color-swatch" style="display:none;">
<input type="color" id="borderColor3" value="#00ff00">
<span>Color 3</span>
</div>
</div>
</div>
<button class="process-button" id="generateBorderButton" style="font-size:0.9em;padding:10px 20px;">Generate Border</button>
</div>
<div class="border-preview" id="generatedBorderPreview" style="display:none;">
<p style="color:#666;margin-bottom:8px;font-size:0.9em;">Generated Border Preview:</p>
<img id="generatedBorderPreviewImg" alt="Generated border preview">
</div>
</div>
<details class="resources-tip" style="margin-top:18px;">
<summary>📦 Where to find pixel art borders</summary>
<div class="resources-body">
<p>This tool accepts any 64×64 PNG, so you can use external pixel border sheets. Export or crop to 64×64 with a transparent background (RGBA PNG) for best results.</p>
<ul>
<li><a href="https://opengameart.org" target="_blank">OpenGameArt.org</a> — search "border" or "frame", filter by CC0</li>
<li><a href="https://kenney.nl/assets" target="_blank">Kenney.nl</a> — UI packs often include pixel borders</li>
<li><a href="https://itch.io/game-assets/free/tag-pixel-art" target="_blank">itch.io free pixel assets</a> — search "border frame"</li>
<li><a href="https://lospec.com" target="_blank">Lospec.com</a> — community pixel art tools and palettes</li>
<li><strong>Aseprite / Photoshop / GIMP</strong> — draw your own at 64×64 and export as PNG</li>
</ul>
<p style="margin-top:8px;color:var(--accent-primary);font-size:0.85em;">Tip: Only the non-transparent pixels in your border PNG will show — the rest composites cleanly over the background and foreground.</p>
</div>
</details>
</div>
<!-- ─── SECTION 2: BACKGROUND ────────────────────────────────────── -->
<div class="upload-section">
<h2>2. Upload Background Image or Generate Background</h2>
<div class="border-option">
<label class="radio-label">
<input type="radio" name="backgroundMode" value="upload" id="backgroundUpload" checked>
<span class="radio-text">Upload Background Image</span>
</label>
<div class="file-input-wrapper" id="backgroundUploadSection">
<input type="file" id="backgroundInput" accept="image/*">
<label for="backgroundInput" class="file-button">Choose or drop Background Image</label>
</div>
<span class="file-info" id="backgroundInfo">No file selected</span>
<div class="border-preview" id="backgroundPreview">
<p style="color:#666;margin-bottom:8px;font-size:0.9em;">Background Preview:</p>
<img id="backgroundPreviewImg" alt="Background preview">
</div>
</div>
<div class="border-option" style="margin-top:20px;">
<label class="radio-label">
<input type="radio" name="backgroundMode" value="generate" id="backgroundGenerate">
<span class="radio-text">Generate Background</span>
</label>
<div id="backgroundGenerateSection" style="display:none;">
<div style="margin-bottom:15px;">
<label class="field-label">Background Style:</label>
<select id="backgroundStyle" class="styled-select">
<optgroup label="Noise & Organic">
<option value="bg1">Cellular Soft Noise</option>
<option value="bg4">Flow Noise Field</option>
<option value="bg5">Galaxy Noise Hybrid</option>
<option value="bg7">Soft Radial Falloff</option>
</optgroup>
<optgroup label="Wave & Angular">
<option value="bg2">Concentric Polygon Rings</option>
<option value="bg3">Directional Drift Field</option>
<option value="bg6">Low-Frequency Wave Interference</option>
<option value="bg8">Spiral Swirl Field</option>
<option value="bg9">Starburst Harmonic</option>
</optgroup>
<optgroup label="Geometric">
<option value="bg11">Pixel Grid</option>
<option value="bg12">Diagonal Stripes</option>
<option value="bg13">Dot Grid</option>
</optgroup>
<optgroup label="Sparse">
<option value="bg10">Starfield Sparse Distribution</option>
</optgroup>
</select>
</div>
<div style="margin-bottom:15px;">
<label class="field-label">Number of Colors:</label>
<select id="bgColorCount" class="styled-select">
<option value="2">2 Colors</option>
<option value="3">3 Colors</option>
</select>
</div>
<div style="margin-bottom:15px;">
<label class="field-label">Color Mode:</label>
<select id="bgColorMode" class="styled-select">
<option value="manual" selected>Manual Colors</option>
<option value="extract">Extract from Image</option>
<option value="random">Random Colors</option>
</select>
</div>
<div id="bgManualColorSection" style="display:block;margin-bottom:15px;">
<label class="field-label">Manual Colors:</label>
<div class="color-row">
<div class="color-swatch">
<input type="color" id="bgColor1" value="#1a1a2e">
<span>Color 1</span>
</div>
<div id="bgColor2Container" class="color-swatch">
<input type="color" id="bgColor2" value="#16213e">
<span>Color 2</span>
</div>
<div id="bgColor3Container" class="color-swatch" style="display:none;">
<input type="color" id="bgColor3" value="#0f3460">
<span>Color 3</span>
</div>
</div>
</div>
<button class="process-button" id="generateBackgroundButton" style="font-size:0.9em;padding:10px 20px;">Generate Background</button>
<div style="margin-top:15px;">
<label class="radio-label">
<input type="checkbox" id="cycleBackgrounds" style="width:auto;cursor:pointer;">
<span class="radio-text">Cycle Backgrounds (different seed per image)</span>
</label>
<p style="color:var(--text-secondary);font-size:0.85em;margin-top:8px;margin-left:30px;">
Uses the same style and colors but generates unique variations per image.
</p>
</div>
</div>
<div class="border-preview" id="generatedBackgroundPreview" style="display:none;">
<p style="color:#666;margin-bottom:8px;font-size:0.9em;">Generated Background Preview:</p>
<img id="generatedBackgroundPreviewImg" alt="Generated background preview">
</div>
</div>
</div>
<!-- ─── SECTION 3: IMAGES ────────────────────────────────────────── -->
<div class="upload-section">
<h2>3. Upload Images to Process</h2>
<details class="resources-tip" style="margin-bottom:20px;">
<summary>💡 Tips for best results</summary>
<div class="resources-body">
<p><strong>Image prep:</strong> Crop foreground images to 1:1 ratio. Use PNG with transparency for clean overlays.</p>
<p style="margin-top:8px;"><strong>Background removal:</strong> <a href="https://www.remove.bg/" target="_blank" style="color:var(--accent-primary);">remove.bg</a> works well for most images.</p>
<p style="margin-top:8px;"><strong>Which drop zone?</strong> Use <em>Center & Resize</em> for most images. Use <em>Center Only</em> for small pixel art or sprites that shouldn't be upscaled.</p>
</div>
</details>
<div class="drop-zones-container">
<div class="drop-zone" id="dropZoneResize">
<div class="drop-zone-icon">⤢</div>
<div class="drop-zone-title">Center & Resize</div>
<p class="drop-zone-desc">Scales to fill 64×64</p>
<label for="imagesInputResize" class="file-button">Choose or drop Files</label>
<input type="file" id="imagesInputResize" accept="image/*" multiple style="display:none;">
<div class="drop-zone-footer">
<span class="drop-zone-count" id="countResize">0 files</span>
<button class="clear-btn" id="clearResize">Clear</button>
</div>
<div class="file-list" id="fileListResize"></div>
</div>
<div class="drop-zone" id="dropZoneCentered">
<div class="drop-zone-icon">⊙</div>
<div class="drop-zone-title">Center Only</div>
<p class="drop-zone-desc">Centers at native size, no upscale</p>
<label for="imagesInputCentered" class="file-button">Choose or drop Files</label>
<input type="file" id="imagesInputCentered" accept="image/*" multiple style="display:none;">
<div class="drop-zone-footer">
<span class="drop-zone-count" id="countCentered">0 files</span>
<button class="clear-btn" id="clearCentered">Clear</button>
</div>
<div class="file-list" id="fileListCentered"></div>
</div>
</div>
<p class="total-files-info" id="totalFilesInfo" style="display:none;"></p>
<div style="margin-top:20px;">
<label class="radio-label">
<input type="checkbox" id="enableSlicing" style="width:auto;cursor:pointer;">
<span class="radio-text">Enable Slicing (generates breakout layer variations)</span>
</label>
<p style="color:var(--text-secondary);font-size:0.85em;margin-top:8px;margin-left:30px;">
Opens a preview before processing — pick exactly which slices to include as a composite image.
</p>
</div>
<br>
<button class="process-button" id="processButton" disabled>Process Images</button>
<div class="status" id="status"></div>
<div class="progress-container" id="progressContainer">
<div class="progress-bar" id="progressBar"></div>
<div class="progress-text" id="progressText"></div>
</div>
</div>
<!-- ─── RESULTS ─────────────────────────────────────────────────── -->
<div class="results" id="results">
<h2>Processed Images</h2>
<div class="image-grid" id="imageGrid"></div>
<button class="download-all" id="downloadAll">Download All as ZIP</button>
<button class="download-all" id="downloadSaveAs" style="margin-left:10px;">Save As ZIP</button>
<button class="download-all" id="downloadIndividual" style="margin-left:10px;">Download All (Individual)</button>
</div>
</div>
<!-- ─── SLICE MODAL ──────────────────────────────────────────────────── -->
<div id="sliceModal" class="slice-modal">
<div class="slice-modal-content">
<div class="slice-modal-header">
<h3>Select Slice Variants</h3>
<div class="slice-nav">
<button id="slicePrevBtn" class="slice-nav-btn" disabled>◀</button>
<span id="sliceImageCounter">Image 1 / 1</span>
<button id="sliceNextBtn" class="slice-nav-btn">▶</button>
</div>
</div>
<div class="slice-preview-area">
<canvas id="slicePreviewCanvas" width="256" height="256"></canvas>
</div>
<div id="sliceCheckboxes" class="slice-checkboxes"></div>
<div class="slice-modal-footer">
<span class="slice-kbd-hint">Arrow keys: navigate · Enter: confirm ALL · Esc: cancel</span>
<div class="slice-modal-buttons">
<button id="sliceConfirm" class="process-button" style="font-size:0.9em;padding:10px 28px;">✓ Confirm</button>
<button id="sliceCancel" class="download-all" style="margin-left:10px;">✕ Cancel</button>
</div>
</div>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<script type="module" src="app.js"></script>
</body>
</html>