-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathindex.html
More file actions
719 lines (683 loc) · 32 KB
/
index.html
File metadata and controls
719 lines (683 loc) · 32 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
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>DisplayKit - TFT_eSPI + U8g2 UI Builder</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div class="app-shell">
<div class="sidebar">
<div class="sidebar-header">
<div style="flex: 1;">
<h2>DisplayKit</h2>
<div class="brand-subtitle">by CiferTech</div>
</div>
</div>
<div class="sidebar-card highlight">
<div class="sidebar-card-title">Project Links</div>
<a class="link-chip" href="https://github.com/cifertech/DisplayKit" target="_blank" rel="noreferrer">
<span class="icon">↗</span> GitHub Repo
</a>
<a class="link-chip" href="https://www.patreon.com/cifertech" target="_blank" rel="noreferrer">
<span class="icon">❤️</span> Support on Patreon
</a>
</div>
<div class="sidebar-card tools-card">
<div class="sidebar-card-title">Tools</div>
<a class="link-chip" href="tools/pixelforge/index.html" data-open-tool="pixelforge" rel="noreferrer">
<span class="icon">🧩</span> PixelForge (Image Converter)
</a>
<a class="link-chip" href="tools/bitcanvas-studio/index.html" data-open-tool="bitcanvas" rel="noreferrer">
<span class="icon">🎞️</span> BitCanvas Studio (Animation)
</a>
</div>
<div class="sidebar-card section-card" id="uiExamplesCard">
<div class="sidebar-card-title">UI Examples</div>
<div class="mini-hint">Add a ready-made screen layout (non-destructive).</div>
<div class="ui-examples-tabs" role="tablist" aria-label="UI example presets">
<button class="ui-tab-btn" type="button" id="uiExamplesTabTft" role="tab" aria-selected="true" data-ui-examples-tab="tft">
TFT
</button>
<button class="ui-tab-btn" type="button" id="uiExamplesTabOled" role="tab" aria-selected="false" data-ui-examples-tab="oled">
OLED
</button>
</div>
<div class="example-list" id="uiExamplesList"></div>
<div class="ui-examples-pager" aria-label="UI examples pagination">
<button class="btn small secondary" type="button" id="uiExamplesPrevBtn">Prev</button>
<span class="pill outline small" id="uiExamplesPagePill">Page 1 / 1</span>
<button class="btn small secondary" type="button" id="uiExamplesNextBtn">Next</button>
</div>
</div>
<div class="sidebar-card section-card" id="iconListCard">
<div class="sidebar-card-title">Icon List</div>
<div class="icon-search-row">
<input type="text" id="iconSearch" placeholder="Search icons (wifi, gear, play...)" />
<button class="btn small secondary" type="button" id="clearIconSearch" title="Clear search">Clear</button>
</div>
<div class="icon-toolbar">
<div class="icon-toolbar-left">
<label for="iconSizeFilter" class="sr-only">Icon size</label>
<select id="iconSizeFilter" title="Filter by icon size">
<option value="all">All sizes</option>
<option value="16x16">16x16</option>
<option value="32x32">32x32</option>
</select>
<span class="pill outline small" id="iconCountPill">0 icons</span>
</div>
<button class="btn small secondary" type="button" id="refreshIconsBtn" title="Reload icon manifest">Refresh</button>
</div>
<div class="icon-actions-row">
<button class="btn small secondary" type="button" id="exportIconsTftBtn" title="Export all icons as RGB565 PROGMEM arrays (TFT_eSPI)">
Export TFT (RGB565)
</button>
<button class="btn small secondary" type="button" id="exportIconsU8g2Btn" title="Export all icons as XBM PROGMEM arrays (U8g2)">
Export U8g2 (XBM)
</button>
</div>
<div class="icon-grid" id="iconGrid" aria-label="Icon list"></div>
<div class="icon-pager" aria-label="Icon list pagination">
<button class="btn small secondary" type="button" id="iconPrevBtn">Prev</button>
<span class="pill outline small" id="iconPagePill">Page 1 / 1</span>
<button class="btn small secondary" type="button" id="iconNextBtn">Next</button>
</div>
<div class="mini-hint" id="iconHint">Click an icon to add it as an element. Shift+Click also copies its path.</div>
</div>
<div class="sidebar-card note section-card">
<div class="sidebar-card-title">Workflow tips</div>
<ul>
<li>Use Snap-to-grid for pixel-perfect layouts.</li>
<li>Duplicate elements to iterate fast.</li>
<li>Export JSON often for versioning.</li>
</ul>
</div>
<div class="sidebar-card section-card">
<div class="sidebar-card-title">Basic Shapes</div>
<div class="btn-group">
<button class="btn small chip-btn" data-add="rect" title="Rect">
<span class="icon-box shape">
<svg viewBox="0 0 24 24" aria-hidden="true">
<rect x="5" y="7" width="14" height="10" rx="2" ry="2" stroke="currentColor" stroke-width="2" fill="none" />
</svg>
</span>
<span class="chip-label">Rect</span>
</button>
<button class="btn small chip-btn" data-add="roundrect" title="Round Rect">
<span class="icon-box shape">
<svg viewBox="0 0 24 24" aria-hidden="true">
<rect x="5" y="7" width="14" height="10" rx="5" ry="5" stroke="currentColor" stroke-width="2" fill="none" />
</svg>
</span>
<span class="chip-label">Round</span>
</button>
<button class="btn small chip-btn" data-add="circle" title="Circle">
<span class="icon-box shape">
<svg viewBox="0 0 24 24" aria-hidden="true">
<circle cx="12" cy="12" r="6" stroke="currentColor" stroke-width="2" fill="none" />
</svg>
</span>
<span class="chip-label">Circle</span>
</button>
<button class="btn small chip-btn" data-add="line" title="Line">
<span class="icon-box shape">
<svg viewBox="0 0 24 24" aria-hidden="true">
<line x1="5" y1="18" x2="19" y2="6" stroke="currentColor" stroke-width="2" stroke-linecap="round" />
</svg>
</span>
<span class="chip-label">Line</span>
</button>
<button class="btn small chip-btn" data-add="divider" title="Divider">
<span class="icon-box shape">
<svg viewBox="0 0 24 24" aria-hidden="true">
<line x1="5" y1="12" x2="19" y2="12" stroke="currentColor" stroke-width="2" stroke-linecap="round" />
</svg>
</span>
<span class="chip-label">Divider</span>
</button>
</div>
</div>
<div class="sidebar-card section-card">
<div class="sidebar-card-title">UI Elements</div>
<div class="btn-group">
<button class="btn small chip-btn" data-add="text" title="Text">
<span class="icon-box ui">
<svg viewBox="0 0 24 24" aria-hidden="true">
<path d="M6 7h12" stroke="currentColor" stroke-width="2" stroke-linecap="round" fill="none" />
<path d="M9 11h9" stroke="currentColor" stroke-width="2" stroke-linecap="round" fill="none" />
<path d="M9 15h7" stroke="currentColor" stroke-width="2" stroke-linecap="round" fill="none" />
</svg>
</span>
<span class="chip-label">Text</span>
</button>
<button class="btn small chip-btn" data-add="label" title="Label">
<span class="icon-box ui">
<svg viewBox="0 0 24 24" aria-hidden="true">
<rect x="5" y="7" width="14" height="10" rx="3" ry="3" stroke="currentColor" stroke-width="2" fill="none" />
<line x1="8" y1="11" x2="16" y2="11" stroke="currentColor" stroke-width="2" stroke-linecap="round" />
</svg>
</span>
<span class="chip-label">Label</span>
</button>
<button class="btn small chip-btn" data-add="button" title="Button">
<span class="icon-box ui">
<svg viewBox="0 0 24 24" aria-hidden="true">
<rect x="6" y="9" width="12" height="6" rx="3" ry="3" stroke="currentColor" stroke-width="2" fill="none" />
</svg>
</span>
<span class="chip-label">Button</span>
</button>
<button class="btn small chip-btn" data-add="progress" title="Progress">
<span class="icon-box ui">
<svg viewBox="0 0 24 24" aria-hidden="true">
<rect x="5" y="10" width="14" height="4" rx="2" ry="2" stroke="currentColor" stroke-width="2" fill="none" />
<rect x="6" y="11" width="7" height="2" rx="1" ry="1" fill="currentColor" />
</svg>
</span>
<span class="chip-label">Progress</span>
</button>
<button class="btn small chip-btn" data-add="slider" title="Slider">
<span class="icon-box ui">
<svg viewBox="0 0 24 24" aria-hidden="true">
<line x1="6" y1="12" x2="18" y2="12" stroke="currentColor" stroke-width="2" stroke-linecap="round" />
<circle cx="10" cy="12" r="3" stroke="currentColor" stroke-width="2" fill="var(--bg-tertiary)" />
</svg>
</span>
<span class="chip-label">Slider</span>
</button>
<button class="btn small chip-btn" data-add="toggle" title="Toggle">
<span class="icon-box ui">
<svg viewBox="0 0 24 24" aria-hidden="true">
<rect x="5" y="9" width="14" height="6" rx="3" ry="3" stroke="currentColor" stroke-width="2" fill="none" />
<circle cx="15" cy="12" r="2.5" stroke="currentColor" stroke-width="2" fill="var(--bg-tertiary)" />
</svg>
</span>
<span class="chip-label">Toggle</span>
</button>
<button class="btn small chip-btn" data-add="card" title="Card">
<span class="icon-box ui">
<svg viewBox="0 0 24 24" aria-hidden="true">
<rect x="5" y="7" width="14" height="10" rx="2" ry="2" stroke="currentColor" stroke-width="2" fill="none" />
<line x1="7" y1="11" x2="17" y2="11" stroke="currentColor" stroke-width="2" stroke-linecap="round" />
</svg>
</span>
<span class="chip-label">Card</span>
</button>
<button class="btn small chip-btn" data-add="header" title="Header">
<span class="icon-box ui">
<svg viewBox="0 0 24 24" aria-hidden="true">
<rect x="5" y="7" width="14" height="4" rx="2" ry="2" stroke="currentColor" stroke-width="2" fill="none" />
</svg>
</span>
<span class="chip-label">Header</span>
</button>
<button class="btn small chip-btn" id="addImageBtn" title="Image">
<span class="icon-box ui">
<svg viewBox="0 0 24 24" aria-hidden="true">
<rect x="4" y="6" width="16" height="12" rx="2" ry="2" stroke="currentColor" stroke-width="2" fill="none" />
<circle cx="10" cy="11" r="1.5" stroke="currentColor" stroke-width="1.5" fill="none" />
<polyline points="7,16 11,12 16,16" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" />
</svg>
</span>
<span class="chip-label">Image</span>
</button>
</div>
</div>
</div>
<div class="main">
<div class="top-bar">
<div class="top-left">
<div class="top-left-primary">
<span id="displayInfo">TFT_eSPI · 240x320 px</span>
<span class="pill">Multi-screen · Drag to position · Click to edit</span>
</div>
<div class="status-chips">
<span class="pill soft">Drag to move</span>
<span class="pill soft">⌘ / Ctrl + Z to undo</span>
<span class="pill soft">Export JSON for versioning</span>
</div>
</div>
<div class="top-right">
<a class="btn small github" href="https://github.com/cifertech/DisplayKit" target="_blank" rel="noreferrer">
GitHub
</a>
<a class="btn small patreon" href="https://www.patreon.com/cifertech" target="_blank" rel="noreferrer">
Patreon
</a>
<button class="btn small secondary" id="themeToggle" title="Toggle theme">
<span id="themeIcon">🌙</span>
</button>
<button class="btn small secondary" id="undoBtn">Undo</button>
<button class="btn small secondary" id="redoBtn">Redo</button>
<button class="btn small secondary" id="duplicateBtn">Duplicate</button>
<div class="slider-inline">
<span>Zoom</span>
<input type="range" id="zoomSlider" min="50" max="200" value="75" />
</div>
<button class="btn small secondary" id="exportJsonBtn">Export JSON</button>
<button class="btn small secondary" id="importJsonBtn">Import JSON</button>
</div>
</div>
<div class="workspace">
<div class="preview-wrapper">
<div class="preview-frame">
<div id="preview"></div>
</div>
</div>
<div class="properties">
<div class="props-section">
<div class="settings-block" id="settingsProjectBlock">
<div class="section-title" id="settingsProjectTitle">Project</div>
<div class="mini-hint">Project settings live here (screens, display, scene, grid).</div>
</div>
<div class="settings-block" id="settingsDisplayBlock">
<div class="section-title" id="settingsDisplayTitle">Display</div>
<div class="prop-group">
<div class="prop-row">
<div>
<label for="dispWidth">Width</label>
<input type="number" id="dispWidth" value="240" min="1" />
</div>
<div>
<label for="dispHeight">Height</label>
<input type="number" id="dispHeight" value="320" min="1" />
</div>
</div>
<div class="prop-row">
<div>
<label for="displayDriver">Driver</label>
<select id="displayDriver">
<option value="tft">TFT_eSPI</option>
<option value="u8g2">U8g2 OLED</option>
</select>
</div>
</div>
<button class="btn small secondary icon-btn-ghost" id="applyRes" title="Apply resolution">
<span>Apply</span>
</button>
</div>
</div>
<!-- TFT Display Settings -->
<div id="tftSettings" class="display-settings settings-block">
<div class="section-title" id="settingsTftTitle">TFT Display Settings</div>
<div class="prop-group">
<div class="prop-row">
<div>
<label for="tftRotation">Rotation</label>
<select id="tftRotation">
<option value="0">0° (Portrait)</option>
<option value="1">90° (Landscape)</option>
<option value="2">180° (Portrait)</option>
<option value="3">270° (Landscape)</option>
</select>
</div>
<div>
<label for="tftColorDepth">Color Depth</label>
<select id="tftColorDepth">
<option value="16">16-bit RGB565</option>
<option value="18">18-bit RGB666</option>
<option value="24">24-bit RGB888</option>
</select>
</div>
</div>
<div class="prop-row">
<div>
<label for="tftBacklight">Backlight Control</label>
<select id="tftBacklight">
<option value="none">None</option>
<option value="pwm">PWM Pin</option>
<option value="manual">Manual</option>
</select>
</div>
<div>
<label for="tftTouch">Touch Support</label>
<select id="tftTouch">
<option value="none">No Touch</option>
<option value="resistive">Resistive</option>
<option value="capacitive">Capacitive</option>
</select>
</div>
</div>
</div>
</div>
<!-- OLED Display Settings -->
<div id="oledSettings" class="display-settings settings-block">
<div class="section-title" id="settingsOledTitle">OLED Display Settings</div>
<div class="prop-group">
<div class="prop-row">
<div>
<label for="u8g2Preset">U8g2 Display Model</label>
<select id="u8g2Preset"></select>
</div>
<div>
<label for="oledRotation">Rotation</label>
<select id="oledRotation">
<option value="0">0° (Normal)</option>
<option value="1">90° (Clockwise)</option>
<option value="2">180° (Upside Down)</option>
<option value="3">270° (Counter-clockwise)</option>
</select>
</div>
</div>
<div class="prop-row">
<div>
<label for="oledContrast">Contrast (0-255)</label>
<input type="range" id="oledContrast" min="0" max="255" value="127" />
<span id="oledContrastValue">127</span>
</div>
<div>
<label for="oledFlipMode">Flip Mode</label>
<select id="oledFlipMode">
<option value="none">Normal</option>
<option value="horizontal">Horizontal Flip</option>
<option value="vertical">Vertical Flip</option>
<option value="both">Both</option>
</select>
</div>
</div>
<div class="prop-row">
<div>
<label for="oledFontMode">Font Rendering</label>
<select id="oledFontMode">
<option value="transparent">Transparent Background</option>
<option value="solid">Solid Background</option>
<option value="inverse">Inverse Colors</option>
</select>
</div>
<div>
<label for="oledPowerSave">Power Save Mode</label>
<select id="oledPowerSave">
<option value="off">Always On</option>
<option value="auto">Auto Sleep</option>
<option value="manual">Manual Control</option>
</select>
</div>
</div>
</div>
</div>
<div class="settings-block" id="settingsScreensBlock">
<div class="section-title" id="settingsScreensTitle">Screens</div>
<div class="prop-group">
<label for="screenSelect">Current screen</label>
<div class="prop-row">
<div>
<select id="screenSelect"></select>
</div>
<button class="btn small secondary icon-btn-ghost" id="addScreenBtn" title="Add screen">
<svg viewBox="0 0 24 24" aria-hidden="true">
<line x1="12" y1="6" x2="12" y2="18" stroke="currentColor" stroke-width="2" stroke-linecap="round" />
<line x1="6" y1="12" x2="18" y2="12" stroke="currentColor" stroke-width="2" stroke-linecap="round" />
</svg>
</button>
</div>
</div>
<div class="prop-group">
<label for="screenFnName">Function name</label>
<div class="prop-row fn-row">
<div>
<input type="text" id="screenFnName" placeholder="drawHomeScreen" />
</div>
<button class="btn small secondary icon-btn-ghost" id="deleteScreenBtn" title="Delete screen">
<svg viewBox="0 0 24 24" aria-hidden="true">
<polyline points="9,6 10,4 14,4 15,6" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" />
<rect x="7" y="6" width="10" height="12" rx="2" ry="2" stroke="currentColor" stroke-width="2" fill="none" />
<line x1="10" y1="10" x2="10" y2="14" stroke="currentColor" stroke-width="2" stroke-linecap="round" />
<line x1="14" y1="10" x2="14" y2="14" stroke="currentColor" stroke-width="2" stroke-linecap="round" />
</svg>
</button>
</div>
</div>
</div>
<div class="settings-block" id="settingsSceneBlock">
<div class="section-title" id="settingsSceneTitle">Scene</div>
<div class="prop-group">
<label>Background</label>
<div class="bg-color-row">
<div class="bg-presets">
<button class="bg-chip" data-bg-color="#000000">
<span class="bg-chip-swatch" style="background:#000000"></span>
<span>Black</span>
</button>
<button class="bg-chip" data-bg-color="#ffffff">
<span class="bg-chip-swatch" style="background:#ffffff"></span>
<span>White</span>
</button>
<button class="bg-chip" data-bg-color="#111827">
<span class="bg-chip-swatch" style="background:#111827"></span>
<span>Dark gray</span>
</button>
<button class="bg-chip" data-bg-color="#e5e7eb">
<span class="bg-chip-swatch" style="background:#e5e7eb"></span>
<span>Light gray</span>
</button>
<button class="bg-chip bg-chip-custom" id="bgColorCustom">
<span class="bg-chip-swatch" style="background:conic-gradient(red, orange, yellow, green, cyan, blue, magenta, red)"></span>
<span>Custom</span>
</button>
</div>
</div>
<input type="color" id="bgColor" value="#000000" style="display:none" />
</div>
</div>
<div class="settings-block" id="settingsGridBlock">
<div class="section-title" id="settingsGridTitle">Grid & Snap</div>
<div class="prop-group">
<label class="toggle-label">
<input type="checkbox" id="snapCheckbox" class="toggle-input" />
Snap to grid
</label>
<div class="prop-row">
<div>
<label for="gridSize">Grid size (px)</label>
<input type="number" id="gridSize" value="4" min="1" />
</div>
</div>
</div>
<div class="prop-group">
<label class="toggle-label">
<input type="checkbox" id="useSpriteCheckbox" class="toggle-input" />
Use sprite (TFT_eSprite) for screens
</label>
</div>
<div class="prop-group">
<button class="btn secondary small" id="clearAll">Clear all (screen)</button>
</div>
</div>
</div>
<div class="section-title" id="selectedElementTitle">Selected Element</div>
<div id="noSelection">No element selected</div>
<div id="propsPanel" style="display: none">
<div class="prop-group">
<label id="propTypeLabel">Type</label>
<div class="pill" id="elementTypePill"></div>
</div>
<div class="prop-group">
<div class="prop-row">
<div>
<label for="propX">X</label>
<input type="number" id="propX" />
</div>
<div>
<label for="propY">Y</label>
<input type="number" id="propY" />
</div>
</div>
<div class="prop-row">
<div>
<label for="propW">W</label>
<input type="number" id="propW" />
</div>
<div>
<label for="propH">H</label>
<input type="number" id="propH" />
</div>
</div>
</div>
<div class="prop-group" id="textGroup">
<label for="propText">Text</label>
<input type="text" id="propText" />
<div class="prop-row">
<div>
<label for="propTextSize">Text size (TFT)</label>
<input type="number" id="propTextSize" min="1" max="10" />
</div>
</div>
</div>
<div class="prop-group" id="fontGroup">
<label for="propFont" id="propFontLabel">Font</label>
<select id="propFont"></select>
</div>
<div class="prop-group" id="valueGroup" style="display: none">
<label for="propValue">Value / Level (0–100)</label>
<input type="number" id="propValue" min="0" max="100" />
</div>
<div class="prop-group">
<label>Colors</label>
<div class="prop-row color-row">
<div class="pill">
<input type="color" id="propFillColor" />
<span>Fill</span>
</div>
<div class="pill">
<input type="color" id="propStrokeColor" />
<span>Stroke</span>
</div>
<div class="pill">
<input type="color" id="propTextColor" />
<span>Text</span>
</div>
</div>
<div class="prop-row" id="fillTransparencyRow">
<div>
<label for="propFillAlpha">Fill Transparency</label>
<input type="range" id="propFillAlpha" min="0" max="255" value="255" />
<span id="fillAlphaValue">100%</span>
</div>
</div>
<div class="prop-row" id="oledFillRow" style="display: none;">
<div class="fill-control">
<input type="checkbox" id="propOLEDFill" checked />
<label for="propOLEDFill" class="fill-label">
<span class="fill-indicator"></span>
Filled
</label>
</div>
</div>
</div>
<div class="prop-group" id="actionGroup" style="display:none;">
<label for="propAction">On click</label>
<select id="propAction">
<option value="">None</option>
<option value="goto">Go to screen…</option>
</select>
<div class="prop-row">
<div>
<label for="propActionTarget">Target screen</label>
<select id="propActionTarget"></select>
</div>
</div>
</div>
<div class="prop-group" id="iconTintGroup" style="display:none;">
<div class="fn-label-row">
<label>Icon tint</label>
<label class="toggle-label" title="Tint recolors PNG icons using their transparency (best for monochrome icons)">
<input type="checkbox" id="propIconTintEnabled" class="toggle-input" />
Enable
</label>
</div>
<div class="prop-row color-row">
<div class="pill">
<input type="color" id="propIconTintColor" value="#ffffff" />
<span>Tint</span>
</div>
</div>
<div class="mini-hint">Tip: in OLED mode, tint helps icons match the cyan display style.</div>
</div>
<div class="prop-group">
<label>Align to screen</label>
<div class="btn-group">
<button class="btn small secondary" id="alignLeftBtn">Left</button>
<button class="btn small secondary" id="alignHCenterBtn">H-Center</button>
<button class="btn small secondary" id="alignRightBtn">Right</button>
<button class="btn small secondary" id="alignTopBtn">Top</button>
<button class="btn small secondary" id="alignVCenterBtn">V-Center</button>
<button class="btn small secondary" id="alignBottomBtn">Bottom</button>
</div>
</div>
<div class="prop-group" style="display: flex; justify-content: flex-end;">
<button class="btn danger small" id="deleteElement" title="Delete element">
<svg viewBox="0 0 24 24" aria-hidden="true">
<polyline points="9,6 10,4 14,4 15,6" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" />
<rect x="7" y="6" width="10" height="12" rx="2" ry="2" stroke="currentColor" stroke-width="2" fill="none" />
<line x1="10" y1="10" x2="10" y2="14" stroke="currentColor" stroke-width="2" stroke-linecap="round" />
<line x1="14" y1="10" x2="14" y2="14" stroke="currentColor" stroke-width="2" stroke-linecap="round" />
</svg>
<span>Delete</span>
</button>
</div>
</div>
</div>
</div>
<div class="code-panel">
<div style="display: flex; justify-content: space-between; align-items: center">
<div class="section-title">Generated Code (TFT_eSPI / U8g2)</div>
<div>
<button class="btn small secondary" id="copyCode">
<svg viewBox="0 0 24 24" aria-hidden="true" style="width:14px;height:14px;margin-right:4px">
<rect x="9" y="9" width="11" height="11" rx="2" ry="2" stroke="currentColor" stroke-width="2" fill="none" />
<rect x="4" y="4" width="11" height="11" rx="2" ry="2" stroke="currentColor" stroke-width="2" fill="none" />
</svg>
<span>Copy</span>
</button>
</div>
</div>
<textarea id="codeOutput" spellcheck="false"></textarea>
</div>
</div>
</div>
<input type="file" id="imageInput" accept="image/*" style="display: none" />
<input type="file" id="importJsonInput" accept="application/json" style="display:none" />
<!-- In-app tools overlay (PixelForge / BitCanvas Studio) -->
<div class="tool-overlay" id="toolOverlay" aria-hidden="true">
<div class="tool-overlay-inner" role="dialog" aria-modal="true" aria-label="Tools">
<div class="tool-overlay-bar">
<div class="tool-overlay-title">
<span class="pill outline" id="toolOverlayPill">Tools</span>
<div class="tool-switcher" role="tablist" aria-label="Tools switcher">
<button class="tool-switch-btn" type="button" data-switch-tool="pixelforge" role="tab" aria-selected="false">
🧩 PixelForge
</button>
<button class="tool-switch-btn" type="button" data-switch-tool="bitcanvas" role="tab" aria-selected="false">
🎞️ BitCanvas
</button>
</div>
</div>
<div class="tool-overlay-actions">
<button class="btn small success" id="toolOverlayAction" type="button" style="display:none">Action</button>
<a class="btn small secondary" id="toolOverlayOpenNewTab" href="#" target="_blank" rel="noreferrer">Open in new tab</a>
<button class="btn small" id="toolOverlayClose" type="button">Back to DisplayKit</button>
</div>
</div>
<div class="tool-overlay-frames">
<iframe
id="toolFrame_pixelforge"
class="tool-overlay-frame"
title="PixelForge"
src="about:blank"
allow="clipboard-read; clipboard-write"
></iframe>
<iframe
id="toolFrame_bitcanvas"
class="tool-overlay-frame"
title="BitCanvas Studio"
src="about:blank"
allow="clipboard-read; clipboard-write"
></iframe>
</div>
</div>
</div>
<!-- Icon manifest: supports file:// usage (no fetch required) -->
<script src="icons/manifest.js"></script>
<script src="app.js"></script>
</body>
</html>