From aab6312dc89f94f7da203175de7e7c5e23052ce6 Mon Sep 17 00:00:00 2001 From: Mohamed Kamal Date: Sat, 16 Apr 2022 19:50:23 +0200 Subject: [PATCH 1/3] Calorie Calculator --- Calculators/Calorie_Calculator/app.js | 0 Calculators/Calorie_Calculator/index.html | 142 ++++++++++++++++++++++ Calculators/Calorie_Calculator/readme.md | 0 Calculators/Calorie_Calculator/style.css | 8 ++ 4 files changed, 150 insertions(+) create mode 100644 Calculators/Calorie_Calculator/app.js create mode 100644 Calculators/Calorie_Calculator/index.html create mode 100644 Calculators/Calorie_Calculator/readme.md create mode 100644 Calculators/Calorie_Calculator/style.css diff --git a/Calculators/Calorie_Calculator/app.js b/Calculators/Calorie_Calculator/app.js new file mode 100644 index 00000000..e69de29b diff --git a/Calculators/Calorie_Calculator/index.html b/Calculators/Calorie_Calculator/index.html new file mode 100644 index 00000000..55e7bae6 --- /dev/null +++ b/Calculators/Calorie_Calculator/index.html @@ -0,0 +1,142 @@ + + + + + + + + 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 From c0f8350ce5fba13e72f9966aa780d01d578469b2 Mon Sep 17 00:00:00 2001 From: Mohamed Kamal Date: Sat, 16 Apr 2022 19:54:26 +0200 Subject: [PATCH 2/3] minor fix --- Calculators/Calorie_Calculator/index.html | 45 +---------------------- 1 file changed, 2 insertions(+), 43 deletions(-) diff --git a/Calculators/Calorie_Calculator/index.html b/Calculators/Calorie_Calculator/index.html index 55e7bae6..ff62c199 100644 --- a/Calculators/Calorie_Calculator/index.html +++ b/Calculators/Calorie_Calculator/index.html @@ -19,9 +19,7 @@

Based on Mifflin-St Jeor Equation

- + @@ -61,46 +59,7 @@

-
-
- -
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
-
- - -
-
-
- -
-
-
+ From 1e43bf31e7aa18c59c739c391dbc9b29303cb2cb Mon Sep 17 00:00:00 2001 From: Mohamed Kamal Date: Sun, 17 Apr 2022 20:33:28 +0200 Subject: [PATCH 3/3] removed js from html --- Calculators/Calorie_Calculator/app.js | 27 +++++++++++++++++++++ Calculators/Calorie_Calculator/index.html | 29 ----------------------- 2 files changed, 27 insertions(+), 29 deletions(-) diff --git a/Calculators/Calorie_Calculator/app.js b/Calculators/Calorie_Calculator/app.js index e69de29b..5b651962 100644 --- a/Calculators/Calorie_Calculator/app.js +++ 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 index ff62c199..3843a87d 100644 --- a/Calculators/Calorie_Calculator/index.html +++ b/Calculators/Calorie_Calculator/index.html @@ -68,34 +68,5 @@

- \ No newline at end of file