accessibility-widgets 2.0.6 → 2.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +78 -34
- package/package.json +1 -1
- package/widget.js +35 -2
package/README.md
CHANGED
|
@@ -157,28 +157,35 @@ window.ACCESSIBILITY_WIDGET_CONFIG = {
|
|
|
157
157
|
|
|
158
158
|
```javascript
|
|
159
159
|
window.ACCESSIBILITY_WIDGET_CONFIG = {
|
|
160
|
-
// ===== Feature Toggles =====
|
|
161
|
-
enableHighContrast: true,
|
|
162
|
-
enableBiggerText: true,
|
|
163
|
-
enableTextSpacing: true,
|
|
164
|
-
enablePauseAnimations: true,
|
|
165
|
-
enableHideImages: true,
|
|
166
|
-
enableDyslexiaFont: true,
|
|
167
|
-
enableBiggerCursor: true,
|
|
168
|
-
enableLineHeight: true,
|
|
169
|
-
enableTextAlign: true,
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
160
|
+
// ===== Core Feature Toggles =====
|
|
161
|
+
enableHighContrast: true, // 3-level high contrast mode
|
|
162
|
+
enableBiggerText: true, // 4-level text size control
|
|
163
|
+
enableTextSpacing: true, // 3-level text spacing
|
|
164
|
+
enablePauseAnimations: true, // Pause animations & reduced motion
|
|
165
|
+
enableHideImages: true, // Hide images toggle
|
|
166
|
+
enableDyslexiaFont: true, // Dyslexia-friendly fonts
|
|
167
|
+
enableBiggerCursor: true, // Large cursor
|
|
168
|
+
enableLineHeight: true, // 3-level line height (2em, 3em, 4em)
|
|
169
|
+
enableTextAlign: true, // Text alignment (left, center, right)
|
|
170
|
+
|
|
171
|
+
// ===== Advanced Features =====
|
|
172
|
+
enableScreenReader: true, // Built-in text-to-speech
|
|
173
|
+
enableVoiceControl: true, // Voice command control
|
|
174
|
+
enableFontSelection: true, // Font family selection
|
|
175
|
+
enableColorFilter: true, // Color blindness filters
|
|
174
176
|
|
|
175
177
|
// ===== Widget Layout =====
|
|
176
178
|
widgetWidth: '440px',
|
|
177
|
-
|
|
179
|
+
|
|
180
|
+
// ===== Grid Configuration =====
|
|
181
|
+
gridLayout: {
|
|
182
|
+
columns: '1fr 1fr', // Default 2-column grid
|
|
183
|
+
gap: '10px' // Gap between grid items
|
|
184
|
+
},
|
|
178
185
|
|
|
179
186
|
// ===== Position =====
|
|
180
187
|
widgetPosition: {
|
|
181
|
-
side: 'right',
|
|
188
|
+
side: 'right', // 'left' or 'right'
|
|
182
189
|
right: '20px',
|
|
183
190
|
left: '20px',
|
|
184
191
|
bottom: '20px'
|
|
@@ -186,11 +193,11 @@ window.ACCESSIBILITY_WIDGET_CONFIG = {
|
|
|
186
193
|
|
|
187
194
|
// ===== Colors =====
|
|
188
195
|
colors: {
|
|
189
|
-
primary: '#1663d7',
|
|
190
|
-
secondary: '#ffffff',
|
|
191
|
-
optionBg: '#ffffff',
|
|
192
|
-
optionText: '#333333',
|
|
193
|
-
optionIcon: '#000000'
|
|
196
|
+
primary: '#1663d7', // Header bg, main button, active borders
|
|
197
|
+
secondary: '#ffffff', // Main button icon, header text
|
|
198
|
+
optionBg: '#ffffff', // Option button background
|
|
199
|
+
optionText: '#333333', // Option button text
|
|
200
|
+
optionIcon: '#000000' // Option button icons
|
|
194
201
|
},
|
|
195
202
|
|
|
196
203
|
// ===== Button Styling =====
|
|
@@ -201,17 +208,37 @@ window.ACCESSIBILITY_WIDGET_CONFIG = {
|
|
|
201
208
|
shadow: '0 4px 8px rgba(0, 0, 0, 0.2)'
|
|
202
209
|
},
|
|
203
210
|
|
|
211
|
+
// ===== Menu Styling =====
|
|
212
|
+
menu: {
|
|
213
|
+
headerHeight: '70px',
|
|
214
|
+
padding: '0 10px 10px 10px',
|
|
215
|
+
optionPadding: '20px 10px',
|
|
216
|
+
optionMargin: '10px',
|
|
217
|
+
borderRadius: '8px',
|
|
218
|
+
fontSize: '16px',
|
|
219
|
+
titleFontSize: '16px',
|
|
220
|
+
closeButtonSize: '44px'
|
|
221
|
+
},
|
|
222
|
+
|
|
204
223
|
// ===== Typography =====
|
|
205
224
|
typography: {
|
|
206
225
|
fontFamily: 'Arial, sans-serif',
|
|
207
226
|
fontSize: '17px',
|
|
208
227
|
titleFontSize: '22px',
|
|
209
|
-
titleFontWeight: '700'
|
|
228
|
+
titleFontWeight: '700',
|
|
229
|
+
lineHeight: '1'
|
|
230
|
+
},
|
|
231
|
+
|
|
232
|
+
// ===== Animation =====
|
|
233
|
+
animation: {
|
|
234
|
+
transition: '0.2s',
|
|
235
|
+
hoverScale: '1.05'
|
|
210
236
|
},
|
|
211
237
|
|
|
212
238
|
// ===== Internationalization (i18n) =====
|
|
213
239
|
lang: {
|
|
214
240
|
accessibilityMenu: 'Accessibility Menu',
|
|
241
|
+
closeAccessibilityMenu: 'Close Accessibility Menu',
|
|
215
242
|
accessibilityTools: 'Accessibility Tools',
|
|
216
243
|
resetAllSettings: 'Reset All Settings',
|
|
217
244
|
screenReader: 'Screen Reader',
|
|
@@ -226,21 +253,38 @@ window.ACCESSIBILITY_WIDGET_CONFIG = {
|
|
|
226
253
|
colorFilter: 'Color Filter',
|
|
227
254
|
textAlign: 'Text Align',
|
|
228
255
|
textSize: 'Text Size',
|
|
229
|
-
highContrast: 'High Contrast'
|
|
256
|
+
highContrast: 'High Contrast',
|
|
257
|
+
defaultFont: 'Default Font',
|
|
258
|
+
noFilter: 'No Filter',
|
|
259
|
+
default: 'Default',
|
|
260
|
+
screenReaderOn: 'Screen reader on',
|
|
261
|
+
screenReaderOff: 'Screen reader off',
|
|
262
|
+
voiceControlActivated: 'Voice control activated',
|
|
263
|
+
notSupportedBrowser: 'is not supported in this browser',
|
|
264
|
+
close: 'Close',
|
|
265
|
+
reset: 'Reset',
|
|
266
|
+
saturation: 'Saturation',
|
|
267
|
+
selectLanguage: 'Select Language'
|
|
230
268
|
},
|
|
231
269
|
|
|
232
|
-
// ===== Voice Commands =====
|
|
270
|
+
// ===== Voice Commands (Multi-language Support) =====
|
|
233
271
|
voiceCommands: {
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
272
|
+
en: {
|
|
273
|
+
showMenu: ['show menu', 'open menu', 'accessibility menu', 'access menu'],
|
|
274
|
+
highContrast: ['high contrast', 'contrast', 'dark mode', 'increase contrast'],
|
|
275
|
+
biggerText: ['bigger text', 'large text', 'text size', 'increase text', 'bigger', 'larger text', 'text bigger', 'make text bigger', 'enlarge text'],
|
|
276
|
+
textSpacing: ['text spacing', 'spacing', 'letter spacing', 'text space'],
|
|
277
|
+
pauseAnimations: ['pause animations', 'stop animations', 'disable animations', 'no animations'],
|
|
278
|
+
hideImages: ['hide images', 'remove images', 'no images'],
|
|
279
|
+
dyslexiaFont: ['dyslexia friendly', 'dyslexia font', 'readable font', 'easy font'],
|
|
280
|
+
biggerCursor: ['bigger cursor', 'large cursor', 'cursor size', 'big cursor'],
|
|
281
|
+
lineHeight: ['line height', 'line spacing', 'space between lines', 'line space'],
|
|
282
|
+
textAlign: ['align text', 'text align', 'center text', 'alignment'],
|
|
283
|
+
screenReader: ['screen reader', 'read aloud', 'voice reader'],
|
|
284
|
+
voiceControl: ['voice command', 'voice control', 'voice commands'],
|
|
285
|
+
resetAll: ['reset all', 'reset everything', 'clear all', 'reset settings', 'reset']
|
|
286
|
+
},
|
|
287
|
+
// Additional languages: de, es, it, fr, ru, tr, ar, hi, zh-cn, jp available in widget
|
|
244
288
|
}
|
|
245
289
|
};
|
|
246
290
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "accessibility-widgets",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.9",
|
|
4
4
|
"description": "A comprehensive, lightweight accessibility widget that enhances web accessibility for all users. Provides multiple accessibility features including screen reader support, voice control, high contrast mode, and more.",
|
|
5
5
|
"main": "widget.js",
|
|
6
6
|
"scripts": {
|
package/widget.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* ===========================================
|
|
1
|
+
/* ===========================================
|
|
2
2
|
|
|
3
3
|
ACCESSIBILITY WIDGET
|
|
4
4
|
|
|
@@ -514,6 +514,9 @@ const DEFAULT_WIDGET_CONFIG = {
|
|
|
514
514
|
biggerCursor: ['bigger cursor', 'large cursor', 'cursor size', 'big cursor'],
|
|
515
515
|
lineHeight: ['line height', 'line spacing', 'space between lines', 'line space'],
|
|
516
516
|
textAlign: ['align text', 'text align', 'center text', 'alignment'],
|
|
517
|
+
saturation: ['saturation', 'color saturation', 'saturate', 'desaturate', 'grayscale'],
|
|
518
|
+
fontSelection: ['font selection', 'change font', 'select font', 'font'],
|
|
519
|
+
colorFilter: ['color filter', 'color blind', 'colorblind', 'filter'],
|
|
517
520
|
screenReader: ['screen reader', 'read aloud', 'voice reader'],
|
|
518
521
|
voiceControl: ['voice command', 'voice control', 'voice commands'],
|
|
519
522
|
resetAll: ['reset all', 'reset everything', 'clear all', 'reset settings', 'reset']
|
|
@@ -529,6 +532,9 @@ const DEFAULT_WIDGET_CONFIG = {
|
|
|
529
532
|
biggerCursor: ['größerer cursor', 'großer cursor', 'cursor größe'],
|
|
530
533
|
lineHeight: ['zeilenhöhe', 'zeilenabstand', 'abstand zwischen zeilen'],
|
|
531
534
|
textAlign: ['text ausrichten', 'textausrichtung', 'text zentrieren'],
|
|
535
|
+
saturation: ['sättigung', 'farbsättigung', 'sättigen', 'entsättigen', 'graustufen'],
|
|
536
|
+
fontSelection: ['schriftauswahl', 'schrift ändern', 'schrift wählen', 'schrift'],
|
|
537
|
+
colorFilter: ['farbfilter', 'farbenblind', 'filter'],
|
|
532
538
|
screenReader: ['screenreader', 'vorlesen', 'sprach reader'],
|
|
533
539
|
voiceControl: ['sprachbefehl', 'sprachsteuerung', 'sprachbefehle'],
|
|
534
540
|
resetAll: ['alles zurücksetzen', 'alle zurücksetzen', 'alle löschen', 'einstellungen zurücksetzen']
|
|
@@ -544,6 +550,9 @@ const DEFAULT_WIDGET_CONFIG = {
|
|
|
544
550
|
biggerCursor: ['cursor más grande', 'cursor grande', 'tamaño de cursor'],
|
|
545
551
|
lineHeight: ['altura de línea', 'espaciado de líneas', 'espacio entre líneas'],
|
|
546
552
|
textAlign: ['alinear texto', 'alineación de texto', 'centrar texto'],
|
|
553
|
+
saturation: ['saturación', 'saturación de color', 'saturar', 'desaturar', 'escala de grises'],
|
|
554
|
+
fontSelection: ['selección de fuente', 'cambiar fuente', 'seleccionar fuente', 'fuente'],
|
|
555
|
+
colorFilter: ['filtro de color', 'daltónico', 'filtro'],
|
|
547
556
|
screenReader: ['lector de pantalla', 'leer en voz alta', 'lector de voz'],
|
|
548
557
|
voiceControl: ['comando de voz', 'control de voz', 'comandos de voz'],
|
|
549
558
|
resetAll: ['restablecer todo', 'restablecer todo', 'borrar todo', 'restablecer configuración']
|
|
@@ -559,6 +568,9 @@ const DEFAULT_WIDGET_CONFIG = {
|
|
|
559
568
|
biggerCursor: ['cursore più grande', 'cursore grande', 'dimensione cursore'],
|
|
560
569
|
lineHeight: ['altezza linea', 'spaziatura linee', 'spazio tra linee'],
|
|
561
570
|
textAlign: ['allinea testo', 'allineamento testo', 'centra testo'],
|
|
571
|
+
saturation: ['saturazione', 'saturazione colore', 'saturare', 'desaturare', 'scala di grigi'],
|
|
572
|
+
fontSelection: ['selezione font', 'cambia font', 'seleziona font', 'font'],
|
|
573
|
+
colorFilter: ['filtro colore', 'daltonico', 'filtro'],
|
|
562
574
|
screenReader: ['lettore schermo', 'leggi ad alta voce', 'lettore vocale'],
|
|
563
575
|
voiceControl: ['comando vocale', 'controllo vocale', 'comandi vocali'],
|
|
564
576
|
resetAll: ['ripristina tutto', 'ripristina tutto', 'cancella tutto', 'ripristina impostazioni']
|
|
@@ -574,6 +586,9 @@ const DEFAULT_WIDGET_CONFIG = {
|
|
|
574
586
|
biggerCursor: ['curseur plus grand', 'grand curseur', 'taille curseur'],
|
|
575
587
|
lineHeight: ['hauteur ligne', 'espacement lignes', 'espace entre lignes'],
|
|
576
588
|
textAlign: ['aligner texte', 'alignement texte', 'centrer texte'],
|
|
589
|
+
saturation: ['saturation', 'saturation couleur', 'saturer', 'désaturer', 'niveaux de gris'],
|
|
590
|
+
fontSelection: ['sélection police', 'changer police', 'sélectionner police', 'police'],
|
|
591
|
+
colorFilter: ['filtre couleur', 'daltonien', 'filtre'],
|
|
577
592
|
screenReader: ['lecteur écran', 'lire à haute voix', 'lecteur vocal'],
|
|
578
593
|
voiceControl: ['commande vocale', 'contrôle vocal', 'commandes vocales'],
|
|
579
594
|
resetAll: ['réinitialiser tout', 'réinitialiser tout', 'effacer tout', 'réinitialiser paramètres']
|
|
@@ -589,6 +604,9 @@ const DEFAULT_WIDGET_CONFIG = {
|
|
|
589
604
|
biggerCursor: ['увеличенный курсор', 'большой курсор', 'размер курсора'],
|
|
590
605
|
lineHeight: ['высота строки', 'интервал строк', 'пространство между строками'],
|
|
591
606
|
textAlign: ['выровнять текст', 'выравнивание текста', 'центрировать текст'],
|
|
607
|
+
saturation: ['насыщенность', 'насыщенность цвета', 'насытить', 'обесцветить', 'оттенки серого'],
|
|
608
|
+
fontSelection: ['выбор шрифта', 'изменить шрифт', 'выбрать шрифт', 'шрифт'],
|
|
609
|
+
colorFilter: ['цветовой фильтр', 'дальтонизм', 'фильтр'],
|
|
592
610
|
screenReader: ['программа чтения', 'читать вслух', 'голосовой ридер'],
|
|
593
611
|
voiceControl: ['голосовая команда', 'голосовое управление', 'голосовые команды'],
|
|
594
612
|
resetAll: ['сбросить все', 'сбросить всё', 'очистить все', 'сбросить настройки']
|
|
@@ -604,6 +622,9 @@ const DEFAULT_WIDGET_CONFIG = {
|
|
|
604
622
|
biggerCursor: ['daha büyük imleç', 'büyük imleç', 'imleç boyutu'],
|
|
605
623
|
lineHeight: ['satır yüksekliği', 'satır aralığı', 'satırlar arası boşluk'],
|
|
606
624
|
textAlign: ['metni hizala', 'metin hizalama', 'metni ortala'],
|
|
625
|
+
saturation: ['doygunluk', 'renk doygunluğu', 'doygunlaştır', 'solgunlaştır', 'gri tonlama'],
|
|
626
|
+
fontSelection: ['yazı tipi seçimi', 'yazı tipini değiştir', 'yazı tipi seç', 'yazı tipi'],
|
|
627
|
+
colorFilter: ['renk filtresi', 'renk körü', 'filtre'],
|
|
607
628
|
screenReader: ['ekran okuyucu', 'sesli oku', 'ses okuyucu'],
|
|
608
629
|
voiceControl: ['sesli komut', 'sesli kontrol', 'sesli komutlar'],
|
|
609
630
|
resetAll: ['hepsini sıfırla', 'tümünü sıfırla', 'hepsini temizle', 'ayarları sıfırla']
|
|
@@ -619,6 +640,9 @@ const DEFAULT_WIDGET_CONFIG = {
|
|
|
619
640
|
biggerCursor: ['مؤشر أكبر', 'مؤشر كبير', 'حجم المؤشر'],
|
|
620
641
|
lineHeight: ['ارتفاع الخط', 'تباعد الأسطر', 'مساحة بين الأسطر'],
|
|
621
642
|
textAlign: ['محاذاة النص', 'محاذاة النص', 'توسيط النص'],
|
|
643
|
+
saturation: ['التشبع', 'تشبع اللون', 'تشبيع', 'إزالة التشبع', 'تدرج رمادي'],
|
|
644
|
+
fontSelection: ['اختيار الخط', 'تغيير الخط', 'اختر الخط', 'خط'],
|
|
645
|
+
colorFilter: ['مرشح الألوان', 'عمى الألوان', 'مرشح'],
|
|
622
646
|
screenReader: ['قارئ الشاشة', 'اقرأ بصوت عالٍ', 'قارئ صوتي'],
|
|
623
647
|
voiceControl: ['الأمر الصوتي', 'التحكم الصوتي', 'الأوامر الصوتية'],
|
|
624
648
|
resetAll: ['إعادة تعيين الكل', 'إعادة تعيين جميع', 'مسح الكل', 'إعادة تعيين الإعدادات']
|
|
@@ -634,6 +658,9 @@ const DEFAULT_WIDGET_CONFIG = {
|
|
|
634
658
|
biggerCursor: ['बड़ा कर्सर', 'बड़ा कर्सर', 'कर्सर का आकार'],
|
|
635
659
|
lineHeight: ['लाइन की ऊंचाई', 'लाइन स्पेसिंग', 'लाइनों के बीच स्पेस'],
|
|
636
660
|
textAlign: ['टेक्स्ट अलाइन करें', 'टेक्स्ट संरेखण', 'टेक्स्ट केंद्र में करें'],
|
|
661
|
+
saturation: ['संतृप्ति', 'रंग संतृप्ति', 'संतृप्त करें', 'असंतृप्त करें', 'ग्रेस्केल'],
|
|
662
|
+
fontSelection: ['फ़ॉन्ट चयन', 'फ़ॉन्ट बदलें', 'फ़ॉन्ट चुनें', 'फ़ॉन्ट'],
|
|
663
|
+
colorFilter: ['रंग फ़िल्टर', 'वर्णान्धता', 'फ़िल्टर'],
|
|
637
664
|
screenReader: ['स्क्रीन रीडर', 'जोर से पढ़ें', 'वॉयस रीडर'],
|
|
638
665
|
voiceControl: ['वॉयस कमांड', 'वॉयस नियंत्रण', 'वॉयस कमांड्स'],
|
|
639
666
|
resetAll: ['सभी रीसेट करें', 'सब कुछ रीसेट करें', 'सब साफ़ करें', 'सेटिंग्स रीसेट करें']
|
|
@@ -649,6 +676,9 @@ const DEFAULT_WIDGET_CONFIG = {
|
|
|
649
676
|
biggerCursor: ['更大的光标', '大光标', '光标大小'],
|
|
650
677
|
lineHeight: ['行高', '行间距', '行之间的空间'],
|
|
651
678
|
textAlign: ['对齐文本', '文本对齐', '居中文本'],
|
|
679
|
+
saturation: ['饱和度', '颜色饱和度', '饱和', '去饱和', '灰度'],
|
|
680
|
+
fontSelection: ['字体选择', '更改字体', '选择字体', '字体'],
|
|
681
|
+
colorFilter: ['颜色滤镜', '色盲', '滤镜'],
|
|
652
682
|
screenReader: ['屏幕阅读器', '大声朗读', '语音阅读器'],
|
|
653
683
|
voiceControl: ['语音命令', '语音控制', '语音命令'],
|
|
654
684
|
resetAll: ['重置全部', '重置所有', '清除全部', '重置设置']
|
|
@@ -664,6 +694,9 @@ const DEFAULT_WIDGET_CONFIG = {
|
|
|
664
694
|
biggerCursor: ['大きいカーソル', '大きなカーソル', 'カーソルサイズ'],
|
|
665
695
|
lineHeight: ['行の高さ', '行間隔', '行間のスペース'],
|
|
666
696
|
textAlign: ['テキスト配置', 'テキスト配置', 'テキストを中央'],
|
|
697
|
+
saturation: ['彩度', '色彩度', '彩度を上げる', '彩度を下げる', 'グレースケール'],
|
|
698
|
+
fontSelection: ['フォント選択', 'フォント変更', 'フォント選択', 'フォント'],
|
|
699
|
+
colorFilter: ['カラーフィルター', '色覚異常', 'フィルター'],
|
|
667
700
|
screenReader: ['スクリーンリーダー', '音声で読む', '音声リーダー'],
|
|
668
701
|
voiceControl: ['音声コマンド', '音声制御', '音声コマンド'],
|
|
669
702
|
resetAll: ['すべてリセット', 'すべてリセット', 'すべてクリア', '設定をリセット']
|
|
@@ -736,7 +769,7 @@ const widgetStyles = `
|
|
|
736
769
|
display: flex;
|
|
737
770
|
justify-content: center;
|
|
738
771
|
align-items: center;
|
|
739
|
-
border:solid
|
|
772
|
+
border:solid 2px white;
|
|
740
773
|
}
|
|
741
774
|
|
|
742
775
|
#snn-accessibility-button:hover {
|