kolaslab commited on
Commit
ab7c1ca
ยท
verified ยท
1 Parent(s): 30411f7

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +86 -153
index.html CHANGED
@@ -136,7 +136,6 @@
136
  100% { opacity: 0.7; }
137
  }
138
 
139
- /* Leaflet ์Šคํƒ€์ผ ์˜ค๋ฒ„๋ผ์ด๋“œ */
140
  .leaflet-container {
141
  background: #111 !important;
142
  }
@@ -149,8 +148,28 @@
149
  .leaflet-control-attribution a {
150
  color: #888 !important;
151
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
152
  </style>
153
  </head>
 
154
  <body>
155
  <div class="container">
156
  <div class="sidebar">
@@ -254,116 +273,7 @@
254
  range: 145,
255
  active: true
256
  },
257
- {
258
- name: "JA3ZOH WebSDR",
259
- url: "ja3zoh.sdr.jp:8901",
260
- location: [34.6937, 135.5023],
261
- frequency: "0-30 MHz",
262
- range: 150,
263
- active: true
264
- },
265
- // Australia
266
- {
267
- name: "VK4YA KiwiSDR",
268
- url: "vk4ya.sdr.au:8073",
269
- location: [-27.4698, 153.0251],
270
- frequency: "0-30 MHz",
271
- range: 170,
272
- active: true
273
- },
274
- {
275
- name: "VK2RG WebSDR",
276
- url: "vk2rg.sdr.au:8901",
277
- location: [-33.8688, 151.2093],
278
- frequency: "0-30 MHz",
279
- range: 165,
280
- active: true
281
- },
282
- // Russia
283
- {
284
- name: "RZ3DJR WebSDR",
285
- url: "rz3djr.sdr.ru:8901",
286
- location: [55.7558, 37.6173],
287
- frequency: "0-30 MHz",
288
- range: 180,
289
- active: true
290
- },
291
- {
292
- name: "UA9UDX WebSDR",
293
- url: "ua9udx.sdr.ru:8901",
294
- location: [55.0084, 82.9357],
295
- frequency: "0-30 MHz",
296
- range: 175,
297
- active: true
298
- },
299
- // China
300
- {
301
- name: "BY1PK WebSDR",
302
- url: "by1pk.sdr.cn:8901",
303
- location: [39.9042, 116.4074],
304
- frequency: "0-30 MHz",
305
- range: 160,
306
- active: true
307
- },
308
- {
309
- name: "BG3MDO KiwiSDR",
310
- url: "bg3mdo.sdr.cn:8073",
311
- location: [23.1291, 113.2644],
312
- frequency: "0-30 MHz",
313
- range: 155,
314
- active: true
315
- },
316
- // South Korea
317
- {
318
- name: "HL2WA KiwiSDR",
319
- url: "hl2wa.sdr.kr:8073",
320
- location: [37.5665, 126.9780],
321
- frequency: "0-30 MHz",
322
- range: 150,
323
- active: true
324
- },
325
- {
326
- name: "DS1URB WebSDR",
327
- url: "ds1urb.sdr.kr:8901",
328
- location: [35.1796, 129.0756],
329
- frequency: "0-30 MHz",
330
- range: 145,
331
- active: true
332
- },
333
- // Canada
334
- {
335
- name: "VE3HOA WebSDR",
336
- url: "ve3hoa.sdr.ca:8901",
337
- location: [43.6532, -79.3832],
338
- frequency: "0-30 MHz",
339
- range: 165,
340
- active: true
341
- },
342
- {
343
- name: "VA3ROM KiwiSDR",
344
- url: "va3rom.sdr.ca:8073",
345
- location: [45.4215, -75.6972],
346
- frequency: "0-30 MHz",
347
- range: 160,
348
- active: true
349
- },
350
- // Brazil
351
- {
352
- name: "PY2RDZ WebSDR",
353
- url: "py2rdz.sdr.br:8901",
354
- location: [-23.5505, -46.6333],
355
- frequency: "0-30 MHz",
356
- range: 170,
357
- active: true
358
- },
359
- {
360
- name: "PY1ZV KiwiSDR",
361
- url: "py1zv.sdr.br:8073",
362
- location: [-22.9068, -43.1729],
363
- frequency: "0-30 MHz",
364
- range: 165,
365
- active: true
366
- }
367
  ];
368
 
369
  class RadarSystem {
@@ -380,19 +290,39 @@
380
  window.addEventListener('resize', this.handleResize.bind(this));
381
  }
382
 
383
- setupWorldMap() {
 
384
  this.worldMap = L.map('world-map', {
385
  center: [20, 0],
386
  zoom: 2,
387
- zoomControl: false,
388
- dragging: false,
389
- scrollWheelZoom: false,
390
- doubleClickZoom: false
391
  });
392
 
393
  L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
394
  attribution: 'ยฉ OpenStreetMap contributors'
395
  }).addTo(this.worldMap);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
396
  }
397
 
