remove disclaimer

This commit is contained in:
vcoppe
2024-08-29 14:10:40 +02:00
parent a23fea3d98
commit 920e7901f4
3 changed files with 106 additions and 133 deletions

View File

@@ -1,29 +0,0 @@
<script lang="ts">
import * as AlertDialog from '$lib/components/ui/alert-dialog';
import { settings } from '$lib/db';
const { showWelcomeMessage } = settings;
</script>
<AlertDialog.Root
open={$showWelcomeMessage === true}
closeOnEscape={false}
closeOnOutsideClick={false}
onOpenChange={() => ($showWelcomeMessage = false)}
>
<AlertDialog.Trigger class="hidden"></AlertDialog.Trigger>
<AlertDialog.Content>
<AlertDialog.Header>
<AlertDialog.Title>
Welcome to the new version of <b>gpx.studio</b>!
</AlertDialog.Title>
<AlertDialog.Description class="space-y-1">
<p>The website is still under development and may contain bugs.</p>
<p>Please report any issues you find by email or on GitHub.</p>
</AlertDialog.Description>
</AlertDialog.Header>
<AlertDialog.Footer>
<AlertDialog.Action>Let's go!</AlertDialog.Action>
</AlertDialog.Footer>
</AlertDialog.Content>
</AlertDialog.Root>

View File

@@ -111,7 +111,6 @@ export const settings = {
defaultWeight: dexieSettingStore('defaultWeight', (browser && window.innerWidth < 600) ? 8 : 5), defaultWeight: dexieSettingStore('defaultWeight', (browser && window.innerWidth < 600) ? 8 : 5),
bottomPanelSize: dexieSettingStore('bottomPanelSize', 170), bottomPanelSize: dexieSettingStore('bottomPanelSize', 170),
rightPanelSize: dexieSettingStore('rightPanelSize', 240), rightPanelSize: dexieSettingStore('rightPanelSize', 240),
showWelcomeMessage: dexieSettingStore('showWelcomeMessage', true, false),
}; };
// Wrap Dexie live queries in a Svelte store to avoid triggering the query for every subscriber // Wrap Dexie live queries in a Svelte store to avoid triggering the query for every subscriber

View File

