Skip to content

Commit 35e3fc7

Browse files
committed
project added in index.md
1 parent 5e54072 commit 35e3fc7

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

Index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,4 @@ I've used the concept of *Async functions* and *react hook usestate* also worked
140140
|[Digital & Analog Clock](https://github.com/Ayushparikh-code/Web-dev-mini-projects/tree/main/Clock)| It is a simple project built using Javascript which has two clocks, one is Digital Clock and another one is Analog Clock.
141141
| [Insta Clone](https://github.com/Ayushparikh-code/Web-dev-mini-projects/tree/main/Instagram-clone) |It is a simple clone of instagram front page using react.
142142
|[Password Strength Meter](https://github.com/Ayushparikh-code/Web-dev-mini-projects/tree/main/Password%20Strength%20Meter)| Checks the strength of a password if it is strong, average or weak.
143+
|[lcm-hcf-calculator](https://github.com/Ayushparikh-code/Web-dev-mini-projects/tree/main/lcm-hcf-calculator) |HCF and LCM calculator finds the highest common factor and lowest common multiple for the given numbers.

LCM-HCF-CALCULATOR/public/css/style.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ input[type="number"]{
7373

7474
input[type="submit"]{
7575
background-color:#7C40FF;
76-
padding: 0vh 1vw;
76+
padding-left: 1vw;
77+
padding-right: 1vw;
7778
margin-top: 1vh;
7879
width: 40vw;
7980
}

LCM-HCF-CALCULATOR/public/js/main.js

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
const body = document.querySelector("body");
22
const lcmBtn = document.querySelector("#lcmBtn");
33
const hcfBtn = document.querySelector("#hcfBtn");
4-
const box = document.querySelector(".box");
5-
const resultboxLcm = document.querySelector(".resultboxLcm");
6-
const resultboxHcf = document.querySelector(".resultboxHcf ");
74
const numLcm1 = document.querySelector("#numLcm1");
85
const numLcm2 = document.querySelector("#numLcm2")
96
const lcm = document.querySelector("#lcm");
@@ -44,7 +41,7 @@ const findLcm = () => {
4441
const num2 = numLcm2.value;
4542

4643
let min = (num1 < num2) ? num1 : num2;
47-
while(true){
44+
while(1){
4845
if(min % num1 == 0 && min % num2 == 0){
4946
resultLcm.innerHTML = `LCM of ${num1} and ${num2} is ${min}`;
5047
if(min % 2 == 0){
@@ -55,9 +52,9 @@ const findLcm = () => {
5552
evenLcm.style.opacity = 0.5;
5653
};
5754
break;
58-
};
55+
}
5956
min++;
60-
};
57+
}
6158
});
6259
};
6360

@@ -78,12 +75,12 @@ const findHcf = () => {
7875
}else{
7976
oddHcf.style.opacity = 1;
8077
evenHcf.style.opacity = 0.5;
81-
};
78+
}
8279
resultHcf.innerHTML = `HCF of ${num1} and ${num2} is ${i}`
83-
};
84-
};
85-
});
86-
};
80+
}
81+
}
82+
})
83+
}
8784

8885

8986
lcmBtn.addEventListener("click", findLcm)

0 commit comments

Comments
 (0)