# Accessibility Widgets A comprehensive, lightweight accessibility tool that enhances web accessibility for all users. This single-file JavaScript widget provides multiple accessibility features to make websites more usable for people with disabilities. https://sinan.im ## Regulatory Supports | **Feature** | **WCAG AA** | **EU (EN 301 549/EAA/WAD)** | **US (ADA/Section 508)** | | ----------------------------------- | :------------------------------------------: | :-------------------------: | :----------------------: | | **High Contrast Mode** | ✔️ | ✔️ | ✔️ | | **Text Size Adjustment** | ✔️ | ✔️ | ✔️ | | **Text Spacing** | ✔️ | ✔️ | ✔️ | | **Line Height Adjustment** | ✔️ | ✔️ | ✔️ | | **Text Alignment (Left Align)** | ✔️ (Visual Presentation) | ✔️ | ✔️ | | **Cursor Enhancement** | ✔️ (Pointer Target Size) | ✔️ | ✔️ | | **Pause Animations** | ✔️ | ✔️ | ✔️ | | **Reduced Motion** | ✔️ (Animation from Interactions) | ✔️ | ✔️ | | **Hide Images** | ✔️ (Non-text Content) | ✔️ | ✔️ | | **Dyslexia-Friendly / Font Select** | ✔️ (Use of Color, readability enhancements) | ✔️ | ✔️ | | **Screen Reader Support** | ✔️ | ✔️ | ✔️ | | **Voice Control** | ✔️ (Character Shortcuts / voice operability) | ✔️ | ✔️ | | **Color Blindness Filters** | ✔️ (Use of Color / contrast) | ✔️ | ✔️ | ## Features ### Core Accessibility Features - **High Contrast Mode** - Improves visibility for users with low vision - **Text Size Adjustment** - Increases font size for better readability - **Text Spacing** - Adds letter and word spacing for easier reading - **Animation Control** - Pauses animations that may cause distraction or discomfort - **Image Hiding** - Removes images for users who prefer text-only content - **Dyslexia-Friendly Font** - Uses OpenDyslexic font for users with dyslexia - **Cursor Enhancement** - Increases cursor size for better visibility - **Line Height Adjustment** - Improves text readability with increased line spacing - **Text Alignment** - Forces left alignment for consistent text layout ### Advanced Features - **Screen Reader Support** - Built-in text-to-speech functionality - **Voice Control** - Voice commands to control accessibility features - **Reduced Motion** - Respects user preferences for reduced motion - **Font Selection** - Choose between Arial, Times New Roman, and Verdana - **Color Blindness Filters** - Filters for Protanopia, Deuteranopia, Tritanopia, and Grayscale ## Installation ### Method 1: Direct Download 1. Download the `widget.js` file 2. Include it in your HTML page: ```html ``` ### Method 2: NPM ```bash npm install accessibility-widgets ``` ### Method 3: CDN ```html ``` That's it! The widget will automatically initialize when the page loads. ## Configuration The widget is highly customizable. You can override the default settings by defining `window.ACCESSIBILITY_WIDGET_CONFIG` before loading the widget script. ### Basic Configuration ```html ``` ### Complete Configuration Options ```html ``` ### Partial Configuration You only need to specify the settings you want to change. The widget will merge your settings with the defaults: ```html ``` ### Widget Positioning The widget can be positioned on either side of the screen: ```html ``` ### Internationalization (i18n) The widget supports full internationalization. You can customize all text strings: ```html ``` ## Voice Commands When voice control is enabled, users can activate features using these commands: - "show menu" / "open menu" - Opens the accessibility menu - "high contrast" - Toggles high contrast mode - "bigger text" - Toggles larger text size - "text spacing" - Toggles text spacing - "pause animations" - Toggles animation pausing - "hide images" - Toggles image hiding - "dyslexia font" - Toggles dyslexia-friendly font - "bigger cursor" - Toggles larger cursor - "screen reader" - Toggles screen reader - "reset all" - Resets all accessibility settings ## Browser Compatibility - **Modern Browsers**: Full functionality in Chrome, Firefox, Safari, Edge - **Screen Reader**: Requires Speech Synthesis API support - **Voice Control**: Requires Speech Recognition API support - **Graceful Degradation**: Features that aren't supported are automatically disabled ## Technical Features - **Single File Deployment** - No dependencies, just include one JavaScript file - **Persistent Settings** - User preferences saved in localStorage - **Keyboard Navigation** - Full keyboard accessibility with Tab, Arrow keys, and Escape - **ARIA Compliance** - Proper ARIA labels and roles for screen readers - **Performance Optimized** - DOM caching and efficient event handling - **Error Handling** - Robust error handling for browser compatibility - **Responsive Design** - Works on desktop and mobile devices - **Flexible Positioning** - Support for left/right side positioning - **Full Internationalization** - Complete text customization for any language - **Configurable Colors** - Dynamic color theming including SVG icon colors - **Screen Reader Optimized** - Proper text labels for all interactive elements ## Usage Examples ### Basic Implementation ```html
This site includes accessibility features.
``` ### Custom Configuration ```html ``` ## Accessibility Standards This widget helps websites comply with: - **WCAG 2.1** (Web Content Accessibility Guidelines) - **Section 508** (US Federal accessibility requirements) - **ADA** (Americans with Disabilities Act) digital accessibility standards ## File Structure ``` widget/ ├── widget.js # Main accessibility widget file ├── index.html # Demo/test page └── README.md # This documentation ``` ## Contributing When contributing to this project: 1. Test all features across different browsers 2. Ensure keyboard navigation works properly 3. Verify screen reader compatibility 4. Test voice commands (if supported by browser) 5. Check that settings persist across page reloads ## License This project is open source and available under the GPL License. ## Support For support or feature requests, please check the browser console for any error messages and ensure your browser supports the required APIs for advanced features like speech synthesis and recognition. ## Recent Changes ### Latest Updates - **Widget Positioning**: Added support for left/right side positioning with configurable distances - **Internationalization**: Full i18n support with customizable text strings for all languages - **Color Theming**: SVG icons now use configurable primary color instead of hardcoded values - **Screen Reader Improvements**: Fixed close button text to read properly ("Close" instead of "times") - **Removed Features**: Removed Reading Mode and Enhanced Focus features for better performance - **UI Improvements**: Updated header background to black, removed gradient from accessibility button - **Configuration**: Enhanced configuration system with deep merging for partial overrides