├── .DS_Store ├── age-calculator ├── age-calculator.css ├── age-calculator.html └── age-calculator.js ├── audio-buttons ├── .DS_Store ├── audio-buttons.css ├── audio-buttons.html ├── audio-buttons.js └── audio │ ├── applause.mp3 │ ├── boo.mp3 │ ├── gasp.mp3 │ ├── tada.mp3 │ ├── victory.mp3 │ └── wrong.mp3 ├── bmi ├── bmi.css ├── bmi.html └── bmi.js ├── breakout ├── breakout.css ├── breakout.html └── breakout.js ├── calculator ├── calculator.css ├── calculator.html └── calculator.js ├── captcha-generator ├── index.css ├── index.html └── index.js ├── character-count ├── charactor-count.css ├── charactor-count.html └── charactor-count.js ├── counter ├── counter.css ├── counter.html └── counter.js ├── dad-jokes ├── dadjoke.css ├── dadjoke.html └── dadjoke.js ├── dictionary-app ├── .vscode │ └── settings.json ├── dictionary.css ├── dictionary.js └── dictonary.html ├── digital-clock ├── clock.css ├── clock.html └── clock.js ├── drap-n-drop ├── dragndrop.js ├── drapndrop.css └── drapndrop.html ├── emi-calculator ├── .vscode │ └── settings.json ├── emi-calculator.css ├── emi-calculator.html └── emi-calculator.js ├── expanding-cards ├── .DS_Store ├── cards.css ├── cards.html ├── cards.js └── image │ ├── bangkok.jpg │ ├── mumbai.jpg │ ├── quebec.jpg │ ├── spain.jpg │ └── tokyo.jpg ├── github-contribution-graph ├── index.css ├── index.html └── index.js ├── hidden-search ├── .vscode │ └── settings.json ├── hidden-search.css ├── hidden-search.html └── hidden-search.js ├── hoverboard ├── index.css ├── index.html └── index.js ├── image-crousel ├── index.css ├── index.html └── index.js ├── image-gallary ├── image-gallery.css ├── image-gallery.html └── image-gallery.js ├── image-search ├── imagesearch.css ├── imagesearch.html └── imagesearch.js ├── image-slide ├── image-slider.css ├── image-slider.html └── image-slider.js ├── increment-counter ├── incrementcounter.css ├── incrementcounter.html └── incrementcounter.js ├── jumping-letters ├── index.css ├── index.html └── index.js ├── loader ├── loader.css └── loader.html ├── loading-bar ├── loading.css ├── loading.html └── loading.js ├── mini-calender ├── index.css ├── index.html └── index.js ├── mouseover ├── mouseover.css ├── mouseover.html └── mouseover.js ├── multiplication-app ├── index.css ├── index.html └── index.js ├── new-year-countdown ├── .vscode │ └── settings.json ├── newyear.css ├── newyear.html └── newyear.js ├── password-generator ├── password.css ├── password.html └── password.js ├── password-strength-checker ├── password-checker.css ├── password-checker.html └── password-checker.js ├── pomodoro ├── pomodoro.css ├── pomodoro.html └── pomodoro.js ├── qr-code ├── qrcode.css ├── qrcode.html └── qrcode.js ├── quiz-app ├── quiz-app.css ├── quiz-app.html └── quiz-app.js ├── quote-generator ├── .DS_Store ├── quotes.css ├── quotes.html └── quotes.js ├── random-color-card ├── random-color.css ├── random-color.html └── random-color.js ├── random-emoji-generator ├── .vscode │ └── settings.json ├── random-emoji.css ├── random-emoji.html └── random-emoji.js ├── random-emoji ├── random-emoji.css ├── random-emoji.html └── random-emoji.js ├── ripple-effect ├── ripple.css ├── ripple.html └── ripple.js ├── rock-paper-scissor ├── index.css ├── index.html └── index.js ├── scroll-animation ├── index.css ├── index.html └── index.js ├── sticky-navbar ├── index.css └── index.html ├── stopwatch ├── stopwatch.css ├── stopwatch.html └── stopwatch.js ├── temp-conv ├── index.css ├── index.html └── index.js ├── testimonial-slider ├── index.css ├── index.html └── index.js ├── text-animation ├── text-animation.css ├── text-animation.html └── text-animation.js ├── text-effect ├── texteffect.css ├── texteffect.html └── texteffect.js ├── tip-calculator ├── tipcalculator.css ├── tipcalculator.html └── tipcalculator.js ├── todo ├── index.css ├── index.html └── index.js ├── verify-ui ├── verify.css ├── verify.html └── verify.js ├── vowel-counter ├── index.css ├── index.html └── index.js └── weight-converter ├── index.css ├── index.html └── index.js /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arbazkhan971/html-css-javascript-projects/da9fa39a8e800b46cdc58640810e158a6f031ef5/.DS_Store -------------------------------------------------------------------------------- /age-calculator/age-calculator.css: -------------------------------------------------------------------------------- 1 | *{ 2 | padding:0; 3 | margin: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | body{ 8 | background-color: antiquewhite; 9 | display: flex; 10 | justify-content: center; 11 | align-items: center; 12 | height: 100vh; 13 | } 14 | 15 | .age-container { 16 | border-radius: 10px; 17 | padding: 30px; 18 | width: 500px; 19 | height: 250px; 20 | text-align: center; 21 | box-shadow: 0 0 10px 0 black; 22 | } 23 | 24 | .age-header { 25 | font-size: 2rem; 26 | font-weight: bold; 27 | margin: 10px; 28 | } 29 | 30 | label { 31 | font-size: 1.2rem; 32 | margin-bottom: 10px; 33 | display: block; 34 | } 35 | 36 | .age-dob-input { 37 | width: 200px; 38 | height: 40px; 39 | border-radius: 10px; 40 | font-size: 1.2rem; 41 | padding: 10px; 42 | margin-bottom: 10px; 43 | border: none; 44 | } 45 | 46 | .calculate-btn { 47 | font-size: 1.2rem; 48 | width: 200px; 49 | height: 40px; 50 | background-color: black; 51 | color: white; 52 | margin-bottom: 10px; 53 | } -------------------------------------------------------------------------------- /age-calculator/age-calculator.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Age Calculator Project 7 | 8 | 9 | 10 | 11 |
12 |
13 | Age Calculator 14 |
15 |
16 | 19 | 20 |
21 | 22 |
23 | 26 |
27 | 28 |
29 | Your age is: 30 |
31 |
32 | 36 | 37 | -------------------------------------------------------------------------------- /age-calculator/age-calculator.js: -------------------------------------------------------------------------------- 1 | const inputbtn = document.querySelector(".age-dob-input"); 2 | const calculatebtn = document.querySelector(".calculate-btn"); 3 | const ageresult = document.querySelector(".age-result"); 4 | 5 | calculatebtn.addEventListener("click", () => { 6 | if(inputbtn.value === ""){ 7 | alert("Please enter your date of birth"); 8 | }else { 9 | console.log("input",inputbtn.value); 10 | const dob = new Date(inputbtn.value); 11 | console.log("dob",dob); 12 | const dob_year = dob.getFullYear(); 13 | console.log("dob_year",dob_year); 14 | 15 | // current 16 | const now = new Date(); 17 | console.log("now",now); 18 | const now_year = now.getFullYear(); 19 | console.log("now_year",now_year); 20 | const age = now_year - dob_year; 21 | console.log("age",age); 22 | 23 | ageresult.innerHTML = `Your age is ${age}`; 24 | 25 | } 26 | }); -------------------------------------------------------------------------------- /audio-buttons/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arbazkhan971/html-css-javascript-projects/da9fa39a8e800b46cdc58640810e158a6f031ef5/audio-buttons/.DS_Store -------------------------------------------------------------------------------- /audio-buttons/audio-buttons.css: -------------------------------------------------------------------------------- 1 | * { 2 | padding: 0; 3 | margin: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | body { 8 | background-color: antiquewhite; 9 | display: flex; 10 | justify-content: center; 11 | align-items: center; 12 | height: 100vh; 13 | } 14 | 15 | button{ 16 | padding: 10px; 17 | border: none; 18 | border-radius: 5px; 19 | background-color: aquamarine; 20 | font-size: 18px; 21 | cursor: pointer; 22 | margin: 5px; 23 | } 24 | 25 | button:hover{ 26 | background-color: #00ff7f; 27 | } -------------------------------------------------------------------------------- /audio-buttons/audio-buttons.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Audio buttons 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /audio-buttons/audio-buttons.js: -------------------------------------------------------------------------------- 1 | const button1 = document.querySelector('#applause'); 2 | const button2 = document.querySelector('#boo'); 3 | const button3 = document.querySelector('#gasp'); 4 | const button4 = document.querySelector('#tada'); 5 | const button5 = document.querySelector('#victory'); 6 | const button6 = document.querySelector('#wrong'); 7 | 8 | const audio1 = document.querySelector('#audio-applause'); 9 | const audio2 = document.querySelector('#audio-boo'); 10 | const audio3 = document.querySelector('#audio-gasp'); 11 | const audio4 = document.querySelector('#audio-tada'); 12 | const audio5 = document.querySelector('#audio-victory'); 13 | const audio6 = document.querySelector('#audio-wrong'); 14 | 15 | // console.log(button1, button2, button3, button4, button5, button6) 16 | // console.log(audio1, audio2, audio3, audio4, audio5, audio6) 17 | 18 | button1.addEventListener('click', () => { 19 | stopAudio(); 20 | audio1.play(); 21 | }) 22 | 23 | button2.addEventListener('click', () => { 24 | stopAudio(); 25 | audio2.play(); 26 | }) 27 | 28 | button3.addEventListener('click', () => { 29 | stopAudio(); 30 | audio3.play(); 31 | }); 32 | 33 | button4.addEventListener('click', () => { 34 | stopAudio(); 35 | audio4.play(); 36 | }); 37 | 38 | button5.addEventListener('click', () => { 39 | stopAudio(); 40 | audio5.play(); 41 | }); 42 | 43 | button6.addEventListener('click', () => { 44 | stopAudio(); 45 | audio6.play(); 46 | }); 47 | 48 | function stopAudio(){ 49 | audio1.pause(); 50 | audio1.currentTime = 0; 51 | audio2.pause(); 52 | audio2.currentTime = 0; 53 | audio3.pause(); 54 | audio3.currentTime = 0; 55 | audio4.pause(); 56 | audio4.currentTime = 0; 57 | audio5.pause(); 58 | audio5.currentTime = 0; 59 | audio6.pause(); 60 | audio6.currentTime = 0; 61 | } -------------------------------------------------------------------------------- /audio-buttons/audio/applause.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arbazkhan971/html-css-javascript-projects/da9fa39a8e800b46cdc58640810e158a6f031ef5/audio-buttons/audio/applause.mp3 -------------------------------------------------------------------------------- /audio-buttons/audio/boo.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arbazkhan971/html-css-javascript-projects/da9fa39a8e800b46cdc58640810e158a6f031ef5/audio-buttons/audio/boo.mp3 -------------------------------------------------------------------------------- /audio-buttons/audio/gasp.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arbazkhan971/html-css-javascript-projects/da9fa39a8e800b46cdc58640810e158a6f031ef5/audio-buttons/audio/gasp.mp3 -------------------------------------------------------------------------------- /audio-buttons/audio/tada.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arbazkhan971/html-css-javascript-projects/da9fa39a8e800b46cdc58640810e158a6f031ef5/audio-buttons/audio/tada.mp3 -------------------------------------------------------------------------------- /audio-buttons/audio/victory.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arbazkhan971/html-css-javascript-projects/da9fa39a8e800b46cdc58640810e158a6f031ef5/audio-buttons/audio/victory.mp3 -------------------------------------------------------------------------------- /audio-buttons/audio/wrong.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arbazkhan971/html-css-javascript-projects/da9fa39a8e800b46cdc58640810e158a6f031ef5/audio-buttons/audio/wrong.mp3 -------------------------------------------------------------------------------- /bmi/bmi.css: -------------------------------------------------------------------------------- 1 | * { 2 | padding: 0; 3 | margin: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | body { 8 | background-color: antiquewhite; 9 | display: flex; 10 | justify-content: center; 11 | align-items: center; 12 | height: 100vh; 13 | } 14 | 15 | 16 | .container { 17 | width: 400px; 18 | background-color: white; 19 | border-radius: 10px; 20 | box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.5); 21 | text-align: center; 22 | } 23 | 24 | .header { 25 | font-size: 20px; 26 | font-weight: 700; 27 | padding: 10px; 28 | background-color: green; 29 | color: white; 30 | } 31 | 32 | label { 33 | display: block; 34 | font-size: 20px; 35 | margin-bottom: 10px; 36 | margin-top: 10px; 37 | } 38 | 39 | input { 40 | width: 90%; 41 | padding: 10px; 42 | font-size: 18px; 43 | border-radius: 5px; 44 | outline: none; 45 | margin: 10px; 46 | } 47 | 48 | button { 49 | width: 90%; 50 | padding: 10px; 51 | font-size: 18px; 52 | border-radius: 5px; 53 | background-color: green; 54 | color: white; 55 | margin-bottom: 10px; 56 | } 57 | 58 | .result { 59 | font-size: 20px; 60 | font-weight: 700; 61 | padding: 10px; 62 | margin-bottom: 10px; 63 | } 64 | 65 | #bmi-value, #bmi-status { 66 | color: green; 67 | } -------------------------------------------------------------------------------- /bmi/bmi.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | BMI Calculator 7 | 8 | 9 | 10 | 11 |
12 |
13 |

14 | BMI 15 |

16 |
17 |
18 | 21 | 22 |
23 |
24 | 27 | 28 |
29 | 30 |
31 | 34 |
35 |
36 |

37 | Your BMI is 00 and you are 00 38 |

39 |
40 |
41 | 42 | 43 | 44 | 47 | 48 | -------------------------------------------------------------------------------- /bmi/bmi.js: -------------------------------------------------------------------------------- 1 | const height = document.querySelector('#height'); 2 | const weight = document.querySelector('#weight'); 3 | const bmi_value = document.querySelector('#bmi-value'); 4 | const bmi_status = document.querySelector('#bmi-status'); 5 | const calculate = document.querySelector('#calculate-bmi'); 6 | 7 | calculate.addEventListener('click', () => { 8 | if( height.value === "" || weight.value === "" ) { 9 | alert('Please enter your height and weight'); 10 | return; 11 | }else{ 12 | let height_value = height.value; 13 | let weight_value = weight.value; 14 | let height_value_meters = height_value / 100; 15 | let bmi = weight_value / (height_value_meters * height_value_meters); 16 | bmi = bmi.toFixed(2); 17 | bmi_value.textContent = bmi; 18 | if( bmi <= 18.4){ 19 | bmi_status.textContent = 'Underweight'; 20 | }else if( bmi >= 18.5 && bmi <= 24.9 ){ 21 | bmi_status.textContent = 'Normal'; 22 | }else if( bmi >= 25 && bmi <= 39.9 ){ 23 | bmi_status.textContent = 'Overweight'; 24 | }else if( bmi >= 40){ 25 | bmi_status.textContent = 'Obese'; 26 | } 27 | } 28 | }); 29 | -------------------------------------------------------------------------------- /breakout/breakout.css: -------------------------------------------------------------------------------- 1 | * { 2 | padding: 0; 3 | margin: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | body { 8 | background-color: antiquewhite; 9 | display: flex; 10 | align-items: center; 11 | justify-content: center; 12 | height: 100vh; 13 | } 14 | 15 | #breakout { 16 | background-color: white; 17 | border: 2px solid black; 18 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); 19 | } -------------------------------------------------------------------------------- /breakout/breakout.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Breakout Game 7 | 8 | 9 | 10 | 11 | 16 | 17 | 20 | 21 | -------------------------------------------------------------------------------- /breakout/breakout.js: -------------------------------------------------------------------------------- 1 | const canvas = document.getElementById("breakout"); 2 | const ctx = canvas.getContext("2d"); 3 | console.log(canvas) 4 | console.log(canvas.width) 5 | console.log(canvas.height) 6 | let score= 0; 7 | // ball 8 | let ballX = canvas.width / 2; 9 | let ballY = canvas.height / 2; 10 | let ballRadius = 10; 11 | let ballSpeedX = 2; 12 | let ballSpeedY = 2; 13 | 14 | function drawBall(){ 15 | ctx.beginPath(); 16 | ctx.arc(ballX, ballY, ballRadius, 0, Math.PI * 2); 17 | ctx.fillStyle = "#0395DD"; 18 | ctx.fill(); 19 | ctx.strokeStyle = "#0395DD"; 20 | ctx.stroke(); 21 | ctx.closePath(); 22 | } 23 | 24 | 25 | // paddle 26 | let paddleHeight = 20; 27 | let paddleWidth = 100; 28 | let paddleX = canvas.width/2 - paddleWidth/2; 29 | let paddleY = canvas.height - paddleHeight - 10; 30 | let paddleSpeed = 15; 31 | 32 | function drawPaddle(){ 33 | ctx.beginPath(); 34 | ctx.rect(paddleX, paddleY, paddleWidth, paddleHeight); 35 | ctx.fillStyle = "#0395DD"; 36 | ctx.fill(); 37 | ctx.strokeStyle = "#0395DD"; 38 | ctx.stroke(); 39 | ctx.closePath(); 40 | } 41 | 42 | // Bricks 43 | let brickRowCount = 6; 44 | let brickColumnCount = 10; 45 | let brickWidth = 75; 46 | let brickHeight = 20; 47 | let marginFromTop = 30; 48 | let marginFromLeft = 30; 49 | let brickPadding = 10; 50 | let bricks = []; 51 | for(let c = 0; c < brickColumnCount; c++){ 52 | bricks[c] = []; 53 | for(let r = 0; r < brickRowCount; r++){ 54 | bricks[c][r] = {x: 0, y: 0, alive:1}; 55 | } 56 | } 57 | 58 | function drawBricks(){ 59 | for(let c=0; c < brickColumnCount; c++){ 60 | for(let r=0; r < brickRowCount; r++){ 61 | if( bricks[c][r].alive === 1){ 62 | let brickx = (c * (brickWidth + brickPadding)) + marginFromLeft; 63 | let bricky = (r * (brickHeight + brickPadding)) + marginFromTop; 64 | console.log(brickx, bricky); 65 | bricks[c][r].x = brickx; 66 | bricks[c][r].y = bricky; 67 | ctx.beginPath(); 68 | ctx.rect(brickx, bricky, brickWidth, brickHeight); 69 | ctx.fillStyle = "#0395DD"; 70 | ctx.fill(); 71 | ctx.strokeStyle = "#0395DD"; 72 | } 73 | } 74 | } 75 | } 76 | 77 | function detectCollision(){ 78 | for(let c= 0; c < brickColumnCount; c++){ 79 | for(let r = 0; r < brickRowCount; r++){ 80 | let b = bricks[c][r]; 81 | if( b.alive === 1){ 82 | if( ballX > b.x && ballY > b.y && ballX < b.x + brickWidth && ballY < b.y + brickHeight ){ 83 | bricks[c][r].alive = 0; 84 | ballSpeedY = - ballSpeedY; 85 | score++; 86 | } 87 | } 88 | } 89 | } 90 | } 91 | 92 | //score 93 | function drawScore(){ 94 | ctx.font = "16px Arial"; 95 | ctx.fillStyle = "#0395DD"; 96 | ctx.fillText("Score: "+ score, 800, 20); 97 | } 98 | 99 | 100 | document.addEventListener("keydown", handleKey); 101 | document.addEventListener("keyup", handleKey); 102 | 103 | function handleKey(e){ 104 | console.log(e); 105 | console.log(e.key) 106 | 107 | if( e.key === "ArrowLeft" && paddleX > 0){ 108 | console.log("left"); 109 | paddleX -= paddleSpeed; 110 | } else if( e.key === "ArrowRight" && paddleX + paddleWidth < canvas.width ){ 111 | console.log("right"); 112 | paddleX += paddleSpeed; 113 | } 114 | } 115 | 116 | 117 | function gameStart(){ 118 | ctx.clearRect(0, 0, canvas.width, canvas.height); 119 | drawBall(); 120 | drawPaddle(); 121 | drawBricks(); 122 | drawScore(); 123 | detectCollision(); 124 | console.log("helloo") 125 | 126 | ballX += ballSpeedX; 127 | ballY += ballSpeedY; 128 | if( ballY - ballRadius < 0){ 129 | ballSpeedY = - ballSpeedY; 130 | } 131 | if(ballY + ballRadius > canvas.height){ 132 | document.location.reload(); 133 | } 134 | if(ballX + ballRadius > canvas.width || ballX - ballRadius < 0){ 135 | ballSpeedX = - ballSpeedX; 136 | } 137 | 138 | if( ballX + ballRadius > paddleX && ballY + ballRadius> paddleY && ballX + ballRadius < paddleX + paddleWidth){ 139 | ballSpeedY = - ballSpeedY; 140 | } 141 | 142 | 143 | requestAnimationFrame(gameStart); 144 | } 145 | 146 | gameStart(); -------------------------------------------------------------------------------- /calculator/calculator.css: -------------------------------------------------------------------------------- 1 | * { 2 | padding: 0; 3 | margin: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | body{ 8 | background-color: antiquewhite; 9 | display: flex; 10 | justify-content: center; 11 | align-items: center; 12 | height: 100vh; 13 | } 14 | 15 | .container { 16 | border-radius: 15px; 17 | width: 375px; 18 | height: 500px; 19 | background-color: white; 20 | box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.5); 21 | } 22 | 23 | .result { 24 | width: 100%; 25 | font-size: 4rem; 26 | border: none; 27 | background-color: white; 28 | text-align: right; 29 | font-weight: bold; 30 | padding: 20px; 31 | outline: none; 32 | border-radius: 15px; 33 | } 34 | 35 | button { 36 | border-radius: 50%; 37 | width: 65px; 38 | height: 65px; 39 | font-size: 1.2rem; 40 | border: none; 41 | outline: none; 42 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); 43 | margin: 0 10px 10px 5px; 44 | font-weight: bold; 45 | cursor: pointer; 46 | background-color: white; 47 | } 48 | 49 | button:hover{ 50 | background-color: #e6e6e6; 51 | } 52 | .row { 53 | text-align: center; 54 | } -------------------------------------------------------------------------------- /calculator/calculator.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Calculator using HTML CSS JS 7 | 8 | 9 | 10 | 11 |
12 |
13 | 14 |
15 |
16 | 19 | 22 | 25 | 28 |
29 |
30 | 33 | 36 | 39 | 42 |
43 |
44 | 47 | 50 | 53 | 56 |
57 |
58 | 61 | 64 | 67 | 70 |
71 |
72 | 75 | 78 | 81 | 84 |
85 |
86 | 87 | 90 | 91 | -------------------------------------------------------------------------------- /calculator/calculator.js: -------------------------------------------------------------------------------- 1 | const output = document.querySelector('.result'); 2 | const buttons = document.querySelectorAll('button'); 3 | console.log("buttons", buttons) 4 | console.log("output", output) 5 | let str = ''; 6 | buttons.forEach((button) => { 7 | button.addEventListener('click', (e) => { 8 | console.log("e.target.textContent", e.target.textContent.trim()) 9 | if( e.target.textContent.trim() === 'AC'){ 10 | str = '' 11 | output.value = str; 12 | }else if( e.target.textContent.trim() === '='){ 13 | str = eval(str); 14 | output.value = str; 15 | }else if( e.target.textContent.trim() === 'DEL'){ 16 | str = str.substring(0, str.length - 1); 17 | output.value = str; 18 | }else { 19 | str += e.target.textContent.trim(); 20 | output.value = str; 21 | } 22 | }); 23 | }); -------------------------------------------------------------------------------- /captcha-generator/index.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | body { 8 | background-color: lightblue; 9 | display: flex; 10 | justify-content: center; 11 | align-items: center; 12 | height: 100vh; 13 | } 14 | 15 | .container { 16 | width: 400px; 17 | border-radius: 10px; 18 | background-color: white; 19 | text-align: center; 20 | box-shadow: 0 0 0 5px 0 rgba(0,0,0,0.5); 21 | } 22 | 23 | .header { 24 | background-color: blueviolet; 25 | color: white; 26 | padding: 20px; 27 | margin-bottom: 10px; 28 | border-radius: 10px 10px 0 0; 29 | } 30 | 31 | .captcha { 32 | font-size: 2rem; 33 | font-weight: bold; 34 | margin-bottom: 10px; 35 | } 36 | 37 | input { 38 | width: 90%; 39 | padding: 10px; 40 | font-size: 1.2rem; 41 | margin-bottom: 10px; 42 | } 43 | 44 | button { 45 | border: none; 46 | font-size: 1.2rem; 47 | background-color: blueviolet; 48 | color: white; 49 | padding: 10px; 50 | border-radius: 5px; 51 | margin-bottom: 10px; 52 | margin: 10px; 53 | 54 | } -------------------------------------------------------------------------------- /captcha-generator/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Captcha Generator 7 | 8 | 9 | 10 |
11 |
12 |

13 | Captcha Generator 14 |

15 |
16 |
17 | A22#B1 18 |
19 |
20 | 21 |
22 |
23 | 28 | 33 |
34 |
35 | 38 | 39 | -------------------------------------------------------------------------------- /captcha-generator/index.js: -------------------------------------------------------------------------------- 1 | const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; 2 | const captcha = document.querySelector(".captcha") 3 | const input = document.querySelector("#input") 4 | const submit = document.querySelector("#submit") 5 | const refresh = document.querySelector("#refresh") 6 | 7 | submit.addEventListener("click",()=>{ 8 | const inpval = input.value; 9 | const captchaval = captcha.textContent.trim(); 10 | console.log(inpval) 11 | console.log(captchaval) 12 | if( inpval == captchaval ){ 13 | alert("Captcha is Matched") 14 | }else { 15 | alert("Captcha is not Matched") 16 | } 17 | }) 18 | 19 | 20 | refresh.addEventListener("click",()=>{ 21 | captcha.textContent = generateCaptcha(); 22 | }) 23 | function generateCaptcha(){ 24 | let captcha_gen = ""; 25 | for(let i=0;i<6;i++){ 26 | captcha_gen+= chars[Math.floor(Math.random()*chars.length)] 27 | } 28 | return captcha_gen 29 | } 30 | 31 | console.log(generateCaptcha()) -------------------------------------------------------------------------------- /character-count/charactor-count.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | body { 8 | background-color: antiquewhite; 9 | display: flex; 10 | justify-content: center; 11 | align-items: center; 12 | height: 100vh; 13 | } 14 | 15 | .container { 16 | box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.5); 17 | width: 400px; 18 | text-align: center; 19 | padding: 15px; 20 | border-radius: 10px; 21 | background-color: white; 22 | } 23 | 24 | .header { 25 | margin-bottom: 10px; 26 | } 27 | 28 | textarea { 29 | width: 100%; 30 | border-radius: 10px; 31 | padding: 10px; 32 | outline: none; 33 | margin-bottom: 10px; 34 | } 35 | 36 | .count { 37 | display: flex; 38 | justify-content: space-between; 39 | } 40 | 41 | #total_char, #remaining_char { 42 | font-size: 20px; 43 | color: red; 44 | } -------------------------------------------------------------------------------- /character-count/charactor-count.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Charactor Counter Project 7 | 8 | 9 | 10 |
11 |
12 | 13 |
14 |
15 | 16 |
17 |
18 |

19 | Total characters: 20 | 0 21 | 22 |

23 |

24 | Remaining characters: 25 | 26 | 50 27 | 28 |

29 |
30 |
31 | 32 | 35 | 36 | -------------------------------------------------------------------------------- /character-count/charactor-count.js: -------------------------------------------------------------------------------- 1 | const text = document.querySelector('#text') 2 | const total_char = document.querySelector('#total_char') 3 | const remaining_char = document.querySelector('#remaining_char') 4 | 5 | 6 | text.addEventListener("input",()=>{ 7 | const total = text.value.length 8 | total_char.innerText = total 9 | remaining_char.innerText = 50 - total 10 | 11 | if( total === 50){ 12 | text.disabled = true 13 | }else { 14 | text.disabled = false 15 | } 16 | }) 17 | -------------------------------------------------------------------------------- /counter/counter.css: -------------------------------------------------------------------------------- 1 | * { 2 | padding: 0; 3 | margin: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | body { 8 | background-color: antiquewhite; 9 | display: flex; 10 | justify-content: center; 11 | align-items: center; 12 | height: 100vh; 13 | } 14 | 15 | .container { 16 | background-color: white; 17 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); 18 | text-align: center; 19 | width: 300px; 20 | padding: 20px; 21 | border-radius: 10px; 22 | } 23 | 24 | .header h1{ 25 | font-size: 30px; 26 | font-weight: 600; 27 | margin-bottom: 10px; 28 | } 29 | 30 | .counter-header { 31 | font-size: 50px; 32 | font-weight: 700; 33 | margin-bottom: 10px; 34 | } 35 | 36 | button { 37 | border: none; 38 | outline: none; 39 | font-size: 20px; 40 | margin: 5px; 41 | padding: 10px 20px; 42 | border-radius: 5px; 43 | cursor: pointer; 44 | font-weight: bolder; 45 | } 46 | 47 | #sub { 48 | background-color: red; 49 | color: white; 50 | } 51 | 52 | #add { 53 | background-color: blue; 54 | color: white; 55 | } 56 | 57 | #reset { 58 | background-color: green; 59 | color: white; 60 | } -------------------------------------------------------------------------------- /counter/counter.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Counter Project 7 | 8 | 9 | 10 | 11 |
12 |
13 |

14 | Counter 15 |

16 |
17 |
18 |

0

21 |
22 | 23 |
24 | 25 | 26 | 27 |
28 | 29 | 30 |
31 | 34 | 35 | -------------------------------------------------------------------------------- /counter/counter.js: -------------------------------------------------------------------------------- 1 | const count = document.querySelector('#count'); 2 | const sub = document.querySelector('#sub'); 3 | const add = document.querySelector('#add'); 4 | const reset = document.querySelector('#reset'); 5 | 6 | let counter = 0; 7 | 8 | sub.addEventListener('click', () => { 9 | counter--; 10 | count.innerHTML = counter; 11 | }); 12 | 13 | add.addEventListener('click', () => { 14 | counter++; 15 | count.innerHTML = counter; 16 | }); 17 | 18 | reset.addEventListener('click', () => { 19 | counter = 0; 20 | count.innerHTML = counter; 21 | }); -------------------------------------------------------------------------------- /dad-jokes/dadjoke.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | body { 8 | background-color: antiquewhite; 9 | display: flex; 10 | justify-content: center; 11 | align-items: center; 12 | height: 100vh; 13 | } 14 | 15 | .container { 16 | width: 470px; 17 | box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.5); 18 | text-align: center; 19 | border-radius: 10px; 20 | padding: 15px; 21 | background-color: #fff; 22 | } 23 | 24 | .header { 25 | margin-bottom: 10px; 26 | } 27 | 28 | #joke { 29 | font-size: 1.5rem; 30 | margin-bottom: 10px; 31 | } 32 | 33 | button { 34 | padding: 10px 20px; 35 | border-radius: 5px; 36 | border: none; 37 | background-color: #f44336; 38 | color: #fff; 39 | font-size: 1rem; 40 | cursor: pointer; 41 | } -------------------------------------------------------------------------------- /dad-jokes/dadjoke.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Dad Joke Generator 7 | 8 | 9 | 10 |
11 | 12 |
13 |

Dad Joke Generator

14 |
15 | 16 |
17 | 18 |

19 | What's Forrest Gump's computer password? 1forrest1 20 |

21 | 22 |
23 | 24 |
25 | 28 |
29 | 30 |
31 | 32 | 35 | 36 | -------------------------------------------------------------------------------- /dad-jokes/dadjoke.js: -------------------------------------------------------------------------------- 1 | const joke = document.querySelector('#joke'); 2 | const jokeBtn = document.querySelector('#get-joke'); 3 | 4 | 5 | async function generateJoke(){ 6 | const header = { 7 | headers: { 'X-Api-Key': 'APUFhJBLuaMPjcJswqx9Tw==5oDPPS7wbSQfev4D'} 8 | } 9 | const url = `https://api.api-ninjas.com/v1/dadjokes?limit=1` 10 | let dadjoke = await fetch(url, header); 11 | dadjoke = await dadjoke.json(); 12 | console.log(dadjoke,"dad joke"); 13 | console.log(dadjoke[0]) 14 | console.log(dadjoke[0].joke) 15 | joke.innerHTML = dadjoke[0].joke; 16 | 17 | } 18 | 19 | 20 | jokeBtn.addEventListener('click', generateJoke); -------------------------------------------------------------------------------- /dictionary-app/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "liveServer.settings.port": 5502 3 | } -------------------------------------------------------------------------------- /dictionary-app/dictionary.css: -------------------------------------------------------------------------------- 1 | * { 2 | padding: 0; 3 | margin: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | body { 8 | background-color: antiquewhite; 9 | display: flex; 10 | justify-content: center; 11 | align-items: center; 12 | height: 100vh; 13 | } 14 | 15 | .container { 16 | background-color: white; 17 | box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.2); 18 | width: 450px; 19 | text-align: center; 20 | border-radius: 10px; 21 | padding: 15px; 22 | position: relative; 23 | } 24 | 25 | .header { 26 | position: absolute; 27 | top: -50%; 28 | color: #892BE2; 29 | font-size: 1.5rem; 30 | left:25%; 31 | } 32 | 33 | #input { 34 | display: block; 35 | width: 100%; 36 | padding: 10px; 37 | border: 1px solid #ccc; 38 | border-radius: 5px; 39 | margin-bottom: 10px; 40 | font-size: 1rem; 41 | outline: none; 42 | } 43 | 44 | #input:focus { 45 | border-color: #892BE2; 46 | } 47 | 48 | #search { 49 | background-color: #892BE2; 50 | color: white; 51 | border: none; 52 | padding: 10px 20px; 53 | border-radius: 5px; 54 | font-size: 1rem; 55 | cursor: pointer; 56 | margin-bottom: 10px; 57 | } -------------------------------------------------------------------------------- /dictionary-app/dictionary.js: -------------------------------------------------------------------------------- 1 | const input = document.querySelector('#input'); 2 | const output = document.querySelector('#meaning'); 3 | const search = document.querySelector('#search'); 4 | 5 | search.addEventListener('click', async() => { 6 | const val = input.value; 7 | if( val === ""){ 8 | alert("Please enter a word"); 9 | }else { 10 | const url = `https://api.dictionaryapi.dev/api/v2/entries/en/${val}`; 11 | let meaning = await fetch(url); 12 | meaning = await meaning.json(); 13 | console.log("meaning",meaning[0]['meanings'][0]["definitions"][0]["definition"]) 14 | output.textContent = meaning[0]['meanings'][0]["definitions"][0]["definition"]; 15 | } 16 | }); -------------------------------------------------------------------------------- /dictionary-app/dictonary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Dictionary APP 7 | 8 | 9 | 10 | 11 |
12 |
13 |

14 | Dictionary 15 |

16 |
17 | 21 |
22 |

23 | Meaning will be displayed here... 24 |

25 |
26 |
27 | 28 | 31 | 32 | -------------------------------------------------------------------------------- /digital-clock/clock.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin:0; 3 | padding:0; 4 | box-sizing:border-box; 5 | } 6 | 7 | body{ 8 | background-color: antiquewhite; 9 | display: flex; 10 | justify-content: center; 11 | align-items: center; 12 | height: 100vh; 13 | } 14 | 15 | .container { 16 | border: 1px solid blue; 17 | border-radius: 10px; 18 | box-shadow: 0 0 10px rgba(0,0,0,0.5); 19 | width: 250px; 20 | background-color: white; 21 | text-align: center; 22 | } 23 | 24 | .header { 25 | background-color: blue; 26 | padding: 10px; 27 | font-size: 1.2rem; 28 | color:white; 29 | } 30 | 31 | .timer { 32 | font-size: 3rem; 33 | font-weight: bold; 34 | padding: 10px; 35 | } -------------------------------------------------------------------------------- /digital-clock/clock.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Clock using Javascript 7 | 8 | 9 | 10 |
11 |
12 |

13 | Digital Clock 14 |

15 |
16 |
17 | 00:00:00 18 |
19 |
20 | 23 | 24 | -------------------------------------------------------------------------------- /digital-clock/clock.js: -------------------------------------------------------------------------------- 1 | const timer = document.querySelector('.timer'); 2 | 3 | console.log(timer,"timer"); 4 | 5 | function getTime() { 6 | console.log("getTime"); 7 | const now = new Date(); 8 | console.log(now,"now"); 9 | let h = now.getHours(); 10 | let m = now.getMinutes(); 11 | let s = now.getSeconds(); 12 | console.log(h,m,s); 13 | h = h < 10 ? "0" + h : h; 14 | m = m < 10 ? "0" + m : m; 15 | s = s < 10 ? "0" + s : s; 16 | const timerstr = h + ":" + m + ":" + s; 17 | timer.textContent = timerstr; 18 | } 19 | 20 | setInterval(getTime, 1000); -------------------------------------------------------------------------------- /drap-n-drop/dragndrop.js: -------------------------------------------------------------------------------- 1 | const empties = document.querySelectorAll(".empty"); 2 | const box = document.querySelector(".img-box"); 3 | 4 | console.log("empties",empties) 5 | console.log("box",box) 6 | 7 | 8 | box.addEventListener("dragstart", dragStart) 9 | box.addEventListener("dragend", dragEnd) 10 | 11 | function dragStart(){ 12 | console.log("drag start") 13 | } 14 | 15 | function dragEnd(){ 16 | console.log("drag end") 17 | } 18 | 19 | // drag enter 20 | function dragEnter(e){ 21 | e.preventDefault(); 22 | this.classList.add("hold") 23 | console.log("drag enter") 24 | } 25 | 26 | // drag leave 27 | function dragLeave(){ 28 | this.classList.remove("hold") 29 | console.log("drag leave") 30 | } 31 | 32 | // drag over 33 | function dragOver(e){ 34 | e.preventDefault(); 35 | console.log("dragOver") 36 | } 37 | 38 | 39 | function drop(){ 40 | this.classList.remove("hold") 41 | this.appendChild(box) 42 | console.log("drop") 43 | } 44 | 45 | for( let empty of empties){ 46 | empty.addEventListener("dragenter",dragEnter) 47 | empty.addEventListener("dragover",dragOver) 48 | empty.addEventListener("dragleave",dragLeave) 49 | empty.addEventListener("drop",drop) 50 | } -------------------------------------------------------------------------------- /drap-n-drop/drapndrop.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | body { 8 | background-color: antiquewhite; 9 | display: flex; 10 | justify-content: center; 11 | align-items: center; 12 | height: 100vh; 13 | } 14 | 15 | .container { 16 | display: flex; 17 | width: 800px; 18 | } 19 | 20 | .empty { 21 | width: 150px; 22 | height: 150px; 23 | border: 2px solid black; 24 | background-color: white; 25 | margin: 10px; 26 | } 27 | 28 | .img-box { 29 | background-image: url("https://source.unsplash.com/random/?animal&1"); 30 | background-size: cover; 31 | width: 150px; 32 | height: 150px; 33 | cursor: pointer; 34 | } 35 | 36 | .hold { 37 | border: 5px dashed black; 38 | background-color: grey; 39 | } -------------------------------------------------------------------------------- /drap-n-drop/drapndrop.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Drop N Drop Projects 7 | 8 | 9 | 10 | 11 |
12 |
13 |
14 |
15 |
16 |
17 | 18 |
19 |
20 | 21 | 24 | 25 | -------------------------------------------------------------------------------- /emi-calculator/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "liveServer.settings.port": 5502 3 | } -------------------------------------------------------------------------------- /emi-calculator/emi-calculator.css: -------------------------------------------------------------------------------- 1 | * { 2 | padding: 0; 3 | margin: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | body { 8 | background-color: antiquewhite; 9 | display: flex; 10 | justify-content: center; 11 | align-items: center; 12 | height: 100vh; 13 | } 14 | 15 | .container { 16 | width: 400px; 17 | background-color: white; 18 | text-align: center; 19 | border-radius: 10px; 20 | box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.5); 21 | padding: 20px; 22 | } 23 | 24 | .header { 25 | font-size: 16px; 26 | font-weight: 600; 27 | margin-bottom: 20px; 28 | } 29 | 30 | .load-amount-info, .interest-rate-info, .months-to-pay-info { 31 | display: block; 32 | margin-bottom: 10px; 33 | font-size: 20px; 34 | } 35 | 36 | input { 37 | width: 100%; 38 | padding: 10px; 39 | margin-bottom: 10px; 40 | border-radius: 5px; 41 | border: none; 42 | box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.5); 43 | } 44 | 45 | button { 46 | width: 120px; 47 | padding: 10px; 48 | font-size: 16px; 49 | border: none; 50 | background-color: red; 51 | color: white; 52 | border-radius: 5px; 53 | margin-bottom: 10px; 54 | } 55 | 56 | .result { 57 | font-size: 20px; 58 | font-weight: 600; 59 | margin-bottom: 10px; 60 | } 61 | 62 | #emi { 63 | color: red; 64 | } -------------------------------------------------------------------------------- /emi-calculator/emi-calculator.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Emi Calculator 7 | 8 | 9 | 10 |
11 |
12 |

13 | Emi Calculator 14 |

15 |
16 |
17 | 18 | Loan Amount 19 | 20 | 21 |
22 | 23 |
24 | 25 | Interest Rate 26 | 27 | 28 |
29 |
30 | 31 | Months to Pay 32 | 33 | 34 |
35 | 36 |
37 | 40 |
41 | 42 |
43 |

44 | Your EMI is 45 |

46 |
47 | 48 |
49 | 50 | 54 | 55 | -------------------------------------------------------------------------------- /emi-calculator/emi-calculator.js: -------------------------------------------------------------------------------- 1 | const principal = document.querySelector('#load-amount-input'); 2 | const interest = document.querySelector('#interest-rate-input'); 3 | const tenure = document.querySelector('#months-to-pay-input'); 4 | const calculate = document.querySelector('#calculate'); 5 | const emi = document.querySelector('#emi'); 6 | console.log(principal, interest, tenure); 7 | 8 | function calculateEMI() { 9 | if( principal.value === '' || interest.value === '' || tenure.value === '') { 10 | alert('Please enter all the values'); 11 | return; 12 | }else{ 13 | const p = principal.value; 14 | const r = interest.value / 1200; 15 | const n = tenure.value; 16 | const emiValue = (p * r * (1 + r) ** n) / ((1 + r) ** n - 1); 17 | emi.textContent = emiValue.toFixed(2); 18 | } 19 | } 20 | 21 | calculate.addEventListener('click', calculateEMI); 22 | -------------------------------------------------------------------------------- /expanding-cards/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arbazkhan971/html-css-javascript-projects/da9fa39a8e800b46cdc58640810e158a6f031ef5/expanding-cards/.DS_Store -------------------------------------------------------------------------------- /expanding-cards/cards.css: -------------------------------------------------------------------------------- 1 | * { 2 | padding: 0; 3 | margin: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | .container{ 8 | display: flex; 9 | height: 100vh; 10 | justify-content: center; 11 | align-items: center; 12 | } 13 | 14 | .inner-container{ 15 | margin:10px; 16 | width:20%; 17 | height: 90vh; 18 | border-radius: 25px; 19 | background: white no-repeat scroll center; 20 | flex:1; 21 | filter: grayscale(1); 22 | transition: flex 0.5s ease-in-out; 23 | } 24 | 25 | .inner-container h3{ 26 | color: white; 27 | font-size: 24px; 28 | background: rgba(0,0,0,0.5); 29 | text-align: center; 30 | padding: 10px; 31 | } 32 | 33 | .active{ 34 | flex:3; 35 | filter: grayscale(0); 36 | 37 | } 38 | #inner-container-1{ 39 | background-image: url("image/mumbai.jpg"); 40 | } 41 | 42 | #inner-container-2{ 43 | background-image: url("image/quebec.jpg"); 44 | } 45 | 46 | #inner-container-3{ 47 | background-image: url("image/bangkok.jpg"); 48 | } 49 | 50 | #inner-container-4{ 51 | background-image: url("image/spain.jpg"); 52 | } 53 | 54 | #inner-container-5{ 55 | background-image: url("image/tokyo.jpg"); 56 | } 57 | -------------------------------------------------------------------------------- /expanding-cards/cards.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Expanding Cards 7 | 8 | 9 | 10 | 11 | 12 |
13 |
14 |

Mumbai

15 |
16 |
17 |

Quebec

18 |
19 |
20 |

Bangkok

21 |
22 |
23 |

Spain

24 |
25 |
26 |

Tokyo

27 |
28 |
29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /expanding-cards/cards.js: -------------------------------------------------------------------------------- 1 | const cards = document.querySelectorAll('.inner-container'); 2 | 3 | function removeActiveClasses() { 4 | cards.forEach(card => { 5 | card.classList.remove("active") 6 | }); 7 | } 8 | cards.forEach(card => { 9 | card.addEventListener('click', () => { 10 | removeActiveClasses(); 11 | card.classList.add("active") 12 | }); 13 | }) 14 | 15 | -------------------------------------------------------------------------------- /expanding-cards/image/bangkok.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arbazkhan971/html-css-javascript-projects/da9fa39a8e800b46cdc58640810e158a6f031ef5/expanding-cards/image/bangkok.jpg -------------------------------------------------------------------------------- /expanding-cards/image/mumbai.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arbazkhan971/html-css-javascript-projects/da9fa39a8e800b46cdc58640810e158a6f031ef5/expanding-cards/image/mumbai.jpg -------------------------------------------------------------------------------- /expanding-cards/image/quebec.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arbazkhan971/html-css-javascript-projects/da9fa39a8e800b46cdc58640810e158a6f031ef5/expanding-cards/image/quebec.jpg -------------------------------------------------------------------------------- /expanding-cards/image/spain.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arbazkhan971/html-css-javascript-projects/da9fa39a8e800b46cdc58640810e158a6f031ef5/expanding-cards/image/spain.jpg -------------------------------------------------------------------------------- /expanding-cards/image/tokyo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arbazkhan971/html-css-javascript-projects/da9fa39a8e800b46cdc58640810e158a6f031ef5/expanding-cards/image/tokyo.jpg -------------------------------------------------------------------------------- /github-contribution-graph/index.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | body { 8 | background-color: #E9E9E9; 9 | display: flex; 10 | justify-content: center; 11 | align-items: center; 12 | height: 100vh; 13 | } 14 | 15 | .container { 16 | background-color: white; 17 | height: 145px; 18 | width: 1200px; 19 | display: flex; 20 | flex-wrap: wrap; 21 | flex-direction: column; 22 | border-radius: 5px; 23 | box-shadow: 0 0 5px 0 rgba(0,0,0,0.5); 24 | } 25 | 26 | .square { 27 | width: 16px; 28 | height: 16px; 29 | /* background-color: lightgreen; */ 30 | margin: 2px; 31 | border-radius: 2px; 32 | box-shadow: 0 0 2px 0 rgba(0,0,0,0.3); 33 | border: 1px solid #E9E9E9; 34 | } -------------------------------------------------------------------------------- /github-contribution-graph/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Github graph 7 | 8 | 9 | 10 | 11 |
12 |
13 | 16 | 17 | -------------------------------------------------------------------------------- /github-contribution-graph/index.js: -------------------------------------------------------------------------------- 1 | const cont = document.querySelector(".container") 2 | console.log(cont) 3 | const colors = ["#196127","#219A3A","#EAEDF0","#C6E48B","#7BC96F"] 4 | let square_count = 365; 5 | for(let i= 0;i< 365;i++){ 6 | const square = document.createElement("div") 7 | square.classList.add("square") 8 | square.style.backgroundColor = randomColor(colors) 9 | cont.appendChild(square) 10 | } 11 | function randomColor(colors){ 12 | return colors[Math.floor(Math.random()*colors.length)] 13 | } 14 | 15 | -------------------------------------------------------------------------------- /hidden-search/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "liveServer.settings.port": 5501 3 | } -------------------------------------------------------------------------------- /hidden-search/hidden-search.css: -------------------------------------------------------------------------------- 1 | * { 2 | padding: 0; 3 | margin: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | body { 8 | background-color: wheat; 9 | } 10 | 11 | .container{ 12 | display: flex; 13 | justify-content: center; 14 | align-items: center; 15 | height: 100vh; 16 | } 17 | 18 | .search-container{ 19 | height : 50px; 20 | position: relative; 21 | } 22 | 23 | .input{ 24 | height: 50px; 25 | padding: 10px; 26 | border-radius: 50px; 27 | width: 0; 28 | background: transparent; 29 | border: 0; 30 | } 31 | 32 | .button{ 33 | height: 50px; 34 | width: 50px; 35 | border-radius: 50%; 36 | background-color: beige; 37 | position: absolute; 38 | top: 0; 39 | left: 0; 40 | 41 | } 42 | 43 | .active .input{ 44 | width: 300px; 45 | padding: 10px; 46 | background-color: white; 47 | } 48 | 49 | .input:focus{ 50 | outline: none; 51 | } 52 | 53 | .active .button{ 54 | background-color: beige; 55 | transform: translate(250px); 56 | } -------------------------------------------------------------------------------- /hidden-search/hidden-search.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Hidden Search Bar 7 | 8 | 9 | 10 | 11 |
12 |
13 | 14 | 17 |
18 |
19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /hidden-search/hidden-search.js: -------------------------------------------------------------------------------- 1 | const search = document.querySelector('.search-container'); 2 | const searchInput = document.querySelector('.input'); 3 | const searchIcon = document.querySelector('.button'); 4 | 5 | console.log(search.classList); 6 | searchIcon.addEventListener("click",()=>{ 7 | // if( search.classList.contains('active') ){ 8 | // search.classList.remove('active'); 9 | // }else{ 10 | // search.classList.add('active'); 11 | // searchInput.focus(); 12 | // } 13 | search.classList.toggle('active'); 14 | searchInput.focus(); 15 | }) -------------------------------------------------------------------------------- /hoverboard/index.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | 8 | body { 9 | background-color: black; 10 | display: flex; 11 | justify-content: center; 12 | align-items: center; 13 | height: 100vh; 14 | } 15 | 16 | .container { 17 | width: 280px; 18 | height: 500px; 19 | display: flex; 20 | flex-wrap: wrap; 21 | flex-direction: column; 22 | } 23 | 24 | .square { 25 | width: 16px; 26 | height: 16px; 27 | border-radius: 2px; 28 | margin: 2px; 29 | box-shadow: 0 0 2px 0 rbga(0,0,0,0.3); 30 | background-color: #1D1D1D; 31 | transition: 3s ease; 32 | } 33 | 34 | .square:hover{ 35 | transition-duration: 0ms; 36 | } -------------------------------------------------------------------------------- /hoverboard/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Hoverboard 7 | 8 | 9 | 10 |
11 |
12 | 15 | 16 | -------------------------------------------------------------------------------- /hoverboard/index.js: -------------------------------------------------------------------------------- 1 | const container = document.querySelector(".container") 2 | const n_of_square = 500; 3 | const colors = ["green","orange","yellow","red","violet","pink"]; 4 | 5 | function randomC(colors){ 6 | return colors[Math.floor(Math.random()*colors.length)] 7 | } 8 | 9 | function setColor(element){ 10 | element.style.backgroundColor = randomC(colors); 11 | } 12 | 13 | function unsetColor(element){ 14 | element.style.backgroundColor = "#1D1D1D"; 15 | element.style.boxShadow = "0 0 2px 0 rbga(0,0,0,0.3)"; 16 | } 17 | 18 | for(let i=0;i{ 22 | setColor(square) 23 | }) 24 | square.addEventListener("mouseout",()=>{ 25 | unsetColor(square) 26 | }) 27 | container.appendChild(square) 28 | } -------------------------------------------------------------------------------- /image-crousel/index.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | body { 8 | background-color: lightblue; 9 | display: flex; 10 | justify-content: center; 11 | align-items: center; 12 | height: 100vh; 13 | } 14 | 15 | .container { 16 | width: 500px; 17 | height: 460px; 18 | overflow: hidden; 19 | } 20 | 21 | .image-container { 22 | display: flex; 23 | margin-bottom: 10px; 24 | width: 500px; 25 | height: 400px; 26 | /* overflow: hidden; */ 27 | } 28 | 29 | img { 30 | width: 500px; 31 | height: 400px; 32 | border-radius: 10px; 33 | transition: 1s ease; 34 | } 35 | 36 | .button-container { 37 | display: flex; 38 | justify-content: space-between; 39 | } 40 | 41 | button { 42 | width: 49.5%; 43 | padding: 10px 20px; 44 | border: none; 45 | outline: none; 46 | font-size: 1.2rem; 47 | background-color: black; 48 | color: white; 49 | border-radius: 10px; 50 | } 51 | 52 | button:hover{ 53 | opacity: 0.7; 54 | } -------------------------------------------------------------------------------- /image-crousel/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Image Crousel 7 | 8 | 9 | 10 | 11 |
12 |
13 | random images 14 | random images 15 | random images 16 | random images 17 | random images 18 |
19 |
20 | 25 | 30 |
31 |
32 | 33 | 36 | 37 | -------------------------------------------------------------------------------- /image-crousel/index.js: -------------------------------------------------------------------------------- 1 | const container = document.querySelector(".image-container") 2 | const prev = document.querySelector("#prev") 3 | const next = document.querySelector("#next") 4 | 5 | let count = 0; 6 | let width = 500; 7 | 8 | prev.addEventListener("click",()=>{ 9 | console.log(count) 10 | if(count > 0){ 11 | count--; 12 | container.style.transform = `translateX(-${width*count}px)` 13 | } 14 | }) 15 | 16 | next.addEventListener("click",()=>{ 17 | console.log("inside next") 18 | console.log(count) 19 | if(count < 4){ 20 | count++; 21 | container.style.transform = `translateX(-${width*count}px)` 22 | } 23 | 24 | }) -------------------------------------------------------------------------------- /image-gallary/image-gallery.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | body { 8 | background-color: antiquewhite; 9 | display: flex; 10 | justify-content: center; 11 | align-items: center; 12 | height: 100vh; 13 | } 14 | 15 | .container { 16 | position: absolute; 17 | width: 350px; 18 | box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.5); 19 | border-radius: 10px; 20 | padding: 10px; 21 | text-align: center; 22 | background-color: white; 23 | } 24 | 25 | .header { 26 | font-size: 1.5rem; 27 | margin-bottom: 10px; 28 | } 29 | 30 | label { 31 | display: block; 32 | margin-bottom: 10px; 33 | } 34 | 35 | input { 36 | margin-bottom: 10px; 37 | padding: 5px; 38 | border-radius: 5px; 39 | font-size: 1rem; 40 | } 41 | 42 | button { 43 | padding: 5px 10px; 44 | border-radius: 5px; 45 | font-size: 1rem; 46 | cursor: pointer; 47 | color: white; 48 | background-color: black; 49 | } 50 | 51 | .img-container { 52 | display: flex; 53 | flex-wrap: wrap; 54 | justify-content: center; 55 | margin-top: 10px; 56 | } -------------------------------------------------------------------------------- /image-gallary/image-gallery.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Image Gallery 7 | 8 | 9 | 10 |
11 |
12 |

13 | Image Gallery 14 |

15 |
16 | 17 |
18 | 20 | 21 |
22 |
23 | 26 |
27 | 28 |
29 |
30 | 31 |
32 | 35 | 36 | -------------------------------------------------------------------------------- /image-gallary/image-gallery.js: -------------------------------------------------------------------------------- 1 | // picsum.photos/200/300/?random/1 2 | 3 | const input = document.querySelector('#input'); 4 | const submit = document.querySelector('#submit'); 5 | const imgContainer = document.querySelector('.img-container'); 6 | submit.addEventListener('click', async function() { 7 | const count = input.value; 8 | console.log(count) 9 | if( count < 1 || count > 100) { 10 | alert('Please enter a number between 1 and 10'); 11 | }else { 12 | for( let i=0;i < count;i++) { 13 | const img = document.createElement('img'); 14 | img.src = `https://picsum.photos/200/300/?random/${i}`; 15 | imgContainer.appendChild(img); 16 | } 17 | } 18 | }); -------------------------------------------------------------------------------- /image-search/imagesearch.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | .header { 8 | background-color: #333333; 9 | text-align: center; 10 | padding: 20px; 11 | } 12 | 13 | .header h1 { 14 | color: white; 15 | font-size: 40px; 16 | } 17 | 18 | .search-bar { 19 | margin: 20px auto; 20 | width: 100%; 21 | text-align: center; 22 | } 23 | 24 | input { 25 | width: 50%; 26 | padding: 10px; 27 | border: 1px solid #333333; 28 | border-radius: 5px; 29 | font-size: 18px; 30 | outline: none; 31 | } 32 | 33 | button { 34 | padding: 10px; 35 | border: 1px solid blue; 36 | border-radius: 5px; 37 | font-size: 18px; 38 | background-color: blue; 39 | color: white; 40 | cursor: pointer; 41 | } 42 | 43 | .img-container { 44 | display: flex; 45 | flex-wrap: wrap; 46 | justify-content: center; 47 | } 48 | 49 | img { 50 | width: 200px; 51 | height: 200px; 52 | margin: 10px; 53 | } -------------------------------------------------------------------------------- /image-search/imagesearch.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Image Search App 7 | 8 | 9 | 10 |
11 |
12 |

Image Search App

13 |
14 | 18 |
19 |
20 | 21 |
22 | 25 | 26 | -------------------------------------------------------------------------------- /image-search/imagesearch.js: -------------------------------------------------------------------------------- 1 | const search = document.querySelector('#search') 2 | const search_btn = document.querySelector('#search-btn') 3 | const img_container = document.querySelector('.img-container') 4 | 5 | 6 | search_btn.addEventListener('click', async () => { 7 | const search_value = search.value 8 | console.log(search_value,"search_value") 9 | if ( search_value === '' ) { 10 | alert('Please enter a search term') 11 | return 12 | }else { 13 | const key = 'RuJTeKhXAyF9G-9VlCJJv1NlEMuCgGCDgIS-2Brjv3E' 14 | const url = `https://api.unsplash.com/search/photos?page=1&query=${search_value}&client_id=${key}` 15 | let data = await fetch(url) 16 | data = await data.json() 17 | console.log(data,"data") 18 | displayImages(data) 19 | } 20 | }) 21 | 22 | function displayImages(data){ 23 | img_container.innerHTML = '' 24 | data.results.forEach(element => { 25 | console.log(element.urls.regular,"element.urls.regular") 26 | const img = document.createElement('img') 27 | img.src=element.urls.regular 28 | img_container.appendChild(img) 29 | }); 30 | } -------------------------------------------------------------------------------- /image-slide/image-slider.css: -------------------------------------------------------------------------------- 1 | * { 2 | padding: 0; 3 | margin: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | body { 8 | background-color: antiquewhite; 9 | display: flex; 10 | justify-content: center; 11 | align-items: center; 12 | height: 100vh; 13 | } 14 | 15 | .container { 16 | width: 500px; 17 | height: 300px; 18 | overflow: hidden; 19 | border-radius: 10px; 20 | box-shadow: 0 0 10px 0 rgba(0,0,0,0.5); 21 | } 22 | 23 | .img-container { 24 | display: flex; 25 | } 26 | 27 | .btn { 28 | font-size: 50px; 29 | color: white; 30 | opacity: .9; 31 | position: absolute; 32 | top:48%; 33 | } 34 | 35 | .prev { 36 | right: 60%; 37 | } 38 | 39 | .next { 40 | left: 60%; 41 | } -------------------------------------------------------------------------------- /image-slide/image-slider.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Image Slider 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 |
30 | 33 | 34 | -------------------------------------------------------------------------------- /image-slide/image-slider.js: -------------------------------------------------------------------------------- 1 | const prev = document.querySelector(".prev") 2 | const next = document.querySelector(".next") 3 | 4 | const imgContainer = document.querySelector(".img-container") 5 | 6 | let count = 0; 7 | let widht = 500; 8 | 9 | prev.addEventListener("click",()=>{ 10 | console.log("clicked prev") 11 | if ( count > 0){ 12 | count--; 13 | imgContainer.style.transform = `translateX(-${count*widht}px)`; 14 | } 15 | 16 | 17 | }) 18 | 19 | next.addEventListener("click",()=>{ 20 | console.log("clicked next") 21 | if(count < 5){ 22 | count++; 23 | imgContainer.style.transform = `translateX(-${count*widht}px)`; 24 | } 25 | 26 | }) -------------------------------------------------------------------------------- /increment-counter/incrementcounter.css: -------------------------------------------------------------------------------- 1 | * { 2 | padding: 0; 3 | margin: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | body { 8 | background-color: antiquewhite; 9 | height: 100vh; 10 | } 11 | 12 | .container { 13 | display: flex; 14 | justify-content: center; 15 | align-items: center; 16 | height: 100vh; 17 | } 18 | 19 | .container-counter { 20 | height: 300px; 21 | width: 300px; 22 | background-color: #fff; 23 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); 24 | border-radius: 10px; 25 | margin: 10px; 26 | display: flex; 27 | justify-content: center; 28 | align-items: center; 29 | flex-direction: column; 30 | border: none; 31 | padding: 10px; 32 | } 33 | 34 | .container-counter span { 35 | font-size: 1.5rem; 36 | font-weight: bold; 37 | color: #000; 38 | } 39 | 40 | .container-counter .counter{ 41 | font-size: 4rem; 42 | font-weight: bold; 43 | color: #000; 44 | } -------------------------------------------------------------------------------- /increment-counter/incrementcounter.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Increment Counter 7 | 8 | 9 | 10 | 11 |
12 |
13 | 14 |
10000
15 | Twitter Followers 16 |
17 |
18 | 19 |
6000
20 | Youtube Followers 21 |
22 |
23 | 24 |
8000
25 | Instagram Followers 26 |
27 |
28 | 29 | 30 | -------------------------------------------------------------------------------- /increment-counter/incrementcounter.js: -------------------------------------------------------------------------------- 1 | const counters = document.querySelectorAll('.counter'); 2 | 3 | console.log(counters) 4 | 5 | counters.forEach(counter => { 6 | counter.innerHTML = '0'; 7 | let target = +counter.getAttribute('data-target'); 8 | console.log(target) 9 | let inc = target / 20; 10 | let count = 0; 11 | function incrementcounter(){ 12 | if( count < target){ 13 | count = count + inc; 14 | counter.innerHTML = count; 15 | setInterval(incrementcounter, 1); 16 | }else{ 17 | counter.innerHTML = target; 18 | } 19 | } 20 | incrementcounter(); 21 | }) -------------------------------------------------------------------------------- /jumping-letters/index.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | body { 8 | display: flex; 9 | align-items: center; 10 | justify-content: center; 11 | background-color: lightblue; 12 | height: 100vh; 13 | } 14 | 15 | .container { 16 | cursor: pointer; 17 | } 18 | 19 | span { 20 | font-size: 11rem; 21 | color: blue; 22 | font-weight: bolder; 23 | line-height: 1; 24 | display: inline-block; 25 | } 26 | 27 | span.active { 28 | animation: jump 2s ease-in-out; 29 | } 30 | 31 | @keyframes jump { 32 | 0% { 33 | transform: translate(0,0) rotate(180deg); 34 | } 35 | 100% { 36 | transform: scale(2.5) translate(0,-150px); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /jumping-letters/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Jumping Letter Animation 7 | 8 | 9 | 10 | 11 |
12 | P 13 | R 14 | O 15 | C 16 | O 17 | D 18 | E 19 |
20 | 23 | 24 | -------------------------------------------------------------------------------- /jumping-letters/index.js: -------------------------------------------------------------------------------- 1 | const container = document.querySelectorAll("span") 2 | console.log(container) 3 | container.forEach((item) => { 4 | item.addEventListener("click", () => { 5 | item.classList.toggle("active") 6 | }) 7 | }) 8 | -------------------------------------------------------------------------------- /loader/loader.css: -------------------------------------------------------------------------------- 1 | * { 2 | padding: 0; 3 | margin: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | 8 | body { 9 | background-color: black; 10 | display: flex; 11 | justify-content: center; 12 | align-items: center; 13 | height: 100vh; 14 | } 15 | 16 | .parent { 17 | position: relative; 18 | width: 100px; 19 | height: 100px; 20 | } 21 | 22 | .tri1 { 23 | position: absolute; 24 | width: 0; 25 | height: 0; 26 | border: 50px solid transparent; 27 | border-right: 50px solid white; 28 | top:0; 29 | left:0; 30 | animation:triangle1 2s infinite linear 3s; 31 | } 32 | 33 | .tri2{ 34 | position: absolute; 35 | width: 0; 36 | height: 0; 37 | border: 50px solid transparent; 38 | border-left: 50px solid white; 39 | bottom:0; 40 | right:0; 41 | /* transform: rotate(90deg); */ 42 | animation:triangle2 2s infinite linear 5s; 43 | } 44 | 45 | @keyframes triangle1 { 46 | 0%,25%{ 47 | transform: rotate(0deg); 48 | } 49 | 50%,75%{ 50 | transform: rotate(180deg); 51 | } 52 | 100%{ 53 | transform: rotate(360deg); 54 | } 55 | } 56 | 57 | @keyframes triangle2 { 58 | 0%,25%{ 59 | transform: rotate(0deg); 60 | } 61 | 50%,75%{ 62 | transform: rotate(1800deg); 63 | } 64 | 100%{ 65 | transform: rotate(360deg); 66 | } 67 | 68 | } -------------------------------------------------------------------------------- /loader/loader.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Loaders using html and CSS 7 | 8 | 9 | 10 |
11 | 12 |
13 | 14 |
15 |
16 | 17 |
18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /loading-bar/loading.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | body { 8 | background-color: antiquewhite; 9 | display: flex; 10 | justify-content: center; 11 | align-items: center; 12 | height: 100vh; 13 | } 14 | 15 | .container { 16 | height: 30px; 17 | width: 800px; 18 | border-radius: 10px; 19 | border: 2px solid black; 20 | } 21 | 22 | .percentage { 23 | font-size: 35px; 24 | display: flex; 25 | justify-content: center; 26 | position: absolute; 27 | top: 43%; 28 | left: 50%; 29 | } 30 | 31 | .loading-bar { 32 | background-color: orange; 33 | width: 0; 34 | height: 100%; 35 | transition: width ease .3; 36 | } 37 | -------------------------------------------------------------------------------- /loading-bar/loading.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Loading Bar Animation 7 | 8 | 9 | 10 |
11 | 12 |
13 | 14 |
15 |
16 | 0% 17 |
18 |
19 | 22 | 23 | -------------------------------------------------------------------------------- /loading-bar/loading.js: -------------------------------------------------------------------------------- 1 | const loadingbar = document.querySelector(".loading-bar") 2 | const percentage = document.querySelector(".percentage") 3 | 4 | window.addEventListener("DOMContentLoaded",()=>{ 5 | console.log("inside dom content loaded") 6 | let progress = 0; 7 | setInterval(()=>{ 8 | if (progress < 100){ 9 | progress++; 10 | loadingbar.style.width = `${progress}%` 11 | percentage.textContent = `${progress}%` 12 | } 13 | },30) 14 | }) -------------------------------------------------------------------------------- /mini-calender/index.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | 8 | body { 9 | background-color: lightblue; 10 | display: flex; 11 | justify-content: center; 12 | align-items: center; 13 | height: 100vh; 14 | } 15 | 16 | .container { 17 | width: 250px; 18 | background-color: white; 19 | box-shadow: 0 0 5px 0 rgba(0,0,0,0.5); 20 | border-radius: 10px; 21 | text-align: center; 22 | border: none; 23 | } 24 | 25 | .month { 26 | background-color: red; 27 | height: 60px; 28 | font-size: 2rem; 29 | font-weight: bold; 30 | color: white; 31 | padding: 10px; 32 | margin-bottom: 10px; 33 | border-radius: 10px 10px 0 0; 34 | } 35 | 36 | .weekday { 37 | margin-bottom: 10px; 38 | } 39 | 40 | .day { 41 | font-size: 5rem; 42 | font-weight: bold; 43 | margin-bottom: 10px; 44 | } 45 | 46 | .year { 47 | margin-bottom: 10px; 48 | } -------------------------------------------------------------------------------- /mini-calender/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Mini Calender 7 | 8 | 9 | 10 | 11 |
12 |
13 | December 14 |
15 |
Saturday
16 |
30
17 |
2023
18 |
19 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /mini-calender/index.js: -------------------------------------------------------------------------------- 1 | const month = document.querySelector(".month") 2 | const weekday = document.querySelector(".weekday") 3 | const day = document.querySelector(".day") 4 | const year = document.querySelector(".year") 5 | 6 | window.addEventListener("DOMContentLoaded",()=>{ 7 | const date = new Date(); 8 | console.log(date,"date") 9 | console.log("month",date.toLocaleDateString("en-US",{month:"long"})) 10 | console.log("day",date.getDate()) 11 | console.log("year",date.getFullYear()) 12 | console.log("weekday",date.toLocaleDateString("en-US",{weekday:"long"})) 13 | day.textContent = date.getDate(); 14 | year.textContent = date.getFullYear(); 15 | month.textContent = date.toLocaleDateString("en-US",{month:"long"}) 16 | weekday.textContent = date.toLocaleDateString("en-US",{weekday:"long"}) 17 | }) -------------------------------------------------------------------------------- /mouseover/mouseover.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | body { 8 | background-color: antiquewhite; 9 | display: flex; 10 | justify-content: center; 11 | align-items: center; 12 | height: 100vh; 13 | } 14 | 15 | .container { 16 | display: flex; 17 | justify-content: space-between; 18 | } 19 | 20 | .xpos,.ypos { 21 | width: 300px; 22 | border: 3px solid black; 23 | border-radius: 5px; 24 | margin: 40px; 25 | padding: 20px; 26 | font-size: 1.5rem; 27 | text-align: center; 28 | position: relative; 29 | } 30 | 31 | h4 { 32 | position: absolute; 33 | top: -40%; 34 | left: 20%; 35 | } 36 | 37 | #xpos-value, #ypos-value { 38 | font-size: 3.5rem; 39 | font-weight: bold; 40 | } -------------------------------------------------------------------------------- /mouseover/mouseover.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Mouse Over Project 7 | 8 | 9 | 10 |
11 |
12 |

13 | Mouse X Position: 14 |

15 | 0 16 |
17 |
18 |

19 | Mouse Y Position: 20 |

21 | 0 22 |
23 |
24 | 25 | 28 | 29 | -------------------------------------------------------------------------------- /mouseover/mouseover.js: -------------------------------------------------------------------------------- 1 | const xpos = document.querySelector("#xpos-value"); 2 | const ypos = document.querySelector("#ypos-value"); 3 | 4 | 5 | window.addEventListener("mouseover", (event) => { 6 | console.log(event); 7 | const xclient = event.clientX; 8 | const yclient = event.clientY; 9 | xpos.textContent = xclient; 10 | ypos.textContent = yclient; 11 | } ); -------------------------------------------------------------------------------- /multiplication-app/index.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | body{ 8 | background-color: lightblue; 9 | display: flex; 10 | justify-content: center; 11 | align-items: center; 12 | height: 100vh; 13 | } 14 | 15 | .container { 16 | width: 350px; 17 | border-radius: 10px; 18 | text-align: center; 19 | background-color: white; 20 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.3); 21 | } 22 | 23 | .score { 24 | text-align: right; 25 | padding: 5px; 26 | color: blue; 27 | font-size: 1.2rem; 28 | font-weight: bold; 29 | } 30 | 31 | .question { 32 | font-size: 1.75rem; 33 | margin-bottom: 10px; 34 | font-weight: bold; 35 | } 36 | 37 | input { 38 | width: 90%; 39 | padding: 10px; 40 | font-size: 1.2rem; 41 | margin-bottom: 10px; 42 | } 43 | 44 | button { 45 | width: 90%; 46 | padding: 10px; 47 | font-size: 1.2rem; 48 | margin-bottom: 10px; 49 | background-color: blue; 50 | color: white; 51 | border: none; 52 | border-radius: 5px; 53 | cursor: pointer; 54 | } -------------------------------------------------------------------------------- /multiplication-app/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Multiplication App 7 | 8 | 9 | 10 | 11 |
12 |
13 | Score: 0 14 |
15 |
16 | What is 5 X 5? 17 |
18 |
19 | 20 |
21 |
22 | 23 |
24 |
25 | 26 | 29 | 30 | -------------------------------------------------------------------------------- /multiplication-app/index.js: -------------------------------------------------------------------------------- 1 | const score = document.querySelector('#score'); 2 | const num1 = document.querySelector('#num1'); 3 | const num2 = document.querySelector('#num2'); 4 | let input = document.querySelector('#input'); 5 | const submit = document.querySelector('#submit'); 6 | let count = 0; 7 | submit.addEventListener('click', () => { 8 | let val = input.value; 9 | val = val.trim(); 10 | val = Number(val); 11 | let mult = document.querySelector('#num1').textContent * document.querySelector('#num2').textContent; 12 | mult = Number(mult); 13 | if( document.querySelector('#input').value === '') { 14 | alert('Please enter a number') 15 | }else if (val === mult) { 16 | console.log("inside if") 17 | count++; 18 | score.textContent = count; 19 | num1.textContent = Math.floor(Math.random() * 20); 20 | num2.textContent = Math.floor(Math.random() * 20); 21 | }else { 22 | num1.textContent = Math.floor(Math.random() * 20); 23 | num2.textContent = Math.floor(Math.random() * 20); 24 | } 25 | }); -------------------------------------------------------------------------------- /new-year-countdown/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "liveServer.settings.port": 5502 3 | } -------------------------------------------------------------------------------- /new-year-countdown/newyear.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | body{ 8 | background-color: antiquewhite; 9 | display: flex; 10 | justify-content: center; 11 | align-items: center; 12 | height: 100vh; 13 | } 14 | 15 | .container { 16 | background-color: white; 17 | width: 400px; 18 | border-radius: 10px; 19 | text-align: center; 20 | box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.5); 21 | } 22 | 23 | .header { 24 | background-color: purple; 25 | padding: 20px; 26 | border-top-left-radius: 10px; 27 | border-top-right-radius: 10px; 28 | color: white; 29 | font-size: 1.3rem; 30 | } 31 | 32 | .next-year { 33 | font-size: 3.5rem; 34 | font-weight: bold; 35 | color: purple; 36 | margin-bottom: 10px; 37 | } 38 | 39 | .counter { 40 | display: flex; 41 | justify-content: space-around; 42 | background-color: purple; 43 | color: white; 44 | padding: 10px; 45 | } 46 | 47 | #days, #hours, #minutes, #seconds { 48 | font-size: 3rem; 49 | font-weight: bold; 50 | } -------------------------------------------------------------------------------- /new-year-countdown/newyear.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Newyear Counter 7 | 8 | 9 | 10 |
11 |
12 |

13 | New Year Counter 14 |

15 |
16 |
17 |

18 | 2024 19 |

20 |
21 | 22 |
23 |
24 |

25 | 00 26 |

27 |

28 | Days 29 |

30 |
31 |
32 |

33 | 00 34 |

35 |

36 | Hours 37 |

38 |
39 |
40 |

41 | 00 42 |

43 |

44 | Minutes 45 |

46 |
47 |
48 |

49 | 00 50 |

51 |

52 | Seconds 53 |

54 |
55 |
56 |
57 | 58 | 61 | 62 | -------------------------------------------------------------------------------- /new-year-countdown/newyear.js: -------------------------------------------------------------------------------- 1 | const days = document.querySelector('#days'); 2 | const hours = document.querySelector('#hours'); 3 | const minutes = document.querySelector('#minutes'); 4 | const seconds = document.querySelector('#seconds'); 5 | 6 | const currentYear = new Date().getFullYear(); 7 | const nextYear = currentYear + 1; 8 | 9 | console.log("currentYear: ", currentYear) 10 | console.log("nextYear: ", nextYear) 11 | 12 | setInterval(() => { 13 | 14 | const currentDate = new Date(); 15 | const newYearDate = new Date(`January 01 ${nextYear} 00:00:00`); 16 | const totalSeconds = (newYearDate - currentDate) / 1000; 17 | 18 | const daysLeft = Math.floor(totalSeconds / 3600 / 24); 19 | const hoursLeft = Math.floor(totalSeconds / 3600) % 24; 20 | const minutesLeft = Math.floor(totalSeconds / 60) % 60; 21 | const secondsLeft = Math.floor(totalSeconds) % 60; 22 | days.innerHTML = daysLeft; 23 | hours.innerHTML = hoursLeft; 24 | minutes.innerHTML = minutesLeft; 25 | seconds.innerHTML = secondsLeft; 26 | }, 1000); 27 | -------------------------------------------------------------------------------- /password-generator/password.css: -------------------------------------------------------------------------------- 1 | * { 2 | padding: 0; 3 | margin: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | body { 8 | background-color: antiquewhite; 9 | display: flex; 10 | justify-content: center; 11 | align-items: center; 12 | height: 100vh; 13 | } 14 | 15 | .container-password { 16 | border-radius: 10px; 17 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); 18 | text-align: center; 19 | width: 350px; 20 | background-color: white; 21 | } 22 | 23 | .header { 24 | background-color: blue; 25 | color: white; 26 | padding: 15px; 27 | /* margin-bottom: 10px; */ 28 | } 29 | 30 | .display { 31 | margin-bottom: 5px; 32 | position: relative; 33 | } 34 | 35 | #pass-input { 36 | width: 75%; 37 | border:none; 38 | outline: none; 39 | padding: 15px; 40 | font-size: 1.5rem; 41 | font-weight: bold; 42 | } 43 | 44 | #copy { 45 | position: absolute; 46 | top: 15px; 47 | right: 30px; 48 | background-color: blue; 49 | color: white; 50 | border: none; 51 | font-size: 1.2rem; 52 | width: 20%; 53 | padding: 5px; 54 | font-weight: bold; 55 | border-radius: 5px; 56 | } 57 | 58 | .setting { 59 | display: flex; 60 | justify-content: space-between; 61 | padding: 0 15px 7.5px 15px; 62 | font-size: large; 63 | font-weight: bold; 64 | } 65 | 66 | #generate { 67 | display: block; 68 | width: 100%; 69 | padding: 7.5px; 70 | border: none; 71 | outline: none; 72 | background-color: blue; 73 | color: white; 74 | font-size: 1.2rem; 75 | font-weight: bold; 76 | } -------------------------------------------------------------------------------- /password-generator/password.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Password Generator 7 | 8 | 9 | 10 |
11 |
12 |

Password Generator

13 |
14 |
15 | 16 | 17 |
18 | 19 |
20 | 21 | 22 |
23 |
24 | 25 | 26 |
27 |
28 | 29 | 30 |
31 |
32 | 33 | 34 |
35 |
36 | 37 | 38 |
39 |
40 | 43 |
44 |
45 | 46 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /password-generator/password.js: -------------------------------------------------------------------------------- 1 | const lengthp = document.querySelector('#length-number'); 2 | const upper = document.querySelector('#uppercase'); 3 | const lower = document.querySelector('#lowercase'); 4 | const number = document.querySelector('#numbers'); 5 | const symbol = document.querySelector('#symbols'); 6 | const passinp = document.querySelector('#pass-input'); 7 | const copy = document.querySelector('#copy'); 8 | const generate = document.querySelector('#generate'); 9 | 10 | console.log(lengthp.value) 11 | console.log(upper.checked) 12 | console.log(lower.checked) 13 | console.log(number.checked) 14 | console.log(symbol.checked) 15 | 16 | const uppercasestr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; 17 | const lowercasestr = 'abcdefghijklmnopqrstuvwxyz'; 18 | const numberstr = '0123456789'; 19 | const symbolstr = '!@#$%^&*()_+'; 20 | let password = ''; 21 | generate.addEventListener('click', () => { 22 | 23 | let str = ''; 24 | if( upper.checked ){ 25 | str += uppercasestr; 26 | } 27 | 28 | if( lower.checked ){ 29 | str += lowercasestr; 30 | } 31 | 32 | if( number.checked ){ 33 | str += numberstr; 34 | } 35 | 36 | if( symbol.checked ){ 37 | str += symbolstr; 38 | } 39 | console.log(str,"str") 40 | for( let i=0; i < lengthp.value; i++ ){ 41 | console.log(str.length,"str.length") 42 | let index = Math.floor(Math.random() * str.length); 43 | console.log(index,"index") 44 | console.log("Math.random()", Math.random()) 45 | console.log("Math.random() * str.length", Math.random() * str.length) 46 | console.log("Math.floor(Math.random() * str.length)", Math.floor(Math.random() * str.length)) 47 | console.log(str[index]) 48 | password += str[index]; 49 | } 50 | console.log(password,"password") 51 | passinp.value = password; 52 | }); 53 | 54 | copy.addEventListener('click', () => { 55 | if( passinp.value === '' ){ 56 | alert('Please Generate a Password First'); 57 | }else { 58 | const newele = document.createElement('textarea'); 59 | newele.value = passinp.value; 60 | document.body.appendChild(newele); 61 | newele.select(); 62 | document.execCommand('copy'); 63 | alert('Password Copied to Clipboard'); 64 | newele.remove(); 65 | } 66 | }); 67 | 68 | -------------------------------------------------------------------------------- /password-strength-checker/password-checker.css: -------------------------------------------------------------------------------- 1 | * { 2 | box-sizing: border-box; 3 | margin: 0; 4 | padding: 0; 5 | } 6 | body { 7 | background-color: antiquewhite; 8 | display: flex; 9 | align-items: center; 10 | justify-content: center; 11 | height: 100vh; 12 | } 13 | 14 | #password { 15 | width: 350px; 16 | padding: 15px; 17 | font-size: 1.5rem; 18 | background-color: antiquewhite; 19 | border: 2px solid black; 20 | border-radius: 5px; 21 | } 22 | 23 | #password:focus { 24 | outline: none; 25 | } -------------------------------------------------------------------------------- /password-strength-checker/password-checker.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Password Strength Checker 7 | 8 | 9 | 10 | 11 |
12 | 13 |
14 | 15 |
16 |
17 | 18 | 19 | 20 |
21 | 22 |
23 | 24 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /password-strength-checker/password-checker.js: -------------------------------------------------------------------------------- 1 | const inputfield = document.querySelector('#password'); 2 | const outputfield = document.querySelector('#output'); 3 | 4 | 5 | inputfield.addEventListener('input', function() { 6 | console.log(inputfield.value); 7 | let password = inputfield.value; 8 | if (password.length < 8) { 9 | outputfield.innerText = 'Password is too short'; 10 | outputfield.style.color = 'red'; 11 | }else { 12 | // outputfield.innerText = 'Password is long enough'; 13 | // outputfield.style.color = 'green'; 14 | // a-z 15 | // A-Z 16 | // 0-9 17 | // special characters !@#$%^&*()_+{}:"<>?|[]\;',. 18 | console.log("is loercase",password.search(/[a-z]/)); 19 | if( password.search(/[a-z]/) == -1 ) { 20 | outputfield.innerText = 'Password is missing a lowercase letter'; 21 | outputfield.style.color = 'red'; 22 | }else if (password.search(/[A-Z]/) == -1){ 23 | outputfield.innerText = 'Password is missing a Uppercase letter'; 24 | outputfield.style.color = 'red'; 25 | }else if (password.search(/[0-9]/) == -1){ 26 | outputfield.innerText = 'Password is missing a Numeric letter'; 27 | outputfield.style.color = 'red'; 28 | }else if (password.search(/[!\@\#\$\%\^\&\*\(\)\_\+\{\}\:\"\<\>\?\|\[\]\\\;\'\,\.]/) == -1){ 29 | outputfield.innerText = 'Password is missing a Special Character letter'; 30 | outputfield.style.color = 'red'; 31 | } 32 | else { 33 | outputfield.innerText = 'Password is strong'; 34 | outputfield.style.color = 'green'; 35 | } 36 | 37 | } 38 | }); -------------------------------------------------------------------------------- /pomodoro/pomodoro.css: -------------------------------------------------------------------------------- 1 | * { 2 | padding: 0; 3 | margin: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | body { 8 | background-color: antiquewhite; 9 | display: flex; 10 | justify-content: center; 11 | align-items: center; 12 | height: 100vh; 13 | } 14 | 15 | .container { 16 | background-color: white; 17 | border-radius: 10px; 18 | width: 300px; 19 | text-align: center; 20 | box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.5); 21 | } 22 | 23 | .header { 24 | padding: 10px; 25 | font-weight: bold; 26 | background-color: blue; 27 | color: white; 28 | margin-bottom: 10px; 29 | } 30 | 31 | .timer { 32 | font-size: 30px; 33 | font-weight: bold; 34 | margin-bottom: 10px; 35 | } 36 | 37 | button{ 38 | padding: 10px; 39 | margin-bottom: 10px; 40 | border-radius: 5px; 41 | font-size: 1rem; 42 | border: none; 43 | font-weight: bold; 44 | cursor: pointer; 45 | width: 70px; 46 | color: white; 47 | } 48 | 49 | #start { 50 | background-color: blue; 51 | } 52 | 53 | #stop { 54 | background-color: red; 55 | } 56 | 57 | #reset { 58 | background-color: green; 59 | } -------------------------------------------------------------------------------- /pomodoro/pomodoro.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Pomodoro Timer 7 | 8 | 9 | 10 | 11 |
12 | 13 |
14 |

Pomodoro Timer

15 |
16 | 17 |
18 |

21 | 25:00 22 |

23 |
24 | 25 |
26 | 27 | 30 | 31 | 34 | 35 | 38 | 39 |
40 | 41 | 42 |
43 | 44 | 45 | 49 | 50 | -------------------------------------------------------------------------------- /pomodoro/pomodoro.js: -------------------------------------------------------------------------------- 1 | const start = document.getElementById('start'); 2 | const stop = document.getElementById('stop'); 3 | const reset = document.getElementById('reset'); 4 | 5 | const timer = document.getElementById('timer'); 6 | 7 | let minutes = 25; 8 | let seconds = 0; 9 | let timerId; 10 | 11 | console.log(timer,"timer"); 12 | start.addEventListener('click', () => { 13 | timerId=setInterval(() => { 14 | 15 | if( seconds === 0 ) { 16 | seconds = 59; 17 | if( minutes !== 0 ){ 18 | minutes--; 19 | } 20 | 21 | }else{ 22 | seconds--; 23 | } 24 | console.log(seconds); 25 | console.log(minutes); 26 | timer.innerHTML = `${minutes}:${seconds}`; 27 | }, 1000); 28 | }); 29 | 30 | stop.addEventListener('click', () => { 31 | clearInterval(timerId); 32 | }); 33 | 34 | reset.addEventListener('click', () => { 35 | minutes = 25; 36 | seconds = 0; 37 | timer.innerHTML = `${minutes}:0${seconds}`; 38 | }) -------------------------------------------------------------------------------- /qr-code/qrcode.css: -------------------------------------------------------------------------------- 1 | * { 2 | padding:0; 3 | margin:0; 4 | box-sizing:border-box; 5 | } 6 | 7 | body { 8 | background-color: antiquewhite; 9 | display: flex; 10 | justify-content: center; 11 | align-items: center; 12 | height: 100vh; 13 | } 14 | .qr-container { 15 | border-radius: 10px; 16 | padding: 20px; 17 | width: 500px; 18 | box-shadow: 0 0 10px 0 rgba(0,0,0,0.5); 19 | background-color: white; 20 | } 21 | 22 | h2 { 23 | text-align: center; 24 | margin-bottom: 10px; 25 | } 26 | 27 | #qr-input { 28 | display: block; 29 | margin-bottom: 10px; 30 | width: 100%; 31 | font-size: 16px; 32 | padding: 10px; 33 | } 34 | 35 | #qr-button { 36 | width: 100%; 37 | padding: 10px; 38 | font-size: 1.2rem; 39 | border: none; 40 | background-color: #2ecc71; 41 | color: white; 42 | margin-bottom: 10px; 43 | } 44 | 45 | #qr-img { 46 | display: block; 47 | width: 50%; 48 | margin: 0 auto; 49 | 50 | } -------------------------------------------------------------------------------- /qr-code/qrcode.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | QR code Generator 7 | 8 | 9 | 10 | 11 |
12 |

13 | QR Code Generator 14 |

15 | 16 | 17 | 18 | 21 | 22 |
23 | 24 | 27 | 28 | -------------------------------------------------------------------------------- /qr-code/qrcode.js: -------------------------------------------------------------------------------- 1 | const qrinput = document.getElementById('qr-input'); 2 | const qrimg = document.getElementById('qr-img'); 3 | const qrbutton = document.getElementById('qr-button'); 4 | 5 | console.log(qrinput, qrimg, qrbutton) 6 | 7 | qrbutton.addEventListener('click', () => { 8 | 9 | const inputValue = qrinput.value; 10 | console.log(inputValue) 11 | 12 | if( !inputValue ) { 13 | alert('Please enter a valid URL'); 14 | return; 15 | }else{ 16 | qrimg.src= `https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=${inputValue}`; 17 | arimg.alt = `QR code for ${inputValue}`; 18 | } 19 | 20 | }); -------------------------------------------------------------------------------- /quiz-app/quiz-app.css: -------------------------------------------------------------------------------- 1 | * { 2 | padding: 0; 3 | margin: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | body { 8 | background-color: antiquewhite; 9 | display: flex; 10 | justify-content: center; 11 | align-items: center; 12 | height: 100vh; 13 | } 14 | 15 | .quiz-container{ 16 | border-radius: 10px; 17 | box-shadow: 0 0 10px 0 black; 18 | width: 500px; 19 | height: 350px; 20 | background-color: white; 21 | position: relative; 22 | } 23 | 24 | #quiz-question { 25 | font-size: 1.5rem; 26 | padding: 20px; 27 | text-align: center; 28 | } 29 | 30 | ul { 31 | list-style: none; 32 | margin-left: 30px; 33 | } 34 | 35 | li { 36 | font-size: 1.2rem; 37 | margin-bottom: 15px; 38 | padding: 5px; 39 | cursor: pointer; 40 | } 41 | 42 | #submit { 43 | background-color: #F1C40E; 44 | border: none; 45 | color: white; 46 | font-size: 1.2rem; 47 | display: block; 48 | width: 100%; 49 | position: absolute; 50 | bottom: 0; 51 | left: 0; 52 | padding: 7.5px; 53 | border-radius: 0 0 10px 10px; 54 | } 55 | 56 | #submit:hover { 57 | background-color: #F39C12; 58 | cursor: pointer; 59 | } -------------------------------------------------------------------------------- /quiz-app/quiz-app.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Quiz app 7 | 8 | 9 | 10 | 11 |
12 | 13 |

14 | Question tag 15 |

16 | 17 | 36 | 37 | 38 |
39 | 40 | 44 | 45 | -------------------------------------------------------------------------------- /quiz-app/quiz-app.js: -------------------------------------------------------------------------------- 1 | const quiz = [ 2 | { 3 | question: "What is the most used programming language in 2021?", 4 | ans1text: "Java", 5 | ans2text: "C", 6 | ans3text: "Python", 7 | ans4text: "JavaScript", 8 | answer: "JavaScript", 9 | }, 10 | { 11 | question: "Who is the President of US?", 12 | ans1text: "Joe Biden", 13 | ans2text: "Donald Trump", 14 | ans3text: "Barack Obama", 15 | ans4text: "George Bush", 16 | answer: "Joe Biden", 17 | },{ 18 | question: "What does HTML stand for?", 19 | ans1text: "Hypertext Markup Language", 20 | ans2text: "Cascading Style Sheet", 21 | ans3text: "Jason Object Notation", 22 | ans4text: "Helicopters Terminals Motorboats Lamborginis", 23 | answer: "Hypertext Markup Language", 24 | }, 25 | { 26 | question: "What year was JavaScript launched?", 27 | ans1text: "1996", 28 | ans2text: "1995", 29 | ans3text: "1994", 30 | ans4text: "none of the above", 31 | answer: "1995", 32 | 33 | } 34 | ] 35 | const question = document.getElementById("quiz-question"); 36 | console.log(question); 37 | console.log(question.textContent) 38 | const option_a = document.getElementById("text_option_a"); 39 | const option_b = document.getElementById("text_option_b"); 40 | const option_c = document.getElementById("text_option_c"); 41 | const option_d = document.getElementById("text_option_d"); 42 | const answerElement = document.querySelectorAll(".answer"); 43 | console.log(option_a); 44 | console.log(option_b); 45 | console.log(option_c); 46 | console.log(option_d); 47 | console.log(option_a.textContent); 48 | console.log(option_b.textContent); 49 | console.log(option_c.textContent); 50 | console.log(option_d.textContent); 51 | 52 | const submit = document.getElementById("submit"); 53 | 54 | let currentQuestion = 0; 55 | let score = 0; 56 | 57 | console.log(quiz[currentQuestion].question); 58 | console.log(quiz[currentQuestion].ans1text); 59 | console.log(quiz[currentQuestion].ans2text); 60 | console.log(quiz[currentQuestion].ans3text); 61 | console.log(quiz[currentQuestion].ans4text); 62 | 63 | question.textContent = quiz[currentQuestion].question; 64 | option_a.textContent = quiz[currentQuestion].ans1text; 65 | option_b.textContent = quiz[currentQuestion].ans2text; 66 | option_c.textContent = quiz[currentQuestion].ans3text; 67 | option_d.textContent = quiz[currentQuestion].ans4text; 68 | 69 | 70 | submit.addEventListener("click", () => { 71 | const checkedAns = document.querySelector('input[type="radio"]:checked') 72 | console.log(checkedAns); 73 | // console.log(checkedAns.nextElementSibling.textContent); 74 | if( checkedAns === null){ 75 | alert("Please select an answer"); 76 | }else{ 77 | if( checkedAns.nextElementSibling.textContent === quiz[currentQuestion].answer){ 78 | score++; 79 | } 80 | 81 | currentQuestion++; 82 | if( currentQuestion < quiz.length){ 83 | question.textContent = quiz[currentQuestion].question; 84 | option_a.textContent = quiz[currentQuestion].ans1text; 85 | option_b.textContent = quiz[currentQuestion].ans2text; 86 | option_c.textContent = quiz[currentQuestion].ans3text; 87 | option_d.textContent = quiz[currentQuestion].ans4text; 88 | checkedAns.checked = false; 89 | }else{ 90 | alert("Your score is " + score + " out of " + quiz.length); 91 | location.reload(); 92 | } 93 | 94 | } 95 | }); 96 | 97 | -------------------------------------------------------------------------------- /quote-generator/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arbazkhan971/html-css-javascript-projects/da9fa39a8e800b46cdc58640810e158a6f031ef5/quote-generator/.DS_Store -------------------------------------------------------------------------------- /quote-generator/quotes.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | body { 8 | background-color: olivedrab; 9 | display: flex; 10 | justify-content: center; 11 | align-items: center; 12 | height: 100vh; 13 | } 14 | 15 | 16 | .container { 17 | background-color: white; 18 | width: 550px; 19 | text-align: center; 20 | border-radius: 10px; 21 | padding: 25px; 22 | border: none; 23 | box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.5); 24 | position: relative; 25 | } 26 | 27 | .header { 28 | font-size: 20px; 29 | color: white; 30 | position: absolute; 31 | top: -25%; 32 | left: 10%; 33 | } 34 | 35 | #quote { 36 | font-size: 25px; 37 | margin-bottom: 20px; 38 | color: black; 39 | } 40 | 41 | #author { 42 | font-size: 20px; 43 | margin-bottom: 20px; 44 | color: black; 45 | } 46 | 47 | button { 48 | background-color: olivedrab; 49 | border: none; 50 | padding: 10px 20px; 51 | border-radius: 5px; 52 | color: white; 53 | font-size: 20px; 54 | cursor: pointer; 55 | outline: none; 56 | } -------------------------------------------------------------------------------- /quote-generator/quotes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Random Quote Generator 7 | 8 | 9 | 10 | 11 |
12 |
13 |

Random Quote Generator

14 |
15 |
16 |

17 | if you have a dream, don't just sit there. Gather courage to believe that you can succeed and leave no stone unturned to make it a reality. 18 |

19 |
20 | 21 |
22 |

23 | - Dr. Roopam Sharma 24 |

25 |
26 | 27 |
28 | 29 |
30 |
31 | 32 | 35 | 36 | -------------------------------------------------------------------------------- /quote-generator/quotes.js: -------------------------------------------------------------------------------- 1 | const quotes = document.querySelector('#quotes'); 2 | const author = document.querySelector('#author'); 3 | const btn = document.querySelector('#new-quote'); 4 | 5 | async function getQuote() { 6 | const quotes = await fetch("https://api.quotable.io/quotes/random"); 7 | const data = await quotes.json(); 8 | console.log(quotes) 9 | console.log(data[0]) 10 | console.log("author",data[0].author) 11 | console.log("content",data[0].content) 12 | quotes.textContent = data[0].content; 13 | author.textContent = "-"+ " "+data[0].author; 14 | } 15 | 16 | 17 | btn.addEventListener('click', getQuote); -------------------------------------------------------------------------------- /random-color-card/random-color.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | body { 8 | background-color: antiquewhite; 9 | } 10 | 11 | .container { 12 | display: flex; 13 | align-items: center; 14 | justify-content: space-between; 15 | flex-wrap: wrap; 16 | } 17 | 18 | .color-card { 19 | border: 2px solid black; 20 | border-radius: 10px; 21 | width: 250px; 22 | margin: 10px; 23 | text-align: center; 24 | height: 100px; 25 | display: flex; 26 | align-items: center; 27 | justify-content: center; 28 | font-size: 1.5rem; 29 | } -------------------------------------------------------------------------------- /random-color-card/random-color.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Random Color Card 7 | 8 | 9 | 10 | 11 |
12 | 13 | 18 |
19 | 20 | 21 | 24 | 25 | -------------------------------------------------------------------------------- /random-color-card/random-color.js: -------------------------------------------------------------------------------- 1 | const container = document.querySelector('.container'); 2 | 3 | // hexcode 4 | // 0 - 9 5 | // A - F 6 | // #000000 - #FFFFFF 7 | // 01ab56 8 | const hexcode = '0123456789ABCDEF'; 9 | for(let i = 0; i < 30; i++) { 10 | const box = document.createElement('div'); 11 | box.classList.add('color-card'); 12 | let color = '#'; 13 | for(let j = 0; j < 6; j++) { 14 | color += hexcode[getRandom()]; 15 | } 16 | console.log(color); 17 | box.textContent =color; 18 | box.style.backgroundColor = color; 19 | container.appendChild(box); 20 | } 21 | 22 | 23 | function getRandom(){ 24 | return Math.floor(Math.random() * 16); 25 | } 26 | 27 | console.log(getRandom()); -------------------------------------------------------------------------------- /random-emoji-generator/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "liveServer.settings.port": 5501 3 | } -------------------------------------------------------------------------------- /random-emoji-generator/random-emoji.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin:0; 3 | padding: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | body { 8 | background-color: antiquewhite; 9 | display: flex; 10 | justify-content: center; 11 | align-items: center; 12 | height: 100vh; 13 | } 14 | 15 | .container { 16 | box-shadow: 0 0 10px rgba(0,0,0,0.5); 17 | text-align: center; 18 | padding: 10px; 19 | border-radius: 10px; 20 | width: 300px; 21 | } 22 | 23 | .heading { 24 | font-size: 20px; 25 | margin-bottom: 10px; 26 | } 27 | 28 | button { 29 | width: 120px; 30 | height: 50px; 31 | padding: 10px; 32 | border: none; 33 | box-shadow: 0 0 10px rgba(0,0,0,0.5); 34 | font-size: 20px; 35 | font-weight: 500px; 36 | border-radius: 5px; 37 | margin-bottom: 10px; 38 | } 39 | 40 | .output { 41 | font-size: 18px; 42 | } -------------------------------------------------------------------------------- /random-emoji-generator/random-emoji.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Random Emoji Generator 7 | 8 | 9 | 10 | 11 |
12 |
13 |

Random Emoji

14 |
15 | 16 |
17 | 18 |
19 | 20 |
21 |

22 | Emoji Name 23 |

24 |
25 |
26 | 29 | 30 | -------------------------------------------------------------------------------- /random-emoji-generator/random-emoji.js: -------------------------------------------------------------------------------- 1 | const clickme = document.querySelector('#btn') 2 | console.log("clickme",clickme) 3 | const output = document.querySelector(".output") 4 | console.log("output",output) 5 | 6 | const url = "https://emoji-api.com/emojis?access_key=8bd7c2327a663e6d1b92a245cc9b14a0b56f7bf6"; 7 | 8 | function getRandom(n){ 9 | return Math.floor(Math.random()*n) 10 | } 11 | 12 | clickme.addEventListener("click",async ()=> { 13 | console.log("hello from clickme") 14 | 15 | let getData = await fetch(url) 16 | getData = await getData.json() 17 | console.log("getdata length", getData.length) 18 | console.log("getData",getData) 19 | console.log(getRandom(getData.length),"getRandom") 20 | console.log("random getDataObject", getData[200]) 21 | console.log("random getRandomData",getData[getRandom(getData.length)]) 22 | const randomN = getRandom(getData.length) 23 | const character= getData[randomN].character 24 | const uniCode = getData[randomN].unicodeName 25 | console.log(character) 26 | console.log(uniCode) 27 | clickme.textContent = character 28 | output.textContent = uniCode 29 | 30 | }); -------------------------------------------------------------------------------- /random-emoji/random-emoji.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | body { 8 | background-color: antiquewhite; 9 | display: flex; 10 | justify-content: center; 11 | align-items: center; 12 | height: 100vh; 13 | } 14 | 15 | .container { 16 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); 17 | width: 350px; 18 | border-radius: 5px; 19 | padding: 15px; 20 | text-align: center; 21 | } 22 | 23 | .header { 24 | font-size: 20px; 25 | font-weight: 700; 26 | margin-bottom: 10px; 27 | } 28 | 29 | button { 30 | width: 150px; 31 | font-size: 30px; 32 | padding: 10px; 33 | border-radius: 5px; 34 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); 35 | margin-bottom: 10px; 36 | border: none; 37 | } -------------------------------------------------------------------------------- /random-emoji/random-emoji.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Random Emoji 7 | 8 | 9 | 10 | 11 |
12 | 13 |
14 |

Random Emoji

15 |
16 | 17 |
18 | 19 |
20 | 21 |
22 |

Emoji Name

23 |
24 | 25 |
26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /random-emoji/random-emoji.js: -------------------------------------------------------------------------------- 1 | const clickme = document.querySelector('#btn'); 2 | const emojiname = document.querySelector('#emoji-name'); 3 | 4 | function getRandomInt(max) { 5 | return Math.floor(Math.random() * max); 6 | } 7 | 8 | console.log(getRandomInt(1000),"random number 0 - 9") 9 | 10 | 11 | clickme.addEventListener('click', async() => { 12 | const data = await fetch('https://emoji-api.com/emojis?access_key=8bd7c2327a663e6d1b92a245cc9b14a0b56f7bf6'); 13 | console.log("data from endpoint emoji-api",data) 14 | const emojis = await data.json(); 15 | console.log("emojis",emojis) 16 | console.log("emojis[0]",emojis[0]) 17 | console.log("emojis[0].character",emojis[0].character) 18 | console.log("emojis[0].slug",emojis[0].slug) 19 | console.log("emojis[0].unicodeName",emojis[0].unicodeName) 20 | console.log("emojis[0].codePoint",emojis[0].codePoint) 21 | console.log("emojis[0].group",emojis[0].group) 22 | console.log(emojis.length,"emojis.lenght") 23 | const randomNumber = getRandomInt(emojis.length); 24 | const emoji = emojis[randomNumber]; 25 | console.log("emoji",emoji) 26 | emojiname.innerHTML = emoji.unicodeName; 27 | clickme.innerHTML = emoji.character; 28 | }); -------------------------------------------------------------------------------- /ripple-effect/ripple.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin:0; 3 | padding:0; 4 | box-sizing: border-box; 5 | } 6 | 7 | body { 8 | background-color: aquamarine; 9 | display: flex; 10 | justify-content: center; 11 | align-items: center; 12 | height: 100vh; 13 | } 14 | 15 | button { 16 | height: 50px; 17 | border: none; 18 | width: 150px; 19 | font-size: 16px; 20 | border-radius: 5px; 21 | box-shadow: 0 0 10px 0 rgba(0,0,0,0.5); 22 | outline: none; 23 | cursor: pointer; 24 | background-color: blueviolet; 25 | color: white; 26 | position: relative; 27 | overflow: hidden; 28 | } 29 | 30 | .circle { 31 | border-radius: 50%; 32 | background-color: violet; 33 | position: absolute; 34 | animation: animationname 0.6s linear; 35 | transform: scale(0); 36 | } 37 | 38 | @keyframes animationname { 39 | to{ 40 | transform: scale(3); 41 | opacity: 0; 42 | } 43 | } -------------------------------------------------------------------------------- /ripple-effect/ripple.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Ripple Effect 7 | 8 | 9 | 10 | 11 |
12 | 15 |
16 | 17 | 20 | 21 | -------------------------------------------------------------------------------- /ripple-effect/ripple.js: -------------------------------------------------------------------------------- 1 | const btn = document.querySelector(".button") 2 | 3 | 4 | btn.addEventListener("click", (event)=>{ 5 | console.log("event",event.clientX,event.clientY) 6 | const rect = btn.getBoundingClientRect() 7 | console.log("rect",rect) 8 | let circle = document.createElement("span") 9 | circle.className = "circle" 10 | circle.style.height = circle.style.width = `${rect.width}px` 11 | circle.style.left = `${event.clientX - rect.left - rect.width/2}px` 12 | circle.style.top = `${event.clientY - rect.top - rect.width/2}px` 13 | btn.appendChild(circle) 14 | }) -------------------------------------------------------------------------------- /rock-paper-scissor/index.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | body { 8 | background-color: lightblue; 9 | display: flex; 10 | justify-content: center; 11 | align-items: center; 12 | height: 100vh; 13 | } 14 | 15 | .container { 16 | width: 500px; 17 | border-radius: 8px; 18 | background-color: white; 19 | text-align: center; 20 | } 21 | 22 | .header { 23 | font-size: 1.5rem; 24 | background-color: blue; 25 | border-radius: 8px 8px 0 0; 26 | color: white; 27 | padding: 10px; 28 | margin-bottom: 10px; 29 | } 30 | 31 | .score { 32 | font-size: 1.2rem; 33 | display: flex; 34 | justify-content: center; 35 | margin-bottom: 10px; 36 | } 37 | 38 | #your_score,#computer_score { 39 | color: blue; 40 | font-size: 1.5rem; 41 | padding: 3px; 42 | margin: 20px; 43 | } 44 | 45 | .game { 46 | display: flex; 47 | justify-content: center; 48 | } 49 | 50 | button { 51 | margin: 10px; 52 | width: 100px; 53 | height: 100px; 54 | border-radius: 8px; 55 | border: none; 56 | font-size: 5rem; 57 | } 58 | 59 | .output { 60 | margin-bottom: 20px; 61 | } -------------------------------------------------------------------------------- /rock-paper-scissor/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Rock Paper Scissor 7 | 8 | 9 | 10 |
11 |
12 |

13 | Rock Paper Scissor 14 |

15 |
16 |
17 |

Your Score: 0

18 |

Computer Score: 0

19 |
20 |
21 | 24 | 27 | 30 |
31 |
32 |
33 |
34 | 37 | 38 | -------------------------------------------------------------------------------- /rock-paper-scissor/index.js: -------------------------------------------------------------------------------- 1 | const your_score = document.querySelector('#your_score'); 2 | const computer_score = document.querySelector('#computer_score'); 3 | let your_choice = ""; 4 | let computer_choice = ""; 5 | const buttons = document.querySelectorAll('button'); 6 | 7 | function computerChoice(){ 8 | const choices = ['✊', '✋', '✌']; 9 | const randomChoice = Math.floor(Math.random() * 3); 10 | return choices[randomChoice]; 11 | } 12 | 13 | console.log("computer choice: " + computerChoice()); 14 | 15 | buttons.forEach((button) => { 16 | button.addEventListener('click', () => { 17 | your_choice = button.innerText; 18 | computer_choice = computerChoice(); 19 | console.log("your choice: " + your_choice); 20 | console.log("computer choice: " + computer_choice); 21 | const result = findWinner(); 22 | if(result == "You Win!!!"){ 23 | your_score.innerText = parseInt(your_score.innerText) + 1; 24 | alert("You Win!!!") 25 | }else if(result == "You Loose!!!"){ 26 | computer_score.innerText = parseInt(computer_score.innerText) + 1; 27 | alert("You Loose!!!") 28 | }else if(result == "It's Tie!!!"){ 29 | your_score.innerText = parseInt(your_score.innerText) + 1; 30 | computer_score.innerText = parseInt(computer_score.innerText) + 1; 31 | alert("It's Tie!!!") 32 | } 33 | 34 | }); 35 | }); 36 | 37 | function findWinner(){ 38 | let result = ""; 39 | if( your_choice == computer_choice){ 40 | result = "It's Tie!!!"; 41 | }else if ( your_choice == "✊" && (computer_choice == "✋" || computer_choice == "✌")){ 42 | result = "You Win!!!"; 43 | }else if ( your_choice == "✋" &&(computer_choice == "✌" || computer_choice == "✊")){ 44 | result = "You Loose!!!"; 45 | }else if ( your_choice == "✌" && computer_choice == "✊"){ 46 | result = "You Loose!!!"; 47 | } else if ( your_choice == "✌" && computer_choice == "✋"){ 48 | result = "You Win!!!"; 49 | } 50 | return result; 51 | } -------------------------------------------------------------------------------- /scroll-animation/index.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | body{ 8 | background-color: lightblue; 9 | display: flex; 10 | justify-content: center; 11 | } 12 | 13 | .cards { 14 | width: 200px; 15 | height: 200px; 16 | background-color: white; 17 | font-size: 4rem; 18 | display: flex; 19 | justify-content: center; 20 | align-items: center; 21 | border-radius: 10px; 22 | box-shadow: 0 0 5px rgba(0,0,0,0.5); 23 | margin: 10px; 24 | } 25 | 26 | .scrollbar { 27 | background-color: green; 28 | /* width: 100%; */ 29 | position: fixed; 30 | height: 40px; 31 | top:0; 32 | left:0; 33 | } -------------------------------------------------------------------------------- /scroll-animation/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Scrollbar Animation 7 | 8 | 9 | 10 |
11 |
12 |
13 |
1
14 |
2
15 |
3
16 |
4
17 |
5
18 |
6
19 |
7
20 |
8
21 |
9
22 |
10
23 |
11
24 |
12
25 |
13
26 |
14
27 |
15
28 |
16
29 |
17
30 |
18
31 |
19
32 |
20
33 |
21
34 |
22
35 |
23
36 |
24
37 |
25
38 |
26
39 |
27
40 |
28
41 |
29
42 |
30
43 |
31
44 |
32
45 |
33
46 |
34
47 |
35
48 |
36
49 |
37
50 |
38
51 |
39
52 |
40
53 |
41
54 |
42
55 |
43
56 |
44
57 |
45
58 |
46
59 |
47
60 |
48
61 |
49
62 |
50
63 |
64 | 65 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /scroll-animation/index.js: -------------------------------------------------------------------------------- 1 | const scrollbar = document.querySelector('.scrollbar') 2 | 3 | window.addEventListener('scroll', () => { 4 | console.log("scrollY",window.scrollY) 5 | console.log("scrollHeight",document.body.scrollHeight) 6 | console.log("innerHeight",window.innerHeight) 7 | let percentage = (window.scrollY / (document.body.scrollHeight - window.innerHeight)) * 100 8 | scrollbar.style.width = percentage + '%' 9 | }) 10 | 11 | // scrollY == distance from the top of the page to the top of the scrollbar 12 | // innerHeight == height of the page (which includes height of the page + height of the scrollbar) 13 | // scrollHeight == total height of the page (which includes height of the page + height of the scrollbar) -------------------------------------------------------------------------------- /sticky-navbar/index.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | .nav-container { 8 | display: flex; 9 | justify-content: space-between; 10 | background-color: black; 11 | color: white; 12 | height: 50px; 13 | position: fixed; 14 | width: 100%; 15 | z-index: 10000; 16 | } 17 | 18 | .logo { 19 | display: flex; 20 | justify-content: center; 21 | align-items: center; 22 | padding-left: 60px; 23 | font-size: 2.5rem; 24 | font-weight: bold; 25 | } 26 | 27 | .navbar { 28 | padding-right: 50px; 29 | display: flex; 30 | justify-content: space-between; 31 | align-items: center; 32 | } 33 | 34 | a { 35 | margin: 7.5px; 36 | font-size: 1.2rem; 37 | color: white; 38 | text-decoration-line: none; 39 | } 40 | 41 | .img-container { 42 | width: 100%; 43 | height: 700px; 44 | position: relative; 45 | overflow: hidden; 46 | display: block; 47 | } 48 | 49 | 50 | #coffee { 51 | position: absolute; 52 | top:50%; 53 | left:50%; 54 | transform: translate(-50%,-50%); 55 | font-size: 10rem; 56 | color: white; 57 | } 58 | 59 | -------------------------------------------------------------------------------- /sticky-navbar/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Sticky Navbar 7 | 8 | 9 | 10 | 11 | 30 |
31 | coffee image 32 |

33 | CoffeeZone 34 |

35 |
36 |
37 | Coffee is one of the most beloved and widely consumed beverages globally, cherished for its rich aroma, bold flavor, and the energizing kick it provides. Originating from the beans of the Coffea plant, coffee has become an integral part of cultures around the world, fostering social interactions, fueling productivity, and even inspiring entire rituals. 38 | 39 | The journey of coffee begins with the cultivation of its beans in tropical regions, commonly referred to as the "coffee belt." These regions, with their ideal climate and altitude, contribute to the distinctive characteristics of various coffee varieties. The beans are harvested, processed, and roasted to perfection, resulting in an array of coffee types ranging from light and fruity to dark and robust. 40 | 41 | Coffee has transcended its role as a mere beverage; it's a social catalyst. Cafés serve as meeting places, fostering conversations, intellectual discussions, and sometimes even quiet contemplation. The aroma of freshly brewed coffee is often associated with the warmth of human connections and the comfort of shared moments. 42 | 43 | From espresso to cappuccino, the world of coffee offers a diverse palate to suit every taste preference. The coffee culture has evolved, with enthusiasts exploring brewing methods, experimenting with single-origin beans, and appreciating the nuances of the brewing process. Whether enjoyed black or adorned with cream and sugar, coffee has the remarkable ability to adapt to individual preferences. 44 | 45 | Beyond its sensory delights, coffee boasts health benefits, with studies suggesting its positive effects on cognitive function, mood enhancement, and even certain aspects of physical health. However, moderation is key, as excessive consumption may lead to adverse effects. 46 | 47 | In today's fast-paced world, coffee has become more than a beverage; it's a daily ritual, a source of comfort, and a symbol of productivity. Its invigorating properties make it a reliable companion for early mornings, late nights, and every moment in between. As the global coffee community continues to grow, the love for this enchanting elixir shows no signs of waning, cementing its place as an enduring and cherished cultural icon. 48 | Coffee is one of the most beloved and widely consumed beverages globally, cherished for its rich aroma, bold flavor, and the energizing kick it provides. Originating from the beans of the Coffea plant, coffee has become an integral part of cultures around the world, fostering social interactions, fueling productivity, and even inspiring entire rituals. 49 | 50 | The journey of coffee begins with the cultivation of its beans in tropical regions, commonly referred to as the "coffee belt." These regions, with their ideal climate and altitude, contribute to the distinctive characteristics of various coffee varieties. The beans are harvested, processed, and roasted to perfection, resulting in an array of coffee types ranging from light and fruity to dark and robust. 51 | 52 | Coffee has transcended its role as a mere beverage; it's a social catalyst. Cafés serve as meeting places, fostering conversations, intellectual discussions, and sometimes even quiet contemplation. The aroma of freshly brewed coffee is often associated with the warmth of human connections and the comfort of shared moments. 53 | 54 | From espresso to cappuccino, the world of coffee offers a diverse palate to suit every taste preference. The coffee culture has evolved, with enthusiasts exploring brewing methods, experimenting with single-origin beans, and appreciating the nuances of the brewing process. Whether enjoyed black or adorned with cream and sugar, coffee has the remarkable ability to adapt to individual preferences. 55 | 56 | Beyond its sensory delights, coffee boasts health benefits, with studies suggesting its positive effects on cognitive function, mood enhancement, and even certain aspects of physical health. However, moderation is key, as excessive consumption may lead to adverse effects. 57 | 58 | In today's fast-paced world, coffee has become more than a beverage; it's a daily ritual, a source of comfort, and a symbol of productivity. Its invigorating properties make it a reliable companion for early mornings, late nights, and every moment in between. As the global coffee community continues to grow, the love for this enchanting elixir shows no signs of waning, cementing its place as an enduring and cherished cultural icon. 59 | Coffee is one of the most beloved and widely consumed beverages globally, cherished for its rich aroma, bold flavor, and the energizing kick it provides. Originating from the beans of the Coffea plant, coffee has become an integral part of cultures around the world, fostering social interactions, fueling productivity, and even inspiring entire rituals. 60 | 61 | The journey of coffee begins with the cultivation of its beans in tropical regions, commonly referred to as the "coffee belt." These regions, with their ideal climate and altitude, contribute to the distinctive characteristics of various coffee varieties. The beans are harvested, processed, and roasted to perfection, resulting in an array of coffee types ranging from light and fruity to dark and robust. 62 | 63 | Coffee has transcended its role as a mere beverage; it's a social catalyst. Cafés serve as meeting places, fostering conversations, intellectual discussions, and sometimes even quiet contemplation. The aroma of freshly brewed coffee is often associated with the warmth of human connections and the comfort of shared moments. 64 | 65 | From espresso to cappuccino, the world of coffee offers a diverse palate to suit every taste preference. The coffee culture has evolved, with enthusiasts exploring brewing methods, experimenting with single-origin beans, and appreciating the nuances of the brewing process. Whether enjoyed black or adorned with cream and sugar, coffee has the remarkable ability to adapt to individual preferences. 66 | 67 | Beyond its sensory delights, coffee boasts health benefits, with studies suggesting its positive effects on cognitive function, mood enhancement, and even certain aspects of physical health. However, moderation is key, as excessive consumption may lead to adverse effects. 68 | 69 | In today's fast-paced world, coffee has become more than a beverage; it's a daily ritual, a source of comfort, and a symbol of productivity. Its invigorating properties make it a reliable companion for early mornings, late nights, and every moment in between. As the global coffee community continues to grow, the love for this enchanting elixir shows no signs of waning, cementing its place as an enduring and cherished cultural icon. 70 | Coffee is one of the most beloved and widely consumed beverages globally, cherished for its rich aroma, bold flavor, and the energizing kick it provides. Originating from the beans of the Coffea plant, coffee has become an integral part of cultures around the world, fostering social interactions, fueling productivity, and even inspiring entire rituals. 71 | 72 | The journey of coffee begins with the cultivation of its beans in tropical regions, commonly referred to as the "coffee belt." These regions, with their ideal climate and altitude, contribute to the distinctive characteristics of various coffee varieties. The beans are harvested, processed, and roasted to perfection, resulting in an array of coffee types ranging from light and fruity to dark and robust. 73 | 74 | Coffee has transcended its role as a mere beverage; it's a social catalyst. Cafés serve as meeting places, fostering conversations, intellectual discussions, and sometimes even quiet contemplation. The aroma of freshly brewed coffee is often associated with the warmth of human connections and the comfort of shared moments. 75 | 76 | From espresso to cappuccino, the world of coffee offers a diverse palate to suit every taste preference. The coffee culture has evolved, with enthusiasts exploring brewing methods, experimenting with single-origin beans, and appreciating the nuances of the brewing process. Whether enjoyed black or adorned with cream and sugar, coffee has the remarkable ability to adapt to individual preferences. 77 | 78 | Beyond its sensory delights, coffee boasts health benefits, with studies suggesting its positive effects on cognitive function, mood enhancement, and even certain aspects of physical health. However, moderation is key, as excessive consumption may lead to adverse effects. 79 | 80 | In today's fast-paced world, coffee has become more than a beverage; it's a daily ritual, a source of comfort, and a symbol of productivity. Its invigorating properties make it a reliable companion for early mornings, late nights, and every moment in between. As the global coffee community continues to grow, the love for this enchanting elixir shows no signs of waning, cementing its place as an enduring and cherished cultural icon.Coffee is one of the most beloved and widely consumed beverages globally, cherished for its rich aroma, bold flavor, and the energizing kick it provides. Originating from the beans of the Coffea plant, coffee has become an integral part of cultures around the world, fostering social interactions, fueling productivity, and even inspiring entire rituals. 81 | 82 | The journey of coffee begins with the cultivation of its beans in tropical regions, commonly referred to as the "coffee belt." These regions, with their ideal climate and altitude, contribute to the distinctive characteristics of various coffee varieties. The beans are harvested, processed, and roasted to perfection, resulting in an array of coffee types ranging from light and fruity to dark and robust. 83 | 84 | Coffee has transcended its role as a mere beverage; it's a social catalyst. Cafés serve as meeting places, fostering conversations, intellectual discussions, and sometimes even quiet contemplation. The aroma of freshly brewed coffee is often associated with the warmth of human connections and the comfort of shared moments. 85 | 86 | From espresso to cappuccino, the world of coffee offers a diverse palate to suit every taste preference. The coffee culture has evolved, with enthusiasts exploring brewing methods, experimenting with single-origin beans, and appreciating the nuances of the brewing process. Whether enjoyed black or adorned with cream and sugar, coffee has the remarkable ability to adapt to individual preferences. 87 | 88 | Beyond its sensory delights, coffee boasts health benefits, with studies suggesting its positive effects on cognitive function, mood enhancement, and even certain aspects of physical health. However, moderation is key, as excessive consumption may lead to adverse effects. 89 | 90 | In today's fast-paced world, coffee has become more than a beverage; it's a daily ritual, a source of comfort, and a symbol of productivity. Its invigorating properties make it a reliable companion for early mornings, late nights, and every moment in between. As the global coffee community continues to grow, the love for this enchanting elixir shows no signs of waning, cementing its place as an enduring and cherished cultural icon.Coffee is one of the most beloved and widely consumed beverages globally, cherished for its rich aroma, bold flavor, and the energizing kick it provides. Originating from the beans of the Coffea plant, coffee has become an integral part of cultures around the world, fostering social interactions, fueling productivity, and even inspiring entire rituals. 91 | 92 | The journey of coffee begins with the cultivation of its beans in tropical regions, commonly referred to as the "coffee belt." These regions, with their ideal climate and altitude, contribute to the distinctive characteristics of various coffee varieties. The beans are harvested, processed, and roasted to perfection, resulting in an array of coffee types ranging from light and fruity to dark and robust. 93 | 94 | Coffee has transcended its role as a mere beverage; it's a social catalyst. Cafés serve as meeting places, fostering conversations, intellectual discussions, and sometimes even quiet contemplation. The aroma of freshly brewed coffee is often associated with the warmth of human connections and the comfort of shared moments. 95 | 96 | From espresso to cappuccino, the world of coffee offers a diverse palate to suit every taste preference. The coffee culture has evolved, with enthusiasts exploring brewing methods, experimenting with single-origin beans, and appreciating the nuances of the brewing process. Whether enjoyed black or adorned with cream and sugar, coffee has the remarkable ability to adapt to individual preferences. 97 | 98 | Beyond its sensory delights, coffee boasts health benefits, with studies suggesting its positive effects on cognitive function, mood enhancement, and even certain aspects of physical health. However, moderation is key, as excessive consumption may lead to adverse effects. 99 | 100 | In today's fast-paced world, coffee has become more than a beverage; it's a daily ritual, a source of comfort, and a symbol of productivity. Its invigorating properties make it a reliable companion for early mornings, late nights, and every moment in between. As the global coffee community continues to grow, the love for this enchanting elixir shows no signs of waning, cementing its place as an enduring and cherished cultural icon. 101 | 102 | Coffee is one of the most beloved and widely consumed beverages globally, cherished for its rich aroma, bold flavor, and the energizing kick it provides. Originating from the beans of the Coffea plant, coffee has become an integral part of cultures around the world, fostering social interactions, fueling productivity, and even inspiring entire rituals. 103 | 104 | The journey of coffee begins with the cultivation of its beans in tropical regions, commonly referred to as the "coffee belt." These regions, with their ideal climate and altitude, contribute to the distinctive characteristics of various coffee varieties. The beans are harvested, processed, and roasted to perfection, resulting in an array of coffee types ranging from light and fruity to dark and robust. 105 | 106 | Coffee has transcended its role as a mere beverage; it's a social catalyst. Cafés serve as meeting places, fostering conversations, intellectual discussions, and sometimes even quiet contemplation. The aroma of freshly brewed coffee is often associated with the warmth of human connections and the comfort of shared moments. 107 | 108 | From espresso to cappuccino, the world of coffee offers a diverse palate to suit every taste preference. The coffee culture has evolved, with enthusiasts exploring brewing methods, experimenting with single-origin beans, and appreciating the nuances of the brewing process. Whether enjoyed black or adorned with cream and sugar, coffee has the remarkable ability to adapt to individual preferences. 109 | 110 | Beyond its sensory delights, coffee boasts health benefits, with studies suggesting its positive effects on cognitive function, mood enhancement, and even certain aspects of physical health. However, moderation is key, as excessive consumption may lead to adverse effects. 111 | 112 | In today's fast-paced world, coffee has become more than a beverage; it's a daily ritual, a source of comfort, and a symbol of productivity. Its invigorating properties make it a reliable companion for early mornings, late nights, and every moment in between. As the global coffee community continues to grow, the love for this enchanting elixir shows no signs of waning, cementing its place as an enduring and cherished cultural icon. 113 | Coffee is one of the most beloved and widely consumed beverages globally, cherished for its rich aroma, bold flavor, and the energizing kick it provides. Originating from the beans of the Coffea plant, coffee has become an integral part of cultures around the world, fostering social interactions, fueling productivity, and even inspiring entire rituals. 114 | 115 | The journey of coffee begins with the cultivation of its beans in tropical regions, commonly referred to as the "coffee belt." These regions, with their ideal climate and altitude, contribute to the distinctive characteristics of various coffee varieties. The beans are harvested, processed, and roasted to perfection, resulting in an array of coffee types ranging from light and fruity to dark and robust. 116 | 117 | Coffee has transcended its role as a mere beverage; it's a social catalyst. Cafés serve as meeting places, fostering conversations, intellectual discussions, and sometimes even quiet contemplation. The aroma of freshly brewed coffee is often associated with the warmth of human connections and the comfort of shared moments. 118 | 119 | From espresso to cappuccino, the world of coffee offers a diverse palate to suit every taste preference. The coffee culture has evolved, with enthusiasts exploring brewing methods, experimenting with single-origin beans, and appreciating the nuances of the brewing process. Whether enjoyed black or adorned with cream and sugar, coffee has the remarkable ability to adapt to individual preferences. 120 | 121 | Beyond its sensory delights, coffee boasts health benefits, with studies suggesting its positive effects on cognitive function, mood enhancement, and even certain aspects of physical health. However, moderation is key, as excessive consumption may lead to adverse effects. 122 | 123 | In today's fast-paced world, coffee has become more than a beverage; it's a daily ritual, a source of comfort, and a symbol of productivity. Its invigorating properties make it a reliable companion for early mornings, late nights, and every moment in between. As the global coffee community continues to grow, the love for this enchanting elixir shows no signs of waning, cementing its place as an enduring and cherished cultural icon. 124 | Coffee is one of the most beloved and widely consumed beverages globally, cherished for its rich aroma, bold flavor, and the energizing kick it provides. Originating from the beans of the Coffea plant, coffee has become an integral part of cultures around the world, fostering social interactions, fueling productivity, and even inspiring entire rituals. 125 | 126 | The journey of coffee begins with the cultivation of its beans in tropical regions, commonly referred to as the "coffee belt." These regions, with their ideal climate and altitude, contribute to the distinctive characteristics of various coffee varieties. The beans are harvested, processed, and roasted to perfection, resulting in an array of coffee types ranging from light and fruity to dark and robust. 127 | 128 | Coffee has transcended its role as a mere beverage; it's a social catalyst. Cafés serve as meeting places, fostering conversations, intellectual discussions, and sometimes even quiet contemplation. The aroma of freshly brewed coffee is often associated with the warmth of human connections and the comfort of shared moments. 129 | 130 | From espresso to cappuccino, the world of coffee offers a diverse palate to suit every taste preference. The coffee culture has evolved, with enthusiasts exploring brewing methods, experimenting with single-origin beans, and appreciating the nuances of the brewing process. Whether enjoyed black or adorned with cream and sugar, coffee has the remarkable ability to adapt to individual preferences. 131 | 132 | Beyond its sensory delights, coffee boasts health benefits, with studies suggesting its positive effects on cognitive function, mood enhancement, and even certain aspects of physical health. However, moderation is key, as excessive consumption may lead to adverse effects. 133 | 134 | In today's fast-paced world, coffee has become more than a beverage; it's a daily ritual, a source of comfort, and a symbol of productivity. Its invigorating properties make it a reliable companion for early mornings, late nights, and every moment in between. As the global coffee community continues to grow, the love for this enchanting elixir shows no signs of waning, cementing its place as an enduring and cherished cultural icon. 135 |
136 | 137 | 138 | -------------------------------------------------------------------------------- /stopwatch/stopwatch.css: -------------------------------------------------------------------------------- 1 | * { 2 | padding: 0; 3 | margin: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | body{ 8 | background-color: antiquewhite; 9 | display: flex; 10 | justify-content: center; 11 | align-items: center; 12 | height: 100vh; 13 | } 14 | 15 | .container { 16 | border-radius: 15px; 17 | box-shadow: 0 0 10px rgba(0,0,0,0.5); 18 | background-color: white; 19 | width: 300px; 20 | text-align: center; 21 | } 22 | 23 | .header{ 24 | padding: 20px; 25 | background-color: blue; 26 | color: white; 27 | font-size: 1.2rem; 28 | } 29 | 30 | .display { 31 | padding: 20px; 32 | font-size: 2.75rem; 33 | } 34 | 35 | button { 36 | border: none; 37 | background-color: blue; 38 | color: white; 39 | padding: 10px 20px; 40 | margin-bottom: 10px; 41 | border-radius: 5px; 42 | } 43 | 44 | .active { 45 | background-color: red; 46 | } -------------------------------------------------------------------------------- /stopwatch/stopwatch.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Stopwatch 7 | 8 | 9 | 10 | 11 |
12 |
13 |

14 | Stopwatch 15 |

16 |
17 |
18 |

19 | 00:00:00 20 |

21 |
22 |
23 | 24 | 25 |
26 |
27 | 28 | 31 | 32 | -------------------------------------------------------------------------------- /stopwatch/stopwatch.js: -------------------------------------------------------------------------------- 1 | const timer = document.querySelector('#timer'); 2 | const start = document.querySelector('#start'); 3 | const reset = document.querySelector('#reset'); 4 | 5 | console.log(timer); 6 | console.log(start); 7 | console.log(reset); 8 | 9 | let active = false; 10 | let [ss,mm,hh] = [0,0,0]; 11 | let interval; 12 | 13 | function watchcount(){ 14 | ss++; 15 | if ( ss > 59 ) { 16 | ss = 0; 17 | mm++; 18 | if ( mm > 59){ 19 | mm = 0; 20 | hh++; 21 | } 22 | } 23 | console.log(ss,mm,hh) 24 | hh = String(hh).padStart(2,'0'); 25 | mm = String(mm).padStart(2,'0'); 26 | ss = String(ss).padStart(2,'0'); 27 | timer.textContent = `${hh}:${mm}:${ss}`; 28 | } 29 | 30 | 31 | start.addEventListener('click', () => { 32 | 33 | active = active ? false : true; 34 | if ( active ) { 35 | start.textContent = 'Stop'; 36 | start.classList.add('active'); 37 | interval = setInterval(watchcount,100); 38 | 39 | }else{ 40 | start.textContent = 'Start'; 41 | start.classList.remove('active'); 42 | clearInterval(interval); 43 | 44 | } 45 | 46 | }); 47 | 48 | reset.addEventListener('click', () => { 49 | clearInterval(interval); 50 | [ss,mm,hh] = [0,0,0]; 51 | timer.textContent = '00:00:00'; 52 | }); -------------------------------------------------------------------------------- /temp-conv/index.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | body { 8 | background-color: lightblue; 9 | display: flex; 10 | justify-content: center; 11 | align-items: center; 12 | height: 100vh; 13 | } 14 | 15 | .container { 16 | width: 450px; 17 | background-color: white; 18 | border-radius: 10px; 19 | text-align: center; 20 | } 21 | 22 | .header { 23 | margin-bottom: 10px; 24 | background-color: black; 25 | color: white; 26 | font-size: 1rem; 27 | padding: 10px; 28 | border-radius: 10px 10px 0 0; 29 | } 30 | 31 | label { 32 | display: block; 33 | font-size: 1.5rem; 34 | margin-bottom: 10px; 35 | } 36 | 37 | input { 38 | width: 90%; 39 | padding: 10px; 40 | margin-bottom: 10px; 41 | font-size: 1rem; 42 | } 43 | 44 | .input3 { 45 | margin-bottom: 20px; 46 | } -------------------------------------------------------------------------------- /temp-conv/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Temperature Converter 7 | 8 | 9 | 10 |
11 |
12 |

13 | Temperature Converter 14 |

15 |
16 |
17 | 20 | 21 |
22 |
23 | 26 | 27 | 28 |
29 |
30 | 33 | 34 |
35 |
36 | 37 | 40 | 41 | -------------------------------------------------------------------------------- /temp-conv/index.js: -------------------------------------------------------------------------------- 1 | const calcius = document.querySelector("#calcius"); 2 | const fahrenheit = document.querySelector("#farenheit"); 3 | const kelvin = document.querySelector("#kelvin"); 4 | console.log(calcius, fahrenheit, kelvin); 5 | // calcius to fahrenheit => (0°C × 9/5) + 32 = 32°F 6 | // calcius to kelvin => 0°C + 273.15 = 273.15K 7 | calcius.addEventListener("input", function () { 8 | let c = parseFloat(calcius.value); 9 | let f = (c * 9 / 5) + 32; 10 | let k = c + 273.15; 11 | fahrenheit.value = f; 12 | kelvin.value = k; 13 | }); 14 | 15 | // fahrenheit to calcius => (32°F − 32) × 5/9 = 0°C 16 | // fahrenheit to kelvin => (32°F − 32) × 5/9 + 273.15 = 273.15K 17 | fahrenheit.addEventListener("input", function () { 18 | let f = parseFloat(fahrenheit.value); 19 | let c = (f - 32) * 5 / 9; 20 | let k = (f - 32) * 5 / 9 + 273.15; 21 | calcius.value = c; 22 | kelvin.value = k; 23 | }); 24 | 25 | // kelvin to calcius => 0K − 273.15 = -273.1°C 26 | // kelvin to fahrenheit => (0K − 273.15) × 9/5 + 32 = -459.7°F 27 | kelvin.addEventListener("input", function () { 28 | let k = parseFloat(kelvin.value); 29 | let c = k - 273.15; 30 | let f = (k - 273.15) * 9 / 5 + 32; 31 | calcius.value = c; 32 | fahrenheit.value = f; 33 | }); -------------------------------------------------------------------------------- /testimonial-slider/index.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | body { 8 | background-color: lightblue; 9 | display: flex; 10 | justify-content: center; 11 | align-items: center; 12 | height: 100vh; 13 | } 14 | 15 | .container { 16 | background-color: white; 17 | border-radius: 10px; 18 | width: 550px; 19 | text-align: center; 20 | box-shadow: 0 0 5px 0 rgba(0,0,0,0.5); 21 | } 22 | 23 | img { 24 | height: 120px; 25 | width: 120px; 26 | border-radius: 50%; 27 | margin-top: -60px; 28 | margin-bottom: 30px; 29 | } 30 | 31 | .testimonials{ 32 | margin-bottom: 10px; 33 | } 34 | 35 | .author { 36 | margin-bottom: 20px; 37 | } -------------------------------------------------------------------------------- /testimonial-slider/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Testimonials Slider 7 | 8 | 9 | 10 |
11 |
12 | Person Image 13 |
14 |
15 |

16 | Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam, voluptatum. Quisquam, voluptatum. 17 |

18 |
19 |
20 |

21 | Mike Doe 22 |

23 |
24 |
25 | 28 | 29 | -------------------------------------------------------------------------------- /testimonial-slider/index.js: -------------------------------------------------------------------------------- 1 | const testimonials = ["The Lorem Ipsum Company has been an integral part of our content marketing success. We have seen a notable increase in organic leads since we began using their services in 2012.","My busy schedule leaves little, if any, time for blogging and social media. The Lorem Ipsum Company has been a huge part of helping me grow my business through organic search and content marketing.","Jeramy and his team at the Lorem Ipsum Company whipped my website into shape just in time for tax season. I was excited by the results and am proud to direct clients to my website once again.","Professional, responsive, and able to keep up with ever-changing demand and tight deadlines: That's how I would describe Jeramy and his team at The Lorem Ipsum Company. When it comes to content marketing, you'll definitely get the 5-star treatment from the Lorem Ipsum Company!"] 2 | const authors = ["Roland Weedon","Kelsi Gordon","Seth Gewirtz","Tasha Zuzalek"] 3 | const imgUrl = "https://source.unsplash.com/random/150×150/?face" 4 | const author = document.querySelector("#author") 5 | const testimonial = document.querySelector("#testimonials") 6 | const image = document.querySelector(".image-container") 7 | const imgsarry = [ 8 | "https://source.unsplash.com/random/150×150/?puma", 9 | "https://source.unsplash.com/random/150×150/?cat", 10 | "https://source.unsplash.com/random/150×150/?dog", 11 | "https://source.unsplash.com/random/150×150/?tiger", 12 | ] 13 | let count = 0 14 | function changeTest(){ 15 | author.textContent = authors[count] 16 | testimonial.textContent = testimonials[count] 17 | image.innerHTML=`Person Image` 18 | count++; 19 | console.log(count) 20 | if (count > authors.length-1){ 21 | count = 0; 22 | } 23 | } 24 | setInterval(changeTest,5000) 25 | 26 | -------------------------------------------------------------------------------- /text-animation/text-animation.css: -------------------------------------------------------------------------------- 1 | * { 2 | padding: 0; 3 | margin: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | body { 8 | background-color: antiquewhite; 9 | display: flex; 10 | justify-content: center; 11 | align-items: center; 12 | height: 100vh; 13 | } 14 | 15 | .animated-text { 16 | font-size: 2rem; 17 | } -------------------------------------------------------------------------------- /text-animation/text-animation.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Text Animation 7 | 8 | 9 | 10 |
11 |
12 | 13 | Subscribe to Procode Youtube Channel, and don't forget to like and share this video 14 |
15 |
16 | 17 | 20 | 21 | -------------------------------------------------------------------------------- /text-animation/text-animation.js: -------------------------------------------------------------------------------- 1 | const animatedtext =document.querySelector(".animated-text"); 2 | const text = "Subscribe to Procode Youtube Channel" 3 | let i = 0; 4 | let speed = 50; 5 | 6 | function animate(){ 7 | animatedtext.textContent = text.substring(0,i) 8 | i++; 9 | console.log(i) 10 | if( i > text.length){ 11 | i = 0; 12 | } 13 | setTimeout(animate,speed) 14 | } 15 | 16 | animate(); -------------------------------------------------------------------------------- /text-effect/texteffect.css: -------------------------------------------------------------------------------- 1 | * { 2 | padding: 0; 3 | margin: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | body{ 8 | display: flex; 9 | justify-content: center; 10 | align-items: center; 11 | height: 100vh; 12 | background-color: antiquewhite; 13 | } 14 | 15 | .input { 16 | position: absolute; 17 | bottom:50px; 18 | border-radius: 10px; 19 | background-color: rgba(0,0,0,0.1); 20 | font-size: 18px; 21 | padding: 10px 20px; 22 | } 23 | 24 | #speed { 25 | padding: 5px; 26 | border:none; 27 | outline: none; 28 | background-color: antiquewhite; 29 | text-align: center; 30 | font-size: 18px; 31 | } -------------------------------------------------------------------------------- /text-effect/texteffect.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Text Effect 7 | 8 | 9 | 10 | 11 |
12 |

Text Effect

13 |
14 | 15 |
16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /text-effect/texteffect.js: -------------------------------------------------------------------------------- 1 | const text = document.querySelector('.text'); 2 | console.log(text.innerHTML) 3 | 4 | const value = document.querySelector('#speed'); 5 | console.log(value.value) 6 | let speed = 1500/value.value; 7 | let textContent = "I love programming"; 8 | value.addEventListener('input', (e)=>{ 9 | console.log(e.target.value) 10 | speed = 1500/e.target.value; 11 | // text.style.animationDuration = `${e.target.value}s` 12 | }) 13 | let index = 1; 14 | function writeText(){ 15 | text.innerHTML = textContent.slice(0, index); 16 | index++; 17 | if(index > textContent.length){ 18 | index = 1; 19 | } 20 | setInterval(writeText, speed); 21 | } 22 | 23 | writeText(); 24 | -------------------------------------------------------------------------------- /tip-calculator/tipcalculator.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | body { 8 | background-color: antiquewhite; 9 | display: flex; 10 | justify-content: center; 11 | align-items: center; 12 | height: 100vh; 13 | } 14 | 15 | .container { 16 | border-radius: 10px; 17 | box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.5); 18 | background-color: white; 19 | width: 400px; 20 | text-align: center; 21 | padding: 20px; 22 | } 23 | 24 | .header { 25 | font-weight: 700; 26 | margin-bottom: 10px; 27 | } 28 | 29 | .bill-info { 30 | display: block; 31 | font-size: 16px; 32 | margin-bottom: 10px; 33 | } 34 | 35 | .tip-info { 36 | display: block; 37 | font-size: 16px; 38 | margin-bottom: 10px; 39 | } 40 | 41 | input { 42 | width: 100%; 43 | padding: 10px; 44 | outline: none; 45 | margin-bottom: 10px; 46 | border-radius: 5px; 47 | } 48 | 49 | button { 50 | width: 120px; 51 | padding: 10px; 52 | font-size: 16px; 53 | background-color: red; 54 | color: white; 55 | border: none; 56 | outline: none; 57 | border-radius: 5px; 58 | margin-bottom: 10px; 59 | } 60 | 61 | button:hover { 62 | cursor: pointer; 63 | background-color: #ff0099; 64 | } 65 | 66 | .result { 67 | font-size: 16px; 68 | font-weight: 700; 69 | margin-bottom: 10px; 70 | } -------------------------------------------------------------------------------- /tip-calculator/tipcalculator.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Tip Calculator 7 | 8 | 9 | 10 |
11 | 12 |
13 |

14 | Tip Calculator 15 |

16 |
17 | 18 |
19 | 20 | 21 |
22 | 23 |
24 | 25 | 26 |
27 | 28 |
29 | 30 |
31 | 32 |
33 |

34 | Your total Bill is 35 |

36 |
37 |
38 | 42 | 43 | -------------------------------------------------------------------------------- /tip-calculator/tipcalculator.js: -------------------------------------------------------------------------------- 1 | const billamount = document.querySelector("#bill-amount"); 2 | const tippercentage = document.querySelector("#tip-percentage"); 3 | const calculate = document.querySelector("#calculate"); 4 | const output = document.querySelector("#total-bill"); 5 | 6 | calculate.addEventListener("click", (e)=>{ 7 | if( billamount.value === "" || tippercentage.value === ""){ 8 | alert("Please enter the values"); 9 | return; 10 | }else if(billamount.value < 0 || tippercentage.value < 0){ 11 | alert("Please enter positive values"); 12 | return; 13 | }else{ 14 | const billamountvalue = parseFloat(billamount.value); 15 | const tippercentagevalue = parseFloat(tippercentage.value); 16 | console.log(billamountvalue, tippercentagevalue) 17 | const tipamount = billamountvalue * (tippercentagevalue/100); 18 | const totalbill = billamountvalue + tipamount; 19 | output.innerText = totalbill; 20 | } 21 | }); -------------------------------------------------------------------------------- /todo/index.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | body { 8 | background-color: lightblue; 9 | display: flex; 10 | justify-content: center; 11 | align-items: center; 12 | height: 100vh; 13 | } 14 | 15 | .container { 16 | width: 400px; 17 | background-color: white; 18 | text-align: center; 19 | border-radius: 8px; 20 | } 21 | 22 | .header { 23 | background-color: blue; 24 | font-size: 1.5rem; 25 | color: white; 26 | padding: 10px; 27 | border-radius: 8px 8px 0 0; 28 | margin-bottom: 10px; 29 | } 30 | 31 | .input { 32 | margin-top: 40px; 33 | margin-bottom: 10px; 34 | width: 100%; 35 | } 36 | 37 | input { 38 | width: 50%; 39 | padding: 10px; 40 | font-size: 1.2rem; 41 | } 42 | 43 | #Addtodo { 44 | width: 30%; 45 | padding: 10px; 46 | font-size: 1.2rem; 47 | cursor: pointer; 48 | background-color: blue; 49 | border-radius: 3px; 50 | border: none; 51 | color: white; 52 | } 53 | 54 | .output { 55 | margin-bottom: 20px; 56 | } 57 | 58 | li { 59 | list-style: none; 60 | display: flex; 61 | justify-content: space-around; 62 | align-items: center; 63 | font-size: 1.5rem; 64 | box-shadow: 0 0 2px blue; 65 | margin: 40px; 66 | border-radius: 3px; 67 | padding: 10px; 68 | 69 | } 70 | 71 | #listBtn { 72 | width: 30%; 73 | padding: 10px; 74 | font-size: 1.2rem; 75 | cursor: pointer; 76 | background-color: blue; 77 | border-radius: 3px; 78 | border: none; 79 | color: white; 80 | } -------------------------------------------------------------------------------- /todo/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Todo Application 7 | 8 | 9 | 10 | 11 |
12 |
13 |

14 | Todo Application 15 |

16 |
17 |
18 | 19 | 22 |
23 |
24 |
    25 |
  • 26 | this is fist todo 27 | 28 |
  • 29 |
  • 30 | this is fist todo 31 | 32 |
  • 33 |
  • 34 | this is fist todo 35 | 36 |
  • 37 |
  • 38 | this is fist todo 39 | 40 |
  • 41 |
42 |
43 |
44 | 45 | 48 | 49 | -------------------------------------------------------------------------------- /todo/index.js: -------------------------------------------------------------------------------- 1 | const input = document.querySelector('input'); 2 | const Addtodo = document.querySelector('#Addtodo'); 3 | const output = document.querySelector('#output'); 4 | 5 | Addtodo.addEventListener('click', () => { 6 | const todo = input.value; 7 | if( todo === '' ) { 8 | alert('Please enter a todo'); 9 | return; 10 | }else { 11 | const li = document.createElement('li'); 12 | li.innerHTML = `${todo} 13 | ` 14 | output.appendChild(li); 15 | input.value = ''; 16 | } 17 | }); 18 | 19 | function removeTodo(element){ 20 | console.log(element.parentNode) 21 | console.log("inside remove Todo") 22 | element.parentNode.remove(); 23 | } -------------------------------------------------------------------------------- /verify-ui/verify.css: -------------------------------------------------------------------------------- 1 | * { 2 | padding: 0; 3 | margin: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | body{ 8 | background-color: antiquewhite; 9 | height: 100vh; 10 | display: flex; 11 | justify-content: center; 12 | align-items: center; 13 | } 14 | 15 | .container{ 16 | width: 600px; 17 | border: 1px solid black; 18 | padding: 30px; 19 | text-align: center; 20 | border-radius: 20px; 21 | background-color: white; 22 | } 23 | 24 | .container h2 { 25 | margin-bottom: 20px; 26 | font-size: 2rem; 27 | } 28 | 29 | .container p { 30 | margin-bottom: 20px; 31 | font-size: 1.2rem; 32 | } 33 | 34 | .code-container { 35 | display: flex; 36 | justify-content: center; 37 | align-items: center; 38 | margin-top: 20px; 39 | } 40 | 41 | .code{ 42 | height: 100px; 43 | width: 80px; 44 | border: 1px solid black; 45 | margin: 5px; 46 | font-size: 4rem; 47 | text-align: center; 48 | } 49 | 50 | .code::-webkit-outer-spin-button, 51 | .code::-webkit-inner-spin-button { 52 | -webkit-appearance: none; 53 | margin: 0; 54 | } 55 | 56 | .code:valid{ 57 | border: 1px solid green; 58 | box-shadow: 0 0 5px green; 59 | } -------------------------------------------------------------------------------- /verify-ui/verify.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Verify UI 7 | 8 | 9 | 10 |
11 |

Verify your Account

12 |

13 | We have sent a verification code to your email address.
14 | Enter the verification code that you received 15 |

16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 |
26 | 27 | 28 | -------------------------------------------------------------------------------- /verify-ui/verify.js: -------------------------------------------------------------------------------- 1 | const codes = document.querySelectorAll(".code"); 2 | codes[0].focus(); 3 | 4 | codes.forEach((code, idx) => { 5 | code.addEventListener("keydown", (e) => { 6 | if( e.key >= 0 && e.key <=9){ 7 | codes[idx].value = ""; 8 | setTimeout(() => codes[idx+1].focus(),10); 9 | }else if( e.key === "Backspace"){ 10 | setTimeout(() => codes[idx-1].focus(),10); 11 | } 12 | }) 13 | }) -------------------------------------------------------------------------------- /vowel-counter/index.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin:0; 3 | padding: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | body { 8 | background-color: lightblue; 9 | display: flex; 10 | justify-content: center; 11 | align-items: center; 12 | height: 100vh; 13 | } 14 | 15 | .container { 16 | width: 400px; 17 | text-align: center; 18 | background-color: white; 19 | border-radius: 10px; 20 | box-shadow: 0 0 10px rgba(0,0,0,0.3); 21 | } 22 | 23 | .header { 24 | margin-bottom: 10px; 25 | padding-top: 10px; 26 | } 27 | 28 | #textarea { 29 | width: 90%; 30 | height: 200px; 31 | padding: 10px; 32 | margin-bottom: 10px; 33 | border-radius: 10px; 34 | } 35 | 36 | button { 37 | width: 90%; 38 | padding: 10px; 39 | border-radius: 5px; 40 | border: none; 41 | background-color: blue; 42 | cursor: pointer; 43 | color: white; 44 | margin-bottom: 10px; 45 | font-size: 1.2rem; 46 | } 47 | 48 | .output { 49 | margin-bottom: 10px; 50 | } -------------------------------------------------------------------------------- /vowel-counter/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Vowel Counter 7 | 8 | 9 | 10 | 11 |
12 |
13 |

14 | Vowel Counter 15 |

16 |
17 |
18 | 19 |
20 |
21 | 24 |
25 |
26 |
27 | 28 | 31 | 32 | -------------------------------------------------------------------------------- /vowel-counter/index.js: -------------------------------------------------------------------------------- 1 | const textarea = document.querySelector('#textarea'); 2 | const button = document.querySelector('#count'); 3 | const output = document.querySelector('.output'); 4 | 5 | button.addEventListener('click', () => { 6 | if (textarea.value === '') { 7 | output.innerHTML = 'Please enter some text'; 8 | }else { 9 | //aeiou 10 | const val = textarea.value; 11 | let count = 0; 12 | for(let i=0; i 2 | 3 | 4 | 5 | 6 | Weight Converter 7 | 8 | 9 | 10 | 11 |
12 |
13 |

14 | Weight Converter 15 |

16 |
17 |
18 | 20 | 21 |
22 |
23 | Your Weight in Pounds

0

24 |
25 |
26 | 29 | 30 | -------------------------------------------------------------------------------- /weight-converter/index.js: -------------------------------------------------------------------------------- 1 | const input = document.querySelector('#input'); 2 | const output = document.querySelector('#output'); 3 | 4 | 5 | input.addEventListener("input",()=>{ 6 | let val = input.value; 7 | let out = val*2.2; 8 | output.innerHTML = out.toFixed(2); 9 | }) --------------------------------------------------------------------------------