forked from vinaysingh282006/Hacknova
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlight.html
More file actions
192 lines (179 loc) · 10 KB
/
Copy pathlight.html
File metadata and controls
192 lines (179 loc) · 10 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
<!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 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">
</head>
<body class="bg-gray-900 text-white">
<!-- Navigation -->
<nav class="fixed top-0 w-full z-50 bg-gray-900/90 backdrop-blur-lg border-b border-gray-800">
<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>
<!-- Desktop Navigation -->
<div class="hidden md:flex items-center space-x-8">
<a href="index.html" class="nav-link">Home</a>
<a href="air.html" class="nav-link">Air</a>
<a href="water.html" class="nav-link">Water</a>
<a href="light.html" class="nav-link active text-eco-orange">Light</a>
<a href="noise.html" class="nav-link">Noise</a>
<a href="presentation.html" class="nav-link">Demo</a>
</div>
<!-- Mobile Menu Button -->
<button id="mobile-menu-btn" class="md:hidden p-2">
<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>
<!-- Mobile Menu -->
<div id="mobile-menu" class="md:hidden hidden bg-gray-800 border-t border-gray-700">
<div class="px-4 py-4 space-y-3">
<a href="index.html" class="block py-2 hover:text-eco-blue transition-colors">Home</a>
<a href="air.html" class="block py-2 hover:text-eco-red transition-colors">Air Pollution</a>
<a href="water.html" class="block py-2 hover:text-eco-blue transition-colors">Water Pollution</a>
<a href="light.html" class="block py-2 text-eco-orange font-medium">Light Pollution</a>
<a href="noise.html" class="block py-2 hover:text-eco-purple transition-colors">Noise Pollution</a>
<a href="ai-prediction.html" class="block py-2 hover:text-purple-400 transition-colors">AI Prediction</a>
<a href="presentation.html" class="block py-2 hover:text-eco-green transition-colors">Demo</a>
</div>
</div>
</nav>
<main class="pt-16">
<!-- Hero -->
<section class="py-20 bg-gradient-to-br from-orange-950 via-yellow-900/30 to-orange-900">
<div class="container mx-auto px-4 text-center">
<span class="badge badge-warning mb-4 inline-block shadow-lg shadow-orange-500/50">Growing Problem</span>
<h1 class="text-5xl md:text-6xl font-bold mb-6 drop-shadow-[0_0_30px_rgba(249,115,22,0.6)]">Light <span class="text-eco-orange">Pollution</span></h1>
<p class="text-xl text-gray-300 max-w-3xl mx-auto">
80% of the world can no longer see the Milky Way. Explore night sky data.
</p>
</div>
</section>
<!-- Main Content -->
<section class="py-12 bg-gradient-to-b from-gray-900 to-orange-950/30">
<div class="container mx-auto px-4">
<div class="grid lg:grid-cols-2 gap-8">
<!-- Placeholder for 3D -->
<div class="card">
<h3 class="text-2xl font-bold mb-4">Night Sky Simulation</h3>
<div class="relative bg-black rounded-lg overflow-hidden scene-container" 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/90 flex items-center justify-center">
<div class="text-center">
<div class="spinner mx-auto mb-4"></div>
<p class="text-gray-300">Loading Night Sky...</p>
</div>
</div>
</div>
<div class="mt-6">
<div class="flex justify-between mb-2">
<label>Light Intensity</label>
<span id="light-intensity-value" class="text-eco-orange font-bold">High (75%)</span>
</div>
<input type="range" id="light-intensity-slider" min="0" max="100" value="75" class="w-full">
</div>
</div>
<!-- Data Panel -->
<div>
<div class="card mb-6">
<h3 class="text-2xl font-bold mb-4">Light Pollution Impact</h3>
<div class="grid grid-cols-2 gap-4">
<div class="bg-gray-700/50 p-4 rounded-lg">
<div class="text-3xl font-bold text-eco-orange">17.4</div>
<div class="text-sm text-gray-400">Sky Brightness</div>
</div>
<div class="bg-gray-700/50 p-4 rounded-lg">
<div class="text-3xl font-bold text-eco-red">15.3%</div>
<div class="text-sm text-gray-400">Stars Visible</div>
</div>
</div>
</div>
<div class="card">
<h3 class="text-xl font-bold mb-4">✨ Impact on Wildlife</h3>
<div class="space-y-3">
<div class="flex items-center justify-between p-3 bg-orange-900/20 rounded-lg">
<span>🦉 Nocturnal Animals</span>
<span class="text-eco-red font-bold">87% Affected</span>
</div>
<div class="flex items-center justify-between p-3 bg-orange-900/20 rounded-lg">
<span>🦅 Migratory Birds</span>
<span class="text-eco-orange font-bold">62% Disoriented</span>
</div>
<div class="flex items-center justify-between p-3 bg-orange-900/20 rounded-lg">
<span>🐛 Insects</span>
<span class="text-eco-red font-bold">75% Decline</span>
</div>
<div class="flex items-center justify-between p-3 bg-orange-900/20 rounded-lg">
<span>🌳 Plant Cycles</span>
<span class="text-eco-orange font-bold">45% Disrupted</span>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</main>
<footer class="bg-gray-900 border-t border-gray-800 py-8 text-center text-gray-400">
<p>© 2024 EcoPulse. Hackathon 2024</p>
</footer>
<!-- Added scroll-to-top button -->
<button id="scroll-to-top" class="scroll-to-top fixed bottom-4 right-4 p-4 bg-gray-800 text-white rounded-full hover:bg-gray-700 transition-colors" aria-label="Scroll to top" title="Back to top">
<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="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
<script src="js/main.js"></script>
<script src="js/light-3d.js"></script>
<script>
document.addEventListener('DOMContentLoaded', () => {
const slider = document.getElementById('light-intensity-slider');
const valueDisplay = document.getElementById('light-intensity-value');
slider?.addEventListener('input', (e) => {
const value = e.target.value;
const level = value < 30 ? 'Low' : value < 70 ? 'Medium' : 'High';
valueDisplay.textContent = `${level} (${value}%)`;
window.lightScene?.updateLightIntensity(value);
});
});
</script>
<script>// Scroll to Top Functionality
;(() => {
const scrollButton = document.getElementById("scroll-to-top")
if (!scrollButton) return
// Show/hide button based on scroll position
function toggleScrollButton() {
if (window.scrollY > 300) {
scrollButton.classList.add("visible")
} else {
scrollButton.classList.remove("visible")
}
}
// Smooth scroll to top
function scrollToTop() {
window.scrollTo({
top: 0,
behavior: "smooth",
})
}
// Event listeners
window.addEventListener("scroll", toggleScrollButton, { passive: true })
scrollButton.addEventListener("click", scrollToTop)
// Initial check
toggleScrollButton()
})()
</script>
</body>
</html>