Add basic PWA support
This commit is contained in:
parent
a9040edc84
commit
0ac58c3349
|
@ -41,6 +41,12 @@ body {
|
|||
z-index: 3;
|
||||
}
|
||||
|
||||
@media (orientation: portrait) {
|
||||
#dpad, #apad {
|
||||
bottom: calc(1rem + env(safe-area-inset-bottom));
|
||||
}
|
||||
}
|
||||
|
||||
#dpad {
|
||||
left: 1rem;
|
||||
}
|
||||
|
|
17
index.html
17
index.html
|
@ -10,7 +10,7 @@
|
|||
<meta property="og:description" content="A Pokémon fangame heavily inspired by the roguelite genre. Battle endlessly while gathering stacking items, exploring many different biomes, and reaching Pokémon stats you never thought possible." />
|
||||
<meta property="og:image" content="https://pokerogue.net/logo.png" />
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
|
||||
<style type="text/css">
|
||||
@font-face {
|
||||
font-family: 'emerald';
|
||||
|
@ -23,6 +23,21 @@
|
|||
}
|
||||
</style>
|
||||
<link rel="stylesheet" type="text/css" href="index.css" />
|
||||
<link rel="manifest" href="manifest.json" />
|
||||
<script>
|
||||
if ("serviceWorker" in navigator) {
|
||||
window.addEventListener("load", function () {
|
||||
navigator.serviceWorker.register("/service-worker.js").then(
|
||||
function (registration) {
|
||||
console.log("ServiceWorker registration successful");
|
||||
},
|
||||
function (err) {
|
||||
console.log("ServiceWorker registration failed: ", err);
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"name": "PokéRogue",
|
||||
"short_name": "PokéRogue",
|
||||
"description": "A Pokémon fangame heavily inspired by the roguelite genre. Battle endlessly while gathering stacking items, exploring many different biomes, and reaching Pokémon stats you never thought possible.",
|
||||
"start_url": "/",
|
||||
"display": "standalone",
|
||||
"background_color": "#8c8c8c",
|
||||
"theme_color": "#8c8c8c",
|
||||
"icons": [
|
||||
{
|
||||
"src": "../logo.png",
|
||||
"sizes": "128x128",
|
||||
"type": "image/png"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
self.addEventListener('install', function () {
|
||||
console.log('Service worker installing...');
|
||||
});
|
Loading…
Reference in New Issue