feat/FRO-36: PWA (#25)

Added a PWA for knockoutwhist including a special offline screen.

Co-authored-by: LQ63 <lkhermann@web.de>
Reviewed-on: #25
Reviewed-by: Janis <janis-e@gmx.de>
Co-authored-by: lq64 <lq@blackhole.local>
Co-committed-by: lq64 <lq@blackhole.local>
This commit is contained in:
2025-12-18 09:46:23 +01:00
committed by Janis
parent 9feb4a93b8
commit 2fbfca32a0
8 changed files with 4602 additions and 129 deletions

View File

@@ -1,5 +1,22 @@
<script setup lang="ts">
import { RouterView } from 'vue-router'
import { onMounted, onUnmounted } from 'vue';
import { useRoute } from 'vue-router';
const route = useRoute();
const handleOnlineStatusChange = () => {
if (navigator.onLine) {
if (route.name === 'offline') {
window.location.reload();
}
}
};
onMounted(() => {
window.addEventListener('online', handleOnlineStatusChange);
});
onUnmounted(() => {
window.removeEventListener('online', handleOnlineStatusChange);
});
</script>
<template>