Skip to content

Joshmaina/Hyper-local-accessibilty-auditor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hyper-Local Accessibility Auditor

📋 Overview

Hyper-Local Accessibility Auditor is a professional web-based accessibility analysis tool designed for non-technical business owners and entrepreneurs. It analyzes website HTML files to identify WCAG accessibility compliance issues and generates comprehensive, human-friendly reports.

Problem it Solves

Many small business owners lack the technical expertise to evaluate their websites for accessibility. This tool eliminates that barrier by providing:

  • Simple upload interface - No developer tools required
  • Visual, intuitive results - Easy-to-understand dashboards
  • Actionable recommendations - Clear steps to improve accessibility
  • WCAG compliance tracking - Meet accessibility standards

What It Does

Analyzes websites for:

  • Alt Text Analysis - Identifies missing or inadequate image descriptions
  • Contrast Ratios - Verifies text/background contrast meets WCAG standards
  • Readability Metrics - Measures text complexity using Flesch-Kincaid scores
  • Semantic HTML - Checks for proper document structure
  • Form Labels - Ensures all inputs have associated labels
  • Heading Hierarchy - Validates H1-H6 structure
  • Overall Score - Provides a 0-100 accessibility score

🚀 Features

Core Features

  • Single-page application - Works entirely in the browser
  • No backend required - All analysis runs client-side
  • Professional dashboard - Beautiful, responsive card-based UI
  • Local storage - Saves reports for later viewing
  • Export options - Download reports as JSON, CSV, or HTML
  • Mobile-friendly - Works on phones, tablets, and desktops

Advanced Features

  • Flesch-Kincaid readability analysis - Professional-grade text metrics
  • WCAG AA/AAA compliance checking - Industry-standard conformance
  • Detailed issue logging - Shows exactly what needs fixing
  • API-ready architecture - Built for future ML integration
  • Accessibility-first design - The tool itself is accessible

📦 Tech Stack

Frontend

  • HTML5 - Semantic markup
  • CSS3 - Grid, Flexbox, clamp(), responsive design
  • JavaScript (ES6+) - Modular class-based architecture
  • DOMParser - Browser's built-in HTML parsing
  • Canvas API - Image analysis capabilities

Browser Support

  • Chrome/Edge (latest)
  • Firefox (latest)
  • Safari (latest)
  • Mobile browsers

No External Dependencies

  • Zero npm package requirements
  • No build tools needed
  • Works with just HTML, CSS, JavaScript
  • Runs offline after first load

📁 Project Structure

accessibility-auditor/
│
├── index.html                 # Main application file
├── README.md                  # This file
│
├── css/
│   ├── styles.css            # Main styles & layout
│   ├── grid.css              # Responsive grid system
│   └── cards.css             # Card component styles
│
├── js/
│   ├── app.js                # Main app orchestration
│   ├── auditor.js            # Core audit engine
│   ├── contrastChecker.js    # WCAG contrast analysis
│   ├── readability.js        # Flesch-Kincaid calculator
│   ├── altTextChecker.js     # Image alt-text audit
│   ├── api.js                # API integration layer
│   └── export.js             # Report export utilities
│
├── assets/
│   └── icons/               # Icon assets (future)
│
└── sample/
    └── test.html            # Sample HTML for testing

🎯 How to Use

1. Open the Application

Simply open index.html in any modern web browser. No installation required.

# On Windows
start index.html

# On macOS
open index.html

# Or open in any browser

2. Upload an HTML File

  • Click "Choose HTML File" or drag-drop an .html file
  • Select your HTML file to analyze

3. Click "Scan Website"

The tool will:

  • Parse your HTML
  • Run all accessibility checks
  • Generate a comprehensive report
  • Display results in real-time

4. Review Results

  • Overall Score - 0-100 accessibility rating
  • 6 Category Cards - Detailed results for each audit type
  • Summary Stats - Total and critical issues
  • Detailed Log - Complete list of all findings

