-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcapture.html
More file actions
259 lines (226 loc) · 7.18 KB
/
capture.html
File metadata and controls
259 lines (226 loc) · 7.18 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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Color Contrast Analysis</title>
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
margin: 0;
padding: 16px;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
background-color: #0f0f0f;
color: #ffffff;
min-height: 100vh;
}
.container {
display: flex;
flex-direction: column;
gap: 16px;
min-height: calc(100vh - 32px);
}
#toolbar {
background: rgba(255, 255, 255, 0.08);
padding: 12px;
border-radius: 12px;
backdrop-filter: blur(10px);
display: flex;
flex-direction: row;
flex-wrap: wrap;
gap: 12px;
border: 1px solid rgba(255, 255, 255, 0.1);
width: 100%;
height: fit-content;
flex-shrink: 0;
position: sticky;
top: 16px;
z-index: 10;
}
input[type="radio"], input[type="checkbox"] {
width: 1.25rem;
height: 1.25rem;
}
.button {
padding: 6px 16px;
cursor: pointer;
color: black;
border: 1px solid orange;
background: white;
border-radius: 6px;
font-weight: 500;
font-size: 1rem;
transition: all 0.2s ease;
display: flex;
align-items: center;
justify-content: center;
height: 2 rem;
min-width: 120px;
flex-shrink: 0;
}
.button:hover {
transform: translateY(-1px);
box-shadow: 0 2px 8px rgba(0,0,0,0.2);
opacity: 0.9;
}
.button:active {
transform: translateY(0);
}
.select-group {
display: flex;
flex-direction: column;
gap: 3px;
min-width: 160px;
flex: 1;
position: relative;
}
label {
font-size: 1rem;
font-weight: 500;
color: rgba(255, 255, 255, 0.7);
text-transform: uppercase;
}
select {
padding: 6px 10px;
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 6px;
font-size: 1rem;
background-color: rgba(255, 255, 255, 0.05);
color: white;
cursor: pointer;
appearance: none;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23fff' viewBox='0 0 16 16'%3E%3Cpath d='M8 10.5l-4-4h8l-4 4z'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 8px center;
padding-right: 28px;
height: 2 rem;
width: 100%;
}
select option {
background-color: #1f1f1f;
color: white;
padding: 6px;
font-size: 1rem;
}
select:focus {
border-color: rgba(255, 255, 255, 0.3);
background-color: rgba(255, 255, 255, 0.15);
}
select option:hover {
background-color: #2f2f2f;
}
.checkbox-group {
display: flex;
flex-direction: column;
gap: 3px;
min-width: 140px;
flex: 0;
position: relative;
}
.checkbox-group label {
font-size: 1rem;
font-weight: 500;
color: rgba(255, 255, 255, 0.7);
text-transform: uppercase;
display: flex;
align-items: center;
gap: 6px;
cursor: pointer;
}
.webgl-checkbox {
width: 1.75rem;
height: 1.75rem;
cursor: pointer;
}
.webgl-status-small {
font-size: 1rem;
color: rgba(255, 255, 255, 0.6);
line-height: 1.5;
}
.webgl-status-small.available {
color: #4ade80;
}
.webgl-status-small.unavailable {
color: #f87171;
}
.image-container {
position: relative;
width: 100%;
min-width: 0;
}
#analysisCanvas {
position: absolute;
top: 0;
left: 0;
z-index: 2;
}
#capturedImage {
box-shadow: 0 4px 20px rgba(0,0,0,0.2);
z-index: 1;
display: block;
max-width: 100%;
height: auto;
}
#maskButton {
background: white;
box-shadow: 0 2px 4px rgba(255, 165, 0, 0.2);
}
#rescanButton {
background: white;
box-shadow: 0 2px 4px rgba(255, 165, 0, 0.2);
}
#downloadButton {
background: white;
box-shadow: 0 2px 4px rgba(255, 165, 0, 0.2);
}
@media (max-width: 768px) {
.select-group {
min-width: calc(50% - 8px);
}
.button {
min-width: calc(33.33% - 11px);
}
}
</style>
</head>
<body>
<div class="container">
<div id="toolbar">
<div class="select-group">
<label for="levelEvaluated-options">WCAG Level Evaluated</label>
<select id="levelEvaluated-options">
<option value="WCAG-aa-small">Level AA, Small Non-Bold Text (4.5:1)</option>
<option value="WCAG-aa-large">Level AA, Large Text (3:1)</option>
<option value="WCAG-aaa-small">Level AAA, Small Non-Bold Text (7:1)</option>
<option value="WCAG-aaa-large">Level AAA, Large Text (4.5:1)</option>
</select>
</div>
<div class="select-group">
<label for="pixelRadius-options">Pixel Radius</label>
<select id="pixelRadius-options">
<option value="1">1 pixel</option>
<option value="2">2 pixels</option>
<option value="3">3 pixels</option>
</select>
</div>
<div class="checkbox-group">
<label for="useWebGL-options">
<input type="checkbox" id="useWebGL-options" class="webgl-checkbox">
GPU Acceleration
</label>
<div id="webglStatusToolbar" class="webgl-status-small"></div>
</div>
<button id="maskButton" class="button">Hide Mask</button>
<button id="rescanButton" class="button">Rescan</button>
<button id="downloadButton" class="button">Download</button>
</div>
<div class="image-container">
<canvas id="analysisCanvas"></canvas>
<img id="capturedImage" alt="Captured content">
</div>
</div>
<script src="capture.js"></script>
</body>
</html>