Crop type affects the output

This commit is contained in:
LABS\s478989 2024-01-16 16:02:04 +01:00
parent d8ac8c32a5
commit 3dc1bcf466

View File

@ -90,7 +90,20 @@
draw_image_and_boxes(file, boxes); draw_image_and_boxes(file, boxes);
const location = locationInput.value; const location = locationInput.value;
if (cropTypeInput.value == "external") {
getWeather(location); 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) { function draw_image_and_boxes(file, boxes) {