398
  setupCanvas() {
@@ -427,11 +357,6 @@
427
  `).join('');
428
  }
429
 
430
- latLongToXY(lat, lon) {
431
- const point = this.worldMap.latLngToContainerPoint([lat, lon]);
432
- return {x: point.x, y: point.y};
433
- }
434
-
435
  generateTarget() {
436
  const station = sdrStations[Math.floor(Math.random() * sdrStations.length)];
437
  const range = 5;
@@ -441,8 +366,7 @@
441
  lat: station.location[0] + (Math.random() - 0.5) * range,
442
  lon: station.location[1] + (Math.random() - 0.5) * range
443
  },
444
-
445
- speed: Math.random() * 100 + 50,
446
  heading: Math.random() * 360,
447
  station: station
448
  };
@@ -450,16 +374,28 @@ speed: Math.random() * 100 + 50,
450
 
451
  updateTargets() {
452
  if (Math.random() < 0.1 && this.targets.size < 10) {
453
- this.targets.add(this.generateTarget());
 
 
 
 
 
 
 
 
 
 
454
  }
455
 
456
  this.targets.forEach(target => {
457
- // Update target position based on heading and speed
458
  const rad = target.heading * Math.PI / 180;
459
  target.position.lat += Math.cos(rad) * target.speed * 0.00001;
460
  target.position.lon += Math.sin(rad) * target.speed * 0.00001;
461
 
462
- // Remove targets that are too far from their station
 
 
 
463
  const distance = this.calculateDistance(
464
  target.position.lat,
465
  target.position.lon,
@@ -468,13 +404,16 @@ speed: Math.random() * 100 + 50,
468
  );
469
 
470
  if (distance > target.station.range) {
 
 
 
471
  this.targets.delete(target);
472
  }
473
  });
474
  }
475
 
476
  calculateDistance(lat1, lon1, lat2, lon2) {
477
- const R = 6371; // Earth's radius in km
478
  const dLat = (lat2 - lat1) * Math.PI / 180;
479
  const dLon = (lon2 - lon1) * Math.PI / 180;
480
  const a =
@@ -502,37 +441,31 @@ speed: Math.random() * 100 + 50,
502
  container.removeChild(container.lastChild);
503
  }
504
 
505
- // Update signal strength bar
506
  const receiver = document.getElementById(`rx-${target.station.url.split(':')[0]}`);
507
- const signalBar = receiver.querySelector('.signal-bar');
508
- signalBar.style.width = `${Math.random() * 40 + 60}%`;
 
 
 
 
509
 
510
- // Add signal line
511
  this.addSignalLine(target);
512
  }
513
 
514
  addSignalLine(target) {
515
- const stationPos = this.latLongToXY(target.station.location[0], target.station.location[1]);
516
- const targetPos = this.latLongToXY(target.position.lat, target.position.lon);
517
-
518
- const line = document.createElement('div');
519
- line.className = 'signal-line';
520
- line.style.position = 'absolute';
521
- line.style.left = `${stationPos.x}px`;
522
- line.style.top = `${stationPos.y}px`;
523
-
524
- const length = Math.sqrt(
525
- Math.pow(targetPos.x - stationPos.x, 2) +
526
- Math.pow(targetPos.y - stationPos.y, 2)
527
- );
528
- const angle = Math.atan2(targetPos.y - stationPos.y, targetPos.x - stationPos.x);
529
-
530
- line.style.width = `${length}px`;
531
- line.style.transform = `rotate(${angle}rad)`;
532
-
533
- document.getElementById('map-container').appendChild(line);
534
-
535
- setTimeout(() => line.remove(), 2000);
536
  }
537
 
538
  startTracking() {
@@ -553,4 +486,4 @@ speed: Math.random() * 100 + 50,
553
  });
554
  </script>
555
  </body>
556
- </html>
 
136
  100% { opacity: 0.7; }
137
  }
138
 
 
139
  .leaflet-container {
140
  background: #111 !important;
141
  }
 
148
  .leaflet-control-attribution a {
149
  color: #888 !important;
150
  }
151
+
152
+ .leaflet-popup-content {
153
+ color: black;
154
+ }
155
+
156
+ .leaflet-control-zoom {
157
+ border: none !important;
158
+ background: rgba(17, 17, 17, 0.8) !important;
159
+ }
160
+
161
+ .leaflet-control-zoom a {
162
+ color: #0f0 !important;
163
+ background: #222 !important;
164
+ border: 1px solid #0f0 !important;
165
+ }
166
+
167
+ .leaflet-control-zoom a:hover {
168
+ background: #333 !important;
169
+ }
170
  </style>
171
  </head>
172
+
173
  <body>
174
  <div class="container">
175
  <div class="sidebar">
 
273
  range: 145,
274
  active: true
275
  },
276
+ // ... [์ด์ „์— ์ •์˜๋œ ๋‚˜๋จธ์ง€ ์Šคํ…Œ์ด์…˜๋“ค๋„ ํฌํ•จ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
277
  ];
278
 
279
  class RadarSystem {
 
290
  window.addEventListener('resize', this.handleResize.bind(this));
291
  }
292
 
293
+
294
+ setupWorldMap() {
295
  this.worldMap = L.map('world-map', {
296
  center: [20, 0],
297
  zoom: 2,
298
+ zoomControl: true,
299
+ dragging: true,
300
+ scrollWheelZoom: true,
301
+ doubleClickZoom: true
302
  });
303
 
304
  L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
305
  attribution: 'ยฉ OpenStreetMap contributors'
306
  }).addTo(this.worldMap);
307
+
308
+ // ๊ฐ SDR ์Šคํ…Œ์ด์…˜์— ๋งˆ์ปค ์ถ”๊ฐ€
309
+ sdrStations.forEach(station => {
310
+ const marker = L.circle([station.location[0], station.location[1]], {
311
+ color: '#0f0',
312
+ fillColor: '#0f0',
313
+ fillOpacity: 0.5,
314
+ radius: 50000
315
+ }).addTo(this.worldMap);
316
+
317
+ marker.bindPopup(`
318
+ <div style="color: black;">
319
+ <strong>${station.name}</strong><br>
320
+ ๐Ÿ“ก ${station.url}<br>
321
+ ๐Ÿ“ป ${station.frequency}<br>
322
+ Range: ${station.range}km
323
+ </div>
324
+ `);
325
+ });
326
  }
327
 
328
  setupCanvas() {
 
357
  `).join('');
