|
@@ -1,10 +1,32 @@
|
|
|
-let calories =
|
|
|
- +prompt("How many calories do you eat for breakfast?", 700) +
|
|
|
- +prompt("How many calories do you eat for lunch?", 500) +
|
|
|
- +prompt("How many calories do you eat for dinner?", 400);
|
|
|
-alert(`you eat ${calories} for breakfast`);
|
|
|
+// Simple calories calculator-------------------------------------------------------------------------
|
|
|
|
|
|
-let message = "you are eating enough calories";
|
|
|
-if (calories >= 1800) message = "you are eating too many calories";
|
|
|
+// let breakfastEats = +prompt("How many calories do you eat for breakfast?", []);
|
|
|
+// let lunchEats = +prompt("How many calories do you eat for lunch?", []);
|
|
|
+// let dinnerEats = +prompt("How many calories do you eat for dinner?", []);
|
|
|
|
|
|
-alert(message);
|
|
|
+// let caloriesOfTheDay = breakfastEats + lunchEats + dinnerEats;
|
|
|
+
|
|
|
+// if (caloriesOfTheDay > 1800) {
|
|
|
+// alert("You are eating too many calories");
|
|
|
+// } else {
|
|
|
+// alert(
|
|
|
+// "Everything is fine, you did not exceed the number of calories for the day"
|
|
|
+// );
|
|
|
+// }
|
|
|
+
|
|
|
+// Login form--------------------------------------------------------------------------------------------
|
|
|
+const box = document.body;
|
|
|
+
|
|
|
+function Input() {
|
|
|
+ user_name = "";
|
|
|
+ password = "";
|
|
|
+ user_name = prompt("Login", []);
|
|
|
+ user_name = user_name.toLowerCase();
|
|
|
+ password = prompt("Password", []);
|
|
|
+ password = password.toLowerCase();
|
|
|
+ if (user_name == "admin" && password == "qwerty") {
|
|
|
+ box.style.backgroundColor = "green";
|
|
|
+ } else {
|
|
|
+ box.style.backgroundColor = "red";
|
|
|
+ }
|
|
|
+}
|