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/
}
// Show popup if the cookie doesn't exist
window.onload = function() {
const atariAutoRedirect = getCookie('atariAutoRedirect');
if (atariAutoRedirect) {
window.location.href = "https://ale.farama.org/environments/air_raid";
} 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/air_raid";
})
</script>
</html>