Spaces:
Sleeping
Sleeping
Update templates/index.html
#1
by
RushiMane2003
- opened
- templates/index.html +161 -142
templates/index.html
CHANGED
@@ -1,143 +1,162 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
<
|
4 |
-
<
|
5 |
-
<meta
|
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 |
-
max-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
border:
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
max-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
<
|
51 |
-
|
52 |
-
|
53 |
-
<
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
<
|
75 |
-
|
76 |
-
<li>
|
77 |
-
<li>
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
<
|
86 |
-
|
87 |
-
</
|
88 |
-
<
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
<
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
<
|
99 |
-
|
100 |
-
<option value="
|
101 |
-
<option value="
|
102 |
-
<option value="
|
103 |
-
<option value="
|
104 |
-
<option value="
|
105 |
-
<option value="
|
106 |
-
<option value="
|
107 |
-
<option value="
|
108 |
-
<option value="
|
109 |
-
<option value="
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
<
|
124 |
-
<div class="
|
125 |
-
<
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
</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>Plant Disease Detector</title>
|
7 |
+
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
|
8 |
+
<style>
|
9 |
+
body {
|
10 |
+
background-color: #f8f9fa;
|
11 |
+
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
12 |
+
}
|
13 |
+
.hero-section {
|
14 |
+
background-color: #28a745;
|
15 |
+
color: white;
|
16 |
+
padding: 3rem 0;
|
17 |
+
margin-bottom: 2rem;
|
18 |
+
}
|
19 |
+
.upload-container {
|
20 |
+
background-color: white;
|
21 |
+
border-radius: 10px;
|
22 |
+
padding: 2rem;
|
23 |
+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
24 |
+
}
|
25 |
+
.instructions {
|
26 |
+
background-color: #e9f7ef;
|
27 |
+
border-left: 4px solid #28a745;
|
28 |
+
padding: 1rem;
|
29 |
+
margin-bottom: 1.5rem;
|
30 |
+
}
|
31 |
+
.preview-container {
|
32 |
+
max-width: 300px;
|
33 |
+
max-height: 300px;
|
34 |
+
overflow: hidden;
|
35 |
+
margin: 0 auto;
|
36 |
+
border: 2px dashed #dee2e6;
|
37 |
+
border-radius: 5px;
|
38 |
+
display: flex;
|
39 |
+
align-items: center;
|
40 |
+
justify-content: center;
|
41 |
+
}
|
42 |
+
#imagePreview {
|
43 |
+
max-width: 100%;
|
44 |
+
max-height: 100%;
|
45 |
+
display: none;
|
46 |
+
}
|
47 |
+
</style>
|
48 |
+
</head>
|
49 |
+
<body>
|
50 |
+
<div class="hero-section">
|
51 |
+
<div class="container text-center">
|
52 |
+
<h1 class="display-4">Plant Disease & Pest Detector</h1>
|
53 |
+
<p class="lead">Upload an image of your plant to detect diseases and pests</p>
|
54 |
+
</div>
|
55 |
+
</div>
|
56 |
+
|
57 |
+
<div class="container mb-5">
|
58 |
+
{% with messages = get_flashed_messages() %}
|
59 |
+
{% if messages %}
|
60 |
+
{% for message in messages %}
|
61 |
+
<div class="alert alert-warning alert-dismissible fade show" role="alert">
|
62 |
+
{{ message }}
|
63 |
+
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
64 |
+
</div>
|
65 |
+
{% endfor %}
|
66 |
+
{% endif %}
|
67 |
+
{% endwith %}
|
68 |
+
|
69 |
+
<div class="row justify-content-center">
|
70 |
+
<div class="col-md-8">
|
71 |
+
<div class="upload-container">
|
72 |
+
<div class="instructions">
|
73 |
+
<h5>How to use:</h5>
|
74 |
+
<ol>
|
75 |
+
<li>Select an image of your plant (preferably showing affected areas)</li>
|
76 |
+
<li>Enter the name of the plant (e.g., Tomato, Rice, Potato)</li>
|
77 |
+
<li>Click "Analyze Plant" to detect diseases or pests</li>
|
78 |
+
</ol>
|
79 |
+
</div>
|
80 |
+
|
81 |
+
<form action="/analyze" method="post" enctype="multipart/form-data">
|
82 |
+
<div class="mb-4">
|
83 |
+
<div class="preview-container mb-3">
|
84 |
+
<img id="imagePreview" src="#" alt="Image Preview">
|
85 |
+
<span id="previewPlaceholder">Image preview will appear here</span>
|
86 |
+
</div>
|
87 |
+
<label for="plant_image" class="form-label">Upload Plant Image</label>
|
88 |
+
<input class="form-control" type="file" id="plant_image" name="plant_image" accept="image/*" required onchange="previewImage(event)">
|
89 |
+
</div>
|
90 |
+
|
91 |
+
<div class="mb-4">
|
92 |
+
<label for="plant_name" class="form-label">Plant Name</label>
|
93 |
+
<input type="text" class="form-control" id="plant_name" name="plant_name" placeholder="e.g., Tomato, Rice, Potato" required>
|
94 |
+
</div>
|
95 |
+
|
96 |
+
<div class="mb-4">
|
97 |
+
<label for="language" class="form-label">Response Language</label>
|
98 |
+
<select class="form-control" id="language" name="language" required>
|
99 |
+
<option value="English">English</option>
|
100 |
+
<option value="Hindi">Hindi</option>
|
101 |
+
<option value="Bengali">Bengali</option>
|
102 |
+
<option value="Telugu">Telugu</option>
|
103 |
+
<option value="Marathi">Marathi</option>
|
104 |
+
<option value="Tamil">Tamil</option>
|
105 |
+
<option value="Gujarati">Gujarati</option>
|
106 |
+
<option value="Urdu">Urdu</option>
|
107 |
+
<option value="Kannada">Kannada</option>
|
108 |
+
<option value="Odia">Odia</option>
|
109 |
+
<option value="Malayalam">Malayalam</option>
|
110 |
+
</select>
|
111 |
+
</div>
|
112 |
+
|
113 |
+
<div class="d-grid">
|
114 |
+
<button type="submit" class="btn btn-success btn-lg">Analyze Plant</button>
|
115 |
+
</div>
|
116 |
+
</form>
|
117 |
+
</div>
|
118 |
+
</div>
|
119 |
+
</div>
|
120 |
+
</div>
|
121 |
+
|
122 |
+
<!-- Loading Overlay -->
|
123 |
+
<div id="loadingOverlay" style="display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(255, 255, 255, 0.8); z-index: 1050; align-items: center; justify-content: center;">
|
124 |
+
<div class="text-center">
|
125 |
+
<div class="spinner-border text-success" role="status" style="width: 4rem; height: 4rem;">
|
126 |
+
<span class="visually-hidden">Loading...</span>
|
127 |
+
</div>
|
128 |
+
<div class="mt-3">
|
129 |
+
<h4>Processing, please wait...</h4>
|
130 |
+
</div>
|
131 |
+
</div>
|
132 |
+
</div>
|
133 |
+
|
134 |
+
<footer class="bg-dark text-white text-center py-3">
|
135 |
+
<div class="container">
|
136 |
+
<p class="mb-0">Plant Disease Detector © 2025 | Powered by Gemini AI</p>
|
137 |
+
</div>
|
138 |
+
</footer>
|
139 |
+
|
140 |
+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
|
141 |
+
<script>
|
142 |
+
function previewImage(event) {
|
143 |
+
var reader = new FileReader();
|
144 |
+
reader.onload = function() {
|
145 |
+
var output = document.getElementById('imagePreview');
|
146 |
+
output.src = reader.result;
|
147 |
+
output.style.display = 'block';
|
148 |
+
document.getElementById('previewPlaceholder').style.display = 'none';
|
149 |
+
};
|
150 |
+
reader.readAsDataURL(event.target.files[0]);
|
151 |
+
}
|
152 |
+
|
153 |
+
// Show loading overlay on form submit
|
154 |
+
document.addEventListener("DOMContentLoaded", function() {
|
155 |
+
const form = document.querySelector("form");
|
156 |
+
form.addEventListener("submit", function() {
|
157 |
+
document.getElementById("loadingOverlay").style.display = "flex";
|
158 |
+
});
|
159 |
+
});
|
160 |
+
</script>
|
161 |
+
</body>
|
162 |
</html>
|