kolaslab commited on
Commit
0e4238b
ยท
verified ยท
1 Parent(s): 255454b

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +74 -19
index.html CHANGED
@@ -1,19 +1,74 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ updateDetections() {
2
+ const detections = document.getElementById('detections');
3
+ detections.innerHTML = Array.from(this.targets)
4
+ .map(target => `
5
+ <div class="detection">
6
+ ${target.type === 'aircraft' ? 'โœˆ๏ธ' : '๐Ÿš—'}
7
+ ${target.id}
8
+ ${target.speed.toFixed(0)}kts
9
+ ${target.type === 'aircraft' ? `${target.altitude.toFixed(0)}ft` : ''}
10
+ Signal: ${(target.signalStrength * 100).toFixed(0)}%
11
+ Position: ${target.position.lat.toFixed(2)}ยฐ, ${target.position.lon.toFixed(2)}ยฐ
12
+ </div>
13
+ `).join('');
14
+ }
15
+
16
+ updateSignalStrengths() {
17
+ sdrStations.forEach(station => {
18
+ const bar = document.querySelector(`#rx-${station.url.split(':')[0]} .signal-bar`);
19
+ if(bar) {
20
+ const strength = 40 + Math.random() * 60;
21
+ bar.style.width = `${strength}%`;
22
+ }
23
+ });
24
+ }
25
+
26
+ startTracking() {
27
+ setInterval(() => {
28
+ // ํƒ€๊ฒŸ ์ถ”๊ฐ€/์ œ๊ฑฐ
29
+ if(Math.random() < 0.1 && this.targets.size < 15) {
30
+ this.targets.add(this.generateTarget());
31
+ }
32
+ if(Math.random() < 0.1 && this.targets.size > 0) {
33
+ this.targets.delete(Array.from(this.targets)[0]);
34
+ }
35
+
36
+ // ๊ธฐ์กด ํƒ€๊ฒŸ ์—…๋ฐ์ดํŠธ (์›€์ง์ž„ ์‹œ๋ฎฌ๋ ˆ์ด์…˜)
37
+ this.targets.forEach(target => {
38
+ // ํ˜„์žฌ ๋ฐฉํ–ฅ์œผ๋กœ ์ด๋™
39
+ const speed = target.speed / 3600; // kts to degrees per second (approximate)
40
+ const radians = target.heading * Math.PI / 180;
41
+
42
+ target.position.lon += Math.sin(radians) * speed;
43
+ target.position.lat += Math.cos(radians) * speed;
44
+
45
+ // ํ™”๋ฉด ๊ฒฝ๊ณ„ ์ฒ˜๋ฆฌ
46
+ if(target.position.lon > 180) target.position.lon -= 360;
47
+ if(target.position.lon < -180) target.position.lon += 360;
48
+ if(target.position.lat > 75) target.position.lat = 75;
49
+ if(target.position.lat < -75) target.position.lat = -75;
50
+
51
+ // ๊ฐ€๋” ๋ฐฉํ–ฅ ๋ณ€๊ฒฝ
52
+ if(Math.random() < 0.05) {
53
+ target.heading += (Math.random() - 0.5) * 30;
54
+ target.heading = (target.heading + 360) % 360;
55
+ }
56
+
57
+ // ์‹ ํ˜ธ ๊ฐ•๋„ ๋ณ€๋™
58
+ target.signalStrength = Math.max(0.1, Math.min(1, target.signalStrength + (Math.random() - 0.5) * 0.1));
59
+ });
60
+
61
+ this.drawWorldMap();
62
+ this.drawStations();
63
+ this.drawTargets();
64
+ this.updateDetections();
65
+ this.updateSignalStrengths();
66
+ }, 100);
67
+ }
68
+ }
69
+
70
+ // Initialize global radar system
71
+ const radar = new GlobalRadarSystem();
72
+ </script>
73
+ </body>
74
+ </html>