mirror of
https://github.com/Terncode/pixel.horse.git
synced 2026-09-24 13:55:04 +02:00
Archive commit
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||
<title>Pony Town (reset)</title>
|
||||
<style>
|
||||
body {
|
||||
background: #333;
|
||||
}
|
||||
|
||||
div {
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #d88856;
|
||||
font: normal 16px sans-serif;
|
||||
text-align: center;
|
||||
padding: 30px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div>
|
||||
<a href="/">go back to the game</a>
|
||||
</div>
|
||||
<script>
|
||||
function unregisterServiceWorker() {
|
||||
if ('serviceWorker' in navigator && typeof navigator.serviceWorker.getRegistrations === 'function') {
|
||||
return navigator.serviceWorker.getRegistrations()
|
||||
.then(rs => rs.forEach(r => r.unregister()))
|
||||
.catch(e => console.error(e));
|
||||
}
|
||||
}
|
||||
|
||||
function reloadResources() {
|
||||
if (typeof fetch === 'function') {
|
||||
return fetch('/', { cache: 'reload' })
|
||||
.then(x => x.text())
|
||||
.then(x => /script src="([^"]+)"/.exec(x)[1])
|
||||
.then(x => fetch(x, { cache: 'reload' }))
|
||||
.then(x => x.text())
|
||||
.catch(e => console.error(e));
|
||||
}
|
||||
}
|
||||
|
||||
localStorage.clear();
|
||||
|
||||
Promise.resolve()
|
||||
.then(unregisterServiceWorker)
|
||||
.then(reloadResources)
|
||||
.then(() => location.href = '/');
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user