@@ -1,121 +1,124 @@
<script lang="ts"> <script lang="ts">
import GPXLayers from '$lib/components/gpx-layer/GPXLayers.svelte'; import GPXLayers from '$lib/components/gpx-layer/GPXLayers.svelte';
import ElevationProfile from '$lib/components/ElevationProfile.svelte'; import ElevationProfile from '$lib/components/ElevationProfile.svelte';
import FileList from '$lib/components/file-list/FileList.svelte'; import FileList from '$lib/components/file-list/FileList.svelte';
import GPXStatistics from '$lib/components/GPXStatistics.svelte'; import GPXStatistics from '$lib/components/GPXStatistics.svelte';
import Map from '$lib/components/Map.svelte'; import Map from '$lib/components/Map.svelte';
import Menu from '$lib/components/Menu.svelte'; import Menu from '$lib/components/Menu.svelte';
import Toolbar from '$lib/components/toolbar/Toolbar.svelte'; import Toolbar from '$lib/components/toolbar/Toolbar.svelte';
import StreetViewControl from '$lib/components/street-view-control/StreetViewControl.svelte'; import StreetViewControl from '$lib/components/street-view-control/StreetViewControl.svelte';
import LayerControl from '$lib/components/layer-control/LayerControl.svelte'; import LayerControl from '$lib/components/layer-control/LayerControl.svelte';
import Resizer from '$lib/components/Resizer.svelte'; import Resizer from '$lib/components/Resizer.svelte';
import { Toaster } from '$lib/components/ui/sonner'; import { Toaster } from '$lib/components/ui/sonner';
import { observeFilesFromDatabase, settings } from '$lib/db'; import { observeFilesFromDatabase, settings } from '$lib/db';
import { gpxStatistics, loadFiles, slicedGPXStatistics } from '$lib/stores'; import { gpxStatistics, loadFiles, slicedGPXStatistics } from '$lib/stores';
import { onMount } from 'svelte'; import { onMount } from 'svelte';
import { page } from '$app/stores'; import { page } from '$app/stores';
import { languages } from '$lib/languages'; import { languages } from '$lib/languages';
import { getURLForLanguage } from '$lib/utils'; import { getURLForLanguage } from '$lib/utils';
import Welcome from '$lib/components/Welcome.svelte';
const { const {
verticalFileView, verticalFileView,
elevationProfile, elevationProfile,
bottomPanelSize, bottomPanelSize,
rightPanelSize, rightPanelSize,
additionalDatasets, additionalDatasets,
elevationFill elevationFill
} = settings; } = settings;
onMount(() => { onMount(() => {
observeFilesFromDatabase(); observeFilesFromDatabase();
let files = JSON.parse($page.url.searchParams.get('files') || '[]'); let files = JSON.parse($page.url.searchParams.get('files') || '[]');
if (files.length > 0) { if (files.length > 0) {
let downloads: Promise<File | null>[] = []; let downloads: Promise<File | null>[] = [];
files.forEach((url) => { files.forEach((url) => {
downloads.push( downloads.push(
fetch(url) fetch(url)
.then((response) => response.blob()) .then((response) => response.blob())
.then((blob) => new File([blob], url.split('/').pop())) .then((blob) => new File([blob], url.split('/').pop()))
); );
}); });
Promise.all(downloads).then((files) => { Promise.all(downloads).then((files) => {
files = files.filter((file) => file !== null); files = files.filter((file) => file !== null);
loadFiles(files); loadFiles(files);
}); });
} }
}); });
</script> </script>
<div class="fixed flex flex-row w-screen h-screen h-dvh"> <div class="fixed flex flex-row w-screen h-screen h-dvh">
<div class="flex flex-col grow h-full min-w-0"> <div class="flex flex-col grow h-full min-w-0">
<div class="grow relative"> <div class="grow relative">
<Menu /> <Menu />
<div <div
class="absolute top-0 bottom-0 left-0 z-40 flex flex-col justify-center pointer-events-none" class="absolute top-0 bottom-0 left-0 z-40 flex flex-col justify-center pointer-events-none"
> >
<Toolbar /> <Toolbar />
</div> </div>
<Map class="h-full {$verticalFileView ? '' : 'horizontal'}" /> <Map class="h-full {$verticalFileView ? '' : 'horizontal'}" />
<StreetViewControl /> <StreetViewControl />
<LayerControl /> <LayerControl />
<GPXLayers /> <GPXLayers />
<Toaster richColors /> <Toaster richColors />
{#if !$verticalFileView} {#if !$verticalFileView}
<div class="h-10 -translate-y-10 w-full pointer-events-none absolute z-30"> <div class="h-10 -translate-y-10 w-full pointer-events-none absolute z-30">
<FileList orientation="horizontal" /> <FileList orientation="horizontal" />
</div> </div>
{/if} {/if}
</div> </div>
{#if $elevationProfile} {#if $elevationProfile}
<Resizer orientation="row" bind:after={$bottomPanelSize} minAfter={100} maxAfter={300} /> <Resizer
{/if} orientation="row"
<div bind:after={$bottomPanelSize}
class="{$elevationProfile ? '' : 'h-10'} flex flex-row gap-2 px-2 sm:px-4" minAfter={100}
style={$elevationProfile ? `height: ${$bottomPanelSize}px` : ''} maxAfter={300}
> />
<GPXStatistics {/if}
{gpxStatistics} <div
{slicedGPXStatistics} class="{$elevationProfile ? '' : 'h-10'} flex flex-row gap-2 px-2 sm:px-4"
panelSize={$bottomPanelSize} style={$elevationProfile ? `height: ${$bottomPanelSize}px` : ''}
orientation={$elevationProfile ? 'vertical' : 'horizontal'} >
/> <GPXStatistics
{#if $elevationProfile} {gpxStatistics}
<ElevationProfile {slicedGPXStatistics}
{gpxStatistics} panelSize={$bottomPanelSize}
{slicedGPXStatistics} orientation={$elevationProfile ? 'vertical' : 'horizontal'}
bind:additionalDatasets={$additionalDatasets} />
bind:elevationFill={$elevationFill} {#if $elevationProfile}
panelSize={$bottomPanelSize} <ElevationProfile
class="py-2" {gpxStatistics}
/> {slicedGPXStatistics}
{/if} bind:additionalDatasets={$additionalDatasets}
</div> bind:elevationFill={$elevationFill}
</div> panelSize={$bottomPanelSize}
{#if $verticalFileView} class="py-2"
<Resizer orientation="col" bind:after={$rightPanelSize} minAfter={100} maxAfter={400} /> />
<FileList orientation="vertical" recursive={true} style="width: {$rightPanelSize}px" /> {/if}
{/if} </div>
<Welcome /> </div>
{#if $verticalFileView}
<Resizer orientation="col" bind:after={$rightPanelSize} minAfter={100} maxAfter={400} />
<FileList orientation="vertical" recursive={true} style="width: {$rightPanelSize}px" />
{/if}
</div> </div>
<!-- hidden links for svelte crawling --> <!-- hidden links for svelte crawling -->
<div class="hidden"> <div class="hidden">
{#each Object.entries(languages) as [lang, label]} {#each Object.entries(languages) as [lang, label]}
<a href={getURLForLanguage(lang, '/embed')}> <a href={getURLForLanguage(lang, '/embed')}>
{label} {label}
</a> </a>
{/each} {/each}
</div> </div>
<style lang="postcss"> <style lang="postcss">
div :global(.toaster.group) { div :global(.toaster.group) {
@apply absolute; @apply absolute;
@apply right-2; @apply right-2;
--offset: 50px !important; --offset: 50px !important;
} }
</style> </style>