-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpopup.html
More file actions
391 lines (364 loc) · 20.5 KB
/
Copy pathpopup.html
File metadata and controls
391 lines (364 loc) · 20.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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>InclusiveRead</title>
<link rel="stylesheet" href="popup.css">
<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=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
</head>
<body>
<!-- Onboarding Tour -->
<div class="tour-overlay" id="tourOverlay"></div>
<div class="tour-spotlight" id="tourSpotlight" style="display: none;"></div>
<div class="tour-arrow" id="tourArrow" style="display: none;">
<svg viewBox="0 0 60 60" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M45 15C35 20 25 35 20 50" stroke="currentColor" stroke-width="3" stroke-linecap="round" />
<path d="M15 42L20 50L28 45" stroke="currentColor" stroke-width="3" stroke-linecap="round"
stroke-linejoin="round" />
</svg>
</div>
<div class="tour-tooltip" id="tourTooltip" style="display: none;"></div>
<div class="container">
<header>
<div class="logo">
<div class="logo-icon">
<img src="icons/favicon.ico" alt="InclusiveRead Logo">
</div>
<h1>InclusiveRead</h1>
</div>
<p class="tagline">Your Cognitive Bridge</p>
</header>
<!-- Theme & Size Controls -->
<div class="controls-bar">
<div class="theme-toggle" id="themeToggle">
<div class="theme-toggle-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="theme-icon-dark">
<circle cx="12" cy="12" r="5" />
<line x1="12" y1="1" x2="12" y2="3" />
<line x1="12" y1="21" x2="12" y2="23" />
<line x1="4.22" y1="4.22" x2="5.64" y2="5.64" />
<line x1="18.36" y1="18.36" x2="19.78" y2="19.78" />
<line x1="1" y1="12" x2="3" y2="12" />
<line x1="21" y1="12" x2="23" y2="12" />
<line x1="4.22" y1="19.78" x2="5.64" y2="18.36" />
<line x1="18.36" y1="5.64" x2="19.78" y2="4.22" />
</svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="theme-icon-light"
style="display: none;">
<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" />
</svg>
</div>
<span id="themeLabel">Light</span>
</div>
<div class="size-controls">
<button class="size-btn" data-size="compact">S</button>
<button class="size-btn active" data-size="normal">M</button>
<button class="size-btn" data-size="expanded">L</button>
</div>
</div>
<main>
<!-- Feature Toggles -->
<section class="features">
<div class="feature-card">
<div class="feature-header">
<div class="feature-info">
<div class="feature-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="1.5" stroke-linecap="round"
stroke-linejoin="round">
<path d="M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20" />
<path d="M8 7h6" />
<path d="M8 11h8" />
</svg>
</div>
<div>
<h3>Jargon Decoder</h3>
<p>Simplify complex legal terms</p>
</div>
</div>
<label class="toggle">
<input type="checkbox" id="jargonToggle">
<span class="slider"></span>
</label>
</div>
</div>
<div class="feature-card">
<div class="feature-header">
<div class="feature-info">
<div class="feature-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="1.5" stroke-linecap="round"
stroke-linejoin="round">
<path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10" />
<path d="m9 12 2 2 4-4" />
</svg>
</div>
<div>
<h3>Sensory Shield</h3>
<p>Freeze distracting animations</p>
</div>
</div>
<label class="toggle">
<input type="checkbox" id="sensoryToggle">
<span class="slider"></span>
</label>
</div>
</div>
<div class="feature-card">
<div class="feature-header">
<div class="feature-info">
<div class="feature-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="1.5" stroke-linecap="round"
stroke-linejoin="round">
<path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z" />
<path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z" />
</svg>
</div>
<div>
<h3>Dyslexia Reading Mode</h3>
<p>Optimized fonts & spacing</p>
</div>
</div>
<label class="toggle">
<input type="checkbox" id="dyslexiaToggle">
<span class="slider"></span>
</label>
</div>
<div class="feature-options" id="dyslexiaOptions" style="display: none;">
<div class="option-group">
<label class="option-label">
<span>Font Style</span>
<select id="dyslexiaFont">
<option value="opendyslexic">OpenDyslexic</option>
<option value="arial">Arial</option>
<option value="comic">Comic Sans</option>
</select>
</label>
</div>
<div class="option-group">
<label class="option-label">
<span>Letter Spacing</span>
<input type="range" id="letterSpacing" min="0" max="5" value="1" step="0.5">
<span class="range-value" id="letterSpacingValue">Normal</span>
</label>
</div>
<div class="option-group">
<label class="option-label">
<span>Line Height</span>
<input type="range" id="lineHeight" min="1" max="3" value="1.6" step="0.1">
<span class="range-value" id="lineHeightValue">1.6</span>
</label>
</div>
<div class="option-group">
<label class="option-label">
<span>Word Spacing</span>
<input type="range" id="wordSpacing" min="0" max="10" value="3" step="1">
<span class="range-value" id="wordSpacingValue">Normal</span>
</label>
</div>
<div class="option-group">
<label class="option-label">
<span>Overlay Color</span>
<select id="overlayColor">
<option value="none">None</option>
<option value="beige">Beige</option>
<option value="blue">Light Blue</option>
<option value="green">Light Green</option>
<option value="yellow">Light Yellow</option>
</select>
</label>
</div>
<div class="option-group checkbox-group">
<label class="checkbox-label">
<input type="checkbox" id="bionicReading">
<span>Bionic Reading</span>
</label>
</div>
</div>
</div>
<div class="feature-card">
<div class="feature-header">
<div class="feature-info">
<div class="feature-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="1.5" stroke-linecap="round"
stroke-linejoin="round">
<polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5" />
<path d="M15.54 8.46a5 5 0 0 1 0 7.07" />
<path d="M19.07 4.93a10 10 0 0 1 0 14.14" />
</svg>
</div>
<div>
<h3>Text-to-Speech</h3>
<p>Read aloud with highlighting</p>
</div>
</div>
<label class="toggle">
<input type="checkbox" id="ttsToggle">
<span class="slider"></span>
</label>
</div>
<div class="feature-options" id="ttsOptions" style="display: none;">
<div class="tts-controls">
<button class="tts-btn" id="ttsPlay">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round">
<polygon points="5 3 19 12 5 21 5 3" />
</svg>
<span>Play</span>
</button>
<button class="tts-btn" id="ttsPause">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round">
<rect x="6" y="4" width="4" height="16" />
<rect x="14" y="4" width="4" height="16" />
</svg>
<span>Pause</span>
</button>
<button class="tts-btn" id="ttsStop">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round">
<rect x="3" y="3" width="18" height="18" rx="2" ry="2" />
</svg>
<span>Stop</span>
</button>
</div>
<div class="option-group">
<label class="option-label">
<span>Voice Selection</span>
<select id="ttsVoice">
<option value="auto">Auto (Best Quality)</option>
</select>
</label>
</div>
<div class="option-group">
<label class="option-label">
<span>Reading Speed</span>
<select id="ttsSpeed">
<option value="0.5">Very Slow</option>
<option value="0.75">Slow</option>
<option value="1" selected>Normal</option>
<option value="1.25">Fast</option>
<option value="1.5">Very Fast</option>
</select>
</label>
</div>
<div class="option-group">
<label class="option-label">
<span>Volume</span>
<input type="range" id="ttsVolume" min="0" max="100" value="70" step="5">
<span class="range-value" id="ttsVolumeValue">70%</span>
</label>
</div>
<div class="option-group checkbox-group">
<label class="checkbox-label">
<input type="checkbox" id="ttsPauseOnPunctuation" checked>
<span>Pause on Punctuation</span>
</label>
</div>
<div class="option-group checkbox-group">
<label class="checkbox-label">
<input type="checkbox" id="ttsWordHighlight" checked>
<span>Word Highlighting</span>
</label>
</div>
</div>
</div>
</section>
<!-- API Key Settings -->
<section class="settings">
<button class="settings-btn" id="settingsBtn">
<span class="btn-content">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
<path
d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" />
<circle cx="12" cy="12" r="3" />
</svg>
<span>API Settings</span>
</span>
<span class="arrow">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="m6 9 6 6 6-6" />
</svg>
</span>
</button>
<span class="api-provider-badge gemini" id="apiProviderBadge" title="Active AI Provider">Gemini</span>
<div class="settings-panel" id="settingsPanel" style="display: none;">
<div class="option-group">
<label class="option-label">
<span>AI Provider</span>
<select id="apiProvider">
<option value="gemini">Google Gemini</option>
<option value="openrouter">OpenRouter</option>
</select>
</label>
</div>
<label id="geminiSection">
<span>Gemini API Key</span>
<div class="input-group">
<input type="password" id="geminiKey" placeholder="AIza...">
<button id="toggleGeminiKey" class="icon-btn">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="1.5" stroke-linecap="round"
stroke-linejoin="round">
<path d="M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z" />
<circle cx="12" cy="12" r="3" />
</svg>
</button>
</div>
<small>Get your free key at <a href="https://aistudio.google.com/app/apikey"
target="_blank">Google AI Studio</a></small>
</label>
<label id="openrouterSection" style="display: none;">
<span>OpenRouter API Key</span>
<div class="input-group">
<input type="password" id="apiKey" placeholder="sk-or-...">
<button id="toggleKey" class="icon-btn">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="1.5" stroke-linecap="round"
stroke-linejoin="round" id="eyeIcon">
<path d="M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z" />
<circle cx="12" cy="12" r="3" />
</svg>
</button>
</div>
<small>Get your free key at <a href="https://openrouter.ai/keys"
target="_blank">OpenRouter</a></small>
</label>
<button id="saveKey" class="btn-primary">Save API Key</button>
<div id="apiStatus" class="status-message"></div>
</div>
</section>
<!-- Status -->
<section class="status">
<div id="statusMessage" class="status-info">
<span class="status-dot"></span>
<span id="statusText">Ready to simplify</span>
</div>
</section>
</main>
<footer>
<p>
Made for neurodivergent accessibility
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
<path
d="M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z" />
</svg>
</p>
</footer>
</div>
<script src="popup.js"></script>
</body>
</html>