A simple web-based reaction timer game built with HTML, CSS, and JavaScript.
- Start button to begin a round
- Random delay before the signal appears
- Visual cue (green background) when it's time to click
- Reaction time displayed in milliseconds
- History of the last 10 attempts with color coding:
- Green: faster than the previous attempt
- Red: slower than the previous attempt
- Default: most recent attempt (until compared)
- Click the "Start" button
- Wait for the screen to turn green and display "CLICK!"
- Click as quickly as possible when you see the signal
- Your reaction time (in ms) will be displayed
- Continue playing to build your history
- Uses
performance.now()for high-resolution timing - Listens for
mousedownevents for slightly better responsiveness thanclick - Stores reaction times in an array, keeping only the last 10 attempts
- Color coding compares each attempt with the next most recent one
Adjust the following variables in the JavaScript to change game behavior:
- Delay range: currently 2000-5000ms (2-5 seconds)
- History length: currently 10 attempts
- Colors: modify the CSS variables for different themes
- HTML5
- CSS3 (with flexbox layout)
- Vanilla JavaScript (no frameworks)
This project is open source and available for modification and distribution.