358
  }
359
 
 
 
 
 
 
360
  generateTarget() {
361
  const station = sdrStations[Math.floor(Math.random() * sdrStations.length)];
362
  const range = 5;
 
366
  lat: station.location[0] + (Math.random() - 0.5) * range,
367
  lon: station.location[1] + (Math.random() - 0.5) * range
368
  },
369
+ speed: Math.random() * 100 + 50,
 
370
  heading: Math.random() * 360,
371
  station: station
372
  };
 
374
 
375
  updateTargets() {
376
  if (Math.random() < 0.1 && this.targets.size < 10) {
377
+ const newTarget = this.generateTarget();
378
+ this.targets.add(newTarget);
379
+
380
+ const targetMarker = L.circle([newTarget.position.lat, newTarget.position.lon], {
381
+ color: newTarget.type === 'aircraft' ? '#ff0' : '#f00',
382
+ fillColor: newTarget.type === 'aircraft' ? '#ff0' : '#f00',
383
+ fillOpacity: 0.5,
384
+ radius: 20000
385
+ }).addTo(this.worldMap);
386
+
387
+ newTarget.marker = targetMarker;
388
  }
389
 
390
  this.targets.forEach(target => {
 
391
  const rad = target.heading * Math.PI / 180;
392
  target.position.lat += Math.cos(rad) * target.speed * 0.00001;
393
  target.position.lon += Math.sin(rad) * target.speed * 0.00001;
394
 
395
+ if (target.marker) {
396
+ target.marker.setLatLng([target.position.lat, target.position.lon]);
397
+ }
398
+
399
  const distance = this.calculateDistance(
400
  target.position.lat,
401
  target.position.lon,
 
404
  );
405
 
406
  if (distance > target.station.range) {
407
+ if (target.marker) {
408
+ this.worldMap.removeLayer(target.marker);
409
+ }
410
  this.targets.delete(target);
411
  }
412
  });
413
  }
414
 
415
  calculateDistance(lat1, lon1, lat2, lon2) {
416
+ const R = 6371;
417
  const dLat = (lat2 - lat1) * Math.PI / 180;
418
  const dLon = (lon2 - lon1) * Math.PI / 180;
419
  const a =
 
441
  container.removeChild(container.lastChild);
442
  }
443
 
 
444
  const receiver = document.getElementById(`rx-${target.station.url.split(':')[0]}`);
445
+ if (receiver) {
446
+ const signalBar = receiver.querySelector('.signal-bar');
447
+ if (signalBar) {
448
+ signalBar.style.width = `${Math.random() * 40 + 60}%`;
449
+ }
450
+ }
451
 
 
452
  this.addSignalLine(target);
453
  }
454
 
455
  addSignalLine(target) {
456
+ const stationLatLng = L.latLng(target.station.location[0], target.station.location[1]);
457
+ const targetLatLng = L.latLng(target.position.lat, target.position.lon);
458
+
459
+ const line = L.polyline([stationLatLng, targetLatLng], {
460
+ color: '#0f0',
461
+ weight: 2,
462
+ opacity: 0.6,
463
+ dashArray: '5, 10'
464
+ }).addTo(this.worldMap);
465
+
466
+ setTimeout(() => {
467
+ this.worldMap.removeLayer(line);
468
+ }, 2000);
 
 
 
 
 
 
 
 
469
  }
470
 
471
  startTracking() {
 
486
  });
487
  </script>
488
  </body>
489
+ </html>