PANTALLAS ASUR

CUN · SALIDAS · TIEMPO REAL
00:00
--
Cargando...
--:--
VUELO DESTINO / HORA T ESTATUS
erval(() => { var n = new Date(); document.getElementById('clock').textContent = n.toLocaleTimeString([], {hour:'2-digit', minute:'2-digit'}); document.getElementById('date').textContent = n.toLocaleDateString('es-ES', {day:'2-digit', month:'short', year:'numeric'}).toUpperCase(); }, 1000); // ================= INICIO ================= document.documentElement.setAttribute('data-theme', localStorage.getItem('cun-theme')||'light'); fetchData(); setInterval(fetchData, 30000); '
' + fullFlight + '
'; html += ''; html += '
'; html += '
' + (v.ORI_DEST || '') + dateHTML + '' + (v.DEST_IATA || '') + '
'; html += '
'; html += 'STD ' + std + ''; // Mostrar ETD si es diferente o hay demora if (etd !== std || dm !== 0) { html += 'ETD ' + etd + '' + deltaHTML; } html += '
'; html += '
T' + t + '
'; html += '
' + est + '
'; html += ''; }); list.innerHTML = html; } function setTerm(t, btn) { filterTerm = t; document.querySelectorAll('.term-row .btn').forEach(b => b.classList.remove('active')); btn.classList.add('active'); updateAirlineList(); // Refrescar lista de aerolíneas según terminal render(); } function setStatus(s, btn) { filterStatus = s; document.querySelectorAll('.status-chips .chip').forEach(b => b.classList.remove('active')); btn.classList.add('active'); render(); } function toggleTheme() { var html = document.documentElement; var current = html.getAttribute('data-theme'); var next = current === 'dark' ? 'light' : 'dark'; html.setAttribute('data-theme', next); localStorage.setItem('cun-theme', next); } function updateAirlineList() { var sel = document.getElementById('airlineFilter'); var current = sel.value; var set = {}; flights.forEach(v => { if (filterTerm !== 'ALL' && String(v.TERMINAL) !== filterTerm) return; var a = (v.AEROLINEA || '').trim(); if (a) set[a] = 1; }); sel.innerHTML = ''; Object.keys(set).sort().forEach(a => { sel.innerHTML += ''; }); // Intentar mantener selección previa si existe if ([...sel.options].some(opt => opt.value === current)) { sel.value = current; } else { sel.value = 'ALL'; } } // Reloj en tiempo real setInterval(function() { var now = new Date(); document.getElementById('clock').textContent = now.toLocaleTimeString([], {hour: '2-digit', minute: '2-digit'}); document.getElementById('date').textContent = now.toLocaleDateString('es-ES', {day: '2-digit', month: 'short', year: 'numeric'}).toUpperCase(); }, 1000); // Inicialización document.documentElement.setAttribute('data-theme', localStorage.getItem('cun-theme') || 'light'); fetchData(); setInterval(fetchData, 30000);