-
Notifications
You must be signed in to change notification settings - Fork 10
/
index.html
680 lines (636 loc) · 29.5 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<title>Accessibility Menu (toolbar)</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Add accessibility to your website with one line of javascript code">
<meta name="keywords" content="Accessibility,menu,toolbar">
<meta name="author" content="[email protected]">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="site/css/main.css">
<link rel="shortcut icon" href="favicon.ico" />
</head>
<body>
<div class="wrapper center-me">
<div class="ui inverted blue tertiary segment">
<h1 class="ui header">
<i class="material-icons blue icon">accessible</i> Adaptive Accessibility Menu
</h1>
<h2 class="ui header">
add accessibility toolbar to every website with one line of code
</h2>
<div class="ui raised segment">
<h3 class="ui header">
features
</h3>
<div class="ui relaxed divided list">
<div class="item">
<i class="large text width middle aligned icon"></i>
<div class="content">
<a class="header">manipulate text size</a>
<div class="description">increase or decrease text size. works with <b>em</b> <b>/</b>
<b>rem</b> / <b>px</b> or any type
of font-size units</div>
</div>
</div>
<div class="item">
<i class="large material-icons middle aligned icon"
style="transform: rotate(90deg) translate(4px, 2px);">unfold_more</i>
<div class="content">
<a class="header">manipulate text spacing</a>
<div class="description">increase or decrease text space. works with <b>em</b> <b>/</b>
<b>rem</b> / <b>px</b> or any type
of letter-spacing units</div>
</div>
</div>
<div class="item">
<i class="large material-icons middle aligned icon">invert_colors</i>
<div class="content">
<a class="header">invert colors</a>
<div class="description">toggles the document's body background color from black to white
and the default text color from
white to black and vice versa</div>
</div>
</div>
<div class="item">
<i class="large material-icons middle aligned icon">format_color_reset</i>
<div class="content">
<a class="header">gray hues</a>
<div class="description">turns the site to gray hues only - images including</div>
</div>
</div>
<div class="item">
<i class="large underline middle aligned icon"></i>
<div class="content">
<a class="header">underline links</a>
<div class="description">mark links with underline</div>
</div>
</div>
<div class="item">
<i class="large material-icons middle aligned icon">border_horizontal</i>
<div class="content">
<a class="header">reading guide</a>
<div class="description">add a horizontal line that bind to the mouse or touch position
</div>
</div>
</div>
<div class="item">
<i class="large material-icons middle aligned icon svg-wrap">
<svg version="1.1" id="iconBigCursorSvg" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 512 512"
style="position: absolute;width: 19px;height: 19px;left: 3px;top: 6px;enable-background:new 0 0 512 512;"
xml:space="preserve">
<path
d="M 423.547 323.115 l -320 -320 c -3.051 -3.051 -7.637 -3.947 -11.627 -2.304 s -6.592 5.547 -6.592 9.856 V 480 c 0 4.501 2.837 8.533 7.083 10.048 c 4.224 1.536 8.981 0.192 11.84 -3.285 l 85.205 -104.128 l 56.853 123.179 c 1.792 3.883 5.653 6.187 9.685 6.187 c 1.408 0 2.837 -0.277 4.203 -0.875 l 74.667 -32 c 2.645 -1.131 4.736 -3.285 5.76 -5.973 c 1.024 -2.688 0.939 -5.675 -0.277 -8.299 l -57.024 -123.52 h 132.672 c 4.309 0 8.213 -2.603 9.856 -6.592 C 427.515 330.752 426.598 326.187 423.547 323.115 Z" />
</svg>
</i>
<div class="content">
<a class="header">big cursor</a>
<div class="description">Replacing the default mouse cursor with a bigger one</div>
</div>
</div>
<div class="item">
<i class="large material-icons middle aligned icon">record_voice_over</i>
<div class="content">
<a class="header">text to speech</a>
<div class="description">let's the user select any text on site and enabling the browser's
automatic reading feature (works
in supported browsers only)</div>
</div>
</div>
<div class="item">
<i class="large material-icons middle aligned icon">mic</i>
<div class="content">
<a class="header">speech to text </a>
<div class="description">by enabling that feature the user will be able to speak and the
browser will interpret his words
to text (works in supported browsers only)</div>
</div>
</div>
<div class="item">
<i class="large keyboard middle aligned icon"></i>
<div class="content">
<a class="header">hotkeys</a>
<div class="description">Use keyboard shortcuts to toggle modules / features</div>
</div>
</div>
</div>
<!--<p>
Need more? request on the <a href="#disqus_thread">comments</a> down below
</p>-->
</div>
<div class="ui raised segment">
<h3 class="ui header">easy to use!</h3>
<div class="ui ordered list">
<a class="item">
<p>
install package:
</p>
<code>npm install accessibility</code>
</a>
<a class="item">
<p>
include script:
</p>
<code>
<script type="text/javascript" src="node_modules/accessibility/dist/accessibility.min.js"></script>
</code>
</a>
<a class="item">
<p>
or import:
</p>
<code>
import { Accessibility } from 'accessibility/src/main';
</code>
</a>
<a class="item">
<p>
initialize component
</p>
<code>
window.addEventListener('load', function() {
<br>
new Accessibility();
<br>
}, false);
</code>
</a>
</div>
<ol class="ui list">
<li value="*">Does not depend any other directory (jQuery is not required)</li>
</ol>
</div>
<div class="ui raised segment">
<h3 class="ui header">Limitations and Known Issues</h3>
<p>
Works with html5 browsers only (no IE8 and below)
</p>
<p>
Text to speech & speech to text works in supported browsers and languages only
</p>
<p>
Gray hues is disabled in firefox due to a bug in firefox browser and will be enabled when it will be
fixed
</p>
</div>
<div class="ui raised segment">
<h3 class="ui header">multi language example</h3>
<p>
<code>
var labels = {<br>
resetTitle: 'reset (in my language)',<br>
closeTitle: 'close (in my language)',<br>
menuTitle: 'title (in my language)',<br>
increaseText: 'increase text size (in my language)',<br>
decreaseText: 'decrease text size (in my language)',<br>
increaseTextSpacing: 'increase text spacing (in my language)',<br>
decreaseTextSpacing: 'decrease text spacing (in my language)',<br>
invertColors: 'invert colors (in my language)',<br>
grayHues: 'gray hues (in my language)',<br>
underlineLinks: 'underline links (in my language)',<br>
bigCursor: 'big cursor (in my language)',<br>
readingGuide: 'reading guide (in my language)',<br>
textToSpeech: 'text to speech (in my language)',<br>
speechToText: 'speech to text (in my language)'<br>
};<br>
var options = { labels: labels };<br>
options.textToSpeechLang = 'en-US'; // or any other language<br>
options.speechToTextLang = 'en-US'; // or any other language<br>
new Accessibility(options);
</code>
</p>
</div>
<div class="ui raised segment">
<h3 class="ui header">disable features example</h3>
<p>
<code>
options.modules = {<br>
increaseText: [true/false],<br>
decreaseText: [true/false],<br>
invertColors: [true/false],<br>
increaseTextSpacing: [true/false],<br>
decreaseTextSpacing: [true/false],<br>
grayHues: [true/false],<br>
underlineLinks: [true/false],<br>
bigCursor: [true/false],<br>
readingGuide: [true/false],<br>
textToSpeech: [true/false],<br>
speechToText: [true/false]<br>
};
</code>
<p>
When the default is <b>true</b>
</p>
</p>
</div>
<div class="ui raised segment">
<h3 class="ui header">hotkeys module</h3>
<p>
<p>
This module is <b>disabled</b> by default
</p>
<code>
var options = {<br>
hotkeys: {<br>
enabled: [true/false]<br>
}<br>
};<br>
new Accessibility(options);
</code><br><br>
<p>
Help text is active by default in the buttons title, you can disable or enable setting in
<code>options.hotkeys.helpTitles = [true/false];</code>
</p>
<p><b>Hotkeys Defaults</b></p>
<table>
<thead>
<tr>
<td>Module or Function</td>
<td>Hotkey</td>
</tr>
</thead>
<tbody>
<tr>
<td>Toggle Menu</td>
<td>CTRL + ALT + A</td>
</tr>
<tr>
<td>Gray Hues</td>
<td>CTRL + ALT + G</td>
</tr>
<tr>
<td>Underline Links</td>
<td>CTRL + ALT + U</td>
</tr>
<tr>
<td>Big Cursor</td>
<td>CTRL + ALT + C</td>
</tr>
<tr>
<td>Reading Guide</td>
<td>CTRL + ALT + R</td>
</tr>
<tr>
<td>Text To Speech</td>
<td>CTRL + ALT + T</td>
</tr>
<tr>
<td>Speech To Text</td>
<td>CTRL + ALT + S</td>
</tr>
</tbody>
</table>
</p>
</div>
<div class="ui raised segment">
<h3 class="ui header">text size manipulation approaches</h3>
<p>
The default approach is <code>textEmlMode: false</code> meaning we are changing the <code>html</code>'s percentage.
</p>
<p>
You can also try the legacy approach, witch changes the <code>body</code>'s pixels instead of the <code>html</code>'s percentage.
</p>
<code>
new Accessibility({textEmlMode: false})
</code>
<p>
If text increase / decrease isn't working for your size you're probably not using responsive font
size units (sutch as em,
rem etc.).
</p>
<p>
In that case you can initialize the accessibility tool like this:
</p>
<code>
new Accessibility({textPixelMode: true})
</code>
</div>
<div class="ui raised segment">
<h3 class="ui header">animations</h3>
<p>
Cancel all buttons animations:
</p>
<code>
new Accessibility({animations: {buttons: false}})
</code>
</div>
<div class="ui raised segment">
<h3 class="ui header">free</h3>
<div class="ui list">
<div class="item">
<i class="large material-icons middle aligned icon">code</i>
<div class="content">
<a class="header">open source</a>
<div class="description">This project is an open source one.</div>
</div>
</div>
<div class="item">
<i class="large github middle aligned icon"></i>
<div class="content">
<a class="header" href="https://github.com/ranbuch/accessibility" target="_blank">GitHub
Repo</a>
<div class="description">
<p>
Fell free to star <i class="icon material-icons">star</i> this repository if it
helped
you.
</p>
<p>
you can also <a href="https://github.com/ranbuch/accessibility/issues"
target="_blank">open an issue</a> if necessary.
</p>
</div>
</div>
</div>
<div class="item">
<i class="large material-icons middle aligned icon">code</i>
<div class="content">
<a class="header" href="https://www.npmjs.com/package/accessibility" target="_blank">npm
package</a>
<div class="description">Fell free to star <i class="icon material-icons">star</i> this
package if it helped you.</div>
</div>
</div>
</div>
<p>
</p>
</div>
<div class="ui raised segment">
<h3 class="ui header">positioning</h3>
<p>
You can position the accessibility icon in any place on the screen. The default position is bottom
right:
</p>
<code>
var options = {
<p class="b-space-1">
icon: {
</p>
<p class="b-space-2">
position: {
</p>
<p class="b-space-3">
bottom: { size: 50, units: 'px' },
</p>
<p class="b-space-3">
right: { size: 0, units: 'px' },
</p>
<p class="b-space-3">
type: 'fixed'
</p>
<p class="b-space-2">
}
</p>
<p class="b-space-1">
}
</p>
<p>
}
</p>
<p>
new Accessibility(options);
</p>
</code>
<br>
<p>
But you can also position the icon in the upper left corner of the screen and cancel the fixed
positioning:
</p>
<code>
var options = {
<p class="b-space-1">
icon: {
</p>
<p class="b-space-2">
position: {
</p>
<p class="b-space-3">
top: { size: 2, units: 'vh' },
</p>
<p class="b-space-3">
left: { size: 2, units: '%' },
</p>
<p class="b-space-3">
type: 'absolute'
</p>
<p class="b-space-2">
}
</p>
<p class="b-space-1">
}
</p>
<p>
}
</p>
<p>
new Accessibility(options);
</p>
</code>
</div>
<div class="ui raised segment" id="icon-image">
<h3 class="ui header">icon image</h3>
<p>
You can change the default icon from this ('accessible'): <i
class="large material-icons middle aligned icon i-color">accessible</i>
</p>
<p>
To this this ('accessibility'): <i
class="large material-icons middle aligned icon i-color">accessibility</i>
</p>
<p>
Or change the shape of the icon to a circular one: <i
class="large material-icons middle aligned icon i-circular i-color">accessibility</i>
</p>
<code>
var options = {
<p class="b-space-1">
icon: {
</p>
<p class="b-space-2">
circular: [true/false],
</p>
<p class="b-space-2">
img: ['accessibility'/'accessible'],
</p>
<p class="b-space-1">
}
</p>
<p>
}
</p>
<p>
new Accessibility(options);
</p>
</code>
<br>
<p>
By default, this module is using <a href="https://material.io/resources/icons/?style=baseline"
target="_blank">Material Design Icon</a> witch means that the <code>material-icons</code>
<code>font-face</code> will be loaded automatically.
</p>
<p>
If you want you can chooes to use Emojis instead:
</p>
<code>
var options = {
<p class="b-space-1">
icon: {
</p>
<p class="b-space-2">
useEmojis: [true/false],
</p>
<p class="b-space-1">
}
</p>
<p>
}
</p>
<p>
new Accessibility(options);
</p>
</code>
<br>
<p>
In case the <code>material-icons</code> <code>font-face</code> was not loaded for any reason the
module will automatically fallback to Emojis icons.
</p>
</div>
<div class="ui raised segment" id="icon-image">
<h3 class="ui header">persistent session</h3>
<p>
From version 3.0.1 the session will be persistent even after the user will refresh the page.
</p>
<p>
To disable this feature use:
</p>
<code>
var options = {
<p class="b-space-1">
session: {
</p>
<p class="b-space-2">
persistent: false
</p>
<p class="b-space-1">
}
</p>
<p>
}
</p>
<p>
new Accessibility(options);
</p>
</code>
</div>
<div class="ui raised segment" id="icon-image">
<h3 class="ui header">direct access to the API</h3>
<p>
You can toggle the menu buttons directly via the exposed API:
</p>
<code>
<p>
var instance = new Accessibility(options);
</p>
<p>
instance.menuInterface.increaseText();
</p>
<p>
instance.menuInterface.decreaseText();
</p>
<p>
instance.menuInterface.increaseTextSpacing();
</p>
<p>
instance.menuInterface.decreaseTextSpacing();
</p>
<p>
instance.menuInterface.invertColors();
</p>
<p>
instance.menuInterface.grayHues();
</p>
<p>
instance.menuInterface.underlineLinks();
</p>
<p>
instance.menuInterface.bigCursor();
</p>
<p>
instance.menuInterface.readingGuide();
</p>
<p>
instance.menuInterface.textToSpeech();
</p>
<p>
instance.menuInterface.speechToText();
</p>
</code>
<br>
<p>
You can also override the functionality like this:
</p>
<code>
<p>
instance.menuInterface.increaseText = function() {
<p class="b-space-1">
// My own way to increase text size . . .
</p>
<p>
}
</p>
</p>
</code>
</div>
</div>
<div class="ui raised segment">
<h3> Pause animations</h3>
<img src="https://c.tenor.com/D12KYBUCOBAAAAAd/git-merge.gif" width="400px">
<video width="400px" loop autoplay muted controls>
<source src="https://www.w3schools.com/html/mov_bbb.mp4" type="video/mp4">
</video>
<div class="spin"></div>
<div class="ui raised segment">
<h3 class="ui header">Testing for Speech to Text</h3>
<textarea style="width: 100%; height: 100px;"></textarea>
</div>
<div class="ui raised segment">
<h3 class="ui header">license</h3>
<p>
<a href="https://spdx.org/licenses/MIT" target="_blank">
<img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat" alt="MIT License">
</a>
</p>
</div>
</div>
<div class="ui segment">
<div id="disqus_thread"></div>
<script>
/**
* RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
* LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables */
/*
var disqus_config = function () {
this.page.url = PAGE_URL; // Replace PAGE_URL with your page's canonical URL variable
this.page.identifier = PAGE_IDENTIFIER; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
};
(function() { // DON'T EDIT BELOW THIS LINE
var d = document, s = d.createElement('script');
s.src = '//ranbuch.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
*/
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered
by Disqus.</a></noscript>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.js"></script>
<script src="site/script/main.js"></script>
<script src="dist/accessibility.min.js"></script>
<!--<script id="dsq-count-scr" src="//ranbuch.disqus.com/count.js" async></script>-->
</body>
</html>