Update templates/index.html
Browse files- templates/index.html +77 -149
templates/index.html
CHANGED
|
@@ -45,13 +45,11 @@
|
|
| 45 |
--space-xl: 3rem;
|
| 46 |
--space-2xl: 4rem;
|
| 47 |
}
|
| 48 |
-
|
| 49 |
* {
|
| 50 |
box-sizing: border-box;
|
| 51 |
margin: 0;
|
| 52 |
padding: 0;
|
| 53 |
}
|
| 54 |
-
|
| 55 |
body {
|
| 56 |
background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
|
| 57 |
font-family: 'Outfit', sans-serif;
|
|
@@ -59,13 +57,11 @@
|
|
| 59 |
min-height: 100vh;
|
| 60 |
line-height: 1.6;
|
| 61 |
}
|
| 62 |
-
|
| 63 |
.main-container {
|
| 64 |
max-width: 1400px;
|
| 65 |
margin: 0 auto;
|
| 66 |
padding: 0 var(--space-md);
|
| 67 |
}
|
| 68 |
-
|
| 69 |
.heading {
|
| 70 |
background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
|
| 71 |
color: white;
|
|
@@ -76,7 +72,6 @@
|
|
| 76 |
margin: 0 0 var(--space-xl) 0;
|
| 77 |
border-radius: 0 0 var(--radius-xl) var(--radius-xl);
|
| 78 |
}
|
| 79 |
-
|
| 80 |
.heading::before {
|
| 81 |
content: '';
|
| 82 |
position: absolute;
|
|
@@ -89,14 +84,12 @@
|
|
| 89 |
radial-gradient(circle at 80% 80%, rgba(255,255,255,0.08) 0%, transparent 50%);
|
| 90 |
pointer-events: none;
|
| 91 |
}
|
| 92 |
-
|
| 93 |
.heading i {
|
| 94 |
font-size: 3rem;
|
| 95 |
margin-bottom: var(--space-sm);
|
| 96 |
display: block;
|
| 97 |
opacity: 0.9;
|
| 98 |
}
|
| 99 |
-
|
| 100 |
.heading h1 {
|
| 101 |
font-size: 2.5rem;
|
| 102 |
font-weight: 700;
|
|
@@ -106,14 +99,12 @@
|
|
| 106 |
text-shadow: 0 2px 10px rgba(0,0,0,0.1);
|
| 107 |
margin: 0;
|
| 108 |
}
|
| 109 |
-
|
| 110 |
.heading p {
|
| 111 |
font-size: 1.1rem;
|
| 112 |
margin-top: var(--space-sm);
|
| 113 |
opacity: 0.95;
|
| 114 |
font-weight: 300;
|
| 115 |
}
|
| 116 |
-
|
| 117 |
.input-container {
|
| 118 |
background: var(--bg-light);
|
| 119 |
border-radius: 20px;
|
|
@@ -125,12 +116,10 @@
|
|
| 125 |
border: 2px solid var(--border);
|
| 126 |
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
|
| 127 |
}
|
| 128 |
-
|
| 129 |
.input-container:hover {
|
| 130 |
transform: translateY(-4px);
|
| 131 |
box-shadow: 0 25px 70px rgba(0, 0, 0, 0.18);
|
| 132 |
}
|
| 133 |
-
|
| 134 |
.input-container::before {
|
| 135 |
content: '';
|
| 136 |
position: absolute;
|
|
@@ -141,11 +130,9 @@
|
|
| 141 |
background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-accent) 100%);
|
| 142 |
border-radius: var(--radius-xl) var(--radius-xl) 0 0;
|
| 143 |
}
|
| 144 |
-
|
| 145 |
.form-group {
|
| 146 |
margin-bottom: var(--space-md);
|
| 147 |
}
|
| 148 |
-
|
| 149 |
.form-group label {
|
| 150 |
display: flex;
|
| 151 |
align-items: center;
|
|
@@ -155,17 +142,14 @@
|
|
| 155 |
margin-bottom: var(--space-xs);
|
| 156 |
font-size: 0.95rem;
|
| 157 |
}
|
| 158 |
-
|
| 159 |
.form-group label i {
|
| 160 |
font-size: 1.1rem;
|
| 161 |
color: var(--color-accent);
|
| 162 |
}
|
| 163 |
-
|
| 164 |
.form-control {
|
| 165 |
background: var(--bg-light);
|
| 166 |
border: 2px solid transparent;
|
| 167 |
border-radius: var(--radius-md);
|
| 168 |
-
|
| 169 |
font-family: 'Outfit', sans-serif;
|
| 170 |
font-size: 1rem;
|
| 171 |
color: var(--text);
|
|
@@ -173,11 +157,9 @@
|
|
| 173 |
transition: all 0.3s ease;
|
| 174 |
box-shadow: var(--shadow-sm);
|
| 175 |
}
|
| 176 |
-
|
| 177 |
.form-control:hover {
|
| 178 |
border-color: var(--border-light);
|
| 179 |
}
|
| 180 |
-
|
| 181 |
.form-control:focus {
|
| 182 |
background: var(--surface);
|
| 183 |
outline: none;
|
|
@@ -185,12 +167,6 @@
|
|
| 185 |
box-shadow: 0 0 0 4px rgba(25, 135, 84, 0.1), var(--shadow-md);
|
| 186 |
transform: translateY(-1px);
|
| 187 |
}
|
| 188 |
-
|
| 189 |
-
.form-control::placeholder {
|
| 190 |
-
color: var(--text-light);
|
| 191 |
-
font-weight: 300;
|
| 192 |
-
}
|
| 193 |
-
|
| 194 |
.predict-btn {
|
| 195 |
background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
|
| 196 |
color: white;
|
|
@@ -207,36 +183,57 @@
|
|
| 207 |
overflow: hidden;
|
| 208 |
transition: all 0.3s ease;
|
| 209 |
box-shadow: 0 4px 15px rgba(26, 93, 58, 0.3);
|
|
|
|
|
|
|
|
|
|
|
|
|
| 210 |
}
|
| 211 |
-
|
| 212 |
-
.predict-btn::before {
|
| 213 |
-
content: '';
|
| 214 |
-
position: absolute;
|
| 215 |
-
top: 0;
|
| 216 |
-
left: -100%;
|
| 217 |
-
width: 100%;
|
| 218 |
-
height: 100%;
|
| 219 |
-
background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
|
| 220 |
-
transition: left 0.5s ease;
|
| 221 |
-
}
|
| 222 |
-
|
| 223 |
-
.predict-btn:hover::before {
|
| 224 |
-
left: 100%;
|
| 225 |
-
}
|
| 226 |
-
|
| 227 |
.predict-btn:hover {
|
| 228 |
transform: translateY(-2px);
|
| 229 |
box-shadow: 0 6px 25px rgba(26, 93, 58, 0.4);
|
| 230 |
}
|
| 231 |
|
| 232 |
-
|
| 233 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 234 |
}
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
cursor: not-allowed;
|
| 239 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 240 |
|
| 241 |
.result-container {
|
| 242 |
display: grid;
|
|
@@ -246,13 +243,11 @@
|
|
| 246 |
margin-bottom: var(--space-2xl);
|
| 247 |
animation: fadeInUp 0.6s ease-out;
|
| 248 |
}
|
| 249 |
-
|
| 250 |
@media (max-width: 968px) {
|
| 251 |
.result-container {
|
| 252 |
grid-template-columns: 1fr;
|
| 253 |
}
|
| 254 |
}
|
| 255 |
-
|
| 256 |
.left-container,
|
| 257 |
.right-container {
|
| 258 |
background: var(--surface);
|
|
@@ -264,7 +259,6 @@
|
|
| 264 |
position: relative;
|
| 265 |
overflow: hidden;
|
| 266 |
}
|
| 267 |
-
|
| 268 |
.left-container::before,
|
| 269 |
.right-container::before {
|
| 270 |
content: '';
|
|
@@ -275,21 +269,6 @@
|
|
| 275 |
height: 3px;
|
| 276 |
background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-accent) 100%);
|
| 277 |
}
|
| 278 |
-
|
| 279 |
-
.left-container:hover,
|
| 280 |
-
.right-container:hover {
|
| 281 |
-
transform: translateY(-6px);
|
| 282 |
-
box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
|
| 283 |
-
}
|
| 284 |
-
|
| 285 |
-
.section-heading {
|
| 286 |
-
color: var(--color-primary);
|
| 287 |
-
font-weight: 600;
|
| 288 |
-
text-align: center;
|
| 289 |
-
margin-bottom: var(--space-lg);
|
| 290 |
-
font-size: 1.5rem;
|
| 291 |
-
}
|
| 292 |
-
|
| 293 |
.fertilizer-name {
|
| 294 |
background: linear-gradient(135deg, rgba(26, 93, 58, 0.08) 0%, rgba(25, 135, 84, 0.08) 100%);
|
| 295 |
color: var(--color-primary);
|
|
@@ -302,7 +281,6 @@
|
|
| 302 |
margin: var(--space-md) 0;
|
| 303 |
box-shadow: var(--shadow-sm);
|
| 304 |
}
|
| 305 |
-
|
| 306 |
.fertilizer-info {
|
| 307 |
background: var(--bg-light);
|
| 308 |
padding: var(--space-lg);
|
|
@@ -313,80 +291,38 @@
|
|
| 313 |
color: var(--text);
|
| 314 |
font-size: 1.05rem;
|
| 315 |
}
|
| 316 |
-
|
| 317 |
-
.fertilizer-info strong {
|
| 318 |
color: var(--color-primary);
|
| 319 |
font-weight: 600;
|
|
|
|
|
|
|
|
|
|
| 320 |
}
|
| 321 |
-
|
| 322 |
-
.gauge-container {
|
| 323 |
-
display: flex;
|
| 324 |
-
justify-content: center;
|
| 325 |
-
align-items: center;
|
| 326 |
-
padding: var(--space-md);
|
| 327 |
-
background: var(--bg-light);
|
| 328 |
-
border-radius: var(--radius-md);
|
| 329 |
-
}
|
| 330 |
-
|
| 331 |
-
@keyframes fadeInUp {
|
| 332 |
-
from {
|
| 333 |
-
opacity: 0;
|
| 334 |
-
transform: translateY(30px);
|
| 335 |
-
}
|
| 336 |
-
to {
|
| 337 |
-
opacity: 1;
|
| 338 |
-
transform: translateY(0);
|
| 339 |
-
}
|
| 340 |
-
}
|
| 341 |
-
|
| 342 |
-
.input-container {
|
| 343 |
-
animation: fadeInUp 0.5s ease-out;
|
| 344 |
-
}
|
| 345 |
-
|
| 346 |
.form-row {
|
| 347 |
display: grid;
|
| 348 |
grid-template-columns: 1fr 1fr;
|
| 349 |
gap: var(--space-md);
|
| 350 |
margin-bottom: 0;
|
| 351 |
}
|
| 352 |
-
|
| 353 |
@media (max-width: 768px) {
|
| 354 |
.form-row {
|
| 355 |
grid-template-columns: 1fr;
|
| 356 |
}
|
| 357 |
-
|
| 358 |
-
.heading h1 {
|
| 359 |
-
font-size: 2rem;
|
| 360 |
-
}
|
| 361 |
-
}
|
| 362 |
-
|
| 363 |
-
button:focus,
|
| 364 |
-
input:focus,
|
| 365 |
-
select:focus {
|
| 366 |
-
outline: 2px solid var(--color-accent);
|
| 367 |
-
outline-offset: 2px;
|
| 368 |
-
}
|
| 369 |
-
|
| 370 |
-
::-webkit-scrollbar {
|
| 371 |
-
width: 10px;
|
| 372 |
-
}
|
| 373 |
-
|
| 374 |
-
::-webkit-scrollbar-track {
|
| 375 |
-
background: var(--bg-light);
|
| 376 |
}
|
| 377 |
-
|
| 378 |
-
|
| 379 |
-
|
| 380 |
-
border-radius: 5px;
|
| 381 |
-
}
|
| 382 |
-
|
| 383 |
-
::-webkit-scrollbar-thumb:hover {
|
| 384 |
-
background: var(--color-primary-dark);
|
| 385 |
}
|
| 386 |
</style>
|
| 387 |
</head>
|
| 388 |
|
| 389 |
<body>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 390 |
<div class="heading">
|
| 391 |
<i class="bi bi-flower2"></i>
|
| 392 |
<h1>Fertilizer Recommender & Usage Requirement Estimator</h1>
|
|
@@ -394,7 +330,8 @@
|
|
| 394 |
</div>
|
| 395 |
|
| 396 |
<div class="main-container">
|
| 397 |
-
|
|
|
|
| 398 |
<div class="form-row">
|
| 399 |
<div class="form-group">
|
| 400 |
<label for="temperature"><i class="bi bi-thermometer-half"></i> Temperature (°C)</label>
|
|
@@ -479,7 +416,7 @@
|
|
| 479 |
|
| 480 |
<div class="right-container">
|
| 481 |
<h3 class="section-heading">Optimal Fertilizer Usage (kg/Acres)</h3>
|
| 482 |
-
<div class="gauge-container">
|
| 483 |
<div id="gauge"></div>
|
| 484 |
</div>
|
| 485 |
<script>
|
|
@@ -489,51 +426,42 @@
|
|
| 489 |
mode: 'gauge+number',
|
| 490 |
value: optimalUsage,
|
| 491 |
gauge: {
|
| 492 |
-
axis: {
|
| 493 |
-
range: [0, 100],
|
| 494 |
-
tickwidth: 2,
|
| 495 |
-
tickcolor: "#1a5d3a"
|
| 496 |
-
},
|
| 497 |
bar: { color: "#198754" },
|
| 498 |
bgcolor: "white",
|
| 499 |
-
bordercolor: "#143d2e",
|
| 500 |
borderwidth: 2,
|
| 501 |
steps: [
|
| 502 |
{ range: [0, 33], color: "#e8f5e9" },
|
| 503 |
{ range: [33, 66], color: "#a5d6a7" },
|
| 504 |
{ range: [66, 100], color: "#66bb6a" }
|
| 505 |
-
]
|
| 506 |
-
threshold: {
|
| 507 |
-
line: { color: "#c62828", width: 4 },
|
| 508 |
-
thickness: 0.75,
|
| 509 |
-
value: 90
|
| 510 |
-
}
|
| 511 |
}
|
| 512 |
}];
|
| 513 |
-
|
| 514 |
var layout = {
|
| 515 |
-
width:
|
| 516 |
-
height: 300,
|
| 517 |
margin: { t: 25, b: 25, l: 25, r: 25 },
|
| 518 |
paper_bgcolor: 'rgba(0,0,0,0)',
|
| 519 |
-
font: {
|
| 520 |
-
family: 'Outfit, sans-serif',
|
| 521 |
-
size: 14,
|
| 522 |
-
color: '#1f2937'
|
| 523 |
-
}
|
| 524 |
-
};
|
| 525 |
-
|
| 526 |
-
var config = {
|
| 527 |
-
responsive: true,
|
| 528 |
-
displayModeBar: false
|
| 529 |
};
|
| 530 |
-
|
| 531 |
-
Plotly.newPlot('gauge', gaugeData, layout, config);
|
| 532 |
</script>
|
| 533 |
</div>
|
| 534 |
</div>
|
| 535 |
{% endif %}
|
| 536 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 537 |
</body>
|
| 538 |
|
| 539 |
</html>
|
|
|
|
| 45 |
--space-xl: 3rem;
|
| 46 |
--space-2xl: 4rem;
|
| 47 |
}
|
|
|
|
| 48 |
* {
|
| 49 |
box-sizing: border-box;
|
| 50 |
margin: 0;
|
| 51 |
padding: 0;
|
| 52 |
}
|
|
|
|
| 53 |
body {
|
| 54 |
background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
|
| 55 |
font-family: 'Outfit', sans-serif;
|
|
|
|
| 57 |
min-height: 100vh;
|
| 58 |
line-height: 1.6;
|
| 59 |
}
|
|
|
|
| 60 |
.main-container {
|
| 61 |
max-width: 1400px;
|
| 62 |
margin: 0 auto;
|
| 63 |
padding: 0 var(--space-md);
|
| 64 |
}
|
|
|
|
| 65 |
.heading {
|
| 66 |
background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
|
| 67 |
color: white;
|
|
|
|
| 72 |
margin: 0 0 var(--space-xl) 0;
|
| 73 |
border-radius: 0 0 var(--radius-xl) var(--radius-xl);
|
| 74 |
}
|
|
|
|
| 75 |
.heading::before {
|
| 76 |
content: '';
|
| 77 |
position: absolute;
|
|
|
|
| 84 |
radial-gradient(circle at 80% 80%, rgba(255,255,255,0.08) 0%, transparent 50%);
|
| 85 |
pointer-events: none;
|
| 86 |
}
|
|
|
|
| 87 |
.heading i {
|
| 88 |
font-size: 3rem;
|
| 89 |
margin-bottom: var(--space-sm);
|
| 90 |
display: block;
|
| 91 |
opacity: 0.9;
|
| 92 |
}
|
|
|
|
| 93 |
.heading h1 {
|
| 94 |
font-size: 2.5rem;
|
| 95 |
font-weight: 700;
|
|
|
|
| 99 |
text-shadow: 0 2px 10px rgba(0,0,0,0.1);
|
| 100 |
margin: 0;
|
| 101 |
}
|
|
|
|
| 102 |
.heading p {
|
| 103 |
font-size: 1.1rem;
|
| 104 |
margin-top: var(--space-sm);
|
| 105 |
opacity: 0.95;
|
| 106 |
font-weight: 300;
|
| 107 |
}
|
|
|
|
| 108 |
.input-container {
|
| 109 |
background: var(--bg-light);
|
| 110 |
border-radius: 20px;
|
|
|
|
| 116 |
border: 2px solid var(--border);
|
| 117 |
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
|
| 118 |
}
|
|
|
|
| 119 |
.input-container:hover {
|
| 120 |
transform: translateY(-4px);
|
| 121 |
box-shadow: 0 25px 70px rgba(0, 0, 0, 0.18);
|
| 122 |
}
|
|
|
|
| 123 |
.input-container::before {
|
| 124 |
content: '';
|
| 125 |
position: absolute;
|
|
|
|
| 130 |
background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-accent) 100%);
|
| 131 |
border-radius: var(--radius-xl) var(--radius-xl) 0 0;
|
| 132 |
}
|
|
|
|
| 133 |
.form-group {
|
| 134 |
margin-bottom: var(--space-md);
|
| 135 |
}
|
|
|
|
| 136 |
.form-group label {
|
| 137 |
display: flex;
|
| 138 |
align-items: center;
|
|
|
|
| 142 |
margin-bottom: var(--space-xs);
|
| 143 |
font-size: 0.95rem;
|
| 144 |
}
|
|
|
|
| 145 |
.form-group label i {
|
| 146 |
font-size: 1.1rem;
|
| 147 |
color: var(--color-accent);
|
| 148 |
}
|
|
|
|
| 149 |
.form-control {
|
| 150 |
background: var(--bg-light);
|
| 151 |
border: 2px solid transparent;
|
| 152 |
border-radius: var(--radius-md);
|
|
|
|
| 153 |
font-family: 'Outfit', sans-serif;
|
| 154 |
font-size: 1rem;
|
| 155 |
color: var(--text);
|
|
|
|
| 157 |
transition: all 0.3s ease;
|
| 158 |
box-shadow: var(--shadow-sm);
|
| 159 |
}
|
|
|
|
| 160 |
.form-control:hover {
|
| 161 |
border-color: var(--border-light);
|
| 162 |
}
|
|
|
|
| 163 |
.form-control:focus {
|
| 164 |
background: var(--surface);
|
| 165 |
outline: none;
|
|
|
|
| 167 |
box-shadow: 0 0 0 4px rgba(25, 135, 84, 0.1), var(--shadow-md);
|
| 168 |
transform: translateY(-1px);
|
| 169 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 170 |
.predict-btn {
|
| 171 |
background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
|
| 172 |
color: white;
|
|
|
|
| 183 |
overflow: hidden;
|
| 184 |
transition: all 0.3s ease;
|
| 185 |
box-shadow: 0 4px 15px rgba(26, 93, 58, 0.3);
|
| 186 |
+
display: flex;
|
| 187 |
+
align-items: center;
|
| 188 |
+
justify-content: center;
|
| 189 |
+
gap: 10px;
|
| 190 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 191 |
.predict-btn:hover {
|
| 192 |
transform: translateY(-2px);
|
| 193 |
box-shadow: 0 6px 25px rgba(26, 93, 58, 0.4);
|
| 194 |
}
|
| 195 |
|
| 196 |
+
/* --- LOADER STYLES --- */
|
| 197 |
+
#loader-overlay {
|
| 198 |
+
position: fixed;
|
| 199 |
+
top: 0;
|
| 200 |
+
left: 0;
|
| 201 |
+
width: 100%;
|
| 202 |
+
height: 100%;
|
| 203 |
+
background: rgba(255, 255, 255, 0.85);
|
| 204 |
+
backdrop-filter: blur(8px);
|
| 205 |
+
display: none; /* Hidden by default */
|
| 206 |
+
justify-content: center;
|
| 207 |
+
align-items: center;
|
| 208 |
+
flex-direction: column;
|
| 209 |
+
z-index: 9999;
|
| 210 |
+
}
|
| 211 |
+
.loader-spinner {
|
| 212 |
+
width: 80px;
|
| 213 |
+
height: 80px;
|
| 214 |
+
border: 6px solid var(--bg-light);
|
| 215 |
+
border-top: 6px solid var(--color-primary);
|
| 216 |
+
border-radius: 50%;
|
| 217 |
+
animation: spin 1s linear infinite;
|
| 218 |
+
margin-bottom: 20px;
|
| 219 |
+
box-shadow: var(--shadow-md);
|
| 220 |
+
}
|
| 221 |
+
.loader-text {
|
| 222 |
+
font-weight: 600;
|
| 223 |
+
color: var(--color-primary);
|
| 224 |
+
font-size: 1.2rem;
|
| 225 |
+
letter-spacing: 1px;
|
| 226 |
+
animation: pulse 1.5s ease-in-out infinite;
|
| 227 |
}
|
| 228 |
+
@keyframes spin {
|
| 229 |
+
0% { transform: rotate(0deg); }
|
| 230 |
+
100% { transform: rotate(360deg); }
|
|
|
|
| 231 |
}
|
| 232 |
+
@keyframes pulse {
|
| 233 |
+
0%, 100% { opacity: 1; transform: scale(1); }
|
| 234 |
+
50% { opacity: 0.6; transform: scale(1.05); }
|
| 235 |
+
}
|
| 236 |
+
/* -------------------- */
|
| 237 |
|
| 238 |
.result-container {
|
| 239 |
display: grid;
|
|
|
|
| 243 |
margin-bottom: var(--space-2xl);
|
| 244 |
animation: fadeInUp 0.6s ease-out;
|
| 245 |
}
|
|
|
|
| 246 |
@media (max-width: 968px) {
|
| 247 |
.result-container {
|
| 248 |
grid-template-columns: 1fr;
|
| 249 |
}
|
| 250 |
}
|
|
|
|
| 251 |
.left-container,
|
| 252 |
.right-container {
|
| 253 |
background: var(--surface);
|
|
|
|
| 259 |
position: relative;
|
| 260 |
overflow: hidden;
|
| 261 |
}
|
|
|
|
| 262 |
.left-container::before,
|
| 263 |
.right-container::before {
|
| 264 |
content: '';
|
|
|
|
| 269 |
height: 3px;
|
| 270 |
background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-accent) 100%);
|
| 271 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 272 |
.fertilizer-name {
|
| 273 |
background: linear-gradient(135deg, rgba(26, 93, 58, 0.08) 0%, rgba(25, 135, 84, 0.08) 100%);
|
| 274 |
color: var(--color-primary);
|
|
|
|
| 281 |
margin: var(--space-md) 0;
|
| 282 |
box-shadow: var(--shadow-sm);
|
| 283 |
}
|
|
|
|
| 284 |
.fertilizer-info {
|
| 285 |
background: var(--bg-light);
|
| 286 |
padding: var(--space-lg);
|
|
|
|
| 291 |
color: var(--text);
|
| 292 |
font-size: 1.05rem;
|
| 293 |
}
|
| 294 |
+
.section-heading {
|
|
|
|
| 295 |
color: var(--color-primary);
|
| 296 |
font-weight: 600;
|
| 297 |
+
text-align: center;
|
| 298 |
+
margin-bottom: var(--space-lg);
|
| 299 |
+
font-size: 1.5rem;
|
| 300 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 301 |
.form-row {
|
| 302 |
display: grid;
|
| 303 |
grid-template-columns: 1fr 1fr;
|
| 304 |
gap: var(--space-md);
|
| 305 |
margin-bottom: 0;
|
| 306 |
}
|
|
|
|
| 307 |
@media (max-width: 768px) {
|
| 308 |
.form-row {
|
| 309 |
grid-template-columns: 1fr;
|
| 310 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 311 |
}
|
| 312 |
+
@keyframes fadeInUp {
|
| 313 |
+
from { opacity: 0; transform: translateY(30px); }
|
| 314 |
+
to { opacity: 1; transform: translateY(0); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 315 |
}
|
| 316 |
</style>
|
| 317 |
</head>
|
| 318 |
|
| 319 |
<body>
|
| 320 |
+
<!-- Full Screen Loader Overlay -->
|
| 321 |
+
<div id="loader-overlay">
|
| 322 |
+
<div class="loader-spinner"></div>
|
| 323 |
+
<div class="loader-text">Analyzing Soil Conditions...</div>
|
| 324 |
+
</div>
|
| 325 |
+
|
| 326 |
<div class="heading">
|
| 327 |
<i class="bi bi-flower2"></i>
|
| 328 |
<h1>Fertilizer Recommender & Usage Requirement Estimator</h1>
|
|
|
|
| 330 |
</div>
|
| 331 |
|
| 332 |
<div class="main-container">
|
| 333 |
+
<!-- Added id="predictionForm" for JS handling -->
|
| 334 |
+
<form method="post" id="predictionForm" class="input-container">
|
| 335 |
<div class="form-row">
|
| 336 |
<div class="form-group">
|
| 337 |
<label for="temperature"><i class="bi bi-thermometer-half"></i> Temperature (°C)</label>
|
|
|
|
| 416 |
|
| 417 |
<div class="right-container">
|
| 418 |
<h3 class="section-heading">Optimal Fertilizer Usage (kg/Acres)</h3>
|
| 419 |
+
<div class="gauge-container" style="display: flex; justify-content: center;">
|
| 420 |
<div id="gauge"></div>
|
| 421 |
</div>
|
| 422 |
<script>
|
|
|
|
| 426 |
mode: 'gauge+number',
|
| 427 |
value: optimalUsage,
|
| 428 |
gauge: {
|
| 429 |
+
axis: { range: [0, 100], tickwidth: 2, tickcolor: "#1a5d3a" },
|
|
|
|
|
|
|
|
|
|
|
|
|
| 430 |
bar: { color: "#198754" },
|
| 431 |
bgcolor: "white",
|
|
|
|
| 432 |
borderwidth: 2,
|
| 433 |
steps: [
|
| 434 |
{ range: [0, 33], color: "#e8f5e9" },
|
| 435 |
{ range: [33, 66], color: "#a5d6a7" },
|
| 436 |
{ range: [66, 100], color: "#66bb6a" }
|
| 437 |
+
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 438 |
}
|
| 439 |
}];
|
|
|
|
| 440 |
var layout = {
|
| 441 |
+
width: 350, height: 250,
|
|
|
|
| 442 |
margin: { t: 25, b: 25, l: 25, r: 25 },
|
| 443 |
paper_bgcolor: 'rgba(0,0,0,0)',
|
| 444 |
+
font: { family: 'Outfit, sans-serif', color: '#1f2937' }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 445 |
};
|
| 446 |
+
Plotly.newPlot('gauge', gaugeData, layout, {responsive: true, displayModeBar: false});
|
|
|
|
| 447 |
</script>
|
| 448 |
</div>
|
| 449 |
</div>
|
| 450 |
{% endif %}
|
| 451 |
</div>
|
| 452 |
+
|
| 453 |
+
<!-- Script to Trigger Loader -->
|
| 454 |
+
<script>
|
| 455 |
+
document.getElementById('predictionForm').addEventListener('submit', function() {
|
| 456 |
+
// Show the loader overlay
|
| 457 |
+
document.getElementById('loader-overlay').style.display = 'flex';
|
| 458 |
+
|
| 459 |
+
// Optional: Disable the button to prevent double submission
|
| 460 |
+
const btn = this.querySelector('.predict-btn');
|
| 461 |
+
btn.disabled = true;
|
| 462 |
+
btn.innerHTML = '<i class="bi bi-hourglass-split"></i> Processing...';
|
| 463 |
+
});
|
| 464 |
+
</script>
|
| 465 |
</body>
|
| 466 |
|
| 467 |
</html>
|