Skip to content

Add Morse Code Translator tool#5

Open
anshulkhare7 wants to merge 1 commit into
mainfrom
claude/morse-code-translator-D0N5o
Open

Add Morse Code Translator tool#5
anshulkhare7 wants to merge 1 commit into
mainfrom
claude/morse-code-translator-D0N5o

Conversation

@anshulkhare7
Copy link
Copy Markdown
Owner

Summary

This PR adds a new interactive Morse Code Translator tool that allows users to encode text to Morse code and decode Morse code back to text, with audio playback capabilities.

Key Changes

  • New tool: tools/morse-code.html - A complete, self-contained Morse code translator application
  • Bidirectional translation:
    • Text to Morse code conversion with real-time rendering
    • Morse code to text decoding with support for standard notation (dots, dashes, spaces, and forward slashes for word separation)
  • Audio playback: Web Audio API integration to play Morse code as audio tones (600 Hz sine wave) with proper timing (dots, dashes, and gaps)
  • Visual feedback:
    • Character-by-character highlighting during audio playback
    • Real-time output rendering as user types
    • Toast notifications for user actions
  • Reference chart: Collapsible reference guide showing Morse code mappings for A-Z and 0-9
  • Responsive design: Mobile-friendly layout with dark theme and accessible UI
  • User controls:
    • Tab-based mode switching between encoding and decoding
    • Play/Stop audio buttons
    • Copy output to clipboard functionality

Implementation Details

  • Comprehensive Morse code character mapping (A-Z, 0-9)
  • Proper timing implementation: dots (0.1s), dashes (0.3s), symbol gaps (0.1s), letter gaps (0.3s), word gaps (0.7s)
  • Visual highlighting synchronized with audio playback using requestAnimationFrame
  • Audio context management with proper initialization and cleanup
  • Semantic HTML structure with embedded CSS and JavaScript for easy deployment

https://claude.ai/code/session_01LpqLzE3ZbsHLg5ppdp5KUq

Bidirectional translator (Text-to-Morse and Morse-to-Text) with
real-time conversion, audio playback via Web Audio API, visual
highlighting during playback, copy-to-clipboard, and a collapsible
A-Z/0-9 reference chart. Dark theme with amber/gold telegraph aesthetic.

https://claude.ai/code/session_01LpqLzE3ZbsHLg5ppdp5KUq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants