From b7d53414c2fc759691d5c71887dc89a6956f7245 Mon Sep 17 00:00:00 2001 From: shruti110503 <118251562+shruti110503@users.noreply.github.com> Date: Tue, 4 Jun 2024 14:06:43 +0530 Subject: [PATCH 01/10] Added Game CatchTheBall Added --- 117-CatchTheBall/README.md | 24 +++++ 117-CatchTheBall/catch-the-ball.png | Bin 0 -> 21026 bytes 117-CatchTheBall/index.html | 22 +++++ 117-CatchTheBall/script.js | 135 ++++++++++++++++++++++++++++ 117-CatchTheBall/style.css | 36 ++++++++ 5 files changed, 217 insertions(+) create mode 100644 117-CatchTheBall/README.md create mode 100644 117-CatchTheBall/catch-the-ball.png create mode 100644 117-CatchTheBall/index.html create mode 100644 117-CatchTheBall/script.js create mode 100644 117-CatchTheBall/style.css diff --git a/117-CatchTheBall/README.md b/117-CatchTheBall/README.md new file mode 100644 index 00000000..ae11fed0 --- /dev/null +++ b/117-CatchTheBall/README.md @@ -0,0 +1,24 @@ +# **CatchTheBall** +
+ +## **Description 📃** +Catch the Ball is an engaging and addictive arcade game that challenges players to catch a bouncing ball with a paddle. + +## **features 🎮** +1)Intuitive Gameplay: +Simple controls: Move the paddle left or right to catch the ball. +Easy to understand, making it accessible for players of all skill levels. + +2)Responsive Design: +Mobile-friendly: Optimized for touch controls on smartphones and tablets. +Resizable canvas: Automatically adjusts to different screen sizes, providing a consistent gaming experience on any device. + +3)Endless Challenge: +Increasing difficulty: The ball's speed increases over time, testing players' reflexes and coordination. +Score tracking: Players can see their score in real-time and aim to beat their high score. + +## **How to play? 🕹ī¸** +2. Use the left (`←`) and right (`→`) arrow keys to move the paddle. +3. Try to catch the falling ball with the paddle. +4. If you catch the ball, a new ball will fall from top from a new random position. +5. If you miss the ball, the game will restart. \ No newline at end of file diff --git a/117-CatchTheBall/catch-the-ball.png b/117-CatchTheBall/catch-the-ball.png new file mode 100644 index 0000000000000000000000000000000000000000..dd3487ac112eaf43e39fe82768e5767bad639d9d GIT binary patch literal 21026 zcmeHvcT`hZ+b{DvBQv5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EJO#8dq6{`kQ5<(hE0(qdc45d8p;B%OJ;-d1;2WVV|d0SR|OntyZ*h;DVrQ5_CuVarbay*vz&d~Mg^!6AKqHyR(u^(IhHeI7N%CVR$ZzUEv zhJUvoc+r>My&#%=|L=|=&i*U#t+kzX1*)1`6?HsxM~XjF6i1<=MDw~AKmXxEDcZRo zraIYv{v00#yENmqmT-!+Id#;#kvW<%)g*7Pnh7%JYc?+eAIRxyhR(r(&0a+)dR~1^ zuS-h_I3b?6XUxtLhdV7|&fjarywo2Ps~Sspwb|^k8pS;BaSA= zRK{zeR^yf$3?!ua^N%@?FL|n?lBVR67eL7IO-QwG?(C5sOrthkOAYm;K?}c}McBO1 z0C;B;)7^NaM7$D(_;{c^8Kg;#ezcuha;&V&UQuZZE z=0qZqX9iesHjPI6lDo4c&%ozTm~H^O8-@Q@)ssAa*xI=61&ITH{^|0)-8Td zPKDeO)(H6mUtDXEzH*=twBh+r0Og+#xBaJzbN58sdyiZ)+JCB!B-zh4pl++pZiQz2 zVDw=o7ziLxS17v4RNq4a0{ltRh6JT489}HLiKcME+f;foik9@4&j0Q4Yk!Av1#U$D z`>57`?`$`0C-9%z(Z9p50>A!KYx%>4t~|6$zUUiA&DT^Tt3&#}z^w{qo;1UZey Vw>CQ*irnq?iizc=$_uxC|6c&@kdy!b literal 0 HcmV?d00001 diff --git a/117-CatchTheBall/index.html b/117-CatchTheBall/index.html new file mode 100644 index 00000000..e0756fc3 --- /dev/null +++ b/117-CatchTheBall/index.html @@ -0,0 +1,22 @@ + + + + + + Catch the Ball + + + + +
+

Catch the Ball

+ +
+ + + +
+
+ + + diff --git a/117-CatchTheBall/script.js b/117-CatchTheBall/script.js new file mode 100644 index 00000000..0ed5a936 --- /dev/null +++ b/117-CatchTheBall/script.js @@ -0,0 +1,135 @@ +const canvas = document.getElementById('gameCanvas'); +const ctx = canvas.getContext('2d'); +canvas.width = window.innerWidth * 0.8; +canvas.height = window.innerHeight * 0.6; + +const paddleWidth = 100; +const paddleHeight = 10; +const ballRadius = 10; + +let paddleX = (canvas.width - paddleWidth) / 2; +let rightPressed = false; +let leftPressed = false; + +let ballX = canvas.width / 2; +let ballY = ballRadius; +let ballDX = 2; +let ballDY = 2; +let score = 0; + +document.addEventListener('keydown', keyDownHandler); +document.addEventListener('keyup', keyUpHandler); +document.getElementById('leftBtn').addEventListener('click', () => { leftPressed = true; }); +document.getElementById('rightBtn').addEventListener('click', () => { rightPressed = true; }); +document.getElementById('playAgainBtn').addEventListener('click', resetGame); + +window.addEventListener('resize', () => { + canvas.width = window.innerWidth * 0.8; + canvas.height = window.innerHeight * 0.6; + paddleX = (canvas.width - paddleWidth) / 2; + ballX = canvas.width / 2; + ballY = ballRadius; +}); + +canvas.addEventListener('touchstart', (e) => { + const touchX = e.touches[0].clientX - canvas.offsetLeft; + if (touchX > paddleX + paddleWidth / 2) { + rightPressed = true; + } else { + leftPressed = true; + } +}); + +canvas.addEventListener('touchend', (e) => { + rightPressed = false; + leftPressed = false; +}); + +function keyDownHandler(e) { + if (e.key === 'Right' || e.key === 'ArrowRight') { + rightPressed = true; + } else if (e.key === 'Left' || e.key === 'ArrowLeft') { + leftPressed = true; + } +} + +function keyUpHandler(e) { + if (e.key === 'Right' || e.key === 'ArrowRight') { + rightPressed = false; + } else if (e.key === 'Left' || e.key === 'ArrowLeft') { + leftPressed = false; + } +} + +function drawPaddle() { + ctx.beginPath(); + ctx.rect(paddleX, canvas.height - paddleHeight, paddleWidth, paddleHeight); + ctx.fillStyle = '#0095DD'; + ctx.fill(); + ctx.closePath(); +} + +function drawBall() { + ctx.beginPath(); + ctx.arc(ballX, ballY, ballRadius, 0, Math.PI * 2); + ctx.fillStyle = '#0095DD'; + ctx.fill(); + ctx.closePath(); +} + +function drawScore() { + ctx.font = '16px Arial'; + ctx.fillStyle = '#0095DD'; + ctx.fillText('Score: ' + score, 8, 20); +} + +function draw() { + ctx.clearRect(0, 0, canvas.width, canvas.height); + drawPaddle(); + drawBall(); + drawScore(); + + if (rightPressed && paddleX < canvas.width - paddleWidth) { + paddleX += 7; + } else if (leftPressed && paddleX > 0) { + paddleX -= 7; + } + + ballX += ballDX; + ballY += ballDY; + + if (ballX + ballDX > canvas.width - ballRadius || ballX + ballDX < ballRadius) { + ballDX = -ballDX; + } + + if (ballY + ballDY < ballRadius) { + ballDY = -ballDY; + } else if (ballY + ballDY > canvas.height - ballRadius) { + if (ballX > paddleX && ballX < paddleX + paddleWidth) { + ballDY = -ballDY; + score++; + } else { + endGame(); + return; + } + } + + requestAnimationFrame(draw); +} + +function endGame() { + alert('Game Over! Your score is: ' + score); + document.getElementById('playAgainBtn').style.display = 'inline-block'; +} + +function resetGame() { + score = 0; + ballX = canvas.width / 2; + ballY = ballRadius; + ballDX = 2; + ballDY = 2; + document.getElementById('playAgainBtn').style.display = 'none'; + draw(); +} + +draw(); diff --git a/117-CatchTheBall/style.css b/117-CatchTheBall/style.css new file mode 100644 index 00000000..947a5710 --- /dev/null +++ b/117-CatchTheBall/style.css @@ -0,0 +1,36 @@ +body { + margin: 0; + display: flex; + justify-content: center; + align-items: center; + height: 100vh; + background-color: #f0f0f0; + font-family: 'Roboto', sans-serif; +} + +.game-container { + text-align: center; +} + +.game-title { + font-family: 'Roboto', sans-serif; + font-size: 36px; + font-weight: 700; + margin-bottom: 20px; + color: #0095DD; +} + +canvas { + background-color: #333; + border: 1px solid #000; +} + +.controls { + margin-top: 10px; +} + +button { + padding: 10px 20px; + margin: 0 10px; + font-size: 16px; +} From fea918a2b50122fa7156bb20d4862bd8a37cd8e2 Mon Sep 17 00:00:00 2001 From: shruti110503 <118251562+shruti110503@users.noreply.github.com> Date: Fri, 7 Jun 2024 13:45:46 +0530 Subject: [PATCH 02/10] updated the index file --- .../assets}/catch-the-ball.png | Bin index.html | 13 +++++++++++++ 2 files changed, 13 insertions(+) rename {117-CatchTheBall => 30DaysOfJavaScript/assets}/catch-the-ball.png (100%) diff --git a/117-CatchTheBall/catch-the-ball.png b/30DaysOfJavaScript/assets/catch-the-ball.png similarity index 100% rename from 117-CatchTheBall/catch-the-ball.png rename to 30DaysOfJavaScript/assets/catch-the-ball.png diff --git a/index.html b/index.html index a00f72b4..88258c21 100644 --- a/index.html +++ b/index.html @@ -1382,6 +1382,19 @@

Maze Game

+ +
+
+ +
+
+

CatchTheBall

+

Catch the ball on the rolling pad and beat your own highscore!

+ + +
+
+ From 9ee969fe9e0a9211a98f3367361995b67b851cf0 Mon Sep 17 00:00:00 2001 From: shruti110503 <118251562+shruti110503@users.noreply.github.com> Date: Wed, 12 Jun 2024 00:04:56 +0530 Subject: [PATCH 03/10] Update index.html --- index.html | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/index.html b/index.html index 88258c21..4bbbff68 100644 --- a/index.html +++ b/index.html @@ -1382,20 +1382,20 @@

Maze Game

- -
-
- -
-
-

CatchTheBall

-

Catch the ball on the rolling pad and beat your own highscore!

- - -
+
+
+ Project Image +
+
+

Catch The Ball

+

Catch the ball on the rolling pad and beat your own highscore!

+ + +
+
From 09c6b37e197a95a387f48526ea1aa96d5f135881 Mon Sep 17 00:00:00 2001 From: shruti110503 <118251562+shruti110503@users.noreply.github.com> Date: Sun, 16 Jun 2024 14:32:10 +0530 Subject: [PATCH 04/10] Update index.html --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 4bbbff68..df6a6ea0 100644 --- a/index.html +++ b/index.html @@ -1389,7 +1389,7 @@

Maze Game

Catch The Ball

Catch the ball on the rolling pad and beat your own highscore!

- +
From c33aa9cce077552485206679c29a484aa9ca6d4e Mon Sep 17 00:00:00 2001 From: shruti110503 <118251562+shruti110503@users.noreply.github.com> Date: Tue, 18 Jun 2024 16:09:26 +0530 Subject: [PATCH 05/10] Update index.html --- 117-CatchTheBall/index.html | 206 ++++++++++++++++++++++++++++++++++-- 1 file changed, 196 insertions(+), 10 deletions(-) diff --git a/117-CatchTheBall/index.html b/117-CatchTheBall/index.html index e0756fc3..ca8f8d91 100644 --- a/117-CatchTheBall/index.html +++ b/117-CatchTheBall/index.html @@ -3,20 +3,206 @@ - Catch the Ball - - + Catch the Ball Game +
-

Catch the Ball

+
Catch the Ball
-
- - - -
+
- + From 051c354abd29eb2244766e36a5b3adf877d26e7d Mon Sep 17 00:00:00 2001 From: shruti110503 <118251562+shruti110503@users.noreply.github.com> Date: Fri, 21 Jun 2024 23:30:06 +0530 Subject: [PATCH 06/10] Update index.html --- 117-CatchTheBall/index.html | 44 ++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/117-CatchTheBall/index.html b/117-CatchTheBall/index.html index ca8f8d91..a66b65b4 100644 --- a/117-CatchTheBall/index.html +++ b/117-CatchTheBall/index.html @@ -64,35 +64,36 @@ - \ No newline at end of file + diff --git a/02 - Clock/style.css b/02 - Clock/style.css index 5ee996ad..0ed6e6fd 100644 --- a/02 - Clock/style.css +++ b/02 - Clock/style.css @@ -8,10 +8,11 @@ body { display: flex; justify-content: center; align-items: center; + flex-direction: column; min-height: 100vh; background: #19172e; font-family: "sans"; - + transition: 0.5s; } @font-face { @@ -38,6 +39,12 @@ body { align-items: center; background: url(assets/clock.png); background-size: cover; + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.2); + transition: transform 0.3s; +} + +.clock:hover { + transform: scale(1.05); } .clock:before { @@ -48,12 +55,14 @@ body { background: #fff; border-radius: 50%; z-index: 10000; + box-shadow: 0 0 15px #fff; } .clock .hour, .clock .min, .clock .sec { position: absolute; + transition: all 0.5s ease-in-out; } .clock .hour, @@ -79,7 +88,6 @@ body { .sc { display: flex; justify-content: center; - /* align-items: center; */ position: absolute; border-radius: 50%; } @@ -92,6 +100,7 @@ body { background: #bb86fc; z-index: 10; border-radius: 6px 6px 0 0; + box-shadow: 0 0 10px #bb86fc; } .mn:before { @@ -102,6 +111,7 @@ body { background: #fff; z-index: 11; border-radius: 6px 6px 0 0; + box-shadow: 0 0 10px #fff; } .sc:before { @@ -112,6 +122,7 @@ body { background: #70efde; z-index: 12; border-radius: 6px 6px 0 0; + box-shadow: 0 0 10px #70efde; } footer { @@ -128,3 +139,87 @@ footer { footer a:visited { color: inherit; } + +button#theme-toggle { + margin-top: 20px; + padding: 10px 20px; + font-size: 1rem; + color: #1b1919; + background-color: #6200ea; + border: none; + border-radius: 5px; + cursor: pointer; + transition: background-color 0.3s, transform 0.3s; +} + +button#theme-toggle:hover { + background-color: #3700b3; + transform: scale(1.05); +} + +button#theme-toggle:focus { + outline: none; +} + +@media (max-width: 600px) { + .clock { + width: 250px; + height: 250px; + } + + .clock .hour, + .hr { + width: 120px; + height: 120px; + } + + .clock .min, + .mn { + width: 140px; + height: 140px; + } + + .clock .sec, + .sc { + width: 180px; + height: 180px; + } +} + +/* Theme Toggle */ +body.light-theme { + background: #8f8df9; +} + +body.light-theme .clock:before { + background: #000; + box-shadow: 0 0 15px #000; +} + +body.light-theme .hr:before { + background: #6200ea; + box-shadow: 0 0 10px #6200ea; +} + +body.light-theme .mn:before { + background: #000; + box-shadow: 0 0 10px #000; +} + +body.light-theme .sc:before { + background: #03dac6; + box-shadow: 0 0 10px #03dac6; +} + +body.light-theme .heading, +body.light-theme footer { + color: #000; +} + +body.light-theme button#theme-toggle { + background-color: #bb86fc; +} + +body.light-theme button#theme-toggle:hover { + background-color: #3700b3; +} From b4632b4ad17785e33e17bb3805e2c130fe5977c7 Mon Sep 17 00:00:00 2001 From: keerthika-18 <115565170+keerthika-18@users.noreply.github.com> Date: Sat, 13 Jul 2024 22:06:49 +0530 Subject: [PATCH 10/10] !feat:added limitin password --- 05 - Random Password Generator/main.js | 72 ++++++++++-------------- 05 - Random Password Generator/style.css | 7 ++- 2 files changed, 33 insertions(+), 46 deletions(-) diff --git a/05 - Random Password Generator/main.js b/05 - Random Password Generator/main.js index dfc4010c..aa272f66 100644 --- a/05 - Random Password Generator/main.js +++ b/05 - Random Password Generator/main.js @@ -1,49 +1,35 @@ -const words = ['seat', 'pen', 'broad', 'vapor', 'ocean', - 'red', 'plate', 'late', 'that', 'ring', 'swim', 'shown', - 'path', 'law', 'list', 'hard', 'plate', 'block', 'two', - 'pupil', 'were', 'lot', 'pay', 'would', 'tired', 'dull', - 'mud', 'sky', 'grew', 'hard', 'ill', 'frame', - 'sport', 'did', 'many', 'been', 'page', 'year', 'trail', - 'earth', 'are', 'while', 'off', 'town', 'doing', 'size', - 'steel', 'sale', 'swam', 'put', 'zero', 'week', 'mill', - 'past', 'aside', 'her', 'cent', 'box', 'fuel', 'block', - 'those', 'late', 'sun', 'map', 'silk', 'lady', 'meant', - 'still', 'shine', 'range', 'loud', 'fox', 'gate', 'slide', - 'each', 'nails', 'flag', 'exist', 'door', 'luck', 'down', - 'poem', 'depth', 'press', 'crowd', 'herd', 'drink', 'worry', - 'dried', 'dig', 'new', 'rest', 'play', 'win', 'strong']; - - function getPassword() { - let length = document.getElementById('length').value; - if (length === '') { - length = 8; // Setting default length to 8 +function getPassword() { + let length = document.getElementById('length').value; + if (length === '' || isNaN(length)) { + length = 8; // Setting default length to 8 if invalid input + } else { + length = parseInt(length); + if (length < 8 || length > 32) { + length = 8; + alert('default 8 to 32') } - - const includeLowercase = document.getElementById('includeLowercase').checked; - const includeUppercase = document.getElementById('includeUppercase').checked; - const includeSymbols = document.getElementById('includeSymbols').checked; - const includeNumbers = document.getElementById('includeNumbers').checked; - - let chars = ''; - if (includeLowercase) chars += 'abcdefghijklmnopqrstuvwxyz'; - if (includeUppercase) chars += 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; - if (includeSymbols) chars += '!@#$%&'; - if (includeNumbers) chars += '0123456789'; - - let password = ''; - for (let i = 0; i < length; i++) { - password += chars.charAt(Math.floor(Math.random() * chars.length)); - } - - document.getElementById('password').value = password; } + const includeLowercase = document.getElementById('includeLowercase').checked; + const includeUppercase = document.getElementById('includeUppercase').checked; + const includeSymbols = document.getElementById('includeSymbols').checked; + const includeNumbers = document.getElementById('includeNumbers').checked; -function randomNumber (l) { - return Math.floor(Math.random() * l); -} + let chars = ''; + if (includeLowercase) chars += 'abcdefghijklmnopqrstuvwxyz'; + if (includeUppercase) chars += 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; + if (includeSymbols) chars += '!@#$%&'; + if (includeNumbers) chars += '0123456789'; + + if (chars === '') { + alert('Please select at least one character type.'); + return; + } + + let password = ''; + for (let i = 0; i < length; i++) { + password += chars.charAt(Math.floor(Math.random() * chars.length)); + } -function randomWord () { - const number = randomNumber(words.length); - return words[number]; + document.getElementById('password').value = password; } diff --git a/05 - Random Password Generator/style.css b/05 - Random Password Generator/style.css index 486becc0..70713b46 100644 --- a/05 - Random Password Generator/style.css +++ b/05 - Random Password Generator/style.css @@ -1,13 +1,13 @@ * { padding: 0; margin: 0; - font-family: "sans"; + font-family: "sans-serif"; user-select: none; } @font-face { src: url("font/sans.ttf"); - font-family: "sans"; + font-family: "sans-serif"; } .container { @@ -50,13 +50,13 @@ h2 { color: white; outline: none; } + .inputBox input[type="number"]::-webkit-inner-spin-button, .inputBox input[type="number"]::-webkit-outer-spin-button { appearance: none; margin: 0; } - .inputBox label { color: white; font-size: 1rem; @@ -113,3 +113,4 @@ footer a:visited { text-decoration: none; } +