-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoptions.html
More file actions
305 lines (269 loc) · 7.5 KB
/
options.html
File metadata and controls
305 lines (269 loc) · 7.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Color Contrast Analyzer Options</title>
<style>
body {
padding: 20px;
font-family: system-ui, -apple-system, sans-serif;
max-width: 600px;
margin: 0 auto;
background-color: #f5f5f5;
line-height: 1.6;
}
input[type="radio"] {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
width: 2rem;
height: 2rem;
border: 2px solid #ccc;
cursor: pointer;
vertical-align: middle;
}
input[type="checkbox"] {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
width: 3rem;
height: 2rem;
border: 2px solid #ccc;
cursor: pointer;
vertical-align: middle;
}
input[type="radio"] {
border-radius: 50%;
}
input[type="checkbox"] {
border-radius: 4px;
}
input[type="radio"]:checked {
background-color: #007cba;
border-color: #007cba;
}
input[type="checkbox"]:checked {
background-color: #007cba;
border-color: #007cba;
}
/* input[type="radio"]:checked::after {
content: '';
display: block;
width: 2rem;
height: 2rem;
background-color: white;
border-radius: 50%;
margin: 0.25rem auto;
} */
input[type="checkbox"]:checked::after {
content: '✓';
display: block;
color: white;
font-size: 2rem;
text-align: center;
line-height: 2rem;
}
.container {
background-color: white;
padding: 30px;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.logo {
display: flex;
align-items: center;
gap: 12px;
margin-bottom: 24px;
}
.logo-icon {
width: 32px;
height: 32px;
}
h1 {
color: #2c3e50;
margin: 0;
font-size: 1.5rem;
}
.section {
margin-bottom: 24px;
}
.section-title {
font-weight: 600;
font-size: 1rem;
color: #2c3e50;
}
.option {
margin: 8px 0;
display: flex;
align-items: center;
font-size: 1rem;
gap: 8px;
}
label {
color: #34495e;
font-size: 1rem;
cursor: pointer;
}
select {
padding: 6px;
border-radius: 4px;
font-size: 1rem;
border: 1px solid #ddd;
}
.button-container {
margin-top: 24px;
display: flex;
justify-content: flex-end;
gap: 12px;
}
button {
background-color: white;
color: black;
border: 1px solid orange;
padding: 8px 16px;
border-radius: 4px;
font-size: 1rem;
cursor: pointer;
transition: all 0.2s;
box-shadow: 0 2px 4px rgba(255, 165, 0, 0.2);
}
button:hover {
transform: translateY(-1px);
box-shadow: 0 4px 8px rgba(255, 165, 0, 0.3);
}
.status {
display: none;
color: #27ae60;
margin-right: 12px;
align-items: center;
font-size: 1rem;
}
.status.show {
display: flex;
}
.webgl-status {
font-size: 1rem;
margin-top: 4px;
padding: 4px 8px;
border-radius: 4px;
display: inline-block;
}
.webgl-status.available {
background-color: #e8f5e8;
color: #2d5a2d;
border: 1px solid #c3e6c3;
}
.webgl-status.unavailable {
background-color: #fef2f2;
color: #7f1d1d;
border: 1px solid #fecaca;
}
.capture-mode-info {
margin-top: 12px;
padding: 12px;
background-color: #f8f9fa;
border-radius: 6px;
border: 1px solid #e9ecef;
font-size: 1rem;
line-height: 1.4;
}
.capture-mode-info p {
margin: 0 0 8px 0;
color: #495057;
}
.capture-mode-info p:last-child {
margin-bottom: 0;
}
.capture-mode-info strong {
color: #212529;
}
@media (max-width: 600px) {
.container {
padding: 20px;
}
.button-container {
flex-direction: column;
align-items: flex-start;
gap: 10px;
}
}
</style>
</head>
<body>
<div class="container">
<div class="logo">
<h1>Color Contrast Analyzer Options</h1>
</div>
<div class="section">
<fieldset>
<legend class="section-title">WCAG Level:</legend>
<div class="option">
<input type="radio" id="aa-small" name="wcagLevel" value="WCAG-aa-small">
<label for="aa-small">Level AA, Small Non-Bold Text (4.5:1)</label>
</div>
<div class="option">
<input type="radio" id="aa-large" name="wcagLevel" value="WCAG-aa-large">
<label for="aa-large">Level AA, Medium Bold and Large Non-Bold Text (3:1)</label>
</div>
<div class="option">
<input type="radio" id="aaa-small" name="wcagLevel" value="WCAG-aaa-small">
<label for="aaa-small">Level AAA, Small Non-Bold Text (7:1)</label>
</div>
<div class="option">
<input type="radio" id="aaa-large" name="wcagLevel" value="WCAG-aaa-large">
<label for="aaa-large">Level AAA, Medium Bold and Large Non-Bold Text (4.5:1)</label>
</div>
</fieldset>
</div>
<div class="section">
<label for="pixelRadius" class="section-title">Pixel Radius Scan:</label>
<div class="option">
<select id="pixelRadius" aria-label="Pixel Radius">
<option value="1">1 pixel</option>
<option value="2">2 pixels</option>
<option value="3">3 pixels</option>
</select>
</div>
</div>
<div class="section">
<fieldset>
<legend class="section-title">Performance Settings:</legend>
<div class="option">
<input type="checkbox" id="useWebGL" name="useWebGL">
<label for="useWebGL">Use GPU acceleration (WebGL) when available</label>
<div id="webglStatus" class="webgl-status"></div>
</div>
</fieldset>
</div>
<div class="section">
<fieldset>
<legend class="section-title">Capture Mode:</legend>
<div class="option">
<input type="radio" id="hardwarePixels" name="captureMode" value="hardware">
<label for="hardwarePixels">Hardware Pixels (actual visual appearance with scaling)</label>
</div>
<div class="option">
<input type="radio" id="cssPixels" name="captureMode" value="css">
<label for="cssPixels">CSS Pixels (design intent without hardware scaling)</label>
</div>
<div class="capture-mode-info">
<p><strong>Hardware Pixels:</strong> Captures what users actually see, including antialiasing, scaling artifacts, and visual effects.</p>
<p><strong>CSS Pixels:</strong> Captures design intent colors without hardware rendering effects, useful for validating CSS contrast ratios.</p>
</div>
</fieldset>
</div>
<div class="button-container">
<div id="status" class="status" aria-live="polite">
<svg viewBox="0 0 24 24" width="16" height="16" style="margin-right: 4px;">
<path fill="currentColor" d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"/>
</svg>
Settings saved!
</div>
<button id="save" class="button">Save</button>
<button id="close" class="button">Close</button>
</div>
</div>
<script src="options.js"></script>
</body>
</html>