Illia Kozyr 2 lat temu
commit
d8574ec730
1 zmienionych plików z 33 dodań i 0 usunięć
  1. 33 0
      index.html

+ 33 - 0
index.html

@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html lang="en">
+    <head>
+        <meta charset="UTF-8" />
+        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
+        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+        <title>Document</title>
+    </head>
+    <body>
+        <script>
+            let CaloriesPerDay = 2000;
+            let CaloriesPerMeal = prompt(
+                "Введите, сколько калорий вы потребили:"
+            );
+            if (CaloriesPerMeal < CaloriesPerDay) {
+                let CalorieDifference = CaloriesPerDay - CaloriesPerMeal;
+                alert(
+                    "Вы ещё можете употребить: " +
+                        CalorieDifference +
+                        " калорий. Мало есть тоже плохо!"
+                );
+            } else {
+                let CalorieDifference = CaloriesPerDay - CaloriesPerMeal;
+                alert(
+                    "Вы превысили лимит калорий в сутки на: " +
+                        CalorieDifference +
+                        "." +
+                        " Хватит жрать!"
+                );
+            }
+        </script>
+    </body>
+</html>