diff --git a/Calculators/Calorie_Calculator/app.js b/Calculators/Calorie_Calculator/app.js new file mode 100644 index 00000000..5b651962 --- /dev/null +++ b/Calculators/Calorie_Calculator/app.js @@ -0,0 +1,27 @@ +document.getElementById("mbutton").addEventListener("click", () => { + mAge = document.getElementById("mAge") + mWeight = document.getElementById("mWeight") + mHeight = document.getElementById("mHeight") + if (validate(mAge.value) || validate(mWeight.value) || validate(mHeight.value)) + return; + answer = 0 - 5 * +mAge.value + 10 * +mWeight.value + 6.25 * +mHeight.value + if (document.getElementById('mMale').checked) + answer += 5 + else + answer -= 161 + document.getElementById("mResult").innerHTML = "Your Basic Metabolic Rate = " + answer + " Calories" +}); +// document.getElementById("ubutton").addEventListener("click", () => { +// uAge = document.getElementById("uAge") +// uWeight = document.getElementById("uWeight") +// uHeight = document.getElementById("uHeight") +// answer = 0 - 5 * +mAge.value + 10 * +mWeight.value + 6.25 * +mHeight.value +// if (document.getElementById('mMale').checked) +// answer += 5 +// else +// answer -= 161 +// document.getElementById("uResult").innerHTML = "Your Basic Metabolic Rate =" + answer + " Calories" +// }); +function validate(value) { + return value===""; +} \ No newline at end of file diff --git a/Calculators/Calorie_Calculator/index.html b/Calculators/Calorie_Calculator/index.html new file mode 100644 index 00000000..3843a87d --- /dev/null +++ b/Calculators/Calorie_Calculator/index.html @@ -0,0 +1,72 @@ + + + + + + + + Calorie Calculator + + + + +
+
+

Based on Mifflin-St Jeor Equation

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

+
+
+
+ +
+
+
+ + + + + \ No newline at end of file diff --git a/Calculators/Calorie_Calculator/readme.md b/Calculators/Calorie_Calculator/readme.md new file mode 100644 index 00000000..e69de29b diff --git a/Calculators/Calorie_Calculator/style.css b/Calculators/Calorie_Calculator/style.css new file mode 100644 index 00000000..0648f50b --- /dev/null +++ b/Calculators/Calorie_Calculator/style.css @@ -0,0 +1,8 @@ +.box{ + background-color: rgb(114, 45, 233); + border: 2px solid rgb(114, 45, 233); + border-radius: 5px; +} +a{ + color: red !important; +} \ No newline at end of file