Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
bhaveshnegi authored Jun 10, 2024
2 parents df7aba2 + 35854f8 commit 6c1817e
Show file tree
Hide file tree
Showing 8 changed files with 130 additions and 6 deletions.
33 changes: 33 additions & 0 deletions Games/Morse_Code_Generator/README.md
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


21 changes: 21 additions & 0 deletions Games/Morse_Code_Generator/index.html
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>
26 changes: 26 additions & 0 deletions Games/Morse_Code_Generator/script.js
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(' ');
}
31 changes: 31 additions & 0 deletions Games/Morse_Code_Generator/style.css
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;
}

19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div style="display:none;" align="center"><h1>
<img src="https://raw.githubusercontent.com/Tarikul-Islam-Anik/Animated-Fluent-Emojis/master/Emojis/Activities/Video%20Game.png" alt="Video Game" width="50" height="50" /><font size="10"> GameZone</font></h1>
<img src="https://raw.githubusercontent.com/Tarikul-Islam-Anik/Animated-Fluent-Emojis/master/Emojis/Activities/Video%20Game.png" alt="Video Game" width="50" height="50" /><font size="10">GameZone</font></h1>

<!-- repo intro -->

Expand Down Expand Up @@ -338,6 +338,17 @@ This repository also provides one such platforms where contributers come over an
| [Taash_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Taash_Game)|
| [Number_Guessing_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Number_Guessing_Gam)|
| [Language Learner Adventure](https://github.com/kunjgit/GameZone/tree/main/Games/Language_Learner_Adventure)|
| [Rapid_click_frenzy](https://github.com/kunjgit/GameZone/tree/main/Games/Rapid_click_frenzy) |
| [Dsa_quiz_game](https://github.com/kunjgit/GameZone/tree/main/Games/Dsa_quiz_game) |
| [Gravity_Simulation_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Gravity_Simulation_Game) |
| [Anagarm-Word-Game](https://github.com/kunjgit/GameZone/tree/main/Games/Anagarm-Word-Game) |
| [Brick Buster Game](https://github.com/kunjgit/GameZone/tree/main/Games/Brick%20Buster) |
| [Rapid_click_frenzy](https://github.com/kunjgit/GameZone/tree/main/Games/Rapid_click_frenzy) |
| [Penguins Can't Fly](https://github.com/Will2Jacks/GameZoneForked/tree/Task/Games/Penguins_Can't_Fly) |
| [Intellect Quest](https://github.com/Will2Jacks/GameZoneForked/tree/Task/Games/Intellect_Quest) |
| [Taash_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Taash_Game) |
| [Number_Guessing_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Number_Guessing_Game) |

</center>

<br>
Expand Down Expand Up @@ -390,7 +401,7 @@ Terms and conditions for use, reproduction and distribution are under the [Apach
<br>

- This project thanking all the contributors for having your valuable contribution to our project
- Make sure you show some love by giving ⭐ to our repository
- Make sure you show some love by giving ⭐ to our repository

<br>

Expand All @@ -400,4 +411,6 @@ Terms and conditions for use, reproduction and distribution are under the [Apach
</a>
</center>
<br>
<p align="right"><a href="#top">Back to top</a></p>

<p align="right"><a href="#top">Back to top </a></p>

Binary file added assets/images/Morse_Code_Generator.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/demo_bug.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@

<!-- About section -->

<div class="zoomIn" id="about">
<div class="zoomIn" id="about" style="color:aqua;">

Welcome to our website! Your ultimate destination for a vast collection of free-to-play games. Dive into a world of
endless entertainment and excitement as you explore our diverse selection of games, ranging from timeless classics to
Expand Down Expand Up @@ -233,9 +233,9 @@

<!-- Contributors section -->
<div class="contributors">
<h1 style="font-family: 'Agency FB', Times, serif;">Our Valuable Contributors</h1>
<h1 style="font-family: 'Agency FB', Times, serif; color: aqua;">Our Valuable Contributors</h1>
<!-- display number of contributors-->
<h2 id="total-contributors" style="text-align: center; font-family: 'Agency FB', Times, serif;"></h2>
<h2 id="total-contributors" style="text-align: center; font-family: 'Agency FB', Times, serif; color: aqua;"></h2>
<div id="contributor"></div>
<div class="pagination" id="pagination"></div>
</div>
Expand Down

0 comments on commit 6c1817e

Please sign in to comment.