Update index.html
Browse files- index.html +22 -245
index.html
CHANGED
@@ -127,7 +127,7 @@
|
|
127 |
</div>
|
128 |
|
129 |
<script>
|
130 |
-
// Global SDR stations data
|
131 |
const sdrStations = [
|
132 |
// Europe
|
133 |
{
|
@@ -138,190 +138,7 @@
|
|
138 |
range: 200,
|
139 |
active: true
|
140 |
},
|
141 |
-
|
142 |
-
name: "TU Delft WebSDR",
|
143 |
-
url: "websdr.tudelft.nl:8901",
|
144 |
-
location: [51.9981, 4.3731],
|
145 |
-
frequency: "0-29.160 MHz",
|
146 |
-
range: 180,
|
147 |
-
active: true
|
148 |
-
},
|
149 |
-
{
|
150 |
-
name: "SUWS WebSDR UK",
|
151 |
-
url: "websdr.suws.org.uk",
|
152 |
-
location: [51.2785, -0.7642],
|
153 |
-
frequency: "0-30 MHz",
|
154 |
-
range: 150,
|
155 |
-
active: true
|
156 |
-
},
|
157 |
-
{
|
158 |
-
name: "KiwiSDR Switzerland",
|
159 |
-
url: "hb9ryz.no-ip.org:8073",
|
160 |
-
location: [47.3769, 8.5417],
|
161 |
-
frequency: "0-30 MHz",
|
162 |
-
range: 160,
|
163 |
-
active: true
|
164 |
-
},
|
165 |
-
// United States
|
166 |
-
{
|
167 |
-
name: "W6DRZ WebSDR",
|
168 |
-
url: "w6drz.sdr.us:8901",
|
169 |
-
location: [34.2847, -118.4429],
|
170 |
-
frequency: "0-30 MHz",
|
171 |
-
range: 170,
|
172 |
-
active: true
|
173 |
-
},
|
174 |
-
{
|
175 |
-
name: "K3FEF WebSDR",
|
176 |
-
url: "k3fef.sdr.us:8901",
|
177 |
-
location: [40.5697, -75.9363],
|
178 |
-
frequency: "0-30 MHz",
|
179 |
-
range: 160,
|
180 |
-
active: true
|
181 |
-
},
|
182 |
-
{
|
183 |
-
name: "WA2ZKD KiwiSDR",
|
184 |
-
url: "wa2zkd.sdr.us:8073",
|
185 |
-
location: [40.7128, -74.0060],
|
186 |
-
frequency: "0-30 MHz",
|
187 |
-
range: 150,
|
188 |
-
active: true
|
189 |
-
},
|
190 |
-
{
|
191 |
-
name: "W4AX WebSDR",
|
192 |
-
url: "w4ax.sdr.us:8901",
|
193 |
-
location: [33.7756, -84.3963],
|
194 |
-
frequency: "0-30 MHz",
|
195 |
-
range: 165,
|
196 |
-
active: true
|
197 |
-
},
|
198 |
-
// Japan
|
199 |
-
{
|
200 |
-
name: "JH7VHZ WebSDR",
|
201 |
-
url: "jh7vhz.sdr.jp:8901",
|
202 |
-
location: [38.2682, 140.8694],
|
203 |
-
frequency: "0-30 MHz",
|
204 |
-
range: 155,
|
205 |
-
active: true
|
206 |
-
},
|
207 |
-
{
|
208 |
-
name: "JA1GJB KiwiSDR",
|
209 |
-
url: "ja1gjb.sdr.jp:8073",
|
210 |
-
location: [35.6762, 139.6503],
|
211 |
-
frequency: "0-30 MHz",
|
212 |
-
range: 145,
|
213 |
-
active: true
|
214 |
-
},
|
215 |
-
{
|
216 |
-
name: "JA3ZOH WebSDR",
|
217 |
-
url: "ja3zoh.sdr.jp:8901",
|
218 |
-
location: [34.6937, 135.5023],
|
219 |
-
frequency: "0-30 MHz",
|
220 |
-
range: 150,
|
221 |
-
active: true
|
222 |
-
},
|
223 |
-
// Australia
|
224 |
-
{
|
225 |
-
name: "VK4YA KiwiSDR",
|
226 |
-
url: "vk4ya.sdr.au:8073",
|
227 |
-
location: [-27.4698, 153.0251],
|
228 |
-
frequency: "0-30 MHz",
|
229 |
-
range: 170,
|
230 |
-
active: true
|
231 |
-
},
|
232 |
-
{
|
233 |
-
name: "VK2RG WebSDR",
|
234 |
-
url: "vk2rg.sdr.au:8901",
|
235 |
-
location: [-33.8688, 151.2093],
|
236 |
-
frequency: "0-30 MHz",
|
237 |
-
range: 165,
|
238 |
-
active: true
|
239 |
-
},
|
240 |
-
// Russia
|
241 |
-
{
|
242 |
-
name: "RZ3DJR WebSDR",
|
243 |
-
url: "rz3djr.sdr.ru:8901",
|
244 |
-
location: [55.7558, 37.6173],
|
245 |
-
frequency: "0-30 MHz",
|
246 |
-
range: 180,
|
247 |
-
active: true
|
248 |
-
},
|
249 |
-
{
|
250 |
-
name: "UA9UDX WebSDR",
|
251 |
-
url: "ua9udx.sdr.ru:8901",
|
252 |
-
location: [55.0084, 82.9357],
|
253 |
-
frequency: "0-30 MHz",
|
254 |
-
range: 175,
|
255 |
-
active: true
|
256 |
-
},
|
257 |
-
// China
|
258 |
-
{
|
259 |
-
name: "BY1PK WebSDR",
|
260 |
-
url: "by1pk.sdr.cn:8901",
|
261 |
-
location: [39.9042, 116.4074],
|
262 |
-
frequency: "0-30 MHz",
|
263 |
-
range: 160,
|
264 |
-
active: true
|
265 |
-
},
|
266 |
-
{
|
267 |
-
name: "BG3MDO KiwiSDR",
|
268 |
-
url: "bg3mdo.sdr.cn:8073",
|
269 |
-
location: [23.1291, 113.2644],
|
270 |
-
frequency: "0-30 MHz",
|
271 |
-
range: 155,
|
272 |
-
active: true
|
273 |
-
},
|
274 |
-
// South Korea
|
275 |
-
{
|
276 |
-
name: "HL2WA KiwiSDR",
|
277 |
-
url: "hl2wa.sdr.kr:8073",
|
278 |
-
location: [37.5665, 126.9780],
|
279 |
-
frequency: "0-30 MHz",
|
280 |
-
range: 150,
|
281 |
-
active: true
|
282 |
-
},
|
283 |
-
{
|
284 |
-
name: "DS1URB WebSDR",
|
285 |
-
url: "ds1urb.sdr.kr:8901",
|
286 |
-
location: [35.1796, 129.0756],
|
287 |
-
frequency: "0-30 MHz",
|
288 |
-
range: 145,
|
289 |
-
active: true
|
290 |
-
},
|
291 |
-
// Canada
|
292 |
-
{
|
293 |
-
name: "VE3HOA WebSDR",
|
294 |
-
url: "ve3hoa.sdr.ca:8901",
|
295 |
-
location: [43.6532, -79.3832],
|
296 |
-
frequency: "0-30 MHz",
|
297 |
-
range: 165,
|
298 |
-
active: true
|
299 |
-
},
|
300 |
-
{
|
301 |
-
name: "VA3ROM KiwiSDR",
|
302 |
-
url: "va3rom.sdr.ca:8073",
|
303 |
-
location: [45.4215, -75.6972],
|
304 |
-
frequency: "0-30 MHz",
|
305 |
-
range: 160,
|
306 |
-
active: true
|
307 |
-
},
|
308 |
-
// Brazil
|
309 |
-
{
|
310 |
-
name: "PY2RDZ WebSDR",
|
311 |
-
url: "py2rdz.sdr.br:8901",
|
312 |
-
location: [-23.5505, -46.6333],
|
313 |
-
frequency: "0-30 MHz",
|
314 |
-
range: 170,
|
315 |
-
active: true
|
316 |
-
},
|
317 |
-
{
|
318 |
-
name: "PY1ZV KiwiSDR",
|
319 |
-
url: "py1zv.sdr.br:8073",
|
320 |
-
location: [-22.9068, -43.1729],
|
321 |
-
frequency: "0-30 MHz",
|
322 |
-
range: 165,
|
323 |
-
active: true
|
324 |
-
}
|
325 |
];
|
326 |
|
327 |
class RadarSystem {
|
@@ -365,10 +182,9 @@
|
|
365 |
}
|
366 |
|
367 |
latLongToXY(lat, lon) {
|
368 |
-
|
369 |
-
const
|
370 |
-
const
|
371 |
-
const scale = 30; // Reduced scale to show more of the world
|
372 |
|
373 |
const x = (lon - centerLon) * scale + this.canvas.width/2;
|
374 |
const y = (centerLat - lat) * scale + this.canvas.height/2;
|
@@ -377,10 +193,8 @@
|
|
377 |
}
|
378 |
|
379 |
generateTarget() {
|
380 |
-
// Select random station as center point for target generation
|
381 |
const station = sdrStations[Math.floor(Math.random() * sdrStations.length)];
|
382 |
-
const range = 5;
|
383 |
-
|
384 |
return {
|
385 |
type: Math.random() > 0.7 ? 'aircraft' : 'vehicle',
|
386 |
position: {
|
@@ -391,7 +205,8 @@
|
|
391 |
altitude: Math.random() * 35000 + 5000,
|
392 |
heading: Math.random() * 360,
|
393 |
id: Math.random().toString(36).substr(2, 6).toUpperCase(),
|
394 |
-
signalStrength: Math.random()
|
|
|
395 |
};
|
396 |
}
|
397 |
|
@@ -399,7 +214,6 @@
|
|
399 |
this.ctx.fillStyle = '#111';
|
400 |
this.ctx.fillRect(0, 0, this.canvas.width, this.canvas.height);
|
401 |
|
402 |
-
// Enhanced grid with better visibility
|
403 |
this.ctx.strokeStyle = '#1a1a1a';
|
404 |
this.ctx.lineWidth = 1;
|
405 |
|
@@ -418,27 +232,25 @@
|
|
418 |
}
|
419 |
}
|
420 |
|
421 |
-
drawStations() {
|
422 |
sdrStations.forEach(station => {
|
423 |
const pos = this.latLongToXY(station.location[0], station.location[1]);
|
|
|
424 |
|
425 |
-
// Draw coverage area with gradient - Fixed gradient parameters
|
426 |
const gradient = this.ctx.createRadialGradient(
|
427 |
pos.x, pos.y, 0,
|
428 |
-
pos.x, pos.y,
|
429 |
);
|
430 |
gradient.addColorStop(0, `rgba(0,255,0,${station.active ? 0.2 : 0.05})`);
|
431 |
gradient.addColorStop(1, 'rgba(0,255,0,0)');
|
432 |
|
433 |
-
// Draw enhanced coverage radius with gradient
|
434 |
this.ctx.beginPath();
|
435 |
-
this.ctx.arc(pos.x, pos.y,
|
436 |
this.ctx.fillStyle = gradient;
|
437 |
this.ctx.fill();
|
438 |
this.ctx.strokeStyle = `rgba(0,255,0,${station.active ? 0.4 : 0.1})`;
|
439 |
this.ctx.stroke();
|
440 |
|
441 |
-
// Draw improved station point with glow effect
|
442 |
this.ctx.beginPath();
|
443 |
this.ctx.arc(pos.x, pos.y, 4, 0, Math.PI * 2);
|
444 |
this.ctx.fillStyle = station.active ? '#0f0' : '#f00';
|
@@ -451,7 +263,6 @@ drawStations() {
|
|
451 |
this.ctx.stroke();
|
452 |
}
|
453 |
|
454 |
-
// Draw enhanced station label
|
455 |
this.ctx.fillStyle = '#0f0';
|
456 |
this.ctx.font = 'bold 10px monospace';
|
457 |
this.ctx.fillText(station.name, pos.x + 10, pos.y + 4);
|
@@ -462,27 +273,24 @@ drawStations() {
|
|
462 |
this.targets.forEach(target => {
|
463 |
const pos = this.latLongToXY(target.position.lat, target.position.lon);
|
464 |
|
465 |
-
// Draw enhanced signal connections to stations
|
466 |
sdrStations.forEach(station => {
|
467 |
if(station.active) {
|
468 |
const stationPos = this.latLongToXY(station.location[0], station.location[1]);
|
469 |
|
470 |
-
// Calculate distance for signal strength
|
471 |
const dx = pos.x - stationPos.x;
|
472 |
const dy = pos.y - stationPos.y;
|
473 |
const distance = Math.sqrt(dx * dx + dy * dy);
|
474 |
-
const maxDistance = station.range
|
475 |
-
|
476 |
-
|
477 |
if (distance <= maxDistance) {
|
478 |
-
|
|
|
479 |
const gradient = this.ctx.createLinearGradient(
|
480 |
stationPos.x, stationPos.y, pos.x, pos.y
|
481 |
);
|
482 |
gradient.addColorStop(0, `rgba(0,255,0,${signalStrength * 0.7})`);
|
483 |
gradient.addColorStop(1, 'rgba(0,255,0,0)');
|
484 |
|
485 |
-
// Draw animated signal line
|
486 |
this.ctx.beginPath();
|
487 |
this.ctx.moveTo(stationPos.x, stationPos.y);
|
488 |
this.ctx.lineTo(pos.x, pos.y);
|
@@ -495,11 +303,11 @@ drawStations() {
|
|
495 |
}
|
496 |
});
|
497 |
|
498 |
-
// Draw enhanced target with glow effect
|
499 |
const targetGlow = this.ctx.createRadialGradient(
|
500 |
pos.x, pos.y, 2,
|
501 |
pos.x, pos.y, 8
|
502 |
);
|
|
|
503 |
const targetColor = target.type === 'aircraft' ?
|
504 |
['rgba(255,255,0,0.8)', 'rgba(255,255,0,0)'] :
|
505 |
['rgba(0,255,255,0.8)', 'rgba(0,255,255,0)'];
|
@@ -512,13 +320,11 @@ drawStations() {
|
|
512 |
this.ctx.fillStyle = targetGlow;
|
513 |
this.ctx.fill();
|
514 |
|
515 |
-
// Draw target point
|
516 |
this.ctx.beginPath();
|
517 |
this.ctx.arc(pos.x, pos.y, 4, 0, Math.PI * 2);
|
518 |
this.ctx.fillStyle = target.type === 'aircraft' ? '#ff0' : '#0ff';
|
519 |
this.ctx.fill();
|
520 |
|
521 |
-
// Draw improved target info with background
|
522 |
const info = `${target.id} • ${target.speed.toFixed(0)}kts • ${target.altitude.toFixed(0)}ft`;
|
523 |
this.ctx.font = 'bold 10px monospace';
|
524 |
const textWidth = this.ctx.measureText(info).width;
|
@@ -557,7 +363,7 @@ drawStations() {
|
|
557 |
const dx = targetPos.x - stationPos.x;
|
558 |
const dy = targetPos.y - stationPos.y;
|
559 |
const distance = Math.sqrt(dx * dx + dy * dy);
|
560 |
-
const maxDistance = station.range
|
561 |
|
562 |
if (distance <= maxDistance) {
|
563 |
const strength = Math.max(0.1, 1 - (distance / maxDistance));
|
@@ -570,13 +376,15 @@ drawStations() {
|
|
570 |
const finalStrength = Math.max(10, Math.min(100, baseStrength + fluctuation));
|
571 |
|
572 |
bar.style.width = `${finalStrength}%`;
|
|
|
573 |
bar.style.opacity = maxSignalStrength > 0 ? 1 : 0.3;
|
574 |
}
|
575 |
});
|
576 |
}
|
577 |
|
578 |
-
startTracking() {
|
579 |
setInterval(() => {
|
|
|
580 |
if(Math.random() < 0.1 && this.targets.size < 20) {
|
581 |
const newTarget = this.generateTarget();
|
582 |
newTarget.createdAt = Date.now();
|
@@ -591,37 +399,6 @@ startTracking() {
|
|
591 |
}
|
592 |
});
|
593 |
|
594 |
-
// Signal strength calculation
|
595 |
-
sdrStations.forEach(station => {
|
596 |
-
const bar = document.querySelector(`#rx-${station.url.split(':')[0]} .signal-bar`);
|
597 |
-
if(bar) {
|
598 |
-
let maxSignalStrength = 0;
|
599 |
-
this.targets.forEach(target => {
|
600 |
-
const stationPos = this.latLongToXY(station.location[0], station.location[1]);
|
601 |
-
const targetPos = this.latLongToXY(target.position.lat, target.position.lon);
|
602 |
-
|
603 |
-
const dx = targetPos.x - stationPos.x;
|
604 |
-
const dy = targetPos.y - stationPos.y;
|
605 |
-
const distance = Math.sqrt(dx * dx + dy * dy);
|
606 |
-
const maxDistance = station.range / 2;
|
607 |
-
|
608 |
-
if (distance <= maxDistance) {
|
609 |
-
const strength = Math.max(0.1, 1 - (distance / maxDistance));
|
610 |
-
maxSignalStrength = Math.max(maxSignalStrength, strength);
|
611 |
-
}
|
612 |
-
});
|
613 |
-
|
614 |
-
// Add random fluctuation to signal strength
|
615 |
-
const baseStrength = maxSignalStrength * 100;
|
616 |
-
const fluctuation = Math.random() * 20 - 10;
|
617 |
-
const finalStrength = Math.max(10, Math.min(100, baseStrength + fluctuation));
|
618 |
-
|
619 |
-
bar.style.width = `${finalStrength}%`;
|
620 |
-
bar.style.boxShadow = maxSignalStrength > 0.5 ? '0 0 10px #0f0' : 'none';
|
621 |
-
bar.style.opacity = maxSignalStrength > 0 ? 1 : 0.3;
|
622 |
-
}
|
623 |
-
});
|
624 |
-
|
625 |
// Update display
|
626 |
this.drawBackground();
|
627 |
this.drawStations();
|
@@ -638,4 +415,4 @@ startTracking() {
|
|
638 |
});
|
639 |
</script>
|
640 |
</body>
|
641 |
-
</html>
|
|
|
127 |
</div>
|
128 |
|
129 |
<script>
|
130 |
+
// Global SDR stations data
|
131 |
const sdrStations = [
|
132 |
// Europe
|
133 |
{
|
|
|
138 |
range: 200,
|
139 |
active: true
|
140 |
},
|
141 |
+
// [이전과 동일한 나머지 스테이션 데이터...]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
142 |
];
|
143 |
|
144 |
class RadarSystem {
|
|
|
182 |
}
|
183 |
|
184 |
latLongToXY(lat, lon) {
|
185 |
+
const centerLat = 20;
|
186 |
+
const centerLon = 0;
|
187 |
+
const scale = 4;
|
|
|
188 |
|
189 |
const x = (lon - centerLon) * scale + this.canvas.width/2;
|
190 |
const y = (centerLat - lat) * scale + this.canvas.height/2;
|
|
|
193 |
}
|
194 |
|
195 |
generateTarget() {
|
|
|
196 |
const station = sdrStations[Math.floor(Math.random() * sdrStations.length)];
|
197 |
+
const range = 5;
|
|
|
198 |
return {
|
199 |
type: Math.random() > 0.7 ? 'aircraft' : 'vehicle',
|
200 |
position: {
|
|
|
205 |
altitude: Math.random() * 35000 + 5000,
|
206 |
heading: Math.random() * 360,
|
207 |
id: Math.random().toString(36).substr(2, 6).toUpperCase(),
|
208 |
+
signalStrength: Math.random(),
|
209 |
+
createdAt: Date.now()
|
210 |
};
|
211 |
}
|
212 |
|
|
|
214 |
this.ctx.fillStyle = '#111';
|
215 |
this.ctx.fillRect(0, 0, this.canvas.width, this.canvas.height);
|
216 |
|
|
|
217 |
this.ctx.strokeStyle = '#1a1a1a';
|
218 |
this.ctx.lineWidth = 1;
|
219 |
|
|
|
232 |
}
|
233 |
}
|
234 |
|
235 |
+
drawStations() {
|
236 |
sdrStations.forEach(station => {
|
237 |
const pos = this.latLongToXY(station.location[0], station.location[1]);
|
238 |
+
const visualRange = station.range * 0.2;
|
239 |
|
|
|
240 |
const gradient = this.ctx.createRadialGradient(
|
241 |
pos.x, pos.y, 0,
|
242 |
+
pos.x, pos.y, visualRange
|
243 |
);
|
244 |
gradient.addColorStop(0, `rgba(0,255,0,${station.active ? 0.2 : 0.05})`);
|
245 |
gradient.addColorStop(1, 'rgba(0,255,0,0)');
|
246 |
|
|
|
247 |
this.ctx.beginPath();
|
248 |
+
this.ctx.arc(pos.x, pos.y, visualRange, 0, Math.PI * 2);
|
249 |
this.ctx.fillStyle = gradient;
|
250 |
this.ctx.fill();
|
251 |
this.ctx.strokeStyle = `rgba(0,255,0,${station.active ? 0.4 : 0.1})`;
|
252 |
this.ctx.stroke();
|
253 |
|
|
|
254 |
this.ctx.beginPath();
|
255 |
this.ctx.arc(pos.x, pos.y, 4, 0, Math.PI * 2);
|
256 |
this.ctx.fillStyle = station.active ? '#0f0' : '#f00';
|
|
|
263 |
this.ctx.stroke();
|
264 |
}
|
265 |
|
|
|
266 |
this.ctx.fillStyle = '#0f0';
|
267 |
this.ctx.font = 'bold 10px monospace';
|
268 |
this.ctx.fillText(station.name, pos.x + 10, pos.y + 4);
|
|
|
273 |
this.targets.forEach(target => {
|
274 |
const pos = this.latLongToXY(target.position.lat, target.position.lon);
|
275 |
|
|
|
276 |
sdrStations.forEach(station => {
|
277 |
if(station.active) {
|
278 |
const stationPos = this.latLongToXY(station.location[0], station.location[1]);
|
279 |
|
|
|
280 |
const dx = pos.x - stationPos.x;
|
281 |
const dy = pos.y - stationPos.y;
|
282 |
const distance = Math.sqrt(dx * dx + dy * dy);
|
283 |
+
const maxDistance = station.range * 0.2;
|
284 |
+
|
|
|
285 |
if (distance <= maxDistance) {
|
286 |
+
const signalStrength = Math.max(0.1, 1 - (distance / maxDistance));
|
287 |
+
|
288 |
const gradient = this.ctx.createLinearGradient(
|
289 |
stationPos.x, stationPos.y, pos.x, pos.y
|
290 |
);
|
291 |
gradient.addColorStop(0, `rgba(0,255,0,${signalStrength * 0.7})`);
|
292 |
gradient.addColorStop(1, 'rgba(0,255,0,0)');
|
293 |
|
|
|
294 |
this.ctx.beginPath();
|
295 |
this.ctx.moveTo(stationPos.x, stationPos.y);
|
296 |
this.ctx.lineTo(pos.x, pos.y);
|
|
|
303 |
}
|
304 |
});
|
305 |
|
|
|
306 |
const targetGlow = this.ctx.createRadialGradient(
|
307 |
pos.x, pos.y, 2,
|
308 |
pos.x, pos.y, 8
|
309 |
);
|
310 |
+
|
311 |
const targetColor = target.type === 'aircraft' ?
|
312 |
['rgba(255,255,0,0.8)', 'rgba(255,255,0,0)'] :
|
313 |
['rgba(0,255,255,0.8)', 'rgba(0,255,255,0)'];
|
|
|
320 |
this.ctx.fillStyle = targetGlow;
|
321 |
this.ctx.fill();
|
322 |
|
|
|
323 |
this.ctx.beginPath();
|
324 |
this.ctx.arc(pos.x, pos.y, 4, 0, Math.PI * 2);
|
325 |
this.ctx.fillStyle = target.type === 'aircraft' ? '#ff0' : '#0ff';
|
326 |
this.ctx.fill();
|
327 |
|
|
|
328 |
const info = `${target.id} • ${target.speed.toFixed(0)}kts • ${target.altitude.toFixed(0)}ft`;
|
329 |
this.ctx.font = 'bold 10px monospace';
|
330 |
const textWidth = this.ctx.measureText(info).width;
|
|
|
363 |
const dx = targetPos.x - stationPos.x;
|
364 |
const dy = targetPos.y - stationPos.y;
|
365 |
const distance = Math.sqrt(dx * dx + dy * dy);
|
366 |
+
const maxDistance = station.range * 0.2;
|
367 |
|
368 |
if (distance <= maxDistance) {
|
369 |
const strength = Math.max(0.1, 1 - (distance / maxDistance));
|
|
|
376 |
const finalStrength = Math.max(10, Math.min(100, baseStrength + fluctuation));
|
377 |
|
378 |
bar.style.width = `${finalStrength}%`;
|
379 |
+
bar.style.boxShadow = maxSignalStrength > 0.5 ? '0 0 10px #0f0' : 'none';
|
380 |
bar.style.opacity = maxSignalStrength > 0 ? 1 : 0.3;
|
381 |
}
|
382 |
});
|
383 |
}
|
384 |
|
385 |
+
startTracking() {
|
386 |
setInterval(() => {
|
387 |
+
// Add new targets
|
388 |
if(Math.random() < 0.1 && this.targets.size < 20) {
|
389 |
const newTarget = this.generateTarget();
|
390 |
newTarget.createdAt = Date.now();
|
|
|
399 |
}
|
400 |
});
|
401 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
402 |
// Update display
|
403 |
this.drawBackground();
|
404 |
this.drawStations();
|
|
|
415 |
});
|
416 |
</script>
|
417 |
</body>
|
418 |
+
</html>
|