forked from omroy07/AgriTech
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdisease.html
More file actions
280 lines (255 loc) · 11 KB
/
disease.html
File metadata and controls
280 lines (255 loc) · 11 KB
1
2
3
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
66
67
68
69
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="icon" type="image/png" href="images/logo.png">
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Plant Disease Detection - AI Powered Diagnosis</title>
<link rel="stylesheet" href="disease.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css" />
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap" rel="stylesheet" />
</head>
<body>
<!-- Enhanced Navbar -->
<header class="navbar">
<div class="nav-container">
<a href="main.html" class="logo">
<img src="images/logo.png" alt="AgriTech">
<span>AgriTech</span>
</a>
<nav class="nav-links">
<a href="index.html">Home</a>
<a href="main.html">Dashboard</a>
<a href="feed-back.html">Feedback</a>
</nav>
<button class="theme-toggle" id="themeToggle">
<i class="fas fa-moon"></i>
<span>Dark Mode</span>
</button>
</div>
</header>
<!-- Hero Section -->
<section class="hero-section">
<div class="hero-container">
<h1 class="hero-title">Plant Disease Detection</h1>
<p class="hero-subtitle">AI-Powered Plant Health Diagnosis System</p>
</div>
</section>
<!-- Main Content -->
<main class="main-wrapper" id="analysis">
<div class="main-content">
<div class="analysis-section">
<h2>🔬 AI Disease Analysis</h2>
<div id="modelStatus" class="status-indicator status-success">
✅ AI Model Ready - Upload an image to begin analysis
</div>
<div class="upload-container">
<div class="upload-zone">
<div class="upload-area" id="uploadArea">
<div class="upload-icon">📸</div>
<div class="upload-text">
<strong>Drop your plant image here</strong><br />
or click to browse files<br />
<small style="opacity: 0.7">Supports JPG, PNG, WebP formats</small>
</div>
</div>
<input type="file" id="fileInput" class="file-input" accept="image/*" />
<center>
<button class="btn" id="analyzeBtn" disabled>
🔍 Analyze Plant Health
</button>
</center>
</div>
<div class="results-zone">
<div class="preview-container" id="previewContainer">
<div class="no-results">📷 Upload an image to get started</div>
</div>
<div class="loading" id="loading">
<div class="spinner"></div>
<p>🧠 AI is analyzing your plant...</p>
</div>
<div id="results"></div>
<center style="margin-top: 15px;">
<button id="downloadPdfBtn" class="btn" style="display:none;">
📄 Download Result as PDF
</button>
</center>
</div>
</div>
</div>
</div>
<!-- Features Section -->
<div class="features-section" id="features">
<h2 style="text-align: center; color: var(--color-brand); font-size: 2rem; margin-bottom: 20px;">
✨ Key Features
</h2>
<div class="features-grid">
<div class="feature-card" onclick="openModal('accuracyModal')">
<div class="feature-icon">🎯</div>
<h3>High Accuracy</h3>
<p>Advanced machine learning algorithms for precise disease identification</p>
</div>
<div class="feature-card" onclick="openModal('speedModal')">
<div class="feature-icon">⚡</div>
<h3>Instant Results</h3>
<p>Get comprehensive analysis within seconds of uploading</p>
</div>
<div class="feature-card" onclick="openModal('treatmentModal')">
<div class="feature-icon">💊</div>
<h3>Treatment Recommendations</h3>
<p>Detailed treatment suggestions and prevention tips</p>
</div>
<div class="feature-card" onclick="openModal('plantsModal')">
<div class="feature-icon">🌿</div>
<h3>Multiple Plant Types</h3>
<p>Support for various crops and plant species</p>
</div>
</div>
</div>
</main>
<!-- Modals (keeping your existing modals) -->
<div id="accuracyModal" class="modal">
<div class="modal-content">
<span class="close" onclick="closeModal('accuracyModal')">×</span>
<h2>🎯 High Accuracy Detection</h2>
<div class="modal-section">
<h3>Advanced AI Technology</h3>
<p>Our system uses state-of-the-art deep learning models trained on extensive datasets containing thousands of plant images.</p>
</div>
</div>
</div>
<div id="speedModal" class="modal">
<div class="modal-content">
<span class="close" onclick="closeModal('speedModal')">×</span>
<h2>⚡ Instant Results</h2>
<div class="modal-section">
<h3>Lightning-Fast Analysis</h3>
<p>Our optimized AI model processes your plant images in real-time.</p>
</div>
</div>
</div>
<div id="treatmentModal" class="modal">
<div class="modal-content">
<span class="close" onclick="closeModal('treatmentModal')">×</span>
<h2>💊 Treatment Recommendations</h2>
<div class="modal-section">
<h3>Comprehensive Treatment Plans</h3>
<p>Each diagnosis comes with detailed, actionable treatment recommendations.</p>
</div>
</div>
</div>
<div id="plantsModal" class="modal">
<div class="modal-content">
<span class="close" onclick="closeModal('plantsModal')">×</span>
<h2>🌿 Supported Plant Types</h2>
<div class="modal-section">
<h3>Comprehensive Plant Database</h3>
<p>Our AI system has been trained to identify diseases across a wide variety of plant species.</p>
</div>
</div>
</div>
<!-- Footer -->
<style>
.site-footer {background: linear-gradient(135deg,#2e7d32,#66bb6a); color:#fff; margin-top:80px; padding: 2rem 1.25rem;}
.site-footer .footer-inner {max-width:1200px;margin:0 auto; display:grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap:1.5rem; align-items:flex-start;}
.footer-brand {display:flex;flex-direction:column;gap:.5rem}
.footer-logo {width:48px;height:48px;border-radius:8px;object-fit:cover;background:#fff;padding:4px}
.site-footer h3,.site-footer h4{margin:0 0 .5rem 0}
.site-footer p {margin:0;opacity:.9}
.site-footer ul{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:.4rem}
.site-footer a{color:#fff;text-decoration:none;opacity:.9;transition:opacity .2s}
.site-footer a:hover{opacity:1;text-decoration:underline}
.footer-bottom{max-width:1200px;margin:1rem auto 0; padding-top:1rem; border-top:1px solid rgba(255,255,255,.25); text-align:center; font-size:.9rem; opacity:.9}
.social-media {display:flex;gap:1rem;margin-top:.5rem}
.social-media a{display:flex;align-items:center;justify-content:center;width:40px;height:40px;background:rgba(255,255,255,.1);border-radius:50%;transition:all .3s ease;font-size:1.2rem}
.social-media a:hover{background:rgba(255,255,255,.2);transform:translateY(-2px)}
</style>
<footer class="site-footer">
<div class="footer-inner">
<div class="footer-brand">
<img src="images/logo.png" alt="AgriTech logo" class="footer-logo">
<h3>AgriTech</h3>
<p>Empowering India's Farming Future</p>
<div class="social-media">
<a href="https://instagram.com" target="_blank"><i class="fab fa-instagram"></i></a>
<a href="https://github.com/omroy07" target="_blank"><i class="fab fa-github"></i></a>
<a href="https://www.linkedin.com/in/om-roy-3b809628a/" target="_blank"><i class="fab fa-linkedin"></i></a>
</div>
</div>
<div class="footer-links">
<h4>Quick Links</h4>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="main.html">Dashboard</a></li>
<li><a href="feed-back.html">Feedback</a></li>
<li><a href="chat.html">AI Assistant</a></li>
</ul>
</div>
<div class="footer-links">
<h4>Tools</h4>
<ul>
<li><a href="#">Crop Recommendation</a></li>
<li><a href="#">Yield Prediction</a></li>
<li><a href="disease.html">Disease Detector</a></li>
</ul>
</div>
</div>
<div class="footer-bottom">© 2025 AgriTech • Made for farmers</div>
</footer>
<!-- Chatbot Button -->
<a href="chat.html" id="chatbotBtn" title="Chat with us">
<i class="fas fa-robot"></i>
</a>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs"></script>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow-models/mobilenet"></script>
<script src="disease.js"></script>
<script>
// Theme Toggle
const themeToggle = document.getElementById('themeToggle');
const html = document.documentElement;
const savedTheme = localStorage.getItem('theme') || 'light';
html.setAttribute('data-theme', savedTheme);
updateThemeButton(savedTheme);
themeToggle.addEventListener('click', () => {
const currentTheme = html.getAttribute('data-theme');
const newTheme = currentTheme === 'light' ? 'dark' : 'light';
html.setAttribute('data-theme', newTheme);
localStorage.setItem('theme', newTheme);
updateThemeButton(newTheme);
});
function updateThemeButton(theme) {
const icon = themeToggle.querySelector('i');
const text = themeToggle.querySelector('span');
if (theme === 'dark') {
icon.className = 'fas fa-sun';
text.textContent = 'Light Mode';
} else {
icon.className = 'fas fa-moon';
text.textContent = 'Dark Mode';
}
}
// Smooth Scroll
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault();
const target = document.querySelector(this.getAttribute('href'));
if (target) {
target.scrollIntoView({ behavior: 'smooth', block: 'start' });
}
});
});
// Modal Functions
function openModal(modalId) {
document.getElementById(modalId).style.display = 'block';
}
function closeModal(modalId) {
document.getElementById(modalId).style.display = 'none';
}
window.onclick = function(event) {
if (event.target.classList.contains('modal')) {
event.target.style.display = 'none';
}
}
</script>
</body>
</html>