-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
227 lines (208 loc) · 14.8 KB
/
index.html
File metadata and controls
227 lines (208 loc) · 14.8 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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="stylesheet" href="/src/styles.css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>bitcrush</title>
<script type="module" src="/src/main.ts" defer></script>
</head>
<body class="terminal">
<header class="app-header" data-tauri-drag-region>
<div class="header-inner" data-tauri-drag-region></div>
</header>
<main class="max-w-[1280px] mx-auto pt-2">
<div class="px-4 py-1 flex items-center justify-between">
<img src="/src/assets/bitcrush.png" alt="Bitcrush" class="h-6 no-drag" />
<nav class="no-drag" aria-label="Pages">
<a href="#/pixelizer" class="px-2 text-[var(--color-font)] hover:underline">Pixelizer</a>
<a href="#/filters" class="px-2 text-[var(--color-font)] hover:underline">Filters</a>
</nav>
</div>
<section data-route="pixelizer" class="grid grid-cols-1 gap-3 p-3 md:[grid-template-columns:520px_1fr] items-stretch">
<div class="controls grid grid-cols-1 md:grid-cols-2 gap-3">
<div class="bg-[var(--color-surface)] border border-[var(--color-border)] p-3 rounded-[16px] md:col-span-2">
<label>Source Image</label>
<div id="dropzone" class="bg-[var(--color-surface)] border border-[var(--color-border)] p-3 cursor-pointer rounded-[12px]">
<img id="thumb" alt="Selected" style="display:none;width:80px;height:80px;object-fit:cover" />
<div id="dropHint" class="text-[var(--color-secondary)]">Drop image here or click to select</div>
<input id="file" type="file" accept="image/*" style="display:none" />
</div>
</div>
<div class="bg-[var(--color-surface)] border border-[var(--color-border)] p-3 rounded-[16px]">
<label>Palette</label>
<select id="palette" class="w-full shadow-none drop-shadow-none appearance-none bg-[var(--color-surface)] border border-[var(--color-border)] text-[var(--color-font)] focus:outline-none focus:ring-0 [box-shadow:none] px-2 py-2 rounded-[12px]"></select>
</div>
<div class="bg-[var(--color-surface)] border border-[var(--color-border)] p-3 rounded-[16px]">
<label>Algorithm</label>
<select id="algorithm" class="w-full shadow-none drop-shadow-none appearance-none bg-[var(--color-surface)] border border-[var(--color-border)] text-[var(--color-font)] focus:outline-none focus:ring-0 [box-shadow:none] px-2 py-2 rounded-[12px]">
<option>Standard</option>
<option>Enhanced</option>
<option>Artistic</option>
<option>Floyd-Steinberg</option>
<option>Bayer</option>
<option>Bayer 2x2</option>
<option>Bayer 8x8</option>
<option>Selective</option>
<option>Ordered Selective</option>
<option>Dual Color Dithering</option>
<option>Edge Dithering</option>
<option>Randomized Selective</option>
<option>Stucki</option>
<option>Atkinson</option>
<option>Jarvis-Judice-Ninke</option>
<option>Burkes</option>
<option>Sierra</option>
<option>Two-Row Sierra</option>
<option>Sierra Lite</option>
</select>
</div>
<div class="bg-[var(--color-surface)] border border-[var(--color-border)] p-3 rounded-[16px]">
<label id="toneLabel" class="text-[var(--color-secondary)]">Gamma: 1.00</label>
<input id="tone" type="range" min="0.4" max="2.2" step="0.05" value="1.0" class="w-full" />
</div>
<div class="bg-[var(--color-surface)] border border-[var(--color-border)] p-3 rounded-[16px]">
<label id="preContrastLabel" class="text-[var(--color-secondary)]">Contrast: 1.00</label>
<input id="preContrast" type="range" min="0.5" max="2.0" step="0.05" value="1.0" class="w-full" />
</div>
<div class="bg-[var(--color-surface)] border border-[var(--color-border)] p-3 rounded-[16px]">
<label id="preSaturationLabel" class="text-[var(--color-secondary)]">Saturation: 1.00</label>
<input id="preSaturation" type="range" min="0.0" max="2.0" step="0.05" value="1.0" class="w-full" />
</div>
<div class="bg-[var(--color-surface)] border border-[var(--color-border)] p-3 rounded-[16px]">
<label id="preHueLabel" class="text-[var(--color-secondary)]">Hue: 0°</label>
<input id="preHue" type="range" min="-180" max="180" step="1" value="0" class="w-full" />
</div>
<div class="bg-[var(--color-surface)] border border-[var(--color-border)] p-3 rounded-[16px]">
<label id="denoiseLabel" class="text-[var(--color-secondary)]">Sigma: 0.0</label>
<input id="denoise" type="range" min="0" max="3" step="0.1" value="0" class="w-full" />
</div>
<div class="bg-[var(--color-surface)] border border-[var(--color-border)] p-3 rounded-[16px]">
<label>Grid</label>
<select id="grid" class="w-full shadow-none drop-shadow-none appearance-none bg-[var(--color-surface)] border border-[var(--color-border)] text-[var(--color-font)] focus:outline-none focus:ring-0 [box-shadow:none] px-2 py-2 rounded-[12px]">
<option value="8">8×8</option>
<option value="16">16×16</option>
<option value="32" selected>32×32</option>
<option value="64">64×64</option>
<option value="96x96">96×96</option>
<option value="128">128×128</option>
<option value="192x192">192×192</option>
<option value="224x192">224×192</option>
<option value="256x192">256×192</option>
<option value="256">256×256</option>
<option value="288x192">288×192</option>
<option value="288x288">288×288</option>
<option value="144x256">144×256</option>
<option value="216x384">216×384</option>
<option value="270x480">270×480</option>
<option value="384x192">384×192</option>
<option value="384x288">384×288</option>
<option value="384">384×384</option>
<option value="480">480×480</option>
<option value="480x360">480×360</option>
<option value="480x270">480×270</option>
<option value="640">640×640</option>
</select>
</div>
<div class="bg-[var(--color-surface)] border border-[var(--color-border)] p-3 rounded-[16px]">
<label>Palette Options</label>
<div class="grid grid-cols-1 gap-2">
<label class="inline-flex items-center gap-2">
<input id="optAddBlack" type="checkbox" class="accent-[var(--color-primary)]" />
<span>Add black to palette</span>
</label>
<label class="inline-flex items-center gap-2">
<input id="optAddWhite" type="checkbox" class="accent-[var(--color-primary)]" />
<span>Add white to palette</span>
</label>
</div>
</div>
<div class="bg-[var(--color-surface)] border border-[var(--color-border)] p-3 rounded-[16px]">
<label>Color Options</label>
<div class="grid grid-cols-1 gap-2">
<label class="inline-flex items-center gap-2">
<input id="optInvert" type="checkbox" class="accent-[var(--color-primary)]" />
<span>Invert colors</span>
</label>
<label class="inline-flex items-center gap-2">
<input id="optNightVision" type="checkbox" class="accent-[var(--color-primary)]" />
<span>Night vision (pre-filter)</span>
</label>
</div>
</div>
<div class="bg-[var(--color-surface)] border border-[var(--color-border)] p-3 rounded-[16px] md:col-span-2">
<label>Preview PNG Export</label>
<div class="grid grid-cols-1 md:grid-cols-3 gap-3">
<div>
<label class="text-[var(--color-secondary)]">Scale (integer)</label>
<select id="exportScale" class="w-full shadow-none drop-shadow-none appearance-none bg-[var(--color-surface)] border border-[var(--color-border)] text-[var(--color-font)] focus:outline-none focus:ring-0 [box-shadow:none] px-2 py-2 rounded-[12px]">
<option value="1">1×</option>
<option value="2" selected>2×</option>
<option value="3">3×</option>
<option value="4">4×</option>
</select>
</div>
<div>
<label class="text-[var(--color-secondary)]">Filter</label>
<select id="exportFilter" class="w-full shadow-none drop-shadow-none appearance-none bg-[var(--color-surface)] border border-[var(--color-border)] text-[var(--color-font)] focus:outline-none focus:ring-0 [box-shadow:none] px-2 py-2 rounded-[12px]">
<option value="nearest" selected>Nearest (crisp)</option>
<option value="triangle">Triangle (slight soften)</option>
<option value="catmullrom">Catmull-Rom (smooth)</option>
</select>
</div>
<div class="grid grid-cols-1 gap-2">
<label class="inline-flex items-center gap-2 mt-6">
<input id="exportClamp" type="checkbox" class="accent-[var(--color-primary)]" checked />
<span>Clamp to 2000px max</span>
</label>
</div>
</div>
<div class="text-[var(--color-secondary)] mt-2">These settings only affect the downloaded Preview PNG, not the on-screen preview or Base PNG.</div>
</div>
</div>
<div class="preview">
<div id="preview" class="bg-[var(--color-surface)] border border-[var(--color-border)] w-full h-full max-w-[1000px] max-h-[1000px] flex items-center justify-center rounded-[16px]">
<img id="output" alt="Preview" style="display:none;max-width:100%;max-height:100%;image-rendering:pixelated;object-fit:contain" />
<div id="outputEmpty" class="text-[var(--color-secondary)]" style="display:none"></div>
</div>
</div>
<div class="col-span-full flex gap-2 flex-wrap mt-2">
<button id="generate" class="relative inline-flex items-center justify-center select-none border px-[14px] py-[10px] font-semibold text-[0.95rem] leading-none min-h-[36px] [letter-spacing:0.02em] bg-[var(--button-primary-bg)] text-[var(--button-primary-fg)] border-transparent focus-visible:outline-2 focus-visible:outline-[var(--color-primary)] focus-visible:outline-offset-2 disabled:opacity-50 disabled:cursor-not-allowed hover:[filter:brightness(1.05)] active:translate-y-px [&.is-pressed]:translate-y-px rounded-full">Pixelate</button>
<button id="download-upscaled" class="relative inline-flex items-center justify-center select-none border px-[14px] py-[10px] font-semibold text-[0.95rem] leading-none min-h-[36px] [letter-spacing:0.02em] bg-[var(--button-bg)] text-[var(--button-fg)] border-[var(--button-border)] focus-visible:outline-2 focus-visible:outline-[var(--color-primary)] focus-visible:outline-offset-2 disabled:opacity-50 disabled:cursor-not-allowed hover:[box-shadow:inset_0_0_0_1px_var(--color-border)] active:translate-y-px [&.is-pressed]:translate-y-px rounded-full" disabled>Download Preview PNG</button>
<button id="download-base" class="relative inline-flex items-center justify-center select-none border px-[14px] py-[10px] font-semibold text-[0.95rem] leading-none min-h-[36px] [letter-spacing:0.02em] bg-[var(--button-bg)] text-[var(--button-fg)] border-[var(--button-border)] focus-visible:outline-2 focus-visible:outline-[var(--color-primary)] focus-visible:outline-offset-2 disabled:opacity-50 disabled:cursor-not-allowed hover:[box-shadow:inset_0_0_0_1px_var(--color-border)] active:translate-y-px [&.is-pressed]:translate-y-px rounded-full" disabled>Download Base PNG</button>
</div>
</section>
<section data-route="filters" class="p-3" style="display:none">
<div class="grid grid-cols-1 gap-3 md:[grid-template-columns:520px_1fr] items-stretch">
<div class="bg-[var(--color-surface)] p-3 rounded-[16px]">
<label>Source Image</label>
<div id="filters-dropzone" class="bg-[var(--color-surface)] border border-[var(--color-border)] p-3 cursor-pointer rounded-[12px]">
<img id="filters-thumb" alt="Selected" style="display:none;width:80px;height:80px;object-fit:cover" />
<div id="filters-dropHint" class="text-[var(--color-secondary)]">Drop image here or click to select</div>
<input id="filters-file" type="file" accept="image/*" style="display:none" />
</div>
</div>
<div class="bg-[var(--color-surface)] border border-[var(--color-border)] p-3 rounded-[16px]">
<label>Filter</label>
<select id="filters-kind" class="w-full shadow-none drop-shadow-none appearance-none bg-[var(--color-surface)] border border-[var(--color-border)] text-[var(--color-font)] focus:outline-none focus:ring-0 [box-shadow:none] px-2 py-2 rounded-[12px]">
<option value="VHS 1" selected>VHS 1</option>
<option value="VHS 2">VHS 2</option>
<option value="VHS 3">VHS 3</option>
<option value="VHS 4">VHS 4</option>
<option value="VHS 5">VHS 5</option>
<option value="VHS 6">VHS 6</option>
<option value="VHS 7">VHS 7</option>
</select>
</div>
<div class="bg-[var(--color-surface)] border border-[var(--color-border)] w-full h-full max-w-[1000px] max-h-[1000px] flex items-start justify-start rounded-[16px]">
<img id="filters-output" alt="Preview" style="display:none;max-width:100%;max-height:100%;image-rendering:pixelated;object-fit:contain" />
<div id="filters-outputEmpty" class="text-[var(--color-secondary)]" style="display:none"></div>
</div>
<div class="col-span-full flex gap-2 flex-wrap mt-2">
<button id="filters-generate" class="relative inline-flex items-center justify-center select-none border px-[14px] py-[10px] font-semibold text-[0.95rem] leading-none min-h-[36px] [letter-spacing:0.02em] bg-[var(--button-primary-bg)] text-[var(--button-primary-fg)] border-transparent focus-visible:outline-2 focus-visible:outline-[var(--color-primary)] focus-visible:outline-offset-2 disabled:opacity-50 disabled:cursor-not-allowed hover:[filter:brightness(1.05)] active:translate-y-px [&.is-pressed]:translate-y-px rounded-full">Render</button>
</div>
</div>
</section>
</main>
</body>
</html>