A simple, responsive typing speed test that lets users practice typing passages at different difficulty levels, with live accuracy feedback and results for time and words per minute (WPM).
- Features
- Project Structure
- Getting Started
- How To Use
- Key Behaviors
- Tech Stack
- Notes & Troubleshooting
- Roadmap Ideas
- Credits
- Difficulty levels: Easy, Medium, Hard (random passage per retry, no immediate repeats)
- Auto-start on typing: timer begins on the first keystroke
- Stop on Enter: press Enter to finish and record results
- Live accuracy feedback: words turn blue when correct, red when incorrect
- Results panel: displays selected level, elapsed time (seconds), and WPM
- Retry flow: loads a new passage in the same difficulty and resets the test
- Fully client-side: HTML, CSS, JavaScript, Bootstrap 5 (CDN)
Type-Racer/
├─ index.html
├─ README.md
└─ assets/
├─ css/
│ └─ style.css
└─ js/
└─ script.js
You can open index.html directly in a browser, but using a local server is recommended so all features (like the Bootstrap bundle) work consistently.
- Open PowerShell in the project folder
- Start a local server:
python -m http.server 8000- Open http://127.0.0.1:8000/ in your browser
If you use a different port, update the URL accordingly.
- Select a difficulty from the dropdown
- Start typing in the textbox (timer starts automatically)
- Press Enter to stop the test
- See your Level, Time (in seconds), and WPM in the Results panel
- Click Retry to load a new sentence at the same difficulty and try again
- Live feedback: as you type, each word in the sample text is compared to your input word-by-word
- Correct words: blue
- Incorrect words: red
- WPM calculation: based on total characters typed, using the standard 5-characters-per-word formula
- Retry: clears the input, resets results, and loads a new random passage at the current difficulty (avoids immediate repeats when possible)
- HTML5, CSS3, JavaScript (no frameworks)
- Bootstrap 5 via CDN (layout and modal)
- If styles look off, ensure you have an internet connection for the Bootstrap CDN.
- The Instructions modal is moved to
document.bodyat runtime to avoid container clipping. - If Enter inserts a new line instead of stopping, ensure the Bootstrap JS bundle isn’t interfering and that
script.jsloads after the DOM.
- Real-time per-character highlighting and caret alignment
- Accuracy percentage and error counts
- Personal best history (localStorage)
- Shareable results and leaderboard
- Mobile keyboard optimizations and better screen-reader support
Built as a practice project to learn DOM manipulation, event handling, and basic UX for typing tests.