Compare commits

..

3 commits

Author SHA1 Message Date
dd4b3b5373 Update SvelteKitPWA config
All checks were successful
ci/woodpecker/push/build Pipeline was successful
2023-07-19 15:02:38 +02:00
69ec57cb0d Add kolorist 2023-07-19 15:02:25 +02:00
cc8bf87f3e Update MapTab component 2023-07-19 14:43:45 +02:00
11 changed files with 22 additions and 21 deletions

View file

@ -20,6 +20,7 @@
"eslint": "^8.45.0", "eslint": "^8.45.0",
"eslint-config-prettier": "^8.5.0", "eslint-config-prettier": "^8.5.0",
"eslint-plugin-svelte": "^2.30.0", "eslint-plugin-svelte": "^2.30.0",
"kolorist": "^1.8.0",
"prettier": "^3.0.0", "prettier": "^3.0.0",
"prettier-plugin-svelte": "^3.0.0", "prettier-plugin-svelte": "^3.0.0",
"svelte": "^4.0.0", "svelte": "^4.0.0",

BIN
frontend/splash.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

View file

@ -12,7 +12,7 @@
</script> </script>
{#if visible} {#if visible}
<img transition:fade src="/splash.jpeg" alt="splash" /> <img transition:fade src="/splash.webp" alt="splash" />
{/if} {/if}
<style> <style>

View file

@ -10,10 +10,13 @@
let latitude; let latitude;
let longitude; let longitude;
let accuracy; let accuracy;
const errorMessage = "Geolocation not available";
const loadWorker = async () => { let errored = false;
const watchPosition = async () => {
if (!("geolocation" in navigator)) { if (!("geolocation" in navigator)) {
return; errored = true;
throw new Error(errorMessage)
} }
const options = { const options = {
@ -45,7 +48,7 @@
}; };
onMount(async () => { onMount(async () => {
await loadWorker(); await watchPosition();
leaflet = await import('leaflet'); leaflet = await import('leaflet');
layerGroup = leaflet.layerGroup(); layerGroup = leaflet.layerGroup();
@ -75,8 +78,11 @@
} }
}); });
</script> </script>
{#if !errored}
<div id="map" in:fade bind:this={mapElement} /> <div id="map" in:fade bind:this={mapElement} />
{:else}
{errorMessage}
{/if}
<style> <style>
@import 'leaflet/dist/leaflet.css'; @import 'leaflet/dist/leaflet.css';

View file

@ -24,7 +24,7 @@
<Header></Header> <Header></Header>
<img src='/splash.jpeg' alt='splash'> <img src='/splash.webp' alt='splash'>
<div bind:this={divider} id='divider'> <div bind:this={divider} id='divider'>
<div id='banner'> <div id='banner'>
@ -70,4 +70,4 @@
font-size: 14px; font-size: 14px;
text-align: rightìì; text-align: rightìì;
} }
</style> </style>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

View file

@ -7,12 +7,6 @@ const config = {
// for more information about preprocessors // for more information about preprocessors
preprocess: vitePreprocess(), preprocess: vitePreprocess(),
kit: { kit: {
files: {
serviceWorker: 'src/sw.ts',
},
serviceWorker: {
register: false
},
adapter: adapter({ adapter: adapter({
precompress: false, precompress: false,
}), }),

View file

@ -5,12 +5,7 @@ import { SvelteKitPWA } from '@vite-pwa/sveltekit'
const config = { const config = {
plugins: [ plugins: [
sveltekit(), sveltekit(),
SvelteKitPWA({ SvelteKitPWA()
registerType: 'autoUpdate',
strategies: 'injectManifest',
srcDir: 'src',
filename: 'sw.ts',
})
], ],
test: { test: {
include: ["src/**/*.{test,spec}.{js,ts}"], include: ["src/**/*.{test,spec}.{js,ts}"],
@ -26,4 +21,4 @@ const config = {
}, },
}; };
export default config; export default config;

View file

@ -2741,6 +2741,11 @@ known-css-properties@^0.27.0:
resolved "https://registry.yarnpkg.com/known-css-properties/-/known-css-properties-0.27.0.tgz#82a9358dda5fe7f7bd12b5e7142c0a205393c0c5" resolved "https://registry.yarnpkg.com/known-css-properties/-/known-css-properties-0.27.0.tgz#82a9358dda5fe7f7bd12b5e7142c0a205393c0c5"
integrity sha512-uMCj6+hZYDoffuvAJjFAPz56E9uoowFHmTkqRtRq5WyC5Q6Cu/fTZKNQpX/RbzChBYLLl3lo8CjFZBAZXq9qFg== integrity sha512-uMCj6+hZYDoffuvAJjFAPz56E9uoowFHmTkqRtRq5WyC5Q6Cu/fTZKNQpX/RbzChBYLLl3lo8CjFZBAZXq9qFg==
kolorist@^1.8.0:
version "1.8.0"
resolved "https://registry.yarnpkg.com/kolorist/-/kolorist-1.8.0.tgz#edddbbbc7894bc13302cdf740af6374d4a04743c"
integrity sha512-Y+60/zizpJ3HRH8DCss+q95yr6145JXZo46OTpFvDZWLfRCE4qChOyk1b26nMaNpfHHgxagk9dXT5OP0Tfe+dQ==
leaflet@^1.9.4: leaflet@^1.9.4:
version "1.9.4" version "1.9.4"
resolved "https://registry.yarnpkg.com/leaflet/-/leaflet-1.9.4.tgz#23fae724e282fa25745aff82ca4d394748db7d8d" resolved "https://registry.yarnpkg.com/leaflet/-/leaflet-1.9.4.tgz#23fae724e282fa25745aff82ca4d394748db7d8d"