diff --git a/.github/workflows/pr_tags.yaml b/.github/workflows/pr_tags.yaml index 726c629b88..44f8d599d4 100644 --- a/.github/workflows/pr_tags.yaml +++ b/.github/workflows/pr_tags.yaml @@ -75,4 +75,4 @@ # labels: prLabels.map(function(label) { # return label.name; # }) -# }); +# }); \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..5c297ee2ea --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ + +assets/images/Pixel_Painter.png diff --git a/Games/Anagram -Word-Game/README.md b/Games/Anagram -Word-Game/README.md new file mode 100644 index 0000000000..2fa0b996d7 --- /dev/null +++ b/Games/Anagram -Word-Game/README.md @@ -0,0 +1,43 @@ +# **Anagram Word Game** + +--- + +
+ +## **Description ๐Ÿ“ƒ** + +- Anagram Word Game is an engaging web-based game where players are challenged to unscramble a given set of letters to form a correct word. This game is designed to test and enhance players' vocabulary and cognitive skills in a fun and interactive way, providing an enjoyable gaming experience for all ages. + +## **Functionalities ๐ŸŽฎ** + +- Presents players with a scrambled word. +- Allows players to input their guessed word. +- Provides instant feedback on the correctness of the guessed word. +- Generates a new scrambled word for each game session. +- Tracks and displays the player's score. +- Features a sleek and intuitive user interface for seamless gaming. + +
+ +## **How to play? ๐Ÿ•น๏ธ** + +1. Launch the Anagram Word Game in your browser. +2. Observe the scrambled word presented on the screen. +3. Enter your guess for the correct word into the provided input field. +4. Click "Submit Guess" to verify your answer. +5. If correct, you'll receive a confirmation message and your score will increase; otherwise, try again or click "Give Up" to reveal the correct word. +6. Click "Next Word" to generate a new scrambled word and continue playing. + +
+ +## **Screenshots ๐Ÿ“ธ** + +![image](https://github.com/manishh12/GameZone/assets/97523900/c24e9b9f-fdf2-4d3f-87c3-b2780bd27063) + + +
+ + + +
+ diff --git a/Games/Anagram -Word-Game/index.html b/Games/Anagram -Word-Game/index.html new file mode 100644 index 0000000000..25cd275d29 --- /dev/null +++ b/Games/Anagram -Word-Game/index.html @@ -0,0 +1,26 @@ + + + + + + Anagram Word Game + + + +
+

Anagram Word Game

+
+

+ + + +

+ +
+
+

Score: 0

+
+
+ + + diff --git a/Games/Anagram -Word-Game/script.js b/Games/Anagram -Word-Game/script.js new file mode 100644 index 0000000000..05e17dffab --- /dev/null +++ b/Games/Anagram -Word-Game/script.js @@ -0,0 +1,52 @@ +const words = ["javascript", "python", "programming", "developer", "computer"]; +let currentWord = ''; +let scrambledWord = ''; +let score = 0; + +function scrambleWord(word) { + let scrambled = word.split('').sort(() => 0.5 - Math.random()).join(''); + return scrambled; +} + +function pickRandomWord() { + const randomIndex = Math.floor(Math.random() * words.length); + currentWord = words[randomIndex]; + scrambledWord = scrambleWord(currentWord); + document.getElementById('scrambled-word').innerText = scrambledWord; +} + +function checkGuess() { + const guess = document.getElementById('guess').value.toLowerCase(); + if (guess === currentWord) { + document.getElementById('result-message').innerText = `Correct! The word was "${currentWord}".`; + score += 10; + document.getElementById('score').innerText = score; + document.getElementById('next-word').style.display = 'inline-block'; + document.getElementById('submit-guess').disabled = true; + document.getElementById('give-up').disabled = true; + } else { + document.getElementById('result-message').innerText = "Incorrect, try again."; + score -= 2; + document.getElementById('score').innerText = score; + } +} + +function giveUp() { + document.getElementById('result-message').innerText = `The correct word was "${currentWord}".`; + document.getElementById('next-word').style.display = 'inline-block'; + document.getElementById('submit-guess').disabled = true; + document.getElementById('give-up').disabled = true; +} + +document.getElementById('submit-guess').addEventListener('click', checkGuess); +document.getElementById('give-up').addEventListener('click', giveUp); +document.getElementById('next-word').addEventListener('click', () => { + document.getElementById('guess').value = ''; + document.getElementById('result-message').innerText = ''; + document.getElementById('next-word').style.display = 'none'; + document.getElementById('submit-guess').disabled = false; + document.getElementById('give-up').disabled = false; + pickRandomWord(); +}); + +pickRandomWord(); diff --git a/Games/Anagram -Word-Game/style.css b/Games/Anagram -Word-Game/style.css new file mode 100644 index 0000000000..7076c95bee --- /dev/null +++ b/Games/Anagram -Word-Game/style.css @@ -0,0 +1,76 @@ +body { + font-family: 'Arial', sans-serif; + background: linear-gradient(135deg, #0f9997, #e9ecef); + display: flex; + justify-content: center; + align-items: center; + height: 100vh; + margin: 0; +} + +.container { + text-align: center; + background-color: #fff; + padding: 20px; + border-radius: 12px; + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); + max-width: 400px; + width: 100%; +} + +h1 { + margin-bottom: 20px; + color: #343a40; +} + +#game-container { + margin-top: 20px; +} + +#scrambled-word { + font-size: 24px; + margin-bottom: 20px; + color: #007BFF; + font-weight: bold; +} + +input { + padding: 10px; + margin: 5px; + font-size: 16px; + border: 1px solid #ced4da; + border-radius: 4px; + width: calc(100% - 22px); +} + +button { + padding: 10px 15px; + margin: 5px; + font-size: 16px; + border: 1px solid #007BFF; + border-radius: 4px; + background-color: #007BFF; + color: white; + cursor: pointer; + width: calc(100% - 22px); +} + +button:hover { + background-color: #0056b3; +} + +#result-message { + margin-top: 20px; + font-size: 18px; +} + +#next-word { + display: none; + margin-top: 20px; +} + +#score-container { + margin-top: 20px; + font-size: 18px; + color: #495057; +} diff --git a/Games/AquaSort_Game/README.md b/Games/AquaSort_Game/README.md new file mode 100644 index 0000000000..fd33c60b1a --- /dev/null +++ b/Games/AquaSort_Game/README.md @@ -0,0 +1,45 @@ +# **Aquasort** + +--- A water sorting puzzle game! + +
+ +## **Description ๐Ÿ“ƒ** + +- Aquasort is a puzzle game where players must sort colored water into test tubes according to certain rules. +- Developed using HTML, CSS, and JavaScript. +- Players need to strategize and use logic to successfully complete each level. + +
+ +## **Functionalities ๐ŸŽฎ** + +- Sorting colored water into test tubes. +- Multiple difficulty levels to challenge players. +- Dynamic water shuffling to provide a unique experience each time. + +
+ +## **How to play? ๐Ÿ•น๏ธ** + +- Choose a difficulty level (Easy, Medium, Hard, Very Hard, Impossible). +- Click on test tubes to transfer water between them according to the rules. +- The objective is to have all test tubes filled with the same color of water. + +
+ +## **Screenshots ๐Ÿ“ธ** + +![Aquasort_Game](https://github.com/kunjgit/GameZone/assets/AquaSort.png) + +
+ +## **Created By ๐Ÿ‘ฆ** + +[Vijay Shanker Sharma](https://github.com/thevijayshankersharma) + +
+ +### Thanks for playing Aquasort! + +
diff --git a/Games/AquaSort_Game/index.html b/Games/AquaSort_Game/index.html new file mode 100644 index 0000000000..24f380c67c --- /dev/null +++ b/Games/AquaSort_Game/index.html @@ -0,0 +1,30 @@ + + + + Page Title + + + +
+ +
+
+
+
RULES
+
There will be some glasses (or test tubes to be exact xD), your task is to put the liquids with same color together! You can transfer different colored water from one glass to another only if the other glass is empty or its top most layer of water is of the same color as that of the one from which water is to be taken. The glass you have selected will be highlighted to prevent confusion. Restart button will take you back to the beginning of the level, also every time you open the same level the water will be shuffled. Check out the real game 'Water sort puzzle' on playstore, I have cloned it.
+
BACK
+
+
+
+ + + diff --git a/Games/AquaSort_Game/script.js b/Games/AquaSort_Game/script.js new file mode 100644 index 0000000000..5038bf4499 --- /dev/null +++ b/Games/AquaSort_Game/script.js @@ -0,0 +1,241 @@ +var game,level,color=["red","blue","yellow","green","purple","lightgreen","lightblue","orange","brown","pink"],water=[],w=[],currentLevel,clicked=[],transferring=false,t=false,size=1,sizechange=0.05,won=false,moves=0; +var testTubePosition = { + 0: [[-110,130], [-20, 130], [70, 130], [-65,320], [15, 320]], + 1: [[-110,130], [-20, 130], [70, 130],[-110,320], [-20, 320], [70, 320]], + 2: [[-140,130],[-60,130],[20,130],[100,130],[-110,320], [-20, 320], [70, 320]], + 3: [[-140,130],[-60,130],[20,130],[100,130],[-140,320],[-60,320],[20,320],[100,320]], + 7: [[-140,100],[-60,100],[20,100],[100,100],[-140,275],[-60,275],[20,275],[100,275],[-140,450],[-60,450],[20,450],[100,450]], +} + +window.onload = function() { + game = document.getElementById("game"); + level = document.getElementById("level"); +} + +window.OpenLevel = function(x) { + moves = 0; + currentLevel=x; + won=false; + level.style.display = "block"; + level.innerHTML = ""; + water=[]; + let a = [],c=0; + for (let i = 0; i < x+3; i++) { + for (let j = 0; j < 4; j++) { + a.push(color[i]); + } + } + a=shuffle(a); + for (let i = 0; i < x+3; i++) { + water[i]=[]; + for (let j = 0; j < 4; j++) { + water[i].push(a[c]); + c++; + } + } + water.push(["transparent","transparent","transparent","transparent"],["transparent","transparent","transparent","transparent"]); + w = water.map((a)=>[...a]); + //console.log(water[0]); + ApplyInfo(); +} + +function ApplyInfo(a = water) { + if (!won) { + let d=0,heading=["EASY","MEDIUM","HARD","VERY HARD","","","","IMPOSSIBLE"][currentLevel]; + level.innerHTML = `
${heading}
`; + for (let i of testTubePosition[currentLevel]) { + level.innerHTML += `
+
+
+
+
+
`; + d++; + } + level.innerHTML+=`
RESTART
HOME
Moves: ${moves}
`; + } +} + +window.Clicked = function(x) { + //console.log(x); + if (!transferring) { + if (clicked.length == 0) { + clicked.push(x); + document.getElementsByClassName("test-tube")[x].style.transition = "0.2s linear"; + document.getElementsByClassName("test-tube")[x].style.transform = "scale(1.08)"; + } + else { + clicked.push(x); + let el = document.getElementsByClassName("test-tube")[clicked[0]]; + el.style.transform = "scale(1) rotate(0deg)"; + if (clicked[0]!=clicked[1]) { + el.style.transition = "1s linear"; + moves++; + document.getElementById("moves").innerHTML = "Moves: "+moves; + Transfer(...clicked); + } + clicked = []; + } + } +} + +function TransferAnim(a,b) { + let el = document.getElementsByClassName("test-tube")[a]; + transferring = true; + el.style.zIndex = "100"; + el.style.top = `calc(${testTubePosition[currentLevel][b][1]}px - 90px)`; + el.style.left = `calc(50vw + ${testTubePosition[currentLevel][b][0]}px - 70px)`; + el.style.transform = "rotate(75deg)"; + setTimeout(function() { + el.style.transform = "rotate(90deg)"; + },1000) + setTimeout(function() { + el.style.left = `calc(50vw + ${testTubePosition[currentLevel][a][0]}px)`; + el.style.top = `calc(${testTubePosition[currentLevel][a][1]}px)`; + el.style.transform = "rotate(0deg)"; + },2000); + setTimeout(function() { + el.style.zIndex = "0"; + transferring=false; + },3000) +} + +function Transfer(a,b) { + /* + a represents the index of the glass from which water is to ne taken + b represents the index of the glass to which water is to be transferred + constraints: + b should have white + last element of a = last non-white element in b + */ + if (!water[b].includes("transparent") || water[a] == ["transparent","transparent","transparent","transparent"]) { + moves-=1; + document.getElementById("moves").innerHTML = "Moves: "+moves; + return; + } + let p,q,r=false,s=false,count=0,c=0; + for (let i = 0; i < 4; i++) { + if (((water[a][i]!="transparent" && water[a][i+1]=="transparent") || i === 3) && !r) { + r=true; + p=[water[a][i],i]; + if (water[a].map(function(x) { + if (x=="transparent" || x==p[0]) {return 1;} else {return 0;} + }).reduce((x,y)=>x+y) === 4) { + p.push(i+1) + } + else { + for (let j = 1; j < 4; j++) { + if (i-j>=0 && water[a][i-j]!=p[0]) { + p.push(j); + break; + } + } + } + } + if (((water[b][i]!="transparent" && water[b][i+1]=="transparent") || water[b][0]=="transparent") && !s) { + s=true; + q=[water[b][i],i,water[b].map((x)=>x= (x=="transparent") ? 1 : 0).reduce((x,y)=>x+y)]; + } + } + //console.log(p); + if (q[0]!="transparent" && p[0]!=q[0]) { + moves-=1; + document.getElementById("moves").innerHTML = "Moves: "+moves; + return; + } + for (let i = 3; i >= 0; i--) { + if ((water[a][i]==p[0] || water[a][i]=="transparent") && count0) { + count--; + water[b][i]=p[0]; + } + } + setTimeout(function() {ApplyInfo();},3020); + setTimeout(function() {TransferAnim(a,b);},10); + setTimeout(Won,3000); +} + +function WaterDec(p,a,count) { + p[1] = 3-p[1]; + //console.log(count*30); + document.getElementsByClassName("test-tube")[a].innerHTML += `
`; + setTimeout(function() {document.getElementById("white-bg").style.height = count*30+1 + "px";},50); + setTimeout(function() { + document.getElementsByClassName("test-tube")[a].innerHTML = ` +
+
+
+
`; + },1050); +} + +function WaterInc(p,q,b,count) { + q[1] = 4-q[1]; + q[1]-= (q[0]!="transparent" ? 1: 0); + document.getElementsByClassName("test-tube")[b].innerHTML += `
`; + setTimeout(function() { + document.getElementById("colorful-bg").style.height = count*30+1 + "px"; + document.getElementById("colorful-bg").style.top = `calc(10px + ${q[1]*30}px - ${count*30}px)`; + },50); +} + +window.Restart = function() { + moves = 0; + water = w.map((a)=>[...a]); + won=false; + ApplyInfo(w); +} + +window.ShowMenu = function() { + document.getElementById("level").style.display = "none"; +} + +function Won() { + for (let i of water) { + if (i[0]!=i[1]||i[1]!=i[2]||i[2]!=i[3]) { + return; + } + } + won=true; + //console.log("hello"); + level.innerHTML = `
YOU WON
RESTART
HOME
`; +} + +function shuffle(x) { + let a=[],len=x.length; + for (let i = 0; i < len; i++) { + let n = Math.floor(Math.random()*x.length); + a.push(x[n]); + x.splice(n,1); + } + return a; +} + +window.ShowRules = function() { + document.getElementById("rules-page").style.display = "block"; + setTimeout(function() { + document.getElementById("rules-page").style.opacity = "1"; + },50); +} + +window.HideRules = function() { + setTimeout(function() { + document.getElementById("rules-page").style.display = "none"; + },500); + document.getElementById("rules-page").style.opacity = "0"; +} diff --git a/Games/AquaSort_Game/style.css b/Games/AquaSort_Game/style.css new file mode 100644 index 0000000000..0f54e2cad0 --- /dev/null +++ b/Games/AquaSort_Game/style.css @@ -0,0 +1,245 @@ +@import url('https://fonts.googleapis.com/css2?family=Sriracha&family=Raleway&display=swap'); + +body { + font-family: Raleway; + user-select: none; +} + +#game { + position: absolute; + top: 0; + left: 0; + height: 100vh; + width: 100vw; + background-color: white; +} + +#menu { + position: absolute; + margin-top: 0; + left: 0; + height: 100vh; + width: 100vw; + background-color: purple; + overflow-y:scroll; + overflow-x: hidden; + /*display: none;*/ +} + +#menu-heading { + position: relative; + margin-top: 0; + left: 0; + height: 50px; + width: 100vw; + background-color: yellow; + font-size: 30px; + line-height: 50px; + text-align: center; + font-weight: 900; +} + +.lvl { + position: relative; + margin-top: 30px; + left: 10px; + width: calc(100vw - 20px); + height: 80px; + color: white; + background-color: darkgreen; + text-align: center; + font-size: 30px; + font-weight: 600; + line-height: 80px; + border-radius: 20px; +} + +#level { + z-index: 1; + height: 100vh; + width: 100vw; + position: absolute; + top: 0; + left: 0; + background-color: white; + overflow-y: scroll; + overflow-x: hidden; + display: none; +} + +.lvl:hover { + background-color: green; +} + +.test-tube { + position: absolute; + height: 130px; + width: 40px; + border: 2px solid rgb(150,150,150); + border-radius: 2px 2px 20px 20px; + background-position: 0 10px; + overflow: hidden; + transition: 1s linear; + transform: rotate(0deg); +} + +@keyframes glassAnim { + 0%,100% {transform: scale(1);} + 50% {transform: scale(1.05);} +} + +.colors { + position: absolute; + left: 0; + height: 30px; + width: 40px; +} + +#won { + position: absolute; + top: 100px; + left: 0; + width: 100vw; + text-align: center; + font-size: 60px; + font-weight: 900; +} + +#white-bg { + position: absolute; + left: 0; + top: 10px; + width: 40px; + height: 10px; + background-color: white; + z-index: 1000; + transition: 1s; +} + +#colorful-bg { + position: absolute; + width: 100%; + height: 0; + z-index: 1000; + transition: 1s; +} + +#restart { + left: 0; +} + +#home { + left: calc(100vw - 150px); +} + +.game-buttons { + position: fixed; + top: calc(100vh - 50px); + height: 50px; + width: 150px; + font-size: 25px; + font-weight: 600; + text-align: center; + line-height: 50px; + background-color: lightgreen; + border-radius: 10px 10px 0 0; +} + +#lvl-heading { + position: absolute; + top: 0; + left: 0; + height: 50px; + width: 100vw; + background-color: yellow; + border-radius: 0 0 25px 25px; + font-size: 40px; + font-weight: 800; + line-height: 50px; + text-align: center; + letter-spacing: 5px; +} + +#moves { + position: fixed; + top: calc(100vh - 80px); + width: 150px; + height: 30px; + left: 10px; + font-size: 20px; +} + +#rules-btn { + position: fixed; + left: calc(100vw - 200px); + top: calc(100vh - 50px); + height: 50px; + width: 200px; + background-color: lightgreen; + border-radius: 20px 20px 0 0; + text-align: center; + font-size: 25px; + line-height: 50px; + font-weight: 500; +} + +#rules-page { + display: none; + z-index: 1000; + position: absolute; + top: 0; + left: 0; + height: 100vh; + width: 100vw; + background-color: rgba(0,0,0,0.5); + opacity: 0; + transition: 0.5s linear; +} + +#rules { + position: absolute; + top: 100px; + left: 50px; + height: calc(100vh - 200px); + width: calc(100vw - 100px); + background-color: white; + border-radius: 10px; +} + +#rules-heading { + position: absolute; + top: 10px; + left: 0; + height: 30px; + width: 100%; + font-size: 30px; + font-weight: 800; + text-align: center; +} + +#rules-text { + position: absolute; + top: 70px; + left: 5%; + width: 90%; + font-size: 20px; + height: calc(100vh - 200px - 150px); + overflow-x: hidden; +} + +#back { + position: absolute; + top: calc(100% - 120px + 65px + 10px); + height: 40px; + width: 100px; + left: calc(100% - 100px); + background-color: rgb(100, 255, 100); + font-size: 20px; + line-height: 40px; + text-align: center; + border-radius: 10px 0 0 10px; +} + +#alert-button:hover { + background-color: rgb(150,255,150); +} \ No newline at end of file diff --git a/Games/Black_jackk/README.md b/Games/Black_jackk/README.md new file mode 100644 index 0000000000..c3fc20d499 --- /dev/null +++ b/Games/Black_jackk/README.md @@ -0,0 +1,72 @@ +# **Black_jackk** + +--- + +
+ +## **Description ๐Ÿ“ƒ** + +- Blackjack, also known as 21, is one of the most popular casino card games in the world. It is a comparing card game between one or more players and a dealer, where players compete against the dealer but not against each other. The game is typically played with one to eight decks of 52 cards. + +Objective +The main objective of Blackjack is to beat the dealer's hand without exceeding a total of 21. Players aim to get as close to 21 as possible. + +Card Values +Number Cards (2-10): Face value +Face Cards (J, Q, K): 10 points each +Ace (A): 1 or 11 points, depending on which value benefits the hand more +Basic Rules +Initial Deal: Each player is dealt two cards, face-up. The dealer receives one card face-up and one card face-down (the hole card). + +Player's Turn: Starting from the player's left, each player has a turn to act. Players have the following options: + +Hit: Take another card from the dealer. A player can hit as many times as they want, as long as they don't exceed 21. + +Stand: Keep their current hand and end their turn. + +Double Down: Double the initial bet and receive exactly one more card. + +Split: If the first two cards are a pair, the player can split them into two separate hands, each with its own bet. The player then plays out both hands separately. + +Surrender: Some variations allow players to forfeit half their bet and end their hand immediately. + +Dealer's Turn: After all players have finished their actions, the dealer reveals the hole card. The dealer must hit +until their total is 17 or higher. Most casinos require the dealer to stand on all 17s, though some variations require the dealer to hit on a "soft" 17 (a hand containing an Ace valued as 11). + +Winning: Players win if their hand is closer to 21 than the dealer's hand or if the dealer busts (exceeds 21). If a player exceeds 21, they bust and lose their bet. If the player and dealer have the same total (a push), the player's bet is returned. + + + + +## **How to play? ๐Ÿ•น๏ธ** + + +Blackjack is a straightforward game to learn but requires strategy to master. Hereโ€™s a step-by-step guide on how to play: + +1. Setting Up +Players and Dealer: The game is played with one or more players against a dealer. +Decks: Usually played with one to eight standard decks of 52 cards. + +2. Placing Bets +Initial Bet: Each player places a bet in the designated betting area before any cards are dealt. + +3. Dealing Cards +Initial Deal: Each player and the dealer are dealt two cards. Players' cards are typically dealt face-up, while the dealer has one card face-up and one card face-down (the hole card). + +4. Player's Turn +Objective: Try to get as close to 21 as possible without exceeding it. + + +5. Dealer's Turn +Revealing the Hole Card: After all players have finished their actions, the dealer reveals their hole card. +Dealer's Play: The dealer must hit until their total is at least 17. In some variations, the dealer must hit on a "soft" 17 (a hand including an Ace valued as 11). +- + + + +## **Screenshots ๐Ÿ“ธ** + +![alt text]() + + + diff --git a/Games/Black_jackk/blackjack.css b/Games/Black_jackk/blackjack.css new file mode 100644 index 0000000000..3451cf0ca9 --- /dev/null +++ b/Games/Black_jackk/blackjack.css @@ -0,0 +1,28 @@ +body { + font-family: Arial, Helvetica, sans-serif; + text-align: center; +} + +#dealer-cards img { + height: 175px; + width: 125px; + margin: 1px; +} + +#your-cards img { + height: 175px; + width: 125px; + margin: 1px; +} + +#hit { + width: 100px; + height: 50px; + font-size: 20px; +} + +#stay { + width: 100px; + height: 50px; + font-size: 20px; +} diff --git a/Games/Black_jackk/blackjack.js b/Games/Black_jackk/blackjack.js new file mode 100644 index 0000000000..802e1adabb --- /dev/null +++ b/Games/Black_jackk/blackjack.js @@ -0,0 +1,148 @@ + +let dealerSum = 0; +let yourSum = 0; + +let dealerAceCount = 0; +let yourAceCount = 0; + +let hidden; +let deck; + +let canHit = true; //allows the player (you) to draw while yourSum <= 21 + +window.onload = function() { + buildDeck(); + shuffleDeck(); + startGame(); +} + +function buildDeck() { + let values = ["A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K"]; + let types = ["C", "D", "H", "S"]; + deck = []; + + for (let i = 0; i < types.length; i++) { + for (let j = 0; j < values.length; j++) { + deck.push(values[j] + "-" + types[i]); //A-C -> K-C, A-D -> K-D + } + } + // console.log(deck); +} + +function shuffleDeck() { + for (let i = 0; i < deck.length; i++) { + let j = Math.floor(Math.random() * deck.length); // (0-1) * 52 => (0-51.9999) + let temp = deck[i]; + deck[i] = deck[j]; + deck[j] = temp; + } + console.log(deck); +} + +function startGame() { + hidden = deck.pop(); + dealerSum += getValue(hidden); + dealerAceCount += checkAce(hidden); + // console.log(hidden); + // console.log(dealerSum); + while (dealerSum < 17) { + // + let cardImg = document.createElement("img"); + let card = deck.pop(); + cardImg.src = "/assets/images/" + card + ".png"; + dealerSum += getValue(card); + dealerAceCount += checkAce(card); + document.getElementById("dealer-cards").append(cardImg); + } + console.log(dealerSum); + + for (let i = 0; i < 2; i++) { + let cardImg = document.createElement("img"); + let card = deck.pop(); + cardImg.src = "/assets/images/" + card + ".png"; + yourSum += getValue(card); + yourAceCount += checkAce(card); + document.getElementById("your-cards").append(cardImg); + } + + console.log(yourSum); + document.getElementById("hit").addEventListener("click", hit); + document.getElementById("stay").addEventListener("click", stay); + +} + +function hit() { + if (!canHit) { + return; + } + + let cardImg = document.createElement("img"); + let card = deck.pop(); + cardImg.src = "/assets/images" + card + ".png"; + yourSum += getValue(card); + yourAceCount += checkAce(card); + document.getElementById("your-cards").append(cardImg); + + if (reduceAce(yourSum, yourAceCount) > 21) { //A, J, 8 -> 1 + 10 + 8 + canHit = false; + } + +} + +function stay() { + dealerSum = reduceAce(dealerSum, dealerAceCount); + yourSum = reduceAce(yourSum, yourAceCount); + + canHit = false; + document.getElementById("hidden").src = "/assets/images/" + hidden + ".png"; + + let message = ""; + if (yourSum > 21) { + message = "You Lose!"; + } + else if (dealerSum > 21) { + message = "You win!"; + } + //both you and dealer <= 21 + else if (yourSum == dealerSum) { + message = "Tie!"; + } + else if (yourSum > dealerSum) { + message = "You Win!"; + } + else if (yourSum < dealerSum) { + message = "You Lose!"; + } + + document.getElementById("dealer-sum").innerText = dealerSum; + document.getElementById("your-sum").innerText = yourSum; + document.getElementById("results").innerText = message; +} + +function getValue(card) { + let data = card.split("-"); // "4-C" -> ["4", "C"] + let value = data[0]; + + if (isNaN(value)) { //A J Q K + if (value == "A") { + return 11; + } + return 10; + } + return parseInt(value); +} + +function checkAce(card) { + if (card[0] == "A") { + return 1; + } + return 0; +} + +function reduceAce(playerSum, playerAceCount) { + while (playerSum > 21 && playerAceCount > 0) { + playerSum -= 10; + playerAceCount -= 1; + } + return playerSum; +} diff --git a/Games/Black_jackk/index.html b/Games/Black_jackk/index.html new file mode 100644 index 0000000000..e6560f6fbc --- /dev/null +++ b/Games/Black_jackk/index.html @@ -0,0 +1,25 @@ + + + + + + Black Jack + + + + + +

Dealer:

+
+ +
+ +

You:

+
+ +
+ + +

+ + diff --git a/Games/Brick Buster/README.md b/Games/Brick Buster/README.md new file mode 100644 index 0000000000..510341e58c --- /dev/null +++ b/Games/Brick Buster/README.md @@ -0,0 +1,21 @@ +# Brick Buster + +## Description +Brick Buster is a classic arcade game where players control a paddle at the bottom of the screen, bouncing a ball to destroy bricks at the top of the screen. The goal is to clear all the bricks by hitting them with the ball while preventing the ball from falling off the bottom of the screen. + +## Features +- *Paddle Control*: Players control the paddle using the left and right arrow keys. +- *Ball Physics*: The ball moves around the screen, bouncing off walls, the paddle, and bricks. +- *Brick Destruction*: Bricks are destroyed when hit by the ball, and the player scores points. +- *Level Completion*: The game progresses to the next level when all bricks are destroyed. +- *Game Over*: The game ends if the ball falls off the bottom of the screen. +- *Score Tracking*: Displays the player's score. +- *Winning Condition*: The player wins if all bricks are destroyed. + +## How to Play +1. Use the left and right arrow keys to move the paddle. +2. Bounce the ball off the paddle to hit and destroy the bricks. +3. Prevent the ball from falling off the bottom of the screen. +4. Clear all the bricks to win the game. + +Enjoy playing Brick Buster! \ No newline at end of file diff --git a/Games/Brick Buster/index.html b/Games/Brick Buster/index.html new file mode 100644 index 0000000000..96493f6211 --- /dev/null +++ b/Games/Brick Buster/index.html @@ -0,0 +1,20 @@ + + + + + + Brick Buster + + + +
+
Score: 0
+
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/Games/Brick Buster/script.js b/Games/Brick Buster/script.js new file mode 100644 index 0000000000..896e04fed7 --- /dev/null +++ b/Games/Brick Buster/script.js @@ -0,0 +1,117 @@ +const paddle = document.getElementById('paddle'); +const ball = document.getElementById('ball'); +const bricksContainer = document.getElementById('bricks'); +const scoreElement = document.getElementById('score'); + +const gameArea = document.getElementById('game-area'); +const gameAreaRect = gameArea.getBoundingClientRect(); + +const paddleWidth = paddle.clientWidth; +const paddleHeight = paddle.clientHeight; +const ballSize = ball.clientWidth; + +let score = 0; +let ballX = gameAreaRect.width / 2; +let ballY = gameAreaRect.height / 2; +let ballSpeedX = 3; +let ballSpeedY = 3; +let paddleX = (gameAreaRect.width - paddleWidth) / 2; + +const rows = 5; +const cols = 10; +const brickWidth = 80; +const brickHeight = 20; +const brickMargin = 10; + +let bricks = []; + +function createBricks() { + for (let row = 0; row < rows; row++) { + for (let col = 0; col < cols; col++) { + const brick = document.createElement('div'); + brick.classList.add('brick'); + brick.style.left = `${col * (brickWidth + brickMargin)}px`; + brick.style.top = `${row * (brickHeight + brickMargin)}px`; + bricksContainer.appendChild(brick); + bricks.push(brick); + } + } +} + +function movePaddle(event) { + const step = 20; + if (event.key === 'ArrowLeft' && paddleX > 0) { + paddleX -= step; + } else if (event.key === 'ArrowRight' && paddleX < gameAreaRect.width - paddleWidth) { + paddleX += step; + } + + updatePaddlePosition(); +} + +function updatePaddlePosition() { + paddle.style.left = `${paddleX}px`; +} + +function resetBall() { + ballX = gameAreaRect.width / 2; + ballY = gameAreaRect.height / 2; + ballSpeedX = 3; + ballSpeedY = -3; +} + +function updateBall() { + ballX += ballSpeedX; + ballY += ballSpeedY; + + if (ballX <= 0 || ballX >= gameAreaRect.width - ballSize) { + ballSpeedX = -ballSpeedX; + } + + if (ballY <= 0) { + ballSpeedY = -ballSpeedY; + } + + if (ballY >= gameAreaRect.height - ballSize) { + alert('Game Over'); + resetBall(); + } + + const paddleRect = paddle.getBoundingClientRect(); + const ballRect = ball.getBoundingClientRect(); + + if (ballRect.bottom >= paddleRect.top && ballRect.right >= paddleRect.left && ballRect.left <= paddleRect.right) { + ballSpeedY = -ballSpeedY; + } + + bricks.forEach((brick, index) => { + const brickRect = brick.getBoundingClientRect(); + if (ballRect.right >= brickRect.left && ballRect.left <= brickRect.right && ballRect.bottom >= brickRect.top && ballRect.top <= brickRect.bottom) { + ballSpeedY = -ballSpeedY; + bricksContainer.removeChild(brick); + bricks.splice(index, 1); + score++; + scoreElement.textContent = `Score: ${score}`; + } + }); + + ball.style.left = `${ballX}px`; + ball.style.top = `${ballY}px`; + + if (bricks.length === 0) { + alert('You Win!'); + resetBall(); + createBricks(); + } +} + +function gameLoop() { + updateBall(); + requestAnimationFrame(gameLoop); +} + +document.addEventListener('keydown', movePaddle); + +createBricks(); +resetBall(); +gameLoop(); \ No newline at end of file diff --git a/Games/Brick Buster/style.css b/Games/Brick Buster/style.css new file mode 100644 index 0000000000..b8b617bce5 --- /dev/null +++ b/Games/Brick Buster/style.css @@ -0,0 +1,68 @@ +* { + box-sizing: border-box; + margin: 0; + padding: 0; +} + +body { + display: flex; + justify-content: center; + align-items: center; + height: 100vh; + background: linear-gradient(45deg, #ff0000, #ff8000); + font-family: Arial, sans-serif; +} + +.container { + position: relative; + width: 800px; + height: 600px; + border: 2px solid #fff; + background: #000; + overflow: hidden; +} + +.score { + position: absolute; + top: 10px; + left: 10px; + font-size: 1.5rem; + color: #fff; +} + +.game-area { + position: relative; + width: 100%; + height: 100%; +} + +.paddle { + position: absolute; + bottom: 30px; + width: 100px; + height: 20px; + background-color: #fff; + border-radius: 10px; +} + +.ball { + position: absolute; + width: 15px; + height: 15px; + background-color: #fff; + border-radius: 50%; +} + +.bricks { + position: relative; + width: 100%; + height: 200px; +} + +.brick { + position: absolute; + width: 80px; + height: 20px; + background-color: #ff8000; + border-radius: 5px; +} \ No newline at end of file diff --git a/Games/Buliding Block Game/Readme.md b/Games/Buliding Block Game/Readme.md new file mode 100644 index 0000000000..3898b5506f --- /dev/null +++ b/Games/Buliding Block Game/Readme.md @@ -0,0 +1,12 @@ +# Building Block Game + +## About Building Blocks Game +Building blocks game is a fun game for kids of all ages. In this game, our target is to construct the highest tower by arranging blocks one over the other such that we never disobey Newtonโ€™s law by this line we mean no block can hang in the air. It has to be over some other block or over the ground. + +Project Prerequisites +To implement this project we need to know the following : + +1. Basic concepts of JavaScript +2. HTML +3. CSS + diff --git a/Games/Buliding Block Game/assets b/Games/Buliding Block Game/assets new file mode 100644 index 0000000000..3a4e8ef3da --- /dev/null +++ b/Games/Buliding Block Game/assets @@ -0,0 +1 @@ +c:\Users\aasth\OneDrive\Pictures\Screenshots\Screenshot (266).png \ No newline at end of file diff --git a/Games/Buliding Block Game/index.html b/Games/Buliding Block Game/index.html new file mode 100644 index 0000000000..f5b26b88ad --- /dev/null +++ b/Games/Buliding Block Game/index.html @@ -0,0 +1,19 @@ + + +
+
+
0
+
Click (or press the spacebar) to place the block
+
+

Game Over

+

You did great, you're the best.

+

Click or spacebar to start again

+
+
+
Start
+
+
+
+ + + \ No newline at end of file diff --git a/Games/Buliding Block Game/script.js b/Games/Buliding Block Game/script.js new file mode 100644 index 0000000000..2317fc900b --- /dev/null +++ b/Games/Buliding Block Game/script.js @@ -0,0 +1,309 @@ +console.clear(); +var Stage = /** @class */ (function () { + function Stage() { + // container + var _this = this; + this.render = function () { + this.renderer.render(this.scene, this.camera); + }; + this.add = function (elem) { + this.scene.add(elem); + }; + this.remove = function (elem) { + this.scene.remove(elem); + }; + this.container = document.getElementById('game'); + // renderer + this.renderer = new THREE.WebGLRenderer({ + antialias: true, + alpha: false + }); + this.renderer.setSize(window.innerWidth, window.innerHeight); + this.renderer.setClearColor('#D0CBC7', 1); + this.container.appendChild(this.renderer.domElement); + // scene + this.scene = new THREE.Scene(); + // camera + var aspect = window.innerWidth / window.innerHeight; + var d = 20; + this.camera = new THREE.OrthographicCamera(-d * aspect, d * aspect, d, -d, -100, 1000); + this.camera.position.x = 2; + this.camera.position.y = 2; + this.camera.position.z = 2; + this.camera.lookAt(new THREE.Vector3(0, 0, 0)); + //light + this.light = new THREE.DirectionalLight(0xffffff, 0.5); + this.light.position.set(0, 499, 0); + this.scene.add(this.light); + this.softLight = new THREE.AmbientLight(0xffffff, 0.4); + this.scene.add(this.softLight); + window.addEventListener('resize', function () { return _this.onResize(); }); + this.onResize(); + } + Stage.prototype.setCamera = function (y, speed) { + if (speed === void 0) { speed = 0.3; } + TweenLite.to(this.camera.position, speed, { y: y + 4, ease: Power1.easeInOut }); + TweenLite.to(this.camera.lookAt, speed, { y: y, ease: Power1.easeInOut }); + }; + Stage.prototype.onResize = function () { + var viewSize = 30; + this.renderer.setSize(window.innerWidth, window.innerHeight); + this.camera.left = window.innerWidth / -viewSize; + this.camera.right = window.innerWidth / viewSize; + this.camera.top = window.innerHeight / viewSize; + this.camera.bottom = window.innerHeight / -viewSize; + this.camera.updateProjectionMatrix(); + }; + return Stage; +}()); +var Block = /** @class */ (function () { + function Block(block) { + // set size and position + this.STATES = { ACTIVE: 'active', STOPPED: 'stopped', MISSED: 'missed' }; + this.MOVE_AMOUNT = 12; + this.dimension = { width: 0, height: 0, depth: 0 }; + this.position = { x: 0, y: 0, z: 0 }; + this.targetBlock = block; + this.index = (this.targetBlock ? this.targetBlock.index : 0) + 1; + this.workingPlane = this.index % 2 ? 'x' : 'z'; + this.workingDimension = this.index % 2 ? 'width' : 'depth'; + // set the dimensions from the target block, or defaults. + this.dimension.width = this.targetBlock ? this.targetBlock.dimension.width : 10; + this.dimension.height = this.targetBlock ? this.targetBlock.dimension.height : 2; + this.dimension.depth = this.targetBlock ? this.targetBlock.dimension.depth : 10; + this.position.x = this.targetBlock ? this.targetBlock.position.x : 0; + this.position.y = this.dimension.height * this.index; + this.position.z = this.targetBlock ? this.targetBlock.position.z : 0; + this.colorOffset = this.targetBlock ? this.targetBlock.colorOffset : Math.round(Math.random() * 100); + // set color + if (!this.targetBlock) { + this.color = 0x333344; + } + else { + var offset = this.index + this.colorOffset; + var r = Math.sin(0.3 * offset) * 55 + 200; + var g = Math.sin(0.3 * offset + 2) * 55 + 200; + var b = Math.sin(0.3 * offset + 4) * 55 + 200; + this.color = new THREE.Color(r / 255, g / 255, b / 255); + } + // state + this.state = this.index > 1 ? this.STATES.ACTIVE : this.STATES.STOPPED; + // set direction + this.speed = -0.1 - (this.index * 0.005); + if (this.speed < -4) + this.speed = -4; + this.direction = this.speed; + // create block + var geometry = new THREE.BoxGeometry(this.dimension.width, this.dimension.height, this.dimension.depth); + geometry.applyMatrix(new THREE.Matrix4().makeTranslation(this.dimension.width / 2, this.dimension.height / 2, this.dimension.depth / 2)); + this.material = new THREE.MeshToonMaterial({ color: this.color, shading: THREE.FlatShading }); + this.mesh = new THREE.Mesh(geometry, this.material); + this.mesh.position.set(this.position.x, this.position.y + (this.state == this.STATES.ACTIVE ? 0 : 0), this.position.z); + if (this.state == this.STATES.ACTIVE) { + this.position[this.workingPlane] = Math.random() > 0.5 ? -this.MOVE_AMOUNT : this.MOVE_AMOUNT; + } + } + Block.prototype.reverseDirection = function () { + this.direction = this.direction > 0 ? this.speed : Math.abs(this.speed); + }; + Block.prototype.place = function () { + this.state = this.STATES.STOPPED; + var overlap = this.targetBlock.dimension[this.workingDimension] - Math.abs(this.position[this.workingPlane] - this.targetBlock.position[this.workingPlane]); + var blocksToReturn = { + plane: this.workingPlane, + direction: this.direction + }; + if (this.dimension[this.workingDimension] - overlap < 0.3) { + overlap = this.dimension[this.workingDimension]; + blocksToReturn.bonus = true; + this.position.x = this.targetBlock.position.x; + this.position.z = this.targetBlock.position.z; + this.dimension.width = this.targetBlock.dimension.width; + this.dimension.depth = this.targetBlock.dimension.depth; + } + if (overlap > 0) { + var choppedDimensions = { width: this.dimension.width, height: this.dimension.height, depth: this.dimension.depth }; + choppedDimensions[this.workingDimension] -= overlap; + this.dimension[this.workingDimension] = overlap; + var placedGeometry = new THREE.BoxGeometry(this.dimension.width, this.dimension.height, this.dimension.depth); + placedGeometry.applyMatrix(new THREE.Matrix4().makeTranslation(this.dimension.width / 2, this.dimension.height / 2, this.dimension.depth / 2)); + var placedMesh = new THREE.Mesh(placedGeometry, this.material); + var choppedGeometry = new THREE.BoxGeometry(choppedDimensions.width, choppedDimensions.height, choppedDimensions.depth); + choppedGeometry.applyMatrix(new THREE.Matrix4().makeTranslation(choppedDimensions.width / 2, choppedDimensions.height / 2, choppedDimensions.depth / 2)); + var choppedMesh = new THREE.Mesh(choppedGeometry, this.material); + var choppedPosition = { + x: this.position.x, + y: this.position.y, + z: this.position.z + }; + if (this.position[this.workingPlane] < this.targetBlock.position[this.workingPlane]) { + this.position[this.workingPlane] = this.targetBlock.position[this.workingPlane]; + } + else { + choppedPosition[this.workingPlane] += overlap; + } + placedMesh.position.set(this.position.x, this.position.y, this.position.z); + choppedMesh.position.set(choppedPosition.x, choppedPosition.y, choppedPosition.z); + blocksToReturn.placed = placedMesh; + if (!blocksToReturn.bonus) + blocksToReturn.chopped = choppedMesh; + } + else { + this.state = this.STATES.MISSED; + } + this.dimension[this.workingDimension] = overlap; + return blocksToReturn; + }; + Block.prototype.tick = function () { + if (this.state == this.STATES.ACTIVE) { + var value = this.position[this.workingPlane]; + if (value > this.MOVE_AMOUNT || value < -this.MOVE_AMOUNT) + this.reverseDirection(); + this.position[this.workingPlane] += this.direction; + this.mesh.position[this.workingPlane] = this.position[this.workingPlane]; + } + }; + return Block; +}()); +var Game = /** @class */ (function () { + function Game() { + var _this = this; + this.STATES = { + 'LOADING': 'loading', + 'PLAYING': 'playing', + 'READY': 'ready', + 'ENDED': 'ended', + 'RESETTING': 'resetting' + }; + this.blocks = []; + this.state = this.STATES.LOADING; + this.stage = new Stage(); + this.mainContainer = document.getElementById('container'); + this.scoreContainer = document.getElementById('score'); + this.startButton = document.getElementById('start-button'); + this.instructions = document.getElementById('instructions'); + this.scoreContainer.innerHTML = '0'; + this.newBlocks = new THREE.Group(); + this.placedBlocks = new THREE.Group(); + this.choppedBlocks = new THREE.Group(); + this.stage.add(this.newBlocks); + this.stage.add(this.placedBlocks); + this.stage.add(this.choppedBlocks); + this.addBlock(); + this.tick(); + this.updateState(this.STATES.READY); + document.addEventListener('keydown', function (e) { + if (e.keyCode == 32) + _this.onAction(); + }); + document.addEventListener('click', function (e) { + _this.onAction(); + }); + document.addEventListener('touchstart', function (e) { + e.preventDefault(); + _this.onAction(); + // ?? this triggers after click on android so you + // insta-lose, will figure it out later. + }); + } + Game.prototype.updateState = function (newState) { + for (var key in this.STATES) + this.mainContainer.classList.remove(this.STATES[key]); + this.mainContainer.classList.add(newState); + this.state = newState; + }; + Game.prototype.onAction = function () { + switch (this.state) { + case this.STATES.READY: + this.startGame(); + break; + case this.STATES.PLAYING: + this.placeBlock(); + break; + case this.STATES.ENDED: + this.restartGame(); + break; + } + }; + Game.prototype.startGame = function () { + if (this.state != this.STATES.PLAYING) { + this.scoreContainer.innerHTML = '0'; + this.updateState(this.STATES.PLAYING); + this.addBlock(); + } + }; + Game.prototype.restartGame = function () { + var _this = this; + this.updateState(this.STATES.RESETTING); + var oldBlocks = this.placedBlocks.children; + var removeSpeed = 0.2; + var delayAmount = 0.02; + var _loop_1 = function (i) { + TweenLite.to(oldBlocks[i].scale, removeSpeed, { x: 0, y: 0, z: 0, delay: (oldBlocks.length - i) * delayAmount, ease: Power1.easeIn, onComplete: function () { return _this.placedBlocks.remove(oldBlocks[i]); } }); + TweenLite.to(oldBlocks[i].rotation, removeSpeed, { y: 0.5, delay: (oldBlocks.length - i) * delayAmount, ease: Power1.easeIn }); + }; + for (var i = 0; i < oldBlocks.length; i++) { + _loop_1(i); + } + var cameraMoveSpeed = removeSpeed * 2 + (oldBlocks.length * delayAmount); + this.stage.setCamera(2, cameraMoveSpeed); + var countdown = { value: this.blocks.length - 1 }; + TweenLite.to(countdown, cameraMoveSpeed, { value: 0, onUpdate: function () { _this.scoreContainer.innerHTML = String(Math.round(countdown.value)); } }); + this.blocks = this.blocks.slice(0, 1); + setTimeout(function () { + _this.startGame(); + }, cameraMoveSpeed * 1000); + }; + Game.prototype.placeBlock = function () { + var _this = this; + var currentBlock = this.blocks[this.blocks.length - 1]; + var newBlocks = currentBlock.place(); + this.newBlocks.remove(currentBlock.mesh); + if (newBlocks.placed) + this.placedBlocks.add(newBlocks.placed); + if (newBlocks.chopped) { + this.choppedBlocks.add(newBlocks.chopped); + var positionParams = { y: '-=30', ease: Power1.easeIn, onComplete: function () { return _this.choppedBlocks.remove(newBlocks.chopped); } }; + var rotateRandomness = 10; + var rotationParams = { + delay: 0.05, + x: newBlocks.plane == 'z' ? ((Math.random() * rotateRandomness) - (rotateRandomness / 2)) : 0.1, + z: newBlocks.plane == 'x' ? ((Math.random() * rotateRandomness) - (rotateRandomness / 2)) : 0.1, + y: Math.random() * 0.1 + }; + if (newBlocks.chopped.position[newBlocks.plane] > newBlocks.placed.position[newBlocks.plane]) { + positionParams[newBlocks.plane] = '+=' + (40 * Math.abs(newBlocks.direction)); + } + else { + positionParams[newBlocks.plane] = '-=' + (40 * Math.abs(newBlocks.direction)); + } + TweenLite.to(newBlocks.chopped.position, 1, positionParams); + TweenLite.to(newBlocks.chopped.rotation, 1, rotationParams); + } + this.addBlock(); + }; + Game.prototype.addBlock = function () { + var lastBlock = this.blocks[this.blocks.length - 1]; + if (lastBlock && lastBlock.state == lastBlock.STATES.MISSED) { + return this.endGame(); + } + this.scoreContainer.innerHTML = String(this.blocks.length - 1); + var newKidOnTheBlock = new Block(lastBlock); + this.newBlocks.add(newKidOnTheBlock.mesh); + this.blocks.push(newKidOnTheBlock); + this.stage.setCamera(this.blocks.length * 2); + if (this.blocks.length >= 5) + this.instructions.classList.add('hide'); + }; + Game.prototype.endGame = function () { + this.updateState(this.STATES.ENDED); + }; + Game.prototype.tick = function () { + var _this = this; + this.blocks[this.blocks.length - 1].tick(); + this.stage.render(); + requestAnimationFrame(function () { _this.tick(); }); + }; + return Game; +}()); +var game = new Game(); \ No newline at end of file diff --git a/Games/Buliding Block Game/style.css b/Games/Buliding Block Game/style.css new file mode 100644 index 0000000000..27a7c6c25a --- /dev/null +++ b/Games/Buliding Block Game/style.css @@ -0,0 +1,143 @@ +@import url("https://fonts.googleapis.com/css?family=Comfortaa"); +html, body { + margin: 0; + overflow: hidden; + height: 100%; + width: 100%; + position: relative; + font-family: 'Comfortaa', cursive; +} + +#container { + width: 100%; + height: 100%; +} +#container #score { + position: absolute; + top: 20px; + width: 100%; + text-align: center; + font-size: 10vh; + -webkit-transition: -webkit-transform 0.5s ease; + transition: -webkit-transform 0.5s ease; + transition: transform 0.5s ease; + transition: transform 0.5s ease, -webkit-transform 0.5s ease; + color: #333344; + -webkit-transform: translatey(-200px) scale(1); + transform: translatey(-200px) scale(1); +} +#container #game { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; +} +#container .game-over { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 85%; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -ms-flex-direction: column; + flex-direction: column; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: center; + -ms-flex-pack: center; + justify-content: center; +} +#container .game-over * { + -webkit-transition: opacity 0.5s ease, -webkit-transform 0.5s ease; + transition: opacity 0.5s ease, -webkit-transform 0.5s ease; + transition: opacity 0.5s ease, transform 0.5s ease; + transition: opacity 0.5s ease, transform 0.5s ease, -webkit-transform 0.5s ease; + opacity: 0; + -webkit-transform: translatey(-50px); + transform: translatey(-50px); + color: #333344; +} +#container .game-over h2 { + margin: 0; + padding: 0; + font-size: 40px; +} +#container .game-ready { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -ms-flex-direction: column; + flex-direction: column; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + -ms-flex-pack: distribute; + justify-content: space-around; +} +#container .game-ready #start-button { + -webkit-transition: opacity 0.5s ease, -webkit-transform 0.5s ease; + transition: opacity 0.5s ease, -webkit-transform 0.5s ease; + transition: opacity 0.5s ease, transform 0.5s ease; + transition: opacity 0.5s ease, transform 0.5s ease, -webkit-transform 0.5s ease; + opacity: 0; + -webkit-transform: translatey(-50px); + transform: translatey(-50px); + border: 3px solid #333344; + padding: 10px 20px; + background-color: transparent; + color: #333344; + font-size: 30px; +} +#container #instructions { + position: absolute; + width: 100%; + top: 16vh; + left: 0; + text-align: center; + -webkit-transition: opacity 0.5s ease, -webkit-transform 0.5s ease; + transition: opacity 0.5s ease, -webkit-transform 0.5s ease; + transition: opacity 0.5s ease, transform 0.5s ease; + transition: opacity 0.5s ease, transform 0.5s ease, -webkit-transform 0.5s ease; + opacity: 0; +} +#container #instructions.hide { + opacity: 0 !important; +} +#container.playing #score, #container.resetting #score { + -webkit-transform: translatey(0px) scale(1); + transform: translatey(0px) scale(1); +} +#container.playing #instructions { + opacity: 1; +} +#container.ready .game-ready #start-button { + opacity: 1; + -webkit-transform: translatey(0); + transform: translatey(0); +} +#container.ended #score { + -webkit-transform: translatey(6vh) scale(1.5); + transform: translatey(6vh) scale(1.5); +} +#container.ended .game-over * { + opacity: 1; + -webkit-transform: translatey(0); + transform: translatey(0); +} +#container.ended .game-over p { + -webkit-transition-delay: 0.3s; + transition-delay: 0.3s; +} \ No newline at end of file diff --git a/Games/Carrom/README.md b/Games/Carrom/README.md new file mode 100644 index 0000000000..d0ff26dde9 --- /dev/null +++ b/Games/Carrom/README.md @@ -0,0 +1,2 @@ +# carrom +A Carrom Board Game, built on web using Javascript and Html Canvas diff --git a/Games/Carrom/carrom.html b/Games/Carrom/carrom.html new file mode 100644 index 0000000000..91ee9e1e85 --- /dev/null +++ b/Games/Carrom/carrom.html @@ -0,0 +1,44 @@ + + + + + Carrom + + + + + + + + + + +
+
+
+

Player 1

+

Score : 0

+
+ +
+ +
+
+
+ Your browser does not support the HTML5 canvas tag. + Your browser does not support the HTML5 canvas tag. +
+
+
+

Player 2

+

Score : 0

+
+

Mouse Positions :

+
+
+ + + \ No newline at end of file diff --git a/Games/Carrom/carrom.jpg b/Games/Carrom/carrom.jpg new file mode 100644 index 0000000000..1d3c562727 Binary files /dev/null and b/Games/Carrom/carrom.jpg differ diff --git a/Games/Carrom/css/bootstrap.min.css b/Games/Carrom/css/bootstrap.min.css new file mode 100644 index 0000000000..ed3905e0e0 --- /dev/null +++ b/Games/Carrom/css/bootstrap.min.css @@ -0,0 +1,6 @@ +/*! + * Bootstrap v3.3.7 (http://getbootstrap.com) + * Copyright 2011-2016 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + *//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0;font-size:2em}mark{color:#000;background:#ff0}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{height:0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{margin:0;font:inherit;color:inherit}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}input{line-height:normal}input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{padding:.35em .625em .75em;margin:0 2px;border:1px solid silver}legend{padding:0;border:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-spacing:0;border-collapse:collapse}td,th{padding:0}/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{*,:after,:before{color:#000!important;text-shadow:none!important;background:0 0!important;-webkit-box-shadow:none!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="javascript:"]:after,a[href^="#"]:after{content:""}blockquote,pre{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}}@font-face{font-family:'Glyphicons Halflings';src:url(../fonts/glyphicons-halflings-regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),url(../fonts/glyphicons-halflings-regular.woff2) format('woff2'),url(../fonts/glyphicons-halflings-regular.woff) format('woff'),url(../fonts/glyphicons-halflings-regular.ttf) format('truetype'),url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\002a"}.glyphicon-plus:before{content:"\002b"}.glyphicon-eur:before,.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}.glyphicon-cd:before{content:"\e201"}.glyphicon-save-file:before{content:"\e202"}.glyphicon-open-file:before{content:"\e203"}.glyphicon-level-up:before{content:"\e204"}.glyphicon-copy:before{content:"\e205"}.glyphicon-paste:before{content:"\e206"}.glyphicon-alert:before{content:"\e209"}.glyphicon-equalizer:before{content:"\e210"}.glyphicon-king:before{content:"\e211"}.glyphicon-queen:before{content:"\e212"}.glyphicon-pawn:before{content:"\e213"}.glyphicon-bishop:before{content:"\e214"}.glyphicon-knight:before{content:"\e215"}.glyphicon-baby-formula:before{content:"\e216"}.glyphicon-tent:before{content:"\26fa"}.glyphicon-blackboard:before{content:"\e218"}.glyphicon-bed:before{content:"\e219"}.glyphicon-apple:before{content:"\f8ff"}.glyphicon-erase:before{content:"\e221"}.glyphicon-hourglass:before{content:"\231b"}.glyphicon-lamp:before{content:"\e223"}.glyphicon-duplicate:before{content:"\e224"}.glyphicon-piggy-bank:before{content:"\e225"}.glyphicon-scissors:before{content:"\e226"}.glyphicon-bitcoin:before{content:"\e227"}.glyphicon-btc:before{content:"\e227"}.glyphicon-xbt:before{content:"\e227"}.glyphicon-yen:before{content:"\00a5"}.glyphicon-jpy:before{content:"\00a5"}.glyphicon-ruble:before{content:"\20bd"}.glyphicon-rub:before{content:"\20bd"}.glyphicon-scale:before{content:"\e230"}.glyphicon-ice-lolly:before{content:"\e231"}.glyphicon-ice-lolly-tasted:before{content:"\e232"}.glyphicon-education:before{content:"\e233"}.glyphicon-option-horizontal:before{content:"\e234"}.glyphicon-option-vertical:before{content:"\e235"}.glyphicon-menu-hamburger:before{content:"\e236"}.glyphicon-modal-window:before{content:"\e237"}.glyphicon-oil:before{content:"\e238"}.glyphicon-grain:before{content:"\e239"}.glyphicon-sunglasses:before{content:"\e240"}.glyphicon-text-size:before{content:"\e241"}.glyphicon-text-color:before{content:"\e242"}.glyphicon-text-background:before{content:"\e243"}.glyphicon-object-align-top:before{content:"\e244"}.glyphicon-object-align-bottom:before{content:"\e245"}.glyphicon-object-align-horizontal:before{content:"\e246"}.glyphicon-object-align-left:before{content:"\e247"}.glyphicon-object-align-vertical:before{content:"\e248"}.glyphicon-object-align-right:before{content:"\e249"}.glyphicon-triangle-right:before{content:"\e250"}.glyphicon-triangle-left:before{content:"\e251"}.glyphicon-triangle-bottom:before{content:"\e252"}.glyphicon-triangle-top:before{content:"\e253"}.glyphicon-console:before{content:"\e254"}.glyphicon-superscript:before{content:"\e255"}.glyphicon-subscript:before{content:"\e256"}.glyphicon-menu-left:before{content:"\e257"}.glyphicon-menu-right:before{content:"\e258"}.glyphicon-menu-down:before{content:"\e259"}.glyphicon-menu-up:before{content:"\e260"}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff}button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#337ab7;text-decoration:none}a:focus,a:hover{color:#23527c;text-decoration:underline}a:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.carousel-inner>.item>a>img,.carousel-inner>.item>img,.img-responsive,.thumbnail a>img,.thumbnail>img{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{display:inline-block;max-width:100%;height:auto;padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}[role=button]{cursor:pointer}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-weight:400;line-height:1;color:#777}.h1,.h2,.h3,h1,h2,h3{margin-top:20px;margin-bottom:10px}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small{font-size:65%}.h4,.h5,.h6,h4,h5,h6{margin-top:10px;margin-bottom:10px}.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-size:75%}.h1,h1{font-size:36px}.h2,h2{font-size:30px}.h3,h3{font-size:24px}.h4,h4{font-size:18px}.h5,h5{font-size:14px}.h6,h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}.small,small{font-size:85%}.mark,mark{padding:.2em;background-color:#fcf8e3}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#777}.text-primary{color:#337ab7}a.text-primary:focus,a.text-primary:hover{color:#286090}.text-success{color:#3c763d}a.text-success:focus,a.text-success:hover{color:#2b542c}.text-info{color:#31708f}a.text-info:focus,a.text-info:hover{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:focus,a.text-warning:hover{color:#66512c}.text-danger{color:#a94442}a.text-danger:focus,a.text-danger:hover{color:#843534}.bg-primary{color:#fff;background-color:#337ab7}a.bg-primary:focus,a.bg-primary:hover{background-color:#286090}.bg-success{background-color:#dff0d8}a.bg-success:focus,a.bg-success:hover{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:focus,a.bg-info:hover{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:focus,a.bg-warning:hover{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:focus,a.bg-danger:hover{background-color:#e4b9b9}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ol,ul{margin-top:0;margin-bottom:10px}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;margin-left:-5px;list-style:none}.list-inline>li{display:inline-block;padding-right:5px;padding-left:5px}dl{margin-top:0;margin-bottom:20px}dd,dt{line-height:1.42857143}dt{font-weight:700}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[data-original-title],abbr[title]{cursor:help;border-bottom:1px dotted #777}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}blockquote ol:last-child,blockquote p:last-child,blockquote ul:last-child{margin-bottom:0}blockquote .small,blockquote footer,blockquote small{display:block;font-size:80%;line-height:1.42857143;color:#777}blockquote .small:before,blockquote footer:before,blockquote small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;text-align:right;border-right:5px solid #eee;border-left:0}.blockquote-reverse .small:before,.blockquote-reverse footer:before,.blockquote-reverse small:before,blockquote.pull-right .small:before,blockquote.pull-right footer:before,blockquote.pull-right small:before{content:''}.blockquote-reverse .small:after,.blockquote-reverse footer:after,.blockquote-reverse small:after,blockquote.pull-right .small:after,blockquote.pull-right footer:after,blockquote.pull-right small:after{content:'\00A0 \2014'}address{margin-bottom:20px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333;border-radius:3px;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.25);box-shadow:inset 0 -1px 0 rgba(0,0,0,.25)}kbd kbd{padding:0;font-size:100%;font-weight:700;-webkit-box-shadow:none;box-shadow:none}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;color:#333;word-break:break-all;word-wrap:break-word;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{margin-right:-15px;margin-left:-15px}.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{position:relative;min-height:1px;padding-right:15px;padding-left:15px}.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}table{background-color:transparent}caption{padding-top:8px;padding-bottom:8px;color:#777;text-align:left}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:20px}.table>tbody>tr>td,.table>tbody>tr>th,.table>tfoot>tr>td,.table>tfoot>tr>th,.table>thead>tr>td,.table>thead>tr>th{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>td,.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>td,.table>thead:first-child>tr:first-child>th{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>tbody>tr>td,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>td,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>thead>tr>th{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>tbody>tr>td,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>td,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border:1px solid #ddd}.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border-bottom-width:2px}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}.table-hover>tbody>tr:hover{background-color:#f5f5f5}table col[class*=col-]{position:static;display:table-column;float:none}table td[class*=col-],table th[class*=col-]{position:static;display:table-cell;float:none}.table>tbody>tr.active>td,.table>tbody>tr.active>th,.table>tbody>tr>td.active,.table>tbody>tr>th.active,.table>tfoot>tr.active>td,.table>tfoot>tr.active>th,.table>tfoot>tr>td.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>thead>tr.active>th,.table>thead>tr>td.active,.table>thead>tr>th.active{background-color:#f5f5f5}.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr.active:hover>th,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover{background-color:#e8e8e8}.table>tbody>tr.success>td,.table>tbody>tr.success>th,.table>tbody>tr>td.success,.table>tbody>tr>th.success,.table>tfoot>tr.success>td,.table>tfoot>tr.success>th,.table>tfoot>tr>td.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>thead>tr.success>th,.table>thead>tr>td.success,.table>thead>tr>th.success{background-color:#dff0d8}.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr.success:hover>th,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover{background-color:#d0e9c6}.table>tbody>tr.info>td,.table>tbody>tr.info>th,.table>tbody>tr>td.info,.table>tbody>tr>th.info,.table>tfoot>tr.info>td,.table>tfoot>tr.info>th,.table>tfoot>tr>td.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>thead>tr.info>th,.table>thead>tr>td.info,.table>thead>tr>th.info{background-color:#d9edf7}.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr.info:hover>th,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover{background-color:#c4e3f3}.table>tbody>tr.warning>td,.table>tbody>tr.warning>th,.table>tbody>tr>td.warning,.table>tbody>tr>th.warning,.table>tfoot>tr.warning>td,.table>tfoot>tr.warning>th,.table>tfoot>tr>td.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>thead>tr.warning>th,.table>thead>tr>td.warning,.table>thead>tr>th.warning{background-color:#fcf8e3}.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr.warning:hover>th,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover{background-color:#faf2cc}.table>tbody>tr.danger>td,.table>tbody>tr.danger>th,.table>tbody>tr>td.danger,.table>tbody>tr>th.danger,.table>tfoot>tr.danger>td,.table>tfoot>tr.danger>th,.table>tfoot>tr>td.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>thead>tr.danger>th,.table>thead>tr>td.danger,.table>thead>tr>th.danger{background-color:#f2dede}.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr.danger:hover>th,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover{background-color:#ebcccc}.table-responsive{min-height:.01%;overflow-x:auto}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-y:hidden;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>td,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>thead>tr>th{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:700}input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=checkbox],input[type=radio]{margin:4px 0 0;margin-top:1px\9;line-height:normal}input[type=file]{display:block}input[type=range]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type=file]:focus,input[type=checkbox]:focus,input[type=radio]:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:7px;font-size:14px;line-height:1.42857143;color:#555}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.form-control::-moz-placeholder{color:#999;opacity:1}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control::-ms-expand{background-color:transparent;border:0}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{background-color:#eee;opacity:1}.form-control[disabled],fieldset[disabled] .form-control{cursor:not-allowed}textarea.form-control{height:auto}input[type=search]{-webkit-appearance:none}@media screen and (-webkit-min-device-pixel-ratio:0){input[type=date].form-control,input[type=time].form-control,input[type=datetime-local].form-control,input[type=month].form-control{line-height:34px}.input-group-sm input[type=date],.input-group-sm input[type=time],.input-group-sm input[type=datetime-local],.input-group-sm input[type=month],input[type=date].input-sm,input[type=time].input-sm,input[type=datetime-local].input-sm,input[type=month].input-sm{line-height:30px}.input-group-lg input[type=date],.input-group-lg input[type=time],.input-group-lg input[type=datetime-local],.input-group-lg input[type=month],input[type=date].input-lg,input[type=time].input-lg,input[type=datetime-local].input-lg,input[type=month].input-lg{line-height:46px}}.form-group{margin-bottom:15px}.checkbox,.radio{position:relative;display:block;margin-top:10px;margin-bottom:10px}.checkbox label,.radio label{min-height:20px;padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.checkbox input[type=checkbox],.checkbox-inline input[type=checkbox],.radio input[type=radio],.radio-inline input[type=radio]{position:absolute;margin-top:4px\9;margin-left:-20px}.checkbox+.checkbox,.radio+.radio{margin-top:-5px}.checkbox-inline,.radio-inline{position:relative;display:inline-block;padding-left:20px;margin-bottom:0;font-weight:400;vertical-align:middle;cursor:pointer}.checkbox-inline+.checkbox-inline,.radio-inline+.radio-inline{margin-top:0;margin-left:10px}fieldset[disabled] input[type=checkbox],fieldset[disabled] input[type=radio],input[type=checkbox].disabled,input[type=checkbox][disabled],input[type=radio].disabled,input[type=radio][disabled]{cursor:not-allowed}.checkbox-inline.disabled,.radio-inline.disabled,fieldset[disabled] .checkbox-inline,fieldset[disabled] .radio-inline{cursor:not-allowed}.checkbox.disabled label,.radio.disabled label,fieldset[disabled] .checkbox label,fieldset[disabled] .radio label{cursor:not-allowed}.form-control-static{min-height:34px;padding-top:7px;padding-bottom:7px;margin-bottom:0}.form-control-static.input-lg,.form-control-static.input-sm{padding-right:0;padding-left:0}.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm{height:30px;line-height:30px}select[multiple].input-sm,textarea.input-sm{height:auto}.form-group-sm .form-control{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.form-group-sm select.form-control{height:30px;line-height:30px}.form-group-sm select[multiple].form-control,.form-group-sm textarea.form-control{height:auto}.form-group-sm .form-control-static{height:30px;min-height:32px;padding:6px 10px;font-size:12px;line-height:1.5}.input-lg{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-lg{height:46px;line-height:46px}select[multiple].input-lg,textarea.input-lg{height:auto}.form-group-lg .form-control{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.form-group-lg select.form-control{height:46px;line-height:46px}.form-group-lg select[multiple].form-control,.form-group-lg textarea.form-control{height:auto}.form-group-lg .form-control-static{height:46px;min-height:38px;padding:11px 16px;font-size:18px;line-height:1.3333333}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.5px}.form-control-feedback{position:absolute;top:0;right:0;z-index:2;display:block;width:34px;height:34px;line-height:34px;text-align:center;pointer-events:none}.form-group-lg .form-control+.form-control-feedback,.input-group-lg+.form-control-feedback,.input-lg+.form-control-feedback{width:46px;height:46px;line-height:46px}.form-group-sm .form-control+.form-control-feedback,.input-group-sm+.form-control-feedback,.input-sm+.form-control-feedback{width:30px;height:30px;line-height:30px}.has-success .checkbox,.has-success .checkbox-inline,.has-success .control-label,.has-success .help-block,.has-success .radio,.has-success .radio-inline,.has-success.checkbox label,.has-success.checkbox-inline label,.has-success.radio label,.has-success.radio-inline label{color:#3c763d}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;background-color:#dff0d8;border-color:#3c763d}.has-success .form-control-feedback{color:#3c763d}.has-warning .checkbox,.has-warning .checkbox-inline,.has-warning .control-label,.has-warning .help-block,.has-warning .radio,.has-warning .radio-inline,.has-warning.checkbox label,.has-warning.checkbox-inline label,.has-warning.radio label,.has-warning.radio-inline label{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;background-color:#fcf8e3;border-color:#8a6d3b}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .checkbox,.has-error .checkbox-inline,.has-error .control-label,.has-error .help-block,.has-error .radio,.has-error .radio-inline,.has-error.checkbox label,.has-error.checkbox-inline label,.has-error.radio label,.has-error.radio-inline label{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;background-color:#f2dede;border-color:#a94442}.has-error .form-control-feedback{color:#a94442}.has-feedback label~.form-control-feedback{top:25px}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-static{display:inline-block}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .form-control,.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .checkbox,.form-inline .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .checkbox label,.form-inline .radio label{padding-left:0}.form-inline .checkbox input[type=checkbox],.form-inline .radio input[type=radio]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .checkbox,.form-horizontal .checkbox-inline,.form-horizontal .radio,.form-horizontal .radio-inline{padding-top:7px;margin-top:0;margin-bottom:0}.form-horizontal .checkbox,.form-horizontal .radio{min-height:27px}.form-horizontal .form-group{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.form-horizontal .control-label{padding-top:7px;margin-bottom:0;text-align:right}}.form-horizontal .has-feedback .form-control-feedback{right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:11px;font-size:18px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:6px;font-size:12px}}.btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.btn.active.focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn:active:focus,.btn:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.focus,.btn:focus,.btn:hover{color:#333;text-decoration:none}.btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none;opacity:.65}a.btn.disabled,fieldset[disabled] a.btn{pointer-events:none}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default.focus,.btn-default:focus{color:#333;background-color:#e6e6e6;border-color:#8c8c8c}.btn-default:hover{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default.active,.btn-default:active,.open>.dropdown-toggle.btn-default{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default.active.focus,.btn-default.active:focus,.btn-default.active:hover,.btn-default:active.focus,.btn-default:active:focus,.btn-default:active:hover,.open>.dropdown-toggle.btn-default.focus,.open>.dropdown-toggle.btn-default:focus,.open>.dropdown-toggle.btn-default:hover{color:#333;background-color:#d4d4d4;border-color:#8c8c8c}.btn-default.active,.btn-default:active,.open>.dropdown-toggle.btn-default{background-image:none}.btn-default.disabled.focus,.btn-default.disabled:focus,.btn-default.disabled:hover,.btn-default[disabled].focus,.btn-default[disabled]:focus,.btn-default[disabled]:hover,fieldset[disabled] .btn-default.focus,fieldset[disabled] .btn-default:focus,fieldset[disabled] .btn-default:hover{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#333}.btn-primary{color:#fff;background-color:#337ab7;border-color:#2e6da4}.btn-primary.focus,.btn-primary:focus{color:#fff;background-color:#286090;border-color:#122b40}.btn-primary:hover{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-primary{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary.active.focus,.btn-primary.active:focus,.btn-primary.active:hover,.btn-primary:active.focus,.btn-primary:active:focus,.btn-primary:active:hover,.open>.dropdown-toggle.btn-primary.focus,.open>.dropdown-toggle.btn-primary:focus,.open>.dropdown-toggle.btn-primary:hover{color:#fff;background-color:#204d74;border-color:#122b40}.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled.focus,.btn-primary.disabled:focus,.btn-primary.disabled:hover,.btn-primary[disabled].focus,.btn-primary[disabled]:focus,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary.focus,fieldset[disabled] .btn-primary:focus,fieldset[disabled] .btn-primary:hover{background-color:#337ab7;border-color:#2e6da4}.btn-primary .badge{color:#337ab7;background-color:#fff}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success.focus,.btn-success:focus{color:#fff;background-color:#449d44;border-color:#255625}.btn-success:hover{color:#fff;background-color:#449d44;border-color:#398439}.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success{color:#fff;background-color:#449d44;border-color:#398439}.btn-success.active.focus,.btn-success.active:focus,.btn-success.active:hover,.btn-success:active.focus,.btn-success:active:focus,.btn-success:active:hover,.open>.dropdown-toggle.btn-success.focus,.open>.dropdown-toggle.btn-success:focus,.open>.dropdown-toggle.btn-success:hover{color:#fff;background-color:#398439;border-color:#255625}.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success{background-image:none}.btn-success.disabled.focus,.btn-success.disabled:focus,.btn-success.disabled:hover,.btn-success[disabled].focus,.btn-success[disabled]:focus,.btn-success[disabled]:hover,fieldset[disabled] .btn-success.focus,fieldset[disabled] .btn-success:focus,fieldset[disabled] .btn-success:hover{background-color:#5cb85c;border-color:#4cae4c}.btn-success .badge{color:#5cb85c;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info.focus,.btn-info:focus{color:#fff;background-color:#31b0d5;border-color:#1b6d85}.btn-info:hover{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info.active,.btn-info:active,.open>.dropdown-toggle.btn-info{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info.active.focus,.btn-info.active:focus,.btn-info.active:hover,.btn-info:active.focus,.btn-info:active:focus,.btn-info:active:hover,.open>.dropdown-toggle.btn-info.focus,.open>.dropdown-toggle.btn-info:focus,.open>.dropdown-toggle.btn-info:hover{color:#fff;background-color:#269abc;border-color:#1b6d85}.btn-info.active,.btn-info:active,.open>.dropdown-toggle.btn-info{background-image:none}.btn-info.disabled.focus,.btn-info.disabled:focus,.btn-info.disabled:hover,.btn-info[disabled].focus,.btn-info[disabled]:focus,.btn-info[disabled]:hover,fieldset[disabled] .btn-info.focus,fieldset[disabled] .btn-info:focus,fieldset[disabled] .btn-info:hover{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning.focus,.btn-warning:focus{color:#fff;background-color:#ec971f;border-color:#985f0d}.btn-warning:hover{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning.active,.btn-warning:active,.open>.dropdown-toggle.btn-warning{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning.active.focus,.btn-warning.active:focus,.btn-warning.active:hover,.btn-warning:active.focus,.btn-warning:active:focus,.btn-warning:active:hover,.open>.dropdown-toggle.btn-warning.focus,.open>.dropdown-toggle.btn-warning:focus,.open>.dropdown-toggle.btn-warning:hover{color:#fff;background-color:#d58512;border-color:#985f0d}.btn-warning.active,.btn-warning:active,.open>.dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled.focus,.btn-warning.disabled:focus,.btn-warning.disabled:hover,.btn-warning[disabled].focus,.btn-warning[disabled]:focus,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning.focus,fieldset[disabled] .btn-warning:focus,fieldset[disabled] .btn-warning:hover{background-color:#f0ad4e;border-color:#eea236}.btn-warning .badge{color:#f0ad4e;background-color:#fff}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger.focus,.btn-danger:focus{color:#fff;background-color:#c9302c;border-color:#761c19}.btn-danger:hover{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger.active,.btn-danger:active,.open>.dropdown-toggle.btn-danger{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger.active.focus,.btn-danger.active:focus,.btn-danger.active:hover,.btn-danger:active.focus,.btn-danger:active:focus,.btn-danger:active:hover,.open>.dropdown-toggle.btn-danger.focus,.open>.dropdown-toggle.btn-danger:focus,.open>.dropdown-toggle.btn-danger:hover{color:#fff;background-color:#ac2925;border-color:#761c19}.btn-danger.active,.btn-danger:active,.open>.dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled.focus,.btn-danger.disabled:focus,.btn-danger.disabled:hover,.btn-danger[disabled].focus,.btn-danger[disabled]:focus,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger.focus,fieldset[disabled] .btn-danger:focus,fieldset[disabled] .btn-danger:hover{background-color:#d9534f;border-color:#d43f3a}.btn-danger .badge{color:#d9534f;background-color:#fff}.btn-link{font-weight:400;color:#337ab7;border-radius:0}.btn-link,.btn-link.active,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:active,.btn-link:focus,.btn-link:hover{border-color:transparent}.btn-link:focus,.btn-link:hover{color:#23527c;text-decoration:underline;background-color:transparent}.btn-link[disabled]:focus,.btn-link[disabled]:hover,fieldset[disabled] .btn-link:focus,fieldset[disabled] .btn-link:hover{color:#777;text-decoration:none}.btn-group-lg>.btn,.btn-lg{padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.btn-group-sm>.btn,.btn-sm{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-group-xs>.btn,.btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition-timing-function:ease;-o-transition-timing-function:ease;transition-timing-function:ease;-webkit-transition-duration:.35s;-o-transition-duration:.35s;transition-duration:.35s;-webkit-transition-property:height,visibility;-o-transition-property:height,visibility;transition-property:height,visibility}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px dashed;border-top:4px solid\9;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown,.dropup{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;text-align:left;list-style:none;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{color:#262626;text-decoration:none;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:focus,.dropdown-menu>.active>a:hover{color:#fff;text-decoration:none;background-color:#337ab7;outline:0}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{color:#777}.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{right:0;left:auto}.dropdown-menu-left{right:auto;left:0}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}.dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{content:"";border-top:0;border-bottom:4px dashed;border-bottom:4px solid\9}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:2px}@media (min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}.navbar-right .dropdown-menu-left{right:auto;left:0}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;float:left}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group-vertical>.btn:hover,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus,.btn-group>.btn:hover{z-index:2}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn,.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-right:8px;padding-left:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-right:12px;padding-left:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-left-radius:0;border-top-right-radius:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-top-right-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{display:table-cell;float:none;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle=buttons]>.btn input[type=checkbox],[data-toggle=buttons]>.btn input[type=radio],[data-toggle=buttons]>.btn-group>.btn input[type=checkbox],[data-toggle=buttons]>.btn-group>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*=col-]{float:none;padding-right:0;padding-left:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group .form-control:focus{z-index:3}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:46px;line-height:46px}select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn,textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn,textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn{height:auto}.input-group .form-control,.input-group-addon,.input-group-btn{display:table-cell}.input-group .form-control:not(:first-child):not(:last-child),.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:400;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type=checkbox],.input-group-addon input[type=radio]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn-group:not(:last-child)>.btn,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:first-child>.btn-group:not(:first-child)>.btn,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:active,.input-group-btn>.btn:focus,.input-group-btn>.btn:hover{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{z-index:2;margin-left:-1px}.nav{padding-left:0;margin-bottom:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:focus,.nav>li>a:hover{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#777}.nav>li.disabled>a:focus,.nav>li.disabled>a:hover{color:#777;text-decoration:none;cursor:not-allowed;background-color:transparent}.nav .open>a,.nav .open>a:focus,.nav .open>a:hover{background-color:#eee;border-color:#337ab7}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:focus,.nav-tabs>li.active>a:hover{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:focus,.nav-pills>li.active>a:hover{color:#fff;background-color:#337ab7}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:4px}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{padding-right:15px;padding-left:15px;overflow-x:visible;-webkit-overflow-scrolling:touch;border-top:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1)}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse{padding-right:0;padding-left:0}}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:340px}@media (max-device-width:480px) and (orientation:landscape){.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:200px}}.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-bottom,.navbar-fixed-top{position:fixed;right:0;left:0;z-index:1030}@media (min-width:768px){.navbar-fixed-bottom,.navbar-fixed-top{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;height:50px;padding:15px 15px;font-size:18px;line-height:20px}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-brand>img{display:block}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;padding:9px 10px;margin-top:8px;margin-right:15px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-nav .open .dropdown-menu .dropdown-header,.navbar-nav .open .dropdown-menu>li>a{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:focus,.navbar-nav .open .dropdown-menu>li>a:hover{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}}.navbar-form{padding:10px 15px;margin-top:8px;margin-right:-15px;margin-bottom:8px;margin-left:-15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1)}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .form-control-static{display:inline-block}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .form-control,.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .checkbox,.navbar-form .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .checkbox label,.navbar-form .radio label{padding-left:0}.navbar-form .checkbox input[type=checkbox],.navbar-form .radio input[type=radio]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}.navbar-form .form-group:last-child{margin-bottom:0}}@media (min-width:768px){.navbar-form{width:auto;padding-top:0;padding-bottom:0;margin-right:0;margin-left:0;border:0;-webkit-box-shadow:none;box-shadow:none}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-left-radius:0;border-top-right-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{margin-bottom:0;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:8px;margin-bottom:8px}.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px}.navbar-text{margin-top:15px;margin-bottom:15px}@media (min-width:768px){.navbar-text{float:left;margin-right:15px;margin-left:15px}}@media (min-width:768px){.navbar-left{float:left!important}.navbar-right{float:right!important;margin-right:-15px}.navbar-right~.navbar-right{margin-right:0}}.navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:focus,.navbar-default .navbar-brand:hover{color:#5e5e5e;background-color:transparent}.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a{color:#777}.navbar-default .navbar-nav>li>a:focus,.navbar-default .navbar-nav>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:focus,.navbar-default .navbar-nav>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:focus,.navbar-default .navbar-nav>.disabled>a:hover{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:focus,.navbar-default .navbar-toggle:hover{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e7e7e7}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:focus,.navbar-default .navbar-nav>.open>a:hover{color:#555;background-color:#e7e7e7}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-default .btn-link{color:#777}.navbar-default .btn-link:focus,.navbar-default .btn-link:hover{color:#333}.navbar-default .btn-link[disabled]:focus,.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:focus,fieldset[disabled] .navbar-default .btn-link:hover{color:#ccc}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#9d9d9d}.navbar-inverse .navbar-brand:focus,.navbar-inverse .navbar-brand:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a:focus,.navbar-inverse .navbar-nav>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:focus,.navbar-inverse .navbar-nav>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:focus,.navbar-inverse .navbar-nav>.disabled>a:hover{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:focus,.navbar-inverse .navbar-toggle:hover{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:focus,.navbar-inverse .navbar-nav>.open>a:hover{color:#fff;background-color:#080808}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#9d9d9d}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .btn-link{color:#9d9d9d}.navbar-inverse .btn-link:focus,.navbar-inverse .btn-link:hover{color:#fff}.navbar-inverse .btn-link[disabled]:focus,.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:focus,fieldset[disabled] .navbar-inverse .btn-link:hover{color:#444}.breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{padding:0 5px;color:#ccc;content:"/\00a0"}.breadcrumb>.active{color:#777}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;margin-left:-1px;line-height:1.42857143;color:#337ab7;text-decoration:none;background-color:#fff;border:1px solid #ddd}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-top-left-radius:4px;border-bottom-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-top-right-radius:4px;border-bottom-right-radius:4px}.pagination>li>a:focus,.pagination>li>a:hover,.pagination>li>span:focus,.pagination>li>span:hover{z-index:2;color:#23527c;background-color:#eee;border-color:#ddd}.pagination>.active>a,.pagination>.active>a:focus,.pagination>.active>a:hover,.pagination>.active>span,.pagination>.active>span:focus,.pagination>.active>span:hover{z-index:3;color:#fff;cursor:default;background-color:#337ab7;border-color:#337ab7}.pagination>.disabled>a,.pagination>.disabled>a:focus,.pagination>.disabled>a:hover,.pagination>.disabled>span,.pagination>.disabled>span:focus,.pagination>.disabled>span:hover{color:#777;cursor:not-allowed;background-color:#fff;border-color:#ddd}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px;line-height:1.3333333}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-top-left-radius:6px;border-bottom-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-top-right-radius:6px;border-bottom-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px;line-height:1.5}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-top-left-radius:3px;border-bottom-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-top-right-radius:3px;border-bottom-right-radius:3px}.pager{padding-left:0;margin:20px 0;text-align:center;list-style:none}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:focus,.pager li>a:hover{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:focus,.pager .disabled>a:hover,.pager .disabled>span{color:#777;cursor:not-allowed;background-color:#fff}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.label:focus,a.label:hover{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#777}.label-default[href]:focus,.label-default[href]:hover{background-color:#5e5e5e}.label-primary{background-color:#337ab7}.label-primary[href]:focus,.label-primary[href]:hover{background-color:#286090}.label-success{background-color:#5cb85c}.label-success[href]:focus,.label-success[href]:hover{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:focus,.label-info[href]:hover{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:focus,.label-warning[href]:hover{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:focus,.label-danger[href]:hover{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:middle;background-color:#777;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-group-xs>.btn .badge,.btn-xs .badge{top:0;padding:1px 5px}a.badge:focus,a.badge:hover{color:#fff;text-decoration:none;cursor:pointer}.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#337ab7;background-color:#fff}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding-top:30px;padding-bottom:30px;margin-bottom:30px;color:inherit;background-color:#eee}.jumbotron .h1,.jumbotron h1{color:inherit}.jumbotron p{margin-bottom:15px;font-size:21px;font-weight:200}.jumbotron>hr{border-top-color:#d5d5d5}.container .jumbotron,.container-fluid .jumbotron{padding-right:15px;padding-left:15px;border-radius:6px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron,.container-fluid .jumbotron{padding-right:60px;padding-left:60px}.jumbotron .h1,.jumbotron h1{font-size:63px}}.thumbnail{display:block;padding:4px;margin-bottom:20px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:border .2s ease-in-out;-o-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.thumbnail a>img,.thumbnail>img{margin-right:auto;margin-left:auto}a.thumbnail.active,a.thumbnail:focus,a.thumbnail:hover{border-color:#337ab7}.thumbnail .caption{padding:9px;color:#333}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:700}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.progress-bar{float:left;width:0;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#337ab7;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress-bar-striped,.progress-striped .progress-bar{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;background-size:40px 40px}.progress-bar.active,.progress.active .progress-bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#f0ad4e}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.media{margin-top:15px}.media:first-child{margin-top:0}.media,.media-body{overflow:hidden;zoom:1}.media-body{width:10000px}.media-object{display:block}.media-object.img-thumbnail{max-width:none}.media-right,.media>.pull-right{padding-left:10px}.media-left,.media>.pull-left{padding-right:10px}.media-body,.media-left,.media-right{display:table-cell;vertical-align:top}.media-middle{vertical-align:middle}.media-bottom{vertical-align:bottom}.media-heading{margin-top:0;margin-bottom:5px}.media-list{padding-left:0;list-style:none}.list-group{padding-left:0;margin-bottom:20px}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}a.list-group-item,button.list-group-item{color:#555}a.list-group-item .list-group-item-heading,button.list-group-item .list-group-item-heading{color:#333}a.list-group-item:focus,a.list-group-item:hover,button.list-group-item:focus,button.list-group-item:hover{color:#555;text-decoration:none;background-color:#f5f5f5}button.list-group-item{width:100%;text-align:left}.list-group-item.disabled,.list-group-item.disabled:focus,.list-group-item.disabled:hover{color:#777;cursor:not-allowed;background-color:#eee}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text{color:#777}.list-group-item.active,.list-group-item.active:focus,.list-group-item.active:hover{z-index:2;color:#fff;background-color:#337ab7;border-color:#337ab7}.list-group-item.active .list-group-item-heading,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:focus .list-group-item-text,.list-group-item.active:hover .list-group-item-text{color:#c7ddef}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success,button.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading,button.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:focus,a.list-group-item-success:hover,button.list-group-item-success:focus,button.list-group-item-success:hover{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,a.list-group-item-success.active:focus,a.list-group-item-success.active:hover,button.list-group-item-success.active,button.list-group-item-success.active:focus,button.list-group-item-success.active:hover{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info,button.list-group-item-info{color:#31708f}a.list-group-item-info .list-group-item-heading,button.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:focus,a.list-group-item-info:hover,button.list-group-item-info:focus,button.list-group-item-info:hover{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,a.list-group-item-info.active:focus,a.list-group-item-info.active:hover,button.list-group-item-info.active,button.list-group-item-info.active:focus,button.list-group-item-info.active:hover{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning,button.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading,button.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:focus,a.list-group-item-warning:hover,button.list-group-item-warning:focus,button.list-group-item-warning:hover{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,a.list-group-item-warning.active:focus,a.list-group-item-warning.active:hover,button.list-group-item-warning.active,button.list-group-item-warning.active:focus,button.list-group-item-warning.active:hover{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger,button.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading,button.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:focus,a.list-group-item-danger:hover,button.list-group-item-danger:focus,button.list-group-item-danger:hover{color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,a.list-group-item-danger.active:focus,a.list-group-item-danger.active:hover,button.list-group-item-danger.active,button.list-group-item-danger.active:focus,button.list-group-item-danger.active:hover{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-left-radius:3px;border-top-right-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit}.panel-title>.small,.panel-title>.small>a,.panel-title>a,.panel-title>small,.panel-title>small>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group,.panel>.panel-collapse>.list-group{margin-bottom:0}.panel>.list-group .list-group-item,.panel>.panel-collapse>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child,.panel>.panel-collapse>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-left-radius:3px;border-top-right-radius:3px}.panel>.list-group:last-child .list-group-item:last-child,.panel>.panel-collapse>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.panel-heading+.panel-collapse>.list-group .list-group-item:first-child{border-top-left-radius:0;border-top-right-radius:0}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.list-group+.panel-footer{border-top-width:0}.panel>.panel-collapse>.table,.panel>.table,.panel>.table-responsive>.table{margin-bottom:0}.panel>.panel-collapse>.table caption,.panel>.table caption,.panel>.table-responsive>.table caption{padding-right:15px;padding-left:15px}.panel>.table-responsive:first-child>.table:first-child,.panel>.table:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child,.panel>.table:first-child>thead:first-child>tr:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table-responsive:last-child>.table:last-child,.panel>.table:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive,.panel>.table+.panel-body,.panel>.table-responsive+.panel-body{border-top:1px solid #ddd}.panel>.table>tbody:first-child>tr:first-child td,.panel>.table>tbody:first-child>tr:first-child th{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{margin-bottom:0;border:0}.panel-group{margin-bottom:20px}.panel-group .panel{margin-bottom:0;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse>.list-group,.panel-group .panel-heading+.panel-collapse>.panel-body{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ddd}.panel-default>.panel-heading .badge{color:#f5f5f5;background-color:#333}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#337ab7}.panel-primary>.panel-heading{color:#fff;background-color:#337ab7;border-color:#337ab7}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#337ab7}.panel-primary>.panel-heading .badge{color:#337ab7;background-color:#fff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#337ab7}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#d6e9c6}.panel-success>.panel-heading .badge{color:#dff0d8;background-color:#3c763d}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#d6e9c6}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#bce8f1}.panel-info>.panel-heading .badge{color:#d9edf7;background-color:#31708f}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#bce8f1}.panel-warning{border-color:#faebcc}.panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#faebcc}.panel-warning>.panel-heading .badge{color:#fcf8e3;background-color:#8a6d3b}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#faebcc}.panel-danger{border-color:#ebccd1}.panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ebccd1}.panel-danger>.panel-heading .badge{color:#f2dede;background-color:#a94442}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ebccd1}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:21px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;filter:alpha(opacity=20);opacity:.2}.close:focus,.close:hover{color:#000;text-decoration:none;cursor:pointer;filter:alpha(opacity=50);opacity:.5}button.close{-webkit-appearance:none;padding:0;cursor:pointer;background:0 0;border:0}.modal-open{overflow:hidden}.modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;display:none;overflow:hidden;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transition:-webkit-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out;-webkit-transform:translate(0,-25%);-ms-transform:translate(0,-25%);-o-transform:translate(0,-25%);transform:translate(0,-25%)}.modal.in .modal-dialog{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);-o-transform:translate(0,0);transform:translate(0,0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #999;border:1px solid rgba(0,0,0,.2);border-radius:6px;outline:0;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5)}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{filter:alpha(opacity=0);opacity:0}.modal-backdrop.in{filter:alpha(opacity=50);opacity:.5}.modal-header{padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:15px}.modal-footer{padding:15px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);box-shadow:0 5px 15px rgba(0,0,0,.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:12px;font-style:normal;font-weight:400;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;filter:alpha(opacity=0);opacity:0;line-break:auto}.tooltip.in{filter:alpha(opacity=90);opacity:.9}.tooltip.top{padding:5px 0;margin-top:-3px}.tooltip.right{padding:0 5px;margin-left:3px}.tooltip.bottom{padding:5px 0;margin-top:3px}.tooltip.left{padding:0 5px;margin-left:-3px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;background-color:#000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{right:5px;bottom:0;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-right .tooltip-arrow{bottom:0;left:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-left .tooltip-arrow{top:0;right:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-right .tooltip-arrow{top:0;left:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);line-break:auto}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{padding:8px 14px;margin:0;font-size:14px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow{border-width:11px}.popover>.arrow:after{content:"";border-width:10px}.popover.top>.arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,.25);border-bottom-width:0}.popover.top>.arrow:after{bottom:1px;margin-left:-10px;content:" ";border-top-color:#fff;border-bottom-width:0}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,.25);border-left-width:0}.popover.right>.arrow:after{bottom:-10px;left:1px;content:" ";border-right-color:#fff;border-left-width:0}.popover.bottom>.arrow{top:-11px;left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,.25)}.popover.bottom>.arrow:after{top:1px;margin-left:-10px;content:" ";border-top-width:0;border-bottom-color:#fff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,.25)}.popover.left>.arrow:after{right:1px;bottom:-10px;content:" ";border-right-width:0;border-left-color:#fff}.carousel{position:relative}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>a>img,.carousel-inner>.item>img{line-height:1}@media all and (transform-3d),(-webkit-transform-3d){.carousel-inner>.item{-webkit-transition:-webkit-transform .6s ease-in-out;-o-transition:-o-transform .6s ease-in-out;transition:transform .6s ease-in-out;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000px;perspective:1000px}.carousel-inner>.item.active.right,.carousel-inner>.item.next{left:0;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.carousel-inner>.item.active.left,.carousel-inner>.item.prev{left:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.carousel-inner>.item.active,.carousel-inner>.item.next.left,.carousel-inner>.item.prev.right{left:0;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;bottom:0;left:0;width:15%;font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6);background-color:rgba(0,0,0,0);filter:alpha(opacity=50);opacity:.5}.carousel-control.left{background-image:-webkit-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,.0001)));background-image:linear-gradient(to right,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);background-repeat:repeat-x}.carousel-control.right{right:0;left:auto;background-image:-webkit-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.0001)),to(rgba(0,0,0,.5)));background-image:linear-gradient(to right,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);background-repeat:repeat-x}.carousel-control:focus,.carousel-control:hover{color:#fff;text-decoration:none;filter:alpha(opacity=90);outline:0;opacity:.9}.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{position:absolute;top:50%;z-index:5;display:inline-block;margin-top:-10px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{left:50%;margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{right:50%;margin-right:-10px}.carousel-control .icon-next,.carousel-control .icon-prev{width:20px;height:20px;font-family:serif;line-height:1}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;padding-left:0;margin-left:-30%;text-align:center;list-style:none}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;cursor:pointer;background-color:#000\9;background-color:rgba(0,0,0,0);border:1px solid #fff;border-radius:10px}.carousel-indicators .active{width:12px;height:12px;margin:0;background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{width:30px;height:30px;margin-top:-10px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-10px}.carousel-caption{right:20%;left:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.btn-group-vertical>.btn-group:after,.btn-group-vertical>.btn-group:before,.btn-toolbar:after,.btn-toolbar:before,.clearfix:after,.clearfix:before,.container-fluid:after,.container-fluid:before,.container:after,.container:before,.dl-horizontal dd:after,.dl-horizontal dd:before,.form-horizontal .form-group:after,.form-horizontal .form-group:before,.modal-footer:after,.modal-footer:before,.modal-header:after,.modal-header:before,.nav:after,.nav:before,.navbar-collapse:after,.navbar-collapse:before,.navbar-header:after,.navbar-header:before,.navbar:after,.navbar:before,.pager:after,.pager:before,.panel-body:after,.panel-body:before,.row:after,.row:before{display:table;content:" "}.btn-group-vertical>.btn-group:after,.btn-toolbar:after,.clearfix:after,.container-fluid:after,.container:after,.dl-horizontal dd:after,.form-horizontal .form-group:after,.modal-footer:after,.modal-header:after,.nav:after,.navbar-collapse:after,.navbar-header:after,.navbar:after,.pager:after,.panel-body:after,.row:after{clear:both}.center-block{display:block;margin-right:auto;margin-left:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none!important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-lg,.visible-md,.visible-sm,.visible-xs{display:none!important}.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block{display:none!important}@media (max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table!important}tr.visible-xs{display:table-row!important}td.visible-xs,th.visible-xs{display:table-cell!important}}@media (max-width:767px){.visible-xs-block{display:block!important}}@media (max-width:767px){.visible-xs-inline{display:inline!important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block!important}table.visible-sm{display:table!important}tr.visible-sm{display:table-row!important}td.visible-sm,th.visible-sm{display:table-cell!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-block{display:block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline{display:inline!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline-block{display:inline-block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block!important}table.visible-md{display:table!important}tr.visible-md{display:table-row!important}td.visible-md,th.visible-md{display:table-cell!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-block{display:block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline{display:inline!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline-block{display:inline-block!important}}@media (min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table!important}tr.visible-lg{display:table-row!important}td.visible-lg,th.visible-lg{display:table-cell!important}}@media (min-width:1200px){.visible-lg-block{display:block!important}}@media (min-width:1200px){.visible-lg-inline{display:inline!important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block!important}}@media (max-width:767px){.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none!important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-lg{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:block!important}table.visible-print{display:table!important}tr.visible-print{display:table-row!important}td.visible-print,th.visible-print{display:table-cell!important}}.visible-print-block{display:none!important}@media print{.visible-print-block{display:block!important}}.visible-print-inline{display:none!important}@media print{.visible-print-inline{display:inline!important}}.visible-print-inline-block{display:none!important}@media print{.visible-print-inline-block{display:inline-block!important}}@media print{.hidden-print{display:none!important}} +/*# sourceMappingURL=bootstrap.min.css.map */ \ No newline at end of file diff --git a/Games/Carrom/css/main.css b/Games/Carrom/css/main.css new file mode 100644 index 0000000000..f70c00c7ce --- /dev/null +++ b/Games/Carrom/css/main.css @@ -0,0 +1,26 @@ +body,html{ + padding: 0px; + margin: 0px; + +} +body{ + background-position: center; + background-repeat: no-repeat; + background-size: cover; +} +div{ + margin: 0px; + padding: 0px; +} +#Carrom{ + background-color: black; + position: absolute; +} +#Striker{ + position: relative; +} +.jumbotron{ + padding: 0px; + margin: 0px; + padding-left: 20px; +} \ No newline at end of file diff --git a/Games/Carrom/js/bootstrap.min.js b/Games/Carrom/js/bootstrap.min.js new file mode 100644 index 0000000000..9bcd2fccae --- /dev/null +++ b/Games/Carrom/js/bootstrap.min.js @@ -0,0 +1,7 @@ +/*! + * Bootstrap v3.3.7 (http://getbootstrap.com) + * Copyright 2011-2016 Twitter, Inc. + * Licensed under the MIT license + */ +if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1||b[0]>3)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){if(a(b.target).is(this))return b.handleObj.handler.apply(this,arguments)}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.7",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a("#"===f?[]:f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.7",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c).prop(c,!0)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c).prop(c,!1))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target).closest(".btn");b.call(d,"toggle"),a(c.target).is('input[type="radio"], input[type="checkbox"]')||(c.preventDefault(),d.is("input,button")?d.trigger("focus"):d.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.7",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(a>this.$items.length-1||a<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){if(!this.sliding)return this.slide("next")},c.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.7",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",f)))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.7",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger(a.Event("shown.bs.dropdown",h))}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&jdocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);if(c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),!c.isInStateTrue())return clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-mo.width?"left":"left"==h&&k.left-lg.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;jg.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null,a.$element=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;!e&&/destroy|hide/.test(b)||(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.7",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.7",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b=e[a]&&(void 0===e[a+1]||b .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.7",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return e=a-d&&"bottom"},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery); \ No newline at end of file diff --git a/Games/Carrom/js/canvasCalls.js b/Games/Carrom/js/canvasCalls.js new file mode 100644 index 0000000000..7c498cbdd9 --- /dev/null +++ b/Games/Carrom/js/canvasCalls.js @@ -0,0 +1,100 @@ +function canvasCalls(){ + var c = document.getElementById("Carrom"); + var ctx = c.getContext("2d"); + //inner rectangle + drawRect(20,20,680,680,'#f3e5ab',ctx); + //Corner Circles + drawCircle(35,35,22,'black',ctx); + drawCircle(685,35,22,'black',ctx); + drawCircle(685,685,22,'black',ctx); + drawCircle(35,685,22,'black',ctx); + //Central Circles + drawCircle(360,360,10,'black',ctx); + drawCircleS(360,360,70,ctx); + drawCircleS(360,360,75,ctx); + //demo rect + //drawRectS(100,100,520,520,ctx); + //drawRectS(125,125,470,470,ctx); + //top Left Design + //Circles + drawCircleS(125,125,5,ctx); + drawCircle(125+12.5,125-12.5,12.5,'red',ctx); + drawCircle(125-12.5,125+12.5,12.5,'red',ctx); + //Lines Connecting Circles + drawLine(125+12.5,125,595-12.5,125,'black',ctx); + drawLine(125+12.5,100,595-12.5,100,'black',ctx); + //Line and Arc + drawLine(75,75,235+5,235+5,'black',ctx); + drawArc(220,220,30,1.5*Math.PI,1*Math.PI,ctx); + //top Right Design + //Circles + drawCircleS(595,125,5,ctx); + drawCircle(595-12.5,125-12.5,12.5,'red',ctx); + drawCircle(595+12.5,125+12.5,12.5,'red',ctx); + //Lines Connecting Circles + drawLine(595,125+12.5,595,595-12.5,'black',ctx); + drawLine(595+25,125+12.5,595+25,595-12.5,'black',ctx); + //Line and Arc + drawLine(645,75,485-5,235+5,'black',ctx); + drawArc(500,220,30,0*Math.PI,1.5*Math.PI,ctx); + + //bottom Right Design + //Circles + drawCircleS(595,595,5,ctx); + drawCircle(595-12.5,595+12.5,12.5,'red',ctx); + drawCircle(595+12.5,595-12.5,12.5,'red',ctx); + //Lines Connecting Circles + drawLine(595-12.5,595,125+12.5,595,'black',ctx); + drawLine(595-12.5,595+25,125+12.5,595+25,'black',ctx); + //Line and Arc + drawLine(645,645,485-5,485-5,'black',ctx); + drawArc(500,500,30,0.5*Math.PI,0*Math.PI,ctx); + + //bottom Left Design + //Circles + drawCircleS(125,595,5,ctx); + drawCircle(125+12.5,595+12.5,12.5,'red',ctx); + drawCircle(125-12.5,595-12.5,12.5,'red',ctx); + //Lines Connecting Circles + drawLine(125,595-12.5,125,125+12.5,'black',ctx); + drawLine(125-25,595-12.5,125-25,125+12.5,'black',ctx); + //Line and Arc + drawLine(75,645,235+5,485-5,'black',ctx); + drawArc(220,500,30,1*Math.PI,0.5*Math.PI,ctx); + + //coins + coins = []; + coins.push(new coin(0,0,'white',0,0)); + coins.push(new coin(360-25,360,'#515050',0,0)); + coins.push(new coin(360,360,'brown',0,0)); + coins.push(new coin(360+25,360,'#515050',0,0)); + coins.push(new coin(360,360+25,'#515050',0,0)); + coins.push(new coin(360-25,360+25,'brown',0,0)); + coins.push(new coin(360+25,360+25,'brown',0,0)); + coins.push(new coin(360,360-25,'#515050',0,0)); + coins.push(new coin(360-25,360-25,'brown',0,0)); + coins.push(new coin(360+25,360-25,'brown',0,0)); + + drawCoins(); +} + +function drawCoins() +{ + var ct = document.getElementById("Striker"); + var ctxt = ct.getContext("2d"); + for(var i=1;i 700 ) || (this.x - 12.5 + this.vx < 20) ) + { + this.vx = -this.vx; + } + if((this.y + this.vy+ 12.5 > 700 ) || (this.y-12.5+this.vy < 20)) + { + this.vy = -this.vy; + } + } + this.update = function() { + //alert("Update"); + this.x+=this.vx; + this.y+=this.vy; + this.vx*=0.98; + this.vy*=0.98; + } + this.crash = function(i,j){ + //alert("i : "+ coins[i].x); + var dis = dist(this.x+this.vx,this.y+this.vy,coins[i].x+coins[i].vx,coins[i].y+coins[i].vy); + if(dis<=25) + { + var dx = coins[j].x+coins[j].vx-coins[i].x+coins[i].vx; + var dy = coins[j].y+coins[j].vy-coins[i].y+coins[i].vy; + var collisionAngle = Math.atan2(dy, dx); + + var speed1 = Math.sqrt(coins[i].vx*coins[i].vx + coins[i].vy*coins[i].vy ); + var speed2 = Math.sqrt(coins[j].vx*coins[j].vx + coins[j].vy*coins[j].vy); + + var direction1 = Math.atan2(coins[i].vy, coins[i].vx); + var direction2 = Math.atan2(coins[j].vy, coins[j].vx); + + var velocityx_1 = speed1 * Math.cos(direction1 - collisionAngle); + var velocityy_1 = speed1 * Math.sin(direction1 - collisionAngle); + var velocityx_2 = speed2 * Math.cos(direction2 - collisionAngle); + var velocityy_2 = speed2 * Math.sin(direction2 - collisionAngle); + + var final_velocityx_1 = velocityx_2; + var final_velocityx_2 = velocityx_1; + var final_velocityy_1 = velocityy_1; + var final_velocityy_2 = velocityy_2; + + ball1_velocityx = Math.cos(collisionAngle) * final_velocityx_1 + + Math.cos(collisionAngle + Math.PI/2) * final_velocityy_1; + ball1_velocityy = Math.sin(collisionAngle) * final_velocityx_1 + + Math.sin(collisionAngle + Math.PI/2) * final_velocityy_1; + ball2_velocityx = Math.cos(collisionAngle) * final_velocityx_2 + + Math.cos(collisionAngle + Math.PI/2) * final_velocityy_2; + ball2_velocityy = Math.sin(collisionAngle) * final_velocityx_2 + + Math.sin(collisionAngle + Math.PI/2) * final_velocityy_2; + + coins[i].vx = ball1_velocityx; + coins[i].vy = ball1_velocityy; + coins[j].vx = ball2_velocityx; + coins[j].vy = ball2_velocityy; + + coins[j].x+=coins[j].vx; + coins[j].y+=coins[j].vy; + coins[i].x+=coins[i].vx; + coins[i].y+=coins[i].vy; + } + } + + +} \ No newline at end of file diff --git a/Games/Carrom/js/jquery.js b/Games/Carrom/js/jquery.js new file mode 100644 index 0000000000..644d35e274 --- /dev/null +++ b/Games/Carrom/js/jquery.js @@ -0,0 +1,4 @@ +/*! jQuery v3.2.1 | (c) JS Foundation and other contributors | jquery.org/license */ +!function(a,b){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){"use strict";var c=[],d=a.document,e=Object.getPrototypeOf,f=c.slice,g=c.concat,h=c.push,i=c.indexOf,j={},k=j.toString,l=j.hasOwnProperty,m=l.toString,n=m.call(Object),o={};function p(a,b){b=b||d;var c=b.createElement("script");c.text=a,b.head.appendChild(c).parentNode.removeChild(c)}var q="3.2.1",r=function(a,b){return new r.fn.init(a,b)},s=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,t=/^-ms-/,u=/-([a-z])/g,v=function(a,b){return b.toUpperCase()};r.fn=r.prototype={jquery:q,constructor:r,length:0,toArray:function(){return f.call(this)},get:function(a){return null==a?f.call(this):a<0?this[a+this.length]:this[a]},pushStack:function(a){var b=r.merge(this.constructor(),a);return b.prevObject=this,b},each:function(a){return r.each(this,a)},map:function(a){return this.pushStack(r.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(f.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(a<0?b:0);return this.pushStack(c>=0&&c0&&b-1 in a)}var x=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=function(a,b){for(var c=0,d=a.length;c+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(N),U=new RegExp("^"+L+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),aa=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ba=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ca=function(a,b){return b?"\0"===a?"\ufffd":a.slice(0,-1)+"\\"+a.charCodeAt(a.length-1).toString(16)+" ":"\\"+a},da=function(){m()},ea=ta(function(a){return a.disabled===!0&&("form"in a||"label"in a)},{dir:"parentNode",next:"legend"});try{G.apply(D=H.call(v.childNodes),v.childNodes),D[v.childNodes.length].nodeType}catch(fa){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s=b&&b.ownerDocument,w=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==w&&9!==w&&11!==w)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==w&&(l=Z.exec(a)))if(f=l[1]){if(9===w){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(s&&(j=s.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(l[2])return G.apply(d,b.getElementsByTagName(a)),d;if((f=l[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==w)s=b,r=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(ba,ca):b.setAttribute("id",k=u),o=g(a),h=o.length;while(h--)o[h]="#"+k+" "+sa(o[h]);r=o.join(","),s=$.test(a)&&qa(b.parentNode)||b}if(r)try{return G.apply(d,s.querySelectorAll(r)),d}catch(x){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(P,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("fieldset");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return function(b){return"form"in b?b.parentNode&&b.disabled===!1?"label"in b?"label"in b.parentNode?b.parentNode.disabled===a:b.disabled===a:b.isDisabled===a||b.isDisabled!==!a&&ea(b)===a:b.disabled===a:"label"in b&&b.disabled===a}}function pa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function qa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return!!b&&"HTML"!==b.nodeName},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),v!==n&&(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(n.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){return a.getAttribute("id")===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}}):(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c,d,e,f=b.getElementById(a);if(f){if(c=f.getAttributeNode("id"),c&&c.value===a)return[f];e=b.getElementsByName(a),d=0;while(f=e[d++])if(c=f.getAttributeNode("id"),c&&c.value===a)return[f]}return[]}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){if("undefined"!=typeof b.getElementsByClassName&&p)return b.getElementsByClassName(a)},r=[],q=[],(c.qsa=Y.test(n.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){a.innerHTML="";var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+K+"*[*^$|!~]?="),2!==a.querySelectorAll(":enabled").length&&q.push(":enabled",":disabled"),o.appendChild(a).disabled=!0,2!==a.querySelectorAll(":disabled").length&&q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Y.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"*"),s.call(a,"[s!='']:x"),r.push("!=",N)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Y.test(o.compareDocumentPosition),t=b||Y.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?I(k,a)-I(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?I(k,a)-I(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?la(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(S,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.escape=function(a){return(a+"").replace(ba,ca)},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(_,aa),a[3]=(a[3]||a[4]||a[5]||"").replace(_,aa),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return V.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&T.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(_,aa).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:!b||(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(O," ")+" ").indexOf(c)>-1:"|="===b&&(e===c||e.slice(0,c.length+1)===c+"-"))}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(P,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(_,aa),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return U.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(_,aa).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:oa(!1),disabled:oa(!0),checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:pa(function(){return[0]}),last:pa(function(a,b){return[b-1]}),eq:pa(function(a,b,c){return[c<0?c+b:c]}),even:pa(function(a,b){for(var c=0;c=0;)a.push(d);return a}),gt:pa(function(a,b,c){for(var d=c<0?c+b:c;++d1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function va(a,b,c){for(var d=0,e=b.length;d-1&&(f[j]=!(g[j]=l))}}else r=wa(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ya(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ta(function(a){return a===b},h,!0),l=ta(function(a){return I(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];i1&&ua(m),i>1&&sa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(P,"$1"),c,i0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=E.call(i));u=wa(u)}G.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&ga.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=ya(b[c]),f[u]?d.push(f):e.push(f);f=A(a,za(e,d)),f.selector=a}return f},i=ga.select=function(a,b,c,e){var f,i,j,k,l,m="function"==typeof a&&a,n=!e&&g(a=m.selector||a);if(c=c||[],1===n.length){if(i=n[0]=n[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&9===b.nodeType&&p&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(_,aa),b)||[])[0],!b)return c;m&&(b=b.parentNode),a=a.slice(i.shift().value.length)}f=V.needsContext.test(a)?0:i.length;while(f--){if(j=i[f],d.relative[k=j.type])break;if((l=d.find[k])&&(e=l(j.matches[0].replace(_,aa),$.test(i[0].type)&&qa(b.parentNode)||b))){if(i.splice(f,1),a=e.length&&sa(i),!a)return G.apply(c,e),c;break}}}return(m||h(a,n))(e,b,!p,c,!b||$.test(a)&&qa(b.parentNode)||b),c},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("fieldset"))}),ja(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){if(!c)return a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){if(!c&&"input"===a.nodeName.toLowerCase())return a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(J,function(a,b,c){var d;if(!c)return a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);r.find=x,r.expr=x.selectors,r.expr[":"]=r.expr.pseudos,r.uniqueSort=r.unique=x.uniqueSort,r.text=x.getText,r.isXMLDoc=x.isXML,r.contains=x.contains,r.escapeSelector=x.escape;var y=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&r(a).is(c))break;d.push(a)}return d},z=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},A=r.expr.match.needsContext;function B(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()}var C=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,D=/^.[^:#\[\.,]*$/;function E(a,b,c){return r.isFunction(b)?r.grep(a,function(a,d){return!!b.call(a,d,a)!==c}):b.nodeType?r.grep(a,function(a){return a===b!==c}):"string"!=typeof b?r.grep(a,function(a){return i.call(b,a)>-1!==c}):D.test(b)?r.filter(b,a,c):(b=r.filter(b,a),r.grep(a,function(a){return i.call(b,a)>-1!==c&&1===a.nodeType}))}r.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?r.find.matchesSelector(d,a)?[d]:[]:r.find.matches(a,r.grep(b,function(a){return 1===a.nodeType}))},r.fn.extend({find:function(a){var b,c,d=this.length,e=this;if("string"!=typeof a)return this.pushStack(r(a).filter(function(){for(b=0;b1?r.uniqueSort(c):c},filter:function(a){return this.pushStack(E(this,a||[],!1))},not:function(a){return this.pushStack(E(this,a||[],!0))},is:function(a){return!!E(this,"string"==typeof a&&A.test(a)?r(a):a||[],!1).length}});var F,G=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,H=r.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||F,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:G.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof r?b[0]:b,r.merge(this,r.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),C.test(e[1])&&r.isPlainObject(b))for(e in b)r.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&(this[0]=f,this.length=1),this}return a.nodeType?(this[0]=a,this.length=1,this):r.isFunction(a)?void 0!==c.ready?c.ready(a):a(r):r.makeArray(a,this)};H.prototype=r.fn,F=r(d);var I=/^(?:parents|prev(?:Until|All))/,J={children:!0,contents:!0,next:!0,prev:!0};r.fn.extend({has:function(a){var b=r(a,this),c=b.length;return this.filter(function(){for(var a=0;a-1:1===c.nodeType&&r.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?r.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?i.call(r(a),this[0]):i.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(r.uniqueSort(r.merge(this.get(),r(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function K(a,b){while((a=a[b])&&1!==a.nodeType);return a}r.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return y(a,"parentNode")},parentsUntil:function(a,b,c){return y(a,"parentNode",c)},next:function(a){return K(a,"nextSibling")},prev:function(a){return K(a,"previousSibling")},nextAll:function(a){return y(a,"nextSibling")},prevAll:function(a){return y(a,"previousSibling")},nextUntil:function(a,b,c){return y(a,"nextSibling",c)},prevUntil:function(a,b,c){return y(a,"previousSibling",c)},siblings:function(a){return z((a.parentNode||{}).firstChild,a)},children:function(a){return z(a.firstChild)},contents:function(a){return B(a,"iframe")?a.contentDocument:(B(a,"template")&&(a=a.content||a),r.merge([],a.childNodes))}},function(a,b){r.fn[a]=function(c,d){var e=r.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=r.filter(d,e)),this.length>1&&(J[a]||r.uniqueSort(e),I.test(a)&&e.reverse()),this.pushStack(e)}});var L=/[^\x20\t\r\n\f]+/g;function M(a){var b={};return r.each(a.match(L)||[],function(a,c){b[c]=!0}),b}r.Callbacks=function(a){a="string"==typeof a?M(a):r.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=e||a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h-1)f.splice(c,1),c<=h&&h--}),this},has:function(a){return a?r.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||b||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j};function N(a){return a}function O(a){throw a}function P(a,b,c,d){var e;try{a&&r.isFunction(e=a.promise)?e.call(a).done(b).fail(c):a&&r.isFunction(e=a.then)?e.call(a,b,c):b.apply(void 0,[a].slice(d))}catch(a){c.apply(void 0,[a])}}r.extend({Deferred:function(b){var c=[["notify","progress",r.Callbacks("memory"),r.Callbacks("memory"),2],["resolve","done",r.Callbacks("once memory"),r.Callbacks("once memory"),0,"resolved"],["reject","fail",r.Callbacks("once memory"),r.Callbacks("once memory"),1,"rejected"]],d="pending",e={state:function(){return d},always:function(){return f.done(arguments).fail(arguments),this},"catch":function(a){return e.then(null,a)},pipe:function(){var a=arguments;return r.Deferred(function(b){r.each(c,function(c,d){var e=r.isFunction(a[d[4]])&&a[d[4]];f[d[1]](function(){var a=e&&e.apply(this,arguments);a&&r.isFunction(a.promise)?a.promise().progress(b.notify).done(b.resolve).fail(b.reject):b[d[0]+"With"](this,e?[a]:arguments)})}),a=null}).promise()},then:function(b,d,e){var f=0;function g(b,c,d,e){return function(){var h=this,i=arguments,j=function(){var a,j;if(!(b=f&&(d!==O&&(h=void 0,i=[a]),c.rejectWith(h,i))}};b?k():(r.Deferred.getStackHook&&(k.stackTrace=r.Deferred.getStackHook()),a.setTimeout(k))}}return r.Deferred(function(a){c[0][3].add(g(0,a,r.isFunction(e)?e:N,a.notifyWith)),c[1][3].add(g(0,a,r.isFunction(b)?b:N)),c[2][3].add(g(0,a,r.isFunction(d)?d:O))}).promise()},promise:function(a){return null!=a?r.extend(a,e):e}},f={};return r.each(c,function(a,b){var g=b[2],h=b[5];e[b[1]]=g.add,h&&g.add(function(){d=h},c[3-a][2].disable,c[0][2].lock),g.add(b[3].fire),f[b[0]]=function(){return f[b[0]+"With"](this===f?void 0:this,arguments),this},f[b[0]+"With"]=g.fireWith}),e.promise(f),b&&b.call(f,f),f},when:function(a){var b=arguments.length,c=b,d=Array(c),e=f.call(arguments),g=r.Deferred(),h=function(a){return function(c){d[a]=this,e[a]=arguments.length>1?f.call(arguments):c,--b||g.resolveWith(d,e)}};if(b<=1&&(P(a,g.done(h(c)).resolve,g.reject,!b),"pending"===g.state()||r.isFunction(e[c]&&e[c].then)))return g.then();while(c--)P(e[c],h(c),g.reject);return g.promise()}});var Q=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;r.Deferred.exceptionHook=function(b,c){a.console&&a.console.warn&&b&&Q.test(b.name)&&a.console.warn("jQuery.Deferred exception: "+b.message,b.stack,c)},r.readyException=function(b){a.setTimeout(function(){throw b})};var R=r.Deferred();r.fn.ready=function(a){return R.then(a)["catch"](function(a){r.readyException(a)}),this},r.extend({isReady:!1,readyWait:1,ready:function(a){(a===!0?--r.readyWait:r.isReady)||(r.isReady=!0,a!==!0&&--r.readyWait>0||R.resolveWith(d,[r]))}}),r.ready.then=R.then;function S(){d.removeEventListener("DOMContentLoaded",S), +a.removeEventListener("load",S),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",S),a.addEventListener("load",S));var T=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h in c)T(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(r(a),c)})),b))for(;h1,null,!0)},removeData:function(a){return this.each(function(){X.remove(this,a)})}}),r.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=W.get(a,b),c&&(!d||Array.isArray(c)?d=W.access(a,b,r.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=r.queue(a,b),d=c.length,e=c.shift(),f=r._queueHooks(a,b),g=function(){r.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return W.get(a,c)||W.access(a,c,{empty:r.Callbacks("once memory").add(function(){W.remove(a,[b+"queue",c])})})}}),r.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length\x20\t\r\n\f]+)/i,la=/^$|\/(?:java|ecma)script/i,ma={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ma.optgroup=ma.option,ma.tbody=ma.tfoot=ma.colgroup=ma.caption=ma.thead,ma.th=ma.td;function na(a,b){var c;return c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[],void 0===b||b&&B(a,b)?r.merge([a],c):c}function oa(a,b){for(var c=0,d=a.length;c-1)e&&e.push(f);else if(j=r.contains(f.ownerDocument,f),g=na(l.appendChild(f),"script"),j&&oa(g),c){k=0;while(f=g[k++])la.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),o.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="",o.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var ra=d.documentElement,sa=/^key/,ta=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ua=/^([^.]*)(?:\.(.+)|)/;function va(){return!0}function wa(){return!1}function xa(){try{return d.activeElement}catch(a){}}function ya(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)ya(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=wa;else if(!e)return a;return 1===f&&(g=e,e=function(a){return r().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=r.guid++)),a.each(function(){r.event.add(this,b,e,d,c)})}r.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=W.get(a);if(q){c.handler&&(f=c,c=f.handler,e=f.selector),e&&r.find.matchesSelector(ra,e),c.guid||(c.guid=r.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return"undefined"!=typeof r&&r.event.triggered!==b.type?r.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(L)||[""],j=b.length;while(j--)h=ua.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=r.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=r.event.special[n]||{},k=r.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&r.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,o,g)!==!1||a.addEventListener&&a.addEventListener(n,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),r.event.global[n]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=W.hasData(a)&&W.get(a);if(q&&(i=q.events)){b=(b||"").match(L)||[""],j=b.length;while(j--)if(h=ua.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){l=r.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&p!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,o,q.handle)!==!1||r.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)r.event.remove(a,n+b[j],c,d,!0);r.isEmptyObject(i)&&W.remove(a,"handle events")}},dispatch:function(a){var b=r.event.fix(a),c,d,e,f,g,h,i=new Array(arguments.length),j=(W.get(this,"events")||{})[b.type]||[],k=r.event.special[b.type]||{};for(i[0]=b,c=1;c=1))for(;j!==this;j=j.parentNode||this)if(1===j.nodeType&&("click"!==a.type||j.disabled!==!0)){for(f=[],g={},c=0;c-1:r.find(e,this,null,[j]).length),g[e]&&f.push(d);f.length&&h.push({elem:j,handlers:f})}return j=this,i\x20\t\r\n\f]*)[^>]*)\/>/gi,Aa=/\s*$/g;function Ea(a,b){return B(a,"table")&&B(11!==b.nodeType?b:b.firstChild,"tr")?r(">tbody",a)[0]||a:a}function Fa(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function Ga(a){var b=Ca.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ha(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(W.hasData(a)&&(f=W.access(a),g=W.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;c1&&"string"==typeof q&&!o.checkClone&&Ba.test(q))return a.each(function(e){var f=a.eq(e);s&&(b[0]=q.call(this,e,f.html())),Ja(f,b,c,d)});if(m&&(e=qa(b,a[0].ownerDocument,!1,a,d),f=e.firstChild,1===e.childNodes.length&&(e=f),f||d)){for(h=r.map(na(e,"script"),Fa),i=h.length;l")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=r.contains(a.ownerDocument,a);if(!(o.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||r.isXMLDoc(a)))for(g=na(h),f=na(a),d=0,e=f.length;d0&&oa(g,!i&&na(a,"script")),h},cleanData:function(a){for(var b,c,d,e=r.event.special,f=0;void 0!==(c=a[f]);f++)if(U(c)){if(b=c[W.expando]){if(b.events)for(d in b.events)e[d]?r.event.remove(c,d):r.removeEvent(c,d,b.handle);c[W.expando]=void 0}c[X.expando]&&(c[X.expando]=void 0)}}}),r.fn.extend({detach:function(a){return Ka(this,a,!0)},remove:function(a){return Ka(this,a)},text:function(a){return T(this,function(a){return void 0===a?r.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return Ja(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ea(this,a);b.appendChild(a)}})},prepend:function(){return Ja(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ea(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ja(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ja(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(r.cleanData(na(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null!=a&&a,b=null==b?a:b,this.map(function(){return r.clone(this,a,b)})},html:function(a){return T(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!Aa.test(a)&&!ma[(ka.exec(a)||["",""])[1].toLowerCase()]){a=r.htmlPrefilter(a);try{for(;c1)}});function _a(a,b,c,d,e){return new _a.prototype.init(a,b,c,d,e)}r.Tween=_a,_a.prototype={constructor:_a,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||r.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(r.cssNumber[c]?"":"px")},cur:function(){var a=_a.propHooks[this.prop];return a&&a.get?a.get(this):_a.propHooks._default.get(this)},run:function(a){var b,c=_a.propHooks[this.prop];return this.options.duration?this.pos=b=r.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):_a.propHooks._default.set(this),this}},_a.prototype.init.prototype=_a.prototype,_a.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=r.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){r.fx.step[a.prop]?r.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[r.cssProps[a.prop]]&&!r.cssHooks[a.prop]?a.elem[a.prop]=a.now:r.style(a.elem,a.prop,a.now+a.unit)}}},_a.propHooks.scrollTop=_a.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},r.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},r.fx=_a.prototype.init,r.fx.step={};var ab,bb,cb=/^(?:toggle|show|hide)$/,db=/queueHooks$/;function eb(){bb&&(d.hidden===!1&&a.requestAnimationFrame?a.requestAnimationFrame(eb):a.setTimeout(eb,r.fx.interval),r.fx.tick())}function fb(){return a.setTimeout(function(){ab=void 0}),ab=r.now()}function gb(a,b){var c,d=0,e={height:a};for(b=b?1:0;d<4;d+=2-b)c=ca[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function hb(a,b,c){for(var d,e=(kb.tweeners[b]||[]).concat(kb.tweeners["*"]),f=0,g=e.length;f1)},removeAttr:function(a){return this.each(function(){r.removeAttr(this,a)})}}),r.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?r.prop(a,b,c):(1===f&&r.isXMLDoc(a)||(e=r.attrHooks[b.toLowerCase()]||(r.expr.match.bool.test(b)?lb:void 0)),void 0!==c?null===c?void r.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=r.find.attr(a,b), +null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!o.radioValue&&"radio"===b&&B(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d=0,e=b&&b.match(L);if(e&&1===a.nodeType)while(c=e[d++])a.removeAttribute(c)}}),lb={set:function(a,b,c){return b===!1?r.removeAttr(a,c):a.setAttribute(c,c),c}},r.each(r.expr.match.bool.source.match(/\w+/g),function(a,b){var c=mb[b]||r.find.attr;mb[b]=function(a,b,d){var e,f,g=b.toLowerCase();return d||(f=mb[g],mb[g]=e,e=null!=c(a,b,d)?g:null,mb[g]=f),e}});var nb=/^(?:input|select|textarea|button)$/i,ob=/^(?:a|area)$/i;r.fn.extend({prop:function(a,b){return T(this,r.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[r.propFix[a]||a]})}}),r.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&r.isXMLDoc(a)||(b=r.propFix[b]||b,e=r.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=r.find.attr(a,"tabindex");return b?parseInt(b,10):nb.test(a.nodeName)||ob.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),o.optSelected||(r.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),r.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){r.propFix[this.toLowerCase()]=this});function pb(a){var b=a.match(L)||[];return b.join(" ")}function qb(a){return a.getAttribute&&a.getAttribute("class")||""}r.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).addClass(a.call(this,b,qb(this)))});if("string"==typeof a&&a){b=a.match(L)||[];while(c=this[i++])if(e=qb(c),d=1===c.nodeType&&" "+pb(e)+" "){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=pb(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).removeClass(a.call(this,b,qb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(L)||[];while(c=this[i++])if(e=qb(c),d=1===c.nodeType&&" "+pb(e)+" "){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=pb(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):r.isFunction(a)?this.each(function(c){r(this).toggleClass(a.call(this,c,qb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=r(this),f=a.match(L)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=qb(this),b&&W.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":W.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+pb(qb(c))+" ").indexOf(b)>-1)return!0;return!1}});var rb=/\r/g;r.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=r.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,r(this).val()):a,null==e?e="":"number"==typeof e?e+="":Array.isArray(e)&&(e=r.map(e,function(a){return null==a?"":a+""})),b=r.valHooks[this.type]||r.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=r.valHooks[e.type]||r.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(rb,""):null==c?"":c)}}}),r.extend({valHooks:{option:{get:function(a){var b=r.find.attr(a,"value");return null!=b?b:pb(r.text(a))}},select:{get:function(a){var b,c,d,e=a.options,f=a.selectedIndex,g="select-one"===a.type,h=g?null:[],i=g?f+1:e.length;for(d=f<0?i:g?f:0;d-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),r.each(["radio","checkbox"],function(){r.valHooks[this]={set:function(a,b){if(Array.isArray(b))return a.checked=r.inArray(r(a).val(),b)>-1}},o.checkOn||(r.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var sb=/^(?:focusinfocus|focusoutblur)$/;r.extend(r.event,{trigger:function(b,c,e,f){var g,h,i,j,k,m,n,o=[e||d],p=l.call(b,"type")?b.type:b,q=l.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!sb.test(p+r.event.triggered)&&(p.indexOf(".")>-1&&(q=p.split("."),p=q.shift(),q.sort()),k=p.indexOf(":")<0&&"on"+p,b=b[r.expando]?b:new r.Event(p,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=q.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:r.makeArray(c,[b]),n=r.event.special[p]||{},f||!n.trigger||n.trigger.apply(e,c)!==!1)){if(!f&&!n.noBubble&&!r.isWindow(e)){for(j=n.delegateType||p,sb.test(j+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),i=h;i===(e.ownerDocument||d)&&o.push(i.defaultView||i.parentWindow||a)}g=0;while((h=o[g++])&&!b.isPropagationStopped())b.type=g>1?j:n.bindType||p,m=(W.get(h,"events")||{})[b.type]&&W.get(h,"handle"),m&&m.apply(h,c),m=k&&h[k],m&&m.apply&&U(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=p,f||b.isDefaultPrevented()||n._default&&n._default.apply(o.pop(),c)!==!1||!U(e)||k&&r.isFunction(e[p])&&!r.isWindow(e)&&(i=e[k],i&&(e[k]=null),r.event.triggered=p,e[p](),r.event.triggered=void 0,i&&(e[k]=i)),b.result}},simulate:function(a,b,c){var d=r.extend(new r.Event,c,{type:a,isSimulated:!0});r.event.trigger(d,null,b)}}),r.fn.extend({trigger:function(a,b){return this.each(function(){r.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];if(c)return r.event.trigger(a,b,c,!0)}}),r.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(a,b){r.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),r.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),o.focusin="onfocusin"in a,o.focusin||r.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){r.event.simulate(b,a.target,r.event.fix(a))};r.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=W.access(d,b);e||d.addEventListener(a,c,!0),W.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=W.access(d,b)-1;e?W.access(d,b,e):(d.removeEventListener(a,c,!0),W.remove(d,b))}}});var tb=a.location,ub=r.now(),vb=/\?/;r.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||r.error("Invalid XML: "+b),c};var wb=/\[\]$/,xb=/\r?\n/g,yb=/^(?:submit|button|image|reset|file)$/i,zb=/^(?:input|select|textarea|keygen)/i;function Ab(a,b,c,d){var e;if(Array.isArray(b))r.each(b,function(b,e){c||wb.test(a)?d(a,e):Ab(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==r.type(b))d(a,b);else for(e in b)Ab(a+"["+e+"]",b[e],c,d)}r.param=function(a,b){var c,d=[],e=function(a,b){var c=r.isFunction(b)?b():b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(null==c?"":c)};if(Array.isArray(a)||a.jquery&&!r.isPlainObject(a))r.each(a,function(){e(this.name,this.value)});else for(c in a)Ab(c,a[c],b,e);return d.join("&")},r.fn.extend({serialize:function(){return r.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=r.prop(this,"elements");return a?r.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!r(this).is(":disabled")&&zb.test(this.nodeName)&&!yb.test(a)&&(this.checked||!ja.test(a))}).map(function(a,b){var c=r(this).val();return null==c?null:Array.isArray(c)?r.map(c,function(a){return{name:b.name,value:a.replace(xb,"\r\n")}}):{name:b.name,value:c.replace(xb,"\r\n")}}).get()}});var Bb=/%20/g,Cb=/#.*$/,Db=/([?&])_=[^&]*/,Eb=/^(.*?):[ \t]*([^\r\n]*)$/gm,Fb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Gb=/^(?:GET|HEAD)$/,Hb=/^\/\//,Ib={},Jb={},Kb="*/".concat("*"),Lb=d.createElement("a");Lb.href=tb.href;function Mb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(L)||[];if(r.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Nb(a,b,c,d){var e={},f=a===Jb;function g(h){var i;return e[h]=!0,r.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Ob(a,b){var c,d,e=r.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&r.extend(!0,a,d),a}function Pb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}if(f)return f!==i[0]&&i.unshift(f),c[f]}function Qb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}r.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:tb.href,type:"GET",isLocal:Fb.test(tb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Kb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":r.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Ob(Ob(a,r.ajaxSettings),b):Ob(r.ajaxSettings,a)},ajaxPrefilter:Mb(Ib),ajaxTransport:Mb(Jb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m,n,o=r.ajaxSetup({},c),p=o.context||o,q=o.context&&(p.nodeType||p.jquery)?r(p):r.event,s=r.Deferred(),t=r.Callbacks("once memory"),u=o.statusCode||{},v={},w={},x="canceled",y={readyState:0,getResponseHeader:function(a){var b;if(k){if(!h){h={};while(b=Eb.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return k?g:null},setRequestHeader:function(a,b){return null==k&&(a=w[a.toLowerCase()]=w[a.toLowerCase()]||a,v[a]=b),this},overrideMimeType:function(a){return null==k&&(o.mimeType=a),this},statusCode:function(a){var b;if(a)if(k)y.always(a[y.status]);else for(b in a)u[b]=[u[b],a[b]];return this},abort:function(a){var b=a||x;return e&&e.abort(b),A(0,b),this}};if(s.promise(y),o.url=((b||o.url||tb.href)+"").replace(Hb,tb.protocol+"//"),o.type=c.method||c.type||o.method||o.type,o.dataTypes=(o.dataType||"*").toLowerCase().match(L)||[""],null==o.crossDomain){j=d.createElement("a");try{j.href=o.url,j.href=j.href,o.crossDomain=Lb.protocol+"//"+Lb.host!=j.protocol+"//"+j.host}catch(z){o.crossDomain=!0}}if(o.data&&o.processData&&"string"!=typeof o.data&&(o.data=r.param(o.data,o.traditional)),Nb(Ib,o,c,y),k)return y;l=r.event&&o.global,l&&0===r.active++&&r.event.trigger("ajaxStart"),o.type=o.type.toUpperCase(),o.hasContent=!Gb.test(o.type),f=o.url.replace(Cb,""),o.hasContent?o.data&&o.processData&&0===(o.contentType||"").indexOf("application/x-www-form-urlencoded")&&(o.data=o.data.replace(Bb,"+")):(n=o.url.slice(f.length),o.data&&(f+=(vb.test(f)?"&":"?")+o.data,delete o.data),o.cache===!1&&(f=f.replace(Db,"$1"),n=(vb.test(f)?"&":"?")+"_="+ub++ +n),o.url=f+n),o.ifModified&&(r.lastModified[f]&&y.setRequestHeader("If-Modified-Since",r.lastModified[f]),r.etag[f]&&y.setRequestHeader("If-None-Match",r.etag[f])),(o.data&&o.hasContent&&o.contentType!==!1||c.contentType)&&y.setRequestHeader("Content-Type",o.contentType),y.setRequestHeader("Accept",o.dataTypes[0]&&o.accepts[o.dataTypes[0]]?o.accepts[o.dataTypes[0]]+("*"!==o.dataTypes[0]?", "+Kb+"; q=0.01":""):o.accepts["*"]);for(m in o.headers)y.setRequestHeader(m,o.headers[m]);if(o.beforeSend&&(o.beforeSend.call(p,y,o)===!1||k))return y.abort();if(x="abort",t.add(o.complete),y.done(o.success),y.fail(o.error),e=Nb(Jb,o,c,y)){if(y.readyState=1,l&&q.trigger("ajaxSend",[y,o]),k)return y;o.async&&o.timeout>0&&(i=a.setTimeout(function(){y.abort("timeout")},o.timeout));try{k=!1,e.send(v,A)}catch(z){if(k)throw z;A(-1,z)}}else A(-1,"No Transport");function A(b,c,d,h){var j,m,n,v,w,x=c;k||(k=!0,i&&a.clearTimeout(i),e=void 0,g=h||"",y.readyState=b>0?4:0,j=b>=200&&b<300||304===b,d&&(v=Pb(o,y,d)),v=Qb(o,v,y,j),j?(o.ifModified&&(w=y.getResponseHeader("Last-Modified"),w&&(r.lastModified[f]=w),w=y.getResponseHeader("etag"),w&&(r.etag[f]=w)),204===b||"HEAD"===o.type?x="nocontent":304===b?x="notmodified":(x=v.state,m=v.data,n=v.error,j=!n)):(n=x,!b&&x||(x="error",b<0&&(b=0))),y.status=b,y.statusText=(c||x)+"",j?s.resolveWith(p,[m,x,y]):s.rejectWith(p,[y,x,n]),y.statusCode(u),u=void 0,l&&q.trigger(j?"ajaxSuccess":"ajaxError",[y,o,j?m:n]),t.fireWith(p,[y,x]),l&&(q.trigger("ajaxComplete",[y,o]),--r.active||r.event.trigger("ajaxStop")))}return y},getJSON:function(a,b,c){return r.get(a,b,c,"json")},getScript:function(a,b){return r.get(a,void 0,b,"script")}}),r.each(["get","post"],function(a,b){r[b]=function(a,c,d,e){return r.isFunction(c)&&(e=e||d,d=c,c=void 0),r.ajax(r.extend({url:a,type:b,dataType:e,data:c,success:d},r.isPlainObject(a)&&a))}}),r._evalUrl=function(a){return r.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},r.fn.extend({wrapAll:function(a){var b;return this[0]&&(r.isFunction(a)&&(a=a.call(this[0])),b=r(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this},wrapInner:function(a){return r.isFunction(a)?this.each(function(b){r(this).wrapInner(a.call(this,b))}):this.each(function(){var b=r(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=r.isFunction(a);return this.each(function(c){r(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(a){return this.parent(a).not("body").each(function(){r(this).replaceWith(this.childNodes)}),this}}),r.expr.pseudos.hidden=function(a){return!r.expr.pseudos.visible(a)},r.expr.pseudos.visible=function(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)},r.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Rb={0:200,1223:204},Sb=r.ajaxSettings.xhr();o.cors=!!Sb&&"withCredentials"in Sb,o.ajax=Sb=!!Sb,r.ajaxTransport(function(b){var c,d;if(o.cors||Sb&&!b.crossDomain)return{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Rb[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}}),r.ajaxPrefilter(function(a){a.crossDomain&&(a.contents.script=!1)}),r.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return r.globalEval(a),a}}}),r.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),r.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=r(" + + \ No newline at end of file diff --git a/Games/Cartoon_Character_Guessing_Game/images/image_01.png b/Games/Cartoon_Character_Guessing_Game/images/image_01.png new file mode 100644 index 0000000000..43d79a6d1c Binary files /dev/null and b/Games/Cartoon_Character_Guessing_Game/images/image_01.png differ diff --git a/Games/Cartoon_Character_Guessing_Game/images/image_02.png b/Games/Cartoon_Character_Guessing_Game/images/image_02.png new file mode 100644 index 0000000000..04854f84df Binary files /dev/null and b/Games/Cartoon_Character_Guessing_Game/images/image_02.png differ diff --git a/Games/Cartoon_Character_Guessing_Game/images/image_03.png b/Games/Cartoon_Character_Guessing_Game/images/image_03.png new file mode 100644 index 0000000000..8a35c3fc89 Binary files /dev/null and b/Games/Cartoon_Character_Guessing_Game/images/image_03.png differ diff --git a/Games/Cartoon_Character_Guessing_Game/index.html b/Games/Cartoon_Character_Guessing_Game/index.html new file mode 100644 index 0000000000..26631dc61a --- /dev/null +++ b/Games/Cartoon_Character_Guessing_Game/index.html @@ -0,0 +1,19 @@ + + + + + + + + + Cartoon Character Guessing Game + + +
+

Cartoon Character Guessing Game

+ +
+ + \ No newline at end of file diff --git a/Games/Cartoon_Character_Guessing_Game/script.js b/Games/Cartoon_Character_Guessing_Game/script.js new file mode 100644 index 0000000000..5327ce41b9 --- /dev/null +++ b/Games/Cartoon_Character_Guessing_Game/script.js @@ -0,0 +1,205 @@ +const data = [ + { + "id": 1, + "image_url": "https://upload.wikimedia.org/wikipedia/commons/thumb/4/4f/Mickey_Mouse_%28poster_version%29.svg/800px-Mickey_Mouse_%28poster_version%29.svg.png", + "character_name": "Mickey Mouse" + }, + { + "id": 2, + "image_url": "https://th.bing.com/th/id/OIP.ggStsRwWxTyMR5U9BIWpFAHaHw?w=176&h=184&c=7&r=0&o=5&dpr=1.3&pid=1.7", + "character_name": "SpongeBob SquarePants" + }, + { + "id": 3, + "image_url": "https://upload.wikimedia.org/wikipedia/en/0/02/Homer_Simpson_2006.png", + "character_name": "Homer Simpson" + }, + { + "id": 4, + "image_url": "https://upload.wikimedia.org/wikipedia/en/5/53/Scooby-Doo.png", + "character_name": "Scooby-Doo" + }, + { + "id": 5, + "image_url": "https://upload.wikimedia.org/wikipedia/en/f/f6/Tom_Tom_and_Jerry.png", + "character_name": "Tom Cat" + }, + { + "id": 6, + "image_url": "https://upload.wikimedia.org/wikipedia/en/2/2f/Jerry_Mouse.png", + "character_name": "Jerry Mouse" + }, + { + "id": 7, + "image_url": "https://www.desicomments.com/wp-content/uploads/2017/02/Image-Of-Donald-Duck.jpg", + "character_name": "Donald Duck" + }, + { + "id": 8, + "image_url": "https://upload.wikimedia.org/wikipedia/en/a/aa/Bart_Simpson_200px.png", + "character_name": "Bart Simpson" + }, + { + "id": 9, + "image_url": "https://upload.wikimedia.org/wikipedia/en/1/17/Bugs_Bunny.svg", + "character_name": "Bugs Bunny" + }, + { + "id": 10, + "image_url": "https://pngimg.com/uploads/pokemon/pokemon_PNG148.png", + "character_name": "Pikachu" + }, + { + "id": 11, + "image_url": "https://vignette.wikia.nocookie.net/vsbattles/images/4/4f/PopEye.png/revision/latest?cb=20160307172307", + "character_name": "Popeye" + }, + { + "id": 12, + "image_url": "https://www.nicepng.com/png/detail/53-534923_cartoon-character-png-fred-flintstone.png", + "character_name": "Fred Flintstone" + }, + { + "id": 13, + "image_url": "https://www.cartoonpics.net/data/media/11/snoopy_friends.png", + "character_name": "Snoopy" + }, + { + "id": 14, + "image_url": "https://images2.wikia.nocookie.net/__cb20130525054541/woodywoodpecker/images/2/26/Woody-woodpecker-tv-04-g.jpg", + "character_name": "Woody Woodpecker" + }, + { + "id": 15, + "image_url": "https://vignette.wikia.nocookie.net/dominios-encantados/images/e/ea/WIKI_BUZ_LIGHTYEAR.jpg/revision/latest?cb=20141222161728&path-prefix=es", + "character_name": "Buzz Lightyear" + }, + { + "id": 16, + "image_url": "https://images6.fanpop.com/image/photos/38800000/Elsa-frozen-38894629-960-960.jpg", + "character_name": "Elsa" + }, + { + "id": 17, + "image_url": "https://upload.wikimedia.org/wikipedia/en/1/17/Batman-BenAffleck.jpg", + "character_name": "Batman" + } +] +const questionWrapper = document.querySelector(".question-wrapper"); +let timeInterval; + +function getRandomQuestion() { + const randomIndex = Math.floor(Math.random() * data.length); + return data[randomIndex]; +} +function getRandomOption() { + const randomIndex = Math.floor(Math.random() * data.length); + return data[randomIndex].character_name; +} + +function getRandomOptions(correctCharacter) { + let options = [correctCharacter]; + while (options.length < 4) { + let option = getRandomOption(); + if (!options.includes(option)) { + options.push(option); + } + } + return options.sort(() => Math.random() - 0.5); // shuffle the options list +} + +function createResetBtnElement() { + let resetBtnElement = document.createElement('button'); + resetBtnElement.setAttribute('class', 'bg-blue-700 font-bold px-6 py-2 rounded hover:bg-blue-600 text-white focus:ring-2 focus:ring-blue-300 border-2 border-white mr-4') + resetBtnElement.addEventListener('click', renderQuestion) + resetBtnElement.textContent = 'Reset' + resetBtnElement.style.pointerEvents = 'auto'; + return resetBtnElement; +} + +function createQuitBtnElement() { + let quitBtnElement = document.createElement('button'); + quitBtnElement.setAttribute('class', 'bg-blue-700 font-bold px-6 py-2 rounded hover:bg-blue-600 text-white focus:ring-2 focus:ring-blue-300 border-2 border-blue-700') + quitBtnElement.addEventListener('click', () => { + window.location.href = 'index.html' + }) + quitBtnElement.textContent = 'Quit' + quitBtnElement.style.pointerEvents = 'auto'; + return quitBtnElement; +} + +function createImageElement(url) { + let imgElement = document.createElement('img'); + imgElement.setAttribute('class', "mx-auto my-8 h-40 w-40") + imgElement.setAttribute('src', url); + + return imgElement; +} + +function createTimerElement() { + let timerElement = document.createElement('span'); + timerElement.setAttribute('class', "text-blue-600 bg-white rounded px-2 py-1 font-bold") + let timeLeft = 10; + timerElement.textContent = `Time Left: ${timeLeft}s` + timeInterval = setInterval(() => { + timeLeft-=1 + timerElement.textContent = `Time Left: ${timeLeft}s` + if (timeLeft==0) { + clearInterval(timeInterval) + renderQuestion() + return + } + }, 1000) + + return timerElement; +} + +function createHeaderElement() { + let headerElement = document.createElement('h1'); + headerElement.setAttribute('class', "text-gray-200 flex items-center p-2") + headerElement.innerHTML = `Guess who is this!` + headerElement.appendChild(createTimerElement()) + + return headerElement; +} + +function createOptionsElement(index, option, correctOption) { + let optionElement = document.createElement('div'); + optionElement.setAttribute('class', 'option w-full bg-white shadow-md rounded p-2 flex my-4 flex items-center cursor-pointer hover:bg-blue-100') + optionElement.innerHTML = ` +
${index + 1}
+
${option}
+ + × + ` + + optionElement.addEventListener('click', (e) => { + if (option === correctOption) { + optionElement.classList.add('correct') + } else { + optionElement.classList.add('wrong') + } + questionWrapper.style.pointerEvents = 'none'; + clearInterval(timeInterval) + }) + return optionElement; +} + +function renderQuestion() { + questionWrapper.innerHTML = ``; + questionWrapper.classList.remove('hide'); + questionWrapper.style.pointerEvents = 'auto'; + + const randomQuestion = getRandomQuestion(); + const options = getRandomOptions(randomQuestion.character_name); + + questionWrapper.appendChild(createHeaderElement()) + questionWrapper.appendChild(createImageElement(randomQuestion.image_url)) + options.map((option, index) => { + questionWrapper.appendChild(createOptionsElement(index, option, randomQuestion.character_name)) + }) + questionWrapper.appendChild(createResetBtnElement()); + questionWrapper.appendChild(createQuitBtnElement()); +} + +document.addEventListener('DOMContentLoaded', renderQuestion); diff --git a/Games/Cartoon_Character_Guessing_Game/style.css b/Games/Cartoon_Character_Guessing_Game/style.css new file mode 100644 index 0000000000..2ee6db02c7 --- /dev/null +++ b/Games/Cartoon_Character_Guessing_Game/style.css @@ -0,0 +1,46 @@ +.question-wrapper, .start { + max-width: 500px; + pointer-events: auto; +} +.display { + display: block; + pointer-events: auto; +} +.hide { + display: none; + pointer-events: none; +} +.f { + display: flex; + align-items: center; + justify-content: center; +} +.check, .times { + display: none; +} +.option.correct { + background-color: #c1ffc1; + color: green; +} +.option.correct .no { + background-color: green; +} +.option.correct .no { + background-color: green; +} +.option.correct .check { + display: inline-block; +} +.option.wrong { + background-color: #ffc1c1; + color: rgb(181, 0, 0); +} +.option.wrong .no { + background-color: red; +} +.option.wrong .no { + background-color: red; +} +.option.wrong .times { + display: inline-block; +} \ No newline at end of file diff --git a/Games/Chess_Game_computer/README.md b/Games/Chess_Game_computer/README.md new file mode 100644 index 0000000000..4c20db70e1 --- /dev/null +++ b/Games/Chess_Game_computer/README.md @@ -0,0 +1,22 @@ +# ๐ŸŽฎ AI Chess Game Request + +## **Description ๐Ÿ“ƒ** +We propose the development of an AI-powered chess game that offers an engaging and challenging experience to players of all levels. The game will leverage advanced algorithms to provide intelligent gameplay while also offering a user-friendly interface for an immersive gaming experience. + +## **functionalities ๐ŸŽฎ** +- **Intelligent AI Opponent**: The game will feature an AI opponent with varying levels of difficulty, from beginner to grandmaster, to provide a challenging experience for players of all skill levels. + +## **How to play? ๐Ÿ•น๏ธ** +- Players can make moves by dragging and dropping chess pieces to desired locations on the board. +- The game will follow standard chess rules, including move validation and checkmate detection. +- Players can select the difficulty level of the AI opponent to match their skill level. + +
+ +## **Screenshots ๐Ÿ“ธ** + +
+![image](../../assets/images/chessComputer.png) + +
+ diff --git a/Games/Chess_Game_computer/index.html b/Games/Chess_Game_computer/index.html new file mode 100644 index 0000000000..92258599ad --- /dev/null +++ b/Games/Chess_Game_computer/index.html @@ -0,0 +1,14 @@ + + + + Chess Engine + + + + + +
+ + + + \ No newline at end of file diff --git a/Games/Chess_Game_computer/script.js b/Games/Chess_Game_computer/script.js new file mode 100644 index 0000000000..296d7bf0aa --- /dev/null +++ b/Games/Chess_Game_computer/script.js @@ -0,0 +1,1224 @@ +window.onload = function(){ + var w = window.innerWidth || 360; + var h = window.innerHeight || 500; + + var tsw = (w > h) ? h : w; + + var sw = (tsw - 16)/8; + + var container = document.getElementById("container"); + for(var n = 0; n < 64; n++){ + var square = document.createElement("div"); + square.classList.add("square"); + square.classList.add("s"+n); + square.style.height = sw + 'px'; + square.style.width = sw + 'px'; + square.style.top = 7+(h-tsw)/4+sw*(Math.floor(n/8)) + 'px'; + square.style.left = 7+(w-tsw)/2+sw*(Math.floor(n%8)) + 'px'; + square.style.fontSize = sw*3/4 + 'px'; + container.appendChild(square); + } + + var fonts = { + 'k' : '♚', + 'q' : '♛', + 'r' : '♜', + 'b' : '♝', + 'n' : '♞', + 'p' : '♟', + 'l' : '♔', + 'w' : '♕', + 't' : '♖', + 'v' : '♗', + 'm' : '♘', + 'o' : '♙', + + } + + var values = ['r','n','b','q','k','b','n','r','p','p','p','p','p','p','p','p',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'o','o','o','o','o','o','o','o','t','m','v','w','l','v','m','t']; + var ck = false; + var cr1 = false; + var cr2 = false; + var cl; + + var sqs = document.getElementsByClassName("square"); + + for(var n = 0; n < 64; n++){ + if(values[n] !== 0){ + sqs[n].innerHTML = fonts[values[n]]; + } + sqs[n].addEventListener("click",check); + } + + function updateSquarecolor(){ + for(var n = 0; n < 64; n++){ + if(Math.floor(n/8)%2 === 0){ + if(n%2 === 0){ + sqs[n].style.background = '#9ff'; + } + else { + sqs[n].style.background = '#5fa'; + } + } + else { + if(n%2 === 1){ + sqs[n].style.background = '#9ff'; + } + else { + sqs[n].style.background = '#5fa'; + } + } + } + } + + updateSquarecolor(); + + var moveable = false; + var moveTarget = ""; + var moveScopes = []; + + + function checkBlack(n,values){ + var target = values[n]; + var scopes = []; + var x = n; + + if(target === "o"){ + x -= 8; + if("prnbkq".indexOf(values[x-1]) >= 0 && x%8 != 0){ + scopes.push(x-1); + } + if("prnbkq".indexOf(values[x+1]) >= 0 && x%8 != 7){ + scopes.push(x+1); + } + if(x >= 0 && values[x] === 0){ + scopes.push(x); + if(x >= 40){ + if(x-8 >= 0 && values[x-8] === 0){ + scopes.push(x-8); + } + } + } + } + + else if(target === "t"){ + x = n; + x -= 8; + while(x >= 0){ + if(values[x] === 0){ + scopes.push(x); + } + else if("prnbqk".indexOf(values[x]) >= 0){ + scopes.push(x); + break; + } + else { + break; + } + x -= 8; + } + x = n; + x += 8; + while(x < 64){ + if(values[x] === 0){ + scopes.push(x); + } + else if("prnbqk".indexOf(values[x]) >= 0){ + scopes.push(x); + break; + } + else { + break; + } + x += 8; + } + x = n; + x++; + while(x%8 != 0){ + if(values[x] === 0){ + scopes.push(x); + } + else if("prnbqk".indexOf(values[x]) >= 0){ + scopes.push(x); + break; + } + else { + break; + } + x++; + } + x = n; + x--; + while(x%8 != 7){ + if(values[x] === 0){ + scopes.push(x); + } + else if("prnbqk".indexOf(values[x]) >= 0){ + scopes.push(x); + break; + } + else { + break; + } + x--; + } + } + + else if(target === "m"){ + x = n; + if(x%8 > 1 && x%8 < 6){ + x -= 17; + if(("prnbqk".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + x = n; + x -= 15; + if(("prnbqk".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + + x = n; + x -= 10; + if(("prnbqk".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + x = n; + x -= 6; + if(("prnbqk".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + x = n; + x += 6; + if(("prnbqk".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + x = n; + x += 10; + if(("prnbqk".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + x = n; + x += 15; + if(("prnbqk".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + x = n; + x += 17; + if(("prnbqk".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + } + else { + x = n; + if(x%8 <= 1){ + x = n; + x -= 15; + if(("prnbqk".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + x = n; + x -= 6; + if(("prnbqk".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + x = n; + x += 10; + if(("prnbqk".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + x = n; + x += 17; + if(("prnbqk".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + } + x = n; + if(x%8 === 1){ + x -= 17; + if(("prnbqk".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + x = n; + x += 15; + if(("prnbqk".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + } + if(x%8 >= 6){ + x = n; + x -= 17; + if(("prnbqk".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + x = n; + x -= 10; + if(("prnbqk".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + x = n; + x += 6; + if(("prnbqk".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + x = n; + x += 15; + if(("prnbqk".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + } + x = n; + if(x%8 === 6){ + x = n; + x -= 15; + if(("prnbqk".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + x = n; + x += 17; + if(("prnbqk".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + } + } + } + + else if(target === "v"){ + x = n; + x -= 9; + while(x >= 0 && x%8 !== 7){ + if(values[x] === 0){ + scopes.push(x); + } + else if("prnbqk".indexOf(values[x]) >= 0){ + scopes.push(x); + break; + } + else { + break; + } + x -= 9; + } + x = n; + x += 7; + while(x < 64 && x%8 !== 7){ + if(values[x] === 0){ + scopes.push(x); + } + else if("prnbqk".indexOf(values[x]) >= 0){ + scopes.push(x); + break; + } + else { + break; + } + x += 7; + } + x = n; + x += 9; + while(x%8 != 0 && x%8 !== 0){ + if(values[x] === 0){ + scopes.push(x); + } + else if("prnbqk".indexOf(values[x]) >= 0){ + scopes.push(x); + break; + } + else { + break; + } + x += 9; + } + x = n; + x -= 7; + while(x%8 != 0){ + if(values[x] === 0){ + scopes.push(x); + } + else if("prnbqk".indexOf(values[x]) >= 0){ + scopes.push(x); + break; + } + else { + break; + } + x -= 7; + } + } + + else if(target === "w"){ + x = n; + x -= 8; + while(x >= 0){ + if(values[x] === 0){ + scopes.push(x); + } + else if("prnbqk".indexOf(values[x]) >= 0){ + scopes.push(x); + break; + } + else { + break; + } + x -= 8; + } + x = n; + x += 8; + while(x < 64){ + if(values[x] === 0){ + scopes.push(x); + } + else if("prnbqk".indexOf(values[x]) >= 0){ + scopes.push(x); + break; + } + else { + break; + } + x += 8; + } + x = n; + x++; + while(x%8 != 0){ + if(values[x] === 0){ + scopes.push(x); + } + else if("prnbqk".indexOf(values[x]) >= 0){ + scopes.push(x); + break; + } + else { + break; + } + x++; + } + x = n; + x--; + while(x%8 != 7){ + if(values[x] === 0){ + scopes.push(x); + } + else if("prnbqk".indexOf(values[x]) >= 0){ + scopes.push(x); + break; + } + else { + break; + } + x--; + } + x = n; + x -= 9; + while(x >= 0 && x%8 !== 7){ + if(values[x] === 0){ + scopes.push(x); + } + else if("prnbqk".indexOf(values[x]) >= 0){ + scopes.push(x); + break; + } + else { + break; + } + x -= 9; + } + x = n; + x += 7; + while(x < 64 && x%8 !== 7){ + if(values[x] === 0){ + scopes.push(x); + } + else if("prnbqk".indexOf(values[x]) >= 0){ + scopes.push(x); + break; + } + else { + break; + } + x += 7; + } + x = n; + x += 9; + while(x%8 != 0 && x%8 !== 0){ + if(values[x] === 0){ + scopes.push(x); + } + else if("prnbqk".indexOf(values[x]) >= 0){ + scopes.push(x); + break; + } + else { + break; + } + x += 9; + } + x = n; + x -= 7; + while(x%8 != 0){ + if(values[x] === 0){ + scopes.push(x); + } + else if("prnbqk".indexOf(values[x]) >= 0){ + scopes.push(x); + break; + } + else { + break; + } + x -= 7; + } + } + + else if(target === "l"){ + x = n; + x += 8; + if(("prnbqk".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + x = n; + x -= 8; + if(("prnbqk".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + x = n; + if(x%8 > 0){ + x = n; + x -= 1; + if(("prnbqk".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + x = n; + x -= 9; + if(("prnbqk".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + + x = n; + x += 7; + if(("prnbqk".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + } + x = n; + if(x%8 < 7){ + x = n; + x += 1; + if(("prnbqk".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + x = n; + x += 9; + if(("prnbqk".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + x = n; + x -= 7; + if(("prnbqk".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + } + x = n; + if(!ck){ + cl = false; + if(!cr2){ + // cl = false; + if(values[n+1] === 0 && values[n+2] === 0 && values[n+3] === "t"){ + scopes.push(x+2); + cl = true; + } + } + if(!cr1){ + // cl = false; + if(values[n-1] === 0 && values[n-2] === 0 && values[n-3] === 0 && values[n-4] === "t"){ + scopes.push(x-2); + cl = true; + } + } + } + } + if(scopes.length) return scopes; + } + + function checkWhite(n,values){ + var target = values[n]; + var scopes = []; + var x = n; + if(target === "p"){ + x += 8; + if("otmvlw".indexOf(values[x-1]) >= 0 && x%8 != 0){ + scopes.push(x-1); + } + if("otmvlw".indexOf(values[x+1]) >= 0 && x%8 != 7){ + scopes.push(x+1); + } + if(x < 64 && values[x] === 0){ + scopes.push(x); + if(x <= 23){ + if(x+8 >= 0 && values[x+8] === 0){ + scopes.push(x+8); + } + } + } + } + + else if(target === "r"){ + x = n; + x -= 8; + while(x >= 0){ + if(values[x] === 0){ + scopes.push(x); + } + else if("otmvlw".indexOf(values[x]) >= 0){ + scopes.push(x); + break; + } + else { + break; + } + x -= 8; + } + x = n; + x += 8; + while(x < 64){ + if(values[x] === 0){ + scopes.push(x); + } + else if("otmvlw".indexOf(values[x]) >= 0){ + scopes.push(x); + break; + } + else { + break; + } + x += 8; + } + x = n; + x++; + while(x%8 != 0){ + if(values[x] === 0){ + scopes.push(x); + } + else if("otmvlw".indexOf(values[x]) >= 0){ + scopes.push(x); + break; + } + else { + break; + } + x++; + } + x = n; + x--; + while(x%8 != 7){ + if(values[x] === 0){ + scopes.push(x); + } + else if("otmvlw".indexOf(values[x]) >= 0){ + scopes.push(x); + break; + } + else { + break; + } + x--; + } + } + + else if(target === "n"){ + x = n; + if(x%8 > 1 && x%8 < 6){ + x -= 17; + if(("otmvlw".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + x = n; + x -= 15; + if(("otmvlw".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + + x = n; + x -= 10; + if(("otmvlw".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + x = n; + x -= 6; + if(("otmvlw".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + x = n; + x += 6; + if(("otmvlw".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + x = n; + x += 10; + if(("otmvlw".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + x = n; + x += 15; + if(("otmvlw".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + x = n; + x += 17; + if(("otmvlw".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + } + else { + x = n; + if(x%8 <= 1){ + x = n; + x -= 15; + if(("otmvlw".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + x = n; + x -= 6; + if(("otmvlw".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + x = n; + x += 10; + if(("otmvlw".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + x = n; + x += 17; + if(("otmvlw".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + } + x = n; + if(x%8 === 1){ + x -= 17; + if(("otmvlw".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + x = n; + x += 15; + if(("otmvlw".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + } + if(x%8 >= 6){ + x = n; + x -= 17; + if(("otmvlw".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + x = n; + x -= 10; + if(("otmvlw".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + x = n; + x += 6; + if(("otmvlw".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + x = n; + x += 15; + if(("otmvlw".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + } + x = n; + if(x%8 === 6){ + x = n; + x -= 15; + if(("otmvlw".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + x = n; + x += 17; + if(("otmvlw".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + } + } + } + + else if(target === "b"){ + x = n; + x -= 9; + while(x >= 0 && x%8 !== 7){ + if(values[x] === 0){ + scopes.push(x); + } + else if("otmvlw".indexOf(values[x]) >= 0){ + scopes.push(x); + break; + } + else { + break; + } + x -= 9; + } + x = n; + x += 7; + while(x < 64 && x%8 !== 7){ + if(values[x] === 0){ + scopes.push(x); + } + else if("otmvlw".indexOf(values[x]) >= 0){ + scopes.push(x); + break; + } + else { + break; + } + x += 7; + } + x = n; + x += 9; + while(x%8 != 0 && x%8 !== 0){ + if(values[x] === 0){ + scopes.push(x); + } + else if("otmvlw".indexOf(values[x]) >= 0){ + scopes.push(x); + break; + } + else { + break; + } + x += 9; + } + x = n; + x -= 7; + while(x%8 != 0){ + if(values[x] === 0){ + scopes.push(x); + } + else if("otmvlw".indexOf(values[x]) >= 0){ + scopes.push(x); + break; + } + else { + break; + } + x -= 7; + } + } + + else if(target === "q"){ + x = n; + x -= 8; + while(x >= 0){ + if(values[x] === 0){ + scopes.push(x); + } + else if("otmvlw".indexOf(values[x]) >= 0){ + scopes.push(x); + break; + } + else { + break; + } + x -= 8; + } + x = n; + x += 8; + while(x < 64){ + if(values[x] === 0){ + scopes.push(x); + } + else if("otmvlw".indexOf(values[x]) >= 0){ + scopes.push(x); + break; + } + else { + break; + } + x += 8; + } + x = n; + x++; + while(x%8 != 0){ + if(values[x] === 0){ + scopes.push(x); + } + else if("otmvlw".indexOf(values[x]) >= 0){ + scopes.push(x); + break; + } + else { + break; + } + x++; + } + x = n; + x--; + while(x%8 != 7){ + if(values[x] === 0){ + scopes.push(x); + } + else if("otmvlw".indexOf(values[x]) >= 0){ + scopes.push(x); + break; + } + else { + break; + } + x--; + } + x = n; + x -= 9; + while(x >= 0 && x%8 !== 7){ + if(values[x] === 0){ + scopes.push(x); + } + else if("otmvlw".indexOf(values[x]) >= 0){ + scopes.push(x); + break; + } + else { + break; + } + x -= 9; + } + x = n; + x += 7; + while(x < 64 && x%8 !== 7){ + if(values[x] === 0){ + scopes.push(x); + } + else if("otmvlw".indexOf(values[x]) >= 0){ + scopes.push(x); + break; + } + else { + break; + } + x += 7; + } + x = n; + x += 9; + while(x%8 != 0 && x%8 !== 0){ + if(values[x] === 0){ + scopes.push(x); + } + else if("otmvlw".indexOf(values[x]) >= 0){ + scopes.push(x); + break; + } + else { + break; + } + x += 9; + } + x = n; + x -= 7; + while(x%8 != 0){ + if(values[x] === 0){ + scopes.push(x); + } + else if("otmvlw".indexOf(values[x]) >= 0){ + scopes.push(x); + break; + } + else { + break; + } + x -= 7; + } + } + + else if(target === "k"){ + x = n; + x += 8; + if(("otmvlw".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + x = n; + x -= 8; + if(("otmvlw".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + x = n; + if(x%8 > 0){ + x = n; + x -= 1; + if(("otmvlw".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + x = n; + x -= 9; + if(("otmvlw".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + + x = n; + x += 7; + if(("otmvlw".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + } + x = n; + if(x%8 < 7){ + x = n; + x += 1; + if(("otmvlw".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + x = n; + x += 9; + if(("otmvlw".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + x = n; + x -= 7; + if(("otmvlw".indexOf(values[x]) >= 0 || values[x] === 0) && x < 64 && x >= 0){ + scopes.push(x); + } + } + } + if(scopes.length) return scopes; + } + + var myTurn = true; + + function check(){ + if(myTurn){ + var n = Number(this.classList[1].slice(1)); + var target = values[n]; + + var scopes = checkBlack(n,values) || []; + + var x = n; + + if(!moveable){ + if(scopes.length > 0){ + moveable = true; + moveTarget = n; + moveScopes = scopes.join(",").split(","); + } + else { + + } + } + else { + if(moveScopes.indexOf(String(n)) >= 0){ + var checkArr = []; + var saveKing = false; + for(var z = 0; z < 64; z++){ + checkArr[z] = values[z]; + } + + checkArr[n] = checkArr[moveTarget]; + checkArr[moveTarget] = 0; + + for(var y = 0; y < 64; y++){ + if("prnbkq".indexOf(checkArr[y]) >= 0){ + var checkScp = checkWhite(y,checkArr) || []; + for(var z = 0; z < checkScp.length; z++){ + if(checkArr[checkScp[z]] === 'l'){ + if(!saveKing){ + alert('Save Your King'); + saveKing = true; + } + } + } + } + } + + if(!saveKing){ + values[n] = values[moveTarget]; + values[moveTarget] = 0; + if(cl){ + if(n === 62 && moveTarget === 60){ + values[63] = 0; + values[61] = "t"; + } + else if(n === 58 && moveTarget === 60){ + values[59] = "t"; + values[56] = 0; + } + } + if(moveTarget === 60){ + ck = true; + } + else if(moveTarget === 63){ + cr2 = true; + } + else if(moveTarget === 56){ + cr1 = true; + } + if(values[n] === "o" && n < 8){ + values[n] = "w"; + } + moveable = false; + scopes = []; + myTurn = false; + setTimeout(chooseTurn,1000); + } + } + else { + moveScopes = []; + moveable = false; + } + } + + updateSquarecolor(); + + for(var x = 0; x < 64; x++){ + sqs[x].innerHTML = fonts[values[x]]; + if(values[x] === 0){ + sqs[x].innerHTML = ""; + } + } + + for(var x = 0; x < scopes.length; x++){ + sqs[scopes[x]].style.background = "#f45";//.classList.add("scope"); + // alert(scopes) + } + } + } + + + var arr = []; + + function chooseTurn(){ + var approved = []; + var actions = []; + var effects = []; + + + for(var n = 0; n < 64; n++){ + if("prnbqk".indexOf(values[n]) >= 0){ + var scopes = checkWhite(n,values) || []; + for(var x = 0; x < scopes.length; x++){ + var tmp = []//values.join(',').split(','); + for(var xx = 0; xx < 64; xx++){ + tmp[xx] = values[xx] + } + var effect = 0; + var action = Math.random()*3; + //Action value + var actionValue = tmp[scopes[x]]; + if(actionValue === "l"){ + action = 100 + Math.random()*3; + } + else if(actionValue === "w"){ + action = 50 + Math.random()*3; + } + else if(actionValue === "v"){ + action = 30 + Math.random()*3; + } + else if(actionValue === "m"){ + action = 30 + Math.random()*3; + } + else if(actionValue === "t"){ + action = 30 + Math.random()*3; + } + else if(actionValue === "o"){ + action = 15 + Math.random()*3; + } + //Effect value + tmp[scopes[x]] = tmp[n]; + tmp[n] = 0; + for(var y = 0; y < 64; y++){ + if("otmvlw".indexOf(values[y]) >= 0){ + var tmpScp = checkBlack(y,tmp) || []; + for(var z = 0; z < tmpScp.length; z++){ + var effectValue = tmp[tmpScp[z]]; + if(effectValue == "k"){ + if(effect < 100){ + effect = 100; + } + } + else if(effectValue == "q"){ + if(effect < 50){ + effect = 50; + } + } + else if(effectValue == "b"){ + if(effect < 30){ + effect = 30; + } + } + else if(effectValue == "n"){ + if(effect < 30){ + effect = 30; + } + } + else if(effectValue == "r"){ + if(effect < 30){ + effect = 30; + } + } + else if(effectValue == "p"){ + if(effect < 15){ + effect = 15; + } + } + } + } + } + + + + + actions.push(action); + effects.push(effect); + approved.push(n+"-"+scopes[x]); + } + } + } + + //alert(actions); + + var bestEffect = Math.min.apply(null,effects); + //alert(bestEffect); + if(bestEffect >= 100){ + alert("You Win"); + setTimeout(function(){ + values = ['r','n','b','q','k','b','n','r','p','p','p','p','p','p','p','p',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'o','o','o','o','o','o','o','o','t','m','v','w','l','v','m','t']; + },100); + } + + var tmpA = []; + var tmpB = []; + var tmpC = []; + var bestMove = ""; + + for(var n = 0; n < effects.length; n++){ + if(effects[n] === bestEffect){ + tmpA.push(actions[n]); + tmpB.push(approved[n]); + tmpC.push(effects[n]); + } + } + bestMove = tmpB[tmpA.indexOf(Math.max.apply(null,tmpA))]; + // alert(effects) + //alert(bestMove); + + + if(bestMove){ + values[Number(bestMove.split("-")[1])] = values[Number(bestMove.split("-")[0])]; + values[Number(bestMove.split("-")[0])] = 0; + if(values[Number(bestMove.split("-")[1])] === "p" && Number(bestMove.split("-")[1]) >= 56){ + values[Number(bestMove.split("-")[1])] = "q"; + } + + sqs[bestMove.split("-")[1]].style.background = '#aaf'; + sqs[bestMove.split("-")[0]].style.background = '#aaf'; + + for(var x = 0; x < 64; x++){ + //sqs[x].style.background = "#afa"//classList.add("scope"); + sqs[x].innerHTML = fonts[values[x]]; + if(values[x] === 0){ + sqs[x].innerHTML = ""; + } + } + myTurn = true; + } + else { + //alert('You Win'); + } + } +} +//chooseTurn(); \ No newline at end of file diff --git a/Games/Chess_Game_computer/style.css b/Games/Chess_Game_computer/style.css new file mode 100644 index 0000000000..20a54210b9 --- /dev/null +++ b/Games/Chess_Game_computer/style.css @@ -0,0 +1,28 @@ +body { + font-family:chess; + margin: 0; + background-color:#000; +} + +.square { + background:#afa; + display:inline-block; + border:1px solid #fff; + text-align:center; + position: absolute; + cursor: pointer; +} + +#buymeacoffee { + z-index: 10000; + position: absolute; + bottom: 20px; + width: 100%; + display: block; + text-align: center; +} + +#buymeacoffee img { + box-shadow: 0px 2px 6px rgba(255, 255, 255, 0.3); + border-radius: 10px; +} \ No newline at end of file diff --git a/Games/Connect_Four/index.html b/Games/Connect_Four/index.html index 2a0ac4cbe5..8db2d51f94 100644 --- a/Games/Connect_Four/index.html +++ b/Games/Connect_Four/index.html @@ -4,8 +4,17 @@ Connect4 + +
+ +

diff --git a/Games/Doraemon_Jump/index.html b/Games/Doraemon_Jump/index.html index 1b0961d5d3..44e3cdd805 100644 --- a/Games/Doraemon_Jump/index.html +++ b/Games/Doraemon_Jump/index.html @@ -19,6 +19,7 @@
+ diff --git a/Games/Dsa_quiz_game/README.md b/Games/Dsa_quiz_game/README.md new file mode 100644 index 0000000000..1fc0f26a1a --- /dev/null +++ b/Games/Dsa_quiz_game/README.md @@ -0,0 +1,37 @@ +# **Dsa_quiz_game** + +--- + +
+ +## **Description ๐Ÿ“ƒ** + +-The DSA Quiz Game is for educational purposes and contains DSA problems. +-It will help strengthen concepts. +-Increase your self-confidence. +-Easy to play. + +## **functionalities ๐ŸŽฎ** + +-Contains 50+ DSA questions. +-Randomly selects any 10 questions. +-Shows results after the game. +-Displays the correct answer if your answer is wrong. + +
+ +## **How to play? ๐Ÿ•น๏ธ** +-Start by selecting any one option. The game will show you the correct answer if your answer is wrong. + + +
+ +## **Screenshots ๐Ÿ“ธ** + +
+![image](../../assets/images/Dsa_quiz1.png) +![image](../../assets/images/Dsa_quiz2.png) + +
+ + diff --git a/Games/Dsa_quiz_game/index.html b/Games/Dsa_quiz_game/index.html new file mode 100644 index 0000000000..2b9c36c0c3 --- /dev/null +++ b/Games/Dsa_quiz_game/index.html @@ -0,0 +1,26 @@ + + + + + + + Quizz App + + +
+

Simple Quiz

+
+

This is Question

+
+ + + + +
+ +
+
+ + + + \ No newline at end of file diff --git a/Games/Dsa_quiz_game/script.js b/Games/Dsa_quiz_game/script.js new file mode 100644 index 0000000000..52981b7406 --- /dev/null +++ b/Games/Dsa_quiz_game/script.js @@ -0,0 +1,414 @@ +const questions = [ + { + question: "What is the time complexity of accessing an element in an array by its index?", + answers: [ + {text: "O(1)", correct: true}, + {text: "O(n)", correct: false}, + {text: "O(log n)", correct: false}, + {text: "O(n^2)", correct: false}, + ] + }, + { + question: "What data structure is a Last-In-First-Out (LIFO) data structure?", + answers: [ + {text: "Stack", correct: true}, + {text: "Queue", correct: false}, + {text: "Linked List", correct: false}, + {text: "Tree", correct: false}, + ] + }, + { + question: "What is the time complexity of inserting an element at the end of an array?", + answers: [ + {text: "O(1)", correct: false}, + {text: "O(n)", correct: true}, + {text: "O(log n)", correct: false}, + {text: "O(n^2)", correct: false}, + ] + }, + { + question: "Which data structure uses First-In-First-Out (FIFO) ordering?", + answers: [ + {text: "Queue", correct: true}, + {text: "Stack", correct: false}, + {text: "Linked List", correct: false}, + {text: "Tree", correct: false}, + ] + }, + { + question: "What is the time complexity of inserting an element at the beginning of an array?", + answers: [ + {text: "O(1)", correct: false}, + {text: "O(n)", correct: true}, + {text: "O(log n)", correct: false}, + {text: "O(n^2)", correct: false}, + ] + }, + { + question: "Which data structure organizes elements in a hierarchical structure?", + answers: [ + {text: "Tree", correct: true}, + {text: "Stack", correct: false}, + {text: "Queue", correct: false}, + {text: "Linked List", correct: false}, + ] + }, + { + question: "What is the time complexity of searching for an element in a binary search tree?", + answers: [ + {text: "O(1)", correct: false}, + {text: "O(n)", correct: false}, + {text: "O(log n)", correct: true}, + {text: "O(n^2)", correct: false}, + ] + }, + { + question: "Which data structure allows elements to be accessed in a LIFO (Last-In-First-Out) manner?", + answers: [ + {text: "Stack", correct: true}, + {text: "Queue", correct: false}, + {text: "Linked List", correct: false}, + {text: "Tree", correct: false}, + ] + }, + { + question: "What is the time complexity of inserting an element in the middle of an array?", + answers: [ + {text: "O(1)", correct: false}, + {text: "O(n)", correct: true}, + {text: "O(log n)", correct: false}, + {text: "O(n^2)", correct: false}, + ] + }, + { + question: "Which data structure does not have a fixed size?", + answers: [ + {text: "Linked List", correct: true}, + {text: "Stack", correct: false}, + {text: "Queue", correct: false}, + {text: "Tree", correct: false}, + ] + }, + { + question: "What is the time complexity of inserting an element at the end of a linked list?", + answers: [ + {text: "O(1)", correct: false}, + {text: "O(n)", correct: true}, + {text: "O(log n)", correct: false}, + {text: "O(n^2)", correct: false}, + ] + }, + { + question: "Which data structure allows elements to be accessed in a FIFO (First-In-First-Out) manner?", + answers: [ + {text: "Queue", correct: true}, + {text: "Stack", correct: false}, + {text: "Linked List", correct: false}, + {text: "Tree", correct: false}, + ] + }, + { + question: "What is the time complexity of deleting an element at the beginning of a linked list?", + answers: [ + {text: "O(1)", correct: true}, + {text: "O(n)", correct: false}, + {text: "O(log n)", correct: false}, + {text: "O(n^2)", correct: false}, + ] + }, + { + question: "Which data structure represents a collection of elements, each identified by at least one array index or key?", + answers: [ + {text: "Array", correct: true}, + {text: "Linked List", correct: false}, + {text: "Queue", correct: false}, + {text: "Stack", correct: false}, + ] + }, + { + question: "What is the time complexity of finding an element in a hash table?", + answers: [ + {text: "O(1)", correct: true}, + {text: "O(log n)", correct: false}, + {text: "O(n)", correct: false}, + {text: "O(n^2)", correct: false}, + ] + }, + { + question: "Which data structure allows for constant time insertion and deletion of elements at both ends?", + answers: [ + {text: "Deque", correct: true}, + {text: "Linked List", correct: false}, + {text: "Queue", correct: false}, + {text: "Stack", correct: false}, + ] + }, + { + question: "What is the time complexity of finding an element in a sorted array using binary search?", + answers: [ + {text: "O(1)", correct: false}, + {text: "O(log n)", correct: true}, + {text: "O(n)", correct: false}, + {text: "O(n^2)", correct: false}, + ] + }, + { + question: "Which data structure follows the Last-In-First-Out (LIFO) principle?", + answers: [ + {text: "Stack", correct: true}, + {text: "Queue", correct: false}, + {text: "Deque", correct: false}, + {text: "Linked List", correct: false}, + ] + }, + { + question: "What is the time complexity of appending an element to the end of a dynamic array (with resizing)?", + answers: [ + {text: "O(1)", correct: false}, + {text: "O(log n)", correct: false}, + {text: "O(n)", correct: false}, + {text: "Amortized O(1)", correct: true}, + ] + }, + { + question: "Which data structure is based on the principle of First-In-First-Out (FIFO)?", + answers: [ + {text: "Queue", correct: true}, + {text: "Stack", correct: false}, + {text: "Deque", correct: false}, + {text: "Linked List", correct: false}, + ] + }, + { + question: "What is the time complexity of finding the minimum (or maximum) element in a min (or max) heap?", + answers: [ + {text: "O(1)", correct: true}, + {text: "O(log n)", correct: false}, + {text: "O(n)", correct: false}, + {text: "O(n^2)", correct: false}, + ] + }, + { + question: "Which data structure can be used to efficiently implement a priority queue?", + answers: [ + {text: "Heap", correct: true}, + {text: "Stack", correct: false}, + {text: "Queue", correct: false}, + {text: "Linked List", correct: false}, + ] + }, + { + question: "What is the time complexity of inserting an element at the beginning of a linked list?", + answers: [ + {text: "O(1)", correct: true}, + {text: "O(log n)", correct: false}, + {text: "O(n)", correct: false}, + {text: "O(n^2)", correct: false}, + ] + }, + { + question: "What is the purpose of a linked list?", + answers: [ + {text: "To store data in a linear structure with a dynamic size", correct: true}, + {text: "To sort data efficiently", correct: false}, + {text: "To implement recursive algorithms", correct: false}, + {text: "To perform mathematical operations", correct: false}, + ] + }, + { + question: "What is a stack?", + answers: [ + {text: "A data structure that follows the Last-In-First-Out (LIFO) principle", correct: true}, + {text: "A data structure that follows the First-In-First-Out (FIFO) principle", correct: false}, + {text: "A data structure that organizes elements in a hierarchical structure", correct: false}, + {text: "A data structure that allows elements to be accessed in any order", correct: false}, + ] + }, + { + question: "What is the purpose of a binary heap?", + answers: [ + {text: "To implement priority queues efficiently", correct: true}, + {text: "To sort data in ascending order", correct: false}, + {text: "To perform recursive algorithms", correct: false}, + {text: "To store key-value pairs for efficient retrieval", correct: false}, + ] + }, + { + question: "What is a binary tree?", + answers: [ + {text: "A tree data structure in which each node has at most two children", correct: true}, + {text: "A tree data structure in which each node has exactly two children", correct: false}, + {text: "A tree data structure with more than two children per node", correct: false}, + {text: "A tree data structure with no children", correct: false}, + ] + }, + { + question: "What is a binary search tree (BST)?", + answers: [ + {text: "A binary tree in which the left subtree of a node contains only nodes with keys less than the node's key and the right subtree contains only nodes with keys greater than the node's key", correct: true}, + {text: "A binary tree that is sorted in descending order", correct: false}, + {text: "A binary tree that contains duplicate nodes", correct: false}, + {text: "A binary tree in which every node has exactly two children", correct: false}, + ] + }, + { + question: "What is a balanced binary tree?", + answers: [ + {text: "A binary tree in which the height of the left and right subtrees of any node differ by at most one", correct: true}, + {text: "A binary tree that contains only nodes with even keys", correct: false}, + {text: "A binary tree in which every node has exactly two children", correct: false}, + {text: "A binary tree in which all leaf nodes are at the same level", correct: false}, + ] + }, + { + question: "What is a graph?", + answers: [ + {text: "A data structure that consists of a set of nodes (vertices) and a set of edges that connect pairs of nodes", correct: true}, + {text: "A data structure that represents hierarchical relationships between elements", correct: false}, + {text: "A data structure used for storing key-value pairs", correct: false}, + {text: "A data structure that allows for efficient search, insertion, and deletion operations", correct: false}, + ] + }, + { + question: "What is a directed graph?", + answers: [ + {text: "A graph in which the edges have a direction, indicating a one-way connection between nodes", correct: true}, + {text: "A graph in which all nodes are connected to each other", correct: false}, + {text: "A graph in which the edges have weights assigned to them", correct: false}, + {text: "A graph in which the edges do not have a direction, indicating a two-way connection between nodes", correct: false}, + ] + }, + { + question: "What is a weighted graph?", + answers: [ + {text: "A graph in which each edge is assigned a numerical value, called a weight", correct: true}, + {text: "A graph in which the nodes have different sizes", correct: false}, + {text: "A graph in which the nodes have different colors", correct: false}, + {text: "A graph in which each edge is assigned a direction", correct: false}, + ] + }, + { + question: "What is the adjacency matrix of a graph?", + answers: [ + {text: "A two-dimensional array where the value at index [i][j] represents whether there is an edge from node i to node j", correct: true}, + {text: "A tree data structure used for storing key-value pairs", correct: false}, + {text: "A data structure that represents hierarchical relationships between elements", correct: false}, + {text: "A data structure used for representing binary trees", correct: false}, + ] + }, + { + question: "What is the depth-first search (DFS) algorithm used for in graphs?", + answers: [ + {text: "To explore as far as possible along each branch before backtracking", correct: true}, + {text: "To find the shortest path between two nodes in a weighted graph", correct: false}, + {text: "To find the minimum spanning tree of a graph", correct: false}, + {text: "To find the topological ordering of a directed acyclic graph (DAG)", correct: false}, + ] + }, + { + question: "What is the breadth-first search (BFS) algorithm used for in graphs?", + answers: [ + {text: "To explore all the neighbor nodes at the present depth before moving on to the nodes at the next depth level", correct: true}, + {text: "To find the shortest path between two nodes in a weighted graph", correct: false}, + {text: "To find the minimum spanning tree of a graph", correct: false}, + {text: "To find the topological ordering of a directed acyclic graph (DAG)", correct: false}, + ] + }, + { + question: "What is a spanning tree of a graph?", + answers: [ + {text: "A subgraph that is a tree and includes all the vertices of the original graph", correct: true}, + {text: "A tree data structure used for storing key-value pairs", correct: false}, + {text: "A data structure that represents hierarchical relationships between elements", correct: false}, + {text: "A data structure used for representing binary trees", correct: false}, + ] + } + +]; +const questionElement = document.getElementById('question'); +const answerButtons = document.getElementById('answer-btn'); +const nextButton = document.getElementById('next-btn'); +let currentquinx = 0; +let score = 0; +let shuffledQuestions = []; + +function startquiz() { + currentquinx = 0; + score = 0; + nextButton.innerHTML = "Next"; + shuffledQuestions = questions.sort(() => Math.random() - 0.5).slice(0, 10); // Shuffle and select 10 questions + ShowQuestion(); +} + +function ShowQuestion() { + resetState(); + let currentque = shuffledQuestions[currentquinx]; + let questionNo = currentquinx + 1; + questionElement.innerHTML = questionNo + ". " + currentque.question; + currentque.answers.forEach(answer => { + const button = document.createElement('button'); + button.innerHTML = answer.text; + button.classList.add("btn"); + button.addEventListener('click', () => checkAnswer(answer.correct)); + answerButtons.appendChild(button); + if(answer.correct) { + button.dataset.correct = answer.correct; + } + button.addEventListener("click", selectAnswer); + + }) +} + +function resetState() { + nextButton.style.display = 'none'; + while (answerButtons.firstChild) { + answerButtons.removeChild(answerButtons.firstChild); + } +} + +function selectAnswer(e) { + const selectedBtn = e.target; + const isCorrect = selectedBtn.dataset.correct === "true"; + + if (isCorrect) { + selectedBtn.classList.add("correct"); + score++; + } else { + selectedBtn.classList.add("incorrect"); + } + + Array.from(answerButtons.children).forEach(button => { + if (button.dataset.correct === "true") { + button.classList.add("correct"); + } + button.disabled = true; + }); + + nextButton.style.display = "block"; +} + +function ShowScore() { + resetState(); + questionElement.innerHTML = `You scored ${score} out of ${shuffledQuestions.length} !`; + nextButton.innerHTML = "Play Again"; + nextButton.style.display = "block"; +} + +function handleNextButton() { + currentquinx++; + if(currentquinx < shuffledQuestions.length) { + ShowQuestion(); + } else { + ShowScore(); + } +} + +nextButton.addEventListener("click", () => { + if(currentquinx < shuffledQuestions.length) { + handleNextButton(); + } else { + startquiz(); + } +}); + +startquiz(); diff --git a/Games/Dsa_quiz_game/style.css b/Games/Dsa_quiz_game/style.css new file mode 100644 index 0000000000..3fd9887f5c --- /dev/null +++ b/Games/Dsa_quiz_game/style.css @@ -0,0 +1,83 @@ +* +{ + margin: 0; + padding: 0; + font-family: 'Poppins',sans-serif; + box-sizing: border-box; +} +body +{ + background: #001e4d; + +} +.app +{ + background: #fff; + width: 90%; + max-width: 600px; + margin: 100px auto 0; + border-radius: 10px; + padding: 30px; +} +.app h1 +{ + font-weight: 25px; + color: #001e4d; + font-weight: 600px; + border-bottom: 1px solid #333; + padding-bottom: 30px; +} +.quiz +{ + padding: 20px 0; +} +.quiz h2 +{ + font-size: 18px; + color: #001e4d; + font-weight: 600px; +} +.btn +{ + background: #fff; + color: #222; + font-weight: 500px; + width: 100%; + border: 1px solid #222; + padding: 10px; + margin: 10px 0; + text-align: left; + border-radius: 4px; + cursor: pointer; + transition:all 0.5s; +} + +.btn:hover:not([disabled]) { + background: #222; + color: #fff; +} + +.btn:disabled { + cursor: no-drop; +} +#next-btn +{ + background: #001e4d; + color: #fff; + font-weight: 500px; + width: 150px; + border:0; + padding: 10px; + margin: 20px auto 0; + border-radius: 4px; + cursor: pointer; + display: none; +} +.correct +{ + background: #9aeabc; +} +.incorrect +{ + background: #ff9393; +} \ No newline at end of file diff --git a/Games/Grab_The_Carrot/README.md b/Games/Grab_The_Carrot/README.md new file mode 100644 index 0000000000..da04757813 --- /dev/null +++ b/Games/Grab_The_Carrot/README.md @@ -0,0 +1,24 @@ +# Grab The Carrot + +## Description +The Grab The Carrot is a simple web-based game designed to test and have fun . The game presents a sequence of obstacle which the players need to overcomes . The Players need to Grab The Carrot to survive the game + +# Functionality +- Displays a sequence of obstacles +- Increases the Highscore once the players Grab The Carrot. +- Simple and intuitive user interface. +- You can track your current score. + +## Usage +- Open the game by opening index.html in a web browser. +- Click the `Start Game` button to begin. +- A sequence of numbers will be displayed for a short period. +- Memorize the sequence and enter it into the input field once it disappears. +- Click the "Submit" button to check your input. +- If you recall the sequence correctly, a new number will be added to the sequence, and the game continues. +- If you input the sequence incorrectly, the game will end and display the correct sequence. + +## Files +- `index.html`: The main HTML file that sets up the structure of the game. +- `styles.css`: The CSS file that styles the game. +- `script.js`: The JavaScript file that contains the game logic. diff --git a/Games/Grab_The_Carrot/index.html b/Games/Grab_The_Carrot/index.html new file mode 100644 index 0000000000..5459dc7b8f --- /dev/null +++ b/Games/Grab_The_Carrot/index.html @@ -0,0 +1,32 @@ + + + + + + Grab the Carrot Game + + + +
+
+
+
+
+
Game Over
+
+
distance
+
000
+
+
+ Click to jump + โ€” Grab the carrots / avoid the hedgehogs +
+ + + + + + + + diff --git a/Games/Grab_The_Carrot/script.js b/Games/Grab_The_Carrot/script.js new file mode 100644 index 0000000000..77072d3fa7 --- /dev/null +++ b/Games/Grab_The_Carrot/script.js @@ -0,0 +1,1520 @@ +//THREEJS RELATED VARIABLES + +var scene, + camera, + fieldOfView, + aspectRatio, + nearPlane, + farPlane, + gobalLight, + shadowLight, + backLight, + renderer, + container, + controls, + clock; +var delta = 0; +var floorRadius = 200; +var speed = 6; +var distance = 0; +var level = 1; +var levelInterval; +var levelUpdateFreq = 3000; +var initSpeed = 5; +var maxSpeed = 48; +var monsterPos = 0.65; +var monsterPosTarget = 0.65; +var floorRotation = 0; +var collisionObstacle = 10; +var collisionBonus = 20; +var gameStatus = "play"; +var cameraPosGame = 160; +var cameraPosGameOver = 260; +var monsterAcceleration = 0.004; +var malusClearColor = 0xb44b39; +var malusClearAlpha = 0; +var audio = new Audio( + "https://s3-us-west-2.amazonaws.com/s.cdpn.io/264161/Antonio-Vivaldi-Summer_01.mp3", +); + +var fieldGameOver, fieldDistance; + +//SCREEN & MOUSE VARIABLES + +var HEIGHT, + WIDTH, + windowHalfX, + windowHalfY, + mousePos = { + x: 0, + y: 0, + }; + +//3D OBJECTS VARIABLES + +var hero; + +// Materials +var blackMat = new THREE.MeshPhongMaterial({ + color: 0x100707, + flatShading: true, // Replace shading with flatShading +}); +var brownMat = new THREE.MeshPhongMaterial({ + color: 0xb44b39, + flatShading: true, +}); + +var greenMat = new THREE.MeshPhongMaterial({ + color: 0x7abf8e, + flatShading: true, +}); + +var pinkMat = new THREE.MeshPhongMaterial({ + color: 0xdc5f45, //0xb43b29,//0xff5b49, + flatShading: true, +}); + +var lightBrownMat = new THREE.MeshPhongMaterial({ + color: 0xe07a57, + flatShading: true, +}); + +var whiteMat = new THREE.MeshPhongMaterial({ + color: 0xa49789, + shading: THREE.FlatShading, +}); +var skinMat = new THREE.MeshPhongMaterial({ + color: 0xff9ea5, + shading: THREE.FlatShading, +}); + +// OTHER VARIABLES + +var PI = Math.PI; + +//INIT THREE JS, SCREEN AND MOUSE EVENTS + +function initScreenAnd3D() { + HEIGHT = window.innerHeight; + WIDTH = window.innerWidth; + windowHalfX = WIDTH / 2; + windowHalfY = HEIGHT / 2; + + scene = new THREE.Scene(); + + scene.fog = new THREE.Fog(0xd6eae6, 160, 350); + + aspectRatio = WIDTH / HEIGHT; + fieldOfView = 50; + nearPlane = 1; + farPlane = 2000; + camera = new THREE.PerspectiveCamera( + fieldOfView, + aspectRatio, + nearPlane, + farPlane, + ); + camera.position.x = 0; + camera.position.z = cameraPosGame; + camera.position.y = 30; + camera.lookAt(new THREE.Vector3(0, 30, 0)); + + renderer = new THREE.WebGLRenderer({ + alpha: true, + antialias: true, + }); + renderer.setPixelRatio(window.devicePixelRatio); + renderer.setClearColor(malusClearColor, malusClearAlpha); + + renderer.setSize(WIDTH, HEIGHT); + renderer.shadowMap.enabled = true; + + container = document.getElementById("world"); + container.appendChild(renderer.domElement); + + window.addEventListener("resize", handleWindowResize, false); + document.addEventListener("mousedown", handleMouseDown, false); + document.addEventListener("touchend", handleMouseDown, false); + + /* + controls = new THREE.OrbitControls(camera, renderer.domElement); + //controls.minPolarAngle = -Math.PI / 2; + //controls.maxPolarAngle = Math.PI / 2; + //controls.noZoom = true; + controls.noPan = true; + //*/ + + clock = new THREE.Clock(); +} + +function handleWindowResize() { + HEIGHT = window.innerHeight; + WIDTH = window.innerWidth; + windowHalfX = WIDTH / 2; + windowHalfY = HEIGHT / 2; + renderer.setSize(WIDTH, HEIGHT); + camera.aspect = WIDTH / HEIGHT; + camera.updateProjectionMatrix(); +} + +function handleMouseDown(event) { + if (gameStatus == "play") hero.jump(); + else if (gameStatus == "readyToReplay") { + replay(); + } +} + +function createLights() { + globalLight = new THREE.AmbientLight(0xffffff, 0.9); + + shadowLight = new THREE.DirectionalLight(0xffffff, 1); + shadowLight.position.set(-30, 40, 20); + shadowLight.castShadow = true; + shadowLight.shadow.camera.left = -400; + shadowLight.shadow.camera.right = 400; + shadowLight.shadow.camera.top = 400; + shadowLight.shadow.camera.bottom = -400; + shadowLight.shadow.camera.near = 1; + shadowLight.shadow.camera.far = 2000; + shadowLight.shadow.mapSize.width = shadowLight.shadow.mapSize.height = 2048; + + scene.add(globalLight); + scene.add(shadowLight); +} + +function createFloor() { + floorShadow = new THREE.Mesh( + new THREE.SphereGeometry(floorRadius, 50, 50), + new THREE.MeshPhongMaterial({ + color: 0x7abf8e, + specular: 0x000000, + shininess: 1, + transparent: true, + opacity: 0.5, + }), + ); + //floorShadow.rotation.x = -Math.PI / 2; + floorShadow.receiveShadow = true; + + floorGrass = new THREE.Mesh( + new THREE.SphereGeometry(floorRadius - 0.5, 50, 50), + new THREE.MeshBasicMaterial({ + color: 0x7abf8e, + }), + ); + //floor.rotation.x = -Math.PI / 2; + floorGrass.receiveShadow = false; + + floor = new THREE.Group(); + floor.position.y = -floorRadius; + + floor.add(floorShadow); + floor.add(floorGrass); + scene.add(floor); +} + +Hero = function () { + this.status = "running"; + this.runningCycle = 0; + this.mesh = new THREE.Group(); + this.body = new THREE.Group(); + this.mesh.add(this.body); + + var torsoGeom = new THREE.CubeGeometry(7, 7, 10, 1); + + this.torso = new THREE.Mesh(torsoGeom, brownMat); + this.torso.position.z = 0; + this.torso.position.y = 7; + this.torso.castShadow = true; + this.body.add(this.torso); + + var pantsGeom = new THREE.CubeGeometry(9, 9, 5, 1); + this.pants = new THREE.Mesh(pantsGeom, whiteMat); + this.pants.position.z = -3; + this.pants.position.y = 0; + this.pants.castShadow = true; + this.torso.add(this.pants); + + var tailGeom = new THREE.CubeGeometry(3, 3, 3, 1); + tailGeom.applyMatrix(new THREE.Matrix4().makeTranslation(0, 0, -2)); + this.tail = new THREE.Mesh(tailGeom, lightBrownMat); + this.tail.position.z = -4; + this.tail.position.y = 5; + this.tail.castShadow = true; + this.torso.add(this.tail); + + this.torso.rotation.x = -Math.PI / 8; + + var headGeom = new THREE.CubeGeometry(10, 10, 13, 1); + + headGeom.applyMatrix(new THREE.Matrix4().makeTranslation(0, 0, 7.5)); + this.head = new THREE.Mesh(headGeom, brownMat); + this.head.position.z = 2; + this.head.position.y = 11; + this.head.castShadow = true; + this.body.add(this.head); + + var cheekGeom = new THREE.CubeGeometry(1, 4, 4, 1); + this.cheekR = new THREE.Mesh(cheekGeom, pinkMat); + this.cheekR.position.x = -5; + this.cheekR.position.z = 7; + this.cheekR.position.y = -2.5; + this.cheekR.castShadow = true; + this.head.add(this.cheekR); + + this.cheekL = this.cheekR.clone(); + this.cheekL.position.x = -this.cheekR.position.x; + this.head.add(this.cheekL); + + var noseGeom = new THREE.CubeGeometry(6, 6, 3, 1); + this.nose = new THREE.Mesh(noseGeom, lightBrownMat); + this.nose.position.z = 13.5; + this.nose.position.y = 2.6; + this.nose.castShadow = true; + this.head.add(this.nose); + + var mouthGeom = new THREE.CubeGeometry(4, 2, 4, 1); + mouthGeom.applyMatrix(new THREE.Matrix4().makeTranslation(0, 0, 3)); + mouthGeom.applyMatrix(new THREE.Matrix4().makeRotationX(Math.PI / 12)); + this.mouth = new THREE.Mesh(mouthGeom, brownMat); + this.mouth.position.z = 8; + this.mouth.position.y = -4; + this.mouth.castShadow = true; + this.head.add(this.mouth); + + var pawFGeom = new THREE.CubeGeometry(3, 3, 3, 1); + this.pawFR = new THREE.Mesh(pawFGeom, lightBrownMat); + this.pawFR.position.x = -2; + this.pawFR.position.z = 6; + this.pawFR.position.y = 1.5; + this.pawFR.castShadow = true; + this.body.add(this.pawFR); + + this.pawFL = this.pawFR.clone(); + this.pawFL.position.x = -this.pawFR.position.x; + this.pawFL.castShadow = true; + this.body.add(this.pawFL); + + var pawBGeom = new THREE.CubeGeometry(3, 3, 6, 1); + this.pawBL = new THREE.Mesh(pawBGeom, lightBrownMat); + this.pawBL.position.y = 1.5; + this.pawBL.position.z = 0; + this.pawBL.position.x = 5; + this.pawBL.castShadow = true; + this.body.add(this.pawBL); + + this.pawBR = this.pawBL.clone(); + this.pawBR.position.x = -this.pawBL.position.x; + this.pawBR.castShadow = true; + this.body.add(this.pawBR); + + var earGeom = new THREE.CubeGeometry(7, 18, 2, 1); + earGeom.vertices[6].x += 2; + earGeom.vertices[6].z += 0.5; + + earGeom.vertices[7].x += 2; + earGeom.vertices[7].z -= 0.5; + + earGeom.vertices[2].x -= 2; + earGeom.vertices[2].z -= 0.5; + + earGeom.vertices[3].x -= 2; + earGeom.vertices[3].z += 0.5; + earGeom.applyMatrix(new THREE.Matrix4().makeTranslation(0, 9, 0)); + + this.earL = new THREE.Mesh(earGeom, brownMat); + this.earL.position.x = 2; + this.earL.position.z = 2.5; + this.earL.position.y = 5; + this.earL.rotation.z = -Math.PI / 12; + this.earL.castShadow = true; + this.head.add(this.earL); + + this.earR = this.earL.clone(); + this.earR.position.x = -this.earL.position.x; + this.earR.rotation.z = -this.earL.rotation.z; + this.earR.castShadow = true; + this.head.add(this.earR); + + var eyeGeom = new THREE.CubeGeometry(2, 4, 4); + + this.eyeL = new THREE.Mesh(eyeGeom, whiteMat); + this.eyeL.position.x = 5; + this.eyeL.position.z = 5.5; + this.eyeL.position.y = 2.9; + this.eyeL.castShadow = true; + this.head.add(this.eyeL); + + var irisGeom = new THREE.CubeGeometry(0.6, 2, 2); + + this.iris = new THREE.Mesh(irisGeom, blackMat); + this.iris.position.x = 1.2; + this.iris.position.y = 1; + this.iris.position.z = 1; + this.eyeL.add(this.iris); + + this.eyeR = this.eyeL.clone(); + this.eyeR.children[0].position.x = -this.iris.position.x; + + this.eyeR.position.x = -this.eyeL.position.x; + this.head.add(this.eyeR); + + this.body.traverse(function (object) { + if (object instanceof THREE.Mesh) { + object.castShadow = true; + object.receiveShadow = true; + } + }); +}; + +BonusParticles = function () { + this.mesh = new THREE.Group(); + var bigParticleGeom = new THREE.CubeGeometry(10, 10, 10, 1); + var smallParticleGeom = new THREE.CubeGeometry(5, 5, 5, 1); + this.parts = []; + for (var i = 0; i < 10; i++) { + var partPink = new THREE.Mesh(bigParticleGeom, pinkMat); + var partGreen = new THREE.Mesh(smallParticleGeom, greenMat); + partGreen.scale.set(0.5, 0.5, 0.5); + this.parts.push(partPink); + this.parts.push(partGreen); + this.mesh.add(partPink); + this.mesh.add(partGreen); + } +}; + +BonusParticles.prototype.explose = function () { + var _this = this; + var explosionSpeed = 0.5; + for (var i = 0; i < this.parts.length; i++) { + var tx = -50 + Math.random() * 100; + var ty = -50 + Math.random() * 100; + var tz = -50 + Math.random() * 100; + var p = this.parts[i]; + p.position.set(0, 0, 0); + p.scale.set(1, 1, 1); + p.visible = true; + var s = explosionSpeed + Math.random() * 0.5; + TweenMax.to(p.position, s, { x: tx, y: ty, z: tz, ease: Power4.easeOut }); + TweenMax.to(p.scale, s, { + x: 0.01, + y: 0.01, + z: 0.01, + ease: Power4.easeOut, + onComplete: removeParticle, + onCompleteParams: [p], + }); + } +}; + +function removeParticle(p) { + p.visible = false; +} + +Hero.prototype.run = function () { + this.status = "running"; + + var s = Math.min(speed, maxSpeed); + + this.runningCycle += delta * s * 0.7; + this.runningCycle = this.runningCycle % (Math.PI * 2); + var t = this.runningCycle; + + var amp = 4; + var disp = 0.2; + + // BODY + + this.body.position.y = 6 + Math.sin(t - Math.PI / 2) * amp; + this.body.rotation.x = 0.2 + Math.sin(t - Math.PI / 2) * amp * 0.1; + + this.torso.rotation.x = Math.sin(t - Math.PI / 2) * amp * 0.1; + this.torso.position.y = 7 + Math.sin(t - Math.PI / 2) * amp * 0.5; + + // MOUTH + this.mouth.rotation.x = Math.PI / 16 + Math.cos(t) * amp * 0.05; + + // HEAD + this.head.position.z = 2 + Math.sin(t - Math.PI / 2) * amp * 0.5; + this.head.position.y = 8 + Math.cos(t - Math.PI / 2) * amp * 0.7; + this.head.rotation.x = -0.2 + Math.sin(t + Math.PI) * amp * 0.1; + + // EARS + this.earL.rotation.x = Math.cos(-Math.PI / 2 + t) * (amp * 0.2); + this.earR.rotation.x = Math.cos(-Math.PI / 2 + 0.2 + t) * (amp * 0.3); + + // EYES + this.eyeR.scale.y = this.eyeL.scale.y = + 0.7 + Math.abs(Math.cos(-Math.PI / 4 + t * 0.5)) * 0.6; + + // TAIL + this.tail.rotation.x = Math.cos(Math.PI / 2 + t) * amp * 0.3; + + // FRONT RIGHT PAW + this.pawFR.position.y = 1.5 + Math.sin(t) * amp; + this.pawFR.rotation.x = (Math.cos(t) * Math.PI) / 4; + + this.pawFR.position.z = 6 - Math.cos(t) * amp * 2; + + // FRONT LEFT PAW + + this.pawFL.position.y = 1.5 + Math.sin(disp + t) * amp; + this.pawFL.rotation.x = (Math.cos(t) * Math.PI) / 4; + + this.pawFL.position.z = 6 - Math.cos(disp + t) * amp * 2; + + // BACK RIGHT PAW + this.pawBR.position.y = 1.5 + Math.sin(Math.PI + t) * amp; + this.pawBR.rotation.x = (Math.cos(t + Math.PI * 1.5) * Math.PI) / 3; + + this.pawBR.position.z = -Math.cos(Math.PI + t) * amp; + + // BACK LEFT PAW + this.pawBL.position.y = 1.5 + Math.sin(Math.PI + t) * amp; + this.pawBL.rotation.x = (Math.cos(t + Math.PI * 1.5) * Math.PI) / 3; + + this.pawBL.position.z = -Math.cos(Math.PI + t) * amp; +}; + +Hero.prototype.jump = function () { + if (this.status == "jumping") return; + this.status = "jumping"; + var _this = this; + var totalSpeed = 10 / speed; + var jumpHeight = 45; + + TweenMax.to(this.earL.rotation, totalSpeed, { + x: "+=.3", + ease: Back.easeOut, + }); + TweenMax.to(this.earR.rotation, totalSpeed, { + x: "-=.3", + ease: Back.easeOut, + }); + + TweenMax.to(this.pawFL.rotation, totalSpeed, { + x: "+=.7", + ease: Back.easeOut, + }); + TweenMax.to(this.pawFR.rotation, totalSpeed, { + x: "-=.7", + ease: Back.easeOut, + }); + TweenMax.to(this.pawBL.rotation, totalSpeed, { + x: "+=.7", + ease: Back.easeOut, + }); + TweenMax.to(this.pawBR.rotation, totalSpeed, { + x: "-=.7", + ease: Back.easeOut, + }); + + TweenMax.to(this.tail.rotation, totalSpeed, { x: "+=1", ease: Back.easeOut }); + + TweenMax.to(this.mouth.rotation, totalSpeed, { x: 0.5, ease: Back.easeOut }); + + TweenMax.to(this.mesh.position, totalSpeed / 2, { + y: jumpHeight, + ease: Power2.easeOut, + }); + TweenMax.to(this.mesh.position, totalSpeed / 2, { + y: 0, + ease: Power4.easeIn, + delay: totalSpeed / 2, + onComplete: function () { + //t = 0; + _this.status = "running"; + }, + }); +}; + +Monster = function () { + this.runningCycle = 0; + + this.mesh = new THREE.Group(); + this.body = new THREE.Group(); + + var torsoGeom = new THREE.CubeGeometry(15, 15, 20, 1); + this.torso = new THREE.Mesh(torsoGeom, blackMat); + + var headGeom = new THREE.CubeGeometry(20, 20, 40, 1); + headGeom.applyMatrix(new THREE.Matrix4().makeTranslation(0, 0, 20)); + this.head = new THREE.Mesh(headGeom, blackMat); + this.head.position.z = 12; + this.head.position.y = 2; + + var mouthGeom = new THREE.CubeGeometry(10, 4, 20, 1); + mouthGeom.applyMatrix(new THREE.Matrix4().makeTranslation(0, -2, 10)); + this.mouth = new THREE.Mesh(mouthGeom, blackMat); + this.mouth.position.y = -8; + this.mouth.rotation.x = 0.4; + this.mouth.position.z = 4; + + this.heroHolder = new THREE.Group(); + this.heroHolder.position.z = 20; + this.mouth.add(this.heroHolder); + + var toothGeom = new THREE.CubeGeometry(2, 2, 1, 1); + + toothGeom.vertices[1].x -= 1; + toothGeom.vertices[4].x += 1; + toothGeom.vertices[5].x += 1; + toothGeom.vertices[0].x -= 1; + + for (var i = 0; i < 3; i++) { + var toothf = new THREE.Mesh(toothGeom, whiteMat); + toothf.position.x = -2.8 + i * 2.5; + toothf.position.y = 1; + toothf.position.z = 19; + + var toothl = new THREE.Mesh(toothGeom, whiteMat); + toothl.rotation.y = Math.PI / 2; + toothl.position.z = 12 + i * 2.5; + toothl.position.y = 1; + toothl.position.x = 4; + + var toothr = toothl.clone(); + toothl.position.x = -4; + + this.mouth.add(toothf); + this.mouth.add(toothl); + this.mouth.add(toothr); + } + + var tongueGeometry = new THREE.CubeGeometry(6, 1, 14); + tongueGeometry.applyMatrix(new THREE.Matrix4().makeTranslation(0, 0, 7)); + + this.tongue = new THREE.Mesh(tongueGeometry, pinkMat); + this.tongue.position.z = 2; + this.tongue.rotation.x = -0.2; + this.mouth.add(this.tongue); + + var noseGeom = new THREE.CubeGeometry(4, 4, 4, 1); + this.nose = new THREE.Mesh(noseGeom, pinkMat); + this.nose.position.z = 39.5; + this.nose.position.y = 9; + this.head.add(this.nose); + + this.head.add(this.mouth); + + var eyeGeom = new THREE.CubeGeometry(2, 3, 3); + + this.eyeL = new THREE.Mesh(eyeGeom, whiteMat); + this.eyeL.position.x = 10; + this.eyeL.position.z = 5; + this.eyeL.position.y = 5; + this.eyeL.castShadow = true; + this.head.add(this.eyeL); + + var irisGeom = new THREE.CubeGeometry(0.6, 1, 1); + + this.iris = new THREE.Mesh(irisGeom, blackMat); + this.iris.position.x = 1.2; + this.iris.position.y = -1; + this.iris.position.z = 1; + this.eyeL.add(this.iris); + + this.eyeR = this.eyeL.clone(); + this.eyeR.children[0].position.x = -this.iris.position.x; + this.eyeR.position.x = -this.eyeL.position.x; + this.head.add(this.eyeR); + + var earGeom = new THREE.CubeGeometry(8, 6, 2, 1); + earGeom.vertices[1].x -= 4; + earGeom.vertices[4].x += 4; + earGeom.vertices[5].x += 4; + earGeom.vertices[5].z -= 2; + earGeom.vertices[0].x -= 4; + earGeom.vertices[0].z -= 2; + + earGeom.applyMatrix(new THREE.Matrix4().makeTranslation(0, 3, 0)); + + this.earL = new THREE.Mesh(earGeom, blackMat); + this.earL.position.x = 6; + this.earL.position.z = 1; + this.earL.position.y = 10; + this.earL.castShadow = true; + this.head.add(this.earL); + + this.earR = this.earL.clone(); + this.earR.position.x = -this.earL.position.x; + this.earR.rotation.z = -this.earL.rotation.z; + this.head.add(this.earR); + + var eyeGeom = new THREE.CubeGeometry(2, 4, 4); + + var tailGeom = new THREE.CylinderGeometry(5, 2, 20, 4, 1); + tailGeom.applyMatrix(new THREE.Matrix4().makeTranslation(0, 10, 0)); + tailGeom.applyMatrix(new THREE.Matrix4().makeRotationX(-Math.PI / 2)); + tailGeom.applyMatrix(new THREE.Matrix4().makeRotationZ(Math.PI / 4)); + + this.tail = new THREE.Mesh(tailGeom, blackMat); + this.tail.position.z = -10; + this.tail.position.y = 4; + this.torso.add(this.tail); + + var pawGeom = new THREE.CylinderGeometry(1.5, 0, 10); + pawGeom.applyMatrix(new THREE.Matrix4().makeTranslation(0, -5, 0)); + this.pawFL = new THREE.Mesh(pawGeom, blackMat); + this.pawFL.position.y = -7.5; + this.pawFL.position.z = 8.5; + this.pawFL.position.x = 5.5; + this.torso.add(this.pawFL); + + this.pawFR = this.pawFL.clone(); + this.pawFR.position.x = -this.pawFL.position.x; + this.torso.add(this.pawFR); + + this.pawBR = this.pawFR.clone(); + this.pawBR.position.z = -this.pawFL.position.z; + this.torso.add(this.pawBR); + + this.pawBL = this.pawBR.clone(); + this.pawBL.position.x = this.pawFL.position.x; + this.torso.add(this.pawBL); + + this.mesh.add(this.body); + this.torso.add(this.head); + this.body.add(this.torso); + + this.torso.castShadow = true; + this.head.castShadow = true; + this.pawFL.castShadow = true; + this.pawFR.castShadow = true; + this.pawBL.castShadow = true; + this.pawBR.castShadow = true; + + this.body.rotation.y = Math.PI / 2; +}; + +Monster.prototype.run = function () { + var s = Math.min(speed, maxSpeed); + this.runningCycle += delta * s * 0.7; + this.runningCycle = this.runningCycle % (Math.PI * 2); + var t = this.runningCycle; + + this.pawFR.rotation.x = (Math.sin(t) * Math.PI) / 4; + this.pawFR.position.y = -5.5 - Math.sin(t); + this.pawFR.position.z = 7.5 + Math.cos(t); + + this.pawFL.rotation.x = (Math.sin(t + 0.4) * Math.PI) / 4; + this.pawFL.position.y = -5.5 - Math.sin(t + 0.4); + this.pawFL.position.z = 7.5 + Math.cos(t + 0.4); + + this.pawBL.rotation.x = (Math.sin(t + 2) * Math.PI) / 4; + this.pawBL.position.y = -5.5 - Math.sin(t + 3.8); + this.pawBL.position.z = -7.5 + Math.cos(t + 3.8); + + this.pawBR.rotation.x = (Math.sin(t + 2.4) * Math.PI) / 4; + this.pawBR.position.y = -5.5 - Math.sin(t + 3.4); + this.pawBR.position.z = -7.5 + Math.cos(t + 3.4); + + this.torso.rotation.x = (Math.sin(t) * Math.PI) / 8; + this.torso.position.y = 3 - Math.sin(t + Math.PI / 2) * 3; + + //this.head.position.y = 5-Math.sin(t+Math.PI/2)*2; + this.head.rotation.x = -0.1 + Math.sin(-t - 1) * 0.4; + this.mouth.rotation.x = 0.2 + Math.sin(t + Math.PI + 0.3) * 0.4; + + this.tail.rotation.x = 0.2 + Math.sin(t - Math.PI / 2); + + this.eyeR.scale.y = 0.5 + Math.sin(t + Math.PI) * 0.5; +}; + +Hero.prototype.nod = function () { + var _this = this; + var sp = 0.5 + Math.random(); + + // HEAD + var tHeadRotY = -Math.PI / 6 + (Math.random() * Math.PI) / 3; + TweenMax.to(this.head.rotation, sp, { + y: tHeadRotY, + ease: Power4.easeInOut, + onComplete: function () { + _this.nod(); + }, + }); + + // EARS + var tEarLRotX = Math.PI / 4 + (Math.random() * Math.PI) / 6; + var tEarRRotX = Math.PI / 4 + (Math.random() * Math.PI) / 6; + + TweenMax.to(this.earL.rotation, sp, { x: tEarLRotX, ease: Power4.easeInOut }); + TweenMax.to(this.earR.rotation, sp, { x: tEarRRotX, ease: Power4.easeInOut }); + + // PAWS BACK LEFT + + var tPawBLRot = (Math.random() * Math.PI) / 2; + var tPawBLY = -4 + Math.random() * 8; + + TweenMax.to(this.pawBL.rotation, sp / 2, { + x: tPawBLRot, + ease: Power1.easeInOut, + yoyo: true, + repeat: 2, + }); + TweenMax.to(this.pawBL.position, sp / 2, { + y: tPawBLY, + ease: Power1.easeInOut, + yoyo: true, + repeat: 2, + }); + + // PAWS BACK RIGHT + + var tPawBRRot = (Math.random() * Math.PI) / 2; + var tPawBRY = -4 + Math.random() * 8; + TweenMax.to(this.pawBR.rotation, sp / 2, { + x: tPawBRRot, + ease: Power1.easeInOut, + yoyo: true, + repeat: 2, + }); + TweenMax.to(this.pawBR.position, sp / 2, { + y: tPawBRY, + ease: Power1.easeInOut, + yoyo: true, + repeat: 2, + }); + + // PAWS FRONT LEFT + + var tPawFLRot = (Math.random() * Math.PI) / 2; + var tPawFLY = -4 + Math.random() * 8; + + TweenMax.to(this.pawFL.rotation, sp / 2, { + x: tPawFLRot, + ease: Power1.easeInOut, + yoyo: true, + repeat: 2, + }); + + TweenMax.to(this.pawFL.position, sp / 2, { + y: tPawFLY, + ease: Power1.easeInOut, + yoyo: true, + repeat: 2, + }); + + // PAWS FRONT RIGHT + + var tPawFRRot = (Math.random() * Math.PI) / 2; + var tPawFRY = -4 + Math.random() * 8; + + TweenMax.to(this.pawFR.rotation, sp / 2, { + x: tPawFRRot, + ease: Power1.easeInOut, + yoyo: true, + repeat: 2, + }); + + TweenMax.to(this.pawFR.position, sp / 2, { + y: tPawFRY, + ease: Power1.easeInOut, + yoyo: true, + repeat: 2, + }); + + // MOUTH + var tMouthRot = (Math.random() * Math.PI) / 8; + TweenMax.to(this.mouth.rotation, sp, { + x: tMouthRot, + ease: Power1.easeInOut, + }); + // IRIS + var tIrisY = -1 + Math.random() * 2; + var tIrisZ = -1 + Math.random() * 2; + var iris1 = this.iris; + var iris2 = this.eyeR.children[0]; + TweenMax.to([iris1.position, iris2.position], sp, { + y: tIrisY, + z: tIrisZ, + ease: Power1.easeInOut, + }); + + //EYES + if (Math.random() > 0.2) + TweenMax.to([this.eyeR.scale, this.eyeL.scale], sp / 8, { + y: 0, + ease: Power1.easeInOut, + yoyo: true, + repeat: 1, + }); +}; + +Hero.prototype.hang = function () { + var _this = this; + var sp = 1; + var ease = Power4.easeOut; + + TweenMax.killTweensOf(this.eyeL.scale); + TweenMax.killTweensOf(this.eyeR.scale); + + this.body.rotation.x = 0; + this.torso.rotation.x = 0; + this.body.position.y = 0; + this.torso.position.y = 7; + + TweenMax.to(this.mesh.rotation, sp, { y: 0, ease: ease }); + TweenMax.to(this.mesh.position, sp, { y: -7, z: 6, ease: ease }); + TweenMax.to(this.head.rotation, sp, { + x: Math.PI / 6, + ease: ease, + onComplete: function () { + _this.nod(); + }, + }); + + TweenMax.to(this.earL.rotation, sp, { x: Math.PI / 3, ease: ease }); + TweenMax.to(this.earR.rotation, sp, { x: Math.PI / 3, ease: ease }); + + TweenMax.to(this.pawFL.position, sp, { y: -1, z: 3, ease: ease }); + TweenMax.to(this.pawFR.position, sp, { y: -1, z: 3, ease: ease }); + TweenMax.to(this.pawBL.position, sp, { y: -2, z: -3, ease: ease }); + TweenMax.to(this.pawBR.position, sp, { y: -2, z: -3, ease: ease }); + + TweenMax.to(this.eyeL.scale, sp, { y: 1, ease: ease }); + TweenMax.to(this.eyeR.scale, sp, { y: 1, ease: ease }); +}; + +Monster.prototype.nod = function () { + var _this = this; + var sp = 1 + Math.random() * 2; + + // HEAD + var tHeadRotY = -Math.PI / 3 + Math.random() * 0.5; + var tHeadRotX = Math.PI / 3 - 0.2 + Math.random() * 0.4; + TweenMax.to(this.head.rotation, sp, { + x: tHeadRotX, + y: tHeadRotY, + ease: Power4.easeInOut, + onComplete: function () { + _this.nod(); + }, + }); + + // TAIL + + var tTailRotY = -Math.PI / 4; + TweenMax.to(this.tail.rotation, sp / 8, { + y: tTailRotY, + ease: Power1.easeInOut, + yoyo: true, + repeat: 8, + }); + + // EYES + + TweenMax.to([this.eyeR.scale, this.eyeL.scale], sp / 20, { + y: 0, + ease: Power1.easeInOut, + yoyo: true, + repeat: 1, + }); +}; + +Monster.prototype.sit = function () { + var sp = 1.2; + var ease = Power4.easeOut; + var _this = this; + TweenMax.to(this.torso.rotation, sp, { x: -1.3, ease: ease }); + TweenMax.to(this.torso.position, sp, { + y: -5, + ease: ease, + onComplete: function () { + _this.nod(); + gameStatus = "readyToReplay"; + }, + }); + + TweenMax.to(this.head.rotation, sp, { + x: Math.PI / 3, + y: -Math.PI / 3, + ease: ease, + }); + TweenMax.to(this.tail.rotation, sp, { x: 2, y: Math.PI / 4, ease: ease }); + TweenMax.to(this.pawBL.rotation, sp, { x: -0.1, ease: ease }); + TweenMax.to(this.pawBR.rotation, sp, { x: -0.1, ease: ease }); + TweenMax.to(this.pawFL.rotation, sp, { x: 1, ease: ease }); + TweenMax.to(this.pawFR.rotation, sp, { x: 1, ease: ease }); + TweenMax.to(this.mouth.rotation, sp, { x: 0.3, ease: ease }); + TweenMax.to(this.eyeL.scale, sp, { y: 1, ease: ease }); + TweenMax.to(this.eyeR.scale, sp, { y: 1, ease: ease }); + + //TweenMax.to(this.body.rotation, sp, {y:Math.PI/4}); +}; + +Carrot = function () { + this.angle = 0; + this.mesh = new THREE.Group(); + + var bodyGeom = new THREE.CylinderGeometry(5, 3, 10, 4, 1); + bodyGeom.vertices[8].y += 2; + bodyGeom.vertices[9].y -= 3; + + this.body = new THREE.Mesh(bodyGeom, pinkMat); + + var leafGeom = new THREE.CubeGeometry(5, 10, 1, 1); + leafGeom.applyMatrix(new THREE.Matrix4().makeTranslation(0, 5, 0)); + leafGeom.vertices[2].x -= 1; + leafGeom.vertices[3].x -= 1; + leafGeom.vertices[6].x += 1; + leafGeom.vertices[7].x += 1; + + this.leaf1 = new THREE.Mesh(leafGeom, greenMat); + this.leaf1.position.y = 7; + this.leaf1.rotation.z = 0.3; + this.leaf1.rotation.x = 0.2; + + this.leaf2 = this.leaf1.clone(); + this.leaf2.scale.set(1, 1.3, 1); + this.leaf2.position.y = 7; + this.leaf2.rotation.z = -0.3; + this.leaf2.rotation.x = -0.2; + + this.mesh.add(this.body); + this.mesh.add(this.leaf1); + this.mesh.add(this.leaf2); + + this.body.traverse(function (object) { + if (object instanceof THREE.Mesh) { + object.castShadow = true; + object.receiveShadow = true; + } + }); +}; + +Hedgehog = function () { + this.angle = 0; + this.status = "ready"; + this.mesh = new THREE.Group(); + var bodyGeom = new THREE.CubeGeometry(6, 6, 6, 1); + this.body = new THREE.Mesh(bodyGeom, blackMat); + + var headGeom = new THREE.CubeGeometry(5, 5, 7, 1); + this.head = new THREE.Mesh(headGeom, lightBrownMat); + this.head.position.z = 6; + this.head.position.y = -0.5; + + var noseGeom = new THREE.CubeGeometry(1.5, 1.5, 1.5, 1); + this.nose = new THREE.Mesh(noseGeom, blackMat); + this.nose.position.z = 4; + this.nose.position.y = 2; + + var eyeGeom = new THREE.CubeGeometry(1, 3, 3); + + this.eyeL = new THREE.Mesh(eyeGeom, whiteMat); + this.eyeL.position.x = 2.2; + this.eyeL.position.z = -0.5; + this.eyeL.position.y = 0.8; + this.eyeL.castShadow = true; + this.head.add(this.eyeL); + + var irisGeom = new THREE.CubeGeometry(0.5, 1, 1); + + this.iris = new THREE.Mesh(irisGeom, blackMat); + this.iris.position.x = 0.5; + this.iris.position.y = 0.8; + this.iris.position.z = 0.8; + this.eyeL.add(this.iris); + + this.eyeR = this.eyeL.clone(); + this.eyeR.children[0].position.x = -this.iris.position.x; + this.eyeR.position.x = -this.eyeL.position.x; + + var spikeGeom = new THREE.CubeGeometry(0.5, 2, 0.5, 1); + spikeGeom.applyMatrix(new THREE.Matrix4().makeTranslation(0, 1, 0)); + + for (var i = 0; i < 9; i++) { + var row = i % 3; + var col = Math.floor(i / 3); + var sb = new THREE.Mesh(spikeGeom, blackMat); + sb.rotation.x = -Math.PI / 2 + (Math.PI / 12) * row - 0.5 + Math.random(); + sb.position.z = -3; + sb.position.y = -2 + row * 2; + sb.position.x = -2 + col * 2; + this.body.add(sb); + var st = new THREE.Mesh(spikeGeom, blackMat); + st.position.y = 3; + st.position.x = -2 + row * 2; + st.position.z = -2 + col * 2; + st.rotation.z = Math.PI / 6 - (Math.PI / 6) * row - 0.5 + Math.random(); + this.body.add(st); + + var sr = new THREE.Mesh(spikeGeom, blackMat); + sr.position.x = 3; + sr.position.y = -2 + row * 2; + sr.position.z = -2 + col * 2; + sr.rotation.z = -Math.PI / 2 + (Math.PI / 12) * row - 0.5 + Math.random(); + this.body.add(sr); + + var sl = new THREE.Mesh(spikeGeom, blackMat); + sl.position.x = -3; + sl.position.y = -2 + row * 2; + sl.position.z = -2 + col * 2; + sl.rotation.z = Math.PI / 2 - (Math.PI / 12) * row - 0.5 + Math.random(); + this.body.add(sl); + } + + this.head.add(this.eyeR); + var earGeom = new THREE.CubeGeometry(2, 2, 0.5, 1); + this.earL = new THREE.Mesh(earGeom, lightBrownMat); + this.earL.position.x = 2.5; + this.earL.position.z = -2.5; + this.earL.position.y = 2.5; + this.earL.rotation.z = -Math.PI / 12; + this.earL.castShadow = true; + this.head.add(this.earL); + + this.earR = this.earL.clone(); + this.earR.position.x = -this.earL.position.x; + this.earR.rotation.z = -this.earL.rotation.z; + this.earR.castShadow = true; + this.head.add(this.earR); + + var mouthGeom = new THREE.CubeGeometry(1, 1, 0.5, 1); + this.mouth = new THREE.Mesh(mouthGeom, blackMat); + this.mouth.position.z = 3.5; + this.mouth.position.y = -1.5; + this.head.add(this.mouth); + + this.mesh.add(this.body); + this.body.add(this.head); + this.head.add(this.nose); + + this.mesh.traverse(function (object) { + if (object instanceof THREE.Mesh) { + object.castShadow = true; + object.receiveShadow = true; + } + }); +}; + +Hedgehog.prototype.nod = function () { + var _this = this; + var speed = 0.1 + Math.random() * 0.5; + var angle = -Math.PI / 4 + (Math.random() * Math.PI) / 2; + TweenMax.to(this.head.rotation, speed, { + y: angle, + onComplete: function () { + _this.nod(); + }, + }); +}; + +function createHero() { + hero = new Hero(); + hero.mesh.rotation.y = Math.PI / 2; + scene.add(hero.mesh); + hero.nod(); +} + +function createMonster() { + monster = new Monster(); + monster.mesh.position.z = 20; + //monster.mesh.scale.set(1.2,1.2,1.2); + scene.add(monster.mesh); + updateMonsterPosition(); +} + +function updateMonsterPosition() { + monster.run(); + monsterPosTarget -= delta * monsterAcceleration; + monsterPos += (monsterPosTarget - monsterPos) * delta; + if (monsterPos < 0.56) { + gameOver(); + } + + var angle = Math.PI * monsterPos; + monster.mesh.position.y = -floorRadius + Math.sin(angle) * (floorRadius + 12); + monster.mesh.position.x = Math.cos(angle) * (floorRadius + 15); + monster.mesh.rotation.z = -Math.PI / 2 + angle; +} + +function gameOver() { + fieldGameOver.className = "show"; + gameStatus = "gameOver"; + monster.sit(); + hero.hang(); + monster.heroHolder.add(hero.mesh); + TweenMax.to(this, 1, { speed: 0 }); + TweenMax.to(camera.position, 3, { z: cameraPosGameOver, y: 60, x: -30 }); + carrot.mesh.visible = false; + obstacle.mesh.visible = false; + clearInterval(levelInterval); +} + +function replay() { + gameStatus = "preparingToReplay"; + + fieldGameOver.className = ""; + + TweenMax.killTweensOf(monster.pawFL.position); + TweenMax.killTweensOf(monster.pawFR.position); + TweenMax.killTweensOf(monster.pawBL.position); + TweenMax.killTweensOf(monster.pawBR.position); + + TweenMax.killTweensOf(monster.pawFL.rotation); + TweenMax.killTweensOf(monster.pawFR.rotation); + TweenMax.killTweensOf(monster.pawBL.rotation); + TweenMax.killTweensOf(monster.pawBR.rotation); + + TweenMax.killTweensOf(monster.tail.rotation); + TweenMax.killTweensOf(monster.head.rotation); + TweenMax.killTweensOf(monster.eyeL.scale); + TweenMax.killTweensOf(monster.eyeR.scale); + + //TweenMax.killTweensOf(hero.head.rotation); + + monster.tail.rotation.y = 0; + + TweenMax.to(camera.position, 3, { + z: cameraPosGame, + x: 0, + y: 30, + ease: Power4.easeInOut, + }); + TweenMax.to(monster.torso.rotation, 2, { x: 0, ease: Power4.easeInOut }); + TweenMax.to(monster.torso.position, 2, { y: 0, ease: Power4.easeInOut }); + TweenMax.to(monster.pawFL.rotation, 2, { x: 0, ease: Power4.easeInOut }); + TweenMax.to(monster.pawFR.rotation, 2, { x: 0, ease: Power4.easeInOut }); + TweenMax.to(monster.mouth.rotation, 2, { x: 0.5, ease: Power4.easeInOut }); + + TweenMax.to(monster.head.rotation, 2, { + y: 0, + x: -0.3, + ease: Power4.easeInOut, + }); + + TweenMax.to(hero.mesh.position, 2, { x: 20, ease: Power4.easeInOut }); + TweenMax.to(hero.head.rotation, 2, { x: 0, y: 0, ease: Power4.easeInOut }); + TweenMax.to(monster.mouth.rotation, 2, { x: 0.2, ease: Power4.easeInOut }); + TweenMax.to(monster.mouth.rotation, 1, { + x: 0.4, + ease: Power4.easeIn, + delay: 1, + onComplete: function () { + resetGame(); + }, + }); +} + +Fir = function () { + var height = 200; + var truncGeom = new THREE.CylinderGeometry(2, 2, height, 6, 1); + truncGeom.applyMatrix(new THREE.Matrix4().makeTranslation(0, height / 2, 0)); + this.mesh = new THREE.Mesh(truncGeom, greenMat); + this.mesh.castShadow = true; +}; + +var firs = new THREE.Group(); + +function createFirs() { + var nTrees = 100; + for (var i = 0; i < nTrees; i++) { + var phi = (i * (Math.PI * 2)) / nTrees; + var theta = Math.PI / 2; + //theta += .25 + Math.random()*.3; + theta += + Math.random() > 0.05 + ? 0.25 + Math.random() * 0.3 + : -0.35 - Math.random() * 0.1; + + var fir = new Tree(); + fir.mesh.position.x = Math.sin(theta) * Math.cos(phi) * floorRadius; + fir.mesh.position.y = Math.sin(theta) * Math.sin(phi) * (floorRadius - 10); + fir.mesh.position.z = Math.cos(theta) * floorRadius; + + var vec = fir.mesh.position.clone(); + var axis = new THREE.Vector3(0, 1, 0); + fir.mesh.quaternion.setFromUnitVectors(axis, vec.clone().normalize()); + floor.add(fir.mesh); + } +} + +function createCarrot() { + carrot = new Carrot(); + scene.add(carrot.mesh); +} + +function updateCarrotPosition() { + carrot.mesh.rotation.y += delta * 6; + carrot.mesh.rotation.z = Math.PI / 2 - (floorRotation + carrot.angle); + carrot.mesh.position.y = + -floorRadius + Math.sin(floorRotation + carrot.angle) * (floorRadius + 50); + carrot.mesh.position.x = + Math.cos(floorRotation + carrot.angle) * (floorRadius + 50); +} + +function updateObstaclePosition() { + if (obstacle.status == "flying") return; + + // TODO fix this, + if (floorRotation + obstacle.angle > 2.5) { + obstacle.angle = -floorRotation + Math.random() * 0.3; + obstacle.body.rotation.y = Math.random() * Math.PI * 2; + } + + obstacle.mesh.rotation.z = floorRotation + obstacle.angle - Math.PI / 2; + obstacle.mesh.position.y = + -floorRadius + Math.sin(floorRotation + obstacle.angle) * (floorRadius + 3); + obstacle.mesh.position.x = + Math.cos(floorRotation + obstacle.angle) * (floorRadius + 3); +} + +function updateFloorRotation() { + floorRotation += delta * 0.03 * speed; + floorRotation = floorRotation % (Math.PI * 2); + floor.rotation.z = floorRotation; +} + +function createObstacle() { + obstacle = new Hedgehog(); + obstacle.body.rotation.y = -Math.PI / 2; + obstacle.mesh.scale.set(1.1, 1.1, 1.1); + obstacle.mesh.position.y = floorRadius + 4; + obstacle.nod(); + scene.add(obstacle.mesh); +} + +function createBonusParticles() { + bonusParticles = new BonusParticles(); + bonusParticles.mesh.visible = false; + scene.add(bonusParticles.mesh); +} + +function checkCollision() { + var db = hero.mesh.position.clone().sub(carrot.mesh.position.clone()); + var dm = hero.mesh.position.clone().sub(obstacle.mesh.position.clone()); + + if (db.length() < collisionBonus) { + getBonus(); + } + + if (dm.length() < collisionObstacle && obstacle.status != "flying") { + getMalus(); + } +} + +function getBonus() { + bonusParticles.mesh.position.copy(carrot.mesh.position); + bonusParticles.mesh.visible = true; + bonusParticles.explose(); + carrot.angle += Math.PI / 2; + //speed*=.95; + monsterPosTarget += 0.025; +} + +function getMalus() { + obstacle.status = "flying"; + var tx = + Math.random() > 0.5 ? -20 - Math.random() * 10 : 20 + Math.random() * 5; + TweenMax.to(obstacle.mesh.position, 4, { + x: tx, + y: Math.random() * 50, + z: 350, + ease: Power4.easeOut, + }); + TweenMax.to(obstacle.mesh.rotation, 4, { + x: Math.PI * 3, + z: Math.PI * 3, + y: Math.PI * 6, + ease: Power4.easeOut, + onComplete: function () { + obstacle.status = "ready"; + obstacle.body.rotation.y = Math.random() * Math.PI * 2; + obstacle.angle = -floorRotation - Math.random() * 0.4; + + obstacle.angle = obstacle.angle % (Math.PI * 2); + obstacle.mesh.rotation.x = 0; + obstacle.mesh.rotation.y = 0; + obstacle.mesh.rotation.z = 0; + obstacle.mesh.position.z = 0; + }, + }); + // + monsterPosTarget -= 0.04; + TweenMax.from(this, 0.5, { + malusClearAlpha: 0.5, + onUpdate: function () { + renderer.setClearColor(malusClearColor, malusClearAlpha); + }, + }); +} + +function updateDistance() { + distance += delta * speed; + var d = distance / 2; + fieldDistance.innerHTML = Math.floor(d); +} + +function updateLevel() { + if (speed >= maxSpeed) return; + level++; + speed += 2; +} + +function loop() { + delta = clock.getDelta(); + updateFloorRotation(); + + if (gameStatus == "play") { + if (hero.status == "running") { + hero.run(); + } + updateDistance(); + updateMonsterPosition(); + updateCarrotPosition(); + updateObstaclePosition(); + checkCollision(); + } + + render(); + requestAnimationFrame(loop); +} + +function render() { + renderer.render(scene, camera); +} + +window.addEventListener("load", init, false); + +function init(event) { + initScreenAnd3D(); + createLights(); + createFloor(); + createHero(); + createMonster(); + createFirs(); + createCarrot(); + createBonusParticles(); + createObstacle(); + initUI(); + resetGame(); + loop(); + + //setInterval(hero.blink.bind(hero), 3000); +} + +function resetGame() { + scene.add(hero.mesh); + hero.mesh.rotation.y = Math.PI / 2; + hero.mesh.position.y = 0; + hero.mesh.position.z = 0; + hero.mesh.position.x = 0; + + monsterPos = 0.56; + monsterPosTarget = 0.65; + speed = initSpeed; + level = 0; + distance = 0; + carrot.mesh.visible = true; + obstacle.mesh.visible = true; + gameStatus = "play"; + hero.status = "running"; + hero.nod(); + audio.play(); + updateLevel(); + levelInterval = setInterval(updateLevel, levelUpdateFreq); +} + +function initUI() { + fieldDistance = document.getElementById("distValue"); + fieldGameOver = document.getElementById("gameoverInstructions"); +} + +//////////////////////////////////////////////// +// MODELS +//////////////////////////////////////////////// + +// TREE + +Tree = function () { + this.mesh = new THREE.Object3D(); + this.trunc = new Trunc(); + this.mesh.add(this.trunc.mesh); +}; + +Trunc = function () { + var truncHeight = 50 + Math.random() * 150; + var topRadius = 1 + Math.random() * 5; + var bottomRadius = 5 + Math.random() * 5; + var mats = [ + blackMat, + brownMat, + pinkMat, + whiteMat, + greenMat, + lightBrownMat, + pinkMat, + ]; + var matTrunc = blackMat; //mats[Math.floor(Math.random()*mats.length)]; + var nhSegments = 3; //Math.ceil(2 + Math.random()*6); + var nvSegments = 3; //Math.ceil(2 + Math.random()*6); + var geom = new THREE.CylinderGeometry( + topRadius, + bottomRadius, + truncHeight, + nhSegments, + nvSegments, + ); + geom.applyMatrix(new THREE.Matrix4().makeTranslation(0, truncHeight / 2, 0)); + + this.mesh = new THREE.Mesh(geom, matTrunc); + + for (var i = 0; i < geom.vertices.length; i++) { + var noise = Math.random(); + var v = geom.vertices[i]; + v.x += -noise + Math.random() * noise * 2; + v.y += -noise + Math.random() * noise * 2; + v.z += -noise + Math.random() * noise * 2; + + geom.computeVertexNormals(); + + // FRUITS + + if (Math.random() > 0.7) { + var size = Math.random() * 3; + var fruitGeometry = new THREE.CubeGeometry(size, size, size, 1); + var matFruit = mats[Math.floor(Math.random() * mats.length)]; + var fruit = new THREE.Mesh(fruitGeometry, matFruit); + fruit.position.x = v.x; + fruit.position.y = v.y + 3; + fruit.position.z = v.z; + fruit.rotation.x = Math.random() * Math.PI; + fruit.rotation.y = Math.random() * Math.PI; + + this.mesh.add(fruit); + } + + // BRANCHES + + if (Math.random() > 0.5 && v.y > 10 && v.y < truncHeight - 10) { + var h = 3 + Math.random() * 5; + var thickness = 0.2 + Math.random(); + + var branchGeometry = new THREE.CylinderGeometry( + thickness / 2, + thickness, + h, + 3, + 1, + ); + branchGeometry.applyMatrix( + new THREE.Matrix4().makeTranslation(0, h / 2, 0), + ); + var branch = new THREE.Mesh(branchGeometry, matTrunc); + branch.position.x = v.x; + branch.position.y = v.y; + branch.position.z = v.z; + + var vec = new THREE.Vector3(v.x, 2, v.z); + var axis = new THREE.Vector3(0, 1, 0); + branch.quaternion.setFromUnitVectors(axis, vec.clone().normalize()); + + this.mesh.add(branch); + } + } + + this.mesh.castShadow = true; +}; diff --git a/Games/Grab_The_Carrot/styles.css b/Games/Grab_The_Carrot/styles.css new file mode 100644 index 0000000000..56829774ea --- /dev/null +++ b/Games/Grab_The_Carrot/styles.css @@ -0,0 +1,100 @@ +@import url("https://fonts.googleapis.com/css?family=Voltaire"); + +#world { + position: absolute; + width: 100%; + height: 100%; + background-color: #dbe6e6; + overflow: hidden; +} + +#gameoverInstructions { + position: absolute; + font-family: "Voltaire", sans-serif; + font-weight: bold; + text-transform: uppercase; + font-size: 120px; + text-align: center; + color: #ffc5a2; + opacity: 0; + left: 50%; + top: 50%; + width: 100%; + transform: translate(-50%, -100%); + user-select: none; + transition: all 500ms ease-in-out; + + &.show { + opacity: 1; + transform: translate(-50%, -50%); + transition: all 500ms ease-in-out; + } +} + +#dist { + position: absolute; + left: 50%; + top: 50px; + transform: translate(-50%, 0%); + user-select: none; +} + +.label { + position: relative; + font-family: "Voltaire", sans-serif; + text-transform: uppercase; + color: #ffa873; + font-size: 12px; + letter-spacing: 2px; + text-align: center; + margin-bottom: 5px; +} + +#distValue { + position: relative; + text-transform: uppercase; + color: #dc5f45; + font-size: 40px; + font-family: "Voltaire"; + text-align: center; +} + +#credits { + position: absolute; + width: 100%; + margin: auto; + bottom: 0; + margin-bottom: 20px; + font-family: "Voltaire", sans-serif; + color: #544027; + font-size: 12px; + letter-spacing: 0.5px; + text-transform: uppercase; + text-align: center; + user-select: none; +} +#credits a { + color: #544027; +} + +#credits a:hover { + color: #dc5f45; +} + +#instructions { + position: absolute; + width: 100%; + bottom: 0; + margin: auto; + margin-bottom: 50px; + font-family: "Voltaire", sans-serif; + color: #dc5f45; + font-size: 16px; + letter-spacing: 1px; + text-transform: uppercase; + text-align: center; + user-select: none; +} +.lightInstructions { + color: #5f9042; +} diff --git a/Games/Gravity_Simulation_Game/README.md b/Games/Gravity_Simulation_Game/README.md new file mode 100644 index 0000000000..a20659d485 --- /dev/null +++ b/Games/Gravity_Simulation_Game/README.md @@ -0,0 +1,15 @@ +# **Gravity_Simulation_Game** + +## **Description ๐Ÿ“ƒ** +Observe and Differentiate between the gravitational fields of Sun, Mercury, Venus, Earth, Moon, Mars, Jupiter, Saturn, Uranus, Neptune and Pluto. +
+## **How to play? ๐Ÿ•น๏ธ** +First the user needs to select a celestial body of our solar system among the given options. Then a simulation of various balls of various shapes and colors colliding with each other and jumping under the influence of gravity is shown, until all the balls come at rest at the floor. +This way user can feel and enjoy the diverse gravitation of the planetary bodies our solar system. +
+## **Screenshots ๐Ÿ“ธ** +![ss5](https://github.com/Sara1428/GameZone/assets/146193518/eec47058-4532-49e3-8cbe-2f1893fd5ad4) +
+## **Working video ๐Ÿ“น** +https://github.com/Sara1428/GameZone/assets/146193518/8bfecb13-40d2-4d5e-b7e4-e47325c60293 + diff --git a/Games/Gravity_Simulation_Game/index.html b/Games/Gravity_Simulation_Game/index.html new file mode 100644 index 0000000000..7e1b92f56f --- /dev/null +++ b/Games/Gravity_Simulation_Game/index.html @@ -0,0 +1,32 @@ + + + + + + + +

Enjoy Gravity !

+

Select a Celestial Body from below

+
+ Sun + Mercury + Venus + Earth + Moon + Mars + Jupiter + Saturn + Uranus + Neptune + Pluto +
+
+ +
+
+ +

+ + + + \ No newline at end of file diff --git a/Games/Gravity_Simulation_Game/script.js b/Games/Gravity_Simulation_Game/script.js new file mode 100644 index 0000000000..f618b90529 --- /dev/null +++ b/Games/Gravity_Simulation_Game/script.js @@ -0,0 +1,153 @@ +// Learn to code this at: +// https://www.youtube.com/watch?v=3b7FyIxWW94 + +// Initial Setup +document.getElementById('bt').addEventListener('click', function(){ + location.reload(); +}) +document.getElementById('btn').addEventListener('click', function(){ + location.reload(); +}) +document.getElementById('b').addEventListener('click', function(){ +var canvas = document.querySelector('canvas'); +var c = canvas.getContext('2d'); + +canvas.width = innerWidth; +canvas.height = innerHeight/2; + + +// Variables +var mouse = { + x: innerWidth / 2, + y: innerHeight / 2 +}; + +var colors = [ + 'rgb(235, 1, 40)', + 'white', + 'black', + 'pink' +]; + +var gravity = 0.2; +var x = document.getElementsByName('opt'); +var friction = 0.98; +if(x[0].checked) + gravity=27.4; +if(x[1].checked) + gravity=0.37; +if(x[2].checked) + gravity=0.89; +if(x[3].checked) + gravity=0.98; +if(x[4].checked) + gravity=0.162; +if(x[5].checked) + gravity=0.37; +if(x[6].checked) + gravity=2.31; +if(x[7].checked) + gravity=0.9; +if(x[8].checked) + gravity=0.87; +if(x[9].checked) + gravity=1.1; +if(x[10].checked) + gravity=0.07; + +document.getElementById('dd').style.display='none'; +addEventListener("mousemove", function(event) { + mouse.x = event.clientX; + mouse.y = event.clientY; +}); + +addEventListener("resize", function() { + canvas.width = innerWidth; + canvas.height = innerHeight; + init(); +}); + +addEventListener("click", function(event) { + init(); +}); + + +// Utility Functions +function randomIntFromRange(min,max) { + return Math.floor(Math.random() * (max - min + 1) + min); +} + +function randomColor(colors) { + return colors[Math.floor(Math.random() * colors.length)]; +} + + +// Objects +function Ball(x, y, dx, dy, radius, color) { + this.x = x; + this.y = y; + this.dx = dx; + this.dy = dy; + this.radius = radius; + this.color = color; + + this.update = function() { + if (this.y + this.radius + this.dy> canvas.height) { + this.dy = -this.dy; + this.dy = this.dy * friction; + this.dx = this.dx * friction; + } else { + this.dy += gravity; + } + + if (this.x + this.radius >= canvas.width || this.x - this.radius <= 0) { + this.dx = -this.dx * friction; + } + + this.x += this.dx; + this.y += this.dy; + this.draw(); + }; + + this.draw = function() { + c.beginPath(); + c.arc(this.x, this.y, this.radius, 0, Math.PI * 2, false); + c.fillStyle = this.color; + c.fill(); + c.stroke(); + c.closePath(); + }; +} + + +// Implementation +var ballArray = []; + +function init() { + ballArray = []; + + for (let i = 0; i < 600; i++) { + var radius = randomIntFromRange(8, 20); + var x = randomIntFromRange(radius, canvas.width - radius); + var y = randomIntFromRange(0, canvas.height - radius); + var dx = randomIntFromRange(-3, 3) + var dy = randomIntFromRange(-2, 2) + ballArray.push(new Ball(x, y, dx, dy, radius, randomColor(colors))); + } +} + +// Animation Loop +function animate() { + requestAnimationFrame(animate); + + c.clearRect(0, 0, canvas.width, canvas.height); + + for (let i = 0; i < ballArray.length; i++) { + ballArray[i].update(); + } +} + +init(); +animate(); +} +) \ No newline at end of file diff --git a/Games/Gravity_Simulation_Game/style.css b/Games/Gravity_Simulation_Game/style.css new file mode 100644 index 0000000000..424932852d --- /dev/null +++ b/Games/Gravity_Simulation_Game/style.css @@ -0,0 +1,78 @@ +/* body { + margin: 0; + overflow: hidden; + } */ + + @media only screen and (min-width: 600px) { + canvas{ + margin: auto; + } +h1,h3{ + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; + text-align: center; + color: rgb(243, 63, 63); +} +#dd{ + color: rgb(245, 53, 53); + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; + font-size: 1em; + padding: 0px 260px; +} +input{ + accent-color: rgb(240, 61, 91); +} + + +button{ + display: block; + margin: auto; + margin-bottom: 0px; + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; + border: 2px solid rgb(235, 1, 40); + background-color: white; + cursor: pointer; + transition-duration: 0.5s; +} + +button:hover{ + background-color: rgb(236, 36, 36); + color: white; +} + } + + @media only screen and (max-width: 600px) { + canvas{ + margin: auto; + } + h1,h3{ + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; + text-align: center; + color: rgb(243, 63, 63); + } + #dd{ + color: rgb(245, 53, 53); + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; + font-size: 1em; + padding: 0px; + } + input{ + accent-color: rgb(240, 61, 91); + } + + + button{ + display: block; + margin: auto; + margin-bottom: 0px; + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; + border: 2px solid rgb(235, 1, 40); + background-color: white; + cursor: pointer; + transition-duration: 0.5s; + } + + button:hover{ + background-color: rgb(236, 36, 36); + color: white; + } + } diff --git a/Games/Guess_The_Song/Demo.mp4 b/Games/Guess_The_Song/Demo.mp4 new file mode 100644 index 0000000000..5aa1c7c769 Binary files /dev/null and b/Games/Guess_The_Song/Demo.mp4 differ diff --git a/Games/Guess_The_Song/README.md b/Games/Guess_The_Song/README.md new file mode 100644 index 0000000000..e9518b6547 --- /dev/null +++ b/Games/Guess_The_Song/README.md @@ -0,0 +1,36 @@ +# **Guess_The_Song** + +--- + +
+ +## **Description ๐Ÿ“ƒ** + +Guess the Song is the song guessing game where the hint is provided to the user in form of emoji and get 5 Chances to user to get the desired answer. This game contribute in out of the box thinking regarding any guessing. + +## **functionalities ๐ŸŽฎ** + +Guess The Song is game that contribute to think regarding the song in deeper manner in order to get proper or desired result. The song should be guessed in 5 Chances by consider the hint. +- +
+ +## **How to play? ๐Ÿ•น๏ธ** +Step 1 : Enter the Letter. +Step 2 : If letter matches the desired output will shown on the screen. +Step 3 : If Letter doen't match with the desired output it won't shown on screen and the chance will get decrement by one. +Step 4 : Their will be 5 Chances and all are taken then the player will loss the match. +Step 5 : Otherwise the Player will win + +
+ +## **Screenshots ๐Ÿ“ธ** + +
+ +![image](/assets/images/Guess_The_Song.png) + + +
+ +## **Working video ๐Ÿ“น** +![video](/Games/Guess_The_Song/Demo.mp4) diff --git a/Games/Guess_The_Song/index.html b/Games/Guess_The_Song/index.html new file mode 100644 index 0000000000..e45432aa3c --- /dev/null +++ b/Games/Guess_The_Song/index.html @@ -0,0 +1,31 @@ + + + + + + Emoji Movie Quiz + + + + + + +
+

Emoji Movie Quiz

+

Mixture of Hollywood and Bollywood Songs..๐ŸŽถ๐ŸŽถ

+
+ Tries Left: 05 +
+
+
+
+ +
+ + + + + diff --git a/Games/Guess_The_Song/script.js b/Games/Guess_The_Song/script.js new file mode 100644 index 0000000000..765f4018be --- /dev/null +++ b/Games/Guess_The_Song/script.js @@ -0,0 +1,125 @@ +const moviesObject = { + "๐ŸŽธ๐ŸŽค๐Ÿ”ฅ": "We Will Rock You", + "๐Ÿ‘ถ๐Ÿ‘ถ": "Baby", + "๐Ÿ’ƒ๐Ÿ•บ": "Despacito", + "๐ŸŒง๏ธโ˜”": "Purple Rain", + "๐ŸŽ…๐Ÿ ": "Santa Claus is Coming to Town", + "๐Ÿ˜ข๐ŸŽค": "Crying", + "๐ŸŒง๏ธ๐ŸŒง๏ธ๐Ÿ”ฅ": "Tip Tip Barsa Pani", + "๐Ÿ˜œ๐Ÿ‘ฉ๐Ÿป๐Ÿ˜œ": "Aankh Maare", + "๐Ÿ‘๏ธโšซ": "Yeh Kaali Kaali Aankhen", + "๐Ÿ’ƒ๐Ÿฝ๐Ÿ’": "London Thumakda", + "๐ŸŒŸ๐ŸŒ›": "Chand Sifarish", + "๐Ÿ๏ธ๐Ÿ๏ธ๐Ÿ๏ธ": "Dhoom Machale", + "๐Ÿ˜Š": "Smile", + "๐Ÿฅณ๐Ÿฅณ๐Ÿฅณ": "Happy Birthday", + "๐Ÿ›๏ธ๐Ÿ‘ฆ": "Bad Guy", + "๐Ÿ•บ๐Ÿ’": "Dance Monkey", + "๐Ÿ‘ป": "Ghots", + "โญ๐Ÿค˜": "Rockstar", + "๐Ÿš€๐Ÿ‘ถ": "Rocket Man", + "๐ŸŽ…๐Ÿ‘ถ": "Santa Baby", +}; +const container = document.querySelector(".container"); +const startButton = document.getElementById("start"); +const letterContainer = document.getElementById("letter-container"); +const resultContainer = document.querySelector(".result-container"); +const userInputSection = document.getElementById("userInputSection"); +const resultText = document.getElementById("result"); +const hints = Object.keys(moviesObject); +let randomHint = "", +randomWord = ""; +let winCount = 0, +lossCount = 5; + +const generateRandomValue = (array) => Math.floor(Math.random() * array.length); + +// Blocker +const blocker = () => { + let letterButtons = document.querySelectorAll(".letters"); + letterButtons.forEach((button) => { + button.disabled = true; + }); +}; + +// Start game +const startGame = () => { + init(); +}; + +// Generate Word +const generateWord = () => { + letterContainer.classList.remove("hide"); + userInputSection.innerText = ""; + randomHint = hints[generateRandomValue(hints)]; + randomWord = moviesObject[randomHint]; + container.innerHTML = `
${randomHint}
`; + let displayItem = ""; + randomWord.split("").forEach((value) => { + if (value == " ") { + winCount += 1; + displayItem += ` `; + } else { + displayItem += `_`; + } + }); + userInputSection.innerHTML = displayItem; +}; + +// Initial Function +const init = () => { + winCount = 0; + lossCount = 5; + document.getElementById( + "chanceCount" + ).innerHTML = `Tries Left: ${lossCount}`; + randomHint = null; + randomWord = ""; + userInputSection.innerHTML = ""; + letterContainer.classList.add("hide"); + letterContainer.innerHTML = ""; + generateWord(); + for (let i = 65; i < 91; i++) { + let button = document.createElement("button"); + button.classList.add("letters"); + // Number to ASCII [A - Z] + button.innerText = String.fromCharCode(i); + // Character button click + button.addEventListener("click", () => { + let charArray = randomWord.toUpperCase().split(""); + let inputSpace = document.getElementsByClassName("inputSpace"); + if (charArray.includes(button.innerText)) { + charArray.forEach((char, index) => { + if (char === button.innerText) { + button.classList.add("used"); + inputSpace[index].innerText = char; + winCount += 1; + if (winCount == charArray.length) { + resultText.innerHTML = "You Won"; + resultContainer.style.display = ''; + blocker(); + } + } + }); + } else { + lossCount -= 1; + document.getElementById( + "chanceCount" + ).innerHTML = `Tries Left: ${lossCount}`; + button.classList.add("used"); + if (lossCount == 0) { + resultText.innerHTML = "Game Over"; + blocker(); + resultContainer.style.display = ''; + letterContainer.classList.add("hide"); + } + } + button.disabled = true; + }); + letterContainer.appendChild(button); + } +}; + +window.onload = () => { + startGame(); +}; diff --git a/Games/Guess_The_Song/style.css b/Games/Guess_The_Song/style.css new file mode 100644 index 0000000000..8ccbdac850 --- /dev/null +++ b/Games/Guess_The_Song/style.css @@ -0,0 +1,113 @@ +@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500&display=swap'); + +* { + margin: 0; + padding: 0; + font-family: 'Poppins', sans-serif; +} + +body { + background-image: linear-gradient(to right, #868f96 0%, #596164 100%); + background-repeat: no-repeat; + background-attachment: fixed; + display: flex; + justify-content: center; + align-items: center; + height: 100vh; +} + +.wrapper { + position: absolute; + transform: translate(-50%, -50%); + left: 50%; + top: 50%; + width: 100%; + max-width: 600px; + background-color: #ffffff; + padding: 5em 3em; + border-radius: 0.8em; + box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px; +} + +.wrapper > h1 { + font-size: 50px; +} + +.num-of-tries-left { + text-align: center; + margin-bottom: 2em; +} + +.num-of-tries-left span { + font-weight: 600; + font-size: 20px; +} + +.container { + font-size: 1.87em; + display: flex; + justify-content: space-around; +} + +#letter-container { + margin: 2em 0 1em 0; + display: flex; + flex-wrap: wrap; + justify-content: center; + gap: 10px; +} + +.letters { + width: 2em; + height: 2em; + background-color: #ffffff; + border: 2px solid #596164; + border-radius: 0.3em; + color: #596164; + font-size: 22px; + cursor: pointer; +} + +#userInputSection { + display: flex; + justify-content: center; + gap: 0.5em; + font-size: 30px; +} + +.controls-container { + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + background-image: linear-gradient(to right, #868f96 0%, #596164 100%); + height: 100vh; + width: 100vw; +} + +#start:active { + box-shadow: 0 0 #000000; + transform: translateY(7px); +} + +.hide { + display: none; +} + +.used { + background-color: #f5f5f5; + border-color: #9e9ea6; + color: #9e9ea6; +} + +.result-container > button { + font-size: 20px; + padding: 5px 20px; + border-radius: 5px; + border: none; + outline: none; + background-color: #9e9ea6; + color: rgb(255, 255, 255); + box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px; + margin-top: 20px; +} \ No newline at end of file diff --git a/Games/Hit_the_hamster/README.md b/Games/Hit_the_hamster/README.md new file mode 100644 index 0000000000..d325e0da36 --- /dev/null +++ b/Games/Hit_the_hamster/README.md @@ -0,0 +1,29 @@ +# **Game_Name** + +Hit_the_hamster + +
+ +## **Description ๐Ÿ“ƒ** +A game in which you have to hit maximum number of hamster popping out within a given time frame of 30sec. +- + +## **functionalities ๐ŸŽฎ** +Made using HTML CSS and JS click on hamster to score a point. +- +
+ +## **How to play? ๐Ÿ•น๏ธ** +Click on hamster to score as much as you can +- + +
+ +## **Screenshots ๐Ÿ“ธ** + +
+ +![Alt text](../../assets/images/Hit_the_hamster_game.png) +
+ +## **Working video ๐Ÿ“น** diff --git a/Games/Hit_the_hamster/images/Hit_the_hamster.webp b/Games/Hit_the_hamster/images/Hit_the_hamster.webp new file mode 100644 index 0000000000..6499e75e40 Binary files /dev/null and b/Games/Hit_the_hamster/images/Hit_the_hamster.webp differ diff --git a/Games/Hit_the_hamster/images/Hit_the_hamster_board.webp b/Games/Hit_the_hamster/images/Hit_the_hamster_board.webp new file mode 100644 index 0000000000..2704d6e113 Binary files /dev/null and b/Games/Hit_the_hamster/images/Hit_the_hamster_board.webp differ diff --git a/Games/Hit_the_hamster/index.html b/Games/Hit_the_hamster/index.html new file mode 100644 index 0000000000..204051ff10 --- /dev/null +++ b/Games/Hit_the_hamster/index.html @@ -0,0 +1,30 @@ + + + + + + Hit the Hamster + + + + +
+



+

HIT THE HAMSTER

+
+ +
+
+
+
+ Score: 0 +
+
+ Time: 30s +
+
+

Just click with cursor to beat the hamster.

+
+ + + diff --git a/Games/Hit_the_hamster/script.js b/Games/Hit_the_hamster/script.js new file mode 100644 index 0000000000..aa64bf3679 --- /dev/null +++ b/Games/Hit_the_hamster/script.js @@ -0,0 +1,61 @@ +document.addEventListener('DOMContentLoaded', () => { + const startButton = document.getElementById('start-button'); + const hamster = document.getElementById('hamster'); + const scoreBoard = document.getElementById('score'); + const timerDisplay = document.getElementById('time'); + + let score = 0; + let timeLeft = 30; // 30 seconds timer + let gameInterval; + let timerInterval; + + hamster.style.display = 'none'; // Hide hamster initially + + startButton.addEventListener('click', startGame); + + hamster.addEventListener('click', () => { + score += 1; + scoreBoard.textContent = `Score: ${score}`; + moveHamster(); + }); + + function moveHamster() { + const gridContainer = document.getElementById('grid-container'); + const cellWidth = gridContainer.clientWidth / 6; + const cellHeight = gridContainer.clientHeight / 6; + + const randomX = Math.floor(Math.random() * 6) * cellWidth; + const randomY = Math.floor(Math.random() * 6) * cellHeight; + + hamster.style.left = `${randomX + (cellWidth - hamster.clientWidth) / 2}px`; + hamster.style.top = `${randomY + (cellHeight - hamster.clientHeight) / 2}px`; + } + + function startGame() { + score = 0; + timeLeft = 30; + scoreBoard.textContent = `Score: ${score}`; + timerDisplay.textContent = `Time: ${timeLeft}s`; + hamster.style.display = 'block'; // Show hamster + + moveHamster(); + + gameInterval = setInterval(moveHamster, 1000); // move the hamster every second + timerInterval = setInterval(updateTimer, 1000); // update the timer every second + + startButton.disabled = true; // Disable start button during the game + } + + function updateTimer() { + timeLeft -= 1; + timerDisplay.textContent = `Time: ${timeLeft}s`; + + if (timeLeft <= 0) { + clearInterval(gameInterval); + clearInterval(timerInterval); + hamster.style.display = 'none'; // Hide hamster when game ends + alert(`Game over! Your score is ${score}.`); + startButton.disabled = false; // Enable start button for a new game + } + } +}); diff --git a/Games/Hit_the_hamster/style.css b/Games/Hit_the_hamster/style.css new file mode 100644 index 0000000000..f705483e2c --- /dev/null +++ b/Games/Hit_the_hamster/style.css @@ -0,0 +1,80 @@ +body { + display: flex; + justify-content: center; + align-items: center; + height: 100vh; + margin: 0; + background-color: #f0f0f0; +} + + +#game { + position: relative; + width: 600px; + height: 600px; + border: 2px solid #000; + background-color: #fff; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} +h1{ + text-align: center; +} +#start-button { + margin-bottom: 20px; + padding: 10px 20px; + font-size: 16px; + cursor: pointer; +} + +#grid-container { + display: grid; + grid-template-columns: repeat(6, 1fr); + grid-template-rows: repeat(6, 1fr); + width: 100%; + height: 100%; + position: relative; + background-image: url(https://imgs.search.brave.com/Olfjz7my7Tl7hvVpjejD28AJOxuPDwRJ3oMVZ84Svr0/rs:fit:860:0:0/g:ce/aHR0cHM6Ly9pbnNw/aXJpbmdzdG9yeXMu/Y29tL3dwLWNvbnRl/bnQvdXBsb2Fkcy8y/MDIxLzA1L3RoZS1i/bGFjay1kb3Qtc3Rv/cnktNzUweDQ2MC5q/cGc); + background-size:100px 92px; +} + +#hamster { + width: 80px; + height: 80px; + background-image: url(https://imgs.search.brave.com/EOauzPsAeNtSn9zznwYBgfRiUU7tNPkZuHVtQnxf8gA/rs:fit:860:0:0/g:ce/aHR0cHM6Ly9pbWcu/ZnJlZXBpay5jb20v/cHJlbWl1bS1waG90/by9jbG9zZS11cC1o/YW1zdGVyLXdpdGgt/YnJvd24tZmFjZS1i/cm93bi1leWVzLWdl/bmVyYXRpdmUtYWlf/OTU4MTY1LTkwODA4/LmpwZz9zaXplPTYy/NiZleHQ9anBn); + background-size:cover; + border-radius: 50%; + position: absolute; + cursor: pointer; + transition: transform 0.2s ease; +} + +#hamster:active { + transform: scale(0.8); +} + +#score-board { + position: absolute; + top: 10px; + left: 10px; + font-size: 20px; + font-weight: bold; +} + +#timer { + position: absolute; + top: 10px; + right: 10px; + font-size: 20px; + font-weight: bold; +} +p{ + font-size: 25px; + text-align: center; + margin-top: 20px; + color: rgb(238, 88, 88); + font-weight: bold; + +} \ No newline at end of file diff --git a/Games/Intellect_Quest/README.md b/Games/Intellect_Quest/README.md new file mode 100644 index 0000000000..14d5b93b8a --- /dev/null +++ b/Games/Intellect_Quest/README.md @@ -0,0 +1,27 @@ +### ๐ŸŽฎ Game Request + +

Game logic and basic description:

+ +
  • This game is created with the help of html, css and javascript.
  • +
  • You can play whenever and wherever you want
  • +
  • You will get to know the correct answer of every question once you answer it
  • + + +### Point down the features + +

    Game points

    + +
      +
    1. Answer the questions
    2. +
    3. Show correct answer with green, and wrong answers with red
    4. +
    5. Option to go to next question
    6. +
    + + +### Select The Game Type + +Single Player + +### Pictures + +![Game screen](https://github.com/kunjgit/GameZone/assets/138088550/79592ab5-f2dd-412f-8f74-286dbb147108) \ No newline at end of file diff --git a/Games/Intellect_Quest/index.html b/Games/Intellect_Quest/index.html new file mode 100644 index 0000000000..64c13f82c9 --- /dev/null +++ b/Games/Intellect_Quest/index.html @@ -0,0 +1,29 @@ + + + + + + + Intellect Quest + + + + +
    +

    Intellect Quest

    +
    +
    +
    +
    + +
    +

    Your Score:

    + +
    +
    Loading...
    +
    + + + + + \ No newline at end of file diff --git a/Games/Intellect_Quest/script.js b/Games/Intellect_Quest/script.js new file mode 100644 index 0000000000..f2a7f0ae84 --- /dev/null +++ b/Games/Intellect_Quest/script.js @@ -0,0 +1,112 @@ +const questionContainer = document.getElementById('question-container'); +const questionElement = document.getElementById('question'); +const answerButtonsElement = document.getElementById('answer-buttons'); +const nextButton = document.getElementById('next-button'); +const resultContainer = document.getElementById('result-container'); +const scoreElement = document.getElementById('score'); +const restartButton = document.getElementById('restart-button'); +const loader = document.getElementById('loader'); + +let questions = []; +let currentQuestionIndex, score; + +async function fetchQuestions() { + loader.classList.remove('hide'); + try { + const response = await fetch('https://opentdb.com/api.php?amount=10&type=multiple'); + const data = await response.json(); + questions = data.results.map((question) => { + const formattedQuestion = { + question: question.question, + answers: [...question.incorrect_answers.map(answer => ({ text: answer, correct: false }))] + }; + formattedQuestion.answers.push({ text: question.correct_answer, correct: true }); + return formattedQuestion; + }); + startQuiz(); + } catch (error) { + console.error('Error fetching questions:', error); + } finally { + loader.classList.add('hide'); + } +} + +function startQuiz() { + currentQuestionIndex = 0; + score = 0; + resultContainer.classList.add('hide'); + nextButton.classList.remove('hide'); + questionContainer.classList.remove('hide'); + setNextQuestion(); +} + +function setNextQuestion() { + resetState(); + showQuestion(questions[currentQuestionIndex]); +} + +function showQuestion(question) { + questionElement.innerHTML = question.question; + question.answers.forEach(answer => { + const button = document.createElement('button'); + button.innerText = answer.text; + button.classList.add('btn'); + if (answer.correct) { + button.dataset.correct = answer.correct; + } + button.addEventListener('click', selectAnswer); + answerButtonsElement.appendChild(button); + }); +} + +function resetState() { + nextButton.classList.add('hide'); + while (answerButtonsElement.firstChild) { + answerButtonsElement.removeChild(answerButtonsElement.firstChild); + } +} + +function selectAnswer(e) { + const selectedButton = e.target; + const correct = selectedButton.dataset.correct === 'true'; + if (correct) { + score++; + } + Array.from(answerButtonsElement.children).forEach(button => { + setStatusClass(button, button.dataset.correct === 'true'); + }); + nextButton.classList.remove('hide'); +} + +function setStatusClass(element, correct) { + clearStatusClass(element); + if (correct) { + element.classList.add('correct'); + } else { + element.classList.add('wrong'); + } +} + +function clearStatusClass(element) { + element.classList.remove('correct'); + element.classList.remove('wrong'); +} + +function showResult() { + questionContainer.classList.add('hide'); + resultContainer.classList.remove('hide'); + scoreElement.innerText = score; +} + +nextButton.addEventListener('click', () => { + if (questions.length > currentQuestionIndex + 1) { + currentQuestionIndex++; + setNextQuestion(); + } else { + showResult(); + } +}); + +restartButton.addEventListener('click', fetchQuestions); + +fetchQuestions(); \ No newline at end of file diff --git a/Games/Intellect_Quest/style.css b/Games/Intellect_Quest/style.css new file mode 100644 index 0000000000..b26c1cbc86 --- /dev/null +++ b/Games/Intellect_Quest/style.css @@ -0,0 +1,57 @@ +body { + font-family: Arial, sans-serif; + background: #f4f4f4; + display: flex; + justify-content: center; + align-items: center; + height: 100vh; + margin: 0; +} + +#quiz-container { + background: #fff; + border-radius: 5px; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); + width: 300px; + padding: 20px; + text-align: center; +} + +.btn { + background-color: #007BFF; + color: white; + border: none; + padding: 10px; + border-radius: 5px; + cursor: pointer; + margin-top: 10px; +} + +.btn:hover { + background-color: #0056b3; +} + +.btn-container { + display: flex; + flex-direction: column; +} + +.btn-container .btn { + margin: 5px 0; +} + +.hide { + display: none; +} + +.correct { + background-color: #28a745 !important; +} + +.wrong { + background-color: #dc3545 !important; +} + +#loader { + font-size: 18px; +} \ No newline at end of file diff --git a/Games/Love Calculator Game/README.md b/Games/Love Calculator Game/README.md new file mode 100644 index 0000000000..70335494f5 --- /dev/null +++ b/Games/Love Calculator Game/README.md @@ -0,0 +1,12 @@ + +# Love Calculator App + +![love-calculator](https://user-images.githubusercontent.com/72425181/124382212-e4d84e00-dce3-11eb-958a-8d82b6a05426.png) + +*This is a good-looking love calculator app. Love calculator is a fun application where friends and couples can calculate the percentage of love between them. Simple and interesting app to work on.* + +> Technologies used: + +- HTML +- CSS +- JAVASCRIPT diff --git a/Games/Love Calculator Game/heart.png b/Games/Love Calculator Game/heart.png new file mode 100644 index 0000000000..27f52bf764 Binary files /dev/null and b/Games/Love Calculator Game/heart.png differ diff --git a/Games/Love Calculator Game/index.html b/Games/Love Calculator Game/index.html new file mode 100644 index 0000000000..df32c5756c --- /dev/null +++ b/Games/Love Calculator Game/index.html @@ -0,0 +1,56 @@ + + + + + + + + + + + + Love Calculator + + + + + + +
    +

    Welcome to this great invention of Doctor Love!

    +

    We all know that a name can tell a lot about a person. Names are not randomly chosen: they all + have a meaning. Doctor Love knew this so he made another great invention just for the lonely you! + + Sometimes you'd like to know if a relationship with someone could work out. Therefore Doctor Love himself + designed this great machine for you. With The Love Calculator you can calculate the probability of a + successful relationship between two people. The Love Calculator is an affective way to get an impression of + what the chances are on a relationship between two people. + + To find out what the chances for you and your dream partner are, just fill in both full names (both first + and last name) in the two text boxes below, and press Calculate.

    + +
    +
    +
    +
    + +
    +
    +
    + +
    +
    + +
    + +
    +
    +
    + + + + + + \ No newline at end of file diff --git a/Games/Love Calculator Game/script.js b/Games/Love Calculator Game/script.js new file mode 100644 index 0000000000..4fcc4230bf --- /dev/null +++ b/Games/Love Calculator Game/script.js @@ -0,0 +1,10 @@ + +function calculateLove(){ + var random = Math.random(); + random = (random * 100) + 1; + random = Math.floor(random); + var p = document.createElement("p"); + var text = document.createTextNode(random + "%"); + p.appendChild(text); + document.getElementById("lovePercentage").appendChild(p); +} diff --git a/Games/Love Calculator Game/style.css b/Games/Love Calculator Game/style.css new file mode 100644 index 0000000000..f7064755b3 --- /dev/null +++ b/Games/Love Calculator Game/style.css @@ -0,0 +1,78 @@ +*{ + margin: 0; + padding: 0; + font-family: 'Lato', sans-serif; +} + +body{ + background-color: #eee; +} + +.logo{ + font-family: 'Dancing Script', cursive; + font-size: 39px; + color: red; + padding: 20px 70px; +} + +.wrapper{ + width: 70%; + margin: 0 auto; + text-align: center; + margin-top: 80px; +} + +.heading{ + font-size: 28px; + letter-spacing: 0.9px; + line-height: 54px; +} + +.about{ + font-size: 19px; + line-height: 30px; + text-align: left; +} + +.box{ + padding: 100px 0; + background-image: url('./heart.png'); + background-repeat: no-repeat; + background-size: contain; + background-position: 50% 60%; + opacity: 0.8; +} + +.flex-box{ + display: flex; + justify-content: space-around; +} + +.bold{ + font-weight: bold; + font-size: 17px; + letter-spacing: 0.7px; + +} + +input{ + padding: 20px 70px; + border: none; + border-radius: 35px; + +} + +button{ + padding: 15px 28px; + font-size: 20px; + border-radius: 30px; + background-image: linear-gradient(210deg, red, orange); + border: none; + color: #fff; + cursor: pointer; + +} + +#lovePercentage{ + font-size: 30px; +} \ No newline at end of file diff --git a/Games/Master_Typing/README.md b/Games/Master_Typing/README.md index a35a28d628..158e7a14d1 100644 --- a/Games/Master_Typing/README.md +++ b/Games/Master_Typing/README.md @@ -38,3 +38,4 @@ [Video](https://i.imgur.com/w56sUaV.mp4) [Video] (https://imgur.com/a/uxx8hlM) + diff --git a/Games/MathQuiz/Readme.md b/Games/MathQuiz/Readme.md new file mode 100644 index 0000000000..b6f45ec36d --- /dev/null +++ b/Games/MathQuiz/Readme.md @@ -0,0 +1,38 @@ +# **MathQuiz** + + +## **Description ๐Ÿ“ƒ** +It is a basic mathematical quiz. + + +
    + +## **Functionalities ๐ŸŽฎ** + +Player need to find the correct answer to the maximum number of questions within 30 seconds. + +
    + +## **How to play? ๐Ÿ•น๏ธ** + +1. Start the quiz on your preferred platform. +2. Click on the start button to start the quiz. +3. Your goal is to answer maximum number of questions within 30 seconds. + + +
    + +## **Installation** +1. Clone or download the repository. +2. Navigate to the downloaded repository. +3. Open index.html with live server. + + + + +
    + +## **Screenshots ๐Ÿ“ธ** + +
    +Game Screenshot diff --git a/Games/MathQuiz/index.html b/Games/MathQuiz/index.html new file mode 100644 index 0000000000..669af26fd4 --- /dev/null +++ b/Games/MathQuiz/index.html @@ -0,0 +1,26 @@ + + + + Math Quiz Game + + + +
    +

    Math Quiz Game

    +
    +

    Welcome to the Math Quiz Game! You have 30 seconds to answer as many questions as you can. Good luck!

    + +
    + +
    + + + + diff --git a/Games/MathQuiz/script.js b/Games/MathQuiz/script.js new file mode 100644 index 0000000000..01ebaf3432 --- /dev/null +++ b/Games/MathQuiz/script.js @@ -0,0 +1,78 @@ +let correctAnswers = 0; +let wrongAnswers = 0; +let currentQuestion; +let gameStarted = false; +let timer; +let timeLeft = 30; + +function startGame() { + document.getElementById('instructions').style.display = 'none'; + document.getElementById('game').style.display = 'block'; + if (!gameStarted) { + gameStarted = true; + generateQuestion(); + updateTimer(); + timer = setInterval(updateTimer, 1000); + setTimeout(endGame, 20000); + } +} + +function generateQuestion() { + const num1 = Math.floor(Math.random() * 10) + 1; + const num2 = Math.floor(Math.random() * 10) + 1; + const operations = ['+', '-', '*', '/']; + const operation = operations[Math.floor(Math.random() * operations.length)]; + + if (operation === '/' && num1 % num2 !== 0) { + generateQuestion(); // Avoid division questions with remainders + return; + } + + currentQuestion = { num1, num2, operation }; + document.getElementById('question').innerText = `What is ${num1} ${operation} ${num2}?`; +} + +function submitAnswer() { + const answer = parseFloat(document.getElementById('answer').value); + let correctAnswer; + + switch (currentQuestion.operation) { + case '+': + correctAnswer = currentQuestion.num1 + currentQuestion.num2; + break; + case '-': + correctAnswer = currentQuestion.num1 - currentQuestion.num2; + break; + case '*': + correctAnswer = currentQuestion.num1 * currentQuestion.num2; + break; + case '/': + correctAnswer = currentQuestion.num1 / currentQuestion.num2; + break; + } + + if (answer === correctAnswer) { + correctAnswers++; + } else { + wrongAnswers++; + } + + document.getElementById('answer').value = ''; + generateQuestion(); +} + +function updateTimer() { + if (timeLeft > 0) { + document.getElementById('timer').innerText = `Time left: ${timeLeft} seconds`; + timeLeft--; + } else { + clearInterval(timer); + } +} + +function endGame() { + clearInterval(timer); + gameStarted = false; + document.getElementById('result').innerText = 'Time is up!'; + document.getElementById('score').innerText = `Correct Answers: ${correctAnswers}, Wrong Answers: ${wrongAnswers}`; +} diff --git a/Games/MathQuiz/styles.css b/Games/MathQuiz/styles.css new file mode 100644 index 0000000000..4633931a17 --- /dev/null +++ b/Games/MathQuiz/styles.css @@ -0,0 +1,60 @@ +body { + font-family: Arial, sans-serif; + text-align: center; + background-color: #f0f0f0; + margin: 0; + padding: 20px; + background-image: url("https://png.pngtree.com/thumb_back/fh260/background/20200530/pngtree-cute-hand-drawn-style-mathematics-education-pink-plaid-background-image_337364.jpg"); + background-repeat: no-repeat; + background-size: cover; + background-attachment: fixed; +} + +#game-container { + background-color: rgba(255, 255, 255, 0.8); + border: 1px solid #ccc; + border-radius: 10px; + padding: 40px; + width: 500px; + margin: 50px auto; + box-shadow: 0 0 20px rgba(0, 0, 0, 0.2); +} + +h1 { + color: #333; +} + +#question { + font-size: 24px; + margin-bottom: 20px; +} + +#answer { + width: 100px; + padding: 5px; + font-size: 16px; +} + +button { + padding: 10px 20px; + font-size: 16px; + margin-top: 10px; +} + +#result, #score, #timer { + margin-top: 20px; + font-size: 18px; +} + +#instructions { + font-size: 18px; + background-color: rgba(255, 255, 255, 0.8); + border-radius: 10px; + padding: 20px; +} + +#game { + background-color: rgba(255, 255, 255, 0.8); + border-radius: 10px; + padding: 20px; +} diff --git a/Games/Menja_block_breaker/README.md b/Games/Menja_block_breaker/README.md new file mode 100644 index 0000000000..5c68f770cd --- /dev/null +++ b/Games/Menja_block_breaker/README.md @@ -0,0 +1,18 @@ +# Block Breaker Game + +## Description +The Block Breaker Game is a classic arcade-style game where the player controls a paddle to bounce a ball and break blocks. The objective is to clear all the blocks on the screen by hitting them with the ball while preventing the ball from falling off the screen using the paddle. + +## Features +- **Multiple Levels:** Progressive difficulty with increasing levels. +- **Power-Ups:** Various power-ups to enhance gameplay (e.g., paddle size increase, extra balls). +- **Score Tracking:** Keeps track of the player's score. +- **Sound Effects:** Engaging sound effects for different actions like hitting blocks, catching power-ups, etc. +- **Responsive Controls:** Smooth and responsive paddle controls. + +## Gameplay +- Use the left and right arrow keys to move the paddle. +- Prevent the ball from falling off the bottom of the screen by bouncing it back with the paddle. +- Break all the blocks on the screen to advance to the next level. +- Collect power-ups for special abilities and higher scores. + diff --git a/Games/Menja_block_breaker/index.html b/Games/Menja_block_breaker/index.html new file mode 100644 index 0000000000..dd8641f679 --- /dev/null +++ b/Games/Menja_block_breaker/index.html @@ -0,0 +1,50 @@ + + + + + + Menja + + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + \ No newline at end of file diff --git a/Games/Menja_block_breaker/script.js b/Games/Menja_block_breaker/script.js new file mode 100644 index 0000000000..f4ee8312af --- /dev/null +++ b/Games/Menja_block_breaker/script.js @@ -0,0 +1,1664 @@ +let gameSpeed = 1; +const BLUE = { r: 0x67, g: 0xd7, b: 0xf0 }; +const GREEN = { r: 0xa6, g: 0xe0, b: 0x2c }; +const PINK = { r: 0xfa, g: 0x24, b: 0x73 }; +const ORANGE = { r: 0xfe, g: 0x95, b: 0x22 }; +const allColors = [BLUE, GREEN, PINK, ORANGE]; +const getSpawnDelay = () => { + const spawnDelayMax = 1400; + const spawnDelayMin = 550; + const spawnDelay = spawnDelayMax - state.game.cubeCount * 3.1; + return Math.max(spawnDelay, spawnDelayMin); +} +const doubleStrongEnableScore = 2000; +const slowmoThreshold = 10; +const strongThreshold = 25; +const spinnerThreshold = 25; +let pointerIsDown = false; +let pointerScreen = { x: 0, y: 0 }; +let pointerScene = { x: 0, y: 0 }; +const minPointerSpeed = 60; +const hitDampening = 0.1; +const backboardZ = -400; +const shadowColor = '#262e36'; +const airDrag = 0.022; +const gravity = 0.3; +const sparkColor = 'rgba(170,221,255,.9)'; +const sparkThickness = 2.2; +const airDragSpark = 0.1; +const touchTrailColor = 'rgba(170,221,255,.62)'; +const touchTrailThickness = 7; +const touchPointLife = 120; +const touchPoints = []; +const targetRadius = 40; +const targetHitRadius = 50; +const makeTargetGlueColor = target => { + return 'rgb(170,221,255)'; +};const fragRadius = targetRadius / 3; +const canvas = document.querySelector('#c'); +const cameraDistance = 900; +const sceneScale = 1; +const cameraFadeStartZ = 0.45*cameraDistance; +const cameraFadeEndZ = 0.65*cameraDistance; +const cameraFadeRange = cameraFadeEndZ - cameraFadeStartZ; +const allVertices = []; +const allPolys = []; +const allShadowVertices = []; +const allShadowPolys = []; +const GAME_MODE_RANKED = Symbol('GAME_MODE_RANKED'); +const GAME_MODE_CASUAL = Symbol('GAME_MODE_CASUAL'); +const MENU_MAIN = Symbol('MENU_MAIN'); +const MENU_PAUSE = Symbol('MENU_PAUSE'); +const MENU_SCORE = Symbol('MENU_SCORE'); +const state = { + game: { + mode: GAME_MODE_RANKED, + time: 0, + score: 0, + cubeCount: 0 + }, + menus: { + active: MENU_MAIN + } +}; + +const isInGame = () => !state.menus.active; +const isMenuVisible = () => !!state.menus.active; +const isCasualGame = () => state.game.mode === GAME_MODE_CASUAL; +const isPaused = () => state.menus.active === MENU_PAUSE; +const highScoreKey = '__menja__highScore'; +const getHighScore = () => { + const raw = localStorage.getItem(highScoreKey); + return raw ? parseInt(raw, 10) : 0; +}; +let _lastHighscore = getHighScore(); +const setHighScore = score => { + _lastHighscore = getHighScore(); + localStorage.setItem(highScoreKey, String(score)); +}; +const isNewHighScore = () => state.game.score > _lastHighscore; +const invariant = (condition, message) => { + if (!condition) throw new Error(message); +}; +const $ = selector => document.querySelector(selector); +const handleClick = (element, handler) => element.addEventListener('click', handler); +const handlePointerDown = (element, handler) => { + element.addEventListener('touchstart', handler); + element.addEventListener('mousedown', handler); +}; +const formatNumber = num => num.toLocaleString(); +const PI = Math.PI; +const TAU = Math.PI * 2; +const ETA = Math.PI * 0.5; +const clamp = (num, min, max) => Math.min(Math.max(num, min), max); +const lerp = (a, b, mix) => (b - a) * mix + a; +const random = (min, max) => Math.random() * (max - min) + min; +const randomInt = (min, max) => ((Math.random() * (max - min + 1)) | 0) + min; +const pickOne = arr => arr[Math.random() * arr.length | 0]; +const colorToHex = color => { + return '#' + + (color.r | 0).toString(16).padStart(2, '0') + + (color.g | 0).toString(16).padStart(2, '0') + + (color.b | 0).toString(16).padStart(2, '0'); +}; +const shadeColor = (color, lightness) => { + let other, mix; + if (lightness < 0.5) { + other = 0; + mix = 1 - (lightness * 2); + } else { + other = 255; + mix = lightness * 2 - 1; + } + return '#' + + (lerp(color.r, other, mix) | 0).toString(16).padStart(2, '0') + + (lerp(color.g, other, mix) | 0).toString(16).padStart(2, '0') + + (lerp(color.b, other, mix) | 0).toString(16).padStart(2, '0'); +}; +const _allCooldowns = []; +const makeCooldown = (rechargeTime, units=1) => { + let timeRemaining = 0; + let lastTime = 0; + const initialOptions = { rechargeTime, units }; + const updateTime = () => { + const now = state.game.time; + if (now < lastTime) { + timeRemaining = 0; + } else { + timeRemaining -= now-lastTime; + if (timeRemaining < 0) timeRemaining = 0; + } + lastTime = now; + }; + + const canUse = () => { + updateTime(); + return timeRemaining <= (rechargeTime * (units-1)); + }; + + const cooldown = { + canUse, + useIfAble() { + const usable = canUse(); + if (usable) timeRemaining += rechargeTime; + return usable; + }, + mutate(options) { + if (options.rechargeTime) { + timeRemaining -= rechargeTime-options.rechargeTime; + if (timeRemaining < 0) timeRemaining = 0; + rechargeTime = options.rechargeTime; + } + if (options.units) units = options.units; + }, + reset() { + timeRemaining = 0; + lastTime = 0; + this.mutate(initialOptions); + } + }; + + _allCooldowns.push(cooldown); + + return cooldown; +}; + +const resetAllCooldowns = () => _allCooldowns.forEach(cooldown => cooldown.reset()); + +const makeSpawner = ({ chance, cooldownPerSpawn, maxSpawns }) => { + const cooldown = makeCooldown(cooldownPerSpawn, maxSpawns); + return { + shouldSpawn() { + return Math.random() <= chance && cooldown.useIfAble(); + }, + mutate(options) { + if (options.chance) chance = options.chance; + cooldown.mutate({ + rechargeTime: options.cooldownPerSpawn, + units: options.maxSpawns + }); + } + }; +}; +const normalize = v => { + const mag = Math.hypot(v.x, v.y, v.z); + return { + x: v.x / mag, + y: v.y / mag, + z: v.z / mag + }; +} +const add = a => b => a + b; +const scaleVector = scale => vector => { + vector.x *= scale; + vector.y *= scale; + vector.z *= scale; +}; +function cloneVertices(vertices) { + return vertices.map(v => ({ x: v.x, y: v.y, z: v.z })); +} +function copyVerticesTo(arr1, arr2) { + const len = arr1.length; + for (let i=0; i { + const targetVertex = target[i]; + + const x1 = v.x; + const y1 = v.z*sinX + v.y*cosX; + const z1 = v.z*cosX - v.y*sinX; + + const x2 = x1*cosY - z1*sinY; + const y2 = y1; + const z2 = x1*sinY + z1*cosY; + + const x3 = x2*cosZ - y2*sinZ; + const y3 = x2*sinZ + y2*cosZ; + const z3 = z2; + + targetVertex.x = x3 * sX + tX; + targetVertex.y = y3 * sY + tY; + targetVertex.z = z3 * sZ + tZ; + }); +} + +const projectVertex = v => { + const focalLength = cameraDistance * sceneScale; + const depth = focalLength / (cameraDistance - v.z); + v.x = v.x * depth; + v.y = v.y * depth; +}; + +const projectVertexTo = (v, target) => { + const focalLength = cameraDistance * sceneScale; + const depth = focalLength / (cameraDistance - v.z); + target.x = v.x * depth; + target.y = v.y * depth; +}; + +const PERF_START = () => {}; +const PERF_END = () => {}; +const PERF_UPDATE = () => {}; + +function makeCubeModel({ scale=1 }) { + return { + vertices: [ + + { x: -scale, y: -scale, z: scale }, + { x: scale, y: -scale, z: scale }, + { x: scale, y: scale, z: scale }, + { x: -scale, y: scale, z: scale }, + + { x: -scale, y: -scale, z: -scale }, + { x: scale, y: -scale, z: -scale }, + { x: scale, y: scale, z: -scale }, + { x: -scale, y: scale, z: -scale } + ], + polys: [ + + { vIndexes: [0, 1, 2, 3] }, + + { vIndexes: [7, 6, 5, 4] }, + + { vIndexes: [3, 2, 6, 7] }, + + { vIndexes: [4, 5, 1, 0] }, + + { vIndexes: [5, 6, 2, 1] }, + + { vIndexes: [0, 3, 7, 4] } + ] + }; +} + +function makeRecursiveCubeModel({ recursionLevel, splitFn, color, scale=1 }) { + const getScaleAtLevel = level => 1 / (3 ** level); + + let cubeOrigins = [{ x: 0, y: 0, z: 0 }]; + + for (let i=1; i<=recursionLevel; i++) { + const scale = getScaleAtLevel(i) * 2; + const cubeOrigins2 = []; + cubeOrigins.forEach(origin => { + cubeOrigins2.push(...splitFn(origin, scale)); + }); + cubeOrigins = cubeOrigins2; + } + + const finalModel = { vertices: [], polys: [] }; + + const cubeModel = makeCubeModel({ scale: 1 }); + cubeModel.vertices.forEach(scaleVector(getScaleAtLevel(recursionLevel))); + + const maxComponent = getScaleAtLevel(recursionLevel) * (3 ** recursionLevel - 1); + + cubeOrigins.forEach((origin, cubeIndex) => { + + const occlusion = Math.max( + Math.abs(origin.x), + Math.abs(origin.y), + Math.abs(origin.z) + ) / maxComponent; + + const occlusionLighter = recursionLevel > 2 + ? occlusion + : (occlusion + 0.8) / 1.8; + + finalModel.vertices.push( + ...cubeModel.vertices.map(v => ({ + x: (v.x + origin.x) * scale, + y: (v.y + origin.y) * scale, + z: (v.z + origin.z) * scale + })) + ); + + finalModel.polys.push( + ...cubeModel.polys.map(poly => ({ + vIndexes: poly.vIndexes.map(add(cubeIndex * 8)) + })) + ); + }); + + return finalModel; +} + +function mengerSpongeSplit(o, s) { + return [ + + { x: o.x + s, y: o.y - s, z: o.z + s }, + { x: o.x + s, y: o.y - s, z: o.z + 0 }, + { x: o.x + s, y: o.y - s, z: o.z - s }, + { x: o.x + 0, y: o.y - s, z: o.z + s }, + { x: o.x + 0, y: o.y - s, z: o.z - s }, + { x: o.x - s, y: o.y - s, z: o.z + s }, + { x: o.x - s, y: o.y - s, z: o.z + 0 }, + { x: o.x - s, y: o.y - s, z: o.z - s }, + + { x: o.x + s, y: o.y + s, z: o.z + s }, + { x: o.x + s, y: o.y + s, z: o.z + 0 }, + { x: o.x + s, y: o.y + s, z: o.z - s }, + { x: o.x + 0, y: o.y + s, z: o.z + s }, + { x: o.x + 0, y: o.y + s, z: o.z - s }, + { x: o.x - s, y: o.y + s, z: o.z + s }, + { x: o.x - s, y: o.y + s, z: o.z + 0 }, + { x: o.x - s, y: o.y + s, z: o.z - s }, + + { x: o.x + s, y: o.y + 0, z: o.z + s }, + { x: o.x + s, y: o.y + 0, z: o.z - s }, + { x: o.x - s, y: o.y + 0, z: o.z + s }, + { x: o.x - s, y: o.y + 0, z: o.z - s } + ]; +} + +function optimizeModel(model, threshold=0.0001) { + const { vertices, polys } = model; + + const compareVertices = (v1, v2) => ( + Math.abs(v1.x - v2.x) < threshold && + Math.abs(v1.y - v2.y) < threshold && + Math.abs(v1.z - v2.z) < threshold + ); + + const comparePolys = (p1, p2) => { + const v1 = p1.vIndexes; + const v2 = p2.vIndexes; + return ( + ( + v1[0] === v2[0] || + v1[0] === v2[1] || + v1[0] === v2[2] || + v1[0] === v2[3] + ) && ( + v1[1] === v2[0] || + v1[1] === v2[1] || + v1[1] === v2[2] || + v1[1] === v2[3] + ) && ( + v1[2] === v2[0] || + v1[2] === v2[1] || + v1[2] === v2[2] || + v1[2] === v2[3] + ) && ( + v1[3] === v2[0] || + v1[3] === v2[1] || + v1[3] === v2[2] || + v1[3] === v2[3] + ) + ); + }; + + vertices.forEach((v, i) => { + v.originalIndexes = [i]; + }); + + for (let i=vertices.length-1; i>=0; i--) { + for (let ii=i-1; ii>=0; ii--) { + const v1 = vertices[i]; + const v2 = vertices[ii]; + if (compareVertices(v1, v2)) { + vertices.splice(i, 1); + v2.originalIndexes.push(...v1.originalIndexes); + break; + } + } + } + + vertices.forEach((v, i) => { + polys.forEach(p => { + p.vIndexes.forEach((vi, ii, arr) => { + const vo = v.originalIndexes; + if (vo.includes(vi)) { + arr[ii] = i; + } + }); + }); + }); + + polys.forEach(p => { + const vi = p.vIndexes; + p.sum = vi[0] + vi[1] + vi[2] + vi[3]; + }); + polys.sort((a, b) => b.sum - a.sum); + + for (let i=polys.length-1; i>=0; i--) { + for (let ii=i-1; ii>=0; ii--) { + const p1 = polys[i]; + const p2 = polys[ii]; + if (p1.sum !== p2.sum) break; + if (comparePolys(p1, p2)) { + polys.splice(i, 1); + polys.splice(ii, 1); + i--; + break; + } + } + } + + return model; +} + +class Entity { + constructor({ model, color, wireframe=false }) { + const vertices = cloneVertices(model.vertices); + const shadowVertices = cloneVertices(model.vertices); + const colorHex = colorToHex(color); + const darkColorHex = shadeColor(color, 0.4); + + const polys = model.polys.map(p => ({ + vertices: p.vIndexes.map(vIndex => vertices[vIndex]), + color: color, + wireframe: wireframe, + strokeWidth: wireframe ? 2 : 0, + strokeColor: colorHex, + strokeColorDark: darkColorHex, + depth: 0, + middle: { x: 0, y: 0, z: 0 }, + normalWorld: { x: 0, y: 0, z: 0 }, + normalCamera: { x: 0, y: 0, z: 0 } + })); + + const shadowPolys = model.polys.map(p => ({ + vertices: p.vIndexes.map(vIndex => shadowVertices[vIndex]), + wireframe: wireframe, + normalWorld: { x: 0, y: 0, z: 0 } + })); + + this.projected = {}; + this.model = model; + this.vertices = vertices; + this.polys = polys; + this.shadowVertices = shadowVertices; + this.shadowPolys = shadowPolys; + this.reset(); + } + + reset() { + this.x = 0; + this.y = 0; + this.z = 0; + this.xD = 0; + this.yD = 0; + this.zD = 0; + + this.rotateX = 0; + this.rotateY = 0; + this.rotateZ = 0; + this.rotateXD = 0; + this.rotateYD = 0; + this.rotateZD = 0; + + this.scaleX = 1; + this.scaleY = 1; + this.scaleZ = 1; + + this.projected.x = 0; + this.projected.y = 0; + } + + transform() { + transformVertices( + this.model.vertices, + this.vertices, + this.x, + this.y, + this.z, + this.rotateX, + this.rotateY, + this.rotateZ, + this.scaleX, + this.scaleY, + this.scaleZ + ); + + copyVerticesTo(this.vertices, this.shadowVertices); + } + + project() { + projectVertexTo(this, this.projected); + } +} + +const targets = []; + +const targetPool = new Map(allColors.map(c=>([c, []]))); +const targetWireframePool = new Map(allColors.map(c=>([c, []]))); + +const getTarget = (() => { + + const slowmoSpawner = makeSpawner({ + chance: 0.5, + cooldownPerSpawn: 10000, + maxSpawns: 1 + }); + + let doubleStrong = false; + const strongSpawner = makeSpawner({ + chance: 0.3, + cooldownPerSpawn: 12000, + maxSpawns: 1 + }); + + const spinnerSpawner = makeSpawner({ + chance: 0.1, + cooldownPerSpawn: 10000, + maxSpawns: 1 + }); + + const axisOptions = [ + ['x', 'y'], + ['y', 'z'], + ['z', 'x'] + ]; + + function getTargetOfStyle(color, wireframe) { + const pool = wireframe ? targetWireframePool : targetPool; + let target = pool.get(color).pop(); + if (!target) { + target = new Entity({ + model: optimizeModel(makeRecursiveCubeModel({ + recursionLevel: 1, + splitFn: mengerSpongeSplit, + scale: targetRadius + })), + color: color, + wireframe: wireframe + }); + + target.color = color; + target.wireframe = wireframe; + + target.hit = false; + target.maxHealth = 0; + target.health = 0; + } + return target; + } + + return function getTarget() { + if (doubleStrong && state.game.score <= doubleStrongEnableScore) { + doubleStrong = false; + + } else if (!doubleStrong && state.game.score > doubleStrongEnableScore) { + doubleStrong = true; + strongSpawner.mutate({ maxSpawns: 2 }); + } + + let color = pickOne([BLUE, GREEN, ORANGE]); + let wireframe = false; + let health = 1; + let maxHealth = 3; + const spinner = state.game.cubeCount >= spinnerThreshold && isInGame() && spinnerSpawner.shouldSpawn(); + + if (state.game.cubeCount >= slowmoThreshold && slowmoSpawner.shouldSpawn()) { + color = BLUE; + wireframe = true; + } + else if (state.game.cubeCount >= strongThreshold && strongSpawner.shouldSpawn()) { + color = PINK; + health = 3; + } + + const target = getTargetOfStyle(color, wireframe); + target.hit = false; + target.maxHealth = maxHealth; + target.health = health; + updateTargetHealth(target, 0); + + const spinSpeeds = [ + Math.random() * 0.1 - 0.05, + Math.random() * 0.1 - 0.05 + ]; + + if (spinner) { + + spinSpeeds[0] = -0.25; + spinSpeeds[1] = 0; + target.rotateZ = random(0, TAU); + } + + const axes = pickOne(axisOptions); + + spinSpeeds.forEach((spinSpeed, i) => { + switch (axes[i]) { + case 'x': + target.rotateXD = spinSpeed; + break; + case 'y': + target.rotateYD = spinSpeed; + break; + case 'z': + target.rotateZD = spinSpeed; + break; + } + }); + + return target; + } +})(); + +const updateTargetHealth = (target, healthDelta) => { + target.health += healthDelta; + + if (!target.wireframe) { + const strokeWidth = target.health - 1; + const strokeColor = makeTargetGlueColor(target); + for (let p of target.polys) { + p.strokeWidth = strokeWidth; + p.strokeColor = strokeColor; + } + } +}; + +const returnTarget = target => { + target.reset(); + const pool = target.wireframe ? targetWireframePool : targetPool; + pool.get(target.color).push(target); +}; + +function resetAllTargets() { + while(targets.length) { + returnTarget(targets.pop()); + } +} + +const frags = []; + +const fragPool = new Map(allColors.map(c=>([c, []]))); +const fragWireframePool = new Map(allColors.map(c=>([c, []]))); + +const createBurst = (() => { + + const basePositions = mengerSpongeSplit({ x:0, y:0, z:0 }, fragRadius*2); + const positions = cloneVertices(basePositions); + const prevPositions = cloneVertices(basePositions); + const velocities = cloneVertices(basePositions); + + const basePositionNormals = basePositions.map(normalize); + const positionNormals = cloneVertices(basePositionNormals); + + const fragCount = basePositions.length; + + function getFragForTarget(target) { + const pool = target.wireframe ? fragWireframePool : fragPool; + let frag = pool.get(target.color).pop(); + if (!frag) { + frag = new Entity({ + model: makeCubeModel({ scale: fragRadius }), + color: target.color, + wireframe: target.wireframe + }); + frag.color = target.color; + frag.wireframe = target.wireframe; + } + return frag; + } + + return (target, force=1) => { + + transformVertices( + basePositions, positions, + target.x, target.y, target.z, + target.rotateX, target.rotateY, target.rotateZ, + 1, 1, 1 + ); + transformVertices( + basePositions, prevPositions, + target.x - target.xD, target.y - target.yD, target.z - target.zD, + target.rotateX - target.rotateXD, target.rotateY - target.rotateYD, target.rotateZ - target.rotateZD, + 1, 1, 1 + ); + + for (let i=0; i { + frag.reset(); + const pool = frag.wireframe ? fragWireframePool : fragPool; + pool.get(frag.color).push(frag); +}; + +const sparks = []; +const sparkPool = []; + +function addSpark(x, y, xD, yD) { + const spark = sparkPool.pop() || {}; + + spark.x = x + xD * 0.5; + spark.y = y + yD * 0.5; + spark.xD = xD; + spark.yD = yD; + spark.life = random(200, 300); + spark.maxLife = spark.life; + + sparks.push(spark); + + return spark; +} + +function sparkBurst(x, y, count, maxSpeed) { + const angleInc = TAU / count; + for (let i=0; i { + if (Math.random() < 0.4) { + projectVertex(v); + addSpark( + v.x, + v.y, + random(-12, 12), + random(-12, 12) + ); + } + }); +} + +function returnSpark(spark) { + sparkPool.push(spark); +} + +const hudContainerNode = $('.hud'); + +function setHudVisibility(visible) { + if (visible) { + hudContainerNode.style.display = 'block'; + } else { + hudContainerNode.style.display = 'none'; + } +} + +const scoreNode = $('.score-lbl'); +const cubeCountNode = $('.cube-count-lbl'); + +function renderScoreHud() { + if (isCasualGame()) { + scoreNode.style.display = 'none'; + cubeCountNode.style.opacity = 1; + } else { + scoreNode.innerText = `SCORE: ${state.game.score}`; + scoreNode.style.display = 'block'; + cubeCountNode.style.opacity = 0.65 ; + } + cubeCountNode.innerText = `CUBES SMASHED: ${state.game.cubeCount}`; +} + +renderScoreHud(); + +handlePointerDown($('.pause-btn'), () => pauseGame()); + +const slowmoNode = $('.slowmo'); +const slowmoBarNode = $('.slowmo__bar'); + +function renderSlowmoStatus(percentRemaining) { + slowmoNode.style.opacity = percentRemaining === 0 ? 0 : 1; + slowmoBarNode.style.transform = `scaleX(${percentRemaining.toFixed(3)})`; +} + +const menuContainerNode = $('.menus'); +const menuMainNode = $('.menu--main'); +const menuPauseNode = $('.menu--pause'); +const menuScoreNode = $('.menu--score'); + +const finalScoreLblNode = $('.final-score-lbl'); +const highScoreLblNode = $('.high-score-lbl'); + +function showMenu(node) { + node.classList.add('active'); +} + +function hideMenu(node) { + node.classList.remove('active'); +} + +function renderMenus() { + hideMenu(menuMainNode); + hideMenu(menuPauseNode); + hideMenu(menuScoreNode); + + switch (state.menus.active) { + case MENU_MAIN: + showMenu(menuMainNode); + break; + case MENU_PAUSE: + showMenu(menuPauseNode); + break; + case MENU_SCORE: + finalScoreLblNode.textContent = formatNumber(state.game.score); + if (isNewHighScore()) { + highScoreLblNode.textContent = 'New High Score!'; + } else { + highScoreLblNode.textContent = `High Score: ${formatNumber(getHighScore())}`; + } + showMenu(menuScoreNode); + break; + } + + setHudVisibility(!isMenuVisible()); + menuContainerNode.classList.toggle('has-active', isMenuVisible()); + menuContainerNode.classList.toggle('interactive-mode', isMenuVisible() && pointerIsDown); +} + +renderMenus(); + +handleClick($('.play-normal-btn'), () => { + setGameMode(GAME_MODE_RANKED); + setActiveMenu(null); + resetGame(); +}); + +handleClick($('.play-casual-btn'), () => { + setGameMode(GAME_MODE_CASUAL); + setActiveMenu(null); + resetGame(); +}); + +handleClick($('.resume-btn'), () => resumeGame()); +handleClick($('.menu-btn--pause'), () => setActiveMenu(MENU_MAIN)); + +handleClick($('.play-again-btn'), () => { + setActiveMenu(null); + resetGame(); +}); + +handleClick($('.menu-btn--score'), () => setActiveMenu(MENU_MAIN)); + +handleClick($('.play-normal-btn'), () => { + setGameMode(GAME_MODE_RANKED); + setActiveMenu(null); + resetGame(); +}); + +handleClick($('.play-casual-btn'), () => { + setGameMode(GAME_MODE_CASUAL); + setActiveMenu(null); + resetGame(); +}); + +handleClick($('.resume-btn'), () => resumeGame()); +handleClick($('.menu-btn--pause'), () => setActiveMenu(MENU_MAIN)); + +handleClick($('.play-again-btn'), () => { + setActiveMenu(null); + resetGame(); +}); + +handleClick($('.menu-btn--score'), () => setActiveMenu(MENU_MAIN)); + +function setActiveMenu(menu) { + state.menus.active = menu; + renderMenus(); +} + +function setScore(score) { + state.game.score = score; + renderScoreHud(); +} + +function incrementScore(inc) { + if (isInGame()) { + state.game.score += inc; + if (state.game.score < 0) { + state.game.score = 0; + } + renderScoreHud(); + } +} + +function setCubeCount(count) { + state.game.cubeCount = count; + renderScoreHud(); +} + +function incrementCubeCount(inc) { + if (isInGame()) { + state.game.cubeCount += inc; + renderScoreHud(); + } +} + +function setGameMode(mode) { + state.game.mode = mode; +} + +function resetGame() { + resetAllTargets(); + state.game.time = 0; + resetAllCooldowns(); + setScore(0); + setCubeCount(0); + spawnTime = getSpawnDelay(); +} + +function pauseGame() { + isInGame() && setActiveMenu(MENU_PAUSE); +} + +function resumeGame() { + isPaused() && setActiveMenu(null); +} + +function endGame() { + handleCanvasPointerUp(); + if (isNewHighScore()) { + setHighScore(state.game.score); + } + setActiveMenu(MENU_SCORE); +} + +window.addEventListener('keydown', event => { + if (event.key === 'p') { + isPaused() ? resumeGame() : pauseGame(); + } +}); + +let spawnTime = 0; +const maxSpawnX = 450; +const pointerDelta = { x: 0, y: 0 }; +const pointerDeltaScaled = { x: 0, y: 0 }; + +const slowmoDuration = 1500; +let slowmoRemaining = 0; +let spawnExtra = 0; +const spawnExtraDelay = 300; +let targetSpeed = 1; + +function tick(width, height, simTime, simSpeed, lag) { + PERF_START('frame'); + PERF_START('tick'); + + state.game.time += simTime; + + if (slowmoRemaining > 0) { + slowmoRemaining -= simTime; + if (slowmoRemaining < 0) { + slowmoRemaining = 0; + } + targetSpeed = pointerIsDown ? 0.075 : 0.3; + } else { + const menuPointerDown = isMenuVisible() && pointerIsDown; + targetSpeed = menuPointerDown ? 0.025 : 1; + } + + renderSlowmoStatus(slowmoRemaining / slowmoDuration); + + gameSpeed += (targetSpeed - gameSpeed) / 22 * lag; + gameSpeed = clamp(gameSpeed, 0, 1); + + const centerX = width / 2; + const centerY = height / 2; + + const simAirDrag = 1 - (airDrag * simSpeed); + const simAirDragSpark = 1 - (airDragSpark * simSpeed); + + const forceMultiplier = 1 / (simSpeed * 0.75 + 0.25); + pointerDelta.x = 0; + pointerDelta.y = 0; + pointerDeltaScaled.x = 0; + pointerDeltaScaled.y = 0; + const lastPointer = touchPoints[touchPoints.length - 1]; + + if (pointerIsDown && lastPointer && !lastPointer.touchBreak) { + pointerDelta.x = (pointerScene.x - lastPointer.x); + pointerDelta.y = (pointerScene.y - lastPointer.y); + pointerDeltaScaled.x = pointerDelta.x * forceMultiplier; + pointerDeltaScaled.y = pointerDelta.y * forceMultiplier; + } + const pointerSpeed = Math.hypot(pointerDelta.x, pointerDelta.y); + const pointerSpeedScaled = pointerSpeed * forceMultiplier; + + touchPoints.forEach(p => p.life -= simTime); + + if (pointerIsDown) { + touchPoints.push({ + x: pointerScene.x, + y: pointerScene.y, + life: touchPointLife + }); + } + + while (touchPoints[0] && touchPoints[0].life <= 0) { + touchPoints.shift(); + } + + PERF_START('entities'); + + spawnTime -= simTime; + if (spawnTime <= 0) { + if (spawnExtra > 0) { + spawnExtra--; + spawnTime = spawnExtraDelay; + } else { + spawnTime = getSpawnDelay(); + } + const target = getTarget(); + const spawnRadius = Math.min(centerX * 0.8, maxSpawnX); + target.x = (Math.random() * spawnRadius * 2 - spawnRadius); + target.y = centerY + targetHitRadius * 2; + target.z = (Math.random() * targetRadius*2 - targetRadius); + target.xD = Math.random() * (target.x * -2 / 120); + target.yD = -20; + targets.push(target); + } + + const leftBound = -centerX + targetRadius; + const rightBound = centerX - targetRadius; + const ceiling = -centerY - 120; + const boundDamping = 0.4; + + targetLoop: + for (let i = targets.length - 1; i >= 0; i--) { + const target = targets[i]; + target.x += target.xD * simSpeed; + target.y += target.yD * simSpeed; + + if (target.y < ceiling) { + target.y = ceiling; + target.yD = 0; + } + + if (target.x < leftBound) { + target.x = leftBound; + target.xD *= -boundDamping; + } else if (target.x > rightBound) { + target.x = rightBound; + target.xD *= -boundDamping; + } + + if (target.z < backboardZ) { + target.z = backboardZ; + target.zD *= -boundDamping; + } + + target.yD += gravity * simSpeed; + target.rotateX += target.rotateXD * simSpeed; + target.rotateY += target.rotateYD * simSpeed; + target.rotateZ += target.rotateZD * simSpeed; + target.transform(); + target.project(); + + if (target.y > centerY + targetHitRadius * 2) { + targets.splice(i, 1); + returnTarget(target); + if (isInGame()) { + if (isCasualGame()) { + incrementScore(-25); + } else { + endGame(); + } + } + continue; + } + + const hitTestCount = Math.ceil(pointerSpeed / targetRadius * 2); + + for (let ii=1; ii<=hitTestCount; ii++) { + const percent = 1 - (ii / hitTestCount); + const hitX = pointerScene.x - pointerDelta.x * percent; + const hitY = pointerScene.y - pointerDelta.y * percent; + const distance = Math.hypot( + hitX - target.projected.x, + hitY - target.projected.y + ); + + if (distance <= targetHitRadius) { + + if (!target.hit) { + target.hit = true; + + target.xD += pointerDeltaScaled.x * hitDampening; + target.yD += pointerDeltaScaled.y * hitDampening; + target.rotateXD += pointerDeltaScaled.y * 0.001; + target.rotateYD += pointerDeltaScaled.x * 0.001; + + const sparkSpeed = 7 + pointerSpeedScaled * 0.125; + + if (pointerSpeedScaled > minPointerSpeed) { + target.health--; + incrementScore(10); + + if (target.health <= 0) { + incrementCubeCount(1); + createBurst(target, forceMultiplier); + sparkBurst(hitX, hitY, 8, sparkSpeed); + if (target.wireframe) { + slowmoRemaining = slowmoDuration; + spawnTime = 0; + spawnExtra = 2; + } + targets.splice(i, 1); + returnTarget(target); + } else { + sparkBurst(hitX, hitY, 8, sparkSpeed); + glueShedSparks(target); + updateTargetHealth(target, 0); + } + } else { + incrementScore(5); + sparkBurst(hitX, hitY, 3, sparkSpeed); + } + } + + continue targetLoop; + } + } + + target.hit = false; + } + + const fragBackboardZ = backboardZ + fragRadius; + + const fragLeftBound = -width; + const fragRightBound = width; + + for (let i = frags.length - 1; i >= 0; i--) { + const frag = frags[i]; + frag.x += frag.xD * simSpeed; + frag.y += frag.yD * simSpeed; + frag.z += frag.zD * simSpeed; + + frag.xD *= simAirDrag; + frag.yD *= simAirDrag; + frag.zD *= simAirDrag; + + if (frag.y < ceiling) { + frag.y = ceiling; + frag.yD = 0; + } + + if (frag.z < fragBackboardZ) { + frag.z = fragBackboardZ; + frag.zD *= -boundDamping; + } + + frag.yD += gravity * simSpeed; + frag.rotateX += frag.rotateXD * simSpeed; + frag.rotateY += frag.rotateYD * simSpeed; + frag.rotateZ += frag.rotateZD * simSpeed; + frag.transform(); + frag.project(); + + if ( + + frag.projected.y > centerY + targetHitRadius || + + frag.projected.x < fragLeftBound || + frag.projected.x > fragRightBound || + + frag.z > cameraFadeEndZ + ) { + frags.splice(i, 1); + returnFrag(frag); + continue; + } + } + + for (let i = sparks.length - 1; i >= 0; i--) { + const spark = sparks[i]; + spark.life -= simTime; + if (spark.life <= 0) { + sparks.splice(i, 1); + returnSpark(spark); + continue; + } + spark.x += spark.xD * simSpeed; + spark.y += spark.yD * simSpeed; + spark.xD *= simAirDragSpark; + spark.yD *= simAirDragSpark; + spark.yD += gravity * simSpeed; + } + + PERF_END('entities'); + + PERF_START('3D'); + + allVertices.length = 0; + allPolys.length = 0; + allShadowVertices.length = 0; + allShadowPolys.length = 0; + targets.forEach(entity => { + allVertices.push(...entity.vertices); + allPolys.push(...entity.polys); + allShadowVertices.push(...entity.shadowVertices); + allShadowPolys.push(...entity.shadowPolys); + }); + + frags.forEach(entity => { + allVertices.push(...entity.vertices); + allPolys.push(...entity.polys); + allShadowVertices.push(...entity.shadowVertices); + allShadowPolys.push(...entity.shadowPolys); + }); + + allPolys.forEach(p => computePolyNormal(p, 'normalWorld')); + allPolys.forEach(computePolyDepth); + allPolys.sort((a, b) => b.depth - a.depth); + + allVertices.forEach(projectVertex); + + allPolys.forEach(p => computePolyNormal(p, 'normalCamera')); + + PERF_END('3D'); + + PERF_START('shadows'); + + transformVertices( + allShadowVertices, + allShadowVertices, + 0, 0, 0, + TAU/8, 0, 0, + 1, 1, 1 + ); + + allShadowPolys.forEach(p => computePolyNormal(p, 'normalWorld')); + + const shadowDistanceMult = Math.hypot(1, 1); + const shadowVerticesLength = allShadowVertices.length; + for (let i=0; i { + if (p.wireframe) { + ctx.lineWidth = 2; + ctx.beginPath(); + const { vertices } = p; + const vCount = vertices.length; + const firstV = vertices[0]; + ctx.moveTo(firstV.x, firstV.y); + for (let i=1; i { + if (!p.wireframe && p.normalCamera.z < 0) return; + + if (p.strokeWidth !== 0) { + ctx.lineWidth = p.normalCamera.z < 0 ? p.strokeWidth * 0.5 : p.strokeWidth; + ctx.strokeStyle = p.normalCamera.z < 0 ? p.strokeColorDark : p.strokeColor; + } + + const { vertices } = p; + const lastV = vertices[vertices.length - 1]; + const fadeOut = p.middle.z > cameraFadeStartZ; + + if (!p.wireframe) { + const normalLight = p.normalWorld.y * 0.5 + p.normalWorld.z * -0.5; + const lightness = normalLight > 0 + ? 0.1 + : ((normalLight ** 32 - normalLight) / 2) * 0.9 + 0.1; + ctx.fillStyle = shadeColor(p.color, lightness); + } + + if (fadeOut) { + + ctx.globalAlpha = Math.max(0, 1 - (p.middle.z - cameraFadeStartZ) / cameraFadeRange); + } + + ctx.beginPath(); + ctx.moveTo(lastV.x, lastV.y); + for (let v of vertices) { + ctx.lineTo(v.x, v.y); + } + + if (!p.wireframe) { + ctx.fill(); + } + if (p.strokeWidth !== 0) { + ctx.stroke(); + } + + if (fadeOut) { + ctx.globalAlpha = 1; + } + }); + PERF_END('drawPolys'); + + PERF_START('draw2D'); + + ctx.strokeStyle = sparkColor; + ctx.lineWidth = sparkThickness; + ctx.beginPath(); + sparks.forEach(spark => { + ctx.moveTo(spark.x, spark.y); + + const scale = (spark.life / spark.maxLife) ** 0.5 * 1.5; + ctx.lineTo(spark.x - spark.xD*scale, spark.y - spark.yD*scale); + + }); + ctx.stroke(); + + ctx.strokeStyle = touchTrailColor; + const touchPointCount = touchPoints.length; + for (let i=1; i 68) { + frameTime = 68; + } + + const halfW = width / 2; + const halfH = height / 2; + + pointerScene.x = pointerScreen.x / viewScale - halfW; + pointerScene.y = pointerScreen.y / viewScale - halfH; + + const lag = frameTime / 16.6667; + const simTime = gameSpeed * frameTime; + const simSpeed = gameSpeed * lag; + tick(width, height, simTime, simSpeed, lag); + + ctx.clearRect(0, 0, canvas.width, canvas.height); + + const drawScale = dpr * viewScale; + ctx.scale(drawScale, drawScale); + ctx.translate(halfW, halfH); + draw(ctx, width, height, viewScale); + ctx.setTransform(1, 0, 0, 1, 0, 0); + } + const raf = () => requestAnimationFrame(frameHandler); + + raf(); +} + +function handleCanvasPointerDown(x, y) { + if (!pointerIsDown) { + pointerIsDown = true; + pointerScreen.x = x; + pointerScreen.y = y; + + if (isMenuVisible()) renderMenus(); + } +} + +function handleCanvasPointerUp() { + if (pointerIsDown) { + pointerIsDown = false; + touchPoints.push({ + touchBreak: true, + life: touchPointLife + }); + if (isMenuVisible()) renderMenus(); + } +} +function handleCanvasPointerMove(x, y) { + if (pointerIsDown) { + pointerScreen.x = x; + pointerScreen.y = y; + } +} + +if ('PointerEvent' in window) { + canvas.addEventListener('pointerdown', event => { + event.isPrimary && handleCanvasPointerDown(event.clientX, event.clientY); + }); + + canvas.addEventListener('pointerup', event => { + event.isPrimary && handleCanvasPointerUp(); + }); + + canvas.addEventListener('pointermove', event => { + event.isPrimary && handleCanvasPointerMove(event.clientX, event.clientY); + }); + + document.body.addEventListener('mouseleave', handleCanvasPointerUp); +} else { + let activeTouchId = null; + canvas.addEventListener('touchstart', event => { + if (!pointerIsDown) { + const touch = event.changedTouches[0]; + activeTouchId = touch.identifier; + handleCanvasPointerDown(touch.clientX, touch.clientY); + } + }); + canvas.addEventListener('touchend', event => { + for (let touch of event.changedTouches) { + if (touch.identifier === activeTouchId) { + handleCanvasPointerUp(); + break; + } + } + }); + canvas.addEventListener('touchmove', event => { + for (let touch of event.changedTouches) { + if (touch.identifier === activeTouchId) { + handleCanvasPointerMove(touch.clientX, touch.clientY); + event.preventDefault(); + break; + } + } + }, { passive: false }); +} + +setupCanvases(); \ No newline at end of file diff --git a/Games/Menja_block_breaker/style.css b/Games/Menja_block_breaker/style.css new file mode 100644 index 0000000000..87ffba7281 --- /dev/null +++ b/Games/Menja_block_breaker/style.css @@ -0,0 +1,242 @@ +body { + margin: 0; + background-color: #000; + background-image: radial-gradient(ellipse at top, #335476 0.0%, #31506e 11.1%, #304b67 22.2%, #2f4760 33.3%, #2d4359 44.4%, #2c3f51 55.6%, #2a3a4a 66.7%, #293643 77.8%, #28323d 88.9%, #262e36 100.0%); + height: 100vh; + overflow: hidden; + + font-family: monospace; + font-weight: bold; + letter-spacing: 0.06em; + color: rgba(255, 255, 255, 0.75); +} + +#c { + display: block; + touch-action: none; + transform: translateZ(0); +} + +.hud__score, +.pause-btn { + position: fixed; + font-size: calc(14px + 2vw + 1vh); +} + +.hud__score { + top: 0.65em; + left: 0.65em; + pointer-events: none; + user-select: none; +} + +.cube-count-lbl { + font-size: 0.46em; +} + +.pause-btn { + position: fixed; + top: 0; + right: 0; + padding: 0.8em 0.65em; +} + +.pause-btn > div { + position: relative; + width: 0.8em; + height: 0.8em; + opacity: 0.75; +} + +.pause-btn > div::before, +.pause-btn > div::after { + content: ''; + display: block; + width: 34%; + height: 100%; + position: absolute; + background-color: #fff; +} + +.pause-btn > div::after { + right: 0; +} + +.slowmo { + position: fixed; + bottom: 0; + width: 100%; + pointer-events: none; + opacity: 0; + transition: opacity 0.4s; + will-change: opacity; +} + +.slowmo::before { + content: 'SLOW-MO'; + display: block; + font-size: calc(8px + 1vw + 0.5vh); + margin-left: 0.5em; + margin-bottom: 8px; +} + +.slowmo::after { + content: ''; + display: block; + position: fixed; + bottom: 0; + width: 100%; + height: 1.5vh; + background-color: rgba(0, 0, 0, 0.25); + z-index: -1; +} + +.slowmo__bar { + height: 1.5vh; + background-color: rgba(255, 255, 255, 0.75); + transform-origin: 0 0; +} +.menus::before { + content: ''; + pointer-events: none; + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + background-color: #000; + opacity: 0; + transition: opacity 0.2s; + transition-timing-function: ease-in; +} + +.menus.has-active::before { + opacity: 0.08; + transition-duration: 0.4s; + transition-timing-function: ease-out; +} + +.menus.interactive-mode::before { + opacity: 0.02; +} +.menu { + pointer-events: none; + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + user-select: none; + text-align: center; + color: rgba(255, 255, 255, 0.9); + opacity: 0; + visibility: hidden; + transform: translateY(30px); + transition-property: opacity, visibility, transform; + transition-duration: 0.2s; + transition-timing-function: ease-in; +} + +.menu.active { + opacity: 1; + visibility: visible; + transform: translateY(0); + transition-duration: 0.4s; + transition-timing-function: ease-out; +} + +.menus.interactive-mode .menu.active { + opacity: 0.6; +} + +.menus:not(.interactive-mode) .menu.active > * { + pointer-events: auto; +} +h1 { + font-size: 4rem; + line-height: 0.95; + text-align: center; + font-weight: bold; + margin: 0 0.65em 1em; +} + +h2 { + font-size: 1.2rem; + line-height: 1; + text-align: center; + font-weight: bold; + margin: -1em 0.65em 1em; +} + +.final-score-lbl { + font-size: 5rem; + margin: -0.2em 0 0; +} + +.high-score-lbl { + font-size: 1.2rem; + margin: 0 0 2.5em; +} + +button { + display: block; + position: relative; + width: 200px; + padding: 12px 20px; + background: transparent; + border: none; + outline: none; + user-select: none; + font-family: monospace; + font-weight: bold; + font-size: 1.4rem; + color: #fff; + opacity: 0.75; + transition: opacity 0.3s; +} + +button::before { + content: ''; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + background-color: rgba(255, 255, 255, 0.15); + transform: scale(0, 0); + opacity: 0; + transition: opacity 0.3s, transform 0.3s; +} +button:active { + opacity: 1; +} + +button:active::before { + transform: scale(1, 1); + opacity: 1; +} + +.credits { + position: fixed; + width: 100%; + left: 0; + bottom: 20px; +} + +a { + color: white; +} +@media (min-width: 1025px) { + button:hover { + opacity: 1; + } + + button:hover::before { + transform: scale(1, 1); + opacity: 1; + } +} diff --git a/Games/Number_Guessing_Game/README.md b/Games/Number_Guessing_Game/README.md new file mode 100644 index 0000000000..486067be86 --- /dev/null +++ b/Games/Number_Guessing_Game/README.md @@ -0,0 +1,32 @@ +

    NUMBERGUESSINGGAME

    + + +

    Description

    +Game Overview: +The Number Guessing Game is a fun and engaging activity where players attempt to guess a secret number within a specified range. This game tests players' ability to use logic and intuition to narrow down their guesses and find the correct number in the fewest attempts possible. It's suitable for all ages and can be played solo or with friends. + +Objective: +The objective of the game is to guess the secret number chosen by the computer (or another player) in as few guesses as possible. + +How to Play: +Start the Game: The game begins with the computer selecting a random number within a predefined range, for example, 1 to 100. +Make a Guess: The player makes their first guess by entering a number within the range. +Receive Feedback: The computer provides feedback on whether the guessed number is too high, too low, or correct. +Adjust Guess: Based on the feedback, the player adjusts their next guess accordingly. +Repeat: Steps 2 to 4 are repeated until the player correctly guesses the secret number. +Win: Once the player guesses the correct number, the game congratulates the player and displays the number of attempts taken. +Features: +Difficulty Levels: Players can choose different difficulty levels, which change the range of numbers (e.g., 1-50 for easy, 1-100 for medium, and 1-1000 for hard). +Hint System: Optional hints can be provided to help players, such as indicating if they are within 10 numbers of the correct answer. +Score Tracking: The game can track the number of attempts and time taken to guess the correct number, allowing players to challenge themselves to improve. +Multiplayer Mode: Players can take turns guessing the number, and the one who guesses correctly in the fewest attempts wins. +Benefits: +Educational: Helps improve number sense and logical thinking. +Entertaining: Provides a fun challenge and a sense of achievement when the correct number is guessed. +Versatile: Suitable for players of all ages and can be played in various settings, from casual gatherings to classroom activities. +Conclusion: +The Number Guessing Game is a simple yet captivating game that can provide hours of entertainment and mental stimulation. Whether played alone or with friends, it offers a perfect blend of fun and learning, making it a great choice for anyone looking to pass the time with a challenge. + + + + diff --git a/Games/Number_Guessing_Game/favicon/android-chrome-192x192.png b/Games/Number_Guessing_Game/favicon/android-chrome-192x192.png new file mode 100644 index 0000000000..0de9ddd06a Binary files /dev/null and b/Games/Number_Guessing_Game/favicon/android-chrome-192x192.png differ diff --git a/Games/Number_Guessing_Game/favicon/android-chrome-512x512.png b/Games/Number_Guessing_Game/favicon/android-chrome-512x512.png new file mode 100644 index 0000000000..74ca078605 Binary files /dev/null and b/Games/Number_Guessing_Game/favicon/android-chrome-512x512.png differ diff --git a/Games/Number_Guessing_Game/favicon/apple-touch-icon.png b/Games/Number_Guessing_Game/favicon/apple-touch-icon.png new file mode 100644 index 0000000000..470ea4d1cb Binary files /dev/null and b/Games/Number_Guessing_Game/favicon/apple-touch-icon.png differ diff --git a/Games/Number_Guessing_Game/favicon/favicon-16x16.png b/Games/Number_Guessing_Game/favicon/favicon-16x16.png new file mode 100644 index 0000000000..b4e4c4deee Binary files /dev/null and b/Games/Number_Guessing_Game/favicon/favicon-16x16.png differ diff --git a/Games/Number_Guessing_Game/favicon/favicon-32x32.png b/Games/Number_Guessing_Game/favicon/favicon-32x32.png new file mode 100644 index 0000000000..de11ac4442 Binary files /dev/null and b/Games/Number_Guessing_Game/favicon/favicon-32x32.png differ diff --git a/Games/Number_Guessing_Game/favicon/favicon.ico b/Games/Number_Guessing_Game/favicon/favicon.ico new file mode 100644 index 0000000000..fb125fe304 Binary files /dev/null and b/Games/Number_Guessing_Game/favicon/favicon.ico differ diff --git a/Games/Number_Guessing_Game/favicon/site.webmanifest b/Games/Number_Guessing_Game/favicon/site.webmanifest new file mode 100644 index 0000000000..b2853f64f8 --- /dev/null +++ b/Games/Number_Guessing_Game/favicon/site.webmanifest @@ -0,0 +1,19 @@ +{ + "name": "Number Guessing Game", + "short_name": "Number Guessing Game", + "icons": [ + { + "src": "/android-chrome-192x192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "/android-chrome-512x512.png", + "sizes": "512x512", + "type": "image/png" + } + ], + "theme_color": "#ffffff", + "background_color": "#000300", + "display": "standalone" +} diff --git a/Games/Number_Guessing_Game/index.html b/Games/Number_Guessing_Game/index.html new file mode 100644 index 0000000000..400e0c4374 --- /dev/null +++ b/Games/Number_Guessing_Game/index.html @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + Number Guessing Game + + + + + + + +
    +
    +
    +

    Guess The Number

    +

    + We have randomly selected numbers between 1 - 33. Can you guess it? +

    +
    + + +
    + + + + + +
    + +

    + + + +
    +
    + + + \ No newline at end of file diff --git a/Games/Number_Recall_Game/README.md b/Games/Number_Recall_Game/README.md new file mode 100644 index 0000000000..ac9bf046e5 --- /dev/null +++ b/Games/Number_Recall_Game/README.md @@ -0,0 +1,24 @@ +# Number Recall Game + +## Description +The Number Recall Game is a simple web-based game designed to test and improve your memory. The game presents a sequence of numbers that you must memorize and then recall correctly. The sequence grows longer with each round if you recall it correctly, and the game continues until you make a mistake. + +# Functionality +- Displays a sequence of numbers to memorize. +- Increases the length of the sequence with each round. +- Simple and intuitive user interface. +- You can track your current score. + +## Usage +- Open the game by opening index.html in a web browser. +- Click the `Start Game` button to begin. +- A sequence of numbers will be displayed for a short period. +- Memorize the sequence and enter it into the input field once it disappears. +- Click the "Submit" button to check your input. +- If you recall the sequence correctly, a new number will be added to the sequence, and the game continues. +- If you input the sequence incorrectly, the game will end and display the correct sequence. + +## Files +- `index.html`: The main HTML file that sets up the structure of the game. +- `styles.css`: The CSS file that styles the game. +- `script.js`: The JavaScript file that contains the game logic. \ No newline at end of file diff --git a/Games/Number_Recall_Game/background.jpeg b/Games/Number_Recall_Game/background.jpeg new file mode 100644 index 0000000000..61b818de8b Binary files /dev/null and b/Games/Number_Recall_Game/background.jpeg differ diff --git a/Games/Number_Recall_Game/index.html b/Games/Number_Recall_Game/index.html new file mode 100644 index 0000000000..7ebd2441b0 --- /dev/null +++ b/Games/Number_Recall_Game/index.html @@ -0,0 +1,24 @@ + + + + + + Number Recall Game + + + +
    +

    Recall the Number

    +
    +
    + + +
    +
    + + +
    +

    Score is : 0

    + + + diff --git a/Games/Number_Recall_Game/script.js b/Games/Number_Recall_Game/script.js new file mode 100644 index 0000000000..650f50baba --- /dev/null +++ b/Games/Number_Recall_Game/script.js @@ -0,0 +1,73 @@ +document.addEventListener('DOMContentLoaded', () => { + const sequenceDiv = document.getElementById('pattern') + const playerInput = document.getElementById('input') + const submit = document.getElementById('submit') + const start = document.getElementById('start') + const restart = document.getElementById('restart') + const message = document.getElementById('msg') + const score = document.getElementById('score') + + let sequence = [] + let round = 0 + playerInput.disabled = true + submit.disabled = true + + //generate a random number + const generateNextNumber = () => { + return Math.floor(Math.random() * 10); + } + + const showSequence = () => { + //it sets pattern to be the current sequence of numbers ( from array sequence ) + sequenceDiv.innerText = sequence.join(' ') + + //for round 1, sequenceDiv.innerText = '' will get executed after 1400ms, i.e, sequence is shown for 1400ms + setTimeout(() => { + sequenceDiv.innerText = '...' + }, 1000 + 200 * round) //it ensures as the game progresses and round increases, the sequence is displayed for a longer period before it is hidden. + } + + const startGame = () => { + sequence = [] + round = 0 + currScore = 0 + score.innerHTML = 'Score is : ' + currScore + message.innerText = '' + playerInput.value = '' + playerInput.disabled = false + submit.disabled = false + restart.style.display = 'block' + start.style.display = 'none' + nextRound() + } + + //it will show next sequence of numbers + const nextRound = () => { + round++ + sequence.push(generateNextNumber()) + showSequence() + } + + const checkSequence = () => { + //converting input value to an array + const playerSequence = playerInput.value.split('').map(Number) + if (playerSequence.join('') === sequence.join('')) { + // message.innerText = 'Correct!' + currScore += 10 + score.innerHTML = 'Score is : ' + currScore + playerInput.value = '' + setTimeout(() => { + message.innerText = '' + nextRound(); + }, 1000); + } else { + message.innerText = 'Game Over!' + '\n' + 'The correct sequence was: ' + sequence.join('') + playerInput.disabled = true + submit.disabled = true + } + } + + submit.addEventListener('click', checkSequence) + start.addEventListener('click', startGame) + restart.addEventListener('click', startGame) +}) \ No newline at end of file diff --git a/Games/Number_Recall_Game/style.css b/Games/Number_Recall_Game/style.css new file mode 100644 index 0000000000..c6b1eee4d9 --- /dev/null +++ b/Games/Number_Recall_Game/style.css @@ -0,0 +1,58 @@ +body { + font-family: Arial, sans-serif; + display: flex; + justify-content: center; + align-items: center; + height: 100vh; + margin: 0; + background-image: url('./background.jpeg'); + background-position: 10%; + flex-direction: column; +} + +.container { + text-align: center; + backdrop-filter: blur(10px) brightness(72%); + padding: 20px; + border-radius: 10px; + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); + width: 465px; + height: 43%; +} + +.pattern { + font-size: 2em; + margin-bottom: 20px; +} + +#input { + padding: 10px; + font-size: 1em; + margin-bottom: 10px; + outline: none; +} + +#input:hover{ + border: 2px solid navy; +} + +button { + padding: 10px 20px; + font-size: 1em; + margin: 5px; + cursor: pointer; +} + +#msg { + margin-top: 8px; + margin-bottom: 12px; + font-size: 1.1em; + color: rgb(122, 14, 14); +} +#restart{ + display: none; + margin-left: 35%; +} +#score{ + font-size: 1.3em; +} \ No newline at end of file diff --git a/Games/Penguins_Can't_Fly/Penguins_Can't_Fly1.png b/Games/Penguins_Can't_Fly/Penguins_Can't_Fly1.png new file mode 100644 index 0000000000..244b26cc73 Binary files /dev/null and b/Games/Penguins_Can't_Fly/Penguins_Can't_Fly1.png differ diff --git a/Games/Penguins_Can't_Fly/Penguins_Can't_Fly2.png b/Games/Penguins_Can't_Fly/Penguins_Can't_Fly2.png new file mode 100644 index 0000000000..0fba67a53f Binary files /dev/null and b/Games/Penguins_Can't_Fly/Penguins_Can't_Fly2.png differ diff --git a/Games/Penguins_Can't_Fly/Penguins_Can't_Fly3.png b/Games/Penguins_Can't_Fly/Penguins_Can't_Fly3.png new file mode 100644 index 0000000000..b311fa77ae Binary files /dev/null and b/Games/Penguins_Can't_Fly/Penguins_Can't_Fly3.png differ diff --git a/Games/Penguins_Can't_Fly/README.md b/Games/Penguins_Can't_Fly/README.md new file mode 100644 index 0000000000..6e009d6646 --- /dev/null +++ b/Games/Penguins_Can't_Fly/README.md @@ -0,0 +1,19 @@ +# Description # +The game involves a penguin,shark and clouds with the motive of the penguin to avoid the sharks + +# Functionalities # +1.Theme song +2.Bounce song +3.End-of-game song +4.Score update +5.Highest score update +6.The speed of the shark increases every 15 points scored + +# How to play # +1. Press the left arrow to move left +2. Press the right arrow to move right +3. Press the down arrow to move down +4. Moving out of the screen in either direction makes a new penguin appear from the opposite direction +5. The more the penguin falls, the greater the score +6. Getting eaten up by the shark ends the game +7. Press Enter to restart the game diff --git a/Games/Penguins_Can't_Fly/Terserah.ttf b/Games/Penguins_Can't_Fly/Terserah.ttf new file mode 100644 index 0000000000..f62f634fc6 Binary files /dev/null and b/Games/Penguins_Can't_Fly/Terserah.ttf differ diff --git a/Games/Penguins_Can't_Fly/bounce.mp3 b/Games/Penguins_Can't_Fly/bounce.mp3 new file mode 100644 index 0000000000..81efec77ba Binary files /dev/null and b/Games/Penguins_Can't_Fly/bounce.mp3 differ diff --git a/Games/Penguins_Can't_Fly/cloud1.png b/Games/Penguins_Can't_Fly/cloud1.png new file mode 100644 index 0000000000..de1a12d5f9 Binary files /dev/null and b/Games/Penguins_Can't_Fly/cloud1.png differ diff --git a/Games/Penguins_Can't_Fly/cloud2.png b/Games/Penguins_Can't_Fly/cloud2.png new file mode 100644 index 0000000000..7520c18596 Binary files /dev/null and b/Games/Penguins_Can't_Fly/cloud2.png differ diff --git a/Games/Penguins_Can't_Fly/cloud3.png b/Games/Penguins_Can't_Fly/cloud3.png new file mode 100644 index 0000000000..d8b74844aa Binary files /dev/null and b/Games/Penguins_Can't_Fly/cloud3.png differ diff --git a/Games/Penguins_Can't_Fly/game_over.mp3 b/Games/Penguins_Can't_Fly/game_over.mp3 new file mode 100644 index 0000000000..da649b6b69 Binary files /dev/null and b/Games/Penguins_Can't_Fly/game_over.mp3 differ diff --git a/Games/Penguins_Can't_Fly/high_score.txt b/Games/Penguins_Can't_Fly/high_score.txt new file mode 100644 index 0000000000..aa92725341 --- /dev/null +++ b/Games/Penguins_Can't_Fly/high_score.txt @@ -0,0 +1 @@ +76 \ No newline at end of file diff --git a/Games/Penguins_Can't_Fly/jetpack_shark.png b/Games/Penguins_Can't_Fly/jetpack_shark.png new file mode 100644 index 0000000000..54bd0baff8 Binary files /dev/null and b/Games/Penguins_Can't_Fly/jetpack_shark.png differ diff --git a/Games/Penguins_Can't_Fly/main.py b/Games/Penguins_Can't_Fly/main.py new file mode 100644 index 0000000000..0c767a5ca7 --- /dev/null +++ b/Games/Penguins_Can't_Fly/main.py @@ -0,0 +1,211 @@ +import pygame +import random + +pygame.init() +pygame.mixer.init() #for music and audio files in pygame +WIDTH=500 +HEIGHT=650 +fps=60 #sets the framerate-the number of times the timer ticks per second +timer=pygame.time.Clock() +font=pygame.font.Font(r"Terserah.ttf",24) #Font style and font size +huge_font=pygame.font.Font(r"Terserah.ttf",42) #Font style and font size +pygame.display.set_caption("Penguins Can't Fly") + +screen=pygame.display.set_mode([WIDTH,HEIGHT]) +bg=(135,206,235) +game_over=False +clouds=[[200,100,1],[50,330,2],[350,330,3],[200,500,1]] +cloud_images=[] +for i in range(1,4): + img=pygame.image.load(f'cloud{i}.png') #loads new image from a file + cloud_images.append(img) + +player_x=240 +player_y=40 +penguin=pygame.transform.scale(pygame.image.load('penguin.png'),(50,50)) #scales the penguin to a new dimension +direction=-1 +y_speed=0 +gravity=0.2 +x_speed=3 +x_direction=0 +score=0 +total_distance=0 +file=open('high_score.txt','r') +read=file.readlines() +first_high=int(read[0]) +high_score=first_high +shark=pygame.transform.scale(pygame.image.load('jetpack_shark.png'),(300,200)) +enemies=[[-234,random.randint(400,HEIGHT-100),1]] #the last value '1' specifies the direction of movement of the shark +pygame.mixer.music.load('theme.mp3') #Load a music file for playback +bounce=pygame.mixer.Sound('bounce.mp3') #Create a new Sound object from a file or buffer object +end_sound=pygame.mixer.Sound('game_over.mp3') +pygame.mixer.music.play() +pygame.mixer.music.set_volume(0.2) + + +def draw_clouds(cloud_list,images): + platforms=[] + for j in range(len(cloud_list)): + image=images[cloud_list[j][2]-1] + platform=pygame.rect.Rect((cloud_list[j][0]+5,cloud_list[j][1]+40),(120,10)) #displays the rectangle + screen.blit(image,(cloud_list[j][0],cloud_list[j][1])) #displays the image drawn on the screen + pygame.draw.rect(screen,'gray',[cloud_list[j][0]+5,cloud_list[j][1]+40,120,3]) + platforms.append(platform) + return platforms + +def draw_player(x_pos,y_pos,player_img,direc): + if direc== -1: + player_img=pygame.transform.flip(player_img,False,True) #flips image in the y-direction keeping it unchanged in the x-direction + screen.blit(player_img,(x_pos,y_pos)) #draws the player_img onto the screen at the coordinates specified + player_rect=pygame.rect.Rect((x_pos+7,y_pos+40),(36,10)) + #pygame.draw.rect(screen,'green',player_rect,3) + return player_rect + +def draw_enemies(enemy_list,shark_img): + enemy_rects=[] + for j in range(len(enemy_list)): + enemy_rect=pygame.rect.Rect((enemy_list[j][0]+40,enemy_list[j][1]+50),(215,70)) + #pygame.draw.rect(screen,'orange',enemy_rect,3) + enemy_rects.append(enemy_rect) + if(enemy_list[j][2]==1): + screen.blit(shark_img,(enemy_list[j][0],enemy_list[j][1])) + elif(enemy_list[j][2]==-1): + screen.blit(pygame.transform.flip(shark_img,1,0),(enemy_list[j][0],enemy_list[j][1])) + return enemy_rects + +def move_enemies(enemy_list,current_score): + enemy_speed=2+current_score//15 + for j in range(len(enemy_list)): + if(enemy_list[j][2]==1): + if(enemy_list[j][0]-235): + enemy_list[j][0]-=enemy_speed #increase the x_coord if still on the screen + else: + enemy_list[j][2]=1 #reverse the direction if off the screen + if(enemy_list[j][1]<-100): + enemy_list[j][1]=random.randint(HEIGHT,HEIGHT+500) #if the shark goes offscreen in the vertical direction, make a new shark beneath the screen + return enemy_list,current_score + +def update_objects(cloud_list,play_y,enemy_list): + lowest_cloud=0 + update_speed=5 + if play_y>200: + play_y-=update_speed #moves the player up as well as the clouds up so that it seems that the surrounding is falling + for q in range(len(enemy_list)): + enemy_list[q][1]-=update_speed + for j in range(len(cloud_list)): + cloud_list[j][1]-=update_speed + if(cloud_list[j][1]>lowest_cloud): + lowest_cloud=cloud_list[j][1] + + if lowest_cloud<600: #randomly generate one or two clouds + num_clouds=random.randint(1,2) + if num_clouds==1: + x_pos=random.randint(0,WIDTH-70) + y_pos=random.randint(HEIGHT+100,HEIGHT+300) + cloud_type=random.randint(1,3) + cloud_list.append([x_pos,y_pos,cloud_type]) + else: + x_pos=random.randint(0,WIDTH//2-70) #also ensure that the two clouds generated don't overlap with each other + y_pos=random.randint(HEIGHT+100,HEIGHT+300) + cloud_type=random.randint(1,3) + cloud_list.append([x_pos,y_pos,cloud_type]) + + x_pos2=random.randint(WIDTH//2+70,WIDTH-70) + y_pos2=random.randint(HEIGHT+100,HEIGHT+300) + cloud_type2=random.randint(1,3) + cloud_list.append([x_pos2,y_pos2,cloud_type2]) + return play_y,cloud_list,enemy_list + + +run=True +while run: + screen.fill(bg) + timer.tick(fps) + cloud_platforms=draw_clouds(clouds,cloud_images) + player=draw_player(player_x,player_y,penguin,direction) + enemy_boxes=draw_enemies(enemies,shark) + enemies,score=move_enemies(enemies,score) + player_y,clouds,enemies=update_objects(clouds,player_y,enemies) + if game_over: + player_y=-300 + end_text=huge_font.render('Penguins can\'t Fly',True,'black') #draw text on a new Surface + end_text2=font.render('Game Over: Press Enter to Restart',True,'black') + screen.blit(end_text,(70,20)) + screen.blit(end_text2,(60,80)) + y_speed=0 + + for i in range(len(cloud_platforms)): #the collsion detection + if direction== -1 and player.colliderect(cloud_platforms[i]): + y_speed*=-1 #reverses the direction of the penguin + if y_speed>-2: #keeps a minimum speed of -2 + y_speed=-2 + bounce.play() + + + for event in pygame.event.get(): #get events from the queue + if event.type==pygame.QUIT: + run=False + if event.type==pygame.KEYDOWN: #a key is pressed + if event.key==pygame.K_LEFT: #left arrow is pressed + x_direction=-1 + elif event.key==pygame.K_RIGHT: #right arrow is pressed + x_direction=1 + if event.key==pygame.K_RETURN and game_over: + game_over=False + player_x=240 + player_y=40 + direction=-1 + y_speed=0 + x_direction=0 + score=0 + total_distance=0 + enemies=[[-234,random.randint(400,HEIGHT-100),1]] + clouds=[[200,100,1],[50,330,2],[350,330,3],[200,500,1]] + pygame.mixer.music.play() + + if event.type==pygame.KEYUP: #a key is released + if event.key==pygame.K_LEFT: + x_direction=0 + elif event.key==pygame.K_RIGHT: + x_direction=0 + + if(y_speed<5 and not game_over): + y_speed+=gravity #increases the speed in the y-direction + player_y+=y_speed #increases the y-position of the penguin + if(y_speed<0): + direction=1 #if the y-speed is negative penguin is going up + else: + direction=-1 #else down + player_x+=x_speed*x_direction + if player_x>WIDTH: #handles the case when the penguin goes off screen in the x-direction + player_x=-30 + elif player_x<-50: + player_x=WIDTH-20 + + for i in range(len(enemy_boxes)): + if player.colliderect(enemy_boxes[i]) and not game_over: + end_sound.play() + game_over=True + if(score>first_high): + file=open('high_score.txt','w') + write_score=str(score) + file.write(write_score) + file.close() + first_high=score + + total_distance+=y_speed + score=round(total_distance/100) + score_text=font.render(f'Score: {score}',True,'black') + screen.blit(score_text,(10,HEIGHT-70)) + high_score=max(score,high_score) + score_text2=font.render(f'High Score: {high_score}',True,'black') + screen.blit(score_text2,(10,HEIGHT-40)) + + pygame.display.flip() #Update the full display Surface to the screen +pygame.quit() + diff --git a/Games/Penguins_Can't_Fly/penguin.png b/Games/Penguins_Can't_Fly/penguin.png new file mode 100644 index 0000000000..cb5a5eabe0 Binary files /dev/null and b/Games/Penguins_Can't_Fly/penguin.png differ diff --git a/Games/Penguins_Can't_Fly/theme.mp3 b/Games/Penguins_Can't_Fly/theme.mp3 new file mode 100644 index 0000000000..ef9c7dfdb6 Binary files /dev/null and b/Games/Penguins_Can't_Fly/theme.mp3 differ diff --git a/Games/Penguins_Can't_Fly/wee.mp3 b/Games/Penguins_Can't_Fly/wee.mp3 new file mode 100644 index 0000000000..7a5d1782e1 Binary files /dev/null and b/Games/Penguins_Can't_Fly/wee.mp3 differ diff --git a/Games/Physics_Quizz/README.md b/Games/Physics_Quizz/README.md new file mode 100644 index 0000000000..57ce18a954 --- /dev/null +++ b/Games/Physics_Quizz/README.md @@ -0,0 +1,25 @@ +# **Physics Quiz** + + +## **Description ๐Ÿ“ƒ** +It is a basic Physics Questions Quiz. + + +
    + +## **Functionalities ๐ŸŽฎ** + +Player need to find the correct answer to the maximum number of questions within 1 minute/60 seconds. + +
    + +## **How to play? ๐Ÿ•น๏ธ** + +1. Start the quiz on your preferred platform. +2. Click on the Start Quiz button to start the quiz. +3. Your goal is to answer maximum number of questions within 60 seconds. +
    + + +## **Screenshots ๐Ÿ“ธ** +![image](https://github.com/kunjgit/GameZone/assets/168436423/d76615f7-7a71-4178-b54f-d07dbb47cd42) \ No newline at end of file diff --git a/Games/Physics_Quizz/assets/background_image.jpeg b/Games/Physics_Quizz/assets/background_image.jpeg new file mode 100644 index 0000000000..5098048648 Binary files /dev/null and b/Games/Physics_Quizz/assets/background_image.jpeg differ diff --git a/Games/Physics_Quizz/index.html b/Games/Physics_Quizz/index.html new file mode 100644 index 0000000000..694fd6dc01 --- /dev/null +++ b/Games/Physics_Quizz/index.html @@ -0,0 +1,26 @@ + + + + + Quiz App + + + + +
    +

    Physics Quiz Game

    +
    +

    +
    +
    +
    + +
    + Time Left: 0 +
    +
    +
    + + + + \ No newline at end of file diff --git a/Games/Physics_Quizz/script.js b/Games/Physics_Quizz/script.js new file mode 100644 index 0000000000..7d93152600 --- /dev/null +++ b/Games/Physics_Quizz/script.js @@ -0,0 +1,186 @@ +const quizQuestions = [ + { + question: "A substance which takes the shape of its container and has a definite volume is a ", + options: ["solid", "liquid", "gas", "crystal"], + correctAnswer: "liquid" + }, + { + question: "What happens to a gas when the temperature decreases ", + options: ["It expands", "It rises.", "It condenses", "It becomes less dense."], + correctAnswer: "It condenses" + }, + { + question: "Any material that does not allow heat to pass through it easily is called ", + options: ["conductor", "expand", "contract", "insulator"], + correctAnswer: "insulator" + }, + { + question: "A material through which heat and electricity flow easily is called ", + options: ["Resistancer", "conductor", "Short circuit", "insulator"], + correctAnswer: "conductor" + }, + { + question: "If you were on the Moon, there would be a change in your ", + options: ["weight and mass", "weight", "mass", "voulme"], + correctAnswer: "weight" + }, + { + question: "The process by which a liquid changes to a gas is called ", + options: ["evaporation", "condensation", "precipitation", "transpiration"], + correctAnswer: "evaporation" + }, + { + question: "The ability to do work is called ", + options: ["rest", "force", "motion", "energy"], + correctAnswer: "energy" + }, + { + question: "A force that occurs when an object rubs against another object ", + options: ["friction", "conduction", "thermometer", "radiation"], + correctAnswer: "friction" + }, + { + question: "Something that makes an object start moving, stop moving, speed up, or slow down is a ", + options: ["position", "force", "effort", "load"], + correctAnswer: "force" + }, + { + question: "The buildup of electric charges in one place is called ", + options: ["Static electricity", "Electric charge", "Electric field", "Electric circuit"], + correctAnswer: "Static electricity" + }, + { + question: "The force that attracts a body toward the center of Earth, or toward any other physical body having mass.", + options: ["planet", "weightless", "gravity", "orbit"], + correctAnswer: "gravity" + }, + { + question: "The atoms in which state shake, but don't move freely?", + options: ["liquid", "solid", "gas", "mixture"], + correctAnswer: "solid" + }, + { + question: "An example of a gas is ", + options: ["chocolate syrup", "a rock", " a pencil", "helium"], + correctAnswer: "helium" + }, + { + question: "The temperature at which a gas becomes a liquid is called the ", + options: ["freezing point", "condensation point", "boiling point", "sublimation"], + correctAnswer: "boiling point" + }, + { + question: "Water freezes at what temperature?", + options: ["212 degrees F", "32 degrees C", "32 degrees F", "212 degrees C"], + correctAnswer: "32 degrees F" + } +]; + +// Variables to track quiz state +let currentQuestionIndex = 0; +let score = 0; +let timeLeft = 60; +let timerInterval; + +// Function to start the quiz +function startQuiz() { + document.getElementById("start-button").style.display = "none"; + displayQuestion(); + startTimer(); +} + +// Function to display a question and its options +function displayQuestion() { + const currentQuestion = quizQuestions[currentQuestionIndex]; + const questionText = document.getElementById("question-text"); + const answerButtons = document.getElementById("answer-buttons"); + + // Clear previous question and answer options + questionText.innerHTML = ""; + answerButtons.innerHTML = ""; + + // Display the current question + questionText.innerHTML = currentQuestion.question; + + // Create answer buttons for each option + currentQuestion.options.forEach(option => { + const button = document.createElement("button"); + button.innerText = option; + button.classList.add("answer-button"); + answerButtons.appendChild(button); + + // Add click event listener to check the answer + button.addEventListener("click", function () { + checkAnswer(option, button); + }); + }); +} + +// Function to check the selected answer +function checkAnswer(selectedOption, button) { + const currentQuestion = quizQuestions[currentQuestionIndex]; + const answerButtons = document.getElementById("answer-buttons"); + + // Check if the selected answer is correct + if (selectedOption === currentQuestion.correctAnswer) { + score++; + button.style.backgroundColor = "darkgreen"; + } else { + // Indicate the selected answer is wrong + button.style.backgroundColor = "red"; + + // Display the correct answer if the selected answer is incorrect + const correctAnswerElement = document.createElement("div"); + correctAnswerElement.classList.add("correct-answer"); + correctAnswerElement.innerText = `Correct Answer: ${currentQuestion.correctAnswer}`; + answerButtons.appendChild(correctAnswerElement); + } + + // Move to the next question or end the quiz after a short delay + setTimeout(() => { + currentQuestionIndex++; + if (currentQuestionIndex < quizQuestions.length) { + displayQuestion(); + } else { + endQuiz(); + } + }, 1000); +} + +// Function to start the timer +function startTimer() { + // Update the timer text immediately + document.getElementById("timer").textContent = timeLeft; + + timerInterval = setInterval(function () { + timeLeft--; + + // Update the timer text + document.getElementById("timer").textContent = timeLeft; + + // End the quiz if time runs out + if (timeLeft <= 0) { + endQuiz(); + } + }, 1000); +} + +// Function to end the quiz +function endQuiz() { + // Stop the timer + clearInterval(timerInterval); + + // Calculate the score percentage + const scorePercentage = (score / quizQuestions.length) * 100; + + // Display the final score + const questionContainer = document.getElementById("question-container"); + questionContainer.innerHTML = ` +

    Quiz Completed!

    +

    Your Score: ${score} out of ${quizQuestions.length}

    +

    Score Percentage: ${scorePercentage}%

    + `; +} + + +document.getElementById("start-button").addEventListener("click", startQuiz); diff --git a/Games/Physics_Quizz/style.css b/Games/Physics_Quizz/style.css new file mode 100644 index 0000000000..bbec90d511 --- /dev/null +++ b/Games/Physics_Quizz/style.css @@ -0,0 +1,75 @@ +body { + background-color: #f2f2f2; + font-family: Arial, sans-serif; + display: flex; + justify-content: center; + align-items: center; + height: 100vh; + background-image: url('./background-image/backgroundimage.jpeg'); + background-size: cover; + +} + +.quiz-container { + max-width: 500px; + background-color: #5c50dd; + border-radius: 10px; + padding: 20px; + animation: fadeIn 1s ease-in-out; + box-shadow: 0 4px 6px rgba(25, 89, 172, 0.1); + transition: box-shadow 0.3s ease-in-out; +} + +h1 { + text-align: center; + +} + +#question-container { + margin-bottom: 20px; +} + +#question-text { + font-size: 18px; + margin-bottom: 10px; +} + +#answer-buttons { + display: grid; + grid-template-columns: repeat(2, 1fr); + grid-gap: 10px; +} + +button { + height: 40px; + font-size: 16px; + background-color: #dfdedf; + border: none; + border-radius: 5px; + cursor: pointer; +} + +button:hover { + background-color: #26c488; +} + +#controls-container { + display: flex; + justify-content: space-between; + align-items: center; + font-weight: "bold"; +} + +#timer-container { + display: flex; + align-items: center; +} + +#timer-text { + font-size: 14px; +} + +#timer { + font-weight: bold; + margin-left: 5px; +} \ No newline at end of file diff --git a/Games/Quick_Click/README.md b/Games/Quick_Click/README.md new file mode 100644 index 0000000000..a8e368f522 --- /dev/null +++ b/Games/Quick_Click/README.md @@ -0,0 +1,39 @@ +Quick Click Game using HTML, CSS, and JavaScript. The game features a grid of square , with one square becoming active randomly to show a Different Colour. The player must click the active square to score points. The game will end if the player clicks a non-active Square or when the timer reaches zero. + +Features + + Play memory game with short musical notes. + Difficulty levels to adjust the number of musical pairs. + Track your score and high score. + Clean and responsive design for any device. +How to Play + + Clicking the start button initializes the game with a score of 0 and a timer set to 60 seconds. + A Yellow Square appears randomly in one of the squares every second. + + Scoring: + + Clicking the active square (with the Yellow Square) increments the score by 1. + The Yellow Square disappears and reappears in another random square. + + Game End Conditions: + + Clicking a non-active square ends the game with a "You Lose!" message. + The timer reaching zero ends the game with a "Time's Up! Game Over!" message displaying the final score. + + Resetting: + + At the end of the game, the active Yellow Square disappears, event listeners are removed, and the start button is re-enabled. + +Technologies Used + + HTML: Creates the structure of the game board and interface. + CSS: Styles the game elements for a visually appealing experience. + JavaScript: Manages the game logic, including card flipping, matching sounds, and scorekeeping. +Running the Game + + Ensure you have a web browser installed on your computer (e.g., Chrome, Firefox, Safari). + Clone or download the project files. + Open the index.html file in your web browser. + The game should launch and be ready to play! + diff --git a/Games/Quick_Click/assets/Images/image.png b/Games/Quick_Click/assets/Images/image.png new file mode 100644 index 0000000000..41d0f7dc35 Binary files /dev/null and b/Games/Quick_Click/assets/Images/image.png differ diff --git a/Games/Quick_Click/index.html b/Games/Quick_Click/index.html new file mode 100644 index 0000000000..9c345b7c68 --- /dev/null +++ b/Games/Quick_Click/index.html @@ -0,0 +1,33 @@ + + + + + + + Quick Click + + + + +

    Quick Click

    +
    + Score: 0 + Time: 60s +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + \ No newline at end of file diff --git a/Games/Quick_Click/script.js b/Games/Quick_Click/script.js new file mode 100644 index 0000000000..03e9b10968 --- /dev/null +++ b/Games/Quick_Click/script.js @@ -0,0 +1,61 @@ +const circles = document.querySelectorAll('.circle'); +const scoreDisplay = document.getElementById('score'); +const timeDisplay = document.getElementById('time'); +const startButton = document.getElementById('start'); +let score = 0; +let activeCircle = null; +let gameTimer = null; +let countdownTimer = null; +let timeLeft = 60; + +function randomCircle() { + circles.forEach(circle => circle.classList.remove('active')); + const randomIndex = Math.floor(Math.random() * circles.length); + activeCircle = circles[randomIndex]; + activeCircle.classList.add('active'); + console.log("Random Circle Selected:", activeCircle); +} + +function startGame() { + score = 0; + timeLeft = 60; + scoreDisplay.textContent = score; + timeDisplay.textContent = timeLeft; + startButton.disabled = true; + randomCircle(); + gameTimer = setInterval(randomCircle, 1000); + countdownTimer = setInterval(countDown, 1000); + circles.forEach(circle => circle.addEventListener('click', whack)); + console.log("Game Started"); +} + +function whack(event) { + if (event.target === activeCircle) { + score++; + scoreDisplay.textContent = score; + activeCircle.classList.remove('active'); + randomCircle(); + } else { + endGame('You Lose!'); + } +} + +function countDown() { + timeLeft--; + timeDisplay.textContent = timeLeft; + if (timeLeft <= 0) { + endGame('Time\'s Up! Game Over!'); + } +} + +function endGame(message) { + console.log("Game Ended:", message); + clearInterval(gameTimer); + clearInterval(countdownTimer); + circles.forEach(circle => circle.classList.remove('active')); + circles.forEach(circle => circle.removeEventListener('click', whack)); + startButton.disabled = false; + alert(`${message} Your final score is ${score}`); +} + +startButton.addEventListener('click', startGame); \ No newline at end of file diff --git a/Games/Quick_Click/style.css b/Games/Quick_Click/style.css new file mode 100644 index 0000000000..5bd09e6d77 --- /dev/null +++ b/Games/Quick_Click/style.css @@ -0,0 +1,48 @@ +body { + font-family: Arial, sans-serif; + text-align: center; + background-color: #f0f0f0; + margin: 0; + padding: 0; +} + +h1 { + margin-top: 20px; +} + +.scoreboard { + margin: 20px 0; + font-size: 1.5em; +} + +.grid { + display: grid; + grid-template-columns: repeat(3, 100px); + grid-gap: 10px; + justify-content: center; + margin: 20px auto; +} + +.circle { + width: 100px; + height: 100px; + background-color: #ccc; + border-radius: 50%; + position: relative; + cursor: pointer; +} + +.circle.active { + background-image: url('GameZone\Games\Reflex_text\Mole2.jpg'); + background-size: cover; + background-position: center; + background-color: #ffd700; + /* Fallback background color */ +} + +button { + margin-top: 20px; + padding: 10px 20px; + font-size: 1em; + cursor: pointer; +} \ No newline at end of file diff --git a/Games/Reverse Memory Game b/Games/Reverse Memory Game new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/Games/Reverse Memory Game @@ -0,0 +1 @@ + diff --git a/Games/Reverse Memory/README.md b/Games/Reverse Memory/README.md new file mode 100644 index 0000000000..178c314332 --- /dev/null +++ b/Games/Reverse Memory/README.md @@ -0,0 +1,44 @@ +# Reverse Memory Game + +The Reverse Memory Game is a fun and challenging memory game where you must recall a sequence of colors in reverse order. With each successful recall, the sequence length increases, making the game progressively harder. + +## How to Play + +1. **Select Grid Size**: Choose the grid size (3x3, 4x4, 5x5, or 6x6) from the dropdown menu. +2. **Start Game**: Click the "Start Game" button to begin. +3. **Memorize Colors**: A color will briefly appear on one of the grid squares. Memorize its position. +4. **Recall Sequence**: After the color disappears, click the grid squares in the reverse order of the sequence shown. +5. **Level Up**: If you recall the sequence correctly, a new color will be added to the sequence. Continue to recall the sequence in reverse order as the length increases. +6. **Game Over**: If you select the wrong grid square, the game will end and prompt you to try again. + +## Features + +- **Reverse Memory**: Recall colors in reverse order for a unique challenge. +- **Level Up System**: Sequence length increases with each correct recall. +- **Customizable Grid Size**: Choose from 3x3, 4x4, 5x5, or 6x6 grid sizes. +- **Simple Interface**: Easy to learn with a familiar grid and vibrant colors. +- **Feedback**: Visual cues for right and wrong answers to enhance engagement. + +## Setup and Installation + +1. **Clone the repository**: + ```sh + git clone https://github.com/your-username/reverse-memory-game.git +2. cd reverse-memory-game +3. Run the HTML file in your Browser +4. Play and make fun + +reverse-memory-game/ +โ”œโ”€โ”€ index.html +โ”œโ”€โ”€ styles.css +โ””โ”€โ”€ script.js + +## License +This project is licensed under the MIT License. + +## Contributing +Contributions are welcome! Feel free to open an issue or submit a pull request. + +## Acknowledgments +This game was inspired by classic memory games and is designed to challenge and improve your memory skills. +Special thanks to the contributors and the open-source community for their support. diff --git a/Games/Reverse Memory/index.html b/Games/Reverse Memory/index.html new file mode 100644 index 0000000000..4ac10f0583 --- /dev/null +++ b/Games/Reverse Memory/index.html @@ -0,0 +1,29 @@ + + + + + + Reverse Memory Game + + + +
    +

    Reverse Memory Game

    +
    + + + +
    +
    + +
    +

    +
    + + + diff --git a/Games/Reverse Memory/script.js b/Games/Reverse Memory/script.js new file mode 100644 index 0000000000..69fff3c3ce --- /dev/null +++ b/Games/Reverse Memory/script.js @@ -0,0 +1,128 @@ +const colors = ['#e57373', '#81c784', '#64b5f6', '#ffd54f', '#ba68c8', '#ff8a65']; +let gridSize = 3; +let sequence = []; +let userSequence = []; +let level = 0; + +document.addEventListener('DOMContentLoaded', () => { + const gridContainer = document.getElementById('grid-container'); + const startButton = document.getElementById('start-button'); + const gridSizeSelect = document.getElementById('grid-size'); + const status = document.getElementById('status'); + + // Start button click event + startButton.addEventListener('click', startGame); + + // Grid size change event + gridSizeSelect.addEventListener('change', (e) => { + gridSize = parseInt(e.target.value); + createGrid(); + }); + + // Square click event + gridContainer.addEventListener('click', (e) => { + if (e.target.classList.contains('grid-square')) { + handleSquareClick(e.target.dataset.index); + } + }); + + function createGrid() { + gridContainer.innerHTML = ''; + gridContainer.style.gridTemplateColumns = `repeat(${gridSize}, 100px)`; + for (let i = 0; i < gridSize * gridSize; i++) { + const square = document.createElement('div'); + square.classList.add('grid-square'); + square.dataset.index = i; + gridContainer.appendChild(square); + } + } + + function startGame() { + level = 0; + sequence = []; + userSequence = []; + status.textContent = 'Game started!'; + nextLevel(); + } + + function nextLevel() { + level++; + userSequence = []; + const randomSquare = Math.floor(Math.random() * gridSize * gridSize); + const newColor = colors[Math.floor(Math.random() * colors.length)]; + sequence.push({ index: randomSquare, color: newColor }); + displaySequence(); + } + + function displaySequence() { + let i = 0; + const interval = setInterval(() => { + const squareData = sequence[i]; + const square = document.querySelector(`[data-index='${squareData.index}']`); + showColor(square, squareData.color); + i++; + if (i >= sequence.length) { + clearInterval(interval); + } + }, 1000); + } + + function showColor(square, color) { + const originalColor = square.style.backgroundColor; + square.style.backgroundColor = color; + setTimeout(() => { + square.style.backgroundColor = originalColor; + }, 500); + } + + function handleSquareClick(index) { + if (userSequence.length < sequence.length) { + const square = document.querySelector(`[data-index='${index}']`); + const squareData = sequence[sequence.length - userSequence.length - 1]; + showColor(square, squareData.color); + userSequence.push({ index: parseInt(index), color: squareData.color }); + + // Check the sequence after each click + if (!checkPartialSequence()) { + status.textContent = 'Wrong! Try again.'; + resetGame(); + return; + } + + // If the full sequence is entered, validate it + if (userSequence.length === sequence.length) { + if (checkSequence()) { + status.textContent = 'Correct! Next level...'; + setTimeout(nextLevel, 1000); + } else { + status.textContent = 'Wrong! Try again.'; + resetGame(); + } + } + } + } + + function checkPartialSequence() { + // Check the user sequence against the reversed sequence up to the current length + for (let i = 0; i < userSequence.length; i++) { + if (userSequence[i].index !== sequence[sequence.length - 1 - i].index) { + return false; + } + } + return true; + } + + function checkSequence() { + // Check if the entire user sequence matches the reversed game sequence + return userSequence.every((data, index) => data.index === sequence[sequence.length - 1 - index].index); + } + + function resetGame() { + sequence = []; + userSequence = []; + level = 0; + } + + // Create the initial grid + createGrid(); +}); diff --git a/Games/Reverse Memory/styles.css b/Games/Reverse Memory/styles.css new file mode 100644 index 0000000000..2f06af729e --- /dev/null +++ b/Games/Reverse Memory/styles.css @@ -0,0 +1,84 @@ +@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap'); + +body { + font-family: 'Roboto', sans-serif; + display: flex; + justify-content: center; + align-items: center; + height: 100vh; + margin: 0; + background: linear-gradient(135deg, #f6d365 0%, #fda085 100%); +} + +#game-container { + text-align: center; + background-color: rgba(255, 255, 255, 0.9); + padding: 20px; + border-radius: 15px; + box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); +} + +h1 { + color: #333; + margin-bottom: 20px; +} + +#controls { + display: flex; + justify-content: center; + align-items: center; + margin-bottom: 20px; +} + +#grid-size { + margin-left: 10px; + padding: 5px; + font-size: 16px; + border-radius: 5px; + border: 1px solid #ccc; +} + +#grid-container { + display: grid; + grid-gap: 10px; + margin: 20px auto; +} + +.grid-square { + width: 100px; + height: 100px; + background-color: #ddd; + border: 2px solid #ccc; + cursor: pointer; + transition: background-color 0.3s, transform 0.3s, box-shadow 0.3s; + border-radius: 10px; +} + +.grid-square:hover { + transform: scale(1.1); + box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); +} + +#start-button { + padding: 10px 20px; + font-size: 16px; + cursor: pointer; + background-color: #333; + color: white; + border: none; + border-radius: 10px; + transition: background-color 0.3s, transform 0.3s, box-shadow 0.3s; + margin-left: 10px; +} + +#start-button:hover { + background-color: #555; + transform: scale(1.1); + box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); +} + +#status { + margin-top: 20px; + font-size: 18px; + color: #333; +} diff --git a/Games/Roll_The_Dice/README.md b/Games/Roll_The_Dice/README.md new file mode 100644 index 0000000000..902a7a1126 --- /dev/null +++ b/Games/Roll_The_Dice/README.md @@ -0,0 +1,49 @@ +**Roll the Dice** + +--- + +
    + +## **Description ๐Ÿ“ƒ** + + + +-Roll the Dice is a simple and fun game where the objective is to roll a pair of dice and try to achieve a specific score or beat your previous best. It's a game of chance that tests your luck and provides an exciting challenge each time you play. + +## **functionalities ๐ŸŽฎ** + + + +- Clean and intuitive user interface +- Realistic dice rolling animation +- Option to roll one or two dice +- Score tracking to keep track of your progress +- Ability to reset the game and start a new session +
    + +## **How to play? ๐Ÿ•น๏ธ** + + + +- The game presents you with a button to roll the dice. +- Your goal is to roll the dice and try to achieve the highest possible score. +- Click or tap on the "Roll" button to roll the dice. +- The dice will roll and display a random number between 1 and 6 for each die. +- The sum of the numbers on the dice will be your score for that roll. +- The game keeps track of your total score and the number of rolls. +- If you wish to roll again, simply click or tap on the "Roll" button again. +- You can continue rolling the dice as many times as you like. +- The game can be reset at any time by clicking or tapping on the "Reset" button. +- Enjoy the thrill of the roll and aim for the highest score possible! + +
    + +## **ScreenShots** + +![Dice_Number](./images/dice1.png) +![Dice_Number](./images/dice2.png) +![Dice_Number](./images/dice3.png) +![Dice_Number](./images/dice4.png) +![Dice_Number](./images/dice5.png) +![Dice_Number](./images/dice6.png) +
    \ No newline at end of file diff --git a/Games/Roll_The_Dice/index.html b/Games/Roll_The_Dice/index.html new file mode 100644 index 0000000000..d09c154b47 --- /dev/null +++ b/Games/Roll_The_Dice/index.html @@ -0,0 +1,31 @@ + + + + + Dicee + + + + + +
    +

    Refresh Me

    + +
    +

    Player 1

    + +
    + +
    +

    Player 2

    + +
    + +
    + + + + +
    +
    + diff --git a/Games/Roll_The_Dice/index.js b/Games/Roll_The_Dice/index.js new file mode 100644 index 0000000000..ecdb504690 --- /dev/null +++ b/Games/Roll_The_Dice/index.js @@ -0,0 +1,19 @@ +var randomNumber1 = Math.floor(Math.random() * 6 + 1); +var randomImage = "Dice" + randomNumber1 + ".png"; +var randomImageSource1 = "images/" + randomImage; +var image1 = document.querySelectorAll("img")[0]; +image1.setAttribute("src", randomImageSource1); + +var randomNumber2 = Math.floor(Math.random() * 6 + 1); +var randomImageSource2 = "images/Dice" + randomNumber2 + ".png"; +// var randomImageSource2 = "images/" + randomImage; + +document.querySelectorAll("img")[1].setAttribute("src",randomImageSource2); + +if(randomNumber1 > randomNumber2){ + document.querySelector("h1").innerHTML = "Player 1 Won!!!"; + // alert("player 1 won"); +} +else if(randomNumber2>randomNumber1){ + document.querySelector("h1").innerHTML= "player 2 Won!!!" +} \ No newline at end of file diff --git a/Games/Roll_The_Dice/styles.css b/Games/Roll_The_Dice/styles.css new file mode 100644 index 0000000000..3c59a91198 --- /dev/null +++ b/Games/Roll_The_Dice/styles.css @@ -0,0 +1,33 @@ +body { + background-color: #464239; +} +.container { + width: 70%; + margin: auto; + text-align: center; +} + +.dice { + text-align: center; + display: inline-block; +} + + +h1 { + margin: 30px; + font-family: 'Lobster', cursive; + text-shadow: 5px 0 #baeaa2; + font-size: 8rem; + color: #4ECCA3; +} + +p { + font-size: 4rem; + color: #4ECCA3; + /* font-family: 'Indie Flower', cursive; */ +} + +img { + width: 80%; +} + diff --git a/Games/Soccer/README.md b/Games/Soccer/README.md new file mode 100644 index 0000000000..7cf796cc35 --- /dev/null +++ b/Games/Soccer/README.md @@ -0,0 +1,38 @@ +# **Soccer** + + +## **Description ๐Ÿ“ƒ** +It is a two player soccer game where the player with maximum number of goals is declared the winner. + + +
    + +## **Functionalities ๐ŸŽฎ** + +Player must use the arrow keys and the a/s/d/w keys to move your player and aim a goal. The player with higher number of goals in the set time limit is declared as the winner. Enjoy a strategic and fun-filled challenge with dynamic movement of the players! + +
    + +## **How to play? ๐Ÿ•น๏ธ** + +1. Start the game on your preferred platform. +2. Click on the start button to start the game. +3. Each player's goal is to aim a goal. Player with maximum goal is the winner. +4. Click on play again to play again. + +
    + +## **Installation** +1. Clone or download the repository. +2. Navigate to the downloaded repository. +3. Open index.html with live server. + + + + +
    + +## **Screenshots ๐Ÿ“ธ** + +
    +Game Screenshot diff --git a/Games/Soccer/index.html b/Games/Soccer/index.html new file mode 100644 index 0000000000..76c7716c77 --- /dev/null +++ b/Games/Soccer/index.html @@ -0,0 +1,24 @@ + + + + + + Soccer Penalty Shootout + + + +
    +
    +

    Instructions

    +

    Player 1 uses keys W/A/S/D to move

    +

    Player 2 uses Arrow keys to move

    +

    The player with the most goals in 3 minutes wins!

    + +
    + + + +
    + + + diff --git a/Games/Soccer/script.js b/Games/Soccer/script.js new file mode 100644 index 0000000000..ad91e61b63 --- /dev/null +++ b/Games/Soccer/script.js @@ -0,0 +1,464 @@ +var canvas = document.getElementById("canvas"); +var c = canvas.getContext("2d"); +var out = document.getElementById("out"); +var timerDisplay = document.getElementById("timer"); +var instructions = document.getElementById("instructions"); +var startButton = document.getElementById("startButton"); + +window.requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame; + +var player1 = new Player(100,250); +var player2 = new Player(600,250); +var ball = new Ball(350,250); +var wDown = false; +var sDown = false; +var aDown = false; +var dDown = false; +var upDown = false; +var downDown = false; +var leftDown = false; +var rightDown = false; +var timeLeft = 180; // 3 minutes in seconds +var gameInterval; + +function startGame(){ + instructions.style.display = 'none'; + canvas.style.display = 'block'; + out.style.display = 'block'; + timerDisplay.style.display = 'block'; + + gameInterval = setInterval(function(){ + timeLeft--; + updateTimer(); + if (timeLeft <= 0) { + clearInterval(gameInterval); + endGame(); + } + }, 1000); + requestAnimationFrame(start); +} + +startButton.addEventListener("click", startGame); + +function start(){ + clear(); + renderBackground(); + renderGates(); + checkKeyboardStatus(); + checkPlayersBounds(); + checkBallBounds(); + checkPlayers_BallCollision(); + movePlayers(); + moveBall(); + renderPlayers(); + renderBall(); + + out.innerHTML = "Player 1 Score: " + player1.score + "
    Player 2 Score: " + player2.score; + requestAnimationFrame(start); +} + +function updateTimer() { + var minutes = Math.floor(timeLeft / 60); + var seconds = timeLeft % 60; + timerDisplay.innerHTML = "Time Left: " + minutes + ":" + (seconds < 10 ? "0" : "") + seconds; +} + +function endGame() { + var winner; + if (player1.score > player2.score) { + winner = "Player 1 Wins!"; + } else if (player2.score > player1.score) { + winner = "Player 2 Wins!"; + } else { + winner = "It's a Draw!"; + } + alert(winner); + resetGame(); +} + +function resetGame() { + player1 = new Player(100,250); + player2 = new Player(600,250); + ball = new Ball(350,250); + timeLeft = 180; + updateTimer(); + clearInterval(gameInterval); + instructions.style.display = 'block'; + canvas.style.display = 'none'; + out.style.display = 'none'; + timerDisplay.style.display = 'none'; +} + +function Ball(x,y){ + this.x = x; + this.y = y; + this.xVel = 0; + this.yVel = 0; + this.decel = 0.1; + this.size = 5; +} + +function Player(x,y){ + this.x = x; + this.y = y; + this.size = 20; + this.xVel = 0; + this.yVel = 0; + this.score = 0; + this.accel = 0.55; + this.decel = 0.55; + this.maxSpeed = 3; +} + +function reset(){ + var score1 = player1.score; + var score2 = player2.score; + player1 = new Player(100,250); + player1.score = score1; + player2 = new Player(600,250); + player2.score = score2; + ball = new Ball(350,250); + wDown = false; + sDown = false; + aDown = false; + dDown = false; + upDown = false; + downDown = false; + leftDown = false; + rightDown = false; +} + +function movePlayers(){ + player1.x += player1.xVel; + player1.y += player1.yVel; + player2.x += player2.xVel; + player2.y += player2.yVel; +} + +function checkPlayers_BallCollision(){ + var p1_ball_distance = getDistance(player1.x,player1.y,ball.x,ball.y) - player1.size - ball.size; + if(p1_ball_distance < 0){ + collide(ball,player1); + } + var p2_ball_distance = getDistance(player2.x,player2.y,ball.x,ball.y) - player2.size - ball.size; + if(p2_ball_distance < 0){ + collide(ball,player2); + } +} + +function collide(cir1,cir2){ + var dx = (cir1.x - cir2.x) / (cir1.size); + var dy = (cir1.y - cir2.y) / (cir1.size); + cir2.xVel = -dx; + cir2.yVel = -dy; + cir1.xVel = dx; + cir1.yVel = dy; +} + +function getDistance(x1,y1,x2,y2){ + return Math.sqrt(Math.pow(x1-x2,2)+Math.pow(y1-y2,2)); +} + +function moveBall(){ + if(ball.xVel !== 0){ + if(ball.xVel > 0){ + ball.xVel -= ball.decel; + if(ball.xVel < 0) ball.xVel = 0; + } else { + ball.xVel += ball.decel; + if(ball.xVel > 0) ball.xVel = 0; + } + } + if(ball.yVel !== 0){ + if(ball.yVel > 0){ + ball.yVel -= ball.decel; + if(ball.yVel < 0) ball.yVel = 0; + } else { + ball.yVel += ball.decel; + if(ball.yVel > 0) ball.yVel = 0; + } + } + ball.x += ball.xVel; + ball.y += ball.yVel; +} + +function checkBallBounds(){ + if(ball.x + ball.size > canvas.width){ + if(ball.y > 150 && ball.y < 350){ + player1.score++; + reset(); + return; + } + ball.x = canvas.width - ball.size; + ball.xVel *= -1.5; + } + if(ball.x - ball.size < 0){ + if(ball.y > 150 && ball.y < 350){ + player2.score++; + reset(); + return; + } + ball.x = 0 + ball.size; + ball.xVel *= -1.5; + } + if(ball.y + ball.size > canvas.height){ + ball.y = canvas.height - ball.size; + ball.yVel *= -1.5; + } + if(ball.y - ball.size < 0){ + ball.y = 0 + ball.size; + ball.yVel *= -1.5; + } +} + +function checkPlayersBounds(){ + if(player1.x + player1.size > canvas.width){ + player1.x = canvas.width - player1.size; + player1.xVel *= -0.5; + } + if(player1.x - player1.size < 0){ + player1.x = 0 + player1.size; + player1.xVel *= -0.5; + } + if(player1.y + player1.size > canvas.height){ + player1.y = canvas.height - player1.size; + player1.yVel *= -0.5; + } + if(player1.y - player1.size < 0){ + player1.y = 0 + player1.size; + player1.yVel *= -0.5; + } + if(player2.x + player2.size > canvas.width){ + player2.x = canvas.width - player2.size; + player2.xVel *= -0.5; + } + if(player2.x - player2.size < 0){ + player2.x = 0 + player2.size; + player2.xVel *= -0.5; + } + if(player2.y + player2.size > canvas.height){ + player2.y = canvas.height - player2.size; + player2.yVel *= -0.5; + } + if(player2.y - player2.size < 0){ + player2.y = 0 + player2.size; + player2.yVel *= -0.5; + } +} + +function checkKeyboardStatus(){ + if(wDown){ + if(player1.yVel > -player1.maxSpeed){ + player1.yVel -= player1.accel; + } else { + player1.yVel = -player1.maxSpeed; + } + } else { + if(player1.yVel < 0){ + player1.yVel += player1.decel; + if(player1.yVel > 0) player1.yVel = 0; + } + } + if(sDown){ + if(player1.yVel < player1.maxSpeed){ + player1.yVel += player1.accel; + } else { + player1.yVel = player1.maxSpeed; + } + } else { + if(player1.yVel > 0){ + player1.yVel -= player1.decel; + if(player1.yVel < 0) player1.yVel = 0; + } + } + if(aDown){ + if(player1.xVel > -player1.maxSpeed){ + player1.xVel -= player1.accel; + } else { + player1.xVel = -player1.maxSpeed; + } + } else { + if(player1.xVel < 0){ + player1.xVel += player1.decel; + if(player1.xVel > 0) player1.xVel = 0; + } + } + if(dDown){ + if(player1.xVel < player1.maxSpeed){ + player1.xVel += player1.accel; + } else { + player1.xVel = player1.maxSpeed; + } + } else { + if(player1.xVel > 0){ + player1.xVel -= player1.decel; + if(player1.xVel < 0) player1.xVel = 0; + } + } + + //PLAYER 2 + + if(upDown){ + if(player2.yVel > -player2.maxSpeed){ + player2.yVel -= player2.accel; + } else { + player2.yVel = -player2.maxSpeed; + } + } else { + if(player2.yVel < 0){ + player2.yVel += player2.decel; + if(player2.yVel > 0) player2.yVel = 0; + } + } + if(downDown){ + if(player2.yVel < player2.maxSpeed){ + player2.yVel += player2.accel; + } else { + player2.yVel = player2.maxSpeed; + } + } else { + if(player2.yVel > 0){ + player2.yVel -= player2.decel; + if(player2.yVel < 0) player2.yVel = 0; + } + } + if(leftDown){ + if(player2.xVel > -player2.maxSpeed){ + player2.xVel -= player2.accel; + } else { + player2.xVel = -player2.maxSpeed; + } + } else { + if(player2.xVel < 0){ + player2.xVel += player2.decel; + if(player2.xVel > 0) player2.xVel = 0; + } + } + if(rightDown){ + if(player2.xVel < player2.maxSpeed){ + player2.xVel += player2.accel; + } else { + player2.xVel = player2.maxSpeed; + } + } else { + if(player2.xVel > 0){ + player2.xVel -= player2.decel; + if(player2.xVel < 0) player2.xVel = 0; + } + } +} + +document.onkeyup = function(e){ + if(e.keyCode === 87){ + wDown = false; + } + if(e.keyCode === 65){ + aDown = false; + } + if(e.keyCode === 68){ + dDown = false; + } + if(e.keyCode === 83){ + sDown = false; + } + if(e.keyCode === 38){ + upDown = false; + } + if(e.keyCode === 37){ + leftDown = false; + } + if(e.keyCode === 40){ + downDown = false; + } + if(e.keyCode === 39){ + rightDown = false; + } +} + +document.onkeydown = function(e){ + if(e.keyCode === 87){ + wDown = true; + } + if(e.keyCode === 65){ + aDown = true; + } + if(e.keyCode === 68){ + dDown = true; + } + if(e.keyCode === 83){ + sDown = true; + } + if(e.keyCode === 38){ + upDown = true; + } + if(e.keyCode === 37){ + leftDown = true; + } + if(e.keyCode === 40){ + downDown = true; + } + if(e.keyCode === 39){ + rightDown = true; + } +} + +function renderBall(){ + c.save(); + c.beginPath(); + c.fillStyle = "black"; + c.arc(ball.x,ball.y,ball.size,0,Math.PI*2); + c.fill(); + c.closePath(); + c.restore(); +} + +function renderPlayers(){ + c.save(); + c.fillStyle = "red"; + c.beginPath(); + c.arc(player1.x,player1.y,player1.size,0,Math.PI*2); + c.fill(); + c.closePath(); + c.beginPath(); + c.fillStyle = "blue"; + c.arc(player2.x,player2.y,player2.size,0,Math.PI*2); + c.fill(); + c.closePath(); + c.restore(); +} + +function renderGates(){ + c.save(); + c.beginPath(); + c.moveTo(0,150); + c.lineTo(0,350); + c.strokeStyle = "red"; + c.lineWidth = 10; + c.stroke(); + c.closePath(); + c.beginPath(); + c.moveTo(canvas.width,150); + c.lineTo(canvas.width,350); + c.strokeStyle = "blue"; + c.lineWidth = 10; + c.stroke(); + c.closePath(); + c.restore(); +} + +function renderBackground(){ + c.save(); + c.fillStyle = "#66aa66"; + c.fillRect(0,0,canvas.width,canvas.height); + c.strokeStyle = "rgba(255,255,255,0.6)"; + c.beginPath(); + c.arc(canvas.width/2,canvas.height/2,150,0,Math.PI*2); + c.closePath(); + c.lineWidth = 10; + c.stroke(); + c.restore(); +} + +function clear(){ + c.clearRect(0,0,canvas.width,canvas.height); +} diff --git a/Games/Soccer/style.css b/Games/Soccer/style.css new file mode 100644 index 0000000000..af2b68fc9f --- /dev/null +++ b/Games/Soccer/style.css @@ -0,0 +1,41 @@ +body{ + background-image: url('https://wallpapers.com/images/hd/plain-green-background-vjb4wrgir58bpssc.jpg'); + margin: 10px; + display: flex; + justify-content: center; + align-items: center; + height: 100vh; + font-family: Arial, sans-serif; +} + +.game-container { + text-align: center; + background-color: #ffffff; + padding: 20px; + border: 2px solid #000000; + border-radius: 10px; + box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1); +} + +#instructions { + margin-bottom: 20px; +} + +#out { + color: black; + font-size: 24px; + font-weight: bold; + margin-top: 20px; +} + +canvas { + background-color: white; + border: 2px solid black; + margin-top: 20px; +} + +#timer { + font-size: 24px; + font-weight: bold; + margin-top: 20px; +} diff --git a/Games/Taash Game/README.md b/Games/Taash Game/README.md new file mode 100644 index 0000000000..747d250379 --- /dev/null +++ b/Games/Taash Game/README.md @@ -0,0 +1,12 @@ +# Taash Game +The player has to get a hand with a value as close to 21 as possible without going over. +A hand that goes over 21 is a bust. +The players in a Taash Game plays against the dealer. Each player has to beat the dealer's hand in order to win. + +In Taash Game, the suits have no meaning. +1. Number cards have a value equal to their number. +2. All the picture cards (Jacks, Queens, and Kings) are worth 10. +3. Aces are worth 1. +4. The table keeps a record of total wins,loses and draws +5. Click on "Restart" Button to start a new game +6. Click on "Deal" Button to clear the field diff --git a/Games/Taash Game/images/10.png b/Games/Taash Game/images/10.png new file mode 100644 index 0000000000..01be5daa37 Binary files /dev/null and b/Games/Taash Game/images/10.png differ diff --git a/Games/Taash Game/images/2.png b/Games/Taash Game/images/2.png new file mode 100644 index 0000000000..2f1d24063f Binary files /dev/null and b/Games/Taash Game/images/2.png differ diff --git a/Games/Taash Game/images/3.png b/Games/Taash Game/images/3.png new file mode 100644 index 0000000000..7c804ae15b Binary files /dev/null and b/Games/Taash Game/images/3.png differ diff --git a/Games/Taash Game/images/4.png b/Games/Taash Game/images/4.png new file mode 100644 index 0000000000..ea50674261 Binary files /dev/null and b/Games/Taash Game/images/4.png differ diff --git a/Games/Taash Game/images/5.png b/Games/Taash Game/images/5.png new file mode 100644 index 0000000000..f456f1e71d Binary files /dev/null and b/Games/Taash Game/images/5.png differ diff --git a/Games/Taash Game/images/6.png b/Games/Taash Game/images/6.png new file mode 100644 index 0000000000..46b86bcc59 Binary files /dev/null and b/Games/Taash Game/images/6.png differ diff --git a/Games/Taash Game/images/7.png b/Games/Taash Game/images/7.png new file mode 100644 index 0000000000..1a21883717 Binary files /dev/null and b/Games/Taash Game/images/7.png differ diff --git a/Games/Taash Game/images/8.png b/Games/Taash Game/images/8.png new file mode 100644 index 0000000000..277705b131 Binary files /dev/null and b/Games/Taash Game/images/8.png differ diff --git a/Games/Taash Game/images/9.png b/Games/Taash Game/images/9.png new file mode 100644 index 0000000000..b3fdc074b0 Binary files /dev/null and b/Games/Taash Game/images/9.png differ diff --git a/Games/Taash Game/images/A.png b/Games/Taash Game/images/A.png new file mode 100644 index 0000000000..bb25fee819 Binary files /dev/null and b/Games/Taash Game/images/A.png differ diff --git a/Games/Taash Game/images/J.png b/Games/Taash Game/images/J.png new file mode 100644 index 0000000000..7960a94e7a Binary files /dev/null and b/Games/Taash Game/images/J.png differ diff --git a/Games/Taash Game/images/K.png b/Games/Taash Game/images/K.png new file mode 100644 index 0000000000..c9d1c990ea Binary files /dev/null and b/Games/Taash Game/images/K.png differ diff --git a/Games/Taash Game/images/Q.png b/Games/Taash Game/images/Q.png new file mode 100644 index 0000000000..6499247e29 Binary files /dev/null and b/Games/Taash Game/images/Q.png differ diff --git a/Games/Taash Game/index.html b/Games/Taash Game/index.html new file mode 100644 index 0000000000..2d05937546 --- /dev/null +++ b/Games/Taash Game/index.html @@ -0,0 +1,62 @@ + + + + + Taash Game + + + + + +
    +

    Taash Game

    +

    Let's Play

    + +
    +
    +

    You: 0

    +
    + +
    +

    Dealer: 0

    +
    +
    + +
    +
    + + + + +
    +
    +
    + + + + + + + + + + + + +
    WinLoseDraw
    000
    +
    +
    + + + diff --git a/Games/Taash Game/script.js b/Games/Taash Game/script.js new file mode 100644 index 0000000000..b38f56eeed --- /dev/null +++ b/Games/Taash Game/script.js @@ -0,0 +1,250 @@ +let blackjackGame = { + you: { + scoreSpan: "#your-blackjack-result", + div: "#your-box", + boxSize: ".flex-blackjack-row-2 div", + score: 0, + }, + + dealer: { + scoreSpan: "#dealer-blackjack-result", + div: "#dealer-box", + boxSize: ".flex-blackjack-row-2 div", + score: 0, + }, + + cards: ["2", "3", "4", "5", "6", "7", "8", "9", "10", "K", "J", "Q", "A"], + + cardsMap: { + 2: 2, + 3: 3, + 4: 4, + 5: 5, + 6: 6, + 7: 7, + 8: 8, + 9: 9, + 10: 10, + K: 10, + J: 10, + Q: 10, + A: [1, 11], + }, + + wins: 0, + losses: 0, + draws: 0, + isStand: false, + isTurnsOver: false, + pressOnce: false, +}; + +const YOU = blackjackGame["you"]; +const DEALER = blackjackGame["dealer"]; + +const hitSound = new Audio("sounds/swish.m4a"); +const winSound = new Audio("sounds/cash.mp3"); +const loseSound = new Audio("sounds/aww.mp3"); + +let windowWidth = window.screen.width; +let windowHeight = window.screen.height; +let winner; + +//Button Event Listeners +document + .querySelector("#blackjack-hit-button") + .addEventListener("click", blackjackHit); +document + .querySelector("#blackjack-stand-button") + .addEventListener("click", blackjackStand); +document + .querySelector("#blackjack-deal-button") + .addEventListener("click", blackjackDeal); +document + .querySelector("#blackjack-reset-button") + .addEventListener("click", blackjackRestart); + +function blackjackHit() { + if (blackjackGame["isStand"] === false) { + let card = randomCard(); + showCard(card, YOU); + updateScore(card, YOU); + showScore(YOU); + } +} + +function randomCard() { + let randomIndex = Math.floor(Math.random() * 13); + return blackjackGame["cards"][randomIndex]; +} + +function showCard(card, activePlayer) { + if (activePlayer["score"] <= 21) { + let cardImage = document.createElement("img"); + cardImage.src = `images/${card}.png`; + cardImage.style = `width:${widthSize()}; height:${heightSize()};`; + document.querySelector(activePlayer["div"]).appendChild(cardImage); + hitSound.play(); + } +} + +function widthSize() { + if (windowWidth > 1000) { + let newWidthSize = window.screen.width * 0.1; + return newWidthSize; + } else { + return window.screen.width * 0.18; + } +} + +function heightSize() { + if (windowHeight > 700) { + let newHeightSize = window.screen.height * 0.18; + return newHeightSize; + } else { + return window.screen.height * 0.15; + } +} + +function updateScore(card, activePlayer) { + if (card === "A") { + if (activePlayer["score"] + blackjackGame["cardsMap"][card][1] <= 21) { + activePlayer["score"] += blackjackGame["cardsMap"][card][1]; + } else { + activePlayer["score"] += blackjackGame["cardsMap"][card][0]; + } + } else { + activePlayer["score"] += blackjackGame["cardsMap"][card]; + } + + console.log(activePlayer["score"]); +} + +function showScore(activePlayer) { + //Bust logic if score is over 21 + if (activePlayer["score"] > 21) { + document.querySelector(activePlayer["scoreSpan"]).textContent = "BUST!"; + document.querySelector(activePlayer["scoreSpan"]).style.color = "red"; + } else { + document.querySelector(activePlayer["scoreSpan"]).textContent = + activePlayer["score"]; + } +} + +function blackjackStand() { + if (blackjackGame.pressOnce === false) { + blackjackGame["isStand"] = true; + let yourImages = document + .querySelector("#your-box") + .querySelectorAll("img"); + + for (let i = 0; i < yourImages.length; i++) { + let card = randomCard(); + showCard(card, DEALER); + updateScore(card, DEALER); + showScore(DEALER); + } + + blackjackGame["isTurnsOver"] = true; + + computeWinner(); + showWinner(winner); + } + + blackjackGame.pressOnce = true; +} + +function computeWinner() { + if (YOU["score"] <= 21) { + if (YOU["score"] > DEALER["score"] || DEALER["score"] > 21) { + winner = YOU; + } else if (YOU["score"] < DEALER["score"]) { + winner = DEALER; + } else if (YOU["score"] === DEALER["score"]) { + winner = "Draw"; + } + } else if (YOU["score"] > 21 && DEALER["score"] <= 21) { + winner = DEALER; + } else if (YOU["score"] > 21 && DEALER["score"] > 21) { + winner = "None"; + } + + return winner; +} + +function showWinner(winner) { + let message, messageColor; + + if (winner === YOU) { + message = "You Won"; + messageColor = "#00e676"; + document.querySelector("#wins").textContent = blackjackGame["wins"] += 1; + winSound.play(); + } else if (winner === DEALER) { + message = "You Lost"; + messageColor = "red"; + document.querySelector("#losses").textContent = blackjackGame[ + "losses" + ] += 1; + loseSound.play(); + } else if (winner === "Draw") { + message = "You Drew"; + messageColor = "yellow"; + document.querySelector("#draws").textContent = blackjackGame["draws"] += 1; + loseSound.play(); + } else if (winner === "None") { + message = "You Both Busted!"; + messageColor = "orange"; + loseSound.play(); + } + + document.querySelector("#blackjack-result").textContent = message; + document.querySelector("#blackjack-result").style.color = messageColor; +} + +function blackjackDeal() { + if (blackjackGame["isTurnsOver"] === true) { + // Select all the images in both the user and dealer box + let yourImages = document + .querySelector("#your-box") + .querySelectorAll("img"); + let dealerImages = document + .querySelector("#dealer-box") + .querySelectorAll("img"); + + document.querySelector("#blackjack-result").style.color = "white"; + + //Sets the user and dealers scors to zero + YOU["score"] = DEALER["score"] = 0; + document.querySelector("#your-blackjack-result").textContent = 0; + document.querySelector("#dealer-blackjack-result").textContent = 0; + + //Reset color back to white + document.querySelector("#your-blackjack-result").style.color = "white"; + document.querySelector("#dealer-blackjack-result").style.color = "white"; + + //Reset to Let's Play + document.querySelector("#blackjack-result").textContent = "Lets Play"; + + //Removes the cards in the user's box + for (let i = 0; i < yourImages.length; i++) { + yourImages[i].remove(); + dealerImages[i].remove(); + } + + blackjackGame["isStand"] = false; + blackjackGame.pressOnce = false; + blackjackGame["isTurnsOver"] = false; + } +} + +function blackjackRestart() { + blackjackDeal(); + document.querySelector("#wins").textContent = 0; + document.querySelector("#losses").textContent = 0; + document.querySelector("#draws").textContent = 0; + + blackjackGame.wins = 0; + blackjackGame.losses = 0; + blackjackGame.draws = 0; +} diff --git a/Games/Taash Game/sounds/aww.mp3 b/Games/Taash Game/sounds/aww.mp3 new file mode 100644 index 0000000000..1a57bae92e Binary files /dev/null and b/Games/Taash Game/sounds/aww.mp3 differ diff --git a/Games/Taash Game/sounds/cash.mp3 b/Games/Taash Game/sounds/cash.mp3 new file mode 100644 index 0000000000..0aa9e10e6f Binary files /dev/null and b/Games/Taash Game/sounds/cash.mp3 differ diff --git a/Games/Taash Game/sounds/clap.mp3 b/Games/Taash Game/sounds/clap.mp3 new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/Games/Taash Game/sounds/clap.mp3 @@ -0,0 +1 @@ + diff --git a/Games/Taash Game/sounds/swish.m4a b/Games/Taash Game/sounds/swish.m4a new file mode 100644 index 0000000000..1e27ba6840 Binary files /dev/null and b/Games/Taash Game/sounds/swish.m4a differ diff --git a/Games/Taash Game/style.css b/Games/Taash Game/style.css new file mode 100644 index 0000000000..f0ce85e2cc --- /dev/null +++ b/Games/Taash Game/style.css @@ -0,0 +1,65 @@ +body { + background: url("https://images.pexels.com/photos/956999/milky-way-starry-sky-night-sky-star-956999.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940"); + background-repeat: no-repeat; + background-size: cover; + + padding:10px; +} + + +.container { + margin: 0 auto; + text-align: center; + color: white; + width:75%; + +} + +.flex-blackjack-row-1, +.flex-blackjack-row-2, +.flex-blackjack-row-3 { + display: flex; + padding: 5px; + flex-wrap: wrap; + flex-direction: row; + justify-content: space-evenly; +} + +.flex-blackjack-row-2 div { + padding: 10px; + border: 1px solid black; + + flex: 1; + height: 350px; + text-align: center; +} + +.flex-blackjack-row-2 div img { + padding: 10px; +} + +table { + border: 3px solid black; + border-collapse: collapse; + padding:10px; + width:45%; + background-color: white; + text-align: center; +} +table td { + border: 2px solid black; +} + +.flex-blackjack-row-3 div { + padding: 5px; +} + +.flex-blackjack-row-3 button { + padding: 10 px; + margin-bottom: 10px; +} + +.flex-blackjack-row-2, .flex-blackjack-row-3{ + background-image: url(https://i.stack.imgur.com/q02th.jpg); + border: 3px solid black; +} diff --git a/Games/Tic_Tac_Toe/README.md b/Games/Tic_Tac_Toe/README.md index a0925b7e2c..0f10a277e3 100644 --- a/Games/Tic_Tac_Toe/README.md +++ b/Games/Tic_Tac_Toe/README.md @@ -1,29 +1,32 @@ -# **Tic_Tac_Toe** - ---- - -
    - -## **Description ๐Ÿ“ƒ** -- X and O have to play turn by turn. -- whose ever turn it is ,it will be displayed on screen. -
    - -## **Functionalities ๐ŸŽฎ** -- There is sound on each and every turn. -- The gif will appear if any one wins. -- The game can also restart in between if required. -
    - -## **How to play? ๐Ÿ•น๏ธ** -- X player always plays first.He can click on any 9 of the boxes. -- Next is O's urn he can click in any 9 of the boxes. -- If any 3 appear the same either X or O in row,column or digonally then he wins. - -
    - -## **Screenshots ๐Ÿ“ธ** - -![image](..//..//assets/images/Tic_Tac_Toe.png) - -
    +--- + +# Tic Tac Toe Game + +Welcome to Tic Tac Toe Game!, a classic game of Tic Tac Toe brought to life with HTML, CSS, and JavaScript. This simple yet engaging web application allows users to enjoy the timeless game in a modern and interactive way. + +## Features: + +- **Responsive Design:** Play the game seamlessly on any device, thanks to the responsive design that adapts to various screen sizes. + +- **Intuitive Interface:** The user-friendly interface makes it easy for players to understand the game rules and navigate through the application effortlessly. + +- **CSS Animations:** Enjoy subtle and appealing animations that enhance the gaming experience, creating a visually pleasing atmosphere. + +- **Smart AI Opponent (Coming Soon):** Test your skills against a computer opponent with an intelligent AI. The AI adapts to your moves, providing a challenging single-player experience. + +## How to Play: + +1. Clone the repository to your local machine. +2. Open the [Tic-Tac-Toe](https://oxoxgame.netlify.app/) in your preferred web browser. +3. Start a new game and take turns with your opponent to place your X or O on the grid. +4. The first player to get three in a row (horizontally, vertically, or diagonally) wins the game. + +## Technologies Used: + +- **HTML:** The structure of the game. +- **CSS:** Styling and animations for a visually appealing experience. +- **JavaScript:** Logic for gameplay, user interaction, and implementing the Tic Tac Toe rules. + +Feel free to report issues, or suggest improvements. Let the Tic Tac Toe battles begin! + +--- diff --git a/Games/Tic_Tac_Toe/confetti.gif b/Games/Tic_Tac_Toe/confetti.gif new file mode 100644 index 0000000000..9ad928fc11 Binary files /dev/null and b/Games/Tic_Tac_Toe/confetti.gif differ diff --git a/Games/Tic_Tac_Toe/favicon.png b/Games/Tic_Tac_Toe/favicon.png new file mode 100644 index 0000000000..4ebd3d36b4 Binary files /dev/null and b/Games/Tic_Tac_Toe/favicon.png differ diff --git a/Games/Tic_Tac_Toe/sounds/gameover.mp3 b/Games/Tic_Tac_Toe/gameover.mp3 similarity index 100% rename from Games/Tic_Tac_Toe/sounds/gameover.mp3 rename to Games/Tic_Tac_Toe/gameover.mp3 diff --git a/Games/Tic_Tac_Toe/index.html b/Games/Tic_Tac_Toe/index.html index 03bb0c29ac..30118aa2e3 100644 --- a/Games/Tic_Tac_Toe/index.html +++ b/Games/Tic_Tac_Toe/index.html @@ -1,48 +1,44 @@ - - - - - - - Tic Tac Toe - - - - - -
    -

    Welcome to Simran's Tic Tac Toe Game

    -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - Turn for X -
    - -
    - -
    -
    -
    - - - - \ No newline at end of file + + + + + + + + + Tic Tac Toe + + + +
    +

    TIC TAC TOE

    +
    + + + + + +
    + +
    + confetti +

    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    + + + + diff --git a/Games/Tic_Tac_Toe/sounds/music.mp3 b/Games/Tic_Tac_Toe/music.mp3 similarity index 100% rename from Games/Tic_Tac_Toe/sounds/music.mp3 rename to Games/Tic_Tac_Toe/music.mp3 diff --git a/Games/Tic_Tac_Toe/script.js b/Games/Tic_Tac_Toe/script.js index a02e7545c3..4c145c52d3 100644 --- a/Games/Tic_Tac_Toe/script.js +++ b/Games/Tic_Tac_Toe/script.js @@ -1,100 +1,96 @@ -let music = new Audio("sounds/music.mp3"); -let audioTurn = new Audio("sounds/ting.mp3"); -let gameover = new Audio("sounds/gameover.mp3"); -let turn = "X"; -let isgameover = false; +let gameoverAudio = new Audio("gameover.mp3") +let turnAudio = new Audio("ting.mp3") +let turn = 'X' +let gameover = false; +let music = new Audio("music.mp3") + +const info = document.querySelector('.info') +const reset = document.querySelector('#reset') +const start = document.querySelector('#start') +const playerInfo = document.querySelector('.playerInfo') +const gameContainer = document.querySelector('.gameContainer') +const p1 = document.querySelector('.p1') +const p2 = document.querySelector('.p2') +const line = document.querySelector('.line') + + +start.addEventListener('click', () => { + playerInfo.style.display = 'none'; + gameContainer.style.display = 'flex'; + info.innerText = 'Turn for ' + p1.value + ' (' + turn + ')'; + music.play() +}) -music.play(); -// Function to change the turn const changeTurn = () => { - return turn === "X" ? "0" : "X"; -}; + return turn === 'X' ? 'O' : 'X'; +} -// Function to check for a win const checkWin = () => { - let boxtext = document.getElementsByClassName("boxtext"); - let wins = [ - [0, 1, 2, 5, 5, 0], - [3, 4, 5, 5, 15, 0], - [6, 7, 8, 5, 25, 0], - [0, 3, 6, -5, 15, 90], - [1, 4, 7, 5, 15, 90], - [2, 5, 8, 15, 15, 90], - [0, 4, 8, 5, 15, 45], - [2, 4, 6, 5, 15, 135], - ]; - let isDraw = true; // Flag to check if it's a draw - - wins.forEach((e) => { - if ( - boxtext[e[0]].innerText === boxtext[e[1]].innerText && - boxtext[e[2]].innerText === boxtext[e[1]].innerText && - boxtext[e[0]].innerText !== "" - ) { - document.querySelector(".info").innerText = - boxtext[e[0]].innerText + " Won"; - music.pause(); - gameover.play(); - music.play(); - isgameover = true; - document - .querySelector(".imgbox") - .getElementsByTagName("img")[0].style.width = "200px"; - document.querySelector( - ".line" - ).style.transform = `translate(${e[3]}vw, ${e[4]}vw) rotate(${e[5]}deg)`; - document.querySelector(".line").style.width = "20vw"; - isDraw = false; - document.querySelector(".imgbox").style.display = "block"; - } - }); + let boxText = document.querySelectorAll('.boxText') + let wins = [ + [0, 1, 2, '24%', 0,0], + [3, 4, 5, '50%', 0,0], + [6, 7, 8, '75%', 0,0], + [0, 3, 6, '50%', '-34%','90'], + [1, 4, 7, '50%', 0,'90'], + [2, 5, 8, '50%', '33%','90'], + [0, 4, 8, '50%',0,'45'], + [2, 4, 6, '50%', 0,'135'] + ] + wins.forEach(e => { + if ((boxText[e[0]].innerText === boxText[e[1]].innerText) && (boxText[e[2]].innerText === boxText[e[1]].innerText) && (boxText[e[0]].innerText !== '')) { + if (boxText[e[0]].innerText === 'X') { + info.innerText = p1.value + ' Wins !' + } else { + info.innerText = p2.value + ' Wins !' + } + document.querySelector('.confetti').style.visibility = 'visible'; + line.style.visibility = 'visible' + line.style.top = e[3]; + line.style.left = e[4]; + line.style.transform = `rotate(${e[5]}deg)`; + music.pause() + music.currentTime = 0; + gameoverAudio.play() + gameover = true; + } + }) +} - // Check for a draw - if (isDraw) { - let filledBoxes = Array.from(boxtext).every( - (element) => element.innerText !== "" - ); - if (filledBoxes) { - document.querySelector(".info").innerText = "It's a Draw!"; - music.pause(); - gameover.play(); - music.play(); - isgameover = true; - } - } -}; +let boxes = document.querySelectorAll('.box') +Array.from(boxes).forEach((e) => { + let boxText = e.querySelector('.boxText') + e.addEventListener("click", () => { + if (boxText.innerText === '') { + boxText.innerText = turn + turnAudio.play(); + turn = changeTurn(); + checkWin(); + if (!gameover) { + if (turn === 'X') { + info.innerText = 'Turn for ' + p1.value + ' (' + turn + ')'; + } else { + info.innerText = 'Turn for ' + p2.value + ' (' + turn + ')'; -// Game Logic -music.play(); -let boxes = document.getElementsByClassName("box"); -Array.from(boxes).forEach((element) => { - let boxtext = element.querySelector(".boxtext"); - element.addEventListener("click", () => { - if (boxtext.innerText === "") { - boxtext.innerText = turn; - turn = changeTurn(); - audioTurn.play(); - checkWin(); - if (!isgameover) { - document.getElementsByClassName("info")[0].innerText = - "Turn for " + turn; - } - } - }); -}); + } + } + } + }) -// Add onclick listener to reset button -reset.addEventListener("click", () => { +}) - document.querySelector(".imgbox").style.display = "none"; +reset.addEventListener('click', () => { + let boxText = document.querySelectorAll('.boxText') + Array.from(boxText).forEach(e => { + e.innerText = '' + turn = 'X' + info.innerText = 'Turn for ' + p1.value + ' (' + turn + ')'; + document.querySelector('.confetti').style.visibility = 'hidden'; + line.style.transform = ''; + line.style.visibility = 'hidden' + gameover = false; + music.play() - let boxtexts = document.querySelectorAll(".boxtext"); - Array.from(boxtexts).forEach((element) => { - element.innerText = ""; - }); - turn = "X"; - isgameover = false; - document.querySelector(".line").style.width = "0vw"; - document.getElementsByClassName("info")[0].innerText = "Turn for " + turn; -}); \ No newline at end of file + }) +}) diff --git a/Games/Tic_Tac_Toe/sounds/excited.gif b/Games/Tic_Tac_Toe/sounds/excited.gif deleted file mode 100644 index ac0ecac27e..0000000000 Binary files a/Games/Tic_Tac_Toe/sounds/excited.gif and /dev/null differ diff --git a/Games/Tic_Tac_Toe/style.css b/Games/Tic_Tac_Toe/style.css index b9dfe77dd1..19949d23ef 100644 --- a/Games/Tic_Tac_Toe/style.css +++ b/Games/Tic_Tac_Toe/style.css @@ -1,170 +1,156 @@ -@import url("https://fonts.googleapis.com/css2?family=Baloo+Bhaina+2&family=Roboto&display=swap"); * { - margin: 0; - padding: 0; + margin: 0; + padding: 0; + box-sizing: border-box; + color: #d62828; + font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; } body { - background-color: #e4f9f5; + height: 100vh; + background-color: #eae2b7; + display: flex; + justify-content: center; + align-items: center; } -nav { - background-color: #66bfbf; - color: white; - height: 70px; - font-size: 27px; - display: flex; - align-items: center; - font-family: "Roboto", sans-serif; - justify-content: center; +.card { + padding: 2rem; + border-radius: 40px; + display: flex; + background-color: #fcbf49; + flex-direction: column; + justify-content: center; + align-items: center; } -nav ul { - list-style-type: none; +.heading { + color: #003049; +} + +.heading:hover { + color: #d62828; +} + +.info { + margin: 1rem; } .gameContainer { - display: flex; - align-items: center; - flex-direction: row-reverse; - justify-content: center; - margin-top: 7%; + display: none; + flex-direction: column; + margin: auto; + justify-content: center; + align-items: center; + margin-top: 10px; + margin-bottom: 10px; + position: relative; + } .container { - width: 80%; - display: grid; - grid-template-rows: repeat(3, 10vw); - grid-template-columns: repeat(3, 10vw); - font-family: "Roboto", sans-serif; - position: relative; + display: grid; + grid-template-rows: repeat(3, 7vw); + grid-template-columns: repeat(3, 7vw); } -.box { - border: 2px solid black; - font-size: 7vw; - cursor: pointer; - display: flex; - justify-content: center; - align-items: center; +.line { + background-color: #003049; + height: 3px; + width: 20vw; + position: absolute; + visibility: hidden; } -.box:hover { - background-color: #c1ece4; +.playerInfo { + display: flex; + flex-direction: column; + padding: 1rem; + font-size: large; } -.info { - position: absolute; - /* right: 1260px; */ - font-size: 2.1rem; - font-weight: 1000; - padding-left: 50px; - padding-right: 50px; - text-align: center; - - color: #66bfbf; +label, +input { + margin: 0.5rem; + font-size: large; + padding: 0.5rem; + border: none; + border-radius: 10px; +} + +input:focus { + outline: #d62828da solid; + } -.gameInfo { - text-align: center; - width: 100%; - padding-top: 15px; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - font-family: "Baloo Bhaina 2", cursive; - color: #66bfbf; +.box { + border: 2px solid #f77f00; + cursor: pointer; + font-size: 5vw; + display: flex; + justify-content: center; + align-items: center; } -.gameInfo h1 { - font-size: 2.5rem; +.box:hover { + background-color: #ff8400a9; } -.gaming { - display: flex; - gap: 30px; - margin-top: 30px; + +#reset, +#start { + border-color: #f77f00; + border-radius: 10px; + font-size: large; + margin-top: 1.4rem; + padding: 0.5rem; + cursor: pointer; + z-index: 2; } -.imgbox { - margin-top: 20px; +.confetti { + position: absolute; + visibility: hidden; + z-index: 1; + width: 400px; } -.imgbox img { - width: 0; - transition: width 1s ease-in-out; +@media screen and (max-width:770px) { + .gameContainer { + flex-wrap: wrap; + } + + .container { + grid-template-rows: repeat(3, 17vw); + grid-template-columns: repeat(3, 17vw); + } + + .box{ + font-size: 20vw; + } + + .line { + width: 51vw; + } + + .card { + height: fit-content; + width: 80vw; + } } .br-0 { - border-right: 0; + border-right: 0; } .bl-0 { - border-left: 0; + border-left: 0; } .bt-0 { - border-top: 0; + border-top: 0; } .bb-0 { - border-bottom: 0; -} - -#reset { - margin: 0 23px; - padding: 4px 30px; - background: #e4f9f5; - border: 3px solid #66bfbf; - border-radius: 6px; - cursor: pointer; - font-family: "Baloo Bhaina 2"; - font-size: 20px; - color: #66bfbf; - font-weight: bolder; - position: relative; - top: 270px; - right: -7px; -} -#reset:hover { - background-color: #66bfbf; - color: #ffffff; -} - -.line { - background-color: black; - height: 7px; - width: 0; - position: absolute; - background-color: #57c5b6; - transition: width 1s ease-in-out; -} - -@media screen and (max-width: 1000px) { - .gameContainer { - flex-direction: column-reverse; - } - .gameInfo { - width: 100%; - margin-top: 34px; - } - .gameInfo h1 { - font-size: 1.5rem; - } - .container { - width: 60%; - grid-template-rows: repeat(3, 18vw); - grid-template-columns: repeat(3, 20vw); - position: relative; - bottom: 25px; - } - .info{ - top: 226px; - right: 1rem; - } - #reset{ - position:relative; - top: 590px; - } + border-bottom: 0; } \ No newline at end of file diff --git a/Games/Tic_Tac_Toe/sounds/ting.mp3 b/Games/Tic_Tac_Toe/ting.mp3 similarity index 100% rename from Games/Tic_Tac_Toe/sounds/ting.mp3 rename to Games/Tic_Tac_Toe/ting.mp3 diff --git a/Games/Treasure Hunt/README.md b/Games/Treasure Hunt/README.md new file mode 100644 index 0000000000..2ca20e30fd --- /dev/null +++ b/Games/Treasure Hunt/README.md @@ -0,0 +1,31 @@ +# Treasure Hunt + +Treasure Hunt is a simple and fun game where players navigate through a grid to find hidden treasures. Use your intuition and a bit of luck to uncover the treasure in the least number of attempts! + +## How to Play + +1. **Objective**: Find the hidden treasure on the grid. +2. **Gameplay**: + - Click on any cell in the 3x3 grid to search for the treasure. + - If the cell contains the treasure, you'll see the treasure image. + - If the cell does not contain the treasure, you'll see a wrong guess image. + - The game will display the number of attempts you have made. +3. **Restart**: + - Click the "Restart" button to start a new game. + +## Features + +- **Visual Feedback**: Different images for treasure and wrong guesses. +- **Attempts Counter**: Keep track of the number of attempts made to find the treasure. +- **Restart Functionality**: Easily restart the game to play again. + +## Screenshots + +![Treasure Hunt](../../assets/images/Treasure_Hunt.png) + +## Try It Out + +You can try out the game by opening the `index.html` file in your web browser. + + + diff --git a/Games/Treasure Hunt/assets/cell-bg.png b/Games/Treasure Hunt/assets/cell-bg.png new file mode 100644 index 0000000000..422daf101e Binary files /dev/null and b/Games/Treasure Hunt/assets/cell-bg.png differ diff --git a/Games/Treasure Hunt/assets/treasure.png b/Games/Treasure Hunt/assets/treasure.png new file mode 100644 index 0000000000..e96c77af53 Binary files /dev/null and b/Games/Treasure Hunt/assets/treasure.png differ diff --git a/Games/Treasure Hunt/assets/wrong.png b/Games/Treasure Hunt/assets/wrong.png new file mode 100644 index 0000000000..8e17cd9b00 Binary files /dev/null and b/Games/Treasure Hunt/assets/wrong.png differ diff --git a/Games/Treasure Hunt/index.html b/Games/Treasure Hunt/index.html new file mode 100644 index 0000000000..e0186f56d6 --- /dev/null +++ b/Games/Treasure Hunt/index.html @@ -0,0 +1,28 @@ + + + + + + Treasure Hunt + + + +

    Treasure Hunt

    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    Find the hidden treasure!

    + + + + diff --git a/Games/Treasure Hunt/script.js b/Games/Treasure Hunt/script.js new file mode 100644 index 0000000000..23e9ab2832 --- /dev/null +++ b/Games/Treasure Hunt/script.js @@ -0,0 +1,37 @@ +// Game variables +const cells = document.querySelectorAll('.cell'); +const clueElement = document.getElementById('clue'); +const restartButton = document.getElementById('restart-button'); +let treasureLocation; +let attempts; + +// Function to start/restart the game +function startGame() { + // Hide treasure and reset attempts + cells.forEach(cell => cell.style.backgroundImage = 'url("assets/cell-bg.png")'); + treasureLocation = Math.floor(Math.random() * 9) + 1; + attempts = 0; + clueElement.innerText = 'Find the hidden treasure!'; +} + +// Function to handle cell click +function handleCellClick(event) { + const cellId = parseInt(event.target.id.split('-')[1]); + attempts++; + if (cellId === treasureLocation) { + event.target.style.backgroundImage = 'url("assets/treasure.png")'; + clueElement.innerText = `Congratulations! You found the treasure in ${attempts} attempts.`; + } else { + event.target.style.backgroundImage = 'url("assets/wrong.png")'; + clueElement.innerText = `Keep looking! Attempts: ${attempts}`; + } +} + +// Add event listeners to cells +cells.forEach(cell => cell.addEventListener('click', handleCellClick)); + +// Add event listener to restart button +restartButton.addEventListener('click', startGame); + +// Start the game initially +startGame(); diff --git a/Games/Treasure Hunt/styles.css b/Games/Treasure Hunt/styles.css new file mode 100644 index 0000000000..c9cf241e8c --- /dev/null +++ b/Games/Treasure Hunt/styles.css @@ -0,0 +1,49 @@ +body { + font-family: Arial, sans-serif; + text-align: center; + background-color: #f0f0f0; + margin: 0; + padding: 20px; +} + +h1 { + margin-bottom: 20px; +} + +#game-container { + display: flex; + justify-content: center; + align-items: center; + margin-bottom: 20px; +} + +#map { + display: grid; + grid-template-columns: repeat(3, 100px); + grid-template-rows: repeat(3, 100px); + gap: 10px; +} + +.cell { + width: 100px; + height: 100px; + background-image: url('assets/cell-bg.png'); + background-size: cover; + display: flex; + justify-content: center; + align-items: center; + font-size: 24px; + cursor: pointer; + border: 2px solid #ccc; +} + +#clue { + font-size: 18px; + margin-bottom: 20px; +} + +#restart-button { + padding: 10px 20px; + font-size: 16px; + cursor: pointer; +} diff --git a/Games/Turn_on_the_light/README.md b/Games/Turn_on_the_light/README.md new file mode 100644 index 0000000000..56a7c1ae00 --- /dev/null +++ b/Games/Turn_on_the_light/README.md @@ -0,0 +1,54 @@ +# Turn On the Light + +Turn On the Light is a web-based puzzle game where players rotate cable segments to turn on the light by connecting all segments correctly. + +## Table of Contents + +- [Installation](#installation) +- [Usage](#usage) +- [Game Rules](#game-rules) +- [Levels](#levels) +- [Credits](#credits) + +## Installation + +1. Clone the repository: + ``` + git clone https://github.com/yourusername/turn-on-the-light.git + ``` +2. Navigate to the project directory: + ``` + cd turn-on-the-light + ``` + +## Usage + +1. Open `index.html` in your web browser to start the game. +2. The game will load and you can start playing by following the instructions on the screen. + +## Game Rules + +- Click on cable segments to rotate them clockwise. +- Align all segments correctly to complete the circuit and turn on the light. +- The game consists of multiple levels, each with increasing difficulty. + +## Levels + +The game includes 12 levels. Each level is represented by a 5x4 matrix. The segments are described in the `levels` array in `script.js`. + +## **Screenshots ๐Ÿ“ธ** + +![Turn_on_the_light](https://github.com/kunjgit/GameZone/assets/images/turnonthelight.jpg) + +
    + +## **Created By ๐Ÿ‘ฆ** + +[Vijay Shanker Sharma](https://github.com/thevijayshankersharma) + +
    + +## Credits +- Libraries: [jQuery](https://jquery.com/), [Hammer.js](https://hammerjs.github.io/) + + diff --git a/Games/Turn_on_the_light/index.html b/Games/Turn_on_the_light/index.html new file mode 100644 index 0000000000..ff0f5168e5 --- /dev/null +++ b/Games/Turn_on_the_light/index.html @@ -0,0 +1,44 @@ + + + + + + + + Turn On the Light + + + + +
    + + + + + + + + + + +
    TURN ON
    +
    THE LIGHT
    + + + + +
    +
    + Click on cable
    + segments to rotate
    + clockwise until all
    + the segments are in
    + the correct position. +
    +
    +
    MENU
    +
    NEXT LEVEL
    +
    + + + diff --git a/Games/Turn_on_the_light/script.js b/Games/Turn_on_the_light/script.js new file mode 100644 index 0000000000..8f5c4adc7c --- /dev/null +++ b/Games/Turn_on_the_light/script.js @@ -0,0 +1,270 @@ +var playing = true; +// levels.length = 12 (number of levels) +// each element of levels array is composed of an array +// The game board is a 5x4 matrix +// I define values for the sides of +// each cell of the 5x4 matrix: +// 1 = top +// 2 = right +// 3 = bottom +// 4 = left +// each element of this sub array defines +// the piece (.blocks) of the game starting top-left +// each of the values define what to show, +// example: 141_90 + // 14 indicates that the curved line + // will go from top (1) to left (4) + // the third caharacter is a 1 + // this indicates where to draw the arrow + // as this 3rd character is 1, + // the arrow will be shown at top + // the underscore separates the arrow + // definition from the initial rotation (deg) + // this deg values can be 0 (no rotation al all) + // is deg===0 then the brick background is shown +// there are some special values for this elements: + // x = brick with a cross + // y = brick with top-right & bottom-left lines + // z = brick with top-left & bottom-right lines +var levels = [ + ["122_0","242_90","242_0","242_-90","141_0"], + ["122_180","343_0","","232_0","141_90","","122_90","242_-90","141_-90"], + ["x","343_90","232_-90","244_180","131_90","122_-90","242_-180","y","z","141_90","","122_-90","122_-90","141_90"], + ["133_90","343_-90","232_180","242_90","141_-90","122_90","y","121_90","x","344_-90","233_90","122_-90","343_90","z","141_180","121_90","242_0","122_180","141_90"], + ["122_90","343_180","232_90","242_180","141_-90","233_180","z","x","y","344_180","133_90","y","z","z","141_90","122_180","242_-90","141_180","233_180","121_-90"], + ["y","242_90","343_-90","232_180","z","232_90","242_180","x","141_180","141_180","131_90","122_180","x","244_-90","344_90","122_0","244_180","144_90","122_90","144_0"], + ["122_90","343_-90","232_180","242_-90","141_-90","233_180","z","z","242_90","343_90","133_180","121_180","x","344_90","133_-90","122_-90","242_90","141_180","121_180","144_90"], + ["133_-90","232_90","343_180","232_180","141_90","122_0","z","y","y","344_-90","232_180","z","y","x","141_90","121_-90","144_180","121_90","144_90","144_-90"], + ["122_90","242_-90","343_90","344_180","131_-90","233_90","244_90","144_180","z","141_180","133_-90","121_-90","z","y","344_90","122_-90","242_180","141_-90","122_180","141_90"], + ["133_-90","233_180","344_180","232_90","141_-90","122_-90","y","x","z","343_90","233_180","z","x","141_-90","133_90","122_180","141_-90","121_90","244_180","144_-90"], + ["122_180","343_-90","232_90","343_-90","131_90","233_180","144_90","131_-90","133_180","131_-90","133_90","232_00","z","z","141_180","122_90","141_-90","122_-90","141_180"], + ["133_180","232_180","242_-90","343_90","131_90","122_180","x","343_90","122_-90","141_180","233_90","x","x","244_180","344_-90","122_-90","141_180","122_90","242_180","141_-90"] +]; +// toverify array contain the matrix elements to be verify, +// when rotation degree for each elements of toverify iz zero +// then the level is complete - see verify() function +var toverify = [ + [1,3], + [0,4,6,7,8], + [4,5,6,9,12,13], + [0,2,3,4,5,7,9,11,12,14,17,18], + [0,1,2,3,4,5,10,15,16,17], + [1,2,3,5,6,8,10,16,17], + [0,1,2,3,4,5,8,9,10,11,13,14,15,16,17,18,19], + [0,1,2,3,4,5,9,10,14,15,16,17,18], + [0,1,2,4,5,6,7,9,10,14,15,16,17,18,19], + [0,1,2,3,4,5,9,10,13,14,15,16,17,18,19], + [0,1,2,3,4,5,6,7,8,9,10,11,14,15,16,17,18,19], + [0,1,2,3,4,5,7,8,9,10,13,14,15,16,17,18,19] +]; +// completed_paths is an array with SVG paths to show +// the animation when a level is completed +var completed_paths = [ + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '' +]; +$(document).ready(function() { + $("body").delegate("#b_next","click",function() { + var level = parseInt($("#level span").html()); + show_level(level); + }); + $("body").delegate("#b_menu","click",function() { + $("body").css("background-color","#f0f0f0"); + $("#complete").html(""); + $("#b_menu,#b_next,#level,#moves").hide(); + $("#info,#mainpath,#maincircle,#div_levels,#lighton").show(); + $(".blocks").remove(); + }); + $("body").delegate(".b_levels","click",function() { + var level = parseInt($(this).children("div").html()); + $("#info,#div_levels").hide(); + $("#mainpath,#maincircle").hide(); + show_level(level-1); + }); + $("body").delegate(".blocks","click",function() { + // rotates the block 90 deg clockwise + if (playing) { + blocked = parseInt($(this).data("blocked")); + if (blocked===0) { + $(".blocks").css("z-index",100); + angle = parseInt($(this).data("angle"))+90; + $(this).css({ + "transition":"200ms linear all", + "z-index":"101", + "transform:":"rotate("+angle+"deg)", + "-moz-transform":"rotate("+angle+"deg)", + "-webkit-transform":"rotate("+angle+"deg)", + "-o-transform":"rotate("+angle+"deg)", + "-ms-transform":"rotate("+angle+"deg)", + "-khtml-transform":"rotate("+angle+"deg)" + }); + $(this).data("angle",angle); + moves = parseInt($("#moves span").html()); + $("#moves span").html(moves+1); + verify(); + } + } + }); + show_level_buttons(); +}); +function show_level_buttons() { + var level = 1; + for (var i=0;i<3;i++) { + for (var j=0;j<4;j++) { + bhtml = '
    LEVEL
    '+level+'
    '; + $("#div_levels").append(bhtml); + level++; + } + } +} +function verify() { + // see if all block's rotation angle is zero + // using javascript mod + complete = true; + var level = parseInt($("#level span").html()); + var verify_paths = toverify[level-1]; + for (var i=0;i'; + html += ''; + $("#complete circle").html(html); + var level = parseInt($("#level span").html()); + $(".b_levels:eq("+(level-1)+")").css({ + "border":"2px solid #006100", + "color":"#006100", + "background-color":"#ffffff" + }); + if (level<12) { + $("#b_next").show(); + } + $("body").css("background-color","#f0f0f0"); + $("#lighton").show(); +} +function show_blocks() { + var paths = ''; + + paths += ''; + + paths += ''; + paths += ''; + paths += ''; + paths += ''; + + paths += ''; + paths += ''; + paths += ''; + paths += ''; + + paths += ''; + paths += ''; + paths += ''; + paths += ''; + var c = 0; + for (var i=0;i<4;i++) { + for (var j=0;j<5;j++) { + $("#game").append("
    "+paths+"
    "); + c++; + } + } +} +function show_level(level) { + // show blocks according level + $("body").css("background-color","#c0c0c0"); + playing = true; + $("#complete").html("").hide(); + $(".blocks").remove(); + show_blocks(); + $("#level span").html(level+1); + $("#moves span").html(0); + $("#level,#moves,#b_menu").show(); + $("#lighton,#b_next").hide(); + level_paths = levels[level]; + $(".blocks").css({ + "background-image":"url(https://i.imgur.com/0Fc0TuZ.png)", + "cursor":"default" + }).data("angle","0").data("blocked","1").show(); + $(".blocks circle,.blocks polyline,.blocks path,.blocks line").hide(); + for (var i=0;i { order++; } }; +function calls(){ + swal("*INSTRUCTION - HOW TO PLAY*","The objective of this game is to find the password of 4 digits within 4 tries.\n\n\n~HINT-1:Digit in the black box-This digit is not used to form the vault's password.\n\n~HINT-2:Digit in the yellow box-This digit is used to form the vault's password but is not in it's correct position.\n\n~HINT-3:Digit in the blue box-This digit is used to form the vault's password and is in it's correct'position.\n\n\nAlso remember that the vault's password can have repeated digits.") +}; \ No newline at end of file diff --git a/Games/Wault_master/dist/output.css b/Games/Wault_master/dist/output.css index e2bd2d6a25..3e5c95d843 100644 --- a/Games/Wault_master/dist/output.css +++ b/Games/Wault_master/dist/output.css @@ -1100,4 +1100,18 @@ input[type=number] { .md\:flex-row-reverse { flex-direction: row-reverse; } +} +.b1{ + background-color: white; + border-radius: 10px; + padding: 10px 4px; + display:flex; + font-size: 15px; + font-style:oblique; + box-shadow: 0 5px #999; +} +.b1:active{ + background-color: grey; + box-shadow: 0 3px #666; + transform: translateY(1px); } \ No newline at end of file diff --git a/Games/Wault_master/index.html b/Games/Wault_master/index.html index ec6a1f9d89..2ac57327d2 100644 --- a/Games/Wault_master/index.html +++ b/Games/Wault_master/index.html @@ -12,11 +12,15 @@ Wault - Home + +
    + +
    diff --git a/Games/Whack_a_Mole/CSS/style.css b/Games/Whack_a_Mole/CSS/style.css index 62c45f742f..d096bd9a0b 100644 --- a/Games/Whack_a_Mole/CSS/style.css +++ b/Games/Whack_a_Mole/CSS/style.css @@ -210,3 +210,4 @@ } } + diff --git a/Games/Whack_a_Mole/README.md b/Games/Whack_a_Mole/README.md index 8fe44ffaed..939ec8339e 100644 --- a/Games/Whack_a_Mole/README.md +++ b/Games/Whack_a_Mole/README.md @@ -35,5 +35,8 @@
    ![image](/Games/Whack_a_Mole/whac-a-mole%20.png) + + [Video] (https://imgur.com/a/8onaepi) +
    diff --git a/Games/Whack_a_Mole/audio/game-music.mp3 b/Games/Whack_a_Mole/audio/game-music.mp3 new file mode 100644 index 0000000000..aa23091304 Binary files /dev/null and b/Games/Whack_a_Mole/audio/game-music.mp3 differ diff --git a/Games/Whack_a_Mole/audio/game-over.mp3 b/Games/Whack_a_Mole/audio/game-over.mp3 new file mode 100644 index 0000000000..1aa090c20f Binary files /dev/null and b/Games/Whack_a_Mole/audio/game-over.mp3 differ diff --git a/Games/Whack_a_Mole/index.html b/Games/Whack_a_Mole/index.html index 9a7fd0effe..c1a21b52ea 100644 --- a/Games/Whack_a_Mole/index.html +++ b/Games/Whack_a_Mole/index.html @@ -8,7 +8,10 @@ -

    Whack a Mole

    +
    +

    HOME

    +
    +

    Whack a Mole

    Score:

    0

    @@ -16,9 +19,16 @@

    Score:

    0

     
    - +
    + + + + + + + diff --git a/Games/Whack_a_Mole/mole.css b/Games/Whack_a_Mole/mole.css index 2b2b939332..c0c2c6968c 100644 --- a/Games/Whack_a_Mole/mole.css +++ b/Games/Whack_a_Mole/mole.css @@ -1,44 +1,87 @@ body { - font-family: Arial, Helvetica, sans-serif; - text-align: center; - background: url("./mario-bg.jpg"); - background-size: cover; + font-family: Arial, Helvetica, sans-serif; + text-align: center; + background: url("./mario-bg.jpg"); + background-size: cover; } #board { - width: 540px; - height: 540px; - /* background-color: green; */ + width: 540px; + height: 540px; + /* background-color: green; */ - margin: 0 auto; - display: flex; - flex-wrap: wrap; + margin: 0 auto; + display: flex; + flex-wrap: wrap; - background: url("./soil.png"); - background-size: cover; - border: 3px solid white; - border-radius: 25px; + background: url("./soil.png"); + background-size: cover; + border: 3px solid white; + border-radius: 25px; } #board div { - /* board = 540 x 540, divide into 3x3 tiles --> 180 x 180 per div */ - width: 180px; - height: 180px; - background-image: url("./pipe.png"); - background-size: cover; + /* board = 540 x 540, divide into 3x3 tiles --> 180 x 180 per div */ + width: 180px; + height: 180px; + background-image: url("./pipe.png"); + background-size: cover; } #board div img { - /* all img tags inside tiles */ - width: 100px; - height: 100px; + /* all img tags inside tiles */ + width: 100px; + height: 100px; - user-select: none; - -moz-user-select: none; - -webkit-user-drag: none; - -webkit-user-select: none; - -ms-user-select: none; + user-select: none; + -moz-user-select: none; + -webkit-user-drag: none; + -webkit-user-select: none; + -ms-user-select: none; +} +.home{ + background-color: aqua; + padding:25px; +} +.home h3{ + font-size: sans-serif; } +.start-btn { + background-color: #0d625e; + margin-bottom: 10px; + font-size: large; + padding: 5px; + border-radius: 5px; + transition: background-color 0.3s; + color: white; + border: none; +} +.start-btn:hover { + background-color: #66d37e; + animation: move-down 0.3s; + color: black; + } +#speed-slider { + -webkit-appearance: none; /* Override default CSS styles */ + appearance: none; + background: #45b7b8; + outline: none; + border-radius: 5px; + height: 10px; +} +#speed-slider:hover { + opacity: 10; /* Fully shown on mouse-over */ +} +#speed-slider::-webkit-slider-thumb { + -webkit-appearance: none; /* Override default look */ + appearance:circle; + width: 15px; /* Set a specific slider handle width */ + height: 15px; /* Slider handle height */ + background: #04AA6D; /* Green background */ + cursor: pointer; /* Cursor on hover */ + border-radius: 10px; +} + \ No newline at end of file diff --git a/Games/Whack_a_Mole/mole.js b/Games/Whack_a_Mole/mole.js index 9f7c2fa582..d78a8532aa 100644 --- a/Games/Whack_a_Mole/mole.js +++ b/Games/Whack_a_Mole/mole.js @@ -68,17 +68,30 @@ function setPlant() { } function selectTile() { - if (gameOver) { - return; - } - if (this == currMoleTile) { - score += 10; - document.getElementById("score").innerText = score.toString(); //update score html - } - else if (this == currPlantTile) { - document.getElementById("score").innerText = "GAME OVER: " + score.toString(); //update score html - gameOver = true; - } + if (gameOver) { + return; + } + if (this == currMoleTile) { + score += 10; + document.getElementById("score").innerText = score.toString(); //update score html + } else if (this == currPlantTile) { + let btn = document.getElementById("btn"); + btn.textContent = "Start New Game"; + document.getElementById("score").innerText = + "GAME OVER: " + score.toString(); //update score html + gameOver = true; + let backgroundMusic = document.getElementById("background-music"); + backgroundMusic.pause(); + backgroundMusic.currentTime = 0; // Rewind the music to the beginning + // Play the game over sound + let gameOverSound = document.getElementById("gameOver-music"); + gameOverSound.play(); + setTimeout(() => { + gameOverSound.pause(); + gameOverSound.currentTime = 0; // Reset to the beginning if desired + }, 3000); // 3000 milliseconds = 3 seconds + } + } @@ -105,6 +118,18 @@ function startNewGame() { resetGame(); moleIntervalId = setInterval(setMole, speed); // 1000 miliseconds = 1 second, every 1 second call setMole plantIntervalId = setInterval(setPlant, 2000); // 2000 miliseconds = 2 seconds, every 2 second call setPlant + + let gameOverSound = document.getElementById("gameOver-music"); + if (!gameOverSound.paused) { + gameOverSound.pause(); + gameOverSound.currentTime = 0; + } + + let backgroundMusic = document.getElementById("background-music"); + backgroundMusic.play(); + let btn = document.getElementById("btn"); + btn.textContent = "The game has been started!"; + document.getElementById("speed-section").style.display = "none"; } function resetGame() { diff --git a/Games/wordScramble/README.md b/Games/wordScramble/README.md new file mode 100644 index 0000000000..297880b098 --- /dev/null +++ b/Games/wordScramble/README.md @@ -0,0 +1,45 @@ + +# **Word Scramble Game** + +--- + +## **Description ๐Ÿ“ƒ** + +- Welcome to the Simple Word Scramble Game! It's straightforward yet addictively fun. Just unscramble the letters to reveal the hidden words. With each correct answer, you'll feel a rush of satisfaction as you unlock new levels. It's perfect for quick bursts of entertainment or a relaxing challenge anytime, anywhere and the game aims to challenge players' vocabulary and word unscrambling skills while providing an engaging and interactive experience. Dive in and test your word skills with this easy-to-play game! + +## **Functionalities ๐ŸŽฎ** + +Game consists of following functionalities : + +
      +
    1. Upon loading the page, players are welcomed with a screen providing information about the game. Clicking the "Play Now" button redirects the player to the game page.
    2. +
    3. Players must rearrange the scrambled letters within a given time interval to form a valid word.
    4. +
    5. For every correct word player earns 10 points.
    6. +
    7. If the word entered by the player is incorrect, they lose a life. The game ends if the player loses all their lives.
    8. +
    9. The player can use the "Hint" button to reveal a hint for the current word, but this can only be used once per game.
    10. +
    11. The game progresses through levels, with each level presenting increasingly difficult words. The time limit for each word decreases as the level increases.
    12. +
    13. This is single player game.
    14. +
    + +## **How to Play? ๐Ÿ•น๏ธ** + +- Upon visiting the website, you'll be greeted with a welcome screen. +- By clicking "Play Now," you'll be redirected to the game page. +- You'll see a scrambled word and a hint. Rearrange the letters to form a valid word and by clicking the "Check Word" button or by using "Enter" key you can see if your answer is correct or not. +- For every correct answer you earn points and for non correct answer the lives are deducted +- The game continues until all 3 lives are finished. +- After completing, you'll receive your final score and level cleared.Your score is based on the number of correct answers. + +## **Screenshots ๐Ÿ“ธ** + +
    +

    Home Page

    + +

    Game page

    + +

    For Correct answer

    + +

    For Wrong answer

    + +

    Game Over

    + diff --git a/Games/wordScramble/assets/1.png b/Games/wordScramble/assets/1.png new file mode 100644 index 0000000000..a03fb8e96e Binary files /dev/null and b/Games/wordScramble/assets/1.png differ diff --git a/Games/wordScramble/assets/2.png b/Games/wordScramble/assets/2.png new file mode 100644 index 0000000000..7d7ba1c223 Binary files /dev/null and b/Games/wordScramble/assets/2.png differ diff --git a/Games/wordScramble/assets/3.png b/Games/wordScramble/assets/3.png new file mode 100644 index 0000000000..571e1937f4 Binary files /dev/null and b/Games/wordScramble/assets/3.png differ diff --git a/Games/wordScramble/assets/4.png b/Games/wordScramble/assets/4.png new file mode 100644 index 0000000000..62caaef731 Binary files /dev/null and b/Games/wordScramble/assets/4.png differ diff --git a/Games/wordScramble/assets/5.png b/Games/wordScramble/assets/5.png new file mode 100644 index 0000000000..16bb864f7f Binary files /dev/null and b/Games/wordScramble/assets/5.png differ diff --git a/Games/wordScramble/assets/alphabet-background.jpg b/Games/wordScramble/assets/alphabet-background.jpg new file mode 100644 index 0000000000..bc640707e8 Binary files /dev/null and b/Games/wordScramble/assets/alphabet-background.jpg differ diff --git a/Games/wordScramble/assets/background.jpg b/Games/wordScramble/assets/background.jpg new file mode 100644 index 0000000000..660bc3a5bf Binary files /dev/null and b/Games/wordScramble/assets/background.jpg differ diff --git a/Games/wordScramble/assets/correct.mp3 b/Games/wordScramble/assets/correct.mp3 new file mode 100644 index 0000000000..dfbde1419b Binary files /dev/null and b/Games/wordScramble/assets/correct.mp3 differ diff --git a/Games/wordScramble/assets/game-start.mp3 b/Games/wordScramble/assets/game-start.mp3 new file mode 100644 index 0000000000..0c383ec481 Binary files /dev/null and b/Games/wordScramble/assets/game-start.mp3 differ diff --git a/Games/wordScramble/assets/game_over.mp3 b/Games/wordScramble/assets/game_over.mp3 new file mode 100644 index 0000000000..1fd5b586b3 Binary files /dev/null and b/Games/wordScramble/assets/game_over.mp3 differ diff --git a/Games/wordScramble/assets/giphy.gif b/Games/wordScramble/assets/giphy.gif new file mode 100644 index 0000000000..a238eb0569 Binary files /dev/null and b/Games/wordScramble/assets/giphy.gif differ diff --git a/Games/wordScramble/assets/images/background.jpg b/Games/wordScramble/assets/images/background.jpg new file mode 100644 index 0000000000..660bc3a5bf Binary files /dev/null and b/Games/wordScramble/assets/images/background.jpg differ diff --git a/Games/wordScramble/assets/incorrect.mp3 b/Games/wordScramble/assets/incorrect.mp3 new file mode 100644 index 0000000000..893ea78dc1 Binary files /dev/null and b/Games/wordScramble/assets/incorrect.mp3 differ diff --git a/Games/wordScramble/assets/logo.png b/Games/wordScramble/assets/logo.png new file mode 100644 index 0000000000..e1b2a2ad42 Binary files /dev/null and b/Games/wordScramble/assets/logo.png differ diff --git a/Games/wordScramble/assets/timeout.mp3 b/Games/wordScramble/assets/timeout.mp3 new file mode 100644 index 0000000000..f5a8309981 Binary files /dev/null and b/Games/wordScramble/assets/timeout.mp3 differ diff --git a/Games/wordScramble/game.css b/Games/wordScramble/game.css new file mode 100644 index 0000000000..3049cbf96f --- /dev/null +++ b/Games/wordScramble/game.css @@ -0,0 +1,175 @@ +@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap'); +*{ + margin: 0; + padding: 0; + box-sizing: border-box; + font-family: 'Poppins', sans-serif; + color: white; +} + +body { + display: flex; + justify-content: center; + align-items: center; + min-height: 100vh; + background: url('assets/alphabet-background.jpg') no-repeat center center/cover; + transition: 0.3s ease-in-out; +} + +.container { + width: 90%; + max-width: 450px; + border-radius: 7px; + background: rgb(24, 1, 1); + box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); + animation: fadeIn 0.5s; +} + +@keyframes fadeIn { + from { opacity: 0; } + to { opacity: 1; } +} + + +.container h2{ + font-size: 25px; + font-weight: 500; + padding: 18px 25px; + border-bottom: 1px solid #ccc; +} + +.container .content { + margin: 25px 20px 30px; +} + +.container .word { + font-size: 33px; + font-weight: 500; + text-align: center; + text-transform: uppercase; + letter-spacing: 24px; + margin-right: -24px; +} + +.container input[type="text"] { + color: black; +} + +.content .details { + margin: 25px 0 20px; + display: flex; + justify-content: space-between; + flex-wrap: wrap; +} + +.container .hint { + background-color: rgba(255, 255, 255, 0.2); /* Set background color with transparency */ + padding: 10px; + border-radius: 5px; +} + +.container .hint span { + color: white; +} + +.details p { + font-size: 18px; + margin-bottom: 10px; + flex-basis: 100%; +} + +.details p.bigger { + flex-basis: auto; /* Allow bigger details to occupy necessary space */ +} + +.details p b { + font-weight: 500; +} + +.content input{ + width: 100%; + height: 60px; + outline: none; + font-size: 18px; + padding: 0 16px; + border-radius: 5px; + border: 1-x solid #aaa; +} + +.content .buttons{ + display: flex; + margin-top: 20px; + justify-content: space-between; + gap: 8px; +} + +.buttons button{ + border: none; + outline: none; + color: #fff; + cursor: pointer; + padding: 15px 0; + font-size: 17px; + border-radius: 5px; + width: calc(100%/ 3 - 10px); +} + +.buttons .refresh-word{ + background: #6c757d; +} + +.buttons .check-word{ + background: #5372F0; +} + +.buttons .hint-btn { + background: #28a745; +} + +.buttons button:hover { + background-color: #4e5a65; +} + +/* Styles for the game over popup */ +.popup { + display: none; /* Initially hidden */ + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: rgba(0, 0, 0, 0.7); + justify-content: center; + align-items: center; + z-index: 1000; +} + +.popup-content { + background: #1c1e22; + padding: 20px; + border-radius: 10px; + text-align: center; + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); +} + +.popup-content h2 { + margin-bottom: 20px; +} + +.popup-content p { + margin-bottom: 15px; +} + +.popup-content button { + background: #5372F0; + border: none; + padding: 10px 20px; + color: white; + font-size: 16px; + border-radius: 5px; + cursor: pointer; +} + +.popup-content button:hover { + background: #4358b0; +} \ No newline at end of file diff --git a/Games/wordScramble/game.html b/Games/wordScramble/game.html new file mode 100644 index 0000000000..9620661b3e --- /dev/null +++ b/Games/wordScramble/game.html @@ -0,0 +1,47 @@ + + + + + Word Scramble Game + + + + + + + + +
    +

    Word Scramble

    +
    +

    +
    +

    Hint:

    +

    Time Left: 30s

    +

    Score: 0

    +

    Lives: 3

    +

    Level: 1

    +
    + +
    + + + +
    +
    +
    + + + + + + + + \ No newline at end of file diff --git a/Games/wordScramble/index.html b/Games/wordScramble/index.html new file mode 100644 index 0000000000..ead085c102 --- /dev/null +++ b/Games/wordScramble/index.html @@ -0,0 +1,38 @@ + + + + + Welcome to Word Scramble Game + + + +
    +
    +
    +

    Welcome to Word Scramble Game

    +

    Get ready to unscramble words and test your vocabulary!

    +
    +

    Rules:

    +
      +
    1. Unscramble the letters to form a valid word.
    2. +
    3. You have a limited number of lives.
    4. +
    5. Each correct word earns you points.
    6. +
    7. Try to achieve the highest score!
    8. +
    +
    +
    +
    + Welcome GIF +
    +
    + +
    + + + background +
    + +
    + + + diff --git a/Games/wordScramble/js/script.js b/Games/wordScramble/js/script.js new file mode 100644 index 0000000000..e65ac36f82 --- /dev/null +++ b/Games/wordScramble/js/script.js @@ -0,0 +1,155 @@ +const wordText = document.querySelector(".word"); +hintText = document.querySelector(".hint span"); +timeText = document.querySelector(".time b"); +const scoreText = document.querySelector(".score b"); +const livesText = document.querySelector(".lives b"); +inputField = document.querySelector("input"); +refreshBtn = document.querySelector(".refresh-word"); +checkBtn = document.querySelector(".check-word"); +const hintBtn = document.querySelector(".hint-btn"); +const levelText = document.querySelector(".level b"); + +const gameOverPopup = document.getElementById("gameOverPopup"); +const finalScoreElem = document.getElementById("finalScore"); +const finalLevelElem = document.getElementById("finalLevel"); +const gameOverBtn = document.getElementById("gameOverBtn"); + +let correctWord, timer, score = 0, lives = 3, hintUsed = false, level = 1; +let correctAnswersInLevel = 0; +let timeLeft = 30; + +const correctSound = new Audio('assets/correct.mp3'); +const incorrectSound = new Audio('assets/incorrect.mp3'); +const timeoutSound = new Audio('assets/timeout.mp3'); +const clappingSound = new Audio('assets/game_over.mp3'); + + +const initTimer = maxTime => { + clearInterval(timer); + timer = setInterval(() => { + if(maxTime > 0) { + maxTime--; + return timeText.innerText = maxTime; + } + clearInterval(timer); + timeoutSound.play(); // Play timeout sound + alert(`Time's up!!! ${correctWord.toUpperCase()} was the correct word`); + loselife(); + }, 1000); +} + +const initGame = () => { + if(lives == 0) { + showGameOverPopup(); + return; + } + + if (correctAnswersInLevel == 5) { + level++; + timeLeft -= 10; + levelText.innerText = level; + correctAnswersInLevel = 0; + alert(`Congratulations! You've advanced to level ${level}`); + } + + + initTimer(timeLeft); // time decrease as the level incereases + let randomObj = words[Math.floor(Math.random() * words.length)]; //getting random objects + let wordArray = randomObj.word.split("") //splitting each letter + for (let i = wordArray.length - 1 ; i > 0; i--){ + let j = Math.floor(Math.random() * (i + 1)); //getting random number + // swapping wordArray letters randomly + [wordArray[i], wordArray[j]] = [wordArray[j], wordArray[i]]; + } + wordText.innerText = wordArray.join(""); + hintText.innerText = randomObj.hint; + correctWord = randomObj.word.toLowerCase(); + inputField.value = ""; + inputField.setAttribute("maxlength", correctWord.length); + hintUsed = false; +} + +const checkWord = () => { + let userWord = inputField.value.toLocaleLowerCase(); + if(!userWord) return alert("Please enter a word to check"); // if no input enterd + + // if not matched with the correct word + if(userWord !== correctWord){ + incorrectSound.play(); + alert(`Oops! ${userWord} is not a correct word`); + loselife(); + } + // if matched with the correct word + else{ + correctSound.play(); + alert(`Congrats! ${userWord.toUpperCase()} is a correct word`); + score += 10; + correctAnswersInLevel++; + scoreText.innerText = score; + initGame(); + } +} + +const loselife = () => { + lives--; + livesText.innerText = lives; + if (lives == 0) { + showGameOverPopup(); + } else { + initGame(); + } +} + +const showGameOverPopup = () => { + clappingSound.play(); + finalScoreElem.innerText = score; + finalLevelElem.innerText = level; + gameOverPopup.style.display = 'flex'; +} + +const resetGame = () => { + score = 0; + lives = 3; + level = 1; + correctAnswersInLevel = 0; + timeLeft = 30; + scoreText.innerText = score; + livesText.innerText = lives; + levelText.innerText = level; + initGame(); +} + +const giveHint = () => { + if (hintUsed) { + alert("You can only use the hint once!"); + return; + } + let userWord = inputField.value.toLowerCase(); + for (let i = 0; i < correctWord.length; i++) { + if (userWord[i] !== correctWord[i]) { + inputField.value = userWord.slice(0, i) + correctWord[i] + userWord.slice(i + 1); + hintUsed = true; + break; + } + } +} + +refreshBtn.addEventListener("click", initGame); +checkBtn.addEventListener("click", checkWord); +hintBtn.addEventListener("click", giveHint); + +// Event listener for the game over button +gameOverBtn.addEventListener("click", () => { + // Redirect to the welcome page (index.html) + window.location.href = 'index.html'; +}); + +// Event listener for Enter key press +inputField.addEventListener("keypress", event => { + if (event.key === "Enter") { + checkWord(); + } +}); + + +document.addEventListener("DOMContentLoaded", initGame); \ No newline at end of file diff --git a/Games/wordScramble/js/words.js b/Games/wordScramble/js/words.js new file mode 100644 index 0000000000..4dfa0c2c76 --- /dev/null +++ b/Games/wordScramble/js/words.js @@ -0,0 +1,146 @@ +const words = [ + { + word: "addition", + hint: "The process of adding numbers" + }, + { + word: "meeting", + hint: "Event in which people come together" + }, + { + word: "number", + hint: "Math symbol used for counting" + }, + { + word: "exchange", + hint: "The act of trading" + }, + { + word: "canvas", + hint: "Piece of fabric for oil painting" + }, + { + word: "garden", + hint: "Space for planting flower and plant" + }, + { + word: "position", + hint: "Location of someone or something" + }, + { + word: "feather", + hint: "Hair like outer covering of bird" + }, + { + word: "comfort", + hint: "A pleasant feeling of relaxation" + }, + { + word: "tongue", + hint: "The muscular organ of mouth" + }, + { + word: "expansion", + hint: "The process of increase or grow" + }, + { + word: "country", + hint: "A politically identified region" + }, + { + word: "group", + hint: "A number of objects or persons" + }, + { + word: "taste", + hint: "Ability of tongue to detect flavour" + }, + { + word: "store", + hint: "Large shop where goods are traded" + }, + { + word: "field", + hint: "Area of land for farming activities" + }, + { + word: "friend", + hint: "Person other than a family member" + }, + { + word: "pocket", + hint: "A bag for carrying small items" + }, + { + word: "needle", + hint: "A thin and sharp metal pin" + }, + { + word: "expert", + hint: "Person with extensive knowledge" + }, + { + word: "statement", + hint: "A declaration of something" + }, + { + word: "second", + hint: "One-sixtieth of a minute" + }, + { + word: "library", + hint: "Place containing collection of books" + }, + { + word: "Variable", + hint: "A named storage location in a program" + }, + { + word: "Function", + hint: "A block of organized, reusable code that performs a specific task" + }, + { + word: "Array", + hint: "A data structure that stores a collection of elements" + }, + { + word: "Boolean", + hint: "A data type that represents one of two values, typically 'true' or 'false'" + }, + { + word: "String", + hint: "A sequence of characters" + }, + { + word: "Integer", + hint: "A whole number, without a fractional part" + }, + { + word: "Class", + hint: "A blueprint for creating objects, providing initial values for state and implementations of behavior" + }, + { + word: "Gravity", + hint: "The force that attracts objects toward each other" + }, + { + word: "Revolution", + hint: "A sudden, complete, or marked change in something" + }, + { + word: "Ecosystem", + hint: "A biological community of interacting organisms and their physical environment" + }, + { + word: "Innovation", + hint: "The introduction of something new or a new idea, method, or device" + }, + { + word: "Runway", + hint: "A narrow, usually elevated platform used by models to demonstrate clothing and accessories during a fashion show" + }, + { + word: "Trend", + hint: "A general direction in which something is developing or changing, often in fashion" + }, +] \ No newline at end of file diff --git a/Games/wordScramble/script.js b/Games/wordScramble/script.js new file mode 100644 index 0000000000..d4f3cb79ec --- /dev/null +++ b/Games/wordScramble/script.js @@ -0,0 +1,5 @@ +document.getElementById('play-now-button').addEventListener('click', function() { + const gameStartSound = new Audio('assets/start-game.mp3'); + gameStartSound.play(); + window.location.href = 'game.html'; +}); diff --git a/Games/wordScramble/styles.css b/Games/wordScramble/styles.css new file mode 100644 index 0000000000..7dd5dc27cd --- /dev/null +++ b/Games/wordScramble/styles.css @@ -0,0 +1,132 @@ +body { + margin: 0; + padding: 0; + background-image: url('assets/background.jpg'); + overflow: hidden; +} + +.container { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 80%; + max-width: 600px; + padding: 20px; + text-align: center; + background-color: rgba(255, 255, 255, 0.8); + border-radius: 10px; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); + z-index: 1; +} + + +.welcome-content { + display: flex; + justify-content: space-between; + height: 100%; +} + +.welcome-text { + width: calc(50% - 10px); + white-space: nowrap; + text-overflow: ellipsis; +} + +.welcome-gif-container { + position: absolute; + top: 65%; + right: 20px; + transform: translateY(-50%); + width: 200px; + background-color: transparent; +} + +.welcome-gif { + width: 100%; + height: auto; + border-radius: 10px; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); +} + +h1 { + color: #333; + font-size: 36px; + padding-left: 40px; +} + +.welcome-note { + margin-bottom: 20px; +} + +.rules-list { + text-align: left; + margin-bottom: 20px; +} + +.rules-list li { + margin-bottom: 10px; + font-size: 20px; +} + +#play-now-button { + padding: 10px 20px; + font-size: 20px; + background-color: #4CAF50; + color: white; + border: none; + border-radius: 5px; + cursor: pointer; + transition: background-color 0.3s; +} + +#play-now-button:hover { + background-color: #45a049; +} + + +.logo-container { + position: fixed; + top: 20px; + left: 20px; + width: 100px; + height: 100px; + border-radius: 50%; + background-color: #fff; + display: flex; + justify-content: center; + align-items: center; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); +} + +.logo { + width: 100%; + height: 100%; + object-fit: cover; + border-radius: 50%; +} + +.welcome-text h1{ + padding-left: 40px; +} + +.welcome-content p{ + padding-left: 80px; + font-size: 20px; +} + +h2{ + text-align: left; + padding-left: 20px; + font-size: 20px; +} + +.background { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + object-fit: cover; + z-index: -1; +} \ No newline at end of file diff --git a/README.md b/README.md index 6d8b1d1315..91d6475895 100644 --- a/README.md +++ b/README.md @@ -109,7 +109,7 @@ This repository also provides one such platforms where contributers come over an | Game | Game | Game | Game | Game | | ---------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------- | -| [Master Typing](https://github.com/kunjgit/GameZone/tree/main/Games/Master_Typing) | [Virtual Pet](https://github.com/Antiquely3059/GameZone/tree/main/Games/Virtual_Pet) | [MazeRunner](https://github.com/kunjgit/GameZone/tree/main/Games/MazeRunner) | [Ping_Pong_Singleplayer](https://github.com/kunjgit/GameZone/tree/main/Games/Ping_Pong_Singleplayer) | | +| [Master Typing](https://github.com/kunjgit/GameZone/tree/main/Games/Master_Typing) | [Treasure Hunt](https://github.com/Antiquely3059/GameZone/tree/main/Games/Treasure%20Hunt) | [Virtual Pet](https://github.com/Antiquely3059/GameZone/tree/main/Games/Virtual_Pet) | [MazeRunner](https://github.com/kunjgit/GameZone/tree/main/Games/MazeRunner) | [Ping_Pong_Singleplayer](https://github.com/kunjgit/GameZone/tree/main/Games/Ping_Pong_Singleplayer) | | | [Tilting Maze](https://github.com/kunjgit/GameZone/tree/main/Games/Tilting_Maze) | [Simon Game Challenge](https://github.com/kunjgit/GameZone/tree/main/Games/Simon_Game_Challenge) | [Snake Game](https://github.com/kunjgit/GameZone/tree/main/Games/Snake_Game) | [Dino Runner Game](https://github.com/kunjgit/GameZone/tree/main/Games/Dino_Runner_Game) | | [Whack a Mole](https://github.com/kunjgit/GameZone/tree/main/Games/Whack_a_Mole) | [Doraemon Jump](https://github.com/kunjgit/GameZone/tree/main/Games/Doraemon_Jump) | [Black Jack](https://github.com/kunjgit/GameZone/tree/main/Games/Black_Jack) | [Memory Game](https://github.com/kunjgit/GameZone/tree/main/Games/Memory_Game) | [Word Guessing Game](https://github.com/kunjgit/GameZone/tree/main/Games/Word_Guessing_Game) | | [Ludo Game](https://github.com/kunjgit/GameZone/tree/main/Games/Ludo_Game) | [Piano Game](https://github.com/kunjgit/GameZone/tree/main/Games/Piano) | [Atari Breakout](https://github.com/kunjgit/GameZone/tree/main/Games/Atari_Breakout) | [Dinosaur Game](https://github.com/kunjgit/GameZone/tree/main/Games/Chrome_Dinosaur_Game) | [Guess The Colour by RGB Game](https://github.com/kunjgit/GameZone/tree/main/Games/Colour_Guessing_Game) | @@ -120,6 +120,7 @@ This repository also provides one such platforms where contributers come over an | [Word Scramble Game](https://github.com/kunjgit/GameZone/tree/main/Games/Word_Scramble_Game) | [Tetris](https://github.com/kunjgit/GameZone/tree/main/Games/Tetris) | [Interactive Quizzing Application](https://github.com/kunjgit/GameZone/tree/main/Games/Interactive_Quizzing) | [Planet Defense Game](https://github.com/kunjgit/GameZone/tree/main/Games/Planet_Defense) | [Rabbit Rush Game](https://github.com/kunjgit/GameZone/tree/main/Games/Rabbit_Rush) | | [Wordle](https://github.com/kunjgit/GameZone/tree/main/Games/Wordle) | [Roll Race Game](https://github.com/kunjgit/GameZone/tree/main/Games/Roll_Race) | [Menja Game](https://github.com/kunjgit/GameZone/tree/main/Games/Menja) | [Typing Speed Test Game](https://github.com/kunjgit/GameZone/tree/main/Games/Typing_Speed_Test_Game) | [Tile Game](https://github.com/kunjgit/GameZone/tree/main/Games/Tile_Game) | | [Stick Hero Game](https://github.com/kunjgit/GameZone/tree/main/Games/Stick_Hero_Game) | [Starwars Character Game](https://github.com/kunjgit/GameZone/tree/main/Games/Starwars_Character_Game) | [Traffic Run](https://github.com/kunjgit/GameZone/tree/main/Games/Traffic_Run) | [Love Result Predictor](https://github.com/kunjgit/GameZone/tree/main/Games/Love_Result_Predictor) | [Tower Defense](https://github.com/kunjgit/GameZone/tree/main/Games/Tower_Defense) | +[Menja_block_breaker](https://github.com/kunjgit/GameZone/tree/main/Games/Menja_block_breaker) | | [Bird Game](https://github.com/kunjgit/GameZone/tree/main/Games/Bird_game) | [Bubble Blast Game](https://github.com/kunjgit/GameZone/tree/main/Games/Bubble_Blast_Game) | [Emoji Charades](https://github.com/kunjgit/GameZone/tree/main/Games/Emoji_Charades) | [Drum And Kit](https://github.com/kunjgit/GameZone/tree/main/Games/Drum_Kit_Game) | [Rock Paper Scissors](https://github.com/kunjgit/GameZone/tree/main/Games/Rock_Paper_Scissors) | | [Frogger](https://github.com/kunjgit/GameZone/tree/main/Games/Frogger) | [!morethan5 ](https://github.com/kunjgit/GameZone/tree/main/Games/Not_morethan5) | [Unruly Tower](https://github.com/kunjgit/GameZone/tree/main/Games/Unruly_Tower) | [Maze Game](https://github.com/kunjgit/GameZone/tree/main/Games/MazeGame) | [Connect4](https://github.com/kunjgit/GameZone/tree/main/Games/Connect4) | | [Spelling_Bee](https://github.com/kunjgit/GameZone/tree/main/Games/Spelling_Bee) | [2048](https://github.com/kunjgit/GameZone/tree/main/Games/2048) | [Spin the Wheel](https://github.com/kunjgit/GameZone/tree/main/Games/Spin_the_wheel) | [Breakout](https://github.com/kunjgit/GameZone/tree/main/Games/Breakout) | [Tower Blocks](https://github.com/kunjgit/GameZone/tree/main/Games/Tower_Blocks) | @@ -187,95 +188,72 @@ This repository also provides one such platforms where contributers come over an | [CSS Select](https://github.com/kunjgit/GameZone/tree/main/Games/CSS_Select) | [Squid](https://github.com/kunjgit/GameZone/tree/main/Games/Squid_Game) | [Flip Coin](https://github.com/kunjgit/GameZone/tree/main/Games/Flip_Coin) | [Witty Word Quest](https://github.com/kunjgit/GameZone/tree/main/Games/witty_word_quest) | [Typing Game](https://github.com/Ishan-77/GameZone/tree/main/Games/Typing_Game) | | [numeral-whiz](https://github.com/Ishan-77/GameZone/tree/main/Games/numeral-whiz) | [candy_match](https://github.com/kunjgit/GameZone/tree/main/Games/Candy_Match_Saga) | [Crossy_Road](https://github.com/tanujbordikar/GameZone/tree/Crossy_Road) | [HueHero](https://github.com/kunjgit/GameZone/tree/main/Games/HueHero) | [Puzzel_Winner](https://github.com/kunjgit/GameZone/tree/main/Games/Puzzel_Winner) | | [Emoji_Intruder](https://github.com/kunjgit/GameZone/tree/main/Games/Emoji_Intruder) | [Guess The Weapon](https://github.com/kunjgit/GameZone/tree/main/Games/Guess_The_Weapon) | [Guess Who](https://github.com/kunjgit/GameZone/tree/main/Games/Guess_Who) | [Pop My Balloon](https://github.com/kunjgit/GameZone/tree/main/Games/Pop_My_Balloon) | [Color_Blast](https://github.com/kunjgit/GameZone/tree/main/Games/Color_Blast) | -| [Maze_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Maze_Game) | [Coloron](https://github.com/kunjgit/GameZone/tree/main/Games/Coloron) | [PenPointerFight](https://github.com/kunjgit/GameZone/tree/main/Games/PenPointerFight) | - +| [Maze_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Maze_Game) | [Coloron](https://github.com/kunjgit/GameZone/tree/main/Games/Coloron). | +| [Black_jackk](https://github.com/kunjgit/GameZone/tree/main/Games/Black_jackk) | [Emoji_Intruder](https://github.com/kunjgit/GameZone/tree/main/Games/Emoji_Intruder) | [Guess The Weapon](https://github.com/kunjgit/GameZone/tree/main/Games/Guess_The_Weapon) | [Guess Who](https://github.com/kunjgit/GameZone/tree/main/Games/Guess_Who) | | | | [Emoji_Intruder](https://github.com/kunjgit/GameZone/tree/main/Games/Emoji_Intruder) | [Guess The Weapon](https://github.com/kunjgit/GameZone/tree/main/Games/Guess_The_Weapon) | [Guess Who](https://github.com/kunjgit/GameZone/tree/main/Games/Guess_Who) | [Pop My Balloon](https://github.com/kunjgit/GameZone/tree/main/Games/Pop_My_Balloon) | | - | [Maze_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Maze_Game) | [Earth_Guardian](https://github.com/kunjgit/GameZone/tree/main/Games/Earth_Guardian) | [Earth_Guardian](https://github.com/kunjgit/GameZone/tree/main/Games/Earth_Guardian) | [HTML5_Controller_Tester](https://github.com/kunjgit/GameZone/tree/main/Games/HTML5_Controller_Tester) - | [escaperoom](https://github.com/kunjgit/GameZone/tree/main/Games/escaperoom) - | [Ball_Shooting_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Ball_Shooting_Game) | [HTML5_Controller_Tester](https://github.com/kunjgit/GameZone/tree/main/Games/HTML5_Controller_Tester) - | [numeral-whiz](https://github.com/Ishan-77/GameZone/tree/main/Games/numeral-whiz) | [candy_match](https://github.com/kunjgit/GameZone/tree/main/Games/Candy_Match_Saga) | [Crossy_Road](https://github.com/tanujbordikar/GameZone/tree/Crossy_Road) | [HueHero](https://github.com/kunjgit/GameZone/tree/main/Games/HueHero) | [Puzzel_Winner](https://github.com/kunjgit/GameZone/tree/main/Games/Puzzel_Winner) | | [Emoji_Intruder](https://github.com/kunjgit/GameZone/tree/main/Games/Emoji_Intruder) | [Guess The Weapon](https://github.com/kunjgit/GameZone/tree/main/Games/Guess_The_Weapon) | [Guess Who](https://github.com/kunjgit/GameZone/tree/main/Games/Guess_Who) | [Pop My Balloon](https://github.com/kunjgit/GameZone/tree/main/Games/Pop_My_Balloon) | [Tower Stack](https://github.com/kunjgit/GameZone/tree/main/Games/Tower_Stack) | | [Maze_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Maze_Game) | [TriHand_Tactics](https://github.com/kunjgit/GameZone/tree/main/Games/TriHand_Tactics) | [Earth_Guardian](https://github.com/kunjgit/GameZone/tree/main/Games/Earth_Guardian) | [Ball_Shooting_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Ball_Shooting_Game) | | [Ball_Shooting_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Ball_Shooting_Game) | [CatchTheBall](https://github.com/kunjgit/GameZone/tree/main/Games/CatchTheBall) | - | [Ball_Shooting_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Ball_Shooting_Game) | [DoraemonRun ](https://github.com/kunjgit/GameZone/tree/main/Games/DoraemonRun) | | [Memory_Cards_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Memory_Cards_Game) | | [Technical_Mind_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Technical_Mind_Game) | - [Slide_Master_Puzzle](https://github.com/kunjgit/GameZone/tree/Main/Games/Slide_Master_Puzz)| | - | [Ball_Shooting_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Ball_Shooting_Game) | [Letter_Sleuth](https://github.com/swetha5157/GameZone/tree/main/Games/Letter_Sleuth) - | [Rock_paper_scissor](https://github.com/kunjgit/GameZone/tree/main/Games/Rock_paper_scissor) | | [City_Builder_Game](https://github.com/kunjgit/GameZone/tree/main/Games/City_Builder_Game) | - [Mancala_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Mancala_Game) | [Knife_hit](https://github.com/kunjgit/GameZone/tree/main/Games/Knife_hit) | - | [Dice_Roller](https://github.com/kunjgit/GameZone/tree/main/Games/Dice_Roller) | [Chrome_Dino_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Chrome_Dino_Game) | | [Rock_paper_scissor](https://github.com/kunjgit/GameZone/tree/main/Games/Rock_paper_scissor) | | [City_Builder_Game](https://github.com/kunjgit/GameZone/tree/main/Games/City_Builder_Game) | | [Pokemon_Stats_Card](https://github.com/kunjgit/GameZone/tree/main/Games/Pokemon_Stats_Card) | | [Steampunk_FlappyBird](https://github.com/kunjgit/GameZone/tree/main/Games/Steampunk_FlappyBird) | - | [Catch_The_Circle](https://github.com/kunjgit/GameZone/tree/main/Games/Catch_The_Circle) | | [Automated_rock_paper_scissor](https://github.com/kunjgit/GameZone/tree/main/Games/automated_rock_paper_scissor) | | [Maze_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Maze_Game) | [Astronaut_runner](https://github.com/tanishkaa08/GameZone/tree/main/Games/Astronaunt_runner) | [16_Puzzle](https://github.com/kunjgit/GameZone/tree/main/Games/16_Puzzle) | - | [Rock_paper_scissor](https://github.com/kunjgit/GameZone/tree/main/Games/Rock_paper_scissor) | | [City_Builder_Game](https://github.com/kunjgit/GameZone/tree/main/Games/City_Builder_Game) | | [Dice_Roller](https://github.com/kunjgit/GameZone/tree/main/Games/Dice_Roller) | [Bear Hunter Ninja](https://github.com/Niyatizzz/GameZone/tree/main/Games/Bear_Hunter_Ninja) | | [Rock_paper_scissor](https://github.com/kunjgit/GameZone/tree/main/Games/Rock_paper_scissor) | | [City_Builder_Game](https://github.com/kunjgit/GameZone/tree/main/Games/City_Builder_Game) | - | [Pokemon_Stats_Card](https://github.com/kunjgit/GameZone/tree/main/Games/Pokemon_Stats_Card) | | [Steampunk_FlappyBird](https://github.com/kunjgit/GameZone/tree/main/Games/Steampunk_FlappyBird) | - | [Catch_The_Circle](https://github.com/kunjgit/GameZone/tree/main/Games/Catch_The_Circle) | | [Automated_rock_paper_scissor](https://github.com/kunjgit/GameZone/tree/main/Games/automated_rock_paper_scissor) | - +| [Grab_The_Carrot](https://github.com/Aksshay88/GameZone/tree/main/Games/Grab_The_Carrot) | | [Maze_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Maze_Game) | [Astronaut_runner](https://github.com/tanishkaa08/GameZone/tree/main/Games/Astronaunt_runner) | | [16_Puzzle](https://github.com/kunjgit/GameZone/tree/main/Games/16_Puzzle) | | [Musical_Memory](https://github.com/kunjgit/GameZone/tree/main/Games/Musical_Memory) | - +|[Quick_Click](https://github.com/kunjgit/GameZone/tree/main/Games/Quick_Click) | | [Dragon_Tower](https://github.com/kunjgit/GameZone/tree/main/Games/Dragon_Tower) | | [Hover_Board_Effect](https://github.com/kunjgit/GameZone/tree/main/Games/Hover_Board_Effect) | - - [Mancala_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Mancala_Game) | - - | [Dice_Roller](https://github.com/kunjgit/GameZone/tree/main/Games/Dice_Roller) | [Bear Hunter Ninja](https://github.com/Niyatizzz/GameZone/tree/main/Games/Bear_Hunter_Ninja) | | [Rock_paper_scissor](https://github.com/kunjgit/GameZone/tree/main/Games/Rock_paper_scissor) | | [City_Builder_Game](https://github.com/kunjgit/GameZone/tree/main/Games/City_Builder_Game) | - | [Chrome_Dino_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Chrome_Dino_Game) | | [Pokemon_Stats_Card](https://github.com/kunjgit/GameZone/tree/main/Games/Pokemon_Stats_Card) | | [Steampunk_FlappyBird](https://github.com/kunjgit/GameZone/tree/main/Games/Steampunk_FlappyBird) | - | [Catch_The_Circle](https://github.com/kunjgit/GameZone/tree/main/Games/Catch_The_Circle) | | [Automated_rock_paper_scissor](https://github.com/kunjgit/GameZone/tree/main/Games/automated_rock_paper_scissor) | - | [Maze_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Maze_Game) | [Astronaut_runner](https://github.com/tanishkaa08/GameZone/tree/main/Games/Astronaunt_runner) | | [16_Puzzle](https://github.com/kunjgit/GameZone/tree/main/Games/16_Puzzle) | - | [Dragon_Tower](https://github.com/kunjgit/GameZone/tree/main/Games/Dragon_Tower) | | [Hover_Board_Effect](https://github.com/kunjgit/GameZone/tree/main/Games/Hover_Board_Effect) | | [escaperoom](https://github.com/kunjgit/GameZone/tree/main/Games/escaperoom) | | [Ball_Shooting_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Ball_Shooting_Game) | [HTML5_Controller_Tester](https://github.com/kunjgit/GameZone/tree/main/Games/HTML5_Controller_Tester) | - | [numeral-whiz](https://github.com/Ishan-77/GameZone/tree/main/Games/numeral-whiz) | [candy_match](https://github.com/kunjgit/GameZone/tree/main/Games/Candy_Match_Saga) | | [Crossy_Road](https://github.com/tanujbordikar/GameZone/tree/Crossy_Road) | [HueHero](https://github.com/kunjgit/GameZone/tree/main/Games/HueHero) | | [Puzzel_Winner](https://github.com/kunjgit/GameZone/tree/main/Games/Puzzel_Winner) | | [Emoji_Intruder](https://github.com/kunjgit/GameZone/tree/main/Games/Emoji_Intruder) | [Guess The Weapon](https://github.com/kunjgit/GameZone/tree/main/Games/Guess_The_Weapon) | | [Guess Who](https://github.com/kunjgit/GameZone/tree/main/Games/Guess_Who) | [Pop My Balloon](https://github.com/kunjgit/GameZone/tree/main/Games/Pop_My_Balloon) | -| [Tower Stack](https://github.com/kunjgit/GameZone/tree/main/Games/Tower_Stack) | +| [Tower Stack](https://github.com/kunjgit/GameZone/tree/main/Games/Tower_Stack) | [Soccer](https://github.com/kunjgit/GameZone/tree/main/Games/Soccer) | | [TriHand_Tactics](https://github.com/kunjgit/GameZone/tree/main/Games/TriHand_Tactics) | | [Earth_Guardian](https://github.com/kunjgit/GameZone/tree/main/Games/Earth_Guardian) | | [CatchTheBall](https://github.com/kunjgit/GameZone/tree/main/Games/CatchTheBall) | @@ -288,7 +266,6 @@ This repository also provides one such platforms where contributers come over an [Colour_Generator_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Colour_Generator_Game) | | [Rock_paper_scissor](https://github.com/kunjgit/GameZone/tree/main/Games/Rock_paper_scissor) | | [City_Builder_Game](https://github.com/kunjgit/GameZone/tree/main/Games/City_Builder_Game) | - [Mancala_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Mancala_Game) | |[2048_win](https://github.com/kunjgit/GameZone/tree/main/Games/2048_win) | | [Dice_Roller](https://github.com/kunjgit/GameZone/tree/main/Games/Dice_Roller) | [Chrome_Dino_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Chrome_Dino_Game) | @@ -305,7 +282,11 @@ This repository also provides one such platforms where contributers come over an | [Dragon_Tower](https://github.com/kunjgit/GameZone/tree/main/Games/Dragon_Tower) | | [Guess_num](https://github.com/kunjgit/GameZone/tree/main/Games/Guess_num) | | [QuickFingers](https://github.com/kunjgit/GameZone/tree/main/Games/QuickFingers) | +| [Physics_Quizz](https://github.com/kunjgit/GameZone/tree/main/Games/Physics_Quizz) | | [Tiny_Fishing](https://github.com/kunjgit/GameZone/tree/main/Games/Tiny_Fishing) | + +| [Hover_Board_Effect](https://github.com/kunjgit/GameZone/tree/main/Games/Hover_Board_Effect) | + | [namefate](https://github.com/kunjgit/GameZone/tree/main/Games/namefate) | | [Fruit_Catching_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Fruit_Catching_Game) | | [color_matching_application](https://github.com/kunjgit/GameZone/tree/main/Games/color_matching_application) | @@ -325,19 +306,42 @@ This repository also provides one such platforms where contributers come over an | [Emoji_slot_machine] (https://github.com/kunjgit/GameZone/tree/main/Games/Emoji_slot_machine) | [NewsJunction](https://github.com/kunjgit/GameZone/tree/main/Games/NewsJunction) | [Pixel Painter](https://github.com/kunjgit/GameZone/tree/main/Games/pixel_painter) | -| [Reflex Game](https://github.com/kunjgit/GameZone/tree/main/Games/Reflex_Game) | +| [Guess_The_Song](https://github.com/kunjgit/GameZone/tree/main/Games/Guess_The_Song) | [Reverse Memory](https://github.com/MuraliDharan7/GameZone/tree/reverse-memory-game/Games/Reverse%20Memory) | [NewsJunction](https://github.com/kunjgit/GameZone/tree/main/Games/NewsJunction) | +| [Recognizing_Figures](https://github.com/kunjgit/GameZone/tree/main/Games/Recognizing_Figures) | + +| [WordScramble](https://github.com/kunjgit/GameZone/tree/main/Games/wordScramble) + +[Roll_The_Dice](https://github.com/kunjgit/GameZone/tree/main/Games/Roll_The_Dice) | +| [Black_jackk](https://github.com/kunjgit/GameZone/tree/main/Games/Black_jackk) | | [Recognizing_Figures](https://github.com/kunjgit/GameZone/tree/main/Games/Recognizing_Figures) | [Screen Pet Game](https://github.com/kunjgit/GameZone/tree/main/Games/Screen-Pet-Game) | | [Sudoku_light_theme](https://github.com/kunjgit/GameZone/tree/main/Games/Sudoku_light_theme) | | [Find_the_ball](https://github.com/kunjgit/GameZone/tree/main/Games/Find_the_ball) | -|[Color The Page](https://github.com/kunjgit/GameZone/tree/main/Games/Color_The_Page)| +| [Color The Page](https://github.com/kunjgit/GameZone/tree/main/Games/Color_The_Page)| +|[Building Blocks Game](https://github.com/kunjgit/GameZone/tree/main/Games/Building_Block_Game)| +|[Cartoon character guessing game](https://github.com/kunjgit/GameZone/tree/main/Games/Cartoon_Character_Guessing_Game)| +|[Carrom Board Game](https://github.com/kunjgit/GameZone/tree/main/Games/carrom)| +| [Number_Recall_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Number_Recall_Game) | +| [Hit_the_hamster](https://github.com/kunjgit/GameZone/tree/main/Games/Hit_the_hamster) | | [Forest_Guardian](https://github.com/kunjgit/GameZone/tree/main/Games/Forst_Guardian) | | [Sudoku_light_theme](https://github.com/kunjgit/GameZone/tree/main/Games/Sudoku_light_theme) | | [Find_the_ball](https://github.com/kunjgit/GameZone/tree/main/Games/Find_the_ball) | |[Color The Page](https://github.com/kunjgit/GameZone/tree/main/Games/Color_The_Page)| +|[AquaSort_Game](https://github.com/kunjgit/GameZone/tree/main/Games/AquaSort_Game) | +|[Chess_Game_computer](https://github.com/kunjgit/GameZone/tree/main/Games/Chess_Game_computer) | +|[Turn_on_the_light](https://github.com/kunjgit/GameZone/tree/main/Games/Turn_on_the_light) | | [Tic-Tac-Toe Game](https://github.com/kunjgit/GameZone/tree/main/Games/Tic-Tac-Toe) | -| [Rapid_click_frenzy](https://github.com/kunjgit/GameZone/tree/main/Games/Rapid_click_frenzy) | - +| [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) | +| [Rapid_click_frenzy](https://github.com/kunjgit/GameZone/tree/main/Games/Rapid_click_frenzy) | +| [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 Buster) | +| [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_Gam)|
    @@ -400,5 +404,4 @@ Terms and conditions for use, reproduction and distribution are under the [Apach
    -

    Back to top

    - +

    Back to top

    \ No newline at end of file diff --git a/assets/css/style.css b/assets/css/style.css index 194200e61b..50ab9b3cca 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -1,22 +1,26 @@ /* About Paragraph */ - +html,body { +width: 100%; +height: 100%; +margin: 0px; +padding: 0px; +overflow-x: hidden;} #about { color: white; font-size: 1.2rem; /* font-family: 'Agency FB', Times, serif; */ font-family: Verdana, Geneva, Tahoma, sans-serif; - text-align: center; + text-align: center; } /* Copyright */ -#copyright{ +#copyright { text-align: center; color: white; font-size: 1.1rem; } - /*-----------------------------------*\ #style.css \*-----------------------------------*/ @@ -28,8 +32,9 @@ */ @font-face { - font-family: 'gamezone'; - src: url('https://github.com/Winter262005/GameZone/blob/main/assets/fonts/MouldyCheeseRegular-WyMWG.woff2') format('woff2'); + font-family: "gamezone"; + src: url("https://github.com/Winter262005/GameZone/blob/main/assets/fonts/MouldyCheeseRegular-WyMWG.woff2") + format("woff2"); } /*-----------------------------------*\ @@ -124,7 +129,6 @@ input:checked + .slider:before { color: #000000; } - a { text-decoration: none; color: #fff; @@ -146,6 +150,7 @@ footer { width: 100%; /* width: 100vw; */ + padding-top: 40px; margin-top: auto; @@ -216,11 +221,9 @@ footer { color: #ffffff; } - a:hover svg { - fill:rgb(0, 119, 181); -} - + fill: rgb(0, 119, 181); +} .fa-linkedin-square:hover { color: rgb(0, 119, 181); @@ -1462,6 +1465,26 @@ main { .project-category { margin-left: 10px; } +.title-container { + display: flex; + justify-content: center; + align-items: center; + position: relative; + color: white; +} + +.like-button { + background: none; + border: none; + font-size: 16px; + color: #fff !important; + position: absolute; + right: 40px; +} + +.like-button.liked { + color: rgb(238, 8, 8) !important; +} .project-title { color: var(--white-2); @@ -2420,7 +2443,7 @@ textarea.form-input::-webkit-resizer { margin-bottom: 40px; color: #000; display: flex; - justify-content: center; + justify-content: space-between; align-items: center; cursor: pointer; transition: 0.8s; @@ -2429,7 +2452,6 @@ textarea.form-input::-webkit-resizer { min-width: 100px; max-width: 400px; margin: auto; - &::after { position: absolute; @@ -2462,10 +2484,47 @@ textarea.form-input::-webkit-resizer { font-size: 16px; } +/* @media screen and (max-width: 920px) { + .search-container:hover > .search-input { + width: 90vw; + font-size: 16px; + } +} */ @media screen and (max-width: 920px) { + .search-container { + display: flex; + justify-content: space-between; + align-items: center; + min-width: 50px; + max-width: 250px; + margin-left: 10px; + } + .search-container:hover > .search-input { width: 90vw; font-size: 16px; + visibility: visible; + transition: width 2.5s ease-in-out, font-size 2.5s ease-in-out; + font-weight: 250; + color: #000; + } + + + .fa.fa-search, + .favorites-link { + flex: 1; + order: 1; + margin-left: 5px; + } + .favorites-link { + position: relative; + left: -10px; + } + + .favorites-link img { + width: 30px; + height: 30px; + margin-left: 0; } } @@ -2473,24 +2532,44 @@ textarea.form-input::-webkit-resizer { background: transparent; border: none; outline: none; - width: 10px; + width: 100%; font-weight: 500; - font-size: 0px; + font-size: 16px; transition: 0.8s; + color: #000; } .search-container ::placeholder { color: #000000; } .search-container .search-btn { - position: absolute; /* Added position absolute for icon positioning */ - right: 12px; /* Adjusted right positioning for icon */ + position: absolute; + right: 12px; } .search-btn { - padding-right: 5px; + width: 30px; + height: 30px; + position: relative; + right: 0; } - -.clear-btn{ +.fa.fa-search { + position: absolute; + right: 0; + top: 50%; + transform: translateY(-50%); + order: 1; +} +.favorites-link { + order: 2; + margin-left: 80px; + width: 50px; + height: 50px; +} +.favorites-link img { + width: 40px; + height: 30px; +} +.clear-btn { position: absolute; right: 40px; top: 50%; @@ -2500,40 +2579,49 @@ textarea.form-input::-webkit-resizer { border: none; cursor: pointer; font-size: 18px; - display:none; - color:rgba(16, 2, 2, 0.731) + display: none; + color: rgba(16, 2, 2, 0.731); } .search-input:not(:placeholder-shown) ~ .clear-btn { - display: block; /* Show when input is not empty */ + display: block; } #search-related { display: flex; justify-content: space-around; color: white; padding: 30px 0 20px 0; -} -#search-related p{ +} +#search-related p { color: #b7b7b7; } -#search-related #search-term{ +#search-related #search-term { animation: none; display: contents; font-weight: bolder; } -#search-related #clear-search{ +#search-related #clear-search { background: #e1e1e1; color: black; padding: 0px 10px; border-radius: 50px; font-weight: bolder; } -#search-related #clear-search:hover{ - box-shadow:0 0 10px red; +#search-related #clear-search:hover { + box-shadow: 0 0 10px red; color: red; } +.like-button { + background: none; + border: none; + font-size: 24px; + color: #fff; /* White */ +} +.like-button.liked { + color: #f00; /* Red */ +} /*-----------------------------------*\ #PAGINATION SECTION \*-----------------------------------*/ @@ -2606,7 +2694,6 @@ textarea.form-input::-webkit-resizer { border: 1px solid rgba(255, 255, 255, 0.5); backdrop-filter: blur(5.1px); -webkit-backdrop-filter: blur(9.1px); - } /* pagination hover effect on non-active */ @@ -2621,7 +2708,6 @@ textarea.form-input::-webkit-resizer { /* font-weight: 800; */ opacity: 1; background-color: #df87ef; - } #scrollToTopButton { @@ -2685,7 +2771,7 @@ textarea.form-input::-webkit-resizer { /* GameZone heading **/ .heading { margin-top: -2%; - font: 5.5vw/1 'Agency FB', Times, serif; + font: 5.5vw/1 "Agency FB", Times, serif; font-size: 5.5vw; display: flex; align-items: center; @@ -2791,7 +2877,8 @@ span:nth-child(7) { } .unique-color-dark { - background-color: #b616c7 !important; + /* background-color: #b616c7 !important; */ + background:linear-gradient(#FA8DF3,#e100ff); } .bg-light { @@ -2832,11 +2919,15 @@ ul { .example-2 { display: flex; justify-content: center; + flex-direction: row; align-items: center; + width:100%; + padding: 0 20px; } .example-2 .icon-content { margin: 0 10px; position: relative; + padding: 0 20px; } .example-2 .icon-content .tooltip { position: absolute; @@ -2966,17 +3057,16 @@ box-shadow: 0px 0px 21px 0px rgba(204,153,255,1); */ font-size: 2rem; } - .bgContainer { position: relative; /* width: 500px; */ /* height: 420px; */ - margin: auto; + margin: auto; } .bgContainer::before { content: ""; position: fixed; - top: 0px; + top: 0px; left: -30%; /*width: 500px;*/ /*commented beacuse it causes @@ -2984,7 +3074,12 @@ box-shadow: 0px 0px 21px 0px rgba(204,153,255,1); */ height: 800px; border-radius: 100%; background-color: rgb(120, 47, 152); - background: linear-gradient(343deg, rgba(120, 47, 152, 1) 0%, rgba(5, 50, 129, 1) 82%, rgba(52, 39, 100, 1) 100%); + background: linear-gradient( + 343deg, + rgba(120, 47, 152, 1) 0%, + rgba(5, 50, 129, 1) 82%, + rgba(52, 39, 100, 1) 100% + ); filter: blur(600px); z-index: -10; } @@ -2992,16 +3087,168 @@ box-shadow: 0px 0px 21px 0px rgba(204,153,255,1); */ .bgContainer::after { content: ""; position: fixed; - top: 0px; + top: 0px; right: -30%; width: 500px; height: 800px; border-radius: 100%; background-color: rgb(120, 47, 152); - background: linear-gradient(343deg, rgba(120, 47, 152, 1) 0%, rgba(5, 50, 129, 1) 82%, rgba(52, 39, 100, 1) 100%); + background: linear-gradient( + 343deg, + rgba(120, 47, 152, 1) 0%, + rgba(5, 50, 129, 1) 82%, + rgba(52, 39, 100, 1) 100% + ); filter: blur(600px); z-index: -10; } +@import url('https://fonts.googleapis.com/css?family=Exo:400,700'); + +*{ + margin: 0px; + padding: 0px; +} + +body{ + font-family: 'Exo', sans-serif; +} + + +.context { + width: 100%; + position: absolute; + top:50vh; + +} + +.context h1{ + text-align: center; + color: #fff; + font-size: 50px; +} + + +.area{ + width: 100%; + height:100vh; + + +} + +.circles{ + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + overflow: hidden; +} + +.circles li{ + position: absolute; + display: block; + list-style: none; + width: 20px; + height: 20px; + background: rgba(255, 255, 255, 0.2); + animation: animate 25s linear infinite; + bottom: -150px; + +} + +.circles li:nth-child(1){ + left: 25%; + width: 80px; + height: 80px; + animation-delay: 0s; +} + + +.circles li:nth-child(2){ + left: 10%; + width: 20px; + height: 20px; + animation-delay: 2s; + animation-duration: 12s; +} + +.circles li:nth-child(3){ + left: 70%; + width: 20px; + height: 20px; + animation-delay: 4s; +} + +.circles li:nth-child(4){ + left: 40%; + width: 60px; + height: 60px; + animation-delay: 0s; + animation-duration: 18s; +} + +.circles li:nth-child(5){ + left: 65%; + width: 20px; + height: 20px; + animation-delay: 0s; +} + +.circles li:nth-child(6){ + left: 75%; + width: 110px; + height: 110px; + animation-delay: 3s; +} + +.circles li:nth-child(7){ + left: 35%; + width: 150px; + height: 150px; + animation-delay: 7s; +} + +.circles li:nth-child(8){ + left: 50%; + width: 25px; + height: 25px; + animation-delay: 15s; + animation-duration: 45s; +} + +.circles li:nth-child(9){ + left: 20%; + width: 15px; + height: 15px; + animation-delay: 2s; + animation-duration: 35s; +} + +.circles li:nth-child(10){ + left: 85%; + width: 150px; + height: 150px; + animation-delay: 0s; + animation-duration: 11s; +} + + + +@keyframes animate { + + 0%{ + transform: translateY(0) rotate(0deg); + opacity: 1; + border-radius: 0; + } + + 100%{ + transform: translateY(-1000px) rotate(720deg); + opacity: 0; + border-radius: 50%; + } + +} #suggestion-list { list-style: none; @@ -3033,19 +3280,19 @@ box-shadow: 0px 0px 21px 0px rgba(204,153,255,1); */ } /* Animations */ -.fromTop{ +.fromTop { animation: slideTop 1s ease forwards; } -.fromLeft{ +.fromLeft { animation: slideLeft 1s ease forwards; } -.fromRight{ +.fromRight { animation: slideRight 1s ease forwards; } -.fromBottom{ +.fromBottom { animation: slideBottom 1s ease forwards; } -.zoomIn{ +.zoomIn { animation: zoomIn 1s ease forwards; } @@ -3098,4 +3345,4 @@ box-shadow: 0px 0px 21px 0px rgba(204,153,255,1); */ transform: scale(1); opacity: 1; } -} \ No newline at end of file +} diff --git a/assets/images/10-C.png b/assets/images/10-C.png new file mode 100644 index 0000000000..18af741dbd Binary files /dev/null and b/assets/images/10-C.png differ diff --git a/assets/images/10-D.png b/assets/images/10-D.png new file mode 100644 index 0000000000..3bbc4e06bc Binary files /dev/null and b/assets/images/10-D.png differ diff --git a/assets/images/10-H.png b/assets/images/10-H.png new file mode 100644 index 0000000000..3eb83d72c8 Binary files /dev/null and b/assets/images/10-H.png differ diff --git a/assets/images/10-S.png b/assets/images/10-S.png new file mode 100644 index 0000000000..0b3d29475d Binary files /dev/null and b/assets/images/10-S.png differ diff --git a/assets/images/2-C (1).png b/assets/images/2-C (1).png new file mode 100644 index 0000000000..291ed975f2 Binary files /dev/null and b/assets/images/2-C (1).png differ diff --git a/assets/images/2-C.png b/assets/images/2-C.png new file mode 100644 index 0000000000..291ed975f2 Binary files /dev/null and b/assets/images/2-C.png differ diff --git a/assets/images/2-D.png b/assets/images/2-D.png new file mode 100644 index 0000000000..4deee7cc84 Binary files /dev/null and b/assets/images/2-D.png differ diff --git a/assets/images/2-H (1).png b/assets/images/2-H (1).png new file mode 100644 index 0000000000..75a014f364 Binary files /dev/null and b/assets/images/2-H (1).png differ diff --git a/assets/images/2-S (1).png b/assets/images/2-S (1).png new file mode 100644 index 0000000000..1ce0ffe8b8 Binary files /dev/null and b/assets/images/2-S (1).png differ diff --git a/assets/images/3-C (1).png b/assets/images/3-C (1).png new file mode 100644 index 0000000000..076ab318aa Binary files /dev/null and b/assets/images/3-C (1).png differ diff --git a/assets/images/3-D (1).png b/assets/images/3-D (1).png new file mode 100644 index 0000000000..8ee0b4b902 Binary files /dev/null and b/assets/images/3-D (1).png differ diff --git a/assets/images/3-H (1).png b/assets/images/3-H (1).png new file mode 100644 index 0000000000..8e74673f82 Binary files /dev/null and b/assets/images/3-H (1).png differ diff --git a/assets/images/3-S (1).png b/assets/images/3-S (1).png new file mode 100644 index 0000000000..f9e06b4f01 Binary files /dev/null and b/assets/images/3-S (1).png differ diff --git a/assets/images/4-C (1).png b/assets/images/4-C (1).png new file mode 100644 index 0000000000..8be9e08922 Binary files /dev/null and b/assets/images/4-C (1).png differ diff --git a/assets/images/4-D (1).png b/assets/images/4-D (1).png new file mode 100644 index 0000000000..70e82e839b Binary files /dev/null and b/assets/images/4-D (1).png differ diff --git a/assets/images/4-H.png b/assets/images/4-H.png new file mode 100644 index 0000000000..ceecbfe02f Binary files /dev/null and b/assets/images/4-H.png differ diff --git a/assets/images/4-S.png b/assets/images/4-S.png new file mode 100644 index 0000000000..95abe3e737 Binary files /dev/null and b/assets/images/4-S.png differ diff --git a/assets/images/5-C.png b/assets/images/5-C.png new file mode 100644 index 0000000000..bde9777696 Binary files /dev/null and b/assets/images/5-C.png differ diff --git a/assets/images/5-D.png b/assets/images/5-D.png new file mode 100644 index 0000000000..bb9252558a Binary files /dev/null and b/assets/images/5-D.png differ diff --git a/assets/images/5-H.png b/assets/images/5-H.png new file mode 100644 index 0000000000..d923456fe8 Binary files /dev/null and b/assets/images/5-H.png differ diff --git a/assets/images/5-S.png b/assets/images/5-S.png new file mode 100644 index 0000000000..53a1aad26c Binary files /dev/null and b/assets/images/5-S.png differ diff --git a/assets/images/6-C.png b/assets/images/6-C.png new file mode 100644 index 0000000000..a9660a0372 Binary files /dev/null and b/assets/images/6-C.png differ diff --git a/assets/images/6-D.png b/assets/images/6-D.png new file mode 100644 index 0000000000..78a80ad06a Binary files /dev/null and b/assets/images/6-D.png differ diff --git a/assets/images/6-H.png b/assets/images/6-H.png new file mode 100644 index 0000000000..361643efc3 Binary files /dev/null and b/assets/images/6-H.png differ diff --git a/assets/images/6-S.png b/assets/images/6-S.png new file mode 100644 index 0000000000..40242a718b Binary files /dev/null and b/assets/images/6-S.png differ diff --git a/assets/images/7-C.png b/assets/images/7-C.png new file mode 100644 index 0000000000..9d6b54554f Binary files /dev/null and b/assets/images/7-C.png differ diff --git a/assets/images/7-D.png b/assets/images/7-D.png new file mode 100644 index 0000000000..6ad5f15b51 Binary files /dev/null and b/assets/images/7-D.png differ diff --git a/assets/images/7-H.png b/assets/images/7-H.png new file mode 100644 index 0000000000..19b89a2e7e Binary files /dev/null and b/assets/images/7-H.png differ diff --git a/assets/images/7-S.png b/assets/images/7-S.png new file mode 100644 index 0000000000..b9f1b93d33 Binary files /dev/null and b/assets/images/7-S.png differ diff --git a/assets/images/8-C.png b/assets/images/8-C.png new file mode 100644 index 0000000000..cec743cbcd Binary files /dev/null and b/assets/images/8-C.png differ diff --git a/assets/images/8-D.png b/assets/images/8-D.png new file mode 100644 index 0000000000..ed1295121d Binary files /dev/null and b/assets/images/8-D.png differ diff --git a/assets/images/8-H.png b/assets/images/8-H.png new file mode 100644 index 0000000000..fb39723cb1 Binary files /dev/null and b/assets/images/8-H.png differ diff --git a/assets/images/8-S.png b/assets/images/8-S.png new file mode 100644 index 0000000000..b6b3b3813d Binary files /dev/null and b/assets/images/8-S.png differ diff --git a/assets/images/9-C.png b/assets/images/9-C.png new file mode 100644 index 0000000000..2174db58e1 Binary files /dev/null and b/assets/images/9-C.png differ diff --git a/assets/images/9-D.png b/assets/images/9-D.png new file mode 100644 index 0000000000..0b933fb0e6 Binary files /dev/null and b/assets/images/9-D.png differ diff --git a/assets/images/9-H.png b/assets/images/9-H.png new file mode 100644 index 0000000000..7b196d6dc0 Binary files /dev/null and b/assets/images/9-H.png differ diff --git a/assets/images/9-S.png b/assets/images/9-S.png new file mode 100644 index 0000000000..3c3b5ffbc6 Binary files /dev/null and b/assets/images/9-S.png differ diff --git a/assets/images/A-C.png b/assets/images/A-C.png new file mode 100644 index 0000000000..42bf5ec94d Binary files /dev/null and b/assets/images/A-C.png differ diff --git a/assets/images/A-D.png b/assets/images/A-D.png new file mode 100644 index 0000000000..79cd3b8a80 Binary files /dev/null and b/assets/images/A-D.png differ diff --git a/assets/images/A-H.png b/assets/images/A-H.png new file mode 100644 index 0000000000..b42212405c Binary files /dev/null and b/assets/images/A-H.png differ diff --git a/assets/images/Anagram-Word-Game.jpeg b/assets/images/Anagram-Word-Game.jpeg new file mode 100644 index 0000000000..9bbb84ffa9 Binary files /dev/null and b/assets/images/Anagram-Word-Game.jpeg differ diff --git a/assets/images/AquaSort.png b/assets/images/AquaSort.png new file mode 100644 index 0000000000..353048f392 Binary files /dev/null and b/assets/images/AquaSort.png differ diff --git a/assets/images/BACK.png b/assets/images/BACK.png new file mode 100644 index 0000000000..2e02e052c9 Binary files /dev/null and b/assets/images/BACK.png differ diff --git a/assets/images/Black_jackk.png b/assets/images/Black_jackk.png new file mode 100644 index 0000000000..eb112c1fe1 Binary files /dev/null and b/assets/images/Black_jackk.png differ diff --git a/assets/images/Building Block Game.png b/assets/images/Building Block Game.png new file mode 100644 index 0000000000..20a3c183c5 Binary files /dev/null and b/assets/images/Building Block Game.png differ diff --git a/assets/images/Cartoon_Character_Guessing_Game.png b/assets/images/Cartoon_Character_Guessing_Game.png new file mode 100644 index 0000000000..04854f84df Binary files /dev/null and b/assets/images/Cartoon_Character_Guessing_Game.png differ diff --git a/assets/images/Dsa_quiz1.png b/assets/images/Dsa_quiz1.png new file mode 100644 index 0000000000..22453aa476 Binary files /dev/null and b/assets/images/Dsa_quiz1.png differ diff --git a/assets/images/Dsa_quiz2.png b/assets/images/Dsa_quiz2.png new file mode 100644 index 0000000000..a129e1fe7f Binary files /dev/null and b/assets/images/Dsa_quiz2.png differ diff --git a/assets/images/FavFolder.png b/assets/images/FavFolder.png new file mode 100644 index 0000000000..8ca4df072f Binary files /dev/null and b/assets/images/FavFolder.png differ diff --git a/assets/images/Gravity_Simulation_Game.png b/assets/images/Gravity_Simulation_Game.png new file mode 100644 index 0000000000..7f6d73d53f Binary files /dev/null and b/assets/images/Gravity_Simulation_Game.png differ diff --git a/assets/images/Gravity_Simulation_Game.webp b/assets/images/Gravity_Simulation_Game.webp new file mode 100644 index 0000000000..b08dadec49 Binary files /dev/null and b/assets/images/Gravity_Simulation_Game.webp differ diff --git a/assets/images/Guess_The_Song.png b/assets/images/Guess_The_Song.png new file mode 100644 index 0000000000..5d049be33e Binary files /dev/null and b/assets/images/Guess_The_Song.png differ diff --git a/assets/images/Hit_the_hamster_game.png b/assets/images/Hit_the_hamster_game.png new file mode 100644 index 0000000000..5ceb822e69 Binary files /dev/null and b/assets/images/Hit_the_hamster_game.png differ diff --git a/assets/images/Intellect_Quest.png b/assets/images/Intellect_Quest.png new file mode 100644 index 0000000000..b7d7eed1aa Binary files /dev/null and b/assets/images/Intellect_Quest.png differ diff --git a/assets/images/J-B.png b/assets/images/J-B.png new file mode 100644 index 0000000000..000b640bff Binary files /dev/null and b/assets/images/J-B.png differ diff --git a/assets/images/J-C.png b/assets/images/J-C.png new file mode 100644 index 0000000000..5e003be2d4 Binary files /dev/null and b/assets/images/J-C.png differ diff --git a/assets/images/J-D.png b/assets/images/J-D.png new file mode 100644 index 0000000000..131a97731b Binary files /dev/null and b/assets/images/J-D.png differ diff --git a/assets/images/J-H.png b/assets/images/J-H.png new file mode 100644 index 0000000000..bf342bcb29 Binary files /dev/null and b/assets/images/J-H.png differ diff --git a/assets/images/J-R.png b/assets/images/J-R.png new file mode 100644 index 0000000000..55b3ef9ba5 Binary files /dev/null and b/assets/images/J-R.png differ diff --git a/assets/images/J-S.png b/assets/images/J-S.png new file mode 100644 index 0000000000..f539c19c6c Binary files /dev/null and b/assets/images/J-S.png differ diff --git a/assets/images/K-C.png b/assets/images/K-C.png new file mode 100644 index 0000000000..68e57747d7 Binary files /dev/null and b/assets/images/K-C.png differ diff --git a/assets/images/K-D.png b/assets/images/K-D.png new file mode 100644 index 0000000000..e21d6a0a4a Binary files /dev/null and b/assets/images/K-D.png differ diff --git a/assets/images/K-H.png b/assets/images/K-H.png new file mode 100644 index 0000000000..1d3c468d8e Binary files /dev/null and b/assets/images/K-H.png differ diff --git a/assets/images/K-S.png b/assets/images/K-S.png new file mode 100644 index 0000000000..2edbbc1484 Binary files /dev/null and b/assets/images/K-S.png differ diff --git a/assets/images/Love calculator game.png b/assets/images/Love calculator game.png new file mode 100644 index 0000000000..bb264d2297 Binary files /dev/null and b/assets/images/Love calculator game.png differ diff --git a/assets/images/MathQuiz.png b/assets/images/MathQuiz.png new file mode 100644 index 0000000000..7460942485 Binary files /dev/null and b/assets/images/MathQuiz.png differ diff --git a/assets/images/Menja.png b/assets/images/Menja.png deleted file mode 100644 index 0a3d5f243a..0000000000 Binary files a/assets/images/Menja.png and /dev/null differ diff --git a/assets/images/NumberGuessingGame.png b/assets/images/NumberGuessingGame.png new file mode 100644 index 0000000000..02fcaf5c7d Binary files /dev/null and b/assets/images/NumberGuessingGame.png differ diff --git a/assets/images/Number_recall_game (1).png b/assets/images/Number_recall_game (1).png new file mode 100644 index 0000000000..033d581dbc Binary files /dev/null and b/assets/images/Number_recall_game (1).png differ diff --git a/assets/images/Number_recall_game (2).png b/assets/images/Number_recall_game (2).png new file mode 100644 index 0000000000..413cfd3733 Binary files /dev/null and b/assets/images/Number_recall_game (2).png differ diff --git a/assets/images/Penguins_Can't_Fly1.png b/assets/images/Penguins_Can't_Fly1.png new file mode 100644 index 0000000000..244b26cc73 Binary files /dev/null and b/assets/images/Penguins_Can't_Fly1.png differ diff --git a/assets/images/Penguins_Can't_Fly2.png b/assets/images/Penguins_Can't_Fly2.png new file mode 100644 index 0000000000..0fba67a53f Binary files /dev/null and b/assets/images/Penguins_Can't_Fly2.png differ diff --git a/assets/images/Penguins_Can't_Fly3.png b/assets/images/Penguins_Can't_Fly3.png new file mode 100644 index 0000000000..b311fa77ae Binary files /dev/null and b/assets/images/Penguins_Can't_Fly3.png differ diff --git a/assets/images/Physics_Quizz.png b/assets/images/Physics_Quizz.png new file mode 100644 index 0000000000..2c69f2e39b Binary files /dev/null and b/assets/images/Physics_Quizz.png differ diff --git a/assets/images/Pixel_Painter.png b/assets/images/Pixel_Painter.png deleted file mode 100644 index a778aeef8a..0000000000 Binary files a/assets/images/Pixel_Painter.png and /dev/null differ diff --git a/assets/images/Q-C.png b/assets/images/Q-C.png new file mode 100644 index 0000000000..7be5f9a96a Binary files /dev/null and b/assets/images/Q-C.png differ diff --git a/assets/images/Q-D.png b/assets/images/Q-D.png new file mode 100644 index 0000000000..928f6501da Binary files /dev/null and b/assets/images/Q-D.png differ diff --git a/assets/images/Q-H.png b/assets/images/Q-H.png new file mode 100644 index 0000000000..21839e681a Binary files /dev/null and b/assets/images/Q-H.png differ diff --git a/assets/images/Q-S.png b/assets/images/Q-S.png new file mode 100644 index 0000000000..7983d034dd Binary files /dev/null and b/assets/images/Q-S.png differ diff --git a/assets/images/Quick Click.png b/assets/images/Quick Click.png new file mode 100644 index 0000000000..41d0f7dc35 Binary files /dev/null and b/assets/images/Quick Click.png differ diff --git a/assets/images/Reverse_Memory.png b/assets/images/Reverse_Memory.png new file mode 100644 index 0000000000..a08ad289a7 Binary files /dev/null and b/assets/images/Reverse_Memory.png differ diff --git a/assets/images/Roll_The_Dice.png b/assets/images/Roll_The_Dice.png new file mode 100644 index 0000000000..b0e76ceb02 Binary files /dev/null and b/assets/images/Roll_The_Dice.png differ diff --git a/assets/images/Roll_The_Dice.webp.png b/assets/images/Roll_The_Dice.webp.png new file mode 100644 index 0000000000..b0e76ceb02 Binary files /dev/null and b/assets/images/Roll_The_Dice.webp.png differ diff --git a/assets/images/Soccer.png b/assets/images/Soccer.png new file mode 100644 index 0000000000..b9b19aa4a1 Binary files /dev/null and b/assets/images/Soccer.png differ diff --git a/assets/images/Taash Game.png b/assets/images/Taash Game.png new file mode 100644 index 0000000000..4376fcc0c3 Binary files /dev/null and b/assets/images/Taash Game.png differ diff --git a/assets/images/Tic_Tac_Toe.png b/assets/images/Tic_Tac_Toe.png index 58567752e4..fa31917f69 100644 Binary files a/assets/images/Tic_Tac_Toe.png and b/assets/images/Tic_Tac_Toe.png differ diff --git a/assets/images/Treasure_Hunt.png b/assets/images/Treasure_Hunt.png new file mode 100644 index 0000000000..ab4edf6fb4 Binary files /dev/null and b/assets/images/Treasure_Hunt.png differ diff --git a/assets/images/WordScramble.png b/assets/images/WordScramble.png new file mode 100644 index 0000000000..e1b2a2ad42 Binary files /dev/null and b/assets/images/WordScramble.png differ diff --git a/assets/images/Word_Scramble.png b/assets/images/Word_Scramble.png new file mode 100644 index 0000000000..a03fb8e96e Binary files /dev/null and b/assets/images/Word_Scramble.png differ diff --git a/assets/images/brick.png b/assets/images/brick.png new file mode 100644 index 0000000000..5f791b50f4 Binary files /dev/null and b/assets/images/brick.png differ diff --git a/assets/images/carrom pic.jpg b/assets/images/carrom pic.jpg new file mode 100644 index 0000000000..1d3c562727 Binary files /dev/null and b/assets/images/carrom pic.jpg differ diff --git a/assets/images/chessComputer.png b/assets/images/chessComputer.png new file mode 100644 index 0000000000..0f4d29f932 Binary files /dev/null and b/assets/images/chessComputer.png differ diff --git a/assets/images/grabthecarrot.png b/assets/images/grabthecarrot.png new file mode 100644 index 0000000000..69a5874ced Binary files /dev/null and b/assets/images/grabthecarrot.png differ diff --git a/assets/images/menja_Block_breaker.png b/assets/images/menja_Block_breaker.png new file mode 100644 index 0000000000..24f12b5b35 Binary files /dev/null and b/assets/images/menja_Block_breaker.png differ diff --git a/assets/images/pixel_painter.png b/assets/images/pixel_painter.png deleted file mode 100644 index 5452499cd2..0000000000 Binary files a/assets/images/pixel_painter.png and /dev/null differ diff --git a/assets/images/turnonthelight.jpg b/assets/images/turnonthelight.jpg new file mode 100644 index 0000000000..0d24847f8b Binary files /dev/null and b/assets/images/turnonthelight.jpg differ diff --git a/assets/index_old.html b/assets/index_old.html index 26b59423c7..5d8f6d1843 100644 --- a/assets/index_old.html +++ b/assets/index_old.html @@ -2764,7 +2764,21 @@

    + +
    +
    + Eye +
    + game thumbnail +
    +

    143.Guess_The_Song๐Ÿ”—

    +

    Gessing The song by emoji as a hint with 5 Chances.

    + + diff --git a/assets/js/gamesData.json b/assets/js/gamesData.json index 39b6e52738..0b139faa80 100644 --- a/assets/js/gamesData.json +++ b/assets/js/gamesData.json @@ -2025,6 +2025,11 @@ "thumbnailUrl": "namefate.png" } , +"500":{ + "gameTitle": "Menja block breaker", + "gameUrl": "Menja_block_breaker", + "thumbnailUrl": "menja_Block_breaker.png" +}, "393":{ "gameTitle": "Pop My Balloon", @@ -2044,20 +2049,25 @@ "gameUrl": "Virtual_Pet_Game", "thumbnailUrl": "Virtual_Pet_Game.png" + "gameTitle": "path finder puzzle", + "gameUrl": "path_finder", + "thumbnailUrl": "pathfinder.png" }, "411":{ "gameTitle": "Tiny Fishing", "gameUrl": "Tiny_Fishing", "thumbnailUrl": "Tiny_Fishing.png" - - - - }, "398":{ +"410":{ "gameTitle": "Shrek Vs Wild", "gameUrl": "Shrek_Vs_Wild", "thumbnailUrl": "Shrek_Vs_Wild.png" }, +"409":{ + "gameTitle": "Hover_Board_Effect", + "gameUrl": "Hover_Board_Effect", + "thumbnailUrl": "Hover_Board_Effect.png" +}, "405":{ "gameTitle": "Candy_Crush_Saga", "gameUrl": "Candy_Crush_Saga", @@ -2067,7 +2077,6 @@ "gameTitle": "16_Puzzle", "gameUrl": "16_Puzzle", "thumbnailUrl": "16_Puzzle.png" - }, "420":{ "gameTitle" : "Colour_Generator_Game", @@ -2090,19 +2099,28 @@ "thumbnailUrl": "Screen_Pet_Game.png" },"416":{ - - "gameTitle": "rapid_click_frenzy", - "gameUrl": "rapid_click_frenzy", - "thumbnailUrl": "rapidgame.png" - - - -} - "gameTitle": "Pen_Pointer_Fight", - "gameUrl": "PenPointerFight", - "thumbnailUrl": "PenPointerFight.png" - + "gameTitle": "Guess_The_Song", + "gameUrl": "Guess_The_Song", + "thumbnailUrl": "Guess_The_Song.png" + } +},"408":{ + "gameTitle": "Brick Buster", + "gameUrl": "Brick Buster", + "thumbnailUrl": "Brick.png" + }, + "417":{ + "gameTitle": "Soccer", + "gameUrl": "Soccer", + "thumbnailUrl": "Soccer" +}, +"409":{"gameTitle": "Pen_Pointer_Fight", +"gameUrl": "PenPointerFight", +"thumbnailUrl": "PenPointerFight.png" +}, +"418":{ +"gameTitle": "MathQuiz", +"gameUrl": "MathQuiz", +"thumbnailUrl": "MathQuiz.png" } } - diff --git a/assets/js/index.js b/assets/js/index.js index ce50294161..6bf16f73ff 100644 --- a/assets/js/index.js +++ b/assets/js/index.js @@ -4,12 +4,13 @@ const generateLiTags = (gamesData, searchText = "") => { const liTags = []; searchText = searchText.trim().toLowerCase(); // Trim whitespace and convert to lowercase - for (let tagNumber = 1; tagNumber <= 416; tagNumber++) { + for (let tagNumber = 1; tagNumber <= 418; tagNumber++) { const gameData = gamesData[tagNumber.toString()]; if (gameData) { const { gameTitle, gameUrl, thumbnailUrl } = gameData; if (gameTitle.toLowerCase().includes(searchText)) { + const liked = localStorage.getItem(`liked-${tagNumber}`) === "true"; const liTag = `
  • @@ -19,7 +20,10 @@ const generateLiTags = (gamesData, searchText = "") => { ${gameTitle} -

    ${tagNumber}. ${gameTitle} ๐Ÿ”—

    +
  • `; @@ -57,7 +61,10 @@ fetch("./assets/js/gamesData.json") // Search functionality const searchInput = document.getElementById("searchbar"); searchInput.addEventListener("input", () => { - projectListContainer.innerHTML = generateLiTags(gamesData, searchInput.value); + projectListContainer.innerHTML = generateLiTags( + gamesData, + searchInput.value + ); }); }) .catch((error) => console.error("Error fetching game data:", error)); @@ -75,22 +82,21 @@ window.addEventListener("scroll", function () { // Get references to the div and input elements const searchContainer = document.getElementById("search-container-id"); const searchInput = document.getElementById("searchbar"); -const clearButton=document.getElementById("clearButton") +const clearButton = document.getElementById("clearButton"); // Add a click event listener to the div - searchContainer.addEventListener("click", function () { +searchContainer.addEventListener("click", function () { // Focus on the input field when the div is clicked searchInput.focus(); }); - // Improved searching and filtering of the games -document.addEventListener('DOMContentLoaded', () => { - const searchInput = document.getElementById('searchbar'); - const clearSearchButton = document.getElementById('clear-search'); - const searchTermDisplay = document.getElementById('search-term'); +document.addEventListener("DOMContentLoaded", () => { + const searchInput = document.getElementById("searchbar"); + const clearSearchButton = document.getElementById("clear-search"); + const searchTermDisplay = document.getElementById("search-term"); const searchRelatedDiv = document.getElementById("search-related"); - const suggestionList = document.getElementById('suggestion-list'); + const suggestionList = document.getElementById("suggestion-list"); if (!searchInput) return; searchRelatedDiv.style.display = "none"; const updateSearchRelatedVisibility = (searchText) => { @@ -101,30 +107,32 @@ document.addEventListener('DOMContentLoaded', () => { } }; //old code from script.js - const searchList=(searchText)=>{ - suggestionList.innerHTML = ''; - if (searchText.length === 0) { - suggestionList.style.display = 'none'; - return; - } - const filteredGames = Object.values(gamesData).filter(game => - game.gameTitle.toLowerCase().includes(searchText) || game.gameUrl.toLowerCase().includes(searchText) - ); - filteredGames.forEach(game => { - const li = document.createElement('li'); - const anchor = document.createElement('a'); - anchor.href = `./Games/${game.gameUrl}`; - anchor.target = "_blank"; - anchor.setAttribute('aria-label', game.gameTitle); - anchor.textContent = game.gameTitle; - li.appendChild(anchor); - suggestionList.appendChild(li); - }); - suggestionList.style.display = filteredGames.length ? 'block' : 'none'; -} -//for serching - searchInput.addEventListener('input', function () { - const searchText = searchInput.value.trim().toLowerCase(); + const searchList = (searchText) => { + suggestionList.innerHTML = ""; + if (searchText.length === 0) { + suggestionList.style.display = "none"; + return; + } + const filteredGames = Object.values(gamesData).filter( + (game) => + game.gameTitle.toLowerCase().includes(searchText) || + game.gameUrl.toLowerCase().includes(searchText) + ); + filteredGames.forEach((game) => { + const li = document.createElement("li"); + const anchor = document.createElement("a"); + anchor.href = `./Games/${game.gameUrl}`; + anchor.target = "_blank"; + anchor.setAttribute("aria-label", game.gameTitle); + anchor.textContent = game.gameTitle; + li.appendChild(anchor); + suggestionList.appendChild(li); + }); + suggestionList.style.display = filteredGames.length ? "block" : "none"; + }; + //for searching + searchInput.addEventListener("input", function () { + const searchText = searchInput.value.trim().toLowerCase(); fetch("./assets/js/gamesData.json") .then((response) => response.json()) .then((gamesData) => { @@ -136,8 +144,8 @@ document.addEventListener('DOMContentLoaded', () => { }) .catch((error) => console.error("Error fetching game data:", error)); }); -//for search clearing - clearSearchButton.addEventListener('click', function () { + //for search clearing + clearSearchButton.addEventListener("click", function () { searchInput.value = ""; fetch("./assets/js/gamesData.json") .then((response) => response.json()) @@ -151,3 +159,13 @@ document.addEventListener('DOMContentLoaded', () => { .catch((error) => console.error("Error fetching game data:", error)); }); }); + +function like(button, tagNumber, gameData) { + button.classList.toggle("liked"); + const isLiked = button.classList.contains("liked"); + + // Store both liked state and game data in localStorage + localStorage.setItem(`liked-${tagNumber}`, isLiked); + localStorage.setItem(`game-${tagNumber}`, JSON.stringify(gameData)); +} + diff --git a/index.html b/index.html index a3319dcb4b..f32891a0f5 100644 --- a/index.html +++ b/index.html @@ -105,6 +105,20 @@ +
    +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
    @@ -144,6 +158,7 @@ + @@ -177,8 +192,16 @@
    + +
    +
    @@ -367,6 +391,7 @@

    + @@ -376,7 +401,6 @@

    diff --git a/pages/fav.html b/pages/fav.html new file mode 100644 index 0000000000..cb41d96adf --- /dev/null +++ b/pages/fav.html @@ -0,0 +1,222 @@ + + + + + + Favorites + + + + +
    +

    Your Favorite Games

    +
      +
      + + + diff --git a/pages/script.js b/pages/script.js new file mode 100644 index 0000000000..e69de29bb2