small ui improvements

This commit is contained in:
vcoppe
2026-02-17 22:24:14 +01:00
parent 091f6a3ed0
commit c9ca75e2e8
4 changed files with 24 additions and 7 deletions

View File

@@ -31,13 +31,13 @@
<Card.Root <Card.Root
class="h-full {orientation === 'vertical' class="h-full {orientation === 'vertical'
? 'min-w-40 sm:min-w-44 text-sm sm:text-base' ? 'min-w-40 sm:min-w-44'
: 'w-full'} border-none shadow-none p-0" : 'w-full h-10'} border-none shadow-none p-0 text-sm sm:text-base"
> >
<Card.Content <Card.Content
class="h-full flex {orientation === 'vertical' class="h-full flex {orientation === 'vertical'
? 'flex-col justify-center' ? 'flex-col justify-center'
: 'flex-row w-full justify-between'} gap-4 p-0" : 'flex-row w-full justify-evenly'} gap-4 p-0"
> >
<Tooltip label={i18n._('quantities.distance')}> <Tooltip label={i18n._('quantities.distance')}>
<span class="flex flex-row items-center"> <span class="flex flex-row items-center">

View File

@@ -64,7 +64,7 @@
}); });
</script> </script>
<div class="h-full grow min-w-0 relative py-2"> <div class="h-full grow min-w-0 min-h-0 relative">
<canvas bind:this={overlay} class="w-full h-full absolute pointer-events-none"></canvas> <canvas bind:this={overlay} class="w-full h-full absolute pointer-events-none"></canvas>
<canvas bind:this={canvas} class="w-full h-full absolute"></canvas> <canvas bind:this={canvas} class="w-full h-full absolute"></canvas>
{#if showControls} {#if showControls}

View File

@@ -129,12 +129,21 @@
@apply relative; @apply relative;
@apply top-0; @apply top-0;
@apply left-0; @apply left-0;
@apply my-2;
@apply w-[29px]; @apply w-[29px];
} }
div :global(.maplibregl-ctrl-geocoder--icon-loading) {
@apply -mt-1;
@apply mb-0;
}
div :global(.maplibregl-ctrl-geocoder--icon-close) {
@apply my-0;
}
div :global(.maplibregl-ctrl-geocoder--input) { div :global(.maplibregl-ctrl-geocoder--input) {
@apply relative; @apply relative;
@apply h-8;
@apply w-64; @apply w-64;
@apply py-0; @apply py-0;
@apply pl-2; @apply pl-2;

View File

@@ -30,6 +30,11 @@
elevationFill, elevationFill,
} = settings; } = settings;
let bottomPanelWidth: number | undefined = $state();
let bottomPanelOrientation = $derived(
bottomPanelWidth && bottomPanelWidth >= 540 && $elevationProfile ? 'horizontal' : 'vertical'
);
onMount(async () => { onMount(async () => {
settings.connectToDatabase(db); settings.connectToDatabase(db);
fileStateCollection.connectToDatabase(db).then(() => { fileStateCollection.connectToDatabase(db).then(() => {
@@ -127,14 +132,17 @@
/> />
{/if} {/if}
<div <div
class="{$elevationProfile ? '' : 'h-10'} flex flex-row gap-2 px-2 sm:px-4" bind:offsetWidth={bottomPanelWidth}
class="flex {bottomPanelOrientation == 'vertical'
? 'flex-col'
: 'flex-row py-2'} gap-1 px-2"
style={$elevationProfile ? `height: ${$bottomPanelSize}px` : ''} style={$elevationProfile ? `height: ${$bottomPanelSize}px` : ''}
> >
<GPXStatistics <GPXStatistics
{gpxStatistics} {gpxStatistics}
{slicedGPXStatistics} {slicedGPXStatistics}
panelSize={$bottomPanelSize} panelSize={$bottomPanelSize}
orientation={$elevationProfile ? 'vertical' : 'horizontal'} orientation={bottomPanelOrientation == 'horizontal' ? 'vertical' : 'horizontal'}
/> />
{#if $elevationProfile} {#if $elevationProfile}
<ElevationProfile <ElevationProfile