Spaces:
Running
Running
Add 1 files
Browse files- index.html +279 -78
index.html
CHANGED
@@ -13,8 +13,10 @@
|
|
13 |
:root {
|
14 |
--primary: #00f0ff;
|
15 |
--secondary: #ff00f0;
|
|
|
16 |
--bg-dark: #0a0a1a;
|
17 |
--bg-light: #1a1a2e;
|
|
|
18 |
}
|
19 |
|
20 |
body {
|
@@ -22,6 +24,9 @@
|
|
22 |
background-color: var(--bg-dark);
|
23 |
color: white;
|
24 |
overflow-x: hidden;
|
|
|
|
|
|
|
25 |
}
|
26 |
|
27 |
.orbitron {
|
@@ -36,25 +41,50 @@
|
|
36 |
text-shadow: 0 0 10px var(--secondary), 0 0 20px var(--secondary);
|
37 |
}
|
38 |
|
|
|
|
|
|
|
|
|
39 |
.btn-glow {
|
40 |
box-shadow: 0 0 15px var(--primary);
|
|
|
41 |
}
|
42 |
|
43 |
.btn-glow:hover {
|
44 |
-
box-shadow: 0 0 25px var(--primary);
|
|
|
45 |
}
|
46 |
|
47 |
.btn-glow-secondary {
|
48 |
box-shadow: 0 0 15px var(--secondary);
|
|
|
49 |
}
|
50 |
|
51 |
.btn-glow-secondary:hover {
|
52 |
-
box-shadow: 0 0 25px var(--secondary);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
}
|
54 |
|
55 |
.border-glow {
|
56 |
border: 1px solid var(--primary);
|
57 |
box-shadow: 0 0 10px var(--primary), inset 0 0 10px var(--primary);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
}
|
59 |
|
60 |
.pulse {
|
@@ -123,12 +153,119 @@
|
|
123 |
font-size: 10px;
|
124 |
color: var(--secondary);
|
125 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
126 |
</style>
|
127 |
</head>
|
128 |
-
<body class="min-h-screen flex flex-col">
|
129 |
-
<header class="container mx-auto px-4 py-
|
130 |
-
<
|
131 |
-
<
|
|
|
|
|
|
|
|
|
|
|
132 |
</header>
|
133 |
|
134 |
<main class="flex-grow container mx-auto px-4 py-6">
|
@@ -136,67 +273,79 @@
|
|
136 |
<!-- Left Panel -->
|
137 |
<div class="lg:col-span-1 space-y-6">
|
138 |
<!-- Microphone Status -->
|
139 |
-
<div class="bg-gray-900 bg-opacity-
|
140 |
-
<
|
141 |
-
|
142 |
-
<
|
|
|
143 |
</h2>
|
144 |
-
<div class="flex items-center justify-between">
|
145 |
-
<span id="micStatus" class="text-gray-
|
146 |
<div id="micStatusIndicator" class="w-4 h-4 rounded-full bg-gray-600"></div>
|
147 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
148 |
</div>
|
149 |
|
150 |
<!-- Current Session -->
|
151 |
-
<div class="bg-gray-900 bg-opacity-
|
152 |
-
<
|
|
|
153 |
<i class="fas fa-clock mr-3 text-blue-400"></i>
|
154 |
-
<span>CURRENT SESSION</span>
|
155 |
</h2>
|
156 |
-
<div class="text-center">
|
157 |
<div id="sessionTimer" class="orbitron text-3xl mb-2 glow">00:00:00</div>
|
158 |
-
<div class="text-sm text-gray-400">
|
159 |
</div>
|
160 |
</div>
|
161 |
|
162 |
<!-- Controls -->
|
163 |
-
<div class="bg-gray-900 bg-opacity-
|
164 |
-
<
|
|
|
165 |
<i class="fas fa-sliders-h mr-3 text-green-400"></i>
|
166 |
-
<span>CONTROLS</span>
|
167 |
</h2>
|
168 |
-
<div class="flex flex-col space-y-4">
|
169 |
-
<button id="startBtn" class="btn-glow orbitron py-3 px-6 bg-blue-600 hover:bg-blue-700 rounded-lg font-bold transition-all">
|
170 |
<i class="fas fa-play mr-2"></i> START MONITORING
|
171 |
</button>
|
172 |
-
<button id="stopBtn" disabled class="btn-glow-secondary orbitron py-3 px-6 bg-purple-600 hover:bg-purple-700 rounded-lg font-bold transition-all">
|
173 |
<i class="fas fa-stop mr-2"></i> STOP
|
174 |
</button>
|
175 |
-
<button id="resetBtn" class="orbitron py-3 px-6 bg-
|
176 |
<i class="fas fa-redo mr-2"></i> RESET DATA
|
177 |
</button>
|
178 |
</div>
|
179 |
</div>
|
180 |
|
181 |
<!-- Threshold Settings -->
|
182 |
-
<div class="bg-gray-900 bg-opacity-
|
183 |
-
<
|
|
|
184 |
<i class="fas fa-bell mr-3 text-yellow-400"></i>
|
185 |
-
<span>NOISE THRESHOLD</span>
|
186 |
</h2>
|
187 |
-
<div class="space-y-4">
|
188 |
<div>
|
189 |
-
<label for="thresholdSlider" class="block text-sm text-gray-400 mb-2">
|
190 |
-
<input type="range" id="thresholdSlider" min="0" max="100" value="70" class="w-full h-2 bg-gray-700 rounded-lg appearance-none cursor-pointer">
|
191 |
-
<div class="flex justify-between text-xs text-gray-400 mt-1">
|
192 |
<span>0</span>
|
193 |
<span id="thresholdValue">70</span>
|
194 |
<span>100</span>
|
195 |
</div>
|
196 |
</div>
|
197 |
<div class="flex items-center">
|
198 |
-
<input type="checkbox" id="enableThreshold" class="mr-2" checked>
|
199 |
-
<label for="enableThreshold" class="text-sm">
|
200 |
</div>
|
201 |
</div>
|
202 |
</div>
|
@@ -205,86 +354,89 @@
|
|
205 |
<!-- Main Panel -->
|
206 |
<div class="lg:col-span-2 space-y-6">
|
207 |
<!-- Real-time Noise Level -->
|
208 |
-
<div class="bg-gray-900 bg-opacity-
|
209 |
-
<
|
|
|
210 |
<i class="fas fa-volume-up mr-3 text-red-400"></i>
|
211 |
-
<span>REAL-TIME NOISE LEVEL</span>
|
212 |
</h2>
|
213 |
-
<div class="text-center mb-6">
|
214 |
<div id="noiseLevel" class="orbitron text-6xl md:text-8xl font-bold mb-2 glow pulse">--</div>
|
215 |
-
<div id="noiseDescription" class="text-xl text-gray-400">
|
216 |
</div>
|
217 |
|
218 |
<!-- Visualizer -->
|
219 |
-
<div class="flex justify-center items-end h-32 mb-4" id="audioVisualizer">
|
220 |
<!-- Bars will be added dynamically -->
|
221 |
</div>
|
222 |
|
223 |
<!-- Noise Level Indicator -->
|
224 |
-
<div class="noise-level-indicator mb-2">
|
225 |
<div id="noiseLevelBar" class="h-full bg-green-500 rounded-lg" style="width: 0%"></div>
|
226 |
</div>
|
227 |
-
<div class="flex justify-between text-xs text-gray-400">
|
228 |
-
<span>
|
229 |
-
<span>
|
230 |
-
<span>
|
231 |
</div>
|
232 |
|
233 |
<!-- Stats -->
|
234 |
-
<div class="grid grid-cols-2 gap-4 mt-6">
|
235 |
-
<div class="bg-gray-800 bg-opacity-50 rounded-lg p-4">
|
236 |
-
<div class="text-sm text-gray-400 mb-1">PEAK LEVEL</div>
|
237 |
<div id="peakLevel" class="orbitron text-2xl glow-secondary">--</div>
|
238 |
</div>
|
239 |
-
<div class="bg-gray-800 bg-opacity-50 rounded-lg p-4">
|
240 |
-
<div class="text-sm text-gray-400 mb-1">AVERAGE</div>
|
241 |
<div id="averageLevel" class="orbitron text-2xl">--</div>
|
242 |
</div>
|
243 |
</div>
|
244 |
</div>
|
245 |
|
246 |
<!-- Historical Data -->
|
247 |
-
<div class="bg-gray-900 bg-opacity-
|
248 |
-
<
|
|
|
249 |
<i class="fas fa-chart-line mr-3 text-green-400"></i>
|
250 |
-
<span>HISTORICAL DATA</span>
|
251 |
</h2>
|
252 |
-
<div class="relative h-64">
|
253 |
<canvas id="noiseChart"></canvas>
|
254 |
</div>
|
255 |
-
<div class="flex justify-between mt-4">
|
256 |
-
<div class="text-sm text-gray-400">
|
257 |
<div class="flex space-x-2">
|
258 |
-
<button id="smoothBtn" class="text-xs px-3 py-1 bg-gray-700 rounded hover:bg-gray-600">
|
259 |
-
<i class="fas fa-wave-square mr-1"></i>
|
260 |
</button>
|
261 |
-
<button id="rawBtn" class="text-xs px-3 py-1 bg-gray-700 rounded hover:bg-gray-600">
|
262 |
-
<i class="fas fa-chart-bar mr-1"></i>
|
263 |
</button>
|
264 |
</div>
|
265 |
</div>
|
266 |
</div>
|
267 |
|
268 |
<!-- Peak Values Dashboard -->
|
269 |
-
<div class="bg-gray-900 bg-opacity-
|
270 |
-
<
|
|
|
271 |
<i class="fas fa-mountain mr-3 text-purple-400"></i>
|
272 |
-
<span>PEAK VALUES (LAST 4 HOURS)</span>
|
273 |
</h2>
|
274 |
-
<div class="relative h-64">
|
275 |
<canvas id="peakChart"></canvas>
|
276 |
</div>
|
277 |
-
<div class="grid grid-cols-3 gap-4 mt-4">
|
278 |
-
<div class="bg-gray-800 bg-opacity-50 rounded-lg p-3">
|
279 |
-
<div class="text-sm text-gray-400 mb-1">HIGHEST PEAK</div>
|
280 |
<div id="highestPeak" class="orbitron text-xl glow-secondary">--</div>
|
281 |
</div>
|
282 |
-
<div class="bg-gray-800 bg-opacity-50 rounded-lg p-3">
|
283 |
-
<div class="text-sm text-gray-400 mb-1">AVG PEAKS</div>
|
284 |
<div id="avgPeaks" class="orbitron text-xl">--</div>
|
285 |
</div>
|
286 |
-
<div class="bg-gray-800 bg-opacity-50 rounded-lg p-3">
|
287 |
-
<div class="text-sm text-gray-400 mb-1">THRESHOLD BREACHES</div>
|
288 |
<div id="thresholdBreaches" class="orbitron text-xl">--</div>
|
289 |
</div>
|
290 |
</div>
|
@@ -293,8 +445,8 @@
|
|
293 |
</div>
|
294 |
</main>
|
295 |
|
296 |
-
<footer class="container mx-auto px-4 py-6 text-center text-gray-500 text-sm">
|
297 |
-
<p>
|
298 |
</footer>
|
299 |
|
300 |
<script>
|
@@ -319,6 +471,7 @@
|
|
319 |
const highestPeak = document.getElementById('highestPeak');
|
320 |
const avgPeaks = document.getElementById('avgPeaks');
|
321 |
const thresholdBreaches = document.getElementById('thresholdBreaches');
|
|
|
322 |
|
323 |
// Audio variables
|
324 |
let audioContext;
|
@@ -328,6 +481,7 @@
|
|
328 |
let isMonitoring = false;
|
329 |
let sessionStartTime = 0;
|
330 |
let timerInterval;
|
|
|
331 |
|
332 |
// Data variables
|
333 |
let noiseData = [];
|
@@ -557,11 +711,11 @@
|
|
557 |
|
558 |
// Get noise description based on level
|
559 |
function getNoiseDescription(level) {
|
560 |
-
if (level < 20) return '
|
561 |
-
if (level < 40) return '
|
562 |
-
if (level < 60) return '
|
563 |
-
if (level < 80) return '
|
564 |
-
return '
|
565 |
}
|
566 |
|
567 |
// Get color based on noise level
|
@@ -572,11 +726,47 @@
|
|
572 |
return '#ff0000'; // Red
|
573 |
}
|
574 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
575 |
// Start monitoring
|
576 |
async function startMonitoring() {
|
577 |
try {
|
|
|
|
|
|
|
|
|
578 |
// Request microphone access
|
579 |
-
const stream = await navigator.mediaDevices.getUserMedia(
|
|
|
580 |
|
581 |
// Create audio context
|
582 |
audioContext = new (window.AudioContext || window.webkitAudioContext)();
|
@@ -709,6 +899,11 @@
|
|
709 |
audioContext = null;
|
710 |
}
|
711 |
|
|
|
|
|
|
|
|
|
|
|
712 |
// Update UI
|
713 |
isMonitoring = false;
|
714 |
startBtn.disabled = false;
|
@@ -809,6 +1004,12 @@
|
|
809 |
|
810 |
// Load historical peaks
|
811 |
updatePeakChart();
|
|
|
|
|
|
|
|
|
|
|
|
|
812 |
});
|
813 |
</script>
|
814 |
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=markburn/neon-noice-monitor" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
|
|
13 |
:root {
|
14 |
--primary: #00f0ff;
|
15 |
--secondary: #ff00f0;
|
16 |
+
--tertiary: #f0ff00;
|
17 |
--bg-dark: #0a0a1a;
|
18 |
--bg-light: #1a1a2e;
|
19 |
+
--bg-darker: #050510;
|
20 |
}
|
21 |
|
22 |
body {
|
|
|
24 |
background-color: var(--bg-dark);
|
25 |
color: white;
|
26 |
overflow-x: hidden;
|
27 |
+
background-image:
|
28 |
+
radial-gradient(circle at 10% 20%, rgba(0, 240, 255, 0.05) 0%, transparent 20%),
|
29 |
+
radial-gradient(circle at 90% 80%, rgba(255, 0, 240, 0.05) 0%, transparent 20%);
|
30 |
}
|
31 |
|
32 |
.orbitron {
|
|
|
41 |
text-shadow: 0 0 10px var(--secondary), 0 0 20px var(--secondary);
|
42 |
}
|
43 |
|
44 |
+
.glow-tertiary {
|
45 |
+
text-shadow: 0 0 10px var(--tertiary), 0 0 20px var(--tertiary);
|
46 |
+
}
|
47 |
+
|
48 |
.btn-glow {
|
49 |
box-shadow: 0 0 15px var(--primary);
|
50 |
+
transition: all 0.3s ease;
|
51 |
}
|
52 |
|
53 |
.btn-glow:hover {
|
54 |
+
box-shadow: 0 0 25px var(--primary), 0 0 15px var(--primary);
|
55 |
+
transform: translateY(-2px);
|
56 |
}
|
57 |
|
58 |
.btn-glow-secondary {
|
59 |
box-shadow: 0 0 15px var(--secondary);
|
60 |
+
transition: all 0.3s ease;
|
61 |
}
|
62 |
|
63 |
.btn-glow-secondary:hover {
|
64 |
+
box-shadow: 0 0 25px var(--secondary), 0 0 15px var(--secondary);
|
65 |
+
transform: translateY(-2px);
|
66 |
+
}
|
67 |
+
|
68 |
+
.btn-glow-tertiary {
|
69 |
+
box-shadow: 0 0 15px var(--tertiary);
|
70 |
+
transition: all 0.3s ease;
|
71 |
+
}
|
72 |
+
|
73 |
+
.btn-glow-tertiary:hover {
|
74 |
+
box-shadow: 0 0 25px var(--tertiary), 0 0 15px var(--tertiary);
|
75 |
+
transform: translateY(-2px);
|
76 |
}
|
77 |
|
78 |
.border-glow {
|
79 |
border: 1px solid var(--primary);
|
80 |
box-shadow: 0 0 10px var(--primary), inset 0 0 10px var(--primary);
|
81 |
+
background: linear-gradient(135deg, rgba(0, 240, 255, 0.1), rgba(0, 240, 255, 0.05));
|
82 |
+
}
|
83 |
+
|
84 |
+
.border-glow-secondary {
|
85 |
+
border: 1px solid var(--secondary);
|
86 |
+
box-shadow: 0 0 10px var(--secondary), inset 0 0 10px var(--secondary);
|
87 |
+
background: linear-gradient(135deg, rgba(255, 0, 240, 0.1), rgba(255, 0, 240, 0.05));
|
88 |
}
|
89 |
|
90 |
.pulse {
|
|
|
153 |
font-size: 10px;
|
154 |
color: var(--secondary);
|
155 |
}
|
156 |
+
|
157 |
+
.cyberpunk-box {
|
158 |
+
position: relative;
|
159 |
+
overflow: hidden;
|
160 |
+
}
|
161 |
+
|
162 |
+
.cyberpunk-box::before {
|
163 |
+
content: '';
|
164 |
+
position: absolute;
|
165 |
+
top: -50%;
|
166 |
+
left: -50%;
|
167 |
+
width: 200%;
|
168 |
+
height: 200%;
|
169 |
+
background: linear-gradient(
|
170 |
+
to bottom right,
|
171 |
+
rgba(0, 240, 255, 0) 0%,
|
172 |
+
rgba(0, 240, 255, 0) 30%,
|
173 |
+
rgba(0, 240, 255, 0.3) 45%,
|
174 |
+
rgba(0, 240, 255, 0) 60%,
|
175 |
+
rgba(0, 240, 255, 0) 100%
|
176 |
+
);
|
177 |
+
transform: rotate(30deg);
|
178 |
+
animation: shine-overlay 6s infinite linear;
|
179 |
+
}
|
180 |
+
|
181 |
+
@keyframes shine-overlay {
|
182 |
+
0% { transform: translateX(-100%) rotate(30deg); }
|
183 |
+
100% { transform: translateX(100%) rotate(30deg); }
|
184 |
+
}
|
185 |
+
|
186 |
+
.device-selector {
|
187 |
+
background-color: var(--bg-light);
|
188 |
+
border: 1px solid rgba(0, 240, 255, 0.3);
|
189 |
+
color: white;
|
190 |
+
padding: 8px 12px;
|
191 |
+
border-radius: 6px;
|
192 |
+
font-size: 14px;
|
193 |
+
width: 100%;
|
194 |
+
transition: all 0.3s ease;
|
195 |
+
}
|
196 |
+
|
197 |
+
.device-selector:hover {
|
198 |
+
border-color: var(--primary);
|
199 |
+
box-shadow: 0 0 10px var(--primary);
|
200 |
+
}
|
201 |
+
|
202 |
+
.device-selector:focus {
|
203 |
+
outline: none;
|
204 |
+
border-color: var(--primary);
|
205 |
+
box-shadow: 0 0 15px var(--primary);
|
206 |
+
}
|
207 |
+
|
208 |
+
.holographic-effect {
|
209 |
+
position: relative;
|
210 |
+
}
|
211 |
+
|
212 |
+
.holographic-effect::after {
|
213 |
+
content: '';
|
214 |
+
position: absolute;
|
215 |
+
top: 0;
|
216 |
+
left: 0;
|
217 |
+
right: 0;
|
218 |
+
bottom: 0;
|
219 |
+
background: linear-gradient(
|
220 |
+
135deg,
|
221 |
+
rgba(0, 240, 255, 0.05) 0%,
|
222 |
+
rgba(255, 0, 240, 0.05) 50%,
|
223 |
+
rgba(0, 240, 255, 0.05) 100%
|
224 |
+
);
|
225 |
+
pointer-events: none;
|
226 |
+
z-index: -1;
|
227 |
+
}
|
228 |
+
|
229 |
+
.scanlines {
|
230 |
+
position: relative;
|
231 |
+
overflow: hidden;
|
232 |
+
}
|
233 |
+
|
234 |
+
.scanlines::before {
|
235 |
+
content: "";
|
236 |
+
position: absolute;
|
237 |
+
top: 0;
|
238 |
+
left: 0;
|
239 |
+
right: 0;
|
240 |
+
bottom: 0;
|
241 |
+
background: linear-gradient(
|
242 |
+
to bottom,
|
243 |
+
transparent 0%,
|
244 |
+
rgba(0, 240, 255, 0.05) 50%,
|
245 |
+
transparent 100%
|
246 |
+
);
|
247 |
+
background-size: 100% 2px;
|
248 |
+
pointer-events: none;
|
249 |
+
z-index: 1;
|
250 |
+
}
|
251 |
+
|
252 |
+
.grid-pattern {
|
253 |
+
background-image:
|
254 |
+
linear-gradient(rgba(0, 240, 255, 0.1) 1px, transparent 1px),
|
255 |
+
linear-gradient(90deg, rgba(0, 240, 255, 0.1) 1px, transparent 1px);
|
256 |
+
background-size: 20px 20px;
|
257 |
+
}
|
258 |
</style>
|
259 |
</head>
|
260 |
+
<body class="min-h-screen flex flex-col grid-pattern">
|
261 |
+
<header class="container mx-auto px-4 py-8 relative">
|
262 |
+
<div class="cyberpunk-box absolute inset-0 opacity-20"></div>
|
263 |
+
<h1 class="orbitron text-5xl md:text-6xl font-bold text-center mb-2 glow tracking-wider">
|
264 |
+
<span class="text-transparent bg-clip-text bg-gradient-to-r from-blue-400 to-purple-500">NEON</span>
|
265 |
+
<span class="text-transparent bg-clip-text bg-gradient-to-r from-purple-500 to-pink-500">NOISE</span>
|
266 |
+
<span class="text-transparent bg-clip-text bg-gradient-to-r from-pink-500 to-yellow-400">MONITOR</span>
|
267 |
+
</h1>
|
268 |
+
<p class="text-center text-gray-400 font-light tracking-wider">REAL-TIME AMBIENT NOISE LEVEL VISUALIZATION SYSTEM</p>
|
269 |
</header>
|
270 |
|
271 |
<main class="flex-grow container mx-auto px-4 py-6">
|
|
|
273 |
<!-- Left Panel -->
|
274 |
<div class="lg:col-span-1 space-y-6">
|
275 |
<!-- Microphone Status -->
|
276 |
+
<div class="bg-gray-900 bg-opacity-70 rounded-xl p-6 border-glow relative overflow-hidden scanlines">
|
277 |
+
<div class="absolute inset-0 bg-gradient-to-br from-blue-900/20 to-purple-900/20 opacity-30"></div>
|
278 |
+
<h2 class="orbitron text-xl mb-4 flex items-center relative z-10">
|
279 |
+
<i class="fas fa-microphone mr-3 text-purple-400"></i>
|
280 |
+
<span class="tracking-wider">MICROPHONE STATUS</span>
|
281 |
</h2>
|
282 |
+
<div class="flex items-center justify-between relative z-10">
|
283 |
+
<span id="micStatus" class="text-gray-300">Click start to begin</span>
|
284 |
<div id="micStatusIndicator" class="w-4 h-4 rounded-full bg-gray-600"></div>
|
285 |
</div>
|
286 |
+
|
287 |
+
<!-- Microphone Selector -->
|
288 |
+
<div class="mt-4 relative z-10">
|
289 |
+
<label for="microphoneSelect" class="block text-sm text-gray-400 mb-2 tracking-wider">SELECT INPUT DEVICE</label>
|
290 |
+
<select id="microphoneSelect" class="device-selector">
|
291 |
+
<option value="">Default Microphone</option>
|
292 |
+
</select>
|
293 |
+
</div>
|
294 |
</div>
|
295 |
|
296 |
<!-- Current Session -->
|
297 |
+
<div class="bg-gray-900 bg-opacity-70 rounded-xl p-6 border-glow-secondary relative overflow-hidden scanlines">
|
298 |
+
<div class="absolute inset-0 bg-gradient-to-br from-purple-900/20 to-pink-900/20 opacity-30"></div>
|
299 |
+
<h2 class="orbitron text-xl mb-4 flex items-center relative z-10">
|
300 |
<i class="fas fa-clock mr-3 text-blue-400"></i>
|
301 |
+
<span class="tracking-wider">CURRENT SESSION</span>
|
302 |
</h2>
|
303 |
+
<div class="text-center relative z-10">
|
304 |
<div id="sessionTimer" class="orbitron text-3xl mb-2 glow">00:00:00</div>
|
305 |
+
<div class="text-sm text-gray-400 tracking-wider">MONITORING DURATION</div>
|
306 |
</div>
|
307 |
</div>
|
308 |
|
309 |
<!-- Controls -->
|
310 |
+
<div class="bg-gray-900 bg-opacity-70 rounded-xl p-6 border-glow relative overflow-hidden scanlines">
|
311 |
+
<div class="absolute inset-0 bg-gradient-to-br from-blue-900/20 to-cyan-900/20 opacity-30"></div>
|
312 |
+
<h2 class="orbitron text-xl mb-4 flex items-center relative z-10">
|
313 |
<i class="fas fa-sliders-h mr-3 text-green-400"></i>
|
314 |
+
<span class="tracking-wider">CONTROLS</span>
|
315 |
</h2>
|
316 |
+
<div class="flex flex-col space-y-4 relative z-10">
|
317 |
+
<button id="startBtn" class="btn-glow orbitron py-3 px-6 bg-blue-600 hover:bg-blue-700 rounded-lg font-bold transition-all tracking-wider">
|
318 |
<i class="fas fa-play mr-2"></i> START MONITORING
|
319 |
</button>
|
320 |
+
<button id="stopBtn" disabled class="btn-glow-secondary orbitron py-3 px-6 bg-purple-600 hover:bg-purple-700 rounded-lg font-bold transition-all tracking-wider">
|
321 |
<i class="fas fa-stop mr-2"></i> STOP
|
322 |
</button>
|
323 |
+
<button id="resetBtn" class="btn-glow-tertiary orbitron py-3 px-6 bg-yellow-600 hover:bg-yellow-700 rounded-lg font-bold transition-all tracking-wider">
|
324 |
<i class="fas fa-redo mr-2"></i> RESET DATA
|
325 |
</button>
|
326 |
</div>
|
327 |
</div>
|
328 |
|
329 |
<!-- Threshold Settings -->
|
330 |
+
<div class="bg-gray-900 bg-opacity-70 rounded-xl p-6 border-glow-secondary relative overflow-hidden scanlines">
|
331 |
+
<div class="absolute inset-0 bg-gradient-to-br from-purple-900/20 to-pink-900/20 opacity-30"></div>
|
332 |
+
<h2 class="orbitron text-xl mb-4 flex items-center relative z-10">
|
333 |
<i class="fas fa-bell mr-3 text-yellow-400"></i>
|
334 |
+
<span class="tracking-wider">NOISE THRESHOLD</span>
|
335 |
</h2>
|
336 |
+
<div class="space-y-4 relative z-10">
|
337 |
<div>
|
338 |
+
<label for="thresholdSlider" class="block text-sm text-gray-400 mb-2 tracking-wider">ALERT LEVEL (0-100)</label>
|
339 |
+
<input type="range" id="thresholdSlider" min="0" max="100" value="70" class="w-full h-2 bg-gray-700 rounded-lg appearance-none cursor-pointer accent-purple-500">
|
340 |
+
<div class="flex justify-between text-xs text-gray-400 mt-1 tracking-wider">
|
341 |
<span>0</span>
|
342 |
<span id="thresholdValue">70</span>
|
343 |
<span>100</span>
|
344 |
</div>
|
345 |
</div>
|
346 |
<div class="flex items-center">
|
347 |
+
<input type="checkbox" id="enableThreshold" class="mr-2 w-4 h-4 accent-purple-500" checked>
|
348 |
+
<label for="enableThreshold" class="text-sm tracking-wider">ENABLE THRESHOLD ALERTS</label>
|
349 |
</div>
|
350 |
</div>
|
351 |
</div>
|
|
|
354 |
<!-- Main Panel -->
|
355 |
<div class="lg:col-span-2 space-y-6">
|
356 |
<!-- Real-time Noise Level -->
|
357 |
+
<div class="bg-gray-900 bg-opacity-70 rounded-xl p-6 border-glow relative overflow-hidden scanlines">
|
358 |
+
<div class="absolute inset-0 bg-gradient-to-br from-blue-900/20 to-cyan-900/20 opacity-30"></div>
|
359 |
+
<h2 class="orbitron text-xl mb-4 flex items-center relative z-10">
|
360 |
<i class="fas fa-volume-up mr-3 text-red-400"></i>
|
361 |
+
<span class="tracking-wider">REAL-TIME NOISE LEVEL</span>
|
362 |
</h2>
|
363 |
+
<div class="text-center mb-6 relative z-10">
|
364 |
<div id="noiseLevel" class="orbitron text-6xl md:text-8xl font-bold mb-2 glow pulse">--</div>
|
365 |
+
<div id="noiseDescription" class="text-xl text-gray-400 tracking-wider">MICROPHONE INACTIVE</div>
|
366 |
</div>
|
367 |
|
368 |
<!-- Visualizer -->
|
369 |
+
<div class="flex justify-center items-end h-32 mb-4 relative z-10" id="audioVisualizer">
|
370 |
<!-- Bars will be added dynamically -->
|
371 |
</div>
|
372 |
|
373 |
<!-- Noise Level Indicator -->
|
374 |
+
<div class="noise-level-indicator mb-2 relative z-10">
|
375 |
<div id="noiseLevelBar" class="h-full bg-green-500 rounded-lg" style="width: 0%"></div>
|
376 |
</div>
|
377 |
+
<div class="flex justify-between text-xs text-gray-400 tracking-wider relative z-10">
|
378 |
+
<span>QUIET</span>
|
379 |
+
<span>MODERATE</span>
|
380 |
+
<span>LOUD</span>
|
381 |
</div>
|
382 |
|
383 |
<!-- Stats -->
|
384 |
+
<div class="grid grid-cols-2 gap-4 mt-6 relative z-10">
|
385 |
+
<div class="bg-gray-800 bg-opacity-50 rounded-lg p-4 border border-gray-700 hover:border-blue-400 transition-all">
|
386 |
+
<div class="text-sm text-gray-400 mb-1 tracking-wider">PEAK LEVEL</div>
|
387 |
<div id="peakLevel" class="orbitron text-2xl glow-secondary">--</div>
|
388 |
</div>
|
389 |
+
<div class="bg-gray-800 bg-opacity-50 rounded-lg p-4 border border-gray-700 hover:border-purple-400 transition-all">
|
390 |
+
<div class="text-sm text-gray-400 mb-1 tracking-wider">AVERAGE</div>
|
391 |
<div id="averageLevel" class="orbitron text-2xl">--</div>
|
392 |
</div>
|
393 |
</div>
|
394 |
</div>
|
395 |
|
396 |
<!-- Historical Data -->
|
397 |
+
<div class="bg-gray-900 bg-opacity-70 rounded-xl p-6 border-glow-secondary relative overflow-hidden scanlines">
|
398 |
+
<div class="absolute inset-0 bg-gradient-to-br from-purple-900/20 to-pink-900/20 opacity-30"></div>
|
399 |
+
<h2 class="orbitron text-xl mb-4 flex items-center relative z-10">
|
400 |
<i class="fas fa-chart-line mr-3 text-green-400"></i>
|
401 |
+
<span class="tracking-wider">HISTORICAL DATA</span>
|
402 |
</h2>
|
403 |
+
<div class="relative h-64 z-10">
|
404 |
<canvas id="noiseChart"></canvas>
|
405 |
</div>
|
406 |
+
<div class="flex justify-between mt-4 relative z-10">
|
407 |
+
<div class="text-sm text-gray-400 tracking-wider">LAST 4 HOURS OF DATA</div>
|
408 |
<div class="flex space-x-2">
|
409 |
+
<button id="smoothBtn" class="text-xs px-3 py-1 bg-gray-700 rounded hover:bg-gray-600 tracking-wider">
|
410 |
+
<i class="fas fa-wave-square mr-1"></i> SMOOTH
|
411 |
</button>
|
412 |
+
<button id="rawBtn" class="text-xs px-3 py-1 bg-gray-700 rounded hover:bg-gray-600 tracking-wider">
|
413 |
+
<i class="fas fa-chart-bar mr-1"></i> RAW
|
414 |
</button>
|
415 |
</div>
|
416 |
</div>
|
417 |
</div>
|
418 |
|
419 |
<!-- Peak Values Dashboard -->
|
420 |
+
<div class="bg-gray-900 bg-opacity-70 rounded-xl p-6 border-glow relative overflow-hidden scanlines">
|
421 |
+
<div class="absolute inset-0 bg-gradient-to-br from-blue-900/20 to-cyan-900/20 opacity-30"></div>
|
422 |
+
<h2 class="orbitron text-xl mb-4 flex items-center relative z-10">
|
423 |
<i class="fas fa-mountain mr-3 text-purple-400"></i>
|
424 |
+
<span class="tracking-wider">PEAK VALUES (LAST 4 HOURS)</span>
|
425 |
</h2>
|
426 |
+
<div class="relative h-64 z-10">
|
427 |
<canvas id="peakChart"></canvas>
|
428 |
</div>
|
429 |
+
<div class="grid grid-cols-3 gap-4 mt-4 relative z-10">
|
430 |
+
<div class="bg-gray-800 bg-opacity-50 rounded-lg p-3 border border-gray-700 hover:border-blue-400 transition-all">
|
431 |
+
<div class="text-sm text-gray-400 mb-1 tracking-wider">HIGHEST PEAK</div>
|
432 |
<div id="highestPeak" class="orbitron text-xl glow-secondary">--</div>
|
433 |
</div>
|
434 |
+
<div class="bg-gray-800 bg-opacity-50 rounded-lg p-3 border border-gray-700 hover:border-purple-400 transition-all">
|
435 |
+
<div class="text-sm text-gray-400 mb-1 tracking-wider">AVG PEAKS</div>
|
436 |
<div id="avgPeaks" class="orbitron text-xl">--</div>
|
437 |
</div>
|
438 |
+
<div class="bg-gray-800 bg-opacity-50 rounded-lg p-3 border border-gray-700 hover:border-yellow-400 transition-all">
|
439 |
+
<div class="text-sm text-gray-400 mb-1 tracking-wider">THRESHOLD BREACHES</div>
|
440 |
<div id="thresholdBreaches" class="orbitron text-xl">--</div>
|
441 |
</div>
|
442 |
</div>
|
|
|
445 |
</div>
|
446 |
</main>
|
447 |
|
448 |
+
<footer class="container mx-auto px-4 py-6 text-center text-gray-500 text-sm tracking-wider">
|
449 |
+
<p class="border-t border-gray-800 pt-4">NEON NOISE MONITOR v2.0 | CYBERPUNK EDITION | USES WEB AUDIO API | DATA STAYS IN YOUR BROWSER</p>
|
450 |
</footer>
|
451 |
|
452 |
<script>
|
|
|
471 |
const highestPeak = document.getElementById('highestPeak');
|
472 |
const avgPeaks = document.getElementById('avgPeaks');
|
473 |
const thresholdBreaches = document.getElementById('thresholdBreaches');
|
474 |
+
const microphoneSelect = document.getElementById('microphoneSelect');
|
475 |
|
476 |
// Audio variables
|
477 |
let audioContext;
|
|
|
481 |
let isMonitoring = false;
|
482 |
let sessionStartTime = 0;
|
483 |
let timerInterval;
|
484 |
+
let currentStream;
|
485 |
|
486 |
// Data variables
|
487 |
let noiseData = [];
|
|
|
711 |
|
712 |
// Get noise description based on level
|
713 |
function getNoiseDescription(level) {
|
714 |
+
if (level < 20) return 'SILENT';
|
715 |
+
if (level < 40) return 'VERY QUIET';
|
716 |
+
if (level < 60) return 'MODERATE';
|
717 |
+
if (level < 80) return 'LOUD';
|
718 |
+
return 'VERY LOUD';
|
719 |
}
|
720 |
|
721 |
// Get color based on noise level
|
|
|
726 |
return '#ff0000'; // Red
|
727 |
}
|
728 |
|
729 |
+
// Populate microphone devices
|
730 |
+
async function populateMicrophoneDevices() {
|
731 |
+
try {
|
732 |
+
// Get all audio devices
|
733 |
+
const devices = await navigator.mediaDevices.enumerateDevices();
|
734 |
+
const audioInputs = devices.filter(device => device.kind === 'audioinput');
|
735 |
+
|
736 |
+
// Clear existing options
|
737 |
+
microphoneSelect.innerHTML = '';
|
738 |
+
|
739 |
+
// Add default option
|
740 |
+
const defaultOption = document.createElement('option');
|
741 |
+
defaultOption.value = '';
|
742 |
+
defaultOption.textContent = 'Default Microphone';
|
743 |
+
microphoneSelect.appendChild(defaultOption);
|
744 |
+
|
745 |
+
// Add all available microphones
|
746 |
+
audioInputs.forEach(device => {
|
747 |
+
const option = document.createElement('option');
|
748 |
+
option.value = device.deviceId;
|
749 |
+
option.textContent = device.label || `Microphone ${microphoneSelect.length + 1}`;
|
750 |
+
microphoneSelect.appendChild(option);
|
751 |
+
});
|
752 |
+
|
753 |
+
return true;
|
754 |
+
} catch (error) {
|
755 |
+
console.error('Error enumerating devices:', error);
|
756 |
+
return false;
|
757 |
+
}
|
758 |
+
}
|
759 |
+
|
760 |
// Start monitoring
|
761 |
async function startMonitoring() {
|
762 |
try {
|
763 |
+
// Get selected device ID
|
764 |
+
const deviceId = microphoneSelect.value;
|
765 |
+
const constraints = deviceId ? { audio: { deviceId: { exact: deviceId } } } : { audio: true };
|
766 |
+
|
767 |
// Request microphone access
|
768 |
+
const stream = await navigator.mediaDevices.getUserMedia(constraints);
|
769 |
+
currentStream = stream;
|
770 |
|
771 |
// Create audio context
|
772 |
audioContext = new (window.AudioContext || window.webkitAudioContext)();
|
|
|
899 |
audioContext = null;
|
900 |
}
|
901 |
|
902 |
+
if (currentStream) {
|
903 |
+
currentStream.getTracks().forEach(track => track.stop());
|
904 |
+
currentStream = null;
|
905 |
+
}
|
906 |
+
|
907 |
// Update UI
|
908 |
isMonitoring = false;
|
909 |
startBtn.disabled = false;
|
|
|
1004 |
|
1005 |
// Load historical peaks
|
1006 |
updatePeakChart();
|
1007 |
+
|
1008 |
+
// Populate microphone devices
|
1009 |
+
populateMicrophoneDevices();
|
1010 |
+
|
1011 |
+
// Update device list when devices change
|
1012 |
+
navigator.mediaDevices.addEventListener('devicechange', populateMicrophoneDevices);
|
1013 |
});
|
1014 |
</script>
|
1015 |
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=markburn/neon-noice-monitor" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|