-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.html
More file actions
478 lines (414 loc) · 18 KB
/
example.html
File metadata and controls
478 lines (414 loc) · 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
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
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Accessibility Widget Demo - Multi-Language TTS Support</title>
<!-- Boxicons (Required for icons) -->
<link href="https://unpkg.com/boxicons@2.1.4/css/boxicons.min.css" rel="stylesheet">
<!-- Accessibility Plugin CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@airforcerp/accessibility-widget@latest/accessibility-plugin.css">
<style>
/* Example page styles */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: Arial, sans-serif;
line-height: 1.6;
color: #333;
max-width: 1200px;
margin: 0 auto;
padding: 20px;
background: #f5f5f5;
}
header {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
padding: 40px 20px;
border-radius: 10px;
margin-bottom: 30px;
text-align: center;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
header h1 {
font-size: 2.5em;
margin-bottom: 10px;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}
header p {
font-size: 1.2em;
opacity: 0.95;
}
.container {
background: white;
padding: 30px;
border-radius: 10px;
margin-bottom: 30px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
h2 {
color: #667eea;
border-bottom: 3px solid #667eea;
padding-bottom: 10px;
margin-bottom: 20px;
font-size: 2em;
}
h3 {
color: #764ba2;
margin-top: 25px;
margin-bottom: 15px;
font-size: 1.5em;
}
.feature-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 20px;
margin: 20px 0;
}
.feature-card {
background: #f8f9fa;
padding: 20px;
border-radius: 8px;
border-left: 4px solid #667eea;
transition: transform 0.2s, box-shadow 0.2s;
}
.feature-card:hover {
transform: translateY(-2px);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.feature-card h4 {
color: #667eea;
margin-bottom: 10px;
font-size: 1.2em;
}
.button {
display: inline-block;
padding: 12px 24px;
background: #667eea;
color: white;
text-decoration: none;
border-radius: 5px;
margin: 10px 5px;
transition: background 0.3s, transform 0.2s;
border: none;
cursor: pointer;
font-size: 1em;
}
.button:hover {
background: #764ba2;
transform: scale(1.05);
}
.button:focus {
outline: 3px solid #667eea;
outline-offset: 2px;
}
.language-section {
background: #fff3cd;
padding: 20px;
border-radius: 8px;
margin: 20px 0;
border-left: 4px solid #ffc107;
}
.language-section h3 {
color: #856404;
margin-top: 0;
}
.code-block {
background: #f4f4f4;
padding: 15px;
border-radius: 5px;
border-left: 4px solid #667eea;
margin: 15px 0;
overflow-x: auto;
font-family: 'Courier New', monospace;
font-size: 0.9em;
}
ul, ol {
margin-left: 20px;
margin-bottom: 15px;
}
li {
margin-bottom: 8px;
}
.highlight {
background: #fff3cd;
padding: 2px 6px;
border-radius: 3px;
font-weight: bold;
}
.test-section {
background: #e7f3ff;
padding: 20px;
border-radius: 8px;
margin: 20px 0;
border-left: 4px solid #2196F3;
}
.test-section h3 {
color: #0d47a1;
margin-top: 0;
}
.image-demo {
max-width: 100%;
height: auto;
border-radius: 8px;
margin: 15px 0;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
footer {
text-align: center;
padding: 30px;
color: #666;
margin-top: 40px;
}
.badge {
display: inline-block;
padding: 5px 10px;
background: #667eea;
color: white;
border-radius: 15px;
font-size: 0.85em;
margin: 5px;
}
@media (max-width: 768px) {
header h1 {
font-size: 1.8em;
}
.feature-grid {
grid-template-columns: 1fr;
}
}
</style>
</head>
<body>
<header>
<h1>🌐 Accessibility Widget Demo</h1>
<p>WCAG 2.2 Level AA Compliant • Multi-Language TTS Support</p>
</header>
<div class="container">
<h2>Welcome to the Accessibility Widget</h2>
<p>
This page demonstrates the comprehensive <span class="highlight">Accessibility Widget by AirforceRP</span>.
Look for the accessibility button in the bottom-right corner of the screen to access all features.
</p>
<div class="feature-grid">
<div class="feature-card">
<h4>📱 Text-to-Speech</h4>
<p>Multi-language TTS support with automatic language detection. Select text and click the TTS button to hear it read aloud.</p>
</div>
<div class="feature-card">
<h4>🎨 Visual Customization</h4>
<p>Adjust font size, contrast, line height, letter spacing, and font family to suit your needs.</p>
</div>
<div class="feature-card">
<h4>🌈 Color Blindness</h4>
<p>Apply filters for protanopia, deuteranopia, tritanopia, and achromatopsia to improve visibility.</p>
</div>
<div class="feature-card">
<h4>📖 Reading Tools</h4>
<p>Use reading guide, reading mask, and text highlighting to improve reading experience.</p>
</div>
<div class="feature-card">
<h4>⌨️ Keyboard Navigation</h4>
<p>Full keyboard support with focus indicators and accessible navigation throughout.</p>
</div>
<div class="feature-card">
<h4>🌍 Multi-Language</h4>
<p>Supports 7 languages: English, Spanish, German, French, Mandarin, Korean, and Norwegian.</p>
</div>
</div>
</div>
<div class="container">
<h2>Try These Features</h2>
<h3>1. Text-to-Speech (TTS)</h3>
<p>
Select any text on this page and use the TTS button in the accessibility panel to hear it read aloud.
The widget supports <strong>automatic language detection</strong> and manual language selection.
</p>
<div class="test-section">
<h3>Test TTS with Different Languages</h3>
<p><strong>English:</strong> The quick brown fox jumps over the lazy dog.</p>
<p><strong>Español:</strong> El rápido zorro marrón salta sobre el perro perezoso.</p>
<p><strong>Deutsch:</strong> Der schnelle braune Fuchs springt über den faulen Hund.</p>
<p><strong>Français:</strong> Le renard brun rapide saute par-dessus le chien paresseux.</p>
<p><strong>中文:</strong> 敏捷的棕色狐狸跳过懒狗。</p>
<p><strong>한국어:</strong> 빠른 갈색 여우가 게으른 개를 뛰어넘습니다.</p>
<p><strong>Norsk:</strong> Den raske brune reven hopper over den late hunden.</p>
</div>
<h3>2. Font Size Adjustment</h3>
<p>
Use the accessibility panel to change font size from 75% to 200%.
This helps users with visual impairments read content more easily.
</p>
<h3>3. Contrast Modes</h3>
<p>
Try the different contrast modes:
</p>
<ul>
<li><strong>Normal:</strong> Standard contrast for comfortable reading</li>
<li><strong>High Contrast:</strong> Enhanced contrast for better visibility</li>
<li><strong>Dark Mode:</strong> Dark background with light text to reduce eye strain</li>
</ul>
<h3>4. Reading Tools</h3>
<p>Enable reading tools to improve your reading experience:</p>
<ul>
<li><strong>Reading Guide:</strong> A horizontal line that follows your reading position</li>
<li><strong>Reading Mask:</strong> Hides text below your reading position to reduce distractions</li>
<li><strong>Text Highlight:</strong> Highlights text as it's being read by TTS</li>
</ul>
</div>
<div class="container">
<h2>Sample Content Sections</h2>
<h3>Interactive Elements</h3>
<p>Test the accessibility features with these interactive elements:</p>
<button class="button" onclick="alert('Button clicked!')">Sample Button</button>
<a href="#" class="button" onclick="return false;">Sample Link</a>
<button class="button" onclick="alert('Another button!')">Another Button</button>
<h3>Form Elements</h3>
<form style="margin-top: 20px;">
<label for="name">Name:</label>
<input type="text" id="name" name="name" placeholder="Enter your name" style="padding: 8px; margin: 5px; width: 200px; border-radius: 4px; border: 1px solid #ddd;">
<br><br>
<label for="email">Email:</label>
<input type="email" id="email" name="email" placeholder="Enter your email" style="padding: 8px; margin: 5px; width: 200px; border-radius: 4px; border: 1px solid #ddd;">
<br><br>
<button type="submit" class="button">Submit</button>
</form>
<h3>Lists and Content</h3>
<p>Here's a sample list to test reading features:</p>
<ul>
<li>First item in the list</li>
<li>Second item with more content to read</li>
<li>Third item demonstrating text-to-speech capabilities</li>
<li>Fourth item showing how the widget handles different content types</li>
</ul>
<h3>Code Example</h3>
<p>Here's a code block to test monospace font family:</p>
<div class="code-block">
function accessibilityWidget() {<br>
console.log('Accessibility Widget Loaded');<br>
initTTS();<br>
createWidget();<br>
}
</div>
<h3>Image with Alt Text</h3>
<p>This image has descriptive alt text for screen readers:</p>
<img src="https://via.placeholder.com/600x300/667eea/ffffff?text=Accessibility+Widget+Demo"
alt="Accessibility Widget demonstration image showing the widget interface"
class="image-demo">
</div>
<div class="container">
<h2>Language Support</h2>
<p>The Accessibility Widget supports the following languages for Text-to-Speech:</p>
<div class="language-section">
<h3>Supported TTS Languages</h3>
<ul>
<li><strong>English (en):</strong> Default language with multiple voice options</li>
<li><strong>Español (es):</strong> Spanish with regional variants (Spain, Mexico, Argentina, Colombia)</li>
<li><strong>Deutsch (de):</strong> German with variants (Germany, Austria, Switzerland)</li>
<li><strong>Français (fr):</strong> French with variants (France, Canada, Belgium, Switzerland)</li>
<li><strong>中文 (zh):</strong> Mandarin Chinese with variants (Mainland, Taiwan, Hong Kong)</li>
<li><strong>한국어 (ko):</strong> Korean language support</li>
<li><strong>Norsk (no):</strong> Norwegian with variants (Bokmål, Nynorsk)</li>
</ul>
</div>
<p>
The widget automatically detects the language of selected text, or you can manually select
a language from the "TTS Language" dropdown in the accessibility panel.
</p>
</div>
<div class="container">
<h2>Installation & Usage</h2>
<h3>Quick Start</h3>
<p>Add these scripts to your HTML:</p>
<div class="code-block">
<!-- Boxicons (Required) --><br>
<link href="https://unpkg.com/boxicons@2.1.4/css/boxicons.min.css" rel="stylesheet"><br><br>
<!-- Accessibility Plugin CSS --><br>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@airforcerp/accessibility-widget@latest/accessibility-plugin.css"><br><br>
<!-- TTS Module (Optional but Recommended) --><br>
<script src="https://cdn.jsdelivr.net/npm/@airforcerp/accessibility-widget@latest/tts.js"></script><br><br>
<!-- Dictionary Module --><br>
<script src="https://cdn.jsdelivr.net/npm/@airforcerp/accessibility-widget@latest/dictionary.js"></script><br><br>
<!-- Speech Recognition Module --><br>
<script src="https://cdn.jsdelivr.net/npm/@airforcerp/accessibility-widget@latest/speech-recognition.js"></script><br><br>
<!-- Braille Conversion Module --><br>
<script src="https://cdn.jsdelivr.net/npm/@airforcerp/accessibility-widget@latest/braille.js"></script><br><br>
<!-- Optional: Custom Configuration --><br>
<script src="https://cdn.jsdelivr.net/npm/@airforcerp/accessibility-widget@latest/accessibility-config.js"></script><br><br>
<!-- Accessibility Plugin JavaScript (Must be loaded last) --><br>
<script src="https://cdn.jsdelivr.net/npm/@airforcerp/accessibility-widget@latest/accessibility-plugin.js"></script>
</div>
<h3>Configuration</h3>
<p>Customize the widget with configuration options:</p>
<div class="code-block">
<script><br>
var AccessibilityConfig = {<br>
position: 'bottom-right',<br>
buttonText: 'Accessibility',<br>
fontSize: 100,<br>
contrast: 'normal',<br>
ttsLanguage: 'en'<br>
};<br>
</script>
</div>
</div>
<div class="container">
<h2>WCAG 2.2 Level AA Compliance</h2>
<p>This widget is designed to meet WCAG 2.2 Level AA standards:</p>
<ul>
<li>✅ Keyboard navigation support</li>
<li>✅ Screen reader compatibility</li>
<li>✅ ARIA attributes and roles</li>
<li>✅ Focus management (2.4.11 Focus Not Obscured)</li>
<li>✅ Target Size (2.5.8 - All interactive elements ≥24×24px)</li>
<li>✅ Color contrast options</li>
<li>✅ Text size adjustment</li>
<li>✅ Alternative text support</li>
<li>✅ Skip links for navigation</li>
<li>✅ No dragging required (2.5.7 - Keyboard alternatives provided)</li>
</ul>
<p>
<span class="badge">WCAG 2.2 AA</span>
<span class="badge">ADA Compliant</span>
<span class="badge">Section 508</span>
<span class="badge">Multi-Language</span>
</p>
</div>
<footer>
<p><strong>Accessibility Widget by AirforceRP</strong></p>
<p>Version 1.0.1 • Multi-Language TTS Support</p>
<p>
<a href="https://github.com/airforcerp/Website-Accessibility-Widget" target="_blank" rel="noopener noreferrer" style="color: #667eea; text-decoration: none;">
View on GitHub
</a> •
<a href="https://www.npmjs.com/package/@airforcerp/accessibility-widget" target="_blank" rel="noopener noreferrer" style="color: #667eea; text-decoration: none;">
npm Package
</a>
</p>
</footer>
<!-- TTS Module for Multi-Language Support (Optional but Recommended) -->
<script src="https://cdn.jsdelivr.net/npm/@airforcerp/accessibility-widget@latest/tts.js"></script>
<!-- Dictionary Module -->
<script src="https://cdn.jsdelivr.net/npm/@airforcerp/accessibility-widget@latest/dictionary.js"></script>
<!-- Speech Recognition Module -->
<script src="https://cdn.jsdelivr.net/npm/@airforcerp/accessibility-widget@latest/speech-recognition.js"></script>
<!-- Braille Conversion Module -->
<script src="https://cdn.jsdelivr.net/npm/@airforcerp/accessibility-widget@latest/braille.js"></script>
<!-- Optional: Custom Configuration -->
<script>
var AccessibilityConfig = {
position: 'bottom-right',
buttonText: 'Accessibility',
fontSize: 100,
contrast: 'normal',
ttsLanguage: 'en', // en, es, de, fr, zh, ko, no
showReset: true
};
</script>
<!-- Accessibility Plugin JavaScript (Must be loaded last) -->
<script src="https://cdn.jsdelivr.net/npm/@airforcerp/accessibility-widget@latest/accessibility-plugin.js"></script>
</body>
</html>