This commit is contained in:
vcoppe
2024-10-10 11:39:14 +02:00
parent d1e4588813
commit 60f24f8757
3 changed files with 36 additions and 18 deletions

View File

@@ -45,24 +45,9 @@ export async function handle({ event, resolve }) {
`;
}
const stringsHTML = page === 'app' ? stringsToHTML(strings) : '';
const response = await resolve(event, {
transformPageChunk: ({ html }) => html.replace('<html>', htmlTag).replace('<head>', headTag).replace('</body>', `<div class="fixed -z-10 text-transparent">${stringsHTML}</div></body>`)
transformPageChunk: ({ html }) => html.replace('<html>', htmlTag).replace('<head>', headTag),
});
return response;
}
function stringsToHTML(dictionary, strings = new Set(), root = true) {
Object.values(dictionary).forEach((value) => {
if (typeof value === 'object') {
stringsToHTML(value, strings, false);
} else {
strings.add(value);
}
});
if (root) {
return Array.from(strings).map((string) => `<p>${string}</p>`).join('');
}
}

View File

@@ -49,7 +49,7 @@
<div class="-mt-12 sm:mt-0">
<div class="px-12 w-full flex flex-col items-center">
<div class="flex flex-col gap-6 items-center max-w-3xl">
<div class="text-4xl sm:text-6xl font-black text-center">{$_('metadata.home_title')}</div>
<h1 class="text-4xl sm:text-6xl font-black text-center">{$_('metadata.home_title')}</h1>
<div class="text-lg sm:text-xl text-muted-foreground text-center">
{$_('metadata.description')}
</div>

View File

@@ -10,7 +10,6 @@
import LayerControl from '$lib/components/layer-control/LayerControl.svelte';
import Resizer from '$lib/components/Resizer.svelte';
import { Toaster } from '$lib/components/ui/sonner';
import { observeFilesFromDatabase, settings } from '$lib/db';
import { gpxStatistics, loadFiles, slicedGPXStatistics } from '$lib/stores';
import { onMount } from 'svelte';
@@ -18,6 +17,7 @@
import { languages } from '$lib/languages';
import { getURLForLanguage } from '$lib/utils';
import { getURLForGoogleDriveFile } from '$lib/components/embedding/Embedding';
import { _ } from 'svelte-i18n';
const {
verticalFileView,
@@ -53,6 +53,39 @@
});
</script>
<div class="fixed -z-10 text-transparent">
<h1>{$_('metadata.home_title')}{$_('metadata.app_title')}</h1>
<p>{$_('metadata.description')}</p>
<h2>{$_('toolbar.routing.tooltip')}</h2>
<p>{$_('toolbar.routing.help_no_file')}</p>
<p>{$_('toolbar.routing.help')}</p>
<h3>{$_('toolbar.routing.reverse.button')}</h3>
<p>{$_('toolbar.routing.reverse.tooltip')}</p>
<h3>{$_('toolbar.routing.route_back_to_start.button')}</h3>
<p>{$_('toolbar.routing.route_back_to_start.tooltip')}</p>
<h3>{$_('toolbar.routing.round_trip.button')}</h3>
<p>{$_('toolbar.routing.round_trip.tooltip')}</p>
<h3>{$_('toolbar.routing.start_loop_here')}</h3>
<h2>{$_('toolbar.scissors.tooltip')}</h2>
<p>{$_('toolbar.scissors.help')}</p>
<h2>{$_('toolbar.time.tooltip')}</h2>
<p>{$_('toolbar.time.help')}</p>
<h2>{$_('toolbar.merge.tooltip')}</h2>
<h3>{$_('toolbar.merge.merge_traces')}</h3>
<p>{$_('toolbar.merge.help_merge_traces')}</p>
<h3>{$_('toolbar.merge.merge_contents')}</h3>
<p>{$_('toolbar.merge.help_merge_contents')}</p>
<h2>{$_('toolbar.elevation.button')}</h2>
<p>{$_('toolbar.elevation.help')}</p>
<h2>{$_('toolbar.waypoint.tooltip')}</h2>
<p>{$_('toolbar.waypoint.help')}</p>
<h2>{$_('toolbar.reduce.tooltip')}</h2>
<p>{$_('toolbar.reduce.help')}</p>
<h2>{$_('toolbar.clean.tooltip')}</h2>
<p>{$_('toolbar.clean.help')}</p>
<h2>{$_('gpx.files')}, {$_('gpx.tracks')}, {$_('gpx.segments')}, {$_('gpx.waypoints')}</h2>
</div>
<div class="fixed flex flex-row w-screen h-screen supports-dvh:h-dvh">
<div class="flex flex-col grow h-full min-w-0">
<div class="grow relative">