-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
210 lines (192 loc) · 12.5 KB
/
index.html
File metadata and controls
210 lines (192 loc) · 12.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>DITHER_STUDIO</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Silkscreen:wght@400;700&family=Share+Tech+Mono&display=swap" rel="stylesheet">
<link rel="stylesheet" href="style.css">
</head>
<body>
<!-- Skip navigation -->
<a class="skip-link" href="#main-content">Skip to canvas</a>
<div class="crt-overlay" aria-hidden="true"></div>
<div class="app-layout">
<aside class="sidebar" aria-label="Dither controls">
<div class="sidebar-header">
<!-- Decorative status line, not meaningful to AT -->
<div class="sys-line" aria-hidden="true">SYS:READY <span class="cursor">█</span></div>
<h1>DITHER<span class="title-blink" aria-hidden="true">_</span>STUDIO</h1>
<p class="tagline">IMAGE TRANSFORM ENGINE / v2.0</p>
</div>
<div class="controls-panel">
<!-- 01 LOAD -->
<section class="control-section">
<h2><span class="sec-num" aria-hidden="true">01/</span>LOAD</h2>
<div class="control-group">
<label class="file-upload-btn">
<span aria-hidden="true">▶</span> OPEN FILE
<input type="file" id="imageUpload" accept="image/*,video/*">
</label>
<button id="randomize" class="randomize-btn"><span aria-hidden="true">⟳</span> RANDOMIZE</button>
</div>
</section>
<!-- 02 ALGORITHM -->
<section class="control-section">
<h2 id="algoHeading"><span class="sec-num" aria-hidden="true">02/</span>ALGORITHM</h2>
<div class="control-group algo-grid" role="group" aria-labelledby="algoHeading">
<label><input type="radio" name="algorithm" value="none" checked><span>NONE</span></label>
<label><input type="radio" name="algorithm" value="threshold"><span>THRESHOLD</span></label>
<label><input type="radio" name="algorithm" value="bayer2"><span>BAYER 2×2</span></label>
<label><input type="radio" name="algorithm" value="bayer4"><span>BAYER 4×4</span></label>
<label><input type="radio" name="algorithm" value="bayer8"><span>BAYER 8×8</span></label>
<label><input type="radio" name="algorithm" value="clusteredDot"><span>CLUST.DOT</span></label>
<label><input type="radio" name="algorithm" value="halftone"><span>HALFTONE</span></label>
<label><input type="radio" name="algorithm" value="blueNoise"><span>BLUE NOISE</span></label>
<label><input type="radio" name="algorithm" value="random"><span>RANDOM</span></label>
<label><input type="radio" name="algorithm" value="pattern"><span>PATTERN</span></label>
<label><input type="radio" name="algorithm" value="crosshatch"><span>CROSSHATCH</span></label>
<label><input type="radio" name="algorithm" value="riemersma"><span>RIEMERSMA</span></label>
<label><input type="radio" name="algorithm" value="variableError"><span>VAR.ERROR</span></label>
<label><input type="radio" name="algorithm" value="dotDiffusion"><span>DOT DIFFUSE</span></label>
<label><input type="radio" name="algorithm" value="floydSteinberg"><span>FLOYD-STBG</span></label>
<label><input type="radio" name="algorithm" value="atkinson"><span>ATKINSON</span></label>
<label><input type="radio" name="algorithm" value="jarvisJudiceNinke"><span>JARVIS-JJN</span></label>
<label><input type="radio" name="algorithm" value="stucki"><span>STUCKI</span></label>
</div>
</section>
<!-- 03 PALETTE -->
<section class="control-section">
<h2 id="paletteHeading"><span class="sec-num" aria-hidden="true">03/</span>PALETTE</h2>
<div class="control-group" role="group" aria-labelledby="paletteHeading">
<label><input type="radio" name="palette" value="bw" checked><span>BLACK + WHITE</span></label>
<label><input type="radio" name="palette" value="grayscale4"><span>GRAY ×4</span></label>
<label><input type="radio" name="palette" value="grayscale8"><span>GRAY ×8</span></label>
<label><input type="radio" name="palette" value="grayscale16"><span>GRAY ×16</span></label>
<label><input type="radio" name="palette" value="cga_cyan_magenta"><span>CGA CYAN/MAG</span></label>
<label><input type="radio" name="palette" value="cga_red_green"><span>CGA RED/GRN</span></label>
<label><input type="radio" name="palette" value="cga_cyan_red"><span>CGA CYAN/RED</span></label>
<label><input type="radio" name="palette" value="ega"><span>EGA ×16</span></label>
<label><input type="radio" name="palette" value="gameboy"><span>GAME BOY</span></label>
<label><input type="radio" name="palette" value="monoColor"><span>MONO COLOR</span></label>
<label><input type="radio" name="palette" value="custom"><span>CUSTOM</span></label>
</div>
<div id="monoColorGroup" style="display: none;">
<div class="mono-color-picker">
<div class="slider-row">
<span>BASE COLOR</span>
<span id="monoColorHex">#22AA44</span>
</div>
<input type="color" id="monoColor" value="#22AA44">
</div>
</div>
<div id="colorCountGroup" style="display: none;">
<div class="slider-group">
<div class="slider-row">
<span id="colorCountLabel">COLORS</span>
<span id="colorCountValue">8</span>
</div>
<input type="range" id="colorCount" min="2" max="256" value="8" step="1"
aria-labelledby="colorCountLabel">
</div>
</div>
</section>
<!-- 04 SETTINGS -->
<section class="control-section">
<h2><span class="sec-num" aria-hidden="true">04/</span>SETTINGS</h2>
<div class="slider-group">
<div class="slider-row">
<span id="ditherScaleLabel">DITHER SCALE</span>
<span id="ditherScaleValue">1</span>
</div>
<input type="range" id="ditherScale" min="1" max="8" value="1" step="1"
aria-labelledby="ditherScaleLabel">
</div>
<div class="control-group" style="margin-top: 12px;">
<label class="checkbox-label">
<input type="checkbox" id="pixelate">
<span>PIXELATE</span>
</label>
<div id="pixelSizeGroup" style="display: none;">
<div class="slider-group nested-slider">
<div class="slider-row">
<span id="pixelSizeLabel">PIXEL SIZE</span>
<span id="pixelSizeValue">4</span>
</div>
<input type="range" id="pixelSize" min="1" max="16" value="4" step="1"
aria-labelledby="pixelSizeLabel">
</div>
</div>
</div>
<div class="slider-group" style="margin-top: 12px;">
<div class="slider-row">
<span id="brightnessLabel">BRIGHTNESS</span>
<span id="brightnessValue">0</span>
</div>
<input type="range" id="brightness" min="-100" max="100" value="0" step="1"
aria-labelledby="brightnessLabel">
</div>
<div class="slider-group" style="margin-top: 10px;">
<div class="slider-row">
<span id="contrastLabel">CONTRAST</span>
<span id="contrastValue">0</span>
</div>
<input type="range" id="contrast" min="-100" max="100" value="0" step="1"
aria-labelledby="contrastLabel">
</div>
</section>
<!-- 05 EXPORT -->
<section class="control-section">
<h2><span class="sec-num" aria-hidden="true">05/</span>EXPORT</h2>
<div class="format-options" role="group" aria-label="Export format">
<label><input type="radio" name="format" value="png" checked><span>PNG</span></label>
<label><input type="radio" name="format" value="jpeg"><span>JPG</span></label>
<label><input type="radio" name="format" value="webp"><span>WEBP</span></label>
</div>
<div id="qualityGroup" style="display: none;">
<div class="slider-group">
<div class="slider-row">
<span id="qualityLabel">QUALITY</span>
<span id="qualityValue">90</span>
</div>
<input type="range" id="quality" min="1" max="100" value="90" step="1"
aria-labelledby="qualityLabel">
</div>
</div>
<div class="action-btns">
<button id="downloadBtn" class="download-btn"><span aria-hidden="true">▼</span> EXPORT IMAGE</button>
<button id="resetBtn" class="reset-btn"><span aria-hidden="true">↺</span> RESET ALL</button>
</div>
</section>
</div>
</aside>
<main class="main-content" id="main-content" tabindex="-1">
<div class="canvas-panel">
<div class="canvas-container">
<canvas id="canvas" role="img" aria-label="Dithered image output"></canvas>
<!-- Dropzone is a drag-drop affordance; keyboard users use the OPEN FILE button -->
<div id="dropzone" class="dropzone" aria-hidden="true">
<div class="dropzone-inner">
<div class="drop-hex" aria-hidden="true">⬡</div>
<div class="drop-title">DROP IMAGE</div>
<div class="drop-hint">IMAGE OR VIDEO / OPEN FROM SIDEBAR</div>
</div>
</div>
</div>
<div class="video-controls hidden" id="videoControls" role="group" aria-label="Video playback controls">
<button id="playPauseBtn" class="play-btn" aria-label="Play">▶ PLAY</button>
<span class="time-display" id="currentTime" aria-hidden="true">0:00</span>
<input type="range" id="videoScrubber" min="0" max="100" value="0" step="0.01"
aria-label="Video position">
<span class="time-display" id="totalTime" aria-hidden="true">0:00</span>
<button id="recordBtn" class="record-btn" aria-label="Start recording"><span aria-hidden="true">⏺</span> REC</button>
</div>
<div class="image-info" id="imageInfo" role="status" aria-live="polite" aria-atomic="true"></div>
</div>
</main>
</div>
<script src="dither.js"></script>
</body>
</html>