-
Notifications
You must be signed in to change notification settings - Fork 60
Expand file tree
/
Copy pathlight.html
More file actions
440 lines (400 loc) · 24.6 KB
/
Copy pathlight.html
File metadata and controls
440 lines (400 loc) · 24.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
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Light Pollution - EcoPulse</title>
<link rel="icon" type="image/png" href="favicon.png">
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap"
rel="stylesheet">
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="css/styles.css">
<link rel="stylesheet" href="css/light.css">
<link rel="icon" type="image/png" href="ecopulse-logo.png">
<script>
tailwind.config = {
theme: {
extend: {
colors: {
'eco-green': '#10B981',
'eco-blue': '#3B82F6',
'eco-purple': '#8B5CF6',
'eco-orange': '#F97316',
'eco-red': '#EF4444',
},
animation: {
'fade-in': 'fadeIn 1s ease-out',
'slide-up': 'slideUp 0.5s ease-out forwards',
},
keyframes: {
fadeIn: {
'0%': { opacity: '0' },
'100%': { opacity: '1' },
},
slideUp: {
'0%': { transform: 'translateY(20px)', opacity: '0' },
'100%': { transform: 'translateY(0)', opacity: '1' },
}
}
}
}
}
</script>
<style>
/* Custom styles for glassmorphism and animations that Tailwind might miss */
.glass-card {
background: rgba(31, 41, 55, 0.7);
backdrop-filter: blur(10px);
border: 1px solid rgba(75, 85, 99, 0.4);
}
</style>
</head>
<body class="bg-gray-900 text-white font-['Inter']">
<div id="network-status" class="online">
You are back online
</div>
<!-- Skip to Content Link for Accessibility -->
<a href="#main-content" class="skip-link sr-only focus:not-sr-only" aria-label="Skip to main content">Skip to main content</a>
<nav
class="fixed top-0 w-full z-50 bg-gray-900/90 backdrop-blur-lg border-b border-gray-800 transition-all duration-300">
<div class="container mx-auto px-4">
<div class="flex justify-between items-center h-16">
<a href="index.html" class="flex items-center space-x-2">
<div
class="w-10 h-10 bg-gradient-to-r from-eco-blue to-eco-green rounded-lg flex items-center justify-center">
<span class="text-white font-bold text-xl">E</span>
</div>
<span class="text-2xl font-bold gradient-text">EcoPulse</span>
</a>
<div class="hidden md:flex items-center space-x-8">
<a href="index.html" class="text-gray-300 hover:text-white transition-colors relative group focus-outline" tabindex="0">
Home
<span
class="absolute bottom-0 left-0 w-0 h-0.5 bg-eco-green transition-all group-hover:w-full"></span>
</a>
<a href="air.html" class="text-gray-300 hover:text-eco-red transition-colors relative group focus-outline" tabindex="0">
Air
<span
class="absolute bottom-0 left-0 w-0 h-0.5 bg-eco-red transition-all group-hover:w-full"></span>
</a>
<a href="water.html" class="text-gray-300 hover:text-eco-blue transition-colors relative group focus-outline" tabindex="0">
Water
<span
class="absolute bottom-0 left-0 w-0 h-0.5 bg-eco-blue transition-all group-hover:w-full"></span>
</a>
<a href="light.html" class="text-eco-orange font-medium relative focus-outline" tabindex="0">
Light
<span class="absolute bottom-0 left-0 w-full h-0.5 bg-eco-orange"></span>
</a>
<a href="noise.html" class="text-gray-300 hover:text-eco-purple transition-colors relative group focus-outline" tabindex="0">
Noise
<span
class="absolute bottom-0 left-0 w-0 h-0.5 bg-eco-purple transition-all group-hover:w-full"></span>
</a>
<a href="soil.html" class="text-gray-300 hover:text-eco-purple transition-colors relative group">
Soil
<span class="absolute bottom-0 left-0 w-full h-0.5 bg-eco-brown"></span>
</a>
<a href="plastic.html" class="text-gray-300 hover:text-eco-blue transition-colors relative group">
Plastic
<span class="absolute bottom-0 left-0 w-full h-0.5 bg-eco-cyan"></span>
</a>
<a href="radioactive.html" class="text-gray-300 hover:text-eco-green transition-colors relative group">
Radioactive
<span class="absolute bottom-0 left-0 w-full h-0.5 bg-eco-lime"></span>
</a>
<a href="presentation.html"
class="px-5 py-2 bg-eco-green/20 text-eco-green rounded-full hover:bg-eco-green/30 transition-all hover:scale-105 border border-eco-green/30">Demo</a>
</div>
<button id="mobile-menu-btn" class="md:hidden p-2 text-gray-300 hover:text-white">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M4 6h16M4 12h16M4 18h16" />
</svg>
</button>
</div>
</div>
<div id="mobile-menu" class="md:hidden hidden bg-gray-900 border-t border-gray-800 absolute w-full shadow-2xl">
<div class="px-4 py-4 space-y-3">
<a href="index.html"
class="block py-3 px-4 rounded-lg hover:bg-gray-800 hover:text-eco-blue transition-colors focus-outline" tabindex="0">Home</a>
<a href="air.html"
class="block py-3 px-4 rounded-lg hover:bg-gray-800 hover:text-eco-red transition-colors focus-outline" tabindex="0">Air
Pollution</a>
<a href="water.html"
class="block py-3 px-4 rounded-lg hover:bg-gray-800 hover:text-eco-blue transition-colors focus-outline" tabindex="0">Water
Pollution</a>
<a href="light.html"
class="block py-3 px-4 rounded-lg bg-gray-800/50 text-eco-orange font-medium border-l-4 border-eco-orange focus-outline" tabindex="0">Light
Pollution</a>
<a href="noise.html"
class="block py-3 px-4 rounded-lg hover:bg-gray-800 hover:text-eco-purple transition-colors focus-outline" tabindex="0">Noise
Pollution</a>
<a href="soil.html" class="block py-2 text-gray-300 hover:text-eco-amber">Soil Pollution</a>
<a href="plastic.html" class="block py-2 text-gray-300 hover:text-eco-cyan">Plastic Pollution</a>
<a href="radioactive.html"
class="block py-2 text-gray-300 hover:text-eco-orange">Radioactive
Waste</a>
<a href="presentation.html"
class="block py-3 px-4 rounded-lg hover:bg-gray-800 hover:text-eco-green transition-colors">Demo</a>
</div>
</div>
</nav>
<main class="pt-16">
<section class="relative py-28 min-h-[60vh] flex items-center justify-center overflow-hidden">
<div class="absolute inset-0 z-0">
<img src="https://images.unsplash.com/photo-1519681393784-d120267933ba?auto=format&fit=crop&q=80"
alt="Night Sky Stars" class="w-full h-full object-cover animate-fade-in">
<div class="absolute inset-0 bg-gray-900/70 mix-blend-multiply"></div>
<div class="absolute inset-0 bg-gradient-to-t from-gray-900 via-gray-900/50 to-transparent"></div>
</div>
<div class="container mx-auto px-4 text-center relative z-10 animate-slide-up">
<span
class="inline-block px-4 py-1.5 mb-6 text-xs font-bold tracking-wider text-orange-200 uppercase bg-orange-900/60 rounded-full border border-orange-500/30 backdrop-blur-sm shadow-[0_0_20px_rgba(249,115,22,0.3)]">
Global Crisis
</span>
<h1 class="text-5xl md:text-7xl font-extrabold mb-6 tracking-tight drop-shadow-2xl">
Light <span
class="text-transparent bg-clip-text bg-gradient-to-r from-orange-400 to-yellow-200">Pollution</span>
</h1>
<p
class="text-xl md:text-2xl text-gray-200 max-w-3xl mx-auto leading-relaxed font-light drop-shadow-lg">
80% of the world can no longer see the Milky Way. <br>Discover how artificial light is erasing our
night sky.
</p>
<div class="mt-8 flex justify-center gap-4">
<button onclick="document.getElementById('simulation-section').scrollIntoView({behavior: 'smooth'})"
class="px-8 py-3 bg-eco-orange text-white rounded-full font-semibold hover:bg-orange-600 transition-all hover:scale-105 shadow-lg shadow-orange-500/30">
View Simulation
</button>
</div>
</div>
</section>
<section id="simulation-section" class="py-16 bg-gray-900">
<div class="container mx-auto px-4">
<div class="grid lg:grid-cols-12 gap-8">
<div class="lg:col-span-8 space-y-6">
<div class="glass-card rounded-2xl p-6 shadow-xl animate-slide-up"
style="animation-delay: 0.1s;">
<div class="flex justify-between items-center mb-4">
<h3 class="text-2xl font-bold text-white flex items-center gap-2">
<svg class="w-6 h-6 text-eco-orange" fill="none" stroke="currentColor"
viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M3.055 11H5a2 2 0 012 2v1a2 2 0 002 2 2 2 0 012 2v2.945M8 3.935V5.5A2.5 2.5 0 0010.5 8h.5a2 2 0 012 2 2 2 0 104 0 2 2 0 012-2h1.064M15 20.488V18a2 2 0 012-2h3.064M21 12a9 9 0 11-18 0 9 9 0 0118 0z">
</path>
</svg>
Night Sky Simulation
</h3>
<div
class="flex items-center space-x-2 bg-gray-900/50 px-3 py-1 rounded-full border border-gray-700">
<span class="relative flex h-3 w-3">
<span
class="animate-ping absolute inline-flex h-full w-full rounded-full bg-red-400 opacity-75"></span>
<span class="relative inline-flex rounded-full h-3 w-3 bg-red-500"></span>
</span>
<span class="text-xs font-semibold text-gray-300 uppercase tracking-wide">Live
Render</span>
</div>
</div>
<div class="relative bg-black rounded-xl overflow-hidden shadow-2xl border border-gray-700 group"
style="height: 500px;">
<canvas id="light-3d-scene" class="w-full h-full"></canvas>
<div id="light-scene-loading"
class="absolute inset-0 bg-gray-900 flex items-center justify-center z-20 transition-opacity duration-500">
<div class="text-center">
<div
class="w-12 h-12 border-4 border-gray-700 border-t-eco-orange rounded-full animate-spin mx-auto mb-4">
</div>
<p class="text-gray-400 text-sm tracking-widest font-mono">LOADING SKY MAP...
</p>
</div>
</div>
</div>
<div class="mt-6 bg-gray-900/50 p-5 rounded-xl border border-gray-700/50">
<div class="flex justify-between mb-3">
<label class="text-sm font-medium text-gray-300">City Light Intensity</label>
<span id="light-intensity-value"
class="text-eco-orange font-bold font-mono bg-gray-800 px-2 py-0.5 rounded">High
(75%)</span>
</div>
<div class="relative w-full h-6 flex items-center">
<input type="range" id="light-intensity-slider" min="0" max="100" value="75"
class="w-full h-2 bg-gray-700 rounded-lg appearance-none cursor-pointer accent-eco-orange hover:accent-orange-400 transition-all
hover:opacity-90 focus:outline-none focus:ring-2 focus:ring-orange-500/40
z-10">
</div>
<div class="flex justify-between text-xs text-gray-500 mt-2 font-mono">
<span>Dark Sky Preserve</span>
<span>Major Metropolis</span>
</div>
</div>
</div>
</div>
<div class="lg:col-span-4 space-y-6">
<div class="glass-card rounded-2xl p-6 animate-slide-up" style="animation-delay: 0.2s;">
<h3 class="text-xl font-bold mb-4 flex items-center gap-2 text-white">
<svg class="w-5 h-5 text-eco-orange" fill="none" stroke="currentColor"
viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z">
</path>
</svg>
Current Metrics
</h3>
<div class="space-y-4">
<div
class="bg-gray-800/50 p-4 rounded-xl border border-gray-700 transition-all hover:bg-gray-800 hover:border-eco-orange/50">
<div class="text-sm text-gray-400 mb-1">Sky Brightness</div>
<div class="flex items-baseline gap-2">
<div class="text-3xl font-bold text-eco-orange">17.4</div>
<div class="text-xs text-gray-500">mag/arcsec²</div>
</div>
<div class="text-xs text-eco-red mt-2 flex items-center">
<svg class="w-3 h-3 mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M13 17h8m0 0V9m0 8l-8-8-4 4-6-6"></path>
</svg>
Exceeds critical levels
</div>
</div>
<div
class="bg-gray-800/50 p-4 rounded-xl border border-gray-700 transition-all hover:bg-gray-800 hover:border-eco-orange/50">
<div class="text-sm text-gray-400 mb-1">Stars Visible to Eye</div>
<div class="text-3xl font-bold text-white">15.3%</div>
<div class="text-xs text-gray-500 mt-2">Compared to pre-industrial era</div>
</div>
</div>
</div>
<div class="glass-card rounded-2xl p-6 animate-slide-up" style="animation-delay: 0.3s;">
<h3 class="text-xl font-bold mb-5 flex items-center gap-2 text-white">
<span>🦁</span> Impact on Wildlife
</h3>
<div class="space-y-3">
<div
class="group flex items-center justify-between p-3 bg-gray-800/40 border border-gray-700 rounded-lg hover:bg-gray-800 transition-colors">
<span class="flex items-center gap-3 text-gray-300">
<span class="text-xl">🦇</span> Nocturnal
</span>
<span class="text-eco-red font-bold text-sm bg-red-500/10 px-2 py-1 rounded">87%
Affected</span>
</div>
<div
class="group flex items-center justify-between p-3 bg-gray-800/40 border border-gray-700 rounded-lg hover:bg-gray-800 transition-colors">
<span class="flex items-center gap-3 text-gray-300">
<span class="text-xl">🦆</span> Birds
</span>
<span
class="text-eco-orange font-bold text-sm bg-orange-500/10 px-2 py-1 rounded">62%
Disoriented</span>
</div>
<div
class="group flex items-center justify-between p-3 bg-gray-800/40 border border-gray-700 rounded-lg hover:bg-gray-800 transition-colors">
<span class="flex items-center gap-3 text-gray-300">
<span class="text-xl">🦗</span> Insects
</span>
<span class="text-eco-red font-bold text-sm bg-red-500/10 px-2 py-1 rounded">75%
Decline</span>
</div>
<div
class="group flex items-center justify-between p-3 bg-gray-800/40 border border-gray-700 rounded-lg hover:bg-gray-800 transition-colors">
<span class="flex items-center gap-3 text-gray-300">
<span class="text-xl">🌱</span> Plants
</span>
<span
class="text-yellow-500 font-bold text-sm bg-yellow-500/10 px-2 py-1 rounded">45%
Disrupted</span>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<div class="cursor-container">
<span class="cursor-dot-light"></span>
<span class="cursor-dot-light"></span>
<span class="cursor-dot-light"></span>
<span class="cursor-dot-light"></span>
<span class="cursor-dot-light"></span>
<span class="cursor-dot-light"></span>
<span class="cursor-dot-light"></span>
<span class="cursor-dot-light"></span>
</div>
</main>
<button id="scroll-to-top"
class="fixed bottom-8 right-8 p-3 bg-eco-orange text-white rounded-full shadow-lg shadow-orange-500/20 opacity-0 invisible transition-all duration-300 hover:bg-orange-600 transform translate-y-4 hover:-translate-y-1 z-50">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 10l7-7m0 0l7 7m-7-7v18"></path>
</svg>
</button>
<script src="js/footer.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
<script src="js/light-3d.js"></script>
<script src="js/light.js"></script>
<script src="js/script.js"></script>
<script src="js/main.js"></script>
<!-- Initialize EcoPulse functionality -->
<script>
// Initialize EcoPulse functionality on this page
document.addEventListener('DOMContentLoaded', () => {
// Initialize mobile menu if EcoPulse is available
if (window.EcoPulse && typeof EcoPulse.initMobileMenu === 'function') {
EcoPulse.initMobileMenu();
}
// Initialize scroll to top if available
if (window.EcoPulse && typeof EcoPulse.initScrollToTop === 'function') {
EcoPulse.initScrollToTop();
}
// Initialize scroll reveal for light page specific elements
if (window.EcoPulse && typeof EcoPulse.initScrollReveal === 'function') {
EcoPulse.initScrollReveal();
}
// Additional light-specific scroll reveal for any new elements
const lightReveals = document.querySelectorAll('.glass-card, .animate-slide-up');
if (lightReveals.length && window.IntersectionObserver) {
const lightObserver = new IntersectionObserver(
(entries, observer) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.style.opacity = '1';
entry.target.style.transform = 'translateY(0)';
observer.unobserve(entry.target);
}
});
},
{
threshold: 0.1,
rootMargin: '0px 0px -50px 0px'
}
);
lightReveals.forEach(el => {
// Set initial state for animation
el.style.opacity = '0';
el.style.transform = 'translateY(20px)';
el.style.transition = 'opacity 0.6s ease, transform 0.6s ease';
lightObserver.observe(el);
});
}
});
</script>
<script>
if ('serviceWorker' in navigator) {
window.addEventListener('load', () => {
navigator.serviceWorker
.register('/sw.js')
.then(() => console.log('Service Worker registered'))
.catch(err => console.error('Service Worker registration failed:', err));
});
}
// Optional: Network status feedback
window.addEventListener('offline', () => {
console.warn('You are offline');
});
window.addEventListener('online', () => {
console.log('Back online');
});
</script>
<div id="cursor-glow"></div>
</body>
</html>