├── style.css ├── index.html ├── Clock ├── index.html ├── index.js └── style.css ├── game points increse,decrese using closure.js ├── Stop Watch ├── index.html ├── index.js └── style.css ├── Number Guessing Game.js └── Random PASSWORD generation.js /style.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Git and GitHub 7 | 8 | 9 |

Learning Git and GitHub

10 |

Repositories are used to mainly store code files.

11 | 12 | 13 | -------------------------------------------------------------------------------- /Clock/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | CLOCK 7 | 8 | 9 | 10 |
11 |
00:00.00 12 |
13 |
14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Clock/index.js: -------------------------------------------------------------------------------- 1 | function updateClock(){ 2 | const now = new Date(); 3 | let hour = now.getHours().toString().padStart(2,0); 4 | const hours = hour>=12 ? "PM" : "AM"; 5 | hour = hour%12 || 12; 6 | hour = hour.toString().padStart(2,0) 7 | const minintue = now.getMinutes().toString().padStart(2,0); 8 | const sec = now.getSeconds().toString().padStart(2,0); 9 | const time = `${hour}:${minintue}:${sec} ${hours}`; 10 | document.getElementById("clock").textContent = time; 11 | } 12 | updateClock(); 13 | setInterval(updateClock,1000); 14 | -------------------------------------------------------------------------------- /Clock/style.css: -------------------------------------------------------------------------------- 1 | body{ 2 | background-image: url(https://images3.alphacoders.com/690/69009.jpg); 3 | background-position: center; 4 | background-repeat: no-repeat; 5 | background-size: cover; 6 | background-attachment: fixed; 7 | margin: 0; 8 | } 9 | #clock-container{ 10 | display: flex; 11 | justify-content: center; 12 | align-items: center; 13 | height: 100vh; 14 | } 15 | #clock{ 16 | font-family: monospace; 17 | font-size: 6.5rem; 18 | font-weight: bold; 19 | text-align: center; 20 | color: white; 21 | backdrop-filter: blur(5px); 22 | width: 100%; 23 | background-color: hsla(0, 0%, 100%,0.1); 24 | } -------------------------------------------------------------------------------- /game points increse,decrese using closure.js: -------------------------------------------------------------------------------- 1 | let score = 0; 2 | 3 | function game(){ 4 | function increaseScore(points){ 5 | score+=points; 6 | console.log(`+${points} pts`); 7 | } 8 | function decreseScore(points){ 9 | score-=points; 10 | console.log(`-${points} pts`); 11 | } 12 | function getScore(){ 13 | return score; 14 | } 15 | return{increaseScore,decreseScore,getScore}; 16 | } 17 | 18 | const object = game(); 19 | object.increaseScore(4); 20 | object.increaseScore(5); 21 | console.log(`The Current Score is : ${object.getScore()}`); 22 | object.decreseScore(5); 23 | console.log(`The Current Score is : ${object.getScore()}`); 24 | -------------------------------------------------------------------------------- /Stop Watch/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | STOP WATCH 7 | 8 | 9 | 10 |

STOP WATCH

11 |
12 |
13 | 00:00:00:00 14 |
15 |
16 | 17 | 18 | 19 |
20 |
21 | 22 | 23 | -------------------------------------------------------------------------------- /Number Guessing Game.js: -------------------------------------------------------------------------------- 1 | const minimum = 1; 2 | const maximum = 10; 3 | const ran = Math.floor(Math.random()*(maximum-minimum+1)) + minimum; 4 | let guess; 5 | let guessed = false; 6 | let atempts = 0; 7 | while(!guessed) 8 | { 9 | guess = window.prompt(`Guess the number between ${minimum} & ${maximum}`); 10 | guess = Number(guess); 11 | if(isNaN(guess)) 12 | { 13 | window.alert(`Please enter a number!!!!`); 14 | } 15 | else if(guessmaximum) 16 | { 17 | window.alert(`Please enter a Number within the Given range!!!`); 18 | } 19 | else 20 | { 21 | if(guess===ran) 22 | { 23 | window.alert(`You guessed the Number ${guess} after ${atempts} attempts`); 24 | guessed = true; 25 | } 26 | else if(guess > ran) 27 | { 28 | window.alert(`The guess is too High!!!`); 29 | } 30 | else if(guess < ran) 31 | { 32 | window.alert(`The guess is too Low!!!`); 33 | } 34 | atempts++; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Random PASSWORD generation.js: -------------------------------------------------------------------------------- 1 | function generatePassword(length,Lcase,Ucase,num,symb){ 2 | 3 | const Lletters = "abcdefghijklmnopqrstuvwxyz"; 4 | const Uletters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; 5 | const numbers = "0123456789"; 6 | const symbol = "!@#$%^&*()_+-="; 7 | let temp = ""; 8 | let final = ""; 9 | 10 | temp += Lcase ? Lletters:""; 11 | temp += Ucase ? Uletters:""; 12 | temp += num ? numbers:""; 13 | temp += symb ? symbol:""; 14 | 15 | if(length<=0) 16 | { 17 | return "Legth sholud be atleast 1"; 18 | } 19 | if(temp.length === 0) 20 | { 21 | return "Any one set of charecters shold be selected"; 22 | } 23 | for(let i=0;i