forked from kunjgit/GameZone
-
Notifications
You must be signed in to change notification settings - Fork 0
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
609 changed files
with
31,366 additions
and
14,319 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
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
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
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 |
---|---|---|
|
@@ -10,6 +10,8 @@ body { | |
#6284ff 50%, | ||
#ff0000 100% | ||
); | ||
overflow:hidden; | ||
background-repeat: no-repeat; | ||
} | ||
|
||
h1 { | ||
|
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
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
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
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
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
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
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
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
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,9 @@ | ||
## Child Learning Game | ||
|
||
### Type Any English Alphabet and Hear the Word for that | ||
|
||
### __ScreenShots:__ | ||
![Child Game](https://github.com/Samriddhi15/GameZone/assets/106501626/08628882-3a78-454e-8f38-3d8d5a8162a3) | ||
|
||
### __Video:__ | ||
![169116099-401b10ea-b7bf-4d3c-aaa0-8993f4358e27](https://github.com/Samriddhi15/GameZone/assets/106501626/3400df6e-e5b7-4a91-9c5b-974361a3bd18) |
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,46 @@ | ||
<!DOCTYPE html> | ||
<html lang="en" > | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Child Learning Game</title> | ||
<link rel="stylesheet" href="./style.css"> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" /> | ||
</head> | ||
<body> | ||
<!-- partial:index.partial.html --> | ||
<audio preload="auto"> | ||
<source id="oggSource" src="sounds/ogg/like-glass.ogg" type="audio/ogg"> | ||
<source id="mp3Source" src="sounds/mp3/like-glass.mp3" type="audio/mp3"> | ||
Oops! Looks like you're using an old browser, try using a modern browser like Google Chrome, Firefox or even Safari. | ||
</audio> | ||
|
||
<div class="main-cont"> | ||
<div style="text-align: left; margin-left: 20px; | ||
margin-top: 10px; | ||
font-size: 30px; "><a href="/index.html"><i style="color:white;" class="fas fa-home home-icon"></i></a></div> | ||
<div id="about-cont"> | ||
<div class="content-wrapper"> | ||
<div class="about-white-bg"> | ||
<h2 class="about-title">A simple game to teach kids the English alphabets</h2> | ||
<div class="about-image"></div> | ||
<p class="about-text text-sounds-source"> | ||
Alphabet sounds from <a href="http://www.theblog.ca/mp3-audio-files-alphabet" target="_blank">Peter's Useful Crap</a> | ||
</p> | ||
<button id="hide-button" type="button" name="button">Hide</button> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="char-cont"> | ||
<p id="big-char" class="char animationHabibi"> | ||
Type any letter | ||
</p> | ||
</div> | ||
<footer> | ||
<button id="mute-button" class="habibi-button" type="button" name="button">Mute Sounds</button> | ||
<button id="about-button" class="habibi-button" type="button" name="button">About</button> | ||
</footer> | ||
</div> | ||
<!-- partial --> | ||
<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,126 @@ | ||
// Declaring stuff | ||
myName = ""; // declaring a variable for my easter egg | ||
audioPlayer = document.getElementsByTagName('audio')[0]; | ||
|
||
// ------ Functions ------ | ||
// Getting the letter sound and playing it. | ||
function setLetterSound(letterVariable) { | ||
var mp3Source = document.getElementById('mp3Source'); | ||
var oggSource = document.getElementById('oggSource'); | ||
mp3Source.src = 'https://mahdif.github.io/alphabets-game/sounds/mp3/' + letterVariable +'.mp3'; | ||
oggSource.src = 'https://mahdif.github.io/alphabets-game/sounds/ogg/' + letterVariable +'.ogg'; | ||
} | ||
|
||
function setGenericSound() { | ||
var mp3Source = document.getElementById('mp3Source'); | ||
var oggSource = document.getElementById('oggSource'); | ||
mp3Source.src = 'https://mahdif.github.io/alphabets-game/sounds/mp3/like-glass.mp3'; | ||
oggSource.src = 'https://mahdif.github.io/alphabets-game/sounds/ogg/like-glass.ogg'; | ||
} | ||
|
||
// Generating a new element to restart the CSS3 animation. | ||
function generateNewElement() { | ||
var elm = document.getElementById('big-char'); | ||
var newone = elm.cloneNode(true); | ||
elm.parentNode.replaceChild(newone, elm); | ||
} | ||
|
||
// Running the HTML5 audio player | ||
function runAudioPlayer() { | ||
audioPlayer.load(); // pre loading the audi file | ||
// audioPlayer.currentTime = 0; // start the audio from the beginning | ||
audioPlayer.play(); // play the audio | ||
} | ||
|
||
// Show and hide the about | ||
document.getElementById('hide-button').onclick = function() { | ||
document.getElementById('about-cont').style.display = "none"; | ||
} | ||
document.getElementById('about-button').onclick = function() { | ||
document.getElementById('about-cont').style.display = "block"; | ||
} | ||
|
||
// On mobile, when the user taps on "Show Keyboard" move the focus to the hidden input | ||
document.getElementById('show-keyboard-button').onclick = function() { | ||
document.getElementById('mobile-text-input').focus(); | ||
} | ||
|
||
document.onkeypress = function(event){ // Do stuff when you press any key in the document | ||
|
||
letterOnScreen = document.getElementById('big-char'); // get the element properties | ||
console.log(event.charCode); | ||
if ( // if use pressed on any of these characters which are not numbers or letters | ||
event.charCode === 13|| | ||
event.charCode === 32|| | ||
event.charCode === 92|| | ||
event.charCode === 96|| | ||
event.charCode === 61|| | ||
event.charCode === 43|| | ||
event.charCode === 45|| | ||
event.charCode === 33|| | ||
event.charCode === 64|| | ||
event.charCode === 35|| | ||
event.charCode === 36|| | ||
event.charCode === 37|| | ||
event.charCode === 94|| | ||
event.charCode === 38|| | ||
event.charCode === 42|| | ||
event.charCode === 40|| | ||
event.charCode === 41|| | ||
event.charCode === 95|| | ||
event.charCode === 91|| | ||
event.charCode === 93|| | ||
event.charCode === 34|| | ||
event.charCode === 39|| | ||
event.charCode === 47|| | ||
event.charCode === 63|| | ||
event.charCode === 62|| | ||
event.charCode === 44|| | ||
event.charCode === 60|| | ||
event.charCode === 46|| | ||
event.charCode === 59|| | ||
event.charCode === 58|| | ||
event.charCode === 123|| | ||
event.charCode === 124|| | ||
event.charCode === 125|| | ||
event.charCode === 126 | ||
) { | ||
if (event.charCode === 13) { // getting the Enter key | ||
letterOnScreen.innerHTML = "Enter"; | ||
} else if (event.charCode === 32) { | ||
letterOnScreen.innerHTML = "Space"; | ||
} else { | ||
letterOnScreen.innerHTML = String.fromCharCode(event.charCode); | ||
} | ||
setGenericSound(); // Set the generic sound in the resources of the audio tag | ||
runAudioPlayer(); // Play sound | ||
generateNewElement(); // Generate new DOM element to restart the animation | ||
} else { | ||
letterOnScreen.innerHTML = String.fromCharCode(event.charCode); // getting the pressed character | ||
pressedLetter = String.fromCharCode(event.charCode).toLowerCase(); // passing the pressed letter to the function to add it to sources | ||
setLetterSound(pressedLetter); | ||
runAudioPlayer(); // Play sound | ||
generateNewElement(); // Generate new DOM element to restart the animation | ||
} | ||
|
||
// An easter egg, if you type my name | ||
myName += String.fromCharCode(event.charCode); | ||
console.log(myName); | ||
if (myName==="mahdi") { | ||
alert('You typed my name!\n--------------------------------\nNow I will show you my profile.'); | ||
window.open('https://github.com/Samriddhi15','_blank'); | ||
} | ||
|
||
} | ||
|
||
|
||
// Mute button | ||
document.getElementById('mute-button').onclick = function() { | ||
if (audioPlayer.muted === false) { | ||
audioPlayer.muted = true; | ||
document.getElementById('mute-button').innerHTML = "Unmute Sounds"; | ||
} else { | ||
audioPlayer.muted = false; | ||
document.getElementById('mute-button').innerHTML = "Mute Sounds"; | ||
} | ||
} |
Oops, something went wrong.