A comprehensive Morse code learning and typing application with practice and challenge modes, featuring real-time feedback, scoring, and adaptive timing.
- Single-key input: Uses spacebar (configurable) for all Morse code input
- Real-time timing analysis: Distinguishes dots, dashes, and pauses based on press duration
- Adaptive timing: Adjusts thresholds based on user WPM settings
- Visual feedback: Progress bars, character prediction, timing guides, and target word highlighting
- Free-form Morse code typing
- Real-time character prediction
- Word completion detection
- Statistics tracking (characters, words, time, WPM)
- Random word challenges: Fetches random words from API for typing practice
- Real-time highlighting: Target word highlights in green as you type correct characters
- Scoring system: Points awarded based on word length using arithmetic series formula
- Performance feedback: Success/failure dialogs with detailed scoring
- Score persistence: Maintains score across mode switches
- Export options: Plain text, Morse log, and detailed JSON reports
- Settings: Customizable key binding, WPM targets, themes, and custom Morse codes
- Audio feedback: Beeps for dots and dashes
- Responsive UI: Dark/light theme support
morse-typing-system/
├── index.html # Main UI layout (moved from src/html/)
├── css/
│ └── styles.css # Styling with themes and animations
├── js/
│ └── modules/
│ ├── App.js # Main application logic and UI orchestration
│ ├── MorseInputHandler.js # Key input handling and timing
│ ├── MorseParser.js # Morse-to-text conversion and custom codes
│ └── TimingEngine.js # WPM calculations and timing thresholds
├── netlify.toml # Netlify deployment configuration
├── .gitignore # Git ignore rules
├── babel.config.cjs # Babel configuration
├── package.json # Dependencies and scripts
├── PROJECT_COMPLETE.md # Project completion documentation
├── README.md # This file
├── spec_morse_typing.txt # Project specifications
├── src/ # Original source files (for development)
│ ├── css/
│ ├── html/
│ └── js/
└── test/
└── unit/ # Comprehensive unit test suite
├── App.test.js # App logic and Challenge mode tests
├── MorseInputHandler.test.js
├── MorseParser.test.js
└── TimingEngine.test.js
- Clone the repository
- Install dependencies:
npm install
- For local development, open
index.htmlin your browser
- Build/copy files to root structure:
# Files are already restructured for deployment # index.html, css/, js/ are at root level
- Go to Netlify
- Drag and drop the entire project folder or zip it first
- Netlify will automatically detect and deploy
- Push your code to GitHub/GitLab
- Connect your repository to Netlify
- Netlify will auto-deploy on pushes to main branch
netlify.tomlconfigures the build settings- Publish directory is set to root (
.) - No build command needed (static site)
- SPA redirect configured for client-side routing
-
Choose Mode:
- Practice: Free typing with statistics
- Challenge: Type random words for points
-
Morse Code Input:
- Press and hold spacebar for dots (50-200ms)
- Press and hold longer for dashes (300-800ms)
- Pause between elements (50-300ms)
- Pause longer between letters (500-1200ms)
- Pause even longer between words (1500ms+)
- Target Word Display: Shows the word you need to type
- Real-time Highlighting: Correctly typed characters turn green in the target word
- Scoring: Earn points based on word length (longer words = more points)
- Feedback Dialogs: Success shows points earned, failure shows final score before reset
- Click "Settings" to adjust:
- Key binding (default: spacebar)
- Target WPM for timing calibration
- Theme (dark/light)
- Custom Morse code mappings
- Unknown character handling
- Text: Plain text output
- Morse Log: Detailed timing and sequence data
- JSON Report: Comprehensive session statistics
- App.js: Main orchestrator handling UI, mode switching, Challenge logic, and user interactions
- MorseInputHandler.js: Manages keyboard input, detects press/release events, and classifies timing
- MorseParser.js: Converts Morse sequences to characters, supports custom mappings
- TimingEngine.js: Calculates WPM, manages timing thresholds, classifies pauses
- Word Fetching: Retrieves random words from external API
- Progress Tracking: Monitors typing progress against target word
- Scoring Algorithm: Uses
score(n) = n(n+1)/2for arithmetic series progression - State Management: Handles score persistence and mode transitions
- Dot: 50-200ms press
- Dash: 300-800ms press
- Element separator: 50-300ms pause
- Letter separator: 500-1200ms pause
- Word separator: 1500ms+ pause
Run the comprehensive test suite:
npm testTest coverage includes:
- Input handling and timing classification
- Morse code parsing and character lookup
- Timing calculations and WPM computation
- Challenge mode logic and scoring
- UI interactions and export functionality
- Mode switching and state management
- Create new functionality in appropriate module
- Add comprehensive tests in
test/unit/ - Update UI components if needed
- Ensure all tests pass
Supports standard International Morse Code plus custom mappings:
- A: .-
- B: -...
- C: -.-.
- D: -..
- E: .
- F: ..-.
- G: --.
- H: ....
- I: ..
- J: .---
- K: -.-
- L: .-..
- M: --
- N: -.
- O: ---
- P: .--.
- Q: --.-
- R: .-.
- S: ...
- T: -
- U: ..-
- V: ...-
- W: .--
- X: -..-
- Y: -.--
- Z: --..
- Numbers 0-9 and custom characters
This project is open source. See LICENSE file for details.
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
© 2025 - Developed by Eggplant203 🍆