Update templates/index.html
Browse files- templates/index.html +115 -125
templates/index.html
CHANGED
|
@@ -1,136 +1,127 @@
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html lang="en">
|
| 3 |
<head>
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
</style>
|
| 66 |
</head>
|
| 67 |
<body>
|
| 68 |
|
| 69 |
<div class="container">
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
</select>
|
| 96 |
-
</div>
|
| 97 |
-
|
| 98 |
-
<!-- Soil Type Input -->
|
| 99 |
-
<div class="form-group">
|
| 100 |
-
<label for="soil_type">Soil Type</label>
|
| 101 |
-
<select class="form-control" id="soil_type" name="soil_type" required>
|
| 102 |
-
<option value="DRY">Dry</option>
|
| 103 |
-
<option value="HUMID">Humid</option>
|
| 104 |
-
<option value="WET">Wet</option>
|
| 105 |
-
</select>
|
| 106 |
-
</div>
|
| 107 |
-
|
| 108 |
-
<!-- City Input and Fetch Weather Button -->
|
| 109 |
-
<div class="form-group">
|
| 110 |
-
<label for="city">City</label>
|
| 111 |
-
<input type="text" class="form-control" id="city" name="city" placeholder="Enter city for weather" required>
|
| 112 |
-
</div>
|
| 113 |
-
<button type="button" class="btn btn-green" onclick="fetchWeather()">Fetch Weather Data</button>
|
| 114 |
-
<!-- Weather Info will be inserted below when fetched -->
|
| 115 |
-
<div id="weather_info" class="mt-3" style="display: none;">
|
| 116 |
-
<p><strong>Weather Info:</strong></p>
|
| 117 |
-
<div id="weather_data"></div>
|
| 118 |
-
</div>
|
| 119 |
-
<!-- Motor Capacity Input -->
|
| 120 |
-
<div class="form-group mt-3">
|
| 121 |
-
<label for="motor_capacity">Motor Capacity (liters/sec)</label>
|
| 122 |
-
<input type="text" class="form-control" id="motor_capacity" name="motor_capacity" required>
|
| 123 |
-
</div>
|
| 124 |
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 132 |
</div>
|
| 133 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 134 |
</div>
|
| 135 |
|
| 136 |
<script>
|
|
@@ -147,7 +138,7 @@
|
|
| 147 |
Humidity: ${data.humidity}%<br>
|
| 148 |
Pressure: ${data.pressure} hPa
|
| 149 |
`;
|
| 150 |
-
document.getElementById('weather_info').style.display = 'block';
|
| 151 |
} else {
|
| 152 |
document.getElementById('weather_data').innerHTML = 'Weather data not available';
|
| 153 |
document.getElementById('weather_info').style.display = 'block';
|
|
@@ -162,6 +153,5 @@
|
|
| 162 |
}
|
| 163 |
</script>
|
| 164 |
|
| 165 |
-
|
| 166 |
</body>
|
| 167 |
</html>
|
|
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html lang="en">
|
| 3 |
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Smart Irrigation Water Predictor</title>
|
| 7 |
+
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
|
| 8 |
+
<style>
|
| 9 |
+
body {
|
| 10 |
+
background-color: #f0fff0;
|
| 11 |
+
}
|
| 12 |
+
.container {
|
| 13 |
+
border: 1px solid #28a745;
|
| 14 |
+
padding: 20px;
|
| 15 |
+
margin: 40px auto;
|
| 16 |
+
background-color: white;
|
| 17 |
+
border-radius: 10px;
|
| 18 |
+
}
|
| 19 |
+
#weather_info {
|
| 20 |
+
background-color: #f8f9fa;
|
| 21 |
+
border: 2px solid #000;
|
| 22 |
+
padding: 15px;
|
| 23 |
+
border-radius: 5px;
|
| 24 |
+
}
|
| 25 |
+
h1 {
|
| 26 |
+
color: #28a745;
|
| 27 |
+
text-align: center;
|
| 28 |
+
font-weight: bold;
|
| 29 |
+
}
|
| 30 |
+
.input-container {
|
| 31 |
+
display: flex;
|
| 32 |
+
justify-content: space-between;
|
| 33 |
+
height: 100%;
|
| 34 |
+
}
|
| 35 |
+
.left-input {
|
| 36 |
+
width: 53%;
|
| 37 |
+
border-right: 2px solid #28a745;
|
| 38 |
+
padding-right: 20px;
|
| 39 |
+
}
|
| 40 |
+
.right-image {
|
| 41 |
+
width: 45%;
|
| 42 |
+
display: flex;
|
| 43 |
+
justify-content: center;
|
| 44 |
+
align-items: center;
|
| 45 |
+
height: 200%;
|
| 46 |
+
margin-top: 50px;
|
| 47 |
+
}
|
| 48 |
+
.right-image img {
|
| 49 |
+
width: 100%;
|
| 50 |
+
height: 100%;
|
| 51 |
+
object-fit: contain;
|
| 52 |
+
}
|
| 53 |
+
.form-control {
|
| 54 |
+
border-color: #28a745;
|
| 55 |
+
background-color: #f0fff0;
|
| 56 |
+
}
|
| 57 |
+
.btn-green {
|
| 58 |
+
background-color: #28a745;
|
| 59 |
+
color: white;
|
| 60 |
+
font-weight: bold;
|
| 61 |
+
width: 100%;
|
| 62 |
+
margin-top: 10px;
|
| 63 |
+
}
|
| 64 |
+
</style>
|
|
|
|
| 65 |
</head>
|
| 66 |
<body>
|
| 67 |
|
| 68 |
<div class="container">
|
| 69 |
+
<h1>Irrigation Water Requirement Prediction</h1>
|
| 70 |
+
<form action="/predict" method="POST">
|
| 71 |
+
<div class="input-container">
|
| 72 |
+
<div class="left-input">
|
| 73 |
+
<div class="form-group">
|
| 74 |
+
<label for="crop_type">Crop Type</label>
|
| 75 |
+
<select class="form-control" id="crop_type" name="crop_type" required>
|
| 76 |
+
<option value="BANANA">Banana</option>
|
| 77 |
+
<option value="BEAN">BEAN</option>
|
| 78 |
+
<option value="CABBAGE">CABBAGE</option>
|
| 79 |
+
<option value="CITRUS">CITRUS</option>
|
| 80 |
+
<option value="COTTON">COTTON</option>
|
| 81 |
+
<option value="MAIZE">MAIZE</option>
|
| 82 |
+
<option value="MELON">MELON</option>
|
| 83 |
+
<option value="MUSTARD">MUSTARD</option>
|
| 84 |
+
<option value="ONION">ONION</option>
|
| 85 |
+
<option value="OTHER">OTHER</option>
|
| 86 |
+
<option value="POTATO">POTATO</option>
|
| 87 |
+
<option value="RICE">RICE</option>
|
| 88 |
+
<option value="SOYABEAN">SOYABEAN</option>
|
| 89 |
+
<option value="SUGARCANE">SUGARCANE</option>
|
| 90 |
+
<option value="TOMATO">TOMATO</option>
|
| 91 |
+
<option value="WHEAT">WHEAT</option>
|
| 92 |
+
</select>
|
| 93 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
|
| 95 |
+
<div class="form-group">
|
| 96 |
+
<label for="soil_type">Soil Type</label>
|
| 97 |
+
<select class="form-control" id="soil_type" name="soil_type" required>
|
| 98 |
+
<option value="DRY">Dry</option>
|
| 99 |
+
<option value="HUMID">Humid</option>
|
| 100 |
+
<option value="WET">Wet</option>
|
| 101 |
+
</select>
|
| 102 |
+
</div>
|
| 103 |
|
| 104 |
+
<div class="form-group">
|
| 105 |
+
<label for="city">City</label>
|
| 106 |
+
<input type="text" class="form-control" id="city" name="city" placeholder="Enter city for weather" required>
|
| 107 |
+
</div>
|
| 108 |
+
<button type="button" class="btn btn-green" onclick="fetchWeather()">Fetch Weather Data</button>
|
| 109 |
+
<div id="weather_info" class="mt-3" style="display: none;">
|
| 110 |
+
<p><strong>Weather Info:</strong></p>
|
| 111 |
+
<div id="weather_data"></div>
|
| 112 |
</div>
|
| 113 |
+
<div class="form-group mt-3">
|
| 114 |
+
<label for="motor_capacity">Motor Capacity (liters/sec)</label>
|
| 115 |
+
<input type="text" class="form-control" id="motor_capacity" name="motor_capacity" required>
|
| 116 |
+
</div>
|
| 117 |
+
<button type="submit" class="btn btn-green">Predict Water Requirement</button>
|
| 118 |
+
</div>
|
| 119 |
+
|
| 120 |
+
<div class="right-image">
|
| 121 |
+
<img src="/static/images/img.png" alt="Decorative Image">
|
| 122 |
+
</div>
|
| 123 |
+
</div>
|
| 124 |
+
</form>
|
| 125 |
</div>
|
| 126 |
|
| 127 |
<script>
|
|
|
|
| 138 |
Humidity: ${data.humidity}%<br>
|
| 139 |
Pressure: ${data.pressure} hPa
|
| 140 |
`;
|
| 141 |
+
document.getElementById('weather_info').style.display = 'block';
|
| 142 |
} else {
|
| 143 |
document.getElementById('weather_data').innerHTML = 'Weather data not available';
|
| 144 |
document.getElementById('weather_info').style.display = 'block';
|
|
|
|
| 153 |
}
|
| 154 |
</script>
|
| 155 |
|
|
|
|
| 156 |
</body>
|
| 157 |
</html>
|