748 lines
25 KiB
HTML
748 lines
25 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta http-equiv="refresh" content="300">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Swansea Airport - Arrivals & Departures</title>
|
|
<style>
|
|
/* Overall page styling */
|
|
body {
|
|
margin: 0;
|
|
font-family: Arial, sans-serif;
|
|
display: grid;
|
|
grid-template-rows: auto 1fr auto;
|
|
grid-template-columns: 1fr;
|
|
height: 100vh;
|
|
font-size: 30px; /* Increased font size */
|
|
}
|
|
|
|
/* Header styles */
|
|
header {
|
|
background-color: #333;
|
|
color: white;
|
|
padding: 20px;
|
|
text-align: center;
|
|
position: relative;
|
|
}
|
|
|
|
header img.left-image {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
height: auto;
|
|
}
|
|
|
|
header img.right-image {
|
|
position: absolute;
|
|
top: 0;
|
|
right: 0;
|
|
width: 9%;
|
|
height: auto;
|
|
}
|
|
|
|
/* Main section styles */
|
|
main {
|
|
display: grid;
|
|
grid-template-columns: 1fr 1fr; /* Two equal-width columns */
|
|
gap: 20px;
|
|
padding: 20px;
|
|
overflow-y: auto;
|
|
}
|
|
|
|
/* Table styles */
|
|
table {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
margin: 0;
|
|
border: 1px solid #ccc;
|
|
}
|
|
|
|
th, td {
|
|
padding: 12px;
|
|
text-align: left;
|
|
border: 1px solid #ccc;
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
}
|
|
|
|
th {
|
|
background-color: #f4f4f4;
|
|
}
|
|
|
|
tr:nth-child(even) {
|
|
background-color: #d3d3d3;
|
|
}
|
|
|
|
/* Footer styles */
|
|
footer {
|
|
background-color: #333;
|
|
color: white;
|
|
text-align: center;
|
|
padding: 10px 0;
|
|
position: relative;
|
|
overflow: hidden;
|
|
}
|
|
|
|
/* Marquee container */
|
|
.marquee {
|
|
display: inline-block;
|
|
white-space: nowrap;
|
|
padding-right: 100%; /* This makes the text start out of view */
|
|
animation: scroll-left 20s linear infinite;
|
|
}
|
|
|
|
/* Keyframes for scrolling animation */
|
|
@keyframes scroll-left {
|
|
from {
|
|
transform: translateX(100%);
|
|
}
|
|
to {
|
|
transform: translateX(-100%);
|
|
}
|
|
}
|
|
|
|
/* Marquee text styling */
|
|
.marquee-text {
|
|
font-size: 18px;
|
|
font-weight: bold;
|
|
color: #f4f4f4;
|
|
padding-left: 50px;
|
|
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
|
|
}
|
|
|
|
/* Loading indicator */
|
|
.loading {
|
|
text-align: center;
|
|
padding: 20px;
|
|
color: #666;
|
|
}
|
|
|
|
/* Error message */
|
|
.error {
|
|
text-align: center;
|
|
padding: 20px;
|
|
color: #e74c3c;
|
|
}
|
|
|
|
/* Responsive adjustments */
|
|
@media (max-width: 768px) {
|
|
main {
|
|
grid-template-columns: 1fr; /* Stack columns on smaller screens */
|
|
}
|
|
}
|
|
|
|
/* Christmas toggle switch */
|
|
.christmas-toggle {
|
|
position: absolute;
|
|
right: 20px;
|
|
top: 20px;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
color: white;
|
|
font-size: 14px;
|
|
}
|
|
|
|
.toggle-checkbox {
|
|
width: 50px;
|
|
height: 24px;
|
|
cursor: pointer;
|
|
appearance: none;
|
|
background-color: #555;
|
|
border-radius: 12px;
|
|
border: none;
|
|
outline: none;
|
|
transition: background-color 0.3s;
|
|
position: relative;
|
|
}
|
|
|
|
.toggle-checkbox:checked {
|
|
background-color: #27ae60;
|
|
}
|
|
|
|
.toggle-checkbox::before {
|
|
content: '';
|
|
position: absolute;
|
|
width: 20px;
|
|
height: 20px;
|
|
border-radius: 50%;
|
|
background-color: white;
|
|
top: 2px;
|
|
left: 2px;
|
|
transition: left 0.3s;
|
|
}
|
|
|
|
.toggle-checkbox:checked::before {
|
|
left: 28px;
|
|
}
|
|
|
|
/* Santa hat styles */
|
|
.santa-hat {
|
|
position: absolute;
|
|
width: 60px;
|
|
height: 50px;
|
|
top: -20px;
|
|
transform: rotate(-20deg);
|
|
z-index: 10;
|
|
}
|
|
|
|
.santa-hat::before {
|
|
content: '';
|
|
position: absolute;
|
|
width: 100%;
|
|
height: 70%;
|
|
background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
|
|
clip-path: polygon(0 0, 100% 0, 90% 100%, 10% 100%);
|
|
}
|
|
|
|
.santa-hat::after {
|
|
content: '';
|
|
position: absolute;
|
|
width: 20px;
|
|
height: 20px;
|
|
background: white;
|
|
border-radius: 50%;
|
|
bottom: -5px;
|
|
right: -8px;
|
|
box-shadow: -15px 5px 0 -5px white;
|
|
}
|
|
|
|
/* Jingle bell styles */
|
|
.jingle-bell {
|
|
display: inline-block;
|
|
position: relative;
|
|
width: 12px;
|
|
height: 14px;
|
|
margin: 0 2px;
|
|
animation: jingle 0.4s ease-in-out infinite;
|
|
}
|
|
|
|
.jingle-bell::before {
|
|
content: '';
|
|
position: absolute;
|
|
width: 100%;
|
|
height: 100%;
|
|
background: #f1c40f;
|
|
border-radius: 50% 50% 50% 0;
|
|
transform: rotate(-45deg);
|
|
box-shadow: 0 2px 4px rgba(0,0,0,0.3);
|
|
}
|
|
|
|
.jingle-bell::after {
|
|
content: '';
|
|
position: absolute;
|
|
width: 3px;
|
|
height: 6px;
|
|
background: #d4a500;
|
|
top: -6px;
|
|
left: 50%;
|
|
transform: translateX(-50%);
|
|
}
|
|
|
|
@keyframes jingle {
|
|
0%, 100% { transform: rotate(0deg); }
|
|
25% { transform: rotate(5deg); }
|
|
75% { transform: rotate(-5deg); }
|
|
}
|
|
|
|
/* Snow animation */
|
|
.snowflake {
|
|
position: fixed;
|
|
top: -10px;
|
|
color: white;
|
|
font-size: 1em;
|
|
font-weight: bold;
|
|
text-shadow: 0 0 5px rgba(255,255,255,0.8);
|
|
z-index: 1;
|
|
user-select: none;
|
|
pointer-events: none;
|
|
animation: snowfall linear infinite;
|
|
opacity: 0.8;
|
|
}
|
|
|
|
@keyframes snowfall {
|
|
to {
|
|
transform: translateY(100vh) translateX(100px);
|
|
opacity: 0;
|
|
}
|
|
}
|
|
|
|
body.christmas-active .snowflake {
|
|
animation: snowfall linear infinite;
|
|
}
|
|
|
|
/* Festive header when active */
|
|
body.christmas-active header {
|
|
background: linear-gradient(90deg, #27ae60 0%, #e74c3c 50%, #27ae60 100%);
|
|
background-size: 200% 100%;
|
|
animation: festive-pulse 3s ease-in-out infinite;
|
|
}
|
|
|
|
@keyframes festive-pulse {
|
|
0%, 100% { background-position: 0% 0%; }
|
|
50% { background-position: 100% 0%; }
|
|
}
|
|
|
|
/* Jingle bells in header when active */
|
|
body.christmas-active h1::before {
|
|
content: '🔔 ';
|
|
animation: jingle 0.4s ease-in-out infinite;
|
|
display: inline-block;
|
|
font-size: 30px;
|
|
margin-right: 15px;
|
|
}
|
|
|
|
body.christmas-active h1::after {
|
|
content: ' 🔔';
|
|
animation: jingle 0.4s ease-in-out infinite;
|
|
display: inline-block;
|
|
font-size: 30px;
|
|
margin-left: 15px;
|
|
}
|
|
|
|
/* Corner decorations */
|
|
.corner-decoration {
|
|
position: fixed;
|
|
font-size: 80px;
|
|
z-index: 5;
|
|
pointer-events: none;
|
|
opacity: 0.9;
|
|
width: 100px;
|
|
height: 100px;
|
|
}
|
|
|
|
.corner-decoration img {
|
|
width: 100%;
|
|
height: 100%;
|
|
object-fit: contain;
|
|
}
|
|
|
|
/* Bottom decorations */
|
|
.bottom-decoration {
|
|
position: fixed;
|
|
bottom: 20px;
|
|
width: 80px;
|
|
height: 80px;
|
|
z-index: 5;
|
|
pointer-events: none;
|
|
opacity: 0.85;
|
|
}
|
|
|
|
.bottom-decoration img {
|
|
width: 100%;
|
|
height: 100%;
|
|
object-fit: contain;
|
|
}
|
|
|
|
.corner-decoration.bottom-left {
|
|
bottom: 10px;
|
|
left: 10px;
|
|
animation: sway 3s ease-in-out infinite;
|
|
}
|
|
|
|
.corner-decoration.bottom-right {
|
|
bottom: 10px;
|
|
right: 10px;
|
|
animation: sway 3s ease-in-out infinite reverse;
|
|
}
|
|
|
|
@keyframes sway {
|
|
0%, 100% { transform: rotate(0deg); }
|
|
50% { transform: rotate(-5deg); }
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<img src="assets/logo.png" alt="EGFH Logo" class="left-image">
|
|
<h1>Flight Information</h1>
|
|
<img src="assets/flightImg.png" alt="EGFH Logo" class="right-image">
|
|
</header>
|
|
|
|
<main>
|
|
<!-- Left column with arrivals table -->
|
|
<div>
|
|
<h2><center>Arrivals</center></h2>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th style="width: 25%;">Aircraft</th>
|
|
<th style="width: 60%;">From</th>
|
|
<th style="width: 15%;">Due</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="arrivals-tbody">
|
|
<tr>
|
|
<td colspan="3" class="loading">Loading arrivals...</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<!-- Right column with departures table -->
|
|
<div>
|
|
<h2><center>Departures</center></h2>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th style="width: 25%;">Aircraft</th>
|
|
<th style="width: 60%;">To</th>
|
|
<th style="width: 15%;">Due</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="departures-tbody">
|
|
<tr>
|
|
<td colspan="3" class="loading">Loading departures...</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</main>
|
|
|
|
<footer>
|
|
<!-- Footer content -->
|
|
<div class="iso-marquee-linkwrap">
|
|
<div class="iso-marquee--long iso-marquee">
|
|
<!-- Add marquee content here -->
|
|
</div>
|
|
</div>
|
|
</footer>
|
|
|
|
<script>
|
|
// Christmas mode toggle functionality
|
|
function initChristmasMode() {
|
|
// Check URL parameter first for override
|
|
const urlParams = new URLSearchParams(window.location.search);
|
|
const christmasParam = urlParams.get('christmas');
|
|
|
|
let shouldEnable = false;
|
|
|
|
if (christmasParam === 'on') {
|
|
shouldEnable = true;
|
|
} else if (christmasParam === 'off') {
|
|
shouldEnable = false;
|
|
} else {
|
|
// Auto-enable for December
|
|
const now = new Date();
|
|
shouldEnable = now.getMonth() === 11; // December is month 11 (0-indexed)
|
|
}
|
|
|
|
if (shouldEnable) {
|
|
enableChristmasMode();
|
|
}
|
|
}
|
|
|
|
function enableChristmasMode() {
|
|
document.body.classList.add('christmas-active');
|
|
|
|
// Create falling snowflakes
|
|
function createSnowflake() {
|
|
const snowflake = document.createElement('div');
|
|
snowflake.classList.add('snowflake');
|
|
snowflake.textContent = '❄';
|
|
snowflake.style.left = Math.random() * window.innerWidth + 'px';
|
|
snowflake.style.animationDuration = (Math.random() * 5 + 8) + 's';
|
|
snowflake.style.animationDelay = Math.random() * 2 + 's';
|
|
|
|
document.body.appendChild(snowflake);
|
|
|
|
setTimeout(() => snowflake.remove(), 13000);
|
|
}
|
|
|
|
// Create snowflakes periodically
|
|
const snowInterval = setInterval(() => {
|
|
if (!document.body.classList.contains('christmas-active')) {
|
|
clearInterval(snowInterval);
|
|
return;
|
|
}
|
|
createSnowflake();
|
|
}, 300);
|
|
|
|
// Add corner decorations
|
|
const leftCorner = document.createElement('div');
|
|
leftCorner.classList.add('corner-decoration', 'bottom-left');
|
|
const treeImg = document.createElement('img');
|
|
treeImg.src = 'assets/tree.svg';
|
|
treeImg.alt = 'Christmas Tree';
|
|
leftCorner.appendChild(treeImg);
|
|
leftCorner.id = 'corner-left';
|
|
document.body.appendChild(leftCorner);
|
|
|
|
const rightCorner = document.createElement('div');
|
|
rightCorner.classList.add('corner-decoration', 'bottom-right');
|
|
const santaImg = document.createElement('img');
|
|
santaImg.src = 'assets/santa.svg';
|
|
santaImg.alt = 'Santa';
|
|
rightCorner.appendChild(santaImg);
|
|
rightCorner.id = 'corner-right';
|
|
document.body.appendChild(rightCorner);
|
|
|
|
// Add bottom decorations in a row
|
|
const bottomDecorations = [
|
|
{ src: 'assets/reindeer.svg', alt: 'Reindeer' },
|
|
{ src: 'assets/bell.svg', alt: 'Bell' },
|
|
{ src: 'assets/gift.svg', alt: 'Gift' },
|
|
{ src: 'assets/candycane.svg', alt: 'Candy Cane' },
|
|
{ src: 'assets/bell.svg', alt: 'Bell' },
|
|
{ src: 'assets/gift.svg', alt: 'Gift' }
|
|
];
|
|
|
|
const screenWidth = window.innerWidth;
|
|
const totalDecorations = bottomDecorations.length;
|
|
const spacing = screenWidth / (totalDecorations + 1);
|
|
|
|
bottomDecorations.forEach((deco, index) => {
|
|
const div = document.createElement('div');
|
|
div.classList.add('bottom-decoration');
|
|
div.style.left = (spacing * (index + 1) - 40) + 'px'; // 40 is half the width
|
|
div.style.animation = `sway ${3 + index * 0.5}s ease-in-out infinite`;
|
|
|
|
const img = document.createElement('img');
|
|
img.src = deco.src;
|
|
img.alt = deco.alt;
|
|
div.appendChild(img);
|
|
div.id = `bottom-deco-${index}`;
|
|
|
|
document.body.appendChild(div);
|
|
});
|
|
}
|
|
|
|
function disableChristmasMode() {
|
|
document.body.classList.remove('christmas-active');
|
|
|
|
// Remove corner decorations
|
|
document.getElementById('corner-left')?.remove();
|
|
document.getElementById('corner-right')?.remove();
|
|
|
|
// Remove bottom decorations
|
|
document.querySelectorAll('[id^="bottom-deco-"]').forEach(deco => deco.remove());
|
|
|
|
// Remove snowflakes
|
|
document.querySelectorAll('.snowflake').forEach(flake => flake.remove());
|
|
}
|
|
|
|
let wsConnection = null;
|
|
|
|
// ICAO code to airport name cache
|
|
const airportNameCache = {};
|
|
|
|
async function getAirportName(code) {
|
|
if (!code || code.length !== 4 || !/^[A-Z]{4}$/.test(code)) return code;
|
|
if (airportNameCache[code]) return airportNameCache[code];
|
|
try {
|
|
const resp = await fetch(`/api/v1/airport/public/lookup/${code}`);
|
|
if (resp.ok) {
|
|
const data = await resp.json();
|
|
if (data && data.length && data[0].name) {
|
|
airportNameCache[code] = data[0].name;
|
|
return data[0].name;
|
|
}
|
|
}
|
|
} catch (error) {
|
|
console.error('Error looking up airport:', error);
|
|
}
|
|
return code;
|
|
}
|
|
|
|
// WebSocket connection for real-time updates
|
|
function connectWebSocket() {
|
|
if (wsConnection && wsConnection.readyState === WebSocket.OPEN) {
|
|
return; // Already connected
|
|
}
|
|
|
|
const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
|
|
const wsUrl = `${protocol}//${window.location.host}/ws/tower-updates`;
|
|
|
|
wsConnection = new WebSocket(wsUrl);
|
|
|
|
wsConnection.onopen = function(event) {
|
|
console.log('WebSocket connected for real-time updates');
|
|
};
|
|
|
|
wsConnection.onmessage = function(event) {
|
|
try {
|
|
const data = JSON.parse(event.data);
|
|
console.log('WebSocket message received:', data);
|
|
|
|
// Refresh display when any PPR-related event occurs
|
|
if (data.type && (data.type.includes('ppr_') || data.type === 'status_update')) {
|
|
console.log('PPR update detected, refreshing display...');
|
|
loadArrivals();
|
|
loadDepartures();
|
|
}
|
|
} catch (error) {
|
|
console.error('Error parsing WebSocket message:', error);
|
|
}
|
|
};
|
|
|
|
wsConnection.onclose = function(event) {
|
|
console.log('WebSocket disconnected');
|
|
// Attempt to reconnect after 5 seconds
|
|
setTimeout(() => {
|
|
console.log('Attempting to reconnect WebSocket...');
|
|
connectWebSocket();
|
|
}, 5000);
|
|
};
|
|
|
|
wsConnection.onerror = function(error) {
|
|
console.error('WebSocket error:', error);
|
|
};
|
|
}
|
|
|
|
// Convert UTC datetime to local time display
|
|
function convertToLocalTime(utcDateTimeString) {
|
|
if (!utcDateTimeString) return '';
|
|
|
|
try {
|
|
// Parse the ISO datetime string
|
|
const date = new Date(utcDateTimeString);
|
|
|
|
// Check if valid date
|
|
if (isNaN(date.getTime())) {
|
|
console.error('Invalid date:', utcDateTimeString);
|
|
return utcDateTimeString;
|
|
}
|
|
|
|
// Format as HH:MM in local time
|
|
const localHours = date.getHours().toString().padStart(2, '0');
|
|
const localMinutes = date.getMinutes().toString().padStart(2, '0');
|
|
|
|
return `${localHours}:${localMinutes}`;
|
|
} catch (error) {
|
|
console.error('Error converting time:', error, utcDateTimeString);
|
|
return utcDateTimeString;
|
|
}
|
|
}
|
|
|
|
// Fetch and display arrivals
|
|
async function loadArrivals() {
|
|
const tbody = document.getElementById('arrivals-tbody');
|
|
|
|
try {
|
|
const response = await fetch('/api/v1/public/arrivals');
|
|
|
|
if (!response.ok) {
|
|
throw new Error('Failed to fetch arrivals');
|
|
}
|
|
|
|
const arrivals = await response.json();
|
|
|
|
if (arrivals.length === 0) {
|
|
tbody.innerHTML = '<tr><td colspan="3">No arrivals found.</td></tr>';
|
|
return;
|
|
}
|
|
|
|
// Build rows asynchronously to lookup airport names
|
|
const rows = await Promise.all(arrivals.map(async (arrival) => {
|
|
// Show callsign if available, otherwise registration
|
|
const aircraftId = arrival.ac_call || arrival.ac_reg || '';
|
|
const aircraftDisplay = `${escapeHtml(aircraftId)} <span style="font-size: 0.8em; color: #666;">(${escapeHtml(arrival.ac_type || '')})</span>`;
|
|
const fromDisplay = await getAirportName(arrival.in_from || '');
|
|
|
|
// Show landed time if available, otherwise ETA
|
|
let timeDisplay;
|
|
if ((arrival.status === 'LANDED' || arrival.status === 'DEPARTED') && arrival.landed_dt) {
|
|
const time = convertToLocalTime(arrival.landed_dt);
|
|
timeDisplay = `<div style="display: flex; align-items: center; gap: 8px;"><span style="color: #27ae60; font-weight: bold;">${time}</span><span style="font-size: 0.7em; background: #27ae60; color: white; padding: 2px 4px; border-radius: 3px; white-space: nowrap;">LANDED</span></div>`;
|
|
} else {
|
|
timeDisplay = convertToLocalTime(arrival.eta);
|
|
}
|
|
|
|
return `
|
|
<tr>
|
|
<td>${aircraftDisplay}</td>
|
|
<td>${escapeHtml(fromDisplay)}</td>
|
|
<td>${timeDisplay}</td>
|
|
</tr>
|
|
`;
|
|
}));
|
|
|
|
tbody.innerHTML = rows.join('');
|
|
|
|
} catch (error) {
|
|
console.error('Error loading arrivals:', error);
|
|
tbody.innerHTML = '<tr><td colspan="3" class="error">Error loading arrivals</td></tr>';
|
|
}
|
|
}
|
|
|
|
// Fetch and display departures
|
|
async function loadDepartures() {
|
|
const tbody = document.getElementById('departures-tbody');
|
|
|
|
try {
|
|
const response = await fetch('/api/v1/public/departures');
|
|
|
|
if (!response.ok) {
|
|
throw new Error('Failed to fetch departures');
|
|
}
|
|
|
|
const departures = await response.json();
|
|
|
|
if (departures.length === 0) {
|
|
tbody.innerHTML = '<tr><td colspan="3">No departures found.</td></tr>';
|
|
return;
|
|
}
|
|
|
|
// Build rows asynchronously to lookup airport names
|
|
const rows = await Promise.all(departures.map(async (departure) => {
|
|
// Show callsign if available, otherwise registration
|
|
const aircraftId = departure.ac_call || departure.ac_reg || '';
|
|
const aircraftDisplay = `${escapeHtml(aircraftId)} <span style="font-size: 0.8em; color: #666;">(${escapeHtml(departure.ac_type || '')})</span>`;
|
|
const toDisplay = await getAirportName(departure.out_to || '');
|
|
|
|
// Show departed time if available, otherwise ETD
|
|
let timeDisplay;
|
|
if (departure.status === 'DEPARTED' && departure.departed_dt) {
|
|
const time = convertToLocalTime(departure.departed_dt);
|
|
timeDisplay = `<div style="display: flex; align-items: center; gap: 8px;"><span style="color: #3498db; font-weight: bold;">${time}</span><span style="font-size: 0.7em; background: #3498db; color: white; padding: 2px 4px; border-radius: 3px; white-space: nowrap;">DEPARTED</span></div>`;
|
|
} else {
|
|
timeDisplay = convertToLocalTime(departure.etd);
|
|
}
|
|
|
|
return `
|
|
<tr>
|
|
<td>${aircraftDisplay}</td>
|
|
<td>${escapeHtml(toDisplay)}</td>
|
|
<td>${timeDisplay}</td>
|
|
</tr>
|
|
`;
|
|
}));
|
|
|
|
tbody.innerHTML = rows.join('');
|
|
|
|
} catch (error) {
|
|
console.error('Error loading departures:', error);
|
|
tbody.innerHTML = '<tr><td colspan="3" class="error">Error loading departures</td></tr>';
|
|
}
|
|
}
|
|
|
|
// Escape HTML to prevent XSS
|
|
function escapeHtml(text) {
|
|
const div = document.createElement('div');
|
|
div.textContent = text;
|
|
return div.innerHTML;
|
|
}
|
|
|
|
// Load data on page load
|
|
window.addEventListener('load', function() {
|
|
// Initialize Christmas mode
|
|
initChristmasMode();
|
|
|
|
loadArrivals();
|
|
loadDepartures();
|
|
|
|
// Connect to WebSocket for real-time updates
|
|
connectWebSocket();
|
|
|
|
// Refresh data every 60 seconds as fallback
|
|
setInterval(() => {
|
|
loadArrivals();
|
|
loadDepartures();
|
|
}, 60000);
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|