-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHTML Page for WCAG Check.html
More file actions
2879 lines (2444 loc) · 97.5 KB
/
HTML Page for WCAG Check.html
File metadata and controls
2879 lines (2444 loc) · 97.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
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
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>WCAG A & AA – Accessible vs Inaccessible Examples</title>
<style>
body {
font-family: Segoe UI, Roboto, sans-serif;
background: #f5f7fa;
margin: 0;
padding: 20px;
}
h1 {
text-align: center;
}
.section-title {
margin-top: 40px;
font-size: 1.8rem;
border-bottom: 3px solid #333;
padding-bottom: 5px;
}
.container {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 25px;
margin-top: 20px;
}
.card {
background: #fff;
padding: 20px;
border-radius: 14px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
border-left: 6px solid #4CAF50;
overflow:hidden;
}
.card.inaccessible {
border-left-color: #E53935;
}
.label {
font-weight: bold;
display: block;
margin-bottom: 6px;
}
.example-box {
background: #f0f0f0;
padding: 12px;
border-radius: 10px;
margin-top: 12px;
}
/* Navigation Panel Styles */
.sc-nav {
position: sticky;
top: 10px;
background: #ffffff;
padding: 16px;
border-radius: 12px;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
margin-bottom: 20px;
}
.sc-nav h2 {
margin-top: 0;
font-size: 1.2rem;
color: #333;
}
.sc-nav ul {
list-style: none;
padding-left: 0;
margin: 0;
}
.sc-nav li {
margin: 6px 0;
}
.sc-nav a {
text-decoration: none;
color: #1a73e8;
font-weight: 500;
}
.sc-nav a:focus {
outline: 3px solid #ffbf00;
}
/* Color-blind safe palette improvements */
:root {
--safe-blue: #0072B2;
--safe-green: #009E73;
--safe-yellow: #F0E442;
--safe-red: #D55E00;
--safe-purple: #CC79A7;
}
.card {
border-left-color: var(--safe-green);
}
.card.inaccessible {
border-left-color: var(--safe-red);
}
.badge {
background: var(--safe-purple);
}
/* Code Snippet Toggle */
.code-toggle {
background: var(--safe-blue);
color: white;
padding: 6px 12px;
border-radius: 6px;
cursor: pointer;
font-size: 0.9rem;
display: inline-block;
margin-bottom: 5px;
}
.code-box {
display: none;
background: #111;
color: #fff;
padding: 12px;
border-radius: 8px;
}
.accessible { border-left: 6px solid #2ecc71; }
.inaccessible { border-left: 6px solid #e74c3c; }
#infoheading{
align-content: center;
}
.example-box {
margin-top: 12px;
padding: 10px;
border: 1px solid #ccc;
border-radius: 6px;
}
button {
cursor: pointer;
}
/* ❌ This CSS is what visually fixes the wrong DOM order */
.bad-visual-fix {
display: flex;
flex-direction: column;
}
.bad-visual-fix label { order: 1; }
.bad-visual-fix input { order: 2; }
.bad-visual-fix .help { order: 3; }
/* =============== TARGET SIZE =============== */
.accessible-btn {
min-width: 44px;
min-height: 44px;
font-size: 16px;
margin: 5px;
}
.inaccessible-btn {
width: 18px;
height: 18px;
font-size: 10px;
padding: 0;
}
/* =============== FOCUS ORDER =============== */
.focus-demo input {
margin: 8px 0;
padding: 8px;
}
/* =============== TOOLTIP =============== */
.tooltip {
display: none;
background: black;
color: #fff;
padding: 6px;
border-radius: 4px;
font-size: 13px;
margin-top: 5px;
}
input:focus + .tooltip {
display: block;
}
/* =============== TOAST =============== */
.toast {
display: none;
background: #222;
color: #fff;
padding: 8px;
margin-top: 10px;
border-radius: 4px;
}
</style>
<script> function toggleCode(id) { const box = document.getElementById(id); box.style.display = box.style.display === 'block' ? 'none' : 'block'; } </script>
</head>
<body> <!-- Navigation Panel -->
<h1>WCAG A & AA – Accessible vs Inaccessible Examples</h1> <!-- Each SC will be appended in this format -->
<h2 style="text-align: center;">This page is for WCAG guidelines testing. Not meant for Functional testing</h2>
<h3 style="font-style: italic; text-align: center;" > For example: To test guideline 2.4.7: Focus visible test only focus visibility. Not button's functionality</h3>
<h3 style="font-style: italic; text-align: center;" >** The scenario present are not covering all WCAG sufficent, advisory and failure Techniques.**</h3>
<div id="content">
<h2 class="section-title">1.1.1 Non-text Content</h2>
<div class="container">
<div class="card">
<h3>✔ Accessible Example</h3>
<p>Images include meaningful <code>alt</code> text that describes their purpose.</p>
<div class="example-box">
<img src="Hearing.png" alt="Person typing on a laptop" width="200" />
</div>
</div>
<div class="card inaccessible">
<h3>✘ Inaccessible Example</h3>
<p>Image missing alt text, leaving screen reader users with no information.</p>
<div class="example-box">
<img src="Mobility.png" width="200" />
</div>
</div>
</div>
<h2 class="section-title">3.3.1 Error Identification</h2>
<div class="container">
<div class="card">
<h3>✔ Accessible Example</h3>
<p>Form fields clearly identify errors and provide feedback.</p>
<div class="example-box">
<form id="good-form">
<label for="password-good">Password:</label>
<input
id="password-good"
type="password"
aria-describedby="pwd-help"
aria-invalid="false"
>
<p id="pwd-help">Password must be at least 6 characters.</p>
<p id="pwd-error" style="color:red; display:none;" role="alert">Error: Please enter minimum 6 char password.</p>
<button type="button" onclick="validateGood()">Submit</button>
</form>
</div>
</div>
<script>
function validateGood() {
const passwordInput = document.getElementById('password-good');
const errorMsg = document.getElementById('pwd-error');
const value = passwordInput.value.trim();
// Check if the password is less than 6 characters
if (value.length < 6) {
// Show the error message
errorMsg.style.display = 'block';
errorMsg.textContent = 'Error: Too short. Password must be at least 6 characters.';
passwordInput.setAttribute('aria-invalid', 'true');
passwordInput.setAttribute('aria-describedby', 'pwd-help pwd-error'); // Add error message to aria-describedby
} else {
// Hide the error message
errorMsg.style.display = 'none';
errorMsg.textContent = ''; // Clear the content to prevent stale announcements
passwordInput.setAttribute('aria-invalid', 'false');
passwordInput.setAttribute('aria-describedby', 'pwd-help'); // Remove error message from aria-describedby
}
}
</script>
<!-- Inaccessible -->
<div class="card">
<h3>✘ Inaccessible Example</h3>
<p>No error labels, no instructions.</p>
<div class="example-box">
<form id="bad-form">
<input id="password-bad" type="password" placeholder="Enter password">
<p style="color:red; display:none;" id="bad-err">Invalid</p>
<button type="button" onclick="validateBad()">Submit</button>
</form>
</div>
</div>
</div>
<!-- 3.3.2 Labels or Instructions (A) -->
<h2 class="section-title">3.3.2 Labels or Instructions</h2>
<div class="container">
<div class="card">
<h3>✔ Accessible Example</h3>
<p>Form fields provide clear labels and instructions for users.</p>
<div class="example-box">
<form>
<label for="password-good">Password:</label>
<input id="password-good" type="password" aria-describedby="pwd-help">
<span id="pwd-help" class="help-text">Use at least 6 characters.</span>
</form>
</div>
</div>
<div class="card inaccessible">
<h3>✘ Inaccessible Example</h3>
<p>The input field has no label or instructions, making it difficult for screen reader users.</p>
<div class="example-box">
<form>
<input type="password" placeholder="Password">
</form>
</div>
</div>
</div> <!-- 3.3.3 Error Suggestion (AA) -->
<h2 class="section-title">3.3.3 Error Suggestion</h2>
<div class="container">
<div class="card">
<h3>✔ Accessible Example</h3>
<p>The form provides suggestions to help users correct input errors.</p>
<div class="example-box">
<form>
<label for="username-good">Username:</label>
<input
id="username-good"
type="text"
aria-describedby="username-hint"
aria-invalid="false"
required
placeholder="Enter your username"
>
<span id="username-hint" class="hint-msg">
Hint: Use 6-12 characters, letters, and numbers only.
</span>
<span id="username-error" role="alert" class="error-msg" style="color: red; display: none;">
Username already taken. Try "username123" instead.
</span>
<button type="button" onclick="validateUsername()">Submit</button>
</form>
</div>
</div>
<script>
const usernameInput = document.getElementById('username-good');
const errorMsg = document.getElementById('username-error');
const hintMsg = document.getElementById('username-hint');
function validateUsername() {
const value = usernameInput.value.trim();
// Example validation: Check if the username is "username123"
if (value && value !== 'username123') {
// Show error message and update aria-describedby
errorMsg.style.display = 'block';
errorMsg.textContent = 'Username already taken. Try "username123" instead.';
usernameInput.setAttribute('aria-invalid', 'true');
usernameInput.setAttribute('aria-describedby', 'username-hint username-error');
} else if (!value) {
// Handle empty input
errorMsg.style.display = 'block';
errorMsg.textContent = 'Username is required.';
usernameInput.setAttribute('aria-invalid', 'true');
usernameInput.setAttribute('aria-describedby', 'username-hint username-error');
} else {
// Hide error message and reset aria-describedby
errorMsg.style.display = 'none';
errorMsg.textContent = ''; // Clear the content to prevent stale announcements
usernameInput.setAttribute('aria-invalid', 'false');
usernameInput.setAttribute('aria-describedby', 'username-hint');
}
}
</script>
<div class="card inaccessible">
<h3>✘ Inaccessible Example (Fixed)</h3>
<p>The form only indicates an error without suggesting a correction.
</p>
<div class="example-box">
<form>
<label for="username-bad">Username:</label>
<input
id="username-bad"
type="text"
aria-describedby="username-bad-hint"
aria-invalid="false"
required
placeholder="Enter your username"
>
<span id="username-bad-error" role="alert" class="error-msg" style="color: red; display: none;">
Not Valid user name
</span>
<button type="button" onclick="validateBadUsername1()">Submit</button>
</form>
</div>
</div>
<script>
const badUsernameInput = document.getElementById('username-bad');
const badErrorMsg = document.getElementById('username-bad-error');
const badHintMsg = document.getElementById('username-bad-hint');
function validateBadUsername1() {
const value = badUsernameInput.value.trim();
// Example validation: Check if the username is "username123"
if (value && value !== 'username123') {
// Show error message and update aria-describedby
badErrorMsg.style.display = 'block';
badUsernameInput.setAttribute('aria-invalid', 'true');
badUsernameInput.setAttribute('aria-describedby', 'username-bad-hint username-bad-error');
} else if (!value) {
// Handle empty input
badErrorMsg.style.display = 'block';
badErrorMsg.textContent = 'Required field.';
badUsernameInput.setAttribute('aria-invalid', 'true');
badUsernameInput.setAttribute('aria-describedby', 'username-bad-hint username-bad-error');
} else {
// Hide error message and reset aria-describedby
badErrorMsg.style.display = 'none';
badErrorMsg.textContent = ''; // Clear the content to prevent stale announcements
badUsernameInput.setAttribute('aria-invalid', 'false');
badUsernameInput.setAttribute('aria-describedby', 'username-bad-hint');
}
}
</script>
</div>
</div>
<!-- 3.3.4 Error Prevention – Legal / Financial / Data (AA) -->
<h2 class="section-title">3.3.4 Error Prevention – Legal / Financial / Data</h2>
<div class="container">
<!-- Accessible Example -->
<div class="card">
<h3>✔ Accessible Example</h3>
<p>The form provides a review screen before submitting important data.</p>
<div class="example-box">
<form id="form-good-amount">
<label for="amount">Enter Amount:</label>
<input id="amount" type="number" aria-describedby="review-msg" required>
<span id="review-msg" class="help-text">You will see a review screen before submitting.</span>
<button type="submit">Submit</button>
</form>
</div>
</div>
<!-- Inaccessible Example -->
<div class="card inaccessible">
<h3>✘ Inaccessible Example</h3>
<p>The form submits immediately without a review screen or confirmation.</p>
<div class="example-box">
<form id="form-bad-amount">
<label for="amount2">Enter Amount:</label>
<input id="amount2" type="number" required>
<button type="submit">Submit</button>
</form>
</div>
</div>
</div>
<!-- ========================================================= -->
<!-- 3) 3.2.6 CONSISTENT HELP -->
<!-- ========================================================= -->
<h2 class="section-title">3.2.6 Consistent Help</h2>
<div class="container">
<div class="card">
<h3>✔ Accessible Example</h3>
<p>Help button always opens same content.</p>
<div class="example-box">
<button onclick="showHelp('consistent')">Help</button>
</div>
</div>
<div class="card">
<h3>✘ Inaccessible Example</h3>
<p>Help appears randomly.</p>
<div class="example-box" style="text-align:right;">
<button onclick="showHelp('random')">Help</button>
</div>
</div>
</div>
<!-- ========================================================= -->
<!-- 2) 3.3.7 ACCESSIBLE AUTHENTICATION -->
<!-- ========================================================= -->
<h2 class="section-title">3.3.7 Redundant Entry (Level A)</h2>
<div class="container">
<!-- Accessible Example -->
<div class="card">
<h3>✔ Accessible Example</h3>
<p>Login and address entry without redundant input.</p>
<div class="example-box">
<form id="accessible-login">
<h4>Billing Address</h4>
<label for="billing-address">Address:</label>
<input
type="text"
id="billing-address"
name="billing-address"
placeholder="Enter your billing address"
required
>
<label for="billing-city">City:</label>
<input
type="text"
id="billing-city"
name="billing-city"
placeholder="Enter your city"
required
>
<label for="billing-zip">ZIP Code:</label>
<input
type="text"
id="billing-zip"
name="billing-zip"
placeholder="Enter your ZIP code"
required
>
<h4>Shipping Address</h4>
<input
type="checkbox"
id="same-as-billing"
name="same-as-billing"
onclick="toggleShippingAddress()"
>
<label for="same-as-billing">Same as billing address</label>
<div id="shipping-address-section">
<label for="shipping-address">Address:</label>
<input
type="text"
id="shipping-address"
name="shipping-address"
placeholder="Enter your shipping address"
required
>
<label for="shipping-city">City:</label>
<input
type="text"
id="shipping-city"
name="shipping-city"
placeholder="Enter your city"
required
>
<label for="shipping-zip">ZIP Code:</label>
<input
type="text"
id="shipping-zip"
name="shipping-zip"
placeholder="Enter your ZIP code"
required
>
</div>
</form>
</div>
</div>
<!-- Inaccessible Example -->
<div class="card">
<h3>✘ Inaccessible Example</h3>
<p>Redundant entry required for address fields.</p>
<div class="example-box">
<form id="inaccessible-login">
<h4>Billing Address</h4>
<label for="billing-address-inaccessible">Address:</label>
<input
type="text"
id="billing-address-inaccessible"
name="billing-address-inaccessible"
placeholder="Enter your billing address"
required
>
<label for="billing-city-inaccessible">City:</label>
<input
type="text"
id="billing-city-inaccessible"
name="billing-city-inaccessible"
placeholder="Enter your city"
required
>
<label for="billing-zip-inaccessible">ZIP Code:</label>
<input
type="text"
id="billing-zip-inaccessible"
name="billing-zip-inaccessible"
placeholder="Enter your ZIP code"
required
>
<h4>Shipping Address</h4>
<label for="shipping-address-inaccessible">Address:</label>
<input
type="text"
id="shipping-address-inaccessible"
name="shipping-address-inaccessible"
placeholder="Enter your shipping address"
required
>
<label for="shipping-city-inaccessible">City:</label>
<input
type="text"
id="shipping-city-inaccessible"
name="shipping-city-inaccessible"
placeholder="Enter your city"
required
>
<label for="shipping-zip-inaccessible">ZIP Code:</label>
<input
type="text"
id="shipping-zip-inaccessible"
name="shipping-zip-inaccessible"
placeholder="Enter your ZIP code"
required
>
</form>
</div>
</div>
</div>
<script>
function toggleShippingAddress() {
const checkbox = document.getElementById('same-as-billing');
const shippingSection = document.getElementById('shipping-address-section');
if (checkbox.checked) {
shippingSection.style.display = 'none';
} else {
shippingSection.style.display = 'block';
}
}
// Inaccessible Example: Requires Redundant Entry
</script>
</html> <!-- 1.2.1 Audio-only and Video-only (Prerecorded) -->
<h2 class="section-title">1.2.1 Audio-only and Video-only (Prerecorded)</h2>
<div class="container">
<div class="card">
<h3>✔ Accessible Example</h3>
<p>Audio-only content includes a transcript. Video-only content includes a text description.</p>
<div class="example-box"> <audio controls aria-describedby="audio-transcript">
<source src="audio.mp3" type="audio/mpeg" />
</audio>
<p id="audio-transcript"><strong>Transcript:</strong> Welcome to our product tutorial...</p>
</div>
</div>
<div class="card inaccessible">
<h3>✘ Inaccessible Example</h3>
<p>Audio-only clip with no transcript; video has no description, excluding deaf and blind users.</p>
<div class="example-box"> <audio controls>
<source src="audio.mp3" />
</audio>
<p>(No transcript provided)</p>
</div>
</div>
</div> <!-- 1.2.2 Captions (Prerecorded) -->
<h2 class="section-title">1.2.2 Captions (Prerecorded)</h2>
<div class="container">
<div class="card">
<h3>✔ Accessible Example</h3>
<p>Videos include accurate captions synchronized with the audio content.</p>
<div class="example-box"> <video width="300" controls>
<source src="Flagscape.mp4" type="video/mp4" />
<track label="English" kind="captions" srclang="en" src="captions.vtt" default />
</video> </div>
</div>
<div class="card inaccessible">
<h3>✘ Inaccessible Example</h3>
<p>Video has no captions, making it inaccessible to deaf or hard-of-hearing users.</p>
<div class="example-box"> <video width="300" controls>
<source src="video.mp4" />
</video>
<p>(No captions available)</p>
</div>
</div>
</div> <!-- 1.2.3 Audio Description or Media Alternative (Prerecorded) -->
<h2 class="section-title">1.2.3 Audio Description or Media Alternative (Prerecorded)</h2>
<div class="container">
<div class="card">
<h3>✔ Accessible Example</h3>
<p>Video includes either audio description or a text alternative describing visual details.</p>
<div class="example-box"> <video width="300" controls>
<source src="video.mp4" />
</video>
<p><strong>Text Description:</strong> The video shows a person assembling a drone step-by-step.</p>
</div>
</div>
<div class="card inaccessible">
<h3>✘ Inaccessible Example</h3>
<p>No audio description or text alternative, excluding blind and low vision users.</p>
<div class="example-box"> <video width="300" controls>
<source src="video.mp4" />
</video>
<p>(No descriptions provided)</p>
</div>
</div>
</div>
<!-- ========================================================= -->
<!-- 8) 1.2.4 CAPTIONS (LIVE) -->
<!-- ========================================================= -->
<h2 class="section-title">1.2.4 Captions (Live)</h2>
<div class="container">
<div class="card">
<h3>✔ Accessible Example</h3>
<p>Live captions available.</p>
<div class="example-box">
<video controls width="100%">
<track kind="captions" src="livecaptions.vtt" default>
<source src="live.mp4" type="video/mp4">
</video>
</div>
</div>
<div class="card">
<h3>✘ Inaccessible Example</h3>
<p>No captions.</p>
<div class="example-box">
<video controls width="100%">
<source src="live.mp4" type="video/mp4">
</video>
</div>
</div>
</div>
<h2 class="section-title">1.2.5 Audio Description (Prerecorded)</h2>
<div class="container">
<!-- Accessible Example -->
<div class="card accessible">
<h3>✔ Accessible Example</h3>
<p>This video includes an audio description track and a transcript for users with visual impairments.</p>
<div class="example-box">
<video id="accessible-video" controls>
<source src="example-video.mp4" type="video/mp4">
<track
kind="descriptions"
src="example-audio-description.vtt"
srclang="en"
label="Audio Description">
<track
kind="subtitles"
src="example-subtitles.vtt"
srclang="en"
label="English Subtitles">
Your browser does not support the video tag.
</video>
<p>
<a href="example-transcript.txt" download>Download Transcript</a>
</p>
</div>
</div>
<!-- Inaccessible Example -->
<div class="card inaccessible">
<h3>✘ Inaccessible Example</h3>
<p>This video does not include an audio description or transcript, making it inaccessible to users with visual impairments.</p>
<div class="example-box">
<video id="inaccessible-video" controls>
<source src="example-video.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
</div>
</div>
</div>
<!-- ==== WCAG 1.3.x — Adaptable (Batch 1) ==== -->
<!-- 1.3.1 Info and Relationships -->
<h2 class="section-title">1.3.1 Info & Relationships</h2>
<div class="container">
<!-- Accessible Example -->
<div class="card">
<h3>✔ Accessible Example</h3>
<p>Information and structure is programmatically determinable with properly associated labels.</p>
<div class="example-box">
<form>
<label for="emailA">Email Address</label>
<input id="emailA" type="email" >
</form>
</div>
</div>
<!-- Inaccessible Example -->
<div class="card inaccessible">
<h3>✘ Inaccessible Example</h3>
<p>The label is not properly associated with the input, making structure inaccessible to assistive technologies.</p>
<div class="example-box">
<form>
<span>Email Address</span>
<input type="text" role="button">
</form>
</div>
</div>
</div>
</section>
<!-- 1.3.2 Meaningful Sequence -->
<h2 class="section-title">WCAG 1.3.2 – Meaningful Sequence </h2>
<div class="container">
<!-- ================================================= -->
<!-- ✅ ACCESSIBLE: VISUAL ORDER = DOM ORDER -->
<!-- ================================================= -->
<div class="card accessible">
<h3>✔ Accessible (Correct Meaningful Sequence)</h3>
<div class="example-box">
<!-- ✅ Correct DOM order -->
<label for="cvvA">CVV Number</label>
<input id="cvvA" type="text" aria-describedby="helpA">
<div class="help" id="helpA">
3-digit code on the back of your card
</div>
</div>
<p><strong>Screen reader reads:</strong><br>
CVV Number → Input → Help text ✅
</p>
</div>
<!-- ================================================= -->
<!-- ❌ INACCESSIBLE: UI SAME, READING ORDER WRONG -->
<!-- ================================================= -->
<div class="card inaccessible">
<h3>✘ Inaccessible (Same UI, Wrong Reading Order)</h3>
<!-- ❌ WRONG DOM ORDER, but CSS makes it LOOK correct -->
<div class="example-box bad-visual-fix">
<!-- ❌ Screen reader will read this FIRST -->
<div class="help">
3-digit code on the back of your card
</div>
<!-- ❌ Screen reader will read this SECOND -->
<input type="text">
<!-- ❌ Screen reader will read this LAST -->
<label>CVV Number</label>
</div>
<p><strong>Screen reader reads:</strong><br>
Help text → Input → CVV Number ❌
</p>
</div>
</div>
<!-- 1.3.3 Sensory Characteristics -->
<h2 class="section-title">1.3.3 Sensory Characteristics</h2>
<div class="container">
<!-- Accessible Example Card -->
<div class="card">
<h3>✔ Accessible Example</h3>
<p>
Instructions reference clear text labels, not color or position.<br>
(Example: “Select <strong>Plan A</strong>” instead of “Select the green option.”)
</p>
<div class="example-box">
<label><input type="radio" name="plan"> Plan A – Basic</label><br>
<label><input type="radio" name="plan"> Plan B – Premium</label><br>
<label><input type="radio" name="plan"> Plan C – Enterprise</label>
</div>
</div>
<!-- Inaccessible Example Card -->
<div class="card inaccessible">
<h3>✘ Inaccessible Example</h3>
<p>
Instructions rely only on sensory cues such as color or position.<br>
(Example: “Choose the <span style='color:blue;'>blue button</span> on the right.”)
</p>
<div class="example-box" style="display:flex; gap:1rem;">
<button style="background:gray; color:white;">Option 1</button>
<button style="background:blue; color:white;">Option 2</button>
<button style="background:gray; color:white;">Option 3</button>
</div>
</div>
</div>
</div>
<!-- ========================================================= -->
<!-- 7) 1.3.5 IDENTIFY INPUT PURPOSE -->
<!-- ========================================================= -->
<h2 class="section-title">1.3.5 Identify Input Purpose</h2>
<div class="container">
<div class="card">
<h3>✔ Accessible Example</h3>
<p>Uses autocomplete attribute for recognized personal info fields.</p>
<div class="example-box">
<label for="fname">First Name</label>
<input id="fname" type="text" autocomplete="given-name">
</div>
</div>
<div class="card">
<h3>✘ Inaccessible Example</h3>
<p>No autocomplete provided.</p>
<div class="example-box">
<label for="fname2">First Name</label>
<input id="fname2" type="text">
</div>
</div>
<script>
document.getElementById("fname").addEventListener("input", function() {
console.log("First Name input: ", this.value);
});
document.getElementById("email").addEventListener("input", function() {
console.log("Email input: ", this.value);
});
</script>
</div>
</section> <!-- WCAG 1.4.x – Distinguishable -->
<h2 class="section-title">1.4.1 Use of Color</h2>
<div class="container">
<div class="card">
<h3>✔ Accessible Example</h3>
<p>Color is not the only way information is conveyed.</p>
<div class="example-box">
<p><strong>Required fields</strong> are marked with a red asterisk <span style="color:#d32f2f">*</span>
<em>and</em> announced in text.</p> <label>Username <span style="color:#d32f2f">*</span>
(required)</label> <input type="text" aria-required="true" />
</div>
</div>
<div class="card inaccessible">
<h3>✘ Inaccessible Example</h3>
<p>Color alone conveys meaning.</p>
<div class="example-box">
<p>Required fields are shown only in red text:</p> <label style="color:#d32f2f">Username</label> <input
type="text" />
</div>
</div>
</div> <!-- 1.4.2 Audio Control -->
<h2 class="section-title">1.4.2 Audio Control</h2>
<div class="container">
<!-- Accessible Example Card -->
<div class="card">
<h3>✔ Accessible Example</h3>
<p>
Audio does <strong>not autoplay</strong> and includes clear controls so users can
<strong>pause, stop, or adjust volume</strong> easily.
</p>
<div class="example-box">
<audio controls preload="none">
<source src="sample-accessible.mp3" type="audio/mpeg" />
Your browser does not support audio playback.
</audio>
</div>
</div>
<!-- Inaccessible Example Card -->