do not register service worker on development
All checks were successful
ci/woodpecker/push/build Pipeline was successful

This commit is contained in:
Alessio Davoli 2023-07-24 12:37:10 +02:00
parent 0135d749f0
commit b09aca2c20
5 changed files with 8 additions and 13 deletions

View file

@ -22,6 +22,7 @@
box-shadow: 0 0 50px #ccc; box-shadow: 0 0 50px #ccc;
border-radius: 30px; border-radius: 30px;
width: calc((100% - 50px) / 2); width: calc((100% - 50px) / 2);
height: calc(100vh/3 - 10vh );
font-size: 18px; font-size: 18px;
} }

View file

@ -6,6 +6,8 @@
let node; let node;
onMount(() => { onMount(() => {
if(import.meta.env.DEV) return;
if ('serviceWorker' in navigator) { if ('serviceWorker' in navigator) {
addEventListener('load', function () { addEventListener('load', function () {
navigator.serviceWorker.register('/service-worker.js'); navigator.serviceWorker.register('/service-worker.js');

View file

@ -16,13 +16,10 @@
<style> <style>
main { main {
width: 100%; display: grid;
margin: 0 auto;
height: 100%; height: 100%;
margin: 0px;
font-family: 'Roboto-Regular'; font-family: 'Roboto-Regular';
display: flex;
flex-direction: column;
place-items: center;
} }
.bold { .bold {
@ -31,7 +28,6 @@
} }
#welcome-message { #welcome-message {
font-size: 18px; font-size: 18px;
height: 15%;
display: grid; display: grid;
width: 100%; width: 100%;
place-content: center; place-content: center;
@ -40,11 +36,7 @@
} }
#route-cards { #route-cards {
height: 80%; display: grid;
display: flex;
flex-direction: column;
height: 100%;
width: 100%; width: 100%;
align-items: center;
} }
</style> </style>

View file

@ -20,7 +20,7 @@
gap: 15px; gap: 15px;
padding-top: 10px; padding-top: 10px;
margin-top: 70px; margin-top: 70px;
height: calc(100% - 140px - 10vh); height: calc(100% - 70px - 10vh);
overflow-y: scroll; overflow-y: scroll;
} }
</style> </style>

View file

@ -38,7 +38,7 @@
img { img {
width: 100%; width: 100%;
height: 100%; height: calc(100% - 10vh);
position: absolute; position: absolute;
z-index: -1; z-index: -1;
} }