From 3dc1bcf466fdfd4b5aa459a1d6ce202b21eac319 Mon Sep 17 00:00:00 2001 From: "LABS\\s478989" Date: Tue, 16 Jan 2024 16:02:04 +0100 Subject: [PATCH] Crop type affects the output --- index.html | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index fca4bc7..0e6e2f4 100644 --- a/index.html +++ b/index.html @@ -90,7 +90,20 @@ draw_image_and_boxes(file, boxes); const location = locationInput.value; - getWeather(location); + + if (cropTypeInput.value == "external") { + getWeather(location); + } + + else { + const randomTips = [ + "water your tomatoes every day.", + "keep the temperature between 20-25 degrees Celsius.", + "place the tomatoes in sunlight."]; + + const randomTip = randomTips[Math.floor(Math.random() * randomTips.length)]; + document.getElementById("weatherInfo").innerText = "TIP! To maximalize your yields " + randomTip; + } }); function draw_image_and_boxes(file, boxes) {