This commit is contained in:
vcoppe
2025-06-21 21:07:36 +02:00
parent f0230d4634
commit 1cc07901f6
803 changed files with 7937 additions and 6329 deletions

View File

@@ -2,9 +2,9 @@
import { Button } from '$lib/components/ui/button';
import DocsContainer from '$lib/components/docs/DocsContainer.svelte';
import Logo from '$lib/components/Logo.svelte';
import ElevationProfile from '$lib/components/ElevationProfile.svelte';
import GPXStatistics from '$lib/components/GPXStatistics.svelte';
import Routing from '$lib/components/toolbar/tools/routing/Routing.svelte';
// import ElevationProfile from '$lib/components/ElevationProfile.svelte';
// import GPXStatistics from '$lib/components/GPXStatistics.svelte';
// import Routing from '$lib/components/toolbar/tools/routing/Routing.svelte';
import {
BookOpenText,
Heart,
@@ -14,35 +14,43 @@
PenLine,
Route,
Scale,
} from 'lucide-svelte';
import { _, locale } from '$lib/i18n';
} from '@lucide/svelte';
import { i18n } from '$lib/i18n.svelte';
import { getURLForLanguage } from '$lib/utils';
import { exampleGPXFile } from '$lib/assets/example';
import { writable } from 'svelte/store';
import Toolbar from '$lib/components/toolbar/Toolbar.svelte';
import { currentTool, Tool } from '$lib/stores';
// import Toolbar from '$lib/components/toolbar/Toolbar.svelte';
// import { tool, Tool } from '$lib/components/toolbar/utils.svelte';
import { onDestroy, onMount } from 'svelte';
export let data: {
fundingModule: any;
translationModule: any;
mapboxModule: any;
};
let {
data,
}: {
data: {
fundingModule: Promise<any>;
translationModule: Promise<any>;
mapboxModule: Promise<any>;
};
} = $props();
let gpxStatistics = writable(exampleGPXFile.getStatistics());
let slicedGPXStatistics = writable(undefined);
let additionalDatasets = writable(['speed', 'atemp']);
let elevationFill = writable<'slope' | 'surface' | undefined>(undefined);
onMount(() => {
$currentTool = Tool.SCISSORS;
});
// onMount(() => {
// tool.current = Tool.SCISSORS;
// });
$: $currentTool, ($currentTool = Tool.SCISSORS);
// $effect(() => {
// if (tool.current !== Tool.SCISSORS) {
// tool.current = Tool.SCISSORS;
// }
// });
onDestroy(() => {
$currentTool = null;
});
// onDestroy(() => {
// tool.current = null;
// });
</script>
<div class="space-y-24 my-24">
@@ -50,23 +58,23 @@
<div class="px-12 w-full flex flex-col items-center">
<div class="flex flex-col gap-6 items-center max-w-3xl">
<h1 class="text-4xl sm:text-6xl font-black text-center">
{$_('metadata.home_title')}
{i18n._('metadata.home_title')}
</h1>
<div class="text-lg sm:text-xl text-muted-foreground text-center">
{$_('metadata.description')}
{i18n._('metadata.description')}
</div>
<div class="w-full flex flex-row justify-center gap-3">
<Button href={getURLForLanguage($locale, '/app')} class="w-1/3 min-w-fit">
<Button href={getURLForLanguage(i18n.lang, '/app')} class="w-1/3 min-w-fit">
<Map size="18" class="mr-1.5" />
{$_('homepage.app')}
{i18n._('homepage.app')}
</Button>
<Button
variant="secondary"
href={getURLForLanguage($locale, '/help')}
href={getURLForLanguage(i18n.lang, '/help')}
class="w-1/3 min-w-fit"
>
<BookOpenText size="18" class="mr-1.5" />
<span>{$_('menu.help')}</span>
<span>{i18n._('menu.help')}</span>
</Button>
</div>
</div>
@@ -89,12 +97,12 @@
<div class="markdown text-center">
<h1>
<Route size="24" class="mr-1 inline-block align-baseline" />
{$_('homepage.route_planning')}
{i18n._('homepage.route_planning')}
</h1>
<p class="text-muted-foreground">{$_('homepage.route_planning_description')}</p>
<p class="text-muted-foreground">{i18n._('homepage.route_planning_description')}</p>
</div>
<div class="p-3 w-fit rounded-md border shadow-xl md:shrink-0">
<Routing minimizable={false} />
<!-- <Routing minimizable={false} /> -->
</div>
</div>
</div>
@@ -105,19 +113,23 @@
<div class="markdown text-center md:hidden">
<h1>
<PencilRuler size="24" class="mr-1 inline-block align-baseline" />
{$_('homepage.file_processing')}
{i18n._('homepage.file_processing')}
</h1>
<p class="text-muted-foreground">{$_('homepage.file_processing_description')}</p>
<p class="text-muted-foreground">
{i18n._('homepage.file_processing_description')}
</p>
</div>
<div class="relative md:shrink-0 max-w-[400px]">
<Toolbar />
<!-- <Toolbar /> -->
</div>
<div class="markdown text-center hidden md:block">
<h1>
<PencilRuler size="24" class="mr-1 inline-block align-baseline" />
{$_('homepage.file_processing')}
{i18n._('homepage.file_processing')}
</h1>
<p class="text-muted-foreground">{$_('homepage.file_processing_description')}</p>
<p class="text-muted-foreground">
{i18n._('homepage.file_processing_description')}
</p>
</div>
</div>
</div>
@@ -128,12 +140,12 @@
<div class="markdown text-center">
<h1>
<Map size="24" class="mr-1 inline-block align-baseline" />
{$_('homepage.maps')}
{i18n._('homepage.maps')}
</h1>
<p class="text-muted-foreground">{$_('homepage.maps_description')}</p>
<p class="text-muted-foreground">{i18n._('homepage.maps_description')}</p>
</div>
<div
class="relative h-60 xs:h-80 aspect-square rounded-2xl shadow-xl overflow-hidden overflow-clip"
class="relative w-full max-w-[320px] aspect-square rounded-2xl shadow-xl overflow-clip"
>
<enhanced:img
src="/src/lib/assets/img/home/mapbox-outdoors.png"
@@ -171,28 +183,28 @@
<div class="markdown text-center px-4 md:px-12">
<h1>
<ChartArea size="24" class="mr-1 inline-block align-baseline" />
{$_('homepage.data_visualization')}
{i18n._('homepage.data_visualization')}
</h1>
<p class="text-muted-foreground mb-6">
{$_('homepage.data_visualization_description')}
{i18n._('homepage.data_visualization_description')}
</p>
</div>
<div class="h-48 w-full">
<ElevationProfile
<!-- <ElevationProfile
{gpxStatistics}
{slicedGPXStatistics}
additionalDatasets={$additionalDatasets}
elevationFill={$elevationFill}
/>
/> -->
</div>
<div class="flex flex-col items-center">
<div class="h-10 w-fit">
<GPXStatistics
<!-- <GPXStatistics
{gpxStatistics}
{slicedGPXStatistics}
panelSize={192}
orientation={'horizontal'}
/>
/> -->
</div>
</div>
</div>
@@ -203,9 +215,9 @@
<div class="markdown text-center md:hidden">
<h1>
<Scale size="24" class="mr-1 inline-block align-baseline" />
{$_('homepage.identity')}
{i18n._('homepage.identity')}
</h1>
<p class="text-muted-foreground">{$_('homepage.identity_description')}</p>
<p class="text-muted-foreground">{i18n._('homepage.identity_description')}</p>
</div>
<a href="https://github.com/gpxstudio/gpx.studio" target="_blank">
<Logo class="h-32" company="github" />
@@ -213,9 +225,9 @@
<div class="markdown text-center hidden md:block">
<h1>
<Scale size="24" class="mr-1 inline-block align-baseline" />
{$_('homepage.identity')}
{i18n._('homepage.identity')}
</h1>
<p class="text-muted-foreground">{$_('homepage.identity_description')}</p>
<p class="text-muted-foreground">{i18n._('homepage.identity_description')}</p>
</div>
</div>
</div>
@@ -244,7 +256,7 @@
fill="rgb(var(--support))"
color="rgb(var(--support))"
/>
<span>{$_('homepage.support_button')}</span>
<span>{i18n._('homepage.support_button')}</span>
</Button>
</div>
<div
@@ -255,7 +267,7 @@
{/await}
<Button href="https://crowdin.com/project/gpxstudio" target="_blank" class="text-base">
<PenLine size="16" class="mr-1" />
<span>{$_('homepage.contribute')}</span>
<span>{i18n._('homepage.contribute')}</span>
</Button>
</div>
</div>
@@ -267,7 +279,7 @@
class="shrink-0 flex flex-col sm:flex-row lg:flex-col items-center gap-x-4 gap-y-2"
>
<div class="text-lg font-semibold text-muted-foreground">
❤️ {$_('homepage.supported_by')}
❤️ {i18n._('homepage.supported_by')}
</div>
<a href="https://www.mapbox.com/" target="_blank">
<Logo company="mapbox" class="w-60" />