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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import pandas as pd
|
3 |
+
from datetime import datetime
|
4 |
+
|
5 |
+
# Enhanced CSS with premium design and maximum readability
|
6 |
+
custom_css = """
|
7 |
+
/* Light mode variables with enhanced contrast */
|
8 |
+
:root {
|
9 |
+
--primary-green: #1a4d2e;
|
10 |
+
--secondary-green: #2d5a3d;
|
11 |
+
--tertiary-green: #4a7c59;
|
12 |
+
--accent-green: #6bb26b;
|
13 |
+
--light-green: #8bc68b;
|
14 |
+
--forest-green: #0f2818;
|
15 |
+
--mint-green: #9dd49d;
|
16 |
+
--emerald-green: #50c878;
|
17 |
+
--neon-green: #39ff14;
|
18 |
+
|
19 |
+
/* High contrast text colors */
|
20 |
+
--text-primary: #0d1a0d;
|
21 |
+
--text-secondary: #1a2e1a;
|
22 |
+
--text-accent: #2d5a3d;
|
23 |
+
--text-light: #ffffff;
|
24 |
+
--text-muted: #4a7c59;
|
25 |
+
|
26 |
+
/* Enhanced background colors */
|
27 |
+
--bg-primary: #ffffff;
|
28 |
+
--bg-secondary: #f8fdf8;
|
29 |
+
--bg-tertiary: #ecf8ec;
|
30 |
+
--bg-card: #ffffff;
|
31 |
+
--bg-hover: #e8f5e8;
|
32 |
+
--bg-gradient: linear-gradient(135deg, #f8fdf8 0%, #ecf8ec 100%);
|
33 |
+
|
34 |
+
/* Enhanced shadows and effects */
|
35 |
+
--border-color: #6bb26b;
|
36 |
+
--shadow-light: rgba(26, 77, 46, 0.08);
|
37 |
+
--shadow-medium: rgba(26, 77, 46, 0.15);
|
38 |
+
--shadow-heavy: rgba(26, 77, 46, 0.25);
|
39 |
+
--shadow-glow: 0 0 30px rgba(57, 255, 20, 0.3);
|
40 |
+
}
|
41 |
+
/* Dark mode variables */
|
42 |
+
@media (prefers-color-scheme: dark) {
|
43 |
+
:root {
|
44 |
+
--primary-green: #4a9d4a;
|
45 |
+
--secondary-green: #6bb26b;
|
46 |
+
--tertiary-green: #8bc68b;
|
47 |
+
--accent-green: #9dd49d;
|
48 |
+
--light-green: #b8e6b8;
|
49 |
+
--forest-green: #2d5a3d;
|
50 |
+
--mint-green: #6b9279;
|
51 |
+
--emerald-green: #7fbc7f;
|
52 |
+
|
53 |
+
/* Text colors for dark mode */
|
54 |
+
--text-primary: #e8f5e8;
|
55 |
+
--text-secondary: #d0e8d0;
|
56 |
+
--text-light: #ffffff;
|
57 |
+
|
58 |
+
/* Background colors for dark mode */
|
59 |
+
--bg-primary: #1a1f1a;
|
60 |
+
--bg-secondary: #212621;
|
61 |
+
--bg-tertiary: #2d332d;
|
62 |
+
--bg-card: #262b26;
|
63 |
+
--bg-hover: #333833;
|
64 |
+
|
65 |
+
/* Border and shadow for dark mode */
|
66 |
+
--border-color: #6bb26b;
|
67 |
+
--shadow-light: rgba(74, 157, 74, 0.15);
|
68 |
+
--shadow-medium: rgba(74, 157, 74, 0.25);
|
69 |
+
--shadow-heavy: rgba(74, 157, 74, 0.35);
|
70 |
+
}
|
71 |
+
}
|
72 |
+
/* Global body styling */
|
73 |
+
body {
|
74 |
+
background: var(--bg-primary) !important;
|
75 |
+
color: var(--text-primary) !important;
|
76 |
+
transition: all 0.3s ease;
|
77 |
+
}
|
78 |
+
/* Gradio container styling */
|
79 |
+
.gradio-container {
|
80 |
+
background: var(--bg-primary) !important;
|
81 |
+
color: var(--text-primary) !important;
|
82 |
+
}
|
83 |
+
/* Header styling with enhanced green gradients */
|
84 |
+
.header-container {
|
85 |
+
background: linear-gradient(135deg, var(--primary-green) 0%, var(--secondary-green) 50%, var(--tertiary-green) 100%);
|
86 |
+
color: var(--text-light);
|
87 |
+
padding: 3rem 2rem;
|
88 |
+
text-align: center;
|
89 |
+
margin-bottom: 2rem;
|
90 |
+
border-radius: 16px;
|
91 |
+
box-shadow: 0 8px 32px var(--shadow-heavy);
|
92 |
+
border: 1px solid var(--accent-green);
|
93 |
+
position: relative;
|
94 |
+
overflow: hidden;
|
95 |
+
}
|
96 |
+
.header-container::before {
|
97 |
+
content: '';
|
98 |
+
position: absolute;
|
99 |
+
top: 0;
|
100 |
+
left: 0;
|
101 |
+
right: 0;
|
102 |
+
bottom: 0;
|
103 |
+
background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
|
104 |
+
pointer-events: none;
|
105 |
+
}
|
106 |
+
.header-title {
|
107 |
+
font-size: 3rem;
|
108 |
+
font-weight: 800;
|
109 |
+
margin-bottom: 0.8rem;
|
110 |
+
display: flex;
|
111 |
+
align-items: center;
|
112 |
+
justify-content: center;
|
113 |
+
gap: 15px;
|
114 |
+
text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
|
115 |
+
}
|
116 |
+
.header-subtitle {
|
117 |
+
font-size: 1.4rem;
|
118 |
+
opacity: 0.95;
|
119 |
+
margin-bottom: 1rem;
|
120 |
+
font-weight: 500;
|
121 |
+
}
|
122 |
+
/* Enhanced feature cards */
|
123 |
+
.feature-card {
|
124 |
+
background: var(--bg-card);
|
125 |
+
border: 2px solid var(--accent-green);
|
126 |
+
border-radius: 16px;
|
127 |
+
padding: 2rem;
|
128 |
+
margin: 1.5rem 0;
|
129 |
+
box-shadow: 0 6px 20px var(--shadow-light);
|
130 |
+
transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
|
131 |
+
position: relative;
|
132 |
+
overflow: hidden;
|
133 |
+
}
|
134 |
+
.feature-card::before {
|
135 |
+
content: '';
|
136 |
+
position: absolute;
|
137 |
+
top: 0;
|
138 |
+
left: -100%;
|
139 |
+
width: 100%;
|
140 |
+
height: 100%;
|
141 |
+
background: linear-gradient(90deg, transparent, var(--mint-green), transparent);
|
142 |
+
opacity: 0.1;
|
143 |
+
transition: left 0.6s ease;
|
144 |
+
}
|
145 |
+
.feature-card:hover::before {
|
146 |
+
left: 100%;
|
147 |
+
}
|
148 |
+
.feature-card:hover {
|
149 |
+
transform: translateY(-8px) scale(1.02);
|
150 |
+
box-shadow: 0 12px 40px var(--shadow-medium);
|
151 |
+
border-color: var(--emerald-green);
|
152 |
+
}
|
153 |
+
.feature-title {
|
154 |
+
color: var(--primary-green);
|
155 |
+
font-size: 1.6rem;
|
156 |
+
font-weight: 700;
|
157 |
+
margin-bottom: 1rem;
|
158 |
+
display: flex;
|
159 |
+
align-items: center;
|
160 |
+
gap: 12px;
|
161 |
+
}
|
162 |
+
.feature-description {
|
163 |
+
color: var(--text-secondary);
|
164 |
+
line-height: 1.8;
|
165 |
+
margin-bottom: 1.2rem;
|
166 |
+
font-size: 1.1rem;
|
167 |
+
}
|
168 |
+
.feature-list {
|
169 |
+
color: var(--text-secondary);
|
170 |
+
margin-left: 1.5rem;
|
171 |
+
line-height: 1.8;
|
172 |
+
}
|
173 |
+
/* Enhanced coming soon section */
|
174 |
+
.coming-soon {
|
175 |
+
background: linear-gradient(135deg, var(--forest-green) 0%, var(--primary-green) 50%, var(--secondary-green) 100%);
|
176 |
+
color: var(--text-light);
|
177 |
+
padding: 3rem;
|
178 |
+
border-radius: 20px;
|
179 |
+
text-align: center;
|
180 |
+
margin: 3rem 0;
|
181 |
+
box-shadow: 0 10px 40px var(--shadow-heavy);
|
182 |
+
border: 2px solid var(--emerald-green);
|
183 |
+
position: relative;
|
184 |
+
overflow: hidden;
|
185 |
+
}
|
186 |
+
.coming-soon::before {
|
187 |
+
content: 'π';
|
188 |
+
position: absolute;
|
189 |
+
top: 20px;
|
190 |
+
right: 20px;
|
191 |
+
font-size: 2rem;
|
192 |
+
opacity: 0.3;
|
193 |
+
animation: pulse 2s infinite;
|
194 |
+
}
|
195 |
+
@keyframes pulse {
|
196 |
+
0%, 100% { transform: scale(1); opacity: 0.3; }
|
197 |
+
50% { transform: scale(1.1); opacity: 0.6; }
|
198 |
+
}
|
199 |
+
.coming-soon-title {
|
200 |
+
font-size: 2.2rem;
|
201 |
+
font-weight: 800;
|
202 |
+
margin-bottom: 1.5rem;
|
203 |
+
text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
|
204 |
+
}
|
205 |
+
/* Enhanced founder section */
|
206 |
+
.founder-section {
|
207 |
+
background: var(--bg-secondary);
|
208 |
+
border: 3px solid var(--accent-green);
|
209 |
+
border-radius: 16px;
|
210 |
+
padding: 2.5rem;
|
211 |
+
margin: 3rem 0;
|
212 |
+
box-shadow: 0 8px 30px var(--shadow-light);
|
213 |
+
position: relative;
|
214 |
+
}
|
215 |
+
.founder-section::before {
|
216 |
+
content: '';
|
217 |
+
position: absolute;
|
218 |
+
top: -2px;
|
219 |
+
left: -2px;
|
220 |
+
right: -2px;
|
221 |
+
bottom: -2px;
|
222 |
+
background: linear-gradient(45deg, var(--primary-green), var(--accent-green), var(--emerald-green), var(--primary-green));
|
223 |
+
border-radius: 16px;
|
224 |
+
z-index: -1;
|
225 |
+
opacity: 0.1;
|
226 |
+
}
|
227 |
+
.founder-title {
|
228 |
+
color: var(--primary-green);
|
229 |
+
font-size: 1.8rem;
|
230 |
+
font-weight: 700;
|
231 |
+
margin-bottom: 1.5rem;
|
232 |
+
}
|
233 |
+
/* Enhanced button styling */
|
234 |
+
.demo-button {
|
235 |
+
background: linear-gradient(135deg, var(--primary-green) 0%, var(--secondary-green) 100%) !important;
|
236 |
+
color: var(--text-light) !important;
|
237 |
+
border: 2px solid var(--accent-green) !important;
|
238 |
+
padding: 15px 30px !important;
|
239 |
+
border-radius: 12px !important;
|
240 |
+
font-weight: 700 !important;
|
241 |
+
font-size: 1.1rem !important;
|
242 |
+
transition: all 0.3s ease !important;
|
243 |
+
box-shadow: 0 4px 15px var(--shadow-light) !important;
|
244 |
+
text-transform: uppercase !important;
|
245 |
+
letter-spacing: 0.5px !important;
|
246 |
+
}
|
247 |
+
.demo-button:hover {
|
248 |
+
background: linear-gradient(135deg, var(--secondary-green) 0%, var(--tertiary-green) 100%) !important;
|
249 |
+
transform: translateY(-2px) !important;
|
250 |
+
box-shadow: 0 8px 25px var(--shadow-medium) !important;
|
251 |
+
border-color: var(--emerald-green) !important;
|
252 |
+
}
|
253 |
+
/* Enhanced stats/how-to-use grid */
|
254 |
+
.stats-grid {
|
255 |
+
display: grid;
|
256 |
+
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
257 |
+
gap: 1.5rem;
|
258 |
+
margin: 3rem 0;
|
259 |
+
}
|
260 |
+
.stat-card {
|
261 |
+
background: var(--bg-card);
|
262 |
+
border: 2px solid var(--accent-green);
|
263 |
+
border-radius: 16px;
|
264 |
+
padding: 2rem 1.5rem;
|
265 |
+
text-align: center;
|
266 |
+
transition: all 0.3s ease;
|
267 |
+
box-shadow: 0 6px 20px var(--shadow-light);
|
268 |
+
position: relative;
|
269 |
+
overflow: hidden;
|
270 |
+
}
|
271 |
+
.stat-card::before {
|
272 |
+
content: '';
|
273 |
+
position: absolute;
|
274 |
+
top: 0;
|
275 |
+
left: 0;
|
276 |
+
right: 0;
|
277 |
+
height: 4px;
|
278 |
+
background: linear-gradient(90deg, var(--primary-green), var(--accent-green), var(--emerald-green));
|
279 |
+
}
|
280 |
+
.stat-card:hover {
|
281 |
+
transform: translateY(-5px);
|
282 |
+
box-shadow: 0 12px 35px var(--shadow-medium);
|
283 |
+
border-color: var(--emerald-green);
|
284 |
+
}
|
285 |
+
.stat-number {
|
286 |
+
color: var(--primary-green);
|
287 |
+
font-size: 2.5rem;
|
288 |
+
font-weight: 800;
|
289 |
+
margin-bottom: 0.5rem;
|
290 |
+
text-shadow: 1px 1px 2px var(--shadow-light);
|
291 |
+
}
|
292 |
+
.stat-label {
|
293 |
+
color: var(--text-secondary);
|
294 |
+
font-size: 1rem;
|
295 |
+
margin-top: 0.8rem;
|
296 |
+
line-height: 1.6;
|
297 |
+
font-weight: 500;
|
298 |
+
}
|
299 |
+
/* Section headers */
|
300 |
+
h2 {
|
301 |
+
color: var(--primary-green) !important;
|
302 |
+
font-weight: 700 !important;
|
303 |
+
text-shadow: 1px 1px 2px var(--shadow-light) !important;
|
304 |
+
}
|
305 |
+
/* Responsive design */
|
306 |
+
@media (max-width: 768px) {
|
307 |
+
.header-title {
|
308 |
+
font-size: 2.2rem;
|
309 |
+
}
|
310 |
+
|
311 |
+
.stats-grid {
|
312 |
+
grid-template-columns: 1fr;
|
313 |
+
gap: 1rem;
|
314 |
+
}
|
315 |
+
|
316 |
+
.feature-card {
|
317 |
+
padding: 1.5rem;
|
318 |
+
}
|
319 |
+
}
|
320 |
+
/* Scrollbar styling */
|
321 |
+
::-webkit-scrollbar {
|
322 |
+
width: 12px;
|
323 |
+
}
|
324 |
+
::-webkit-scrollbar-track {
|
325 |
+
background: var(--bg-secondary);
|
326 |
+
}
|
327 |
+
::-webkit-scrollbar-thumb {
|
328 |
+
background: var(--accent-green);
|
329 |
+
border-radius: 6px;
|
330 |
+
}
|
331 |
+
::-webkit-scrollbar-thumb:hover {
|
332 |
+
background: var(--primary-green);
|
333 |
+
}
|
334 |
+
"""
|
335 |
+
|
336 |
+
def create_main_content():
|
337 |
+
return """
|
338 |
+
<div class="header-container">
|
339 |
+
<div class="header-title" style="color: #ffffff !important;">
|
340 |
+
πΎ Shafaq's AgriWeather Hub
|
341 |
+
</div>
|
342 |
+
<div class="header-subtitle" style="color: #ffffff !important;">
|
343 |
+
Real-time Weather Data & Smart Farming Assistant
|
344 |
+
</div>
|
345 |
+
<p style="color: #ffffff !important; font-size: 1.3rem; font-weight: 500;">Empowering farmers with precision agriculture through intelligent weather insights and crop management tools</p>
|
346 |
+
</div>
|
347 |
+
"""
|
348 |
+
|
349 |
+
def create_features_section():
|
350 |
+
return """
|
351 |
+
<div class="feature-card">
|
352 |
+
<div class="feature-title">
|
353 |
+
π€οΈ Real-Time Weather Dashboard
|
354 |
+
</div>
|
355 |
+
<div class="feature-description">
|
356 |
+
Get comprehensive weather data tailored for agricultural needs with location-specific insights for optimal farming decisions.
|
357 |
+
</div>
|
358 |
+
<div class="feature-list">
|
359 |
+
β’ Live temperature, humidity, and precipitation data<br>
|
360 |
+
β’ Wind speed and pressure monitoring<br>
|
361 |
+
β’ UV index and visibility tracking<br>
|
362 |
+
β’ 7-day detailed weather forecasts<br>
|
363 |
+
β’ Agricultural weather alerts and warnings
|
364 |
+
</div>
|
365 |
+
</div>
|
366 |
+
<div class="feature-card">
|
367 |
+
<div class="feature-title">
|
368 |
+
π€ AgriBot Assistant
|
369 |
+
</div>
|
370 |
+
<div class="feature-description">
|
371 |
+
Your personal farming advisor powered by AI, providing expert guidance on irrigation, crop management, and seasonal planning.
|
372 |
+
</div>
|
373 |
+
<div class="feature-list">
|
374 |
+
β’ Smart irrigation scheduling recommendations<br>
|
375 |
+
β’ Crop-specific growing advice and tips<br>
|
376 |
+
β’ Pest and disease identification support<br>
|
377 |
+
β’ Soil health and nutrient management guidance<br>
|
378 |
+
β’ Seasonal farming calendar and reminders
|
379 |
+
</div>
|
380 |
+
</div>
|
381 |
+
<div class="feature-card">
|
382 |
+
<div class="feature-title">
|
383 |
+
π± Crop Intelligence System
|
384 |
+
</div>
|
385 |
+
<div class="feature-description">
|
386 |
+
Discover the best crops for your region with detailed growing guides and environmental condition matching.
|
387 |
+
</div>
|
388 |
+
<div class="feature-list">
|
389 |
+
β’ Region-specific crop recommendations<br>
|
390 |
+
β’ Detailed growing conditions and requirements<br>
|
391 |
+
β’ Seasonal planting and harvesting schedules<br>
|
392 |
+
β’ Yield optimization strategies<br>
|
393 |
+
β’ Market price trends and analysis
|
394 |
+
</div>
|
395 |
+
</div>
|
396 |
+
"""
|
397 |
+
|
398 |
+
def create_coming_soon_section():
|
399 |
+
return """
|
400 |
+
<div class="coming-soon">
|
401 |
+
<div class="coming-soon-title" style="color: #ffffff !important;">
|
402 |
+
π Coming Soon: Advanced Features
|
403 |
+
</div>
|
404 |
+
<div style="font-size: 1.1rem; line-height: 1.6; color: #ffffff !important;">
|
405 |
+
<strong style="color: #ffffff !important;">π¬ AI-Powered Plant Doctor</strong><br>
|
406 |
+
<span style="color: #ffffff !important;">Advanced plant identification system that helps diagnose diseases, identify pests, and provides detailed treatment recommendations with step-by-step cure guides</span>
|
407 |
+
<br><br>
|
408 |
+
<strong style="color: #ffffff !important;">π± Mobile App with Offline Capabilities</strong><br>
|
409 |
+
<span style="color: #ffffff !important;">Take AgriWeather Hub with you to the field, even without internet connectivity</span>
|
410 |
+
<br><br>
|
411 |
+
<strong style="color: #ffffff !important;">π Community Farming Network</strong><br>
|
412 |
+
<span style="color: #ffffff !important;">Connect with local farmers, share insights, and access cooperative farming resources</span>
|
413 |
+
</div>
|
414 |
+
</div>
|
415 |
+
"""
|
416 |
+
|
417 |
+
def create_founder_section():
|
418 |
+
return """
|
419 |
+
<div class="founder-section">
|
420 |
+
<div class="founder-title">
|
421 |
+
π¨βπΎ Meet the Visionary Behind AgriWeather Hub
|
422 |
+
</div>
|
423 |
+
<div style="line-height: 2; color: var(--text-primary); font-size: 1.2rem; font-weight: 500;">
|
424 |
+
<strong style="font-size: 1.4rem; color: var(--primary-green);">Shafaq</strong> is a passionate agricultural technology innovator with a deep understanding of modern farming challenges. With a background in both technology and agriculture, Shafaq recognized the critical need for accessible, intelligent farming tools that could help farmers make data-driven decisions.
|
425 |
+
<br><br>
|
426 |
+
<strong style="color: var(--primary-green); font-size: 1.3rem;">π― Vision:</strong> "To democratize precision agriculture by making advanced weather intelligence and farming insights accessible to farmers of all scales, from smallholder farms to large agricultural enterprises."
|
427 |
+
<br><br>
|
428 |
+
<strong style="color: var(--primary-green); font-size: 1.3rem;">π Mission:</strong> Bridging the gap between traditional farming wisdom and modern technology to create sustainable, profitable, and environmentally conscious agricultural practices.
|
429 |
+
<br><br>
|
430 |
+
<strong style="color: #000000 !important; font-size: 1.3rem;">π Background:</strong>
|
431 |
+
<div style="margin-left: 1rem; margin-top: 1rem;">
|
432 |
+
<span style="color: #000000 !important; font-weight: normal !important;">β’ π Agricultural Engineering & Data Science</span><br>
|
433 |
+
<span style="color: #000000 !important; font-weight: normal !important;">β’ πΎ 5+ years in precision agriculture research</span><br>
|
434 |
+
<span style="color: #000000 !important; font-weight: normal !important;">β’ π‘ Multiple agricultural innovation awards</span><br>
|
435 |
+
<span style="color: #000000 !important; font-weight: normal !important;">β’ π€ Collaborated with farming communities across diverse climates</span><br>
|
436 |
+
<span style="color: #000000 !important; font-weight: normal !important;">β’ π± Advocate for sustainable farming practices</span>
|
437 |
+
</div>
|
438 |
+
</div>
|
439 |
+
</div>
|
440 |
+
"""
|
441 |
+
|
442 |
+
def create_how_to_use_section():
|
443 |
+
return """
|
444 |
+
<div class="stats-grid">
|
445 |
+
<div class="stat-card">
|
446 |
+
<div class="stat-number">1οΈβ£</div>
|
447 |
+
<div class="stat-label"><strong style="color: #000000 !important;">Enter Your Location</strong><br><span style="color: #000000 !important;">Simply input your city or coordinates to get localized weather data</span></div>
|
448 |
+
</div>
|
449 |
+
<div class="stat-card">
|
450 |
+
<div class="stat-number" style="color: #000000 !important;">2οΈβ£</div>
|
451 |
+
<div class="stat-label"><strong style="color: #000000 !important;">Choose Your Crops</strong><br><span style="color: #000000 !important;">Select from our extensive crop database for personalized recommendations</span></div>
|
452 |
+
</div>
|
453 |
+
<div class="stat-card">
|
454 |
+
<div class="stat-number" style="color: #000000 !important;">3οΈβ£</div>
|
455 |
+
<div class="stat-label"><strong style="color: #000000 !important;">Get Smart Insights</strong><br><span style="color: #000000 !important;">Receive AI-powered farming advice and weather-based recommendations</span></div>
|
456 |
+
</div>
|
457 |
+
<div class="stat-card">
|
458 |
+
<div class="stat-number" style="color: #000000 !important;">4οΈβ£</div>
|
459 |
+
<div class="stat-label"><strong style="color: #000000 !important;">Take Action</strong><br><span style="color: #000000 !important;">Implement suggested irrigation, planting, and harvesting schedules</span></div>
|
460 |
+
</div>
|
461 |
+
</div>
|
462 |
+
"""
|
463 |
+
|
464 |
+
def launch_demo():
|
465 |
+
return "π Launching AgriWeather Hub Demo... Please wait while we redirect you to the full application!"
|
466 |
+
|
467 |
+
def connect_with_founder():
|
468 |
+
# JavaScript to open LinkedIn in new tab
|
469 |
+
linkedin_url = "https://www.linkedin.com/in/shafaq-mandha-a0b2a4280/"
|
470 |
+
js_code = f"""
|
471 |
+
<script>
|
472 |
+
window.open('{linkedin_url}', '_blank');
|
473 |
+
</script>
|
474 |
+
"""
|
475 |
+
return js_code
|
476 |
+
|
477 |
+
# Create the Gradio interface
|
478 |
+
with gr.Blocks(css=custom_css, title="Shafaq's AgriWeather Hub") as demo:
|
479 |
+
# Main header
|
480 |
+
gr.HTML(create_main_content())
|
481 |
+
|
482 |
+
# How to Use section
|
483 |
+
gr.HTML("<h2 style='color: #4a7c59; text-align: center; margin: 2rem 0;'>π How to Use AgriWeather Hub</h2>")
|
484 |
+
gr.HTML(create_how_to_use_section())
|
485 |
+
|
486 |
+
# Features section
|
487 |
+
with gr.Row():
|
488 |
+
with gr.Column():
|
489 |
+
gr.HTML("<h2 style='color: #4a7c59; text-align: center; margin: 2rem 0;'>π Core Features</h2>")
|
490 |
+
gr.HTML(create_features_section())
|
491 |
+
|
492 |
+
# Coming soon section
|
493 |
+
gr.HTML(create_coming_soon_section())
|
494 |
+
|
495 |
+
# About founder section
|
496 |
+
gr.HTML(create_founder_section())
|
497 |
+
|
498 |
+
# Action buttons
|
499 |
+
with gr.Row():
|
500 |
+
with gr.Column():
|
501 |
+
gr.HTML("""
|
502 |
+
<a href="https://huggingface.co/spaces/Shafaq25/AgriWeather_Hub" target="_blank" style="text-decoration: none;">
|
503 |
+
<button class="demo-button" style="
|
504 |
+
background: linear-gradient(135deg, var(--primary-green) 0%, var(--secondary-green) 50%, var(--emerald-green) 100%) !important;
|
505 |
+
color: #ffffff !important;
|
506 |
+
border: 3px solid var(--neon-green) !important;
|
507 |
+
padding: 20px 40px !important;
|
508 |
+
border-radius: 16px !important;
|
509 |
+
font-weight: 800 !important;
|
510 |
+
font-size: 1.3rem !important;
|
511 |
+
text-transform: uppercase !important;
|
512 |
+
letter-spacing: 1px !important;
|
513 |
+
cursor: pointer !important;
|
514 |
+
box-shadow: var(--shadow-glow), 0 8px 30px var(--shadow-medium) !important;
|
515 |
+
transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
|
516 |
+
display: inline-block !important;
|
517 |
+
width: 100% !important;
|
518 |
+
text-align: center !important;
|
519 |
+
">
|
520 |
+
π Try Live Demo
|
521 |
+
</button>
|
522 |
+
</a>
|
523 |
+
""")
|
524 |
+
|
525 |
+
with gr.Column():
|
526 |
+
gr.HTML("""
|
527 |
+
<a href="https://www.linkedin.com/in/shafaq-mandha-a0b2a4280/" target="_blank" style="text-decoration: none;">
|
528 |
+
<button class="demo-button" style="
|
529 |
+
background: linear-gradient(135deg, var(--primary-green) 0%, var(--secondary-green) 50%, var(--emerald-green) 100%) !important;
|
530 |
+
color: #ffffff !important;
|
531 |
+
border: 3px solid var(--neon-green) !important;
|
532 |
+
padding: 20px 40px !important;
|
533 |
+
border-radius: 16px !important;
|
534 |
+
font-weight: 800 !important;
|
535 |
+
font-size: 1.3rem !important;
|
536 |
+
text-transform: uppercase !important;
|
537 |
+
letter-spacing: 1px !important;
|
538 |
+
cursor: pointer !important;
|
539 |
+
box-shadow: var(--shadow-glow), 0 8px 30px var(--shadow-medium) !important;
|
540 |
+
transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
|
541 |
+
display: inline-block !important;
|
542 |
+
width: 100% !important;
|
543 |
+
text-align: center !important;
|
544 |
+
">
|
545 |
+
π Connect With Me
|
546 |
+
</button>
|
547 |
+
</a>
|
548 |
+
""")
|
549 |
+
|
550 |
+
# Footer with premium styling
|
551 |
+
gr.HTML("""
|
552 |
+
<div style="text-align: center; margin-top: 5rem; padding: 3rem; background: var(--bg-gradient); border-radius: 20px; border: 3px solid var(--accent-green); box-shadow: var(--shadow-glow), 0 15px 50px var(--shadow-medium);">
|
553 |
+
<p style="color: var(--primary-green); font-weight: 900; font-size: 2rem; margin-bottom: 1rem; text-shadow: 2px 2px 4px var(--shadow-light);">
|
554 |
+
πΎ Shafaq's AgriWeather Hub - Cultivating Tomorrow's Agriculture Today β¨
|
555 |
+
</p>
|
556 |
+
<p style="color: var(--text-muted); margin: 1.5rem 0; font-size: 1.1rem; font-weight: 600;">
|
557 |
+
Β© 2024 AgriWeather Hub. All rights reserved. | Made with β€οΈ for farmers worldwide
|
558 |
+
</p>
|
559 |
+
<div style="margin-top: 2rem; padding: 1.5rem; background: var(--bg-card); border-radius: 12px; border: 2px solid var(--mint-green);">
|
560 |
+
<span style="color: var(--primary-green); font-size: 1.2rem; font-weight: 700;">π Sustainable β’ π Data-Driven β’ π€ Community-Focused β’ π¬ Innovation-Led</span>
|
561 |
+
</div>
|
562 |
+
</div>
|
563 |
+
""")
|
564 |
+
|
565 |
+
if __name__ == "__main__":
|
566 |
+
demo.launch(
|
567 |
+
server_name="0.0.0.0",
|
568 |
+
server_port=7860,
|
569 |
+
share=True,
|
570 |
+
show_error=True
|
571 |
+
)
|