5. Download Report

Click "Download Report" to export results as JSON (or CSV/HTML with customization)

6. Take Action

Use recommendations to fix accessibility issues on your website

🔍 Audit Categories Explained

Alt Text Analysis

Why it matters: Blind and visually impaired users rely on alt text to understand images.

What it checks:

  • Images without alt text (missing)
  • Alt text that's too short (< 5 characters)
  • Alt text that's just the filename
  • Descriptive quality of alt text

Example:

<!-- ❌ Bad -->
<img src="photo.jpg" alt="image">

<!-- ✅ Good -->
<img src="photo.jpg" alt="Team of developers collaborating at a conference">

Contrast Ratio

Why it matters: Poor contrast makes text unreadable for users with color blindness or low vision.

What it checks:

  • Color contrast between text and background
  • WCAG AA compliance (4.5:1 for normal text, 3:1 for large)
  • WCAG AAA compliance (7:1 for normal text, 4.5:1 for large)

Standards:

  • Level AA (minimum): 4.5:1 contrast ratio
  • Level AAA (enhanced): 7:1 contrast ratio

Readability Score

Why it matters: Complex text is hard to read for users with cognitive disabilities or ESL readers.

Metrics calculated:

  • Flesch Reading Ease (0-100): Higher = easier to read
    • 90-100: Very easy (5th grade)
    • 60-70: Standard (8th-9th grade)
    • 0-30: Very difficult (college graduate)
  • Flesch-Kincaid Grade Level: Estimated grade level needed
  • Average sentence length: Longer = harder
  • Average word length: Longer words = harder

Semantic HTML

Why it matters: Semantic markup helps screen readers understand page structure.

What it checks:

  • Presence of <main>, <nav>, <header>, <footer>
  • Proper use of structural elements
  • Divs incorrectly used as buttons
  • Document structure quality

Good practice:

<!-- ❌ Bad -->
<div onclick="navigate()">Menu</div>

<!-- ✅ Good -->
<nav>
  <button class="menu-toggle">Menu</button>
</nav>

Form Labels

Why it matters: Users with cognitive disabilities or screen readers need associated labels.

What it checks:

  • All inputs have associated labels
  • Labels use <label> element with for attribute
  • Or inputs have aria-label or title attributes
  • Proper semantic HTML form structure

Good practice:

<!-- ❌ Bad -->
<input type="email" placeholder="Email">

<!-- ✅ Good -->
<label for="email">Email Address</label>
<input type="email" id="email" required>

Heading Hierarchy

Why it matters: Proper heading structure helps users navigate and understand content.

What it checks:

  • Exactly one H1 per page
  • Proper heading hierarchy (H1 → H2 → H3)
  • No skipped heading levels
  • Headings used for structure, not styling

Good practice:

<!-- ❌ Bad -->
<h1>Page Title</h1>
<h3>Section</h3>  <!-- Skipped H2! -->

<!-- ✅ Good -->
<h1>Page Title</h1>
<h2>Main Section</h2>
<h3>Subsection</h3>

📊 Score Interpretation

Overall Score (0-100)

  • 90-100: Excellent - Minimal accessibility issues
  • 75-89: Good - Minor improvements needed
  • 50-74: Fair - Significant work required
  • 25-49: Poor - Major accessibility barriers
  • 0-24: Critical - Severe accessibility problems

💾 Data & Privacy

Local Storage Only

  • All analysis happens in your browser
  • No data sent to external servers
  • Reports stored in browser's localStorage
  • Clear reports at any time

Report Export

  • JSON: Complete structured data
  • CSV: Spreadsheet-compatible format
  • HTML: Formatted, printable report

🔧 Architecture

Modular Design

App (UI Management)
├── Auditor (Orchestration)
│   ├── ContrastChecker
│   ├── ReadabilityChecker
│   ├── AltTextChecker
│   ├── SemanticChecker
│   ├── FormChecker
│   └── HeadingChecker
├── API (External Integration)
└── Exporter (Report Generation)

Class-Based Architecture

Professional, scalable design with:

  • Encapsulation of logic
  • Clear separation of concerns
  • Reusable components
  • Easy testing and maintainability

🚀 Future Enhancements

Phase 2 Features

  • Machine learning-based alt text suggestions (TensorFlow.js)
  • Cloudinary API integration for image analysis
  • Backend for report storage and history
  • WCAG 2.2 compliance checking
  • Performance metrics
  • Keyboard navigation testing
  • Color blindness simulation

Phase 3 Features

  • Browser extension
  • Automated batch scanning
  • Team collaboration features
  • Trends and progress tracking
  • Custom compliance rules

📚 WCAG Standards Reference

This tool checks compliance with WCAG 2.1 (Web Content Accessibility Guidelines):

Key Principles:

  1. Perceivable - Content must be perceivable to users
  2. Operable - Content must be operable via keyboard
  3. Understandable - Content must be understandable
  4. Robust - Content must be robust enough for assistive technologies

Conformance Levels:

  • Level A: Lowest compliance level
  • Level AA: Mid-level compliance (most common target)
  • Level AAA: Highest compliance level

For complete WCAG guidelines, visit: https://www.w3.org/WAI/WCAG21/quickref/

🧪 Testing

Sample HTML File

A test file is included at sample/test.html with intentional accessibility issues:

  • Missing alt text
  • Poor contrast ratios
  • Complex readability
  • Missing form labels
  • Improper heading structure

Use this to test the auditor:

  1. Open index.html
  2. Click "Choose HTML File"
  3. Select sample/test.html
  4. Click "Scan Website"
  5. Review the realistic results

Expected Results

The sample file should report:

  • ~50-60 Overall Score
  • Multiple images with missing alt text
  • Low contrast issues
  • Medium-high reading difficulty
  • Missing form labels

🎓 Educational Value

Perfect for demonstrating:

  • DOM Manipulation - Querying and analyzing HTML
  • Computed Styles - Accessing element styling
  • WCAG Compliance - Accessibility standards
  • Algorithm Design - Readability calculations
  • User Experience - Professional interfaces
  • Business Value - Real-world applications

📋 Code Quality

Best Practices Implemented

  • ✅ Error handling throughout
  • ✅ Input validation
  • ✅ Clear variable naming
  • ✅ Comprehensive comments
  • ✅ Accessible UI design
  • ✅ Responsive layouts
  • ✅ Performance optimization
  • ✅ Cross-browser compatibility

🔐 Browser Compatibility

Browser Version Support
Chrome Latest ✅ Full
Firefox Latest ✅ Full
Safari Latest ✅ Full
Edge Latest ✅ Full
Mobile Modern ✅ Full

📞 Support

Troubleshooting

"Failed to parse HTML"

  • Ensure file is valid HTML
  • Check for XML/XHTML issues
  • Verify file encoding is UTF-8

"No results displayed"

  • Check browser console for errors
  • Ensure JavaScript is enabled
  • Try a different HTML file

"File upload not working"

  • Check file size (must be under 50MB)
  • Verify .html file extension
  • Clear browser cache and reload

📈 Performance

  • File size: < 50KB total
  • Load time: Instant
  • Scan time: 100-500ms for typical pages
  • Memory: < 10MB
  • No external requests: Everything is local

🤝 Contributing

To improve this tool:

  1. Test with real websites
  2. Report issues you find
  3. Suggest additional checks
  4. Share successful use cases

📄 License

Created as an educational and professional tool for web accessibility.

🌍 Making the Web Accessible

Every website should be accessible to everyone, regardless of ability. This tool helps make that happen by:

  • Making accessibility auditing easy
  • Educating developers and business owners
  • Lowering barriers to compliance
  • Creating better experiences for all users

Help us make the web more accessible! 🎯


Version: 1.0.0
Last Updated: February 2024
Created for: Professional developers & non-technical business owners

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors