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
|
|
| 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>Crop Recommendation Predictor</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
|
| 9 |
+
</head>
|
| 10 |
+
<body class="bg-gradient-to-br from-green-50 to-emerald-100 min-h-screen flex items-center justify-center p-4">
|
| 11 |
+
<div class="container mx-auto max-w-xl">
|
| 12 |
+
<div class="bg-white shadow-2xl rounded-2xl overflow-hidden transform transition-all duration-300 hover:scale-105">
|
| 13 |
+
<div class="bg-gradient-to-r from-green-500 to-emerald-600 p-6 text-center">
|
| 14 |
+
<h1 class="text-3xl font-extrabold text-white flex items-center justify-center gap-3">
|
| 15 |
+
<i class="fas fa-seedling"></i>
|
| 16 |
+
Crop Recommendation
|
| 17 |
+
</h1>
|
| 18 |
+
<p class="text-white opacity-80 mt-2">Optimize Your Agricultural Insights</p>
|
| 19 |
+
</div>
|
| 20 |
+
|
| 21 |
+
<form action="/predict" method="POST" id="predictionForm" class="p-6 space-y-4">
|
| 22 |
+
<div class="grid grid-cols-2 gap-4">
|
| 23 |
+
<div>
|
| 24 |
+
<label class="block text-gray-700 font-semibold mb-2 flex items-center">
|
| 25 |
+
<i class="fas fa-leaf mr-2 text-green-600"></i>
|
| 26 |
+
Nitrogen
|
| 27 |
+
</label>
|
| 28 |
+
<input
|
| 29 |
+
type="number"
|
| 30 |
+
step="any"
|
| 31 |
+
name="Nitrogen"
|
| 32 |
+
placeholder="Enter Nitrogen Level"
|
| 33 |
+
class="w-full px-4 py-2 border-2 border-green-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-green-400 transition duration-300"
|
| 34 |
+
required
|
| 35 |
+
>
|
| 36 |
+
</div>
|
| 37 |
+
<div>
|
| 38 |
+
<label class="block text-gray-700 font-semibold mb-2 flex items-center">
|
| 39 |
+
<i class="fas fa-tint mr-2 text-blue-600"></i>
|
| 40 |
+
Phosphorus
|
| 41 |
+
</label>
|
| 42 |
+
<input
|
| 43 |
+
type="number"
|
| 44 |
+
step="any"
|
| 45 |
+
name="Phosphorus"
|
| 46 |
+
placeholder="Enter Phosphorus Level"
|
| 47 |
+
class="w-full px-4 py-2 border-2 border-green-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-green-400 transition duration-300"
|
| 48 |
+
required
|
| 49 |
+
>
|
| 50 |
+
</div>
|
| 51 |
+
</div>
|
| 52 |
+
|
| 53 |
+
<div class="grid grid-cols-2 gap-4">
|
| 54 |
+
<div>
|
| 55 |
+
<label class="block text-gray-700 font-semibold mb-2 flex items-center">
|
| 56 |
+
<i class="fas fa-bolt mr-2 text-yellow-600"></i>
|
| 57 |
+
Potassium
|
| 58 |
+
</label>
|
| 59 |
+
<input
|
| 60 |
+
type="number"
|
| 61 |
+
step="any"
|
| 62 |
+
name="Potassium"
|
| 63 |
+
placeholder="Enter Potassium Level"
|
| 64 |
+
class="w-full px-4 py-2 border-2 border-green-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-green-400 transition duration-300"
|
| 65 |
+
required
|
| 66 |
+
>
|
| 67 |
+
</div>
|
| 68 |
+
<div>
|
| 69 |
+
<label class="block text-gray-700 font-semibold mb-2 flex items-center">
|
| 70 |
+
<i class="fas fa-thermometer-half mr-2 text-red-600"></i>
|
| 71 |
+
Temperature
|
| 72 |
+
</label>
|
| 73 |
+
<input
|
| 74 |
+
type="number"
|
| 75 |
+
step="any"
|
| 76 |
+
name="temperature"
|
| 77 |
+
placeholder="Enter Temperature"
|
| 78 |
+
class="w-full px-4 py-2 border-2 border-green-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-green-400 transition duration-300"
|
| 79 |
+
required
|
| 80 |
+
>
|
| 81 |
+
</div>
|
| 82 |
+
</div>
|
| 83 |
+
|
| 84 |
+
<div class="grid grid-cols-2 gap-4">
|
| 85 |
+
<div>
|
| 86 |
+
<label class="block text-gray-700 font-semibold mb-2 flex items-center">
|
| 87 |
+
<i class="fas fa-cloud mr-2 text-blue-400"></i>
|
| 88 |
+
Humidity
|
| 89 |
+
</label>
|
| 90 |
+
<input
|
| 91 |
+
type="number"
|
| 92 |
+
step="any"
|
| 93 |
+
name="humidity"
|
| 94 |
+
placeholder="Enter Humidity Level"
|
| 95 |
+
class="w-full px-4 py-2 border-2 border-green-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-green-400 transition duration-300"
|
| 96 |
+
required
|
| 97 |
+
>
|
| 98 |
+
</div>
|
| 99 |
+
<div>
|
| 100 |
+
<label class="block text-gray-700 font-semibold mb-2 flex items-center">
|
| 101 |
+
<i class="fas fa-flask mr-2 text-purple-600"></i>
|
| 102 |
+
pH Level
|
| 103 |
+
</label>
|
| 104 |
+
<input
|
| 105 |
+
type="number"
|
| 106 |
+
step="any"
|
| 107 |
+
name="ph"
|
| 108 |
+
placeholder="Enter pH Level"
|
| 109 |
+
class="w-full px-4 py-2 border-2 border-green-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-green-400 transition duration-300"
|
| 110 |
+
required
|
| 111 |
+
>
|
| 112 |
+
</div>
|
| 113 |
+
</div>
|
| 114 |
+
|
| 115 |
+
<div>
|
| 116 |
+
<label class="block text-gray-700 font-semibold mb-2 flex items-center">
|
| 117 |
+
<i class="fas fa-water mr-2 text-blue-500"></i>
|
| 118 |
+
Rainfall
|
| 119 |
+
</label>
|
| 120 |
+
<input
|
| 121 |
+
type="number"
|
| 122 |
+
step="any"
|
| 123 |
+
name="rainfall"
|
| 124 |
+
placeholder="Enter Rainfall Amount"
|
| 125 |
+
class="w-full px-4 py-2 border-2 border-green-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-green-400 transition duration-300"
|
| 126 |
+
required
|
| 127 |
+
>
|
| 128 |
+
</div>
|
| 129 |
+
|
| 130 |
+
<button
|
| 131 |
+
type="submit"
|
| 132 |
+
class="w-full bg-gradient-to-r from-green-500 to-emerald-600 text-white font-bold py-3 rounded-lg hover:from-green-600 hover:to-emerald-700 transition duration-300 transform hover:scale-105 flex items-center justify-center gap-2"
|
| 133 |
+
>
|
| 134 |
+
<i class="fas fa-chart-line"></i>
|
| 135 |
+
Predict Crop
|
| 136 |
+
</button>
|
| 137 |
+
</form>
|
| 138 |
+
|
| 139 |
+
<!-- Prediction Result Section -->
|
| 140 |
+
{% if prediction_text %}
|
| 141 |
+
<div class="bg-gradient-to-r from-green-100 to-emerald-100 p-6 text-center">
|
| 142 |
+
<div class="flex items-center justify-center mb-4">
|
| 143 |
+
<i class="fas fa-seedling text-4xl text-green-600 mr-3"></i>
|
| 144 |
+
<h2 class="text-2xl font-bold text-green-800">Recommended Crop</h2>
|
| 145 |
+
</div>
|
| 146 |
+
<p class="text-xl text-green-700 font-semibold">
|
| 147 |
+
{{ prediction_text }}
|
| 148 |
+
</p>
|
| 149 |
+
</div>
|
| 150 |
+
{% endif %}
|
| 151 |
+
</div>
|
| 152 |
+
|
| 153 |
+
<div class="mt-6 text-center text-gray-500 text-sm">
|
| 154 |
+
© 2025 Crop Recommendation | Created by <a href="https://github.com/yourusername" class="text-green-600 hover:underline">Swapnil Patil</a>
|
| 155 |
+
</div>
|
| 156 |
+
</div>
|
| 157 |
+
</body>
|
| 158 |
+
</html>
|