Files
website-cv/404.html
T
2026-08-09 23:42:23 +02:00

69 lines
2.8 KiB
HTML

<!DOCTYPE html>
<html>
<head><title>404 Not Found</title></head>
<body>
<center><h1>404 Not Found</h1></center>
<hr><center id="msg">The page has been deleted.</center>
<center id="undo" style="display:none"><br><a href="/">Restore website</a></center>
<center id="count" style="display:none"><br><font size="7">10</font></center>
<center id="quest" style="display:none"><br><button>Embark on a quest</button></center>
<script>
/* Restore hatch: clicking the heading undeletes the website. Undeleting
also revokes the quest (no quest for the deleted website if the website
isn't deleted) — but the save file survives for the next deletion */
function restore() {
try {
localStorage.removeItem('siteDeleted');
localStorage.removeItem('siteDeletedViews');
localStorage.removeItem('questStarted');
} catch (e) {}
}
document.querySelector('h1').addEventListener('click', function () {
restore();
location.replace('/');
});
/* Embarking unlocks quest.html; the page bounces visitors who never did */
document.querySelector('#quest button').addEventListener('click', function () {
try { localStorage.setItem('questStarted', '1'); } catch (e) {}
location.href = '/quest.html';
});
/* Restoring is symmetric with deleting: it needs a confirmation too */
document.querySelector('#undo a').addEventListener('click', function (e) {
if (!confirm('Are you sure? This will restore the entire website.')) {
e.preventDefault();
return;
}
restore();
});
/* View 1 is the deletion, view 2 is the disbelieving reload (nothing
changes; that's the point), view 3 gets the way out. Views 4-9 escalate
for anyone who keeps reloading past the exit; view 10 drops the act and
starts a countdown from 10 (one step per reload); at zero (view 20) the
countdown gives way to the quest */
var MSGS = {
4: 'The page has still been deleted.',
5: 'The page has been deleted for all eternity.',
6: 'The page has been deleted. If only there was a way to restore it.',
7: "The page has been deleted. Click the 'Restore website' button to restore it.",
8: "The page has been deleted. Click the 'Restore website' button to restore it.",
9: "The page has been deleted. Click the 'Restore website' button to restore it."
};
try {
if (localStorage.getItem('siteDeleted')) {
var views = 1 + (parseInt(localStorage.getItem('siteDeletedViews'), 10) || 0);
localStorage.setItem('siteDeletedViews', views);
if (views > 2) document.getElementById('undo').style.display = '';
if (MSGS[views]) document.getElementById('msg').textContent = MSGS[views];
if (views >= 20) {
document.getElementById('quest').style.display = '';
} else if (views >= 10) {
var count = document.getElementById('count');
count.style.display = '';
count.querySelector('font').textContent = 20 - views;
}
}
} catch (e) {}
</script>
</body>
</html>