-
Notifications
You must be signed in to change notification settings - Fork 841
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
130 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Game_Name | ||
|
||
## Description 📃 | ||
|
||
[Game_Name] is a simple yet engaging Morse Code generator. It allows users to convert regular text input into Morse Code, a method of encoding text characters using sequences of dots and dashes. | ||
|
||
## Functionalities 🎮 | ||
|
||
- Translate regular text input into Morse Code representations. | ||
- Display the translated Morse Code output alongside the input text. | ||
- Handle whitespace characters (spaces) between words in the input text. | ||
- Provide real-time conversion, updating the Morse Code output as the user types or modifies the input text. | ||
- Ensure case insensitivity, allowing both uppercase and lowercase characters in the input text. | ||
- Handle errors gracefully, such as invalid characters that cannot be translated into Morse Code. | ||
|
||
## How to play? 🕹️ | ||
|
||
1. Input the desired text into the provided text field. | ||
2. The Morse Code equivalent of the input text will be displayed in real-time. | ||
3. Copy the Morse Code output if needed for further use or communication. | ||
|
||
## Screenshots 📸 | ||
![image](https://github.com/Saipradyumnagoud/GameZone/assets/143107589/d1418c4e-6db9-4cb8-86e0-e8ab971de658) | ||
|
||
|
||
|
||
## Working video 📹 | ||
|
||
|
||
|
||
https://github.com/Saipradyumnagoud/GameZone/assets/143107589/799ff7d0-18ac-4068-9026-8b0980b706b7 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Morse Code Generator</title> | ||
<link rel="stylesheet" href="style.css"> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<h1>Morse Code Generator</h1> | ||
<textarea id="input-text" placeholder="Enter text to convert"></textarea> | ||
<br> | ||
<button id="convert-btn">Convert to Morse Code</button> | ||
|
||
<textarea id="output-morse" placeholder="Morse Code will appear here"></textarea> | ||
</div> | ||
<script src="script.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
document.getElementById('convert-btn').addEventListener('click', function() { | ||
const inputText = document.getElementById('input-text').value.trim().toLowerCase(); | ||
const morseCode = convertToMorse(inputText); | ||
document.getElementById('output-morse').value = morseCode; | ||
}); | ||
|
||
function convertToMorse(text) { | ||
const morseCodeMap = { | ||
'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': '--..', | ||
'0': '-----', '1': '.----', '2': '..---', '3': '...--', '4': '....-', '5': '.....', '6': '-....', | ||
'7': '--...', '8': '---..', '9': '----.' | ||
}; | ||
|
||
return text.split('').map(char => { | ||
if (char === ' ') { | ||
return '/'; | ||
} else if (morseCodeMap[char]) { | ||
return morseCodeMap[char]; | ||
} else { | ||
return ''; | ||
} | ||
}).join(' '); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
body { | ||
font-family: Arial, sans-serif; | ||
} | ||
|
||
.container { | ||
max-width: 600px; | ||
margin: 0 auto; | ||
text-align: center; | ||
padding: 20px; | ||
} | ||
|
||
textarea { | ||
width: 100%; | ||
margin-bottom: 10px; | ||
padding: 10px; | ||
resize: none; | ||
} | ||
|
||
button { | ||
padding: 10px 20px; | ||
background-color: #007bff; | ||
color: #fff; | ||
border: none; | ||
cursor: pointer; | ||
transition: background-color 0.3s; | ||
} | ||
|
||
button:hover { | ||
background-color: #0056b3; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters