updates trail panel view

This commit is contained in:
Christian Beutel
2025-01-27 20:14:50 +01:00
parent e837b6e04b
commit 63a83116a9
2 changed files with 19 additions and 24 deletions

View File

@@ -161,7 +161,8 @@
<div <div
class="trail-info-panel mx-auto {mode == 'list' class="trail-info-panel mx-auto {mode == 'list'
? '' ? ''
: 'border border-input-border rounded-3xl'} h-full overflow-y-scroll" : 'border border-input-border rounded-3xl'} h-full"
class:overflow-y-scroll={mode !== "overview"}
style="max-width: min(100%, 76rem);" style="max-width: min(100%, 76rem);"
> >
<div class="trail-info-panel-header"> <div class="trail-info-panel-header">
@@ -268,9 +269,7 @@
<i class="fa fa-left-right"></i> <i class="fa fa-left-right"></i>
{/if}</span {/if}</span
> >
<span class="" <span class="">{formatDistance(trail.distance)}</span>
>{formatDistance(trail.distance)}</span
>
</div> </div>
<div class="flex flex-col items-center"> <div class="flex flex-col items-center">
<span class="font-medium" <span class="font-medium"
@@ -280,9 +279,7 @@
<i class="fa fa-clock"></i> <i class="fa fa-clock"></i>
{/if}</span {/if}</span
> >
<span class="" <span class="">{formatTimeHHMM(trail.duration)}</span>
>{formatTimeHHMM(trail.duration)}</span
>
</div> </div>
<div class="flex flex-col items-center"> <div class="flex flex-col items-center">
<span class="font-medium" <span class="font-medium"
@@ -292,9 +289,7 @@
<i class="fa fa-arrow-trend-up"></i> <i class="fa fa-arrow-trend-up"></i>
{/if}</span {/if}</span
> >
<span class="" <span class="">{formatElevation(trail.elevation_gain)}</span>
>{formatElevation(trail.elevation_gain)}</span
>
</div> </div>
<div class="flex flex-col items-center"> <div class="flex flex-col items-center">
<span class="font-medium" <span class="font-medium"
@@ -304,9 +299,7 @@
<i class="fa fa-arrow-trend-down"></i> <i class="fa fa-arrow-trend-down"></i>
{/if}</span {/if}</span
> >
<span class="" <span class="">{formatElevation(trail.elevation_loss)}</span>
>{formatElevation(trail.elevation_loss)}</span
>
</div> </div>
{#if trail.expand?.category} {#if trail.expand?.category}
<div class="flex flex-col items-center"> <div class="flex flex-col items-center">
@@ -317,9 +310,7 @@
<i class="fa fa-route"></i> <i class="fa fa-route"></i>
{/if}</span {/if}</span
> >
<span class="" <span class="">{$_(trail.expand.category.name)}</span>
>{$_(trail.expand.category.name)}</span
>
</div> </div>
{/if} {/if}
</section> </section>
@@ -365,7 +356,8 @@
{:else} {:else}
<EmptyStateDescription></EmptyStateDescription> <EmptyStateDescription></EmptyStateDescription>
{/if} {/if}
<h4 class="text-2xl font-semibold mb-6 mt-12">{$_('route')}</h4> <h4 class="text-2xl font-semibold mb-6 mt-12">{$_("route")}</h4>
<div class="relative border border-input-border rounded-xl p-2 mb-6 text-xs" id="epc-container"></div>
<TrailTimeline <TrailTimeline
{trail} {trail}
onmouseenter={openMarkerPopup} onmouseenter={openMarkerPopup}
@@ -482,7 +474,8 @@
trails={[trail]} trails={[trail]}
activeTrail={0} activeTrail={0}
waypoints={trail.expand?.waypoints} waypoints={trail.expand?.waypoints}
showElevation={false} showElevation={true}
elevationProfileContainer={"epc-container"}
showStyleSwitcher={false} showStyleSwitcher={false}
showFullscreen={true} showFullscreen={true}
mapOptions={{ attributionControl: false }} mapOptions={{ attributionControl: false }}

View File

@@ -14,6 +14,8 @@
let gallery: PhotoGallery; let gallery: PhotoGallery;
let { trail, onmouseenter, onmouseleave }: Props = $props(); let { trail, onmouseenter, onmouseleave }: Props = $props();
const photos = trail.expand?.waypoints.map(wp => wp.photos.map((p) => getFileURL(wp, p))).flat() ?? []
</script> </script>
<div <div
@@ -25,6 +27,10 @@
<div class=""> <div class="">
<p class="font-semibold">{$_("start")}</p> <p class="font-semibold">{$_("start")}</p>
</div> </div>
<PhotoGallery
{photos}
bind:this={gallery}
></PhotoGallery>
{#each trail.expand?.waypoints ?? [] as wp, i} {#each trail.expand?.waypoints ?? [] as wp, i}
<div <div
class="bg-background cursor-pointer" class="bg-background cursor-pointer"
@@ -41,17 +47,13 @@
</div> </div>
<div class="border border-input-border rounded-xl overflow-hidden"> <div class="border border-input-border rounded-xl overflow-hidden">
<PhotoGallery
photos={wp.photos.map((p) => getFileURL(wp, p))}
bind:this={gallery}
></PhotoGallery>
{#if wp.photos.length} {#if wp.photos.length}
<div <div
class="grid {wp.photos.length > 1 class="grid {wp.photos.length > 1
? 'grid-cols-[8fr_5fr]' ? 'grid-cols-[8fr_5fr]'
: 'grid-cols-1'} cursor-pointer" : 'grid-cols-1'} cursor-pointer"
role="presentation" role="presentation"
onclick={() => gallery.openGallery()} onclick={() => gallery.openGallery(i)}
> >
{#each wp.photos as photo, i} {#each wp.photos as photo, i}
<img <img