Skip to content

Commit 259aa6a

Browse files
Add popup for Atari documentation to alert users to new website (#1194)
1 parent b4bee69 commit 259aa6a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+8506
-211
lines changed

docs/environments/atari.md

Lines changed: 82 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,89 @@ lastpage:
88

99
<html>
1010
<head>
11-
<meta http-equiv="refresh" content="0; url=https://ale.farama.org/environments/">
12-
<title>Redirecting to Atari Documentation's new home</title>
11+
<title>Redirecting to Atari's documentation</title>
12+
<style>
13+
/* Basic styles for the popup */
14+
.popup {
15+
display: none;
16+
position: fixed;
17+
top: 0;
18+
left: 0;
19+
width: 100%;
20+
height: 100%;
21+
background-color: rgba(0, 0, 0, 0.5);
22+
z-index: 999;
23+
justify-content: center;
24+
align-items: center;
25+
}
26+
.popup-content {
27+
background-color: #fff;
28+
padding: 20px;
29+
border-radius: 10px;
30+
text-align: center;
31+
width: 300px;
32+
}
33+
button {
34+
margin-top: 10px;
35+
padding: 5px 10px;
36+
cursor: pointer;
37+
}
38+
</style>
1339
</head>
1440
<body>
15-
<p>If you are not redirected automatically, follow this <a href="https://ale.farama.org/environments/">link to the new page</a>.</p>
41+
<p>If you are not redirected automatically, follow this <a href="https://ale.farama.org/environments/">link to Atari's new page</a>.</p>
42+
<div id="popup" class="popup">
43+
<div class="popup-content">
44+
<p>Atari's documentation has moved to <b>ale.farama.org</b></p>
45+
<label>
46+
<input type="checkbox" id="atariAutoRedirect">Enable auto-redirect next time
47+
</label>
48+
<br>
49+
<button id="atariRedirectBtn">Redirect to the new website</button>
50+
<button id="closePopupBtn">Close</button>
51+
</div>
52+
</div>
1653
</body>
54+
55+
<script>
56+
// Function to get a cookie by name
57+
function getCookie(name) {
58+
console.log(`${document.cookie}`);
59+
const value = `; ${document.cookie}`;
60+
const parts = value.split(`; ${name}=`);
61+
if (parts.length === 2) {
62+
return parts.pop().split(';').shift();
63+
}
64+
}
65+
66+
// Function to set a cookie
67+
function setCookie(name, value, days) {
68+
const date = new Date();
69+
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
70+
const expires = `expires=${date.toUTCString()}`;
71+
document.cookie = `${name}=${value}; ${expires}; path=/`; // environments/atari/
72+
}
73+
74+
// Show popup if the cookie doesn't exist
75+
window.onload = function() {
76+
const atariAutoRedirect = getCookie('atariAutoRedirect');
77+
if (atariAutoRedirect) {
78+
window.location.href = "https://ale.farama.org/environments/";
79+
} else {
80+
document.getElementById('popup').style.display = 'flex';
81+
}
82+
};
83+
84+
// Close popup and handle the "Don't show again" option
85+
document.getElementById('closePopupBtn').addEventListener('click', function() {
86+
document.getElementById('popup').style.display = 'none';
87+
});
88+
document.getElementById('atariRedirectBtn').addEventListener("click", function() {
89+
if (document.getElementById('atariAutoRedirect').checked) {
90+
setCookie('atariAutoRedirect', 'true', 90); // Set cookie to not show for 90 days
91+
}
92+
console.log("redirecting");
93+
window.location.href = "https://ale.farama.org/environments/";
94+
})
95+
</script>
1796
</html>

docs/environments/atari/adventure.md

Lines changed: 81 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,89 @@ title: Adventure
66

77
<html>
88
<head>
9-
<meta http-equiv="refresh" content="0; url=https://ale.farama.org/environments/adventure">
10-
<title>Redirecting to Atari Documentation's new home</title>
9+
<title>Redirecting to Adventure's documentation</title>
10+
<style>
11+
/* Basic styles for the popup */
12+
.popup {
13+
display: none;
14+
position: fixed;
15+
top: 0;
16+
left: 0;
17+
width: 100%;
18+
height: 100%;
19+
background-color: rgba(0, 0, 0, 0.5);
20+
z-index: 999;
21+
justify-content: center;
22+
align-items: center;
23+
}
24+
.popup-content {
25+
background-color: #fff;
26+
padding: 20px;
27+
border-radius: 10px;
28+
text-align: center;
29+
width: 300px;
30+
}
31+
button {
32+
margin-top: 10px;
33+
padding: 5px 10px;
34+
cursor: pointer;
35+
}
36+
</style>
1137
</head>
1238
<body>
1339
<p>If you are not redirected automatically, follow this <a href="https://ale.farama.org/environments/adventure">link to Adventure's new page</a>.</p>
40+
<div id="popup" class="popup">
41+
<div class="popup-content">
42+
<p>Atari's documentation has moved to <b>ale.farama.org</b></p>
43+
<label>
44+
<input type="checkbox" id="atariAutoRedirect">Enable auto-redirect next time
45+
</label>
46+
<br>
47+
<button id="atariRedirectBtn">Redirect to the new website</button>
48+
<button id="closePopupBtn">Close</button>
49+
</div>
50+
</div>
1451
</body>
52+
53+
<script>
54+
// Function to get a cookie by name
55+
function getCookie(name) {
56+
console.log(`${document.cookie}`);
57+
const value = `; ${document.cookie}`;
58+
const parts = value.split(`; ${name}=`);
59+
if (parts.length === 2) {
60+
return parts.pop().split(';').shift();
61+
}
62+
}
63+
64+
// Function to set a cookie
65+
function setCookie(name, value, days) {
66+
const date = new Date();
67+
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
68+
const expires = `expires=${date.toUTCString()}`;
69+
document.cookie = `${name}=${value}; ${expires}; path=/`; // environments/atari/
70+
}
71+
72+
// Show popup if the cookie doesn't exist
73+
window.onload = function() {
74+
const atariAutoRedirect = getCookie('atariAutoRedirect');
75+
if (atariAutoRedirect) {
76+
window.location.href = "https://ale.farama.org/environments/adventure";
77+
} else {
78+
document.getElementById('popup').style.display = 'flex';
79+
}
80+
};
81+
82+
// Close popup and handle the "Don't show again" option
83+
document.getElementById('closePopupBtn').addEventListener('click', function() {
84+
document.getElementById('popup').style.display = 'none';
85+
});
86+
document.getElementById('atariRedirectBtn').addEventListener("click", function() {
87+
if (document.getElementById('atariAutoRedirect').checked) {
88+
setCookie('atariAutoRedirect', 'true', 90); // Set cookie to not show for 90 days
89+
}
90+
console.log("redirecting");
91+
window.location.href = "https://ale.farama.org/environments/adventure";
92+
})
93+
</script>
1594
</html>

docs/environments/atari/air_raid.md

Lines changed: 81 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,89 @@ title: Air Raid
66

77
<html>
88
<head>
9-
<meta http-equiv="refresh" content="0; url=https://ale.farama.org/environments/air_raid">
10-
<title>Redirecting to Atari Documentation's new home</title>
9+
<title>Redirecting to Air Raid's documentation</title>
10+
<style>
11+
/* Basic styles for the popup */
12+
.popup {
13+
display: none;
14+
position: fixed;
15+
top: 0;
16+
left: 0;
17+
width: 100%;
18+
height: 100%;
19+
background-color: rgba(0, 0, 0, 0.5);
20+
z-index: 999;
21+
justify-content: center;
22+
align-items: center;
23+
}
24+
.popup-content {
25+
background-color: #fff;
26+
padding: 20px;
27+
border-radius: 10px;
28+
text-align: center;
29+
width: 300px;
30+
}
31+
button {
32+
margin-top: 10px;
33+
padding: 5px 10px;
34+
cursor: pointer;
35+
}
36+
</style>
1137
</head>
1238
<body>
1339
<p>If you are not redirected automatically, follow this <a href="https://ale.farama.org/environments/air_raid">link to Air Raid's new page</a>.</p>
40+
<div id="popup" class="popup">
41+
<div class="popup-content">
42+
<p>Atari's documentation has moved to <b>ale.farama.org</b></p>
43+
<label>
44+
<input type="checkbox" id="atariAutoRedirect">Enable auto-redirect next time
45+
</label>
46+
<br>
47+
<button id="atariRedirectBtn">Redirect to the new website</button>
48+
<button id="closePopupBtn">Close</button>
49+
</div>
50+
</div>
1451
</body>
52+
53+
<script>
54+
// Function to get a cookie by name
55+
function getCookie(name) {
56+
console.log(`${document.cookie}`);
57+
const value = `; ${document.cookie}`;
58+
const parts = value.split(`; ${name}=`);
59+
if (parts.length === 2) {
60+
return parts.pop().split(';').shift();
61+
}
62+
}
63+
64+
// Function to set a cookie
65+
function setCookie(name, value, days) {
66+
const date = new Date();
67+
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
68+
const expires = `expires=${date.toUTCString()}`;
69+
document.cookie = `${name}=${value}; ${expires}; path=/`; // environments/atari/
70+
}
71+
72+
// Show popup if the cookie doesn't exist
73+
window.onload = function() {
74+
const atariAutoRedirect = getCookie('atariAutoRedirect');
75+
if (atariAutoRedirect) {
76+
window.location.href = "https://ale.farama.org/environments/air_raid";
77+
} else {
78+
document.getElementById('popup').style.display = 'flex';
79+
}
80+
};
81+
82+
// Close popup and handle the "Don't show again" option
83+
document.getElementById('closePopupBtn').addEventListener('click', function() {
84+
document.getElementById('popup').style.display = 'none';
85+
});
86+
document.getElementById('atariRedirectBtn').addEventListener("click", function() {
87+
if (document.getElementById('atariAutoRedirect').checked) {
88+
setCookie('atariAutoRedirect', 'true', 90); // Set cookie to not show for 90 days
89+
}
90+
console.log("redirecting");
91+
window.location.href = "https://ale.farama.org/environments/air_raid";
92+
})
93+
</script>
1594
</html>

docs/environments/atari/alien.md

Lines changed: 81 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,89 @@ title: Alien
66

77
<html>
88
<head>
9-
<meta http-equiv="refresh" content="0; url=https://ale.farama.org/environments/alien">
10-
<title>Redirecting to Atari Documentation's new home</title>
9+
<title>Redirecting to Alien's documentation</title>
10+
<style>
11+
/* Basic styles for the popup */
12+
.popup {
13+
display: none;
14+
position: fixed;
15+
top: 0;
16+
left: 0;
17+
width: 100%;
18+
height: 100%;
19+
background-color: rgba(0, 0, 0, 0.5);
20+
z-index: 999;
21+
justify-content: center;
22+
align-items: center;
23+
}
24+
.popup-content {
25+
background-color: #fff;
26+
padding: 20px;
27+
border-radius: 10px;
28+
text-align: center;
29+
width: 300px;
30+
}
31+
button {
32+
margin-top: 10px;
33+
padding: 5px 10px;
34+
cursor: pointer;
35+
}
36+
</style>
1137
</head>
1238
<body>
1339
<p>If you are not redirected automatically, follow this <a href="https://ale.farama.org/environments/alien">link to Alien's new page</a>.</p>
40+
<div id="popup" class="popup">
41+
<div class="popup-content">
42+
<p>Atari's documentation has moved to <b>ale.farama.org</b></p>
43+
<label>
44+
<input type="checkbox" id="atariAutoRedirect">Enable auto-redirect next time
45+
</label>
46+
<br>
47+
<button id="atariRedirectBtn">Redirect to the new website</button>
48+
<button id="closePopupBtn">Close</button>
49+
</div>
50+
</div>
1451
</body>
52+
53+
<script>
54+
// Function to get a cookie by name
55+
function getCookie(name) {
56+
console.log(`${document.cookie}`);
57+
const value = `; ${document.cookie}`;
58+
const parts = value.split(`; ${name}=`);
59+
if (parts.length === 2) {
60+
return parts.pop().split(';').shift();
61+
}
62+
}
63+
64+
// Function to set a cookie
65+
function setCookie(name, value, days) {
66+
const date = new Date();
67+
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
68+
const expires = `expires=${date.toUTCString()}`;
69+
document.cookie = `${name}=${value}; ${expires}; path=/`; // environments/atari/
70+
}
71+
72+
// Show popup if the cookie doesn't exist
73+
window.onload = function() {
74+
const atariAutoRedirect = getCookie('atariAutoRedirect');
75+
if (atariAutoRedirect) {
76+
window.location.href = "https://ale.farama.org/environments/alien";
77+
} else {
78+
document.getElementById('popup').style.display = 'flex';
79+
}
80+
};
81+
82+
// Close popup and handle the "Don't show again" option
83+
document.getElementById('closePopupBtn').addEventListener('click', function() {
84+
document.getElementById('popup').style.display = 'none';
85+
});
86+
document.getElementById('atariRedirectBtn').addEventListener("click", function() {
87+
if (document.getElementById('atariAutoRedirect').checked) {
88+
setCookie('atariAutoRedirect', 'true', 90); // Set cookie to not show for 90 days
89+
}
90+
console.log("redirecting");
91+
window.location.href = "https://ale.farama.org/environments/alien";
92+
})
93+
</script>
1594
</html>

0 commit comments

Comments
 (0)