// Function to update the Time on the Left
setInterval(() => {
const clock = document.getElementById('live-clock');
clock.innerText = new Date().toLocaleTimeString();
}, 1000);
// Function to fetch weather by IP (No Cookies)
async function getWeatherByIP() {
try {
const geo = await fetch('https://ipapi.co/json/').then(res => res.json());
// Using Open-Meteo for clean weather data
const weather = await fetch(`https://api.open-meteo.com/v1/forecast?latitude=${geo.latitude}&longitude=${geo.longitude}¤t_weather=true`).then(res => res.json());
document.getElementById('weather-scroll').innerText =
`LOCAL WEATHER FOR ${geo.city}: ${weather.current_weather.temperature}°C | FLIP STATUS: CLEAR | WINDS: ${weather.current_weather.windspeed}km/h | PUBLIC RACING DATA STREAM ACTIVE`;
} catch (err) {
document.getElementById('weather-scroll').innerText = "DATA FEED ERROR: RE-ROUTING THROUGH NORTH AURORA BACKUP...";
}
}
// THE "ALIVE" TRIGGER: Use this to pop up the red banner
function setLiveStatus(isLive) {
const alertBar = document.getElementById('press-alert');
if (isLive) {
alertBar.classList.add('active');
} else {
alertBar.classList.remove('active');
}
}
// Run Infrastructure
getWeatherByIP();
// Trigger a test "Live" state after 6 seconds
setTimeout(() => setLiveStatus(true), 6000);