Time Pilot's documentation has moved to ale.farama.org
Enable auto-redirect next time
Redirect to the new website
Close
<script>
// Function to get a cookie by name
function getCookie(name) {
console.log(`${document.cookie}`);
const value = `; ${document.cookie}`;
const parts = value.split(`; ${name}=`);
if (parts.length === 2) {
return parts.pop().split(';').shift();
}
}
// Function to set a cookie
function setCookie(name, value, days) {
const date = new Date();
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
const expires = `expires=${date.toUTCString()}`;
document.cookie = `${name}=${value}; ${expires}; path=/`; // environments/atari/
}
// Function to apply theme to the popup
function applyTheme() {
const theme = localStorage.getItem("theme") || "auto";
const body = document.body;
// Remove any existing theme classes
body.classList.remove("dark-theme", "light-theme");
if (theme === "dark") {
body.classList.add("dark-theme");
} else if (theme === "light") {
body.classList.add("light-theme");
} else if (theme === "auto") {
// Check system preference for dark mode
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
body.classList.add("dark-theme");
} else {
body.classList.add("light-theme");
}
// Listen for system theme changes
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', e => {
body.classList.remove("dark-theme", "light-theme");
body.classList.add(e.matches ? "dark-theme" : "light-theme");
});
}
}
// Show popup if the cookie doesn't exist
window.onload = function() {
// Apply theme first
applyTheme();
const atariAutoRedirect = getCookie('atariAutoRedirect');
if (atariAutoRedirect) {
window.location.href = "https://ale.farama.org/environments/time_pilot";
} else {
document.getElementById('popup').style.display = 'flex';
}
};
// Close popup and handle the "Don't show again" option
document.getElementById('closePopupBtn').addEventListener('click', function() {
document.getElementById('popup').style.display = 'none';
});
document.getElementById('atariRedirectBtn').addEventListener("click", function() {
if (document.getElementById('atariAutoRedirect').checked) {
setCookie('atariAutoRedirect', 'true', 90); // Set cookie to not show for 90 days
}
console.log("redirecting");
window.location.href = "https://ale.farama.org/environments/time_pilot";
})
</script>
</html>