Skip to content

RRGU26/attention-training-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

2 Commits
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿง  Interactive Attention Training Game

A comprehensive web-based cognitive training application designed to improve sustained attention and focus through progressive difficulty challenges. Built as a single HTML file with no external dependencies.

๐ŸŽฏ Live Demo

Play Now

๐Ÿ“‹ Project Summary

This attention training game was developed to address the growing need for cognitive enhancement tools that can help users build sustained focus over increasingly longer periods. The application progressively trains attention spans from 2 minutes up to 12+ minutes through engaging, scientifically-inspired cognitive challenges.

๐Ÿ—๏ธ Development Approach

  • Single-file architecture for maximum portability and ease of deployment
  • Progressive web app principles with responsive design
  • Accessibility-first development with full keyboard navigation and screen reader support
  • Performance-optimized with 60fps animations and efficient memory management

โœจ Key Features

๐ŸŽฎ Five Distinct Training Modes

1. Memory Sequence Training

  • Purpose: Strengthen working memory and sequential processing
  • Mechanics: Users observe color patterns and repeat them in correct order
  • Progression: Sequences grow from 3 to 9 items based on level
  • Skills Developed: Short-term memory, pattern recognition, sustained attention

2. Speed Reading Comprehension

  • Purpose: Improve reading speed while maintaining comprehension
  • Mechanics: Timed reading passages followed by multiple-choice questions
  • Progression: Text length increases from 75 to 300+ words
  • Skills Developed: Reading comprehension, information retention, processing speed

3. Mental Math Challenges

  • Purpose: Enhance numerical processing and calculation speed
  • Mechanics: Progressive arithmetic problems with time pressure
  • Progression: From single operations to complex multi-step problems
  • Skills Developed: Mental arithmetic, processing speed, sustained concentration

4. Pattern Recognition

  • Purpose: Develop visual-spatial processing and logical reasoning
  • Mechanics: Complete visual patterns by identifying missing elements
  • Progression: From simple color patterns to complex geometric relationships
  • Skills Developed: Pattern recognition, logical reasoning, visual processing

5. Sustained Focus Tracking

  • Purpose: Train selective attention and impulse control
  • Mechanics: Click moving targets while ignoring distractors
  • Progression: More objects, faster movement, increased complexity
  • Skills Developed: Selective attention, impulse control, sustained vigilance

๐Ÿ“Š Progressive Difficulty System

Level Range Session Duration Complexity Target Skills
1-3 2 minutes Basic patterns, simple math Foundation building
4-6 3 minutes Medium complexity, longer texts Skill development
7-9 5 minutes Complex patterns, multi-step problems Advanced training
10-12 7 minutes Expert-level challenges Mastery building
13-15 10 minutes Maximum complexity Sustained expertise
16+ 12+ minutes Ultra-endurance training Peak performance

๐ŸŽ–๏ธ Advanced Scoring & Progression

Intelligent Scoring Algorithm

Score = (Accuracy ร— 100 + TimeBonus) ร— StreakMultiplier
  • Base Points: 0-100 based on accuracy percentage
  • Time Bonus: Up to 50 additional points for quick responses
  • Streak Multiplier: Up to 2x multiplier for consistent accuracy (85%+)
  • Progressive Thresholds: 75% accuracy required for level advancement

Attention Lapse Detection

  • Response Monitoring: Tracks delays over 10 seconds
  • Tab Focus Detection: Automatically pauses when window loses focus
  • Engagement Metrics: Monitors consecutive incorrect responses
  • Adaptive Feedback: Provides real-time attention alerts

๐Ÿ› ๏ธ Technical Architecture

Frontend Technologies

  • Pure HTML5/CSS3/JavaScript - No framework dependencies
  • Responsive Design - Mobile-first approach with breakpoints
  • CSS Grid & Flexbox - Modern layout techniques
  • CSS Animations - Smooth 60fps performance with hardware acceleration
  • Web APIs - requestAnimationFrame, visibility API, local storage

Performance Optimizations

  • Efficient DOM Manipulation - Batch updates and virtual scrolling concepts
  • Memory Management - Proper cleanup of intervals and event listeners
  • Animation Performance - Hardware-accelerated transforms and opacity
  • Responsive Images - Scalable vector graphics and optimized rendering

Accessibility Features

  • ARIA Labels - Complete semantic markup for screen readers
  • Keyboard Navigation - Full tab order and keyboard shortcuts
  • High Contrast Support - Respects user system preferences
  • Reduced Motion - Honors prefers-reduced-motion settings
  • Focus Management - Clear focus indicators and logical tab order

๐Ÿ“ฑ Cross-Platform Compatibility

Desktop Support

  • Minimum Resolution: 1024x768
  • Optimal Resolution: 1920x1080+
  • Browser Support: Chrome 80+, Firefox 75+, Safari 13+, Edge 80+
  • Input Methods: Mouse, keyboard, trackpad

