-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmap.html
More file actions
299 lines (281 loc) · 18.6 KB
/
map.html
File metadata and controls
299 lines (281 loc) · 18.6 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
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Explore Map - EcoAlert</title>
<link rel="stylesheet" href="css/styles.css">
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY=" crossorigin="anonymous" />
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js" integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo=" crossorigin="anonymous" defer></script>
<script src="js/theme.js"></script>
<script src="js/map.js" type="module"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
</head>
<body class="light-theme">
<div class="container">
<header class="main-header">
<div class="logo">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon"><path d="M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z"/><path d="M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12"/></svg>
<h1>EcoAlert</h1>
<h3>Hack The Nest</h3>
</div>
<nav>
<ul class="nav-links">
<li><a href="index.html">Home</a></li>
<li><a href="ecopoints.html"><span class="Eco-Points"><strong>EcoPoints</strong></span></a></li>
<li><a href="map.html" class="active">Explore Map</a></li>
<li class="user-profile"> <a href="signin.html" id="sign-in">Sign In</a>
</li>
<li>
<button id="theme-toggle" class="theme-toggle" aria-label="Toggle dark mode">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="sun-icon"><circle cx="12" cy="12" r="5"></circle><line x1="12" y1="1" x2="12" y2="3"></line><line x1="12" y1="21" x2="12" y2="23"></line><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line><line x1="1" y1="12" x2="3" y2="12"></line><line x1="21" y1="12" x2="23" y2="12"></line><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line></svg>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="moon-icon" style="display: none;"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path></svg>
</button>
</li>
</ul>
</nav>
</header>
<main class="map-page">
<div class="map-container fade-in delay-1">
<h2 class="fade-in delay-2">Select Location for Environmental Analysis</h2>
<form id="search-form" class="search-form">
<input type="text" class="fade-in delay-3" id="location-input" placeholder="Search your city...">
<button type="submit" id="search-button" style="display: none;" >
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>
</button>
</form>
<div id="map" class="map fade-in delay-4" style="height: 400px; width: 100%;"></div>
<p class="map-instruction fade-in delay-5">Click on the map to select a location or use the search bar above</p>
</div>
<div id="loading-indicator" class="loading-indicator hidden">
<div class="spinner"></div>
<p>Loading data...</p>
</div>
<div id="weather-data" class="weather-data hidden">
<div class="card location-card">
<div class="card-header">
<h3 id="location-name">Location Name</h3>
<p id="location-coordinates">Lat: 0.0000, Lng: 0.0000</p>
<div class="unit-toggle">
<label class="switch">
<input type="checkbox" id="unit-toggle">
<span class="slider round"></span>
</label>
<span id="unit-label">°C</span>
</div>
</div>
<div class="card-content">
<div class="current-weather">
<div class="weather-main">
<img id="weather-icon" src="" alt="Weather icon">
<div class="temperature">
<span id="current-temp">--</span><span id="temp-unit">°C</span>
</div>
<p id="weather-description">Weather description</p>
<p>Feels like <span id="feels-like">--</span><span id="feels-like-unit">°C</span></p>
</div>
<div class="weather-details">
<div class="detail">
<span class="detail-label">Humidity</span>
<span id="humidity">--%</span>
</div>
<div class="detail">
<span class="detail-label">Wind</span>
<span id="wind-speed">-- km/h</span>
</div>
<div class="detail">
<span class="detail-label">Pressure</span>
<span id="pressure">-- hPa</span>
</div>
<div class="detail">
<span class="detail-label">UV Index</span>
<span id="uv-index">--</span>
</div>
<div class="detail">
<span class="detail-label">Visibility</span>
<span id="visibility">-- km</span>
</div>
<div class="detail">
<span class="detail-label">Air Quality</span>
<span id="air-quality-badge" class="badge">--</span>
</div>
</div>
</div>
</div>
</div>
<div class="tabs">
<div class="tab-buttons">
<button class="tab-button active" data-tab="forecast">7-Day Forecast</button>
<button class="tab-button" data-tab="air-quality">Air Quality</button>
<button class="tab-button" data-tab="flood-risks">Flood Risk</button>
<button class="tab-button" data-tab="insights">Environmental Insights</button>
<button class="tab-button" data-tab="ask-ai"><strong>Ask <span class="Eco-Alert">Eco AI</span></strong></button>
</div>
<div id="forecast" class="tab-content active">
<div class="card">
<div class="card-header">
<h3>7-Day Weather Forecast</h3>
</div>
<div class="card-content">
<div class="forecast-days" id="forecast-days">
</div>
</div>
</div>
</div>
<div id="air-quality" class="tab-content hidden">
<div class="card">
<div class="card-header">
<h3>Air Quality Information</h3>
<p>Current air quality index and pollutant levels</p>
</div>
<div class="card-content">
<div class="air-quality-main">
<div class="aqi-display">
<div id="aqi-value" class="aqi-value">--</div>
<div id="aqi-category" class="badge">--</div>
</div>
<div class="aqi-description">
<p id="aqi-text">Air quality information will appear here.</p>
</div>
</div>
<div class="pollutants">
<div class="pollutant">
<div class="pollutant-name">PM2.5</div>
<div id="pm25" class="pollutant-value">-- μg/m³</div>
</div>
<div class="pollutant">
<div class="pollutant-name">PM10</div>
<div id="pm10" class="pollutant-value">-- μg/m³</div>
</div>
<div class="pollutant">
<div class="pollutant-name">Ozone (O₃)</div>
<div id="o3" class="pollutant-value">-- μg/m³</div>
</div>
<div class="pollutant">
<div class="pollutant-name">Nitrogen Dioxide (NO₂)</div>
<div id="no2" class="pollutant-value">-- μg/m³</div>
</div>
<div class="pollutant">
<div class="pollutant-name">Sulfur Dioxide (SO₂)</div>
<div id="so2" class="pollutant-value">-- μg/m³</div>
</div>
<div class="pollutant">
<div class="pollutant-name">Carbon Monoxide (CO)</div>
<div id="co" class="pollutant-value">-- μg/m³</div>
</div>
</div>
<canvas id="aq-chart" width="400" height="200"></canvas>
</div>
</div>
</div>
<div id="flood-risks" class="tab-content hidden">
<div class="card">
<div class="card-header">
<h3>Flood Risk</h3>
<p>Potential natural floods and their risk levels in this location</p>
</div>
<div class="card-content">
<div id="flood-risks-grid" class="flood-risks-grid">
<div class="flood-risk-item">
<h4>River Flooding</h4>
<p><strong>Risk Level:</strong> <span class="badge badge-high">High Risk</span></p>
<p>Heavy rainfall in the region has caused rivers to overflow, posing a significant risk to nearby areas.</p>
</div>
<div class="flood-risk-item">
<h4>Urban Flooding</h4>
<p><strong>Risk Level:</strong> <span class="badge badge-moderate">Moderate Risk</span></p>
<p>Blocked drainage systems in urban areas may lead to localized flooding during heavy rains.</p>
</div>
<div class="flood-risk-item">
<h4>Coastal Flooding</h4>
<p><strong>Risk Level:</strong> <span class="badge badge-low">Low Risk</span></p>
<p>High tides and minor storm surges may cause slight flooding in low-lying coastal areas.</p>
</div>
<div class="flood-risk-item">
<h4>Flash Flooding</h4>
<p><strong>Risk Level:</strong> <span class="badge badge-severe">Severe Risk</span></p>
<p>Sudden and intense rainfall in hilly areas could lead to dangerous flash floods.</p>
</div>
</div>
</div>
</div>
</div>
<div id="insights" class="tab-content hidden">
<div class="card">
<div class="card-header">
<h3>Environmental Risks</h3>
<p>Potential environmental hazards in this location</p>
</div>
<div class="card-content">
<div id="environmental-risks" class="risks">
</div>
</div>
</div>
<div class="card">
<div class="card-header">
<h3>Sustainability Recommendations</h3>
<p>AI-generated suggestions for improving environmental sustainability</p>
</div>
<div class="card-content">
<div id="sustainability-recommendations" class="accordion">
</div>
</div>
</div>
<div class="card">
<div class="card-header">
<h3>Local Environment</h3>
<p>Information about the local ecosystem and biodiversity</p>
</div>
<div class="card-content">
<div id="local-environment" class="local-environment">
</div>
</div>
</div>
</div>
<div id="ask-ai" class="tab-content hidden">
<div class="card">
<div class="card-header">
<h3>Ask Eco For Insights About Your Location</h3>
<p>Get personalized insights about weather, environment, and sustainability</p>
</div>
<div class="card-content">
<div class="chat-container">
<div id="chat-messages" class="chat-messages">
<div class="message system-message">
<p>Hi! I'm Eco, your environmental AI assistant. Ask me anything about the weather, environmental conditions, or sustainability recommendations for this location.</p>
</div>
</div>
<form id="chat-form" class="chat-input">
<input type="text" id="chat-input" placeholder="Type your question here...">
<button type="submit" id="chat-submit">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="22" y1="2" x2="11" y2="13"></line><polygon points="22 2 15 22 11 13 2 9 22 2"></polygon></svg>
</button>
</form>
</div>
<div class="chat-suggestions">
<p>Suggested questions:</p>
<div class="suggestion-buttons">
<button class="suggestion-button" data-question="What are the main environmental risks in this area?">Environmental risks</button>
<button class="suggestion-button" data-question="How will the weather change in the next few days?">Weather forecast</button>
<button class="suggestion-button" data-question="What sustainability practices are recommended for this location?">Sustainability tips</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
<footer>
<div class="footer-content">
<div class="footer-logo">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon"><path d="M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z"/><path d="M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12"/></svg>
<p>2025 EcoAlert. Hack The Nest</p>
</div>
</div>
</footer>
</div>
<div id="toast-container" class="toast-container"></div>
</body>
</html>