-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathastra-net.html
More file actions
641 lines (587 loc) · 24.5 KB
/
astra-net.html
File metadata and controls
641 lines (587 loc) · 24.5 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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ASTRA-Net Platform | YAKAMI TECH</title>
<meta name="description" content="Sistema de monitoramento e rastreamento por satélite para a Amazônia - Tecnologia de Órbita Baixa (LEO)" />
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" />
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" />
<style>
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: #0f172a;
margin: 0;
padding: 0;
min-height: 100vh;
}
.leaflet-container {
background: #1e293b;
border-radius: 12px;
}
.vessel-marker {
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 10px;
color: black;
transition: all 0.3s ease;
box-shadow: 0 2px 6px rgba(0,0,0,0.3);
border: 2px solid white;
}
.vessel-balsa { background-color: #f97316; }
.vessel-lancha { background-color: #facc15; }
.vessel-recreio { background-color: #e5e7eb; }
.vessel-navio-patrulha { background-color: #3b82f6; color: white;}
.vessel-carga { background-color: #6b7280; color: white;}
.vessel-hidrooceanografico { background-color: #10b981; }
.vessel-hospitalar { background-color: #ef4444; color: white;}
.animate-pulse-sos {
animation: pulse-sos 1.5s infinite;
}
@keyframes pulse-sos {
0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
50% { box-shadow: 0 0 0 12px rgba(239, 68, 68, 0); }
}
.panel-bg {
background: #1e293b;
border: 1px solid #334155;
border-radius: 12px;
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.panel-title {
border-bottom: 1px solid #334155;
padding-bottom: 0.75rem;
margin-bottom: 0.75rem;
font-size: 1.1rem;
font-weight: 600;
}
/* Estilo para a área metropolitana de Manaus */
.manaus-area {
fill: rgba(59, 130, 246, 0.15);
stroke: rgba(59, 130, 246, 0.8);
stroke-width: 3;
stroke-dasharray: 5, 5;
}
/* Correção para garantir que o mapa ocupe todo o espaço */
#map {
width: 100%;
height: 100%;
min-height: 600px;
}
.main-container {
min-height: 100vh;
display: flex;
flex-direction: column;
}
/* Estilo para a logo NASA */
.nasa-badge {
background: linear-gradient(135deg, #1a237e, #283593);
border: 1px solid #3949ab;
}
/* Melhorias de responsividade */
@media (max-width: 768px) {
#map {
min-height: 400px;
}
}
</style>
</head>
<body class="text-gray-200">
<header class="bg-gray-900/95 backdrop-blur-sm border-b border-gray-700 py-4 sticky top-0 z-50">
<div class="container mx-auto px-4 flex items-center justify-between">
<a href="https://www.yakami.com.br/" class="flex items-center space-x-3">
<div class="bg-orange-500 w-10 h-10 rounded-lg flex items-center justify-center">
<i class="fas fa-satellite text-white text-lg"></i>
</div>
<div>
<div class="font-bold text-xl">YAKAMI TECH</div>
<div class="text-xs text-gray-400">ASTRA-Net Platform</div>
</div>
</a>
<div class="nasa-badge text-white px-4 py-2 rounded-full flex items-center space-x-2">
<i class="fas fa-rocket text-red-400"></i>
<span class="font-semibold">NASA Space Apps 2025</span>
</div>
</div>
</header>
<main class="flex-1 container mx-auto px-4 py-6">
<!-- Cabeçalho Principal -->
<div class="text-center mb-8">
<h1 class="text-4xl font-bold mb-3 bg-gradient-to-r from-orange-500 to-blue-500 bg-clip-text text-transparent">
ASTRA-Net Platform
</h1>
<p class="text-gray-300 text-lg max-w-3xl mx-auto leading-relaxed">
Sistema de monitoramento e rastreamento por satélite para a Amazônia - Tecnologia de Órbita Baixa (LEO)
</p>
</div>
<!-- Subtítulo -->
<div class="text-center mb-8">
<h2 class="text-2xl font-bold mb-2">DEMONSTRAÇÃO INTERATIVA</h2>
<h3 class="text-xl text-gray-300">Mapa de Monitoramento & Operações Fluviais da Amazônia</h3>
</div>
<!-- Layout Principal: Mapa + Painéis -->
<div class="grid grid-cols-1 xl:grid-cols-4 gap-6 mb-8">
<!-- Mapa - Ocupa 3 colunas -->
<div class="xl:col-span-3 h-[600px]">
<div id="map" class="w-full h-full rounded-xl border-2 border-gray-600 shadow-2xl"></div>
</div>
<!-- Painéis Laterais - Ocupa 1 coluna -->
<div class="xl:col-span-1 space-y-4">
<!-- Telemetria -->
<div id="telemetry-panel" class="panel-bg p-5">
<h3 class="panel-title">Telemetria do Ativo</h3>
<div class="text-gray-400 text-sm">
Selecione uma embarcação no mapa para ver dados em tempo real.
</div>
</div>
<!-- Orbital -->
<div id="orbital-panel" class="panel-bg p-5">
<h3 class="panel-title">Visibilidade Orbital</h3>
<div class="space-y-3">
<div class="flex justify-between items-center">
<span class="text-gray-300">Status:</span>
<span id="orbital-status" class="font-bold text-red-400">NÃO VISÍVEL</span>
</div>
<div class="text-sm text-gray-400">
Próxima passagem em: <span id="next-pass" class="font-mono text-cyan-300">11:29</span>
</div>
</div>
</div>
<!-- Alertas -->
<div id="alerts-panel" class="panel-bg p-5">
<h3 class="panel-title">Co-Piloto e Alertas</h3>
<div id="alerts-content" class="text-gray-400 text-sm">
Sistema inicializado. Aguardando dados...
</div>
</div>
<!-- Botões de Ação -->
<div class="grid grid-cols-2 gap-4">
<button onclick="activateSOS()" class="bg-red-600 hover:bg-red-500 text-white px-4 py-3 rounded-lg flex items-center justify-center transition-all duration-200 font-semibold shadow-lg">
<i class="fas fa-exclamation-triangle mr-2"></i> S.O.S
</button>
<button class="bg-blue-600 hover:bg-blue-500 text-white px-4 py-3 rounded-lg flex items-center justify-center transition-all duration-200 font-semibold shadow-lg">
<i class="fas fa-envelope mr-2"></i> Mensagem
</button>
</div>
</div>
</div>
<!-- Seção NASA - Agora em linha única -->
<section class="mb-12">
<div class="text-center mb-8">
<h2 class="text-3xl font-bold mb-4">Integração com Dados da NASA</h2>
<p class="text-gray-300 text-lg max-w-4xl mx-auto">
Utilizando o ecossistema de dados da NASA para uma operação mais inteligente e segura na Amazônia
</p>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
<div class="bg-gray-800/50 p-6 rounded-xl border border-gray-700 hover:border-blue-500 transition-all duration-300">
<i class="fas fa-globe-americas text-blue-400 text-3xl mb-4"></i>
<h3 class="font-bold text-lg mb-3">NASA Earthdata Search</h3>
<p class="text-gray-300 leading-relaxed">Monitoramento ambiental, análise de desmatamento e qualidade da água dos rios.</p>
</div>
<div class="bg-gray-800/50 p-6 rounded-xl border border-gray-700 hover:border-yellow-500 transition-all duration-300">
<i class="fas fa-solar-panel text-yellow-400 text-3xl mb-4"></i>
<h3 class="font-bold text-lg mb-3">NASA POWER</h3>
<p class="text-gray-300 leading-relaxed">Previsão de irradiação solar para otimizar a geração de energia das YAKAMI Eco Stations.</p>
</div>
<div class="bg-gray-800/50 p-6 rounded-xl border border-gray-700 hover:border-gray-400 transition-all duration-300">
<i class="fas fa-user-astronaut text-gray-300 text-3xl mb-4"></i>
<h3 class="font-bold text-lg mb-3">Orbital Debris Program</h3>
<p class="text-gray-300 leading-relaxed">Planejamento de órbita e mitigação de riscos para a futura constelação YAKAMI-SAT.</p>
</div>
<div class="bg-gray-800/50 p-6 rounded-xl border border-gray-700 hover:border-green-500 transition-all duration-300">
<i class="fas fa-broadcast-tower text-green-400 text-3xl mb-4"></i>
<h3 class="font-bold text-lg mb-3">Satellite Situation Report</h3>
<p class="text-gray-300 leading-relaxed">Otimização das janelas de comunicação com satélites ativos para garantir a conectividade.</p>
</div>
</div>
</section>
<!-- Seção NORMAM-204 -->
<section class="bg-blue-900/20 p-8 rounded-2xl border border-blue-700/30">
<h2 class="text-2xl font-bold mb-6 text-center">Conformidade com a NORMAM-204 da Marinha do Brasil</h2>
<p class="text-gray-300 mb-6 text-lg leading-relaxed text-center">
A partir de 1º de janeiro de 2026, todas as embarcações com Arqueação Bruta ≥ 50 estão obrigadas a utilizar um sistema de monitoramento AVL (Automatic Vehicle Location) em tempo real.
</p>
<ul class="list-none space-y-3 max-w-2xl mx-auto">
<li class="flex items-start">
<i class="fas fa-check-circle text-green-400 mt-1 mr-3"></i>
<span class="text-gray-300">O ASTRA-Net é um <strong class="text-white">Provedor de Serviço de Monitoramento</strong> compatível com os requisitos da Marinha.</span>
</li>
<li class="flex items-start">
<i class="fas fa-check-circle text-green-400 mt-1 mr-3"></i>
<span class="text-gray-300">Nossos dispositivos YAKAMI são certificados pela <strong class="text-white">Anatel</strong> e transmitem dados para o <strong class="text-white">SISTRAM</strong>.</span>
</li>
<li class="flex items-start">
<i class="fas fa-check-circle text-green-400 mt-1 mr-3"></i>
<span class="text-gray-300">Garantimos <strong class="text-white">180 dias de armazenamento de dados</strong> para auditoria.</span>
</li>
</ul>
</section>
</main>
<script>
// --- INICIALIZAÇÃO DO MAPA ---
const map = L.map('map').setView([-3.1190, -60.0217], 11);
// Tile layer com fallback
L.tileLayer('https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png', {
attribution: '© OpenStreetMap & CARTO',
maxZoom: 18
}).addTo(map);
// Adicionar camada de fallback caso a principal falhe
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 18,
opacity: 0.7
}).addTo(map);
// --- DESTAQUE DA ÁREA METROPOLITANA DE MANAUS ---
const manausMetroArea = [
[-3.00, -60.15], [-3.00, -59.85],
[-3.30, -59.85], [-3.30, -60.15]
];
L.polygon(manausMetroArea, {
color: '#3b82f6',
fillColor: '#3b82f6',
fillOpacity: 0.1,
weight: 3,
dashArray: '5, 5',
className: 'manaus-area'
}).addTo(map).bindPopup('<strong>Área Metropolitana de Manaus</strong><br>Centro de operações ASTRA-Net');
// --- RIOS PRINCIPAIS ---
const rios = [
{
nome: "Rio Negro",
coords: [
[-2.8, -60.5], [-3.0, -60.3], [-3.1, -60.1],
[-3.2, -60.0], [-3.3, -59.9], [-3.4, -59.8]
]
},
{
nome: "Rio Solimões",
coords: [
[-3.1, -60.0], [-3.2, -59.8], [-3.3, -59.6], [-3.4, -59.4]
]
},
{
nome: "Encontro das Águas",
coords: [
[-3.15, -59.95], [-3.17, -59.92], [-3.19, -59.90]
]
}
];
rios.forEach(rio => {
L.polyline(rio.coords, {
color: '#3b82f6',
weight: 5,
opacity: 0.8
}).addTo(map).bindPopup(`<strong>${rio.nome}</strong>`);
});
// --- PONTOS DE INTERESSE ---
const pointsOfInterest = [
{ nome: "Porto de Manaus", lat: -3.134, lng: -59.992, type: 'porto-organizado' },
{ nome: "Porto Chibatão", lat: -3.145, lng: -60.025, type: 'porto-container' },
{ nome: "Base da Marinha (9º DN)", lat: -3.1100, lng: -60.0100, type: 'marinha' },
{ nome: "Comunidade Janauari", lat: -3.22, lng: -60.15, type: 'comunidade' },
{ nome: "Comunidade do Tupé", lat: -3.05, lng: -60.25, type: 'comunidade' },
{ nome: "Aeroporto de Manaus", lat: -3.0386, lng: -60.0497, type: 'aeroporto' },
{ nome: "Centro de Manaus", lat: -3.1190, lng: -60.0217, type: 'centro' }
];
pointsOfInterest.forEach(p => {
let iconHtml, iconClass;
switch(p.type) {
case 'porto-organizado':
iconHtml = '<i class="fas fa-ship"></i>';
iconClass = 'text-amber-500 bg-amber-500/20 p-2 rounded-full';
break;
case 'porto-container':
iconHtml = '<i class="fas fa-warehouse"></i>';
iconClass = 'text-gray-400 bg-gray-400/20 p-2 rounded-full';
break;
case 'marinha':
iconHtml = '<i class="fas fa-shield-alt"></i>';
iconClass = 'text-blue-600 bg-blue-600/20 p-2 rounded-full';
break;
case 'comunidade':
iconHtml = '<i class="fas fa-users"></i>';
iconClass = 'text-green-400 bg-green-400/20 p-2 rounded-full';
break;
case 'aeroporto':
iconHtml = '<i class="fas fa-plane"></i>';
iconClass = 'text-red-400 bg-red-400/20 p-2 rounded-full';
break;
case 'centro':
iconHtml = '<i class="fas fa-city"></i>';
iconClass = 'text-white bg-white/20 p-2 rounded-full';
break;
default:
iconHtml = '<i class="fas fa-map-marker-alt"></i>';
iconClass = 'text-white bg-white/20 p-2 rounded-full';
}
const icon = L.divIcon({
className: `point-marker ${iconClass}`,
html: iconHtml,
iconSize: [40, 40],
iconAnchor: [20, 20]
});
L.marker([p.lat, p.lng], { icon: icon })
.addTo(map)
.bindPopup(`<strong>${p.nome}</strong><br><small>${p.type.toUpperCase()}</small>`);
});
// --- FROTA DE EMBARCAÇÕES ---
const vessels = [
{
id: 1,
nome: "Balsa Iranduba",
empresa: "Barcas Iranduba",
tipo: "balsa",
rota: "Manaus ↔ Iranduba",
lat: -3.1350,
lng: -60.2100,
bateria: 88,
sinal: -80,
velocidade: 8.2,
rpm: 1500
},
{
id: 2,
nome: "Lancha Janauari",
empresa: "COOBARQ",
tipo: "lancha",
rota: "Manaus ↔ Janauari",
lat: -3.0600,
lng: -60.0900,
bateria: 92,
sinal: -75,
velocidade: 18.5,
rpm: 2800
},
{
id: 3,
nome: "NAsH Oswaldo Cruz",
empresa: "Marinha do Brasil",
tipo: "hospitalar",
rota: "Atendimento Comunidades",
lat: -3.1500,
lng: -60.0500,
bateria: 89,
sinal: -82,
velocidade: 14.2,
rpm: 1900
},
{
id: 4,
nome: "Dona Helen",
empresa: "Transporte Fluvial",
tipo: "lancha",
rota: "Manaus ↔ Parintins",
lat: -3.1000,
lng: -60.0800,
bateria: 85,
sinal: -78,
velocidade: 16.8,
rpm: 2400
}
];
const vesselMarkers = {};
let selectedVessel = null;
let alerts = [];
let passSchedule = [];
// --- FUNÇÕES PRINCIPAIS ---
function getVesselIcon(type) {
const icons = {
balsa: 'ship',
lancha: 'bolt',
recreio: 'ship',
'navio-patrulha': 'shield-alt',
carga: 'box',
hidrooceanografico: 'water',
hospitalar: 'hospital'
};
return icons[type] || 'ship';
}
function renderVessels() {
vessels.forEach(v => {
const el = L.divIcon({
className: `vessel-marker vessel-${v.tipo} ${selectedVessel?.id === v.id ? 'border-yellow-400 scale-125 ring-2 ring-yellow-400' : 'border-white'} ${v.sosActive ? 'animate-pulse-sos' : ''}`,
html: `<i class="fas fa-${getVesselIcon(v.tipo)} text-xs"></i>`,
iconSize: [28, 28],
iconAnchor: [14, 14]
});
if (vesselMarkers[v.id]) {
vesselMarkers[v.id].setLatLng([v.lat, v.lng]).setIcon(el);
} else {
vesselMarkers[v.id] = L.marker([v.lat, v.lng], { icon: el })
.addTo(map)
.bindPopup(`
<div class="font-semibold">${v.nome}</div>
<div class="text-sm text-gray-600">${v.empresa}</div>
<div class="text-xs text-blue-600">${v.rota}</div>
`)
.on('click', () => selectVessel(v));
}
});
}
function selectVessel(v) {
selectedVessel = v;
updateTelemetryPanel();
updateAlertsPanel();
renderVessels();
map.setView([v.lat, v.lng], 13);
}
function activateSOS() {
if (!selectedVessel) {
alert('⚠️ Selecione uma embarcação no mapa antes de ativar o S.O.S');
return;
}
selectedVessel.sosActive = true;
addAlert('SOS', `🚨 Sinal de SOS ativado para ${selectedVessel.nome}!`);
renderVessels();
// Auto-reset após 10 segundos
setTimeout(() => {
if (selectedVessel) {
selectedVessel.sosActive = false;
renderVessels();
}
}, 10000);
}
function updateTelemetryPanel() {
const panel = document.getElementById('telemetry-panel');
if (!selectedVessel) {
panel.innerHTML = `
<h3 class="panel-title">Telemetria do Ativo</h3>
<div class="text-gray-400 text-sm">
<i class="fas fa-mouse-pointer mr-2"></i>Clique em uma embarcação no mapa
</div>
`;
return;
}
const v = selectedVessel;
panel.innerHTML = `
<h3 class="panel-title">${v.nome}</h3>
<div class="space-y-3">
<div class="flex justify-between items-center">
<span class="text-gray-400">Empresa:</span>
<span class="font-semibold">${v.empresa}</span>
</div>
<div class="flex justify-between items-center">
<span class="text-gray-400">Rota:</span>
<span class="text-blue-400 font-semibold">${v.rota}</span>
</div>
<div class="border-t border-gray-700 pt-3 space-y-2">
<div class="flex justify-between items-center">
<span class="text-gray-400">Posição:</span>
<span class="font-mono text-sm">${v.lat.toFixed(4)}, ${v.lng.toFixed(4)}</span>
</div>
<div class="flex justify-between items-center">
<span class="text-gray-400">Velocidade:</span>
<span class="text-yellow-400 font-semibold">${v.velocidade.toFixed(1)} nós</span>
</div>
<div class="flex justify-between items-center">
<span class="text-gray-400">RPM:</span>
<span class="font-semibold">${v.rpm.toFixed(0)}</span>
</div>
<div class="flex justify-between items-center">
<span class="text-gray-400">Bateria:</span>
<span class="text-green-400 font-semibold">${v.bateria.toFixed(0)}%</span>
</div>
</div>
</div>
`;
}
function addAlert(type, msg) {
alerts.unshift({
type,
msg,
time: new Date().toLocaleTimeString('pt-BR', { hour12: false })
});
if (alerts.length > 5) alerts.pop();
updateAlertsPanel();
}
function updateAlertsPanel() {
const panel = document.getElementById('alerts-panel');
let alertsContent = '';
if (alerts.length > 0) {
alertsContent = alerts.map(alert =>
`<div class="text-sm mb-2 p-2 rounded ${alert.type === 'SOS' ? 'bg-red-500/20 text-red-300 border border-red-500/30' : 'bg-blue-500/20 text-blue-300'}">
<span class="font-mono text-xs">[${alert.time}]</span> ${alert.msg}
</div>`
).join('');
} else {
alertsContent = '<div class="text-gray-400 text-sm">Nenhum alerta no momento</div>';
}
panel.innerHTML = `
<h3 class="panel-title">Co-Piloto e Alertas</h3>
<div class="space-y-2 max-h-40 overflow-y-auto">
${alertsContent}
</div>
`;
}
function updateOrbitalPanel() {
const now = new Date();
// Gerar passagens se necessário
if (!passSchedule.length || passSchedule[0].time < now) {
const sats = ["YAKAMI-SAT-01", "Starlink", "TERRA (NASA)", "AQUA (NASA)"];
passSchedule = [];
for (let i = 0; i < 3; i++) {
passSchedule.push({
sat: sats[Math.floor(Math.random() * sats.length)],
time: new Date(now.getTime() + (i * 10 + Math.random() * 15) * 60000),
dur: 5 + Math.floor(Math.random() * 5)
});
}
passSchedule.sort((a,b) => a.time - b.time);
}
const next = passSchedule[0];
const timeToPass = next.time - now;
let statusText = "NÃO VISÍVEL", statusColor = "text-red-400", countdownText = "";
if (timeToPass < 0 && timeToPass > -next.dur * 60000) {
statusText = "VISÍVEL";
statusColor = "text-green-400";
const remaining = Math.floor((next.dur * 60000 + timeToPass) / 1000);
countdownText = `Fim em: <span class="font-mono font-bold">${String(Math.floor(remaining/60)).padStart(2,'0')}:${String(remaining%60).padStart(2,'0')}</span>`;
} else {
const diff = Math.max(0, Math.floor(timeToPass / 1000));
countdownText = `Próxima em: <span class="font-mono font-bold">${String(Math.floor(diff/60)).padStart(2,'0')}:${String(diff%60).padStart(2,'0')}</span>`;
}
// Atualizar elementos da UI
document.getElementById('orbital-status').textContent = statusText;
document.getElementById('orbital-status').className = `font-bold ${statusColor}`;
document.getElementById('next-pass').innerHTML = countdownText.split(': ')[1].replace('</span>', '');
}
// --- SIMULAÇÃO EM TEMPO REAL ---
function simulateMovement() {
vessels.forEach(v => {
// Movimento mais suave e realista
v.lat += (Math.random() - 0.5) * 0.002;
v.lng += (Math.random() - 0.5) * 0.002;
v.velocidade += (Math.random() - 0.5) * 0.1;
v.velocidade = Math.max(5, Math.min(25, v.velocidade)); // Limites realistas
v.rpm += (Math.random() - 0.5) * 10;
v.bateria -= 0.02;
if (v.bateria < 15) v.bateria = 100; // Recarga
});
renderVessels();
if (selectedVessel) updateTelemetryPanel();
}
// --- INICIALIZAÇÃO ---
document.addEventListener('DOMContentLoaded', function() {
renderVessels();
updateTelemetryPanel();
updateAlertsPanel();
updateOrbitalPanel();
// Alerta de sistema inicializado
setTimeout(() => {
addAlert('SISTEMA', 'Sistema ASTRA-Net inicializado com sucesso');
}, 1000);
// Configurar intervalos
setInterval(updateOrbitalPanel, 1000);
setInterval(simulateMovement, 3000);
// Forçar redimensionamento do mapa após carregamento
setTimeout(() => {
map.invalidateSize();
}, 100);
});
</script>
</body>
</html>