The app is now officially a PWA

This commit is contained in:
maxluli
2022-10-11 11:10:31 +02:00
parent cb8162214f
commit d23eb50fb3
6 changed files with 46 additions and 14 deletions

View File

@@ -0,0 +1,14 @@
{
"name": "Tinder for pokemons 2022",
"short_name": "Pokinder",
"start_url": "/es2-2022-2023/rhmr/PokemonTinder/index.html",
"id": "/es2-2022-2023/rhmr/PokemonTinder/index.html",
"display": "fullscreen",
"icons": [
{
"src": "/es2-2022-2023/rhmr/PokemonTinder/assets/img/Icon2.png",
"sizes": "144x144",
"type": "image/png"
}
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 297 B

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -0,0 +1,3 @@
[ZoneTransfer]
ZoneId=3
HostUrl=https://www.piskelapp.com/

BIN
assets/img/Icon2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -19,7 +19,24 @@
<title>Tinder Pokemon</title>
<link rel="icon" type="image/x-icon" href="assets/img/Icon.ico">
<link rel="manifest" href="assets/JsStuff/manifest.webmanifest">
</head>
<script>
if ('serviceWorker' in navigator) {
// Register a service worker hosted at the root of the
// site using the default scope.
navigator.serviceWorker.register('/es2-2022-2023/rhmr/PokemonTinder/sw.js').then(
(registration) => {
console.log('Service worker registration succeeded:', registration)
},
/*catch*/(error) => {
console.log('Service worker registration failed:', error)
}
)
} else {
console.log('Service workers are not supported.')
}
</script>
<body id="main">
<div class="d-grid gap-2 text-center">
@@ -30,15 +47,6 @@
<h2>Home</h2>
</div>
</div>
<!---
<div class="container">
<div class="card p-2 text-center">
<div class="card-body">
This definitely is an AD
</div>
</div>
</div>
-->
<div class="container">
<div class="card p-2">
<img id="pokemonImage" style="image-rendering: pixelated;"

7
sw.js Normal file
View File

@@ -0,0 +1,7 @@
// This code executes in its own worker or thread
self.addEventListener("install", event => {
console.log("Service worker installed");
});
self.addEventListener("activate", event => {
console.log("Service worker activated");
});