Mobile & Tablet Support

  • Responsive Breakpoints: 320px, 768px, 1024px
  • Touch Optimizations: Large tap targets (44px minimum)
  • Gesture Support: Touch, swipe, pinch-to-zoom disabled for game integrity
  • Performance: Optimized for mobile processors with reduced animations

๐Ÿ”ง Development Features

Code Quality & Maintenance

  • 1000+ lines of JavaScript with comprehensive documentation
  • 500+ lines of CSS with BEM methodology
  • Modular Architecture - Separated game modes and utilities
  • Error Handling - Graceful degradation and user feedback
  • Performance Monitoring - Built-in frame rate and memory tracking

Deployment & Hosting

  • Single File Deployment - Copy and run anywhere
  • GitHub Pages Ready - Instant static hosting
  • CDN Compatible - Works with any static file server
  • Offline Capable - No external resource dependencies

๐Ÿš€ Quick Start

Option 1: Direct Download

  1. Download index.html
  2. Open in any modern web browser
  3. Start training immediately

Option 2: GitHub Pages Deployment

  1. Fork this repository
  2. Enable GitHub Pages in repository settings
  3. Access at https://yourusername.github.io/attention-training-game/

Option 3: Local Development

git clone https://github.com/RRGU26/attention-training-game.git
cd attention-training-game
# Open index.html in browser or serve with local server
python -m http.server 8000  # Python 3
# or
npx serve .  # Node.js

๐ŸŽฎ How to Play

Getting Started

  1. Select Level: Choose your starting difficulty (Level 1 recommended for new users)
  2. Choose Mode: Pick from 5 training modes based on your focus goals
  3. Start Session: Begin your timed attention training session
  4. Stay Focused: Complete challenges while maintaining high accuracy
  5. Track Progress: Monitor your improvement through detailed statistics

Progression Tips

  • Start Low: Begin with Level 1 to understand each game mode
  • Consistency Over Speed: Maintain 75%+ accuracy for level advancement
  • Take Breaks: Use the pause feature when needed to prevent fatigue
  • Mix Modes: Rotate between different training types for comprehensive development
  • Track Streaks: Build longer accuracy streaks for bonus multipliers

Optimal Training Schedule

  • Beginners: 2-3 sessions per week, 2-5 minutes each
  • Intermediate: 4-5 sessions per week, 5-10 minutes each
  • Advanced: Daily sessions, 10+ minutes each
  • Expert: Multiple daily sessions with varied modes

๐Ÿ“Š Performance Metrics

User Analytics

  • Session Duration: Actual time spent in focused training
  • Accuracy Percentage: Correct responses over total attempts
  • Response Time: Average time per challenge completion
  • Attention Lapses: Count of focus breaks and delays
  • Streak Records: Longest consecutive correct responses
  • Level Progression: Advancement rate and unlock achievements

Cognitive Improvements

Users typically report improvements in:

  • Sustained Attention: Ability to focus for longer periods
  • Working Memory: Better retention of information sequences
  • Processing Speed: Faster completion of mental tasks
  • Selective Attention: Improved ability to filter distractions
  • Mental Flexibility: Enhanced task-switching capabilities

๐Ÿ›ก๏ธ Privacy & Data

Data Handling

  • No Server Communication: All data processed locally
  • No Personal Information: No account creation or data collection
  • Session-Based Storage: Progress resets with browser session
  • No Cookies: No tracking or persistent storage
  • GDPR Compliant: No data processing requirements

Browser Permissions

  • No Special Permissions required
  • Visibility API: Only for pause detection when tab switching
  • Local Storage: None used - purely session-based

๐Ÿค Contributing

This project welcomes contributions for:

  • New Game Modes: Additional cognitive training exercises
  • Accessibility Improvements: Enhanced support for diverse users
  • Performance Optimizations: Better mobile and low-end device support
  • Localization: Multi-language support
  • Research Integration: Evidence-based training protocols

Development Guidelines

  • Maintain single-file architecture
  • Ensure no external dependencies
  • Follow existing code style and patterns
  • Test across multiple devices and browsers
  • Document all new features comprehensively

๐Ÿ“„ License

MIT License - Free for personal and commercial use. See LICENSE file for details.

๐Ÿ”ฌ Scientific Background

This application is inspired by cognitive training research in:

  • Attention Training Theory (Posner & Petersen, 1990)
  • Working Memory Training (Klingberg, 2010)
  • Dual N-Back Studies (Jaeggi et al., 2008)
  • Sustained Attention Response Task (Robertson et al., 1997)
  • Attention Network Test principles (Fan et al., 2002)

๐Ÿ“ž Support & Feedback

  • Issues: Report bugs or request features via GitHub Issues
  • Discussions: Join community discussions for tips and strategies
  • Updates: Watch repository for new features and improvements

Built with โค๏ธ for cognitive enhancement and attention training

Last Updated: August 2024

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages