In < 1000 lines of code, practice any dictionary and get targeted feedback and statistics per character and pair of characters, like Keybr. Right now, common Rust programming keywords are the dictionary.
Demo here: https://keybr.onrender.com/
![image](https://private-user-images.githubusercontent.com/4804438/248170382-ad518ed6-67ba-4452-b598-ca3fd2df3ec6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ3Njk2OTEsIm5iZiI6MTcyNDc2OTM5MSwicGF0aCI6Ii80ODA0NDM4LzI0ODE3MDM4Mi1hZDUxOGVkNi02N2JhLTQ0NTItYjU5OC1jYTNmZDJkZjNlYzYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgyNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MjdUMTQzNjMxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NjA2NTkyMDA1ODkxZDBkODQ4MWQ3ODFmNThhNGIwYjJiOWFjNmU0MTg0M2Q0OWJiMWI5MzQ2YWU5NGE2Zjg4ZiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.4zWBSbDrufmFW1Qqgp6YAcrI7rZDzd9gDiSRHw-bqNc)
yarn install
tsc typingAnalysis.ts
Open index.html in browser.
If you're interested in this and want to contribute, there are a lot of cool things you can add!
- Add the ability for people to select different dictionaries or programming languages
- Add the ability to make this an extension inside vscode, that tracks and gives real time stats as you work
- Call the localstorage getter code on startup to populate your profile with your past stats
- Make the UI nicer and closer to keybr's
- Lay out the keys in a grid instead of a list
- Put results in multiple coloumns to reduce scroll distance
Done
- Ignore keystrokes that take more than 5 seconds, to assume you took a break
This code was ~80% written with GPT-4 in Cursor IDE. Here was the initial prompt:
generate typescript code for a simple browser website that analyzes your typing. have it display a few sentences at a time that it asks you to type. overlay your typing beneath it, highlighting red characters when you get something wrong, green if its correct, and yellow if you previously got it wrong but then went back and got it correct. if a letter is wrong, do not allow progression of the cursor and force the user to backspace their errors.
display at the bottom the statistics for each lowercase letter, symbol, and capital letter, and highlight it lighter if the accuracy-adjusted WPM is high, and darker if its lower. calculate this average as a time-adjusted weighting of the history where recent updates are more heavily considered.
also show on the side the 10 most missed individual keys and the 10 most missed pairs of keys, including shift and punctuation.
have a nice user interface like keybr.
Linked here is the full transcript of the discussion, not including the Cursor prompts and manual tweaks.