feat(hikes): use SAC-tier colours for the detail-page trail

Live and static heroes on the detail page were rendered in Nord red,
while the same trail on the /hikes overview map already used the
high-contrast SAC palette (orange/red/blue). The mismatch made the
detail trail look muted against the Pixelkarte; the overview's choice
also doubles as a navigational hint ("the orange trail you saw on
the map is this one").

Introduce $lib/data/sacColors as the single source of truth so
HikeMap, HikesOverviewMap, and the build-side static renderer all
pull the same palette. Bump HERO_RENDER_VERSION to v6 so stale
Nord-red static heroes get re-rendered on the next build.
This commit is contained in:
2026-05-19 10:27:31 +02:00
parent 706dedbdc5
commit a1aa722512
6 changed files with 75 additions and 47 deletions
+4 -1
View File
@@ -17,6 +17,7 @@
import Download from '@lucide/svelte/icons/download';
import { buildGpx, type GpxWritePoint } from '$lib/gpx';
import { resolveCanton } from '$lib/data/cantons';
import { sacTrailColor } from '$lib/data/sacColors';
import type { HikeTrackPoint } from '$types/hikes';
import type { PageProps } from './$types';
@@ -51,6 +52,7 @@
});
const canton = $derived(resolveCanton(hike.canton));
const trackColor = $derived(sacTrailColor(hike.difficulty));
// Publish date formatted in long German for the meta footer
// (matches the hike's `date: YYYY-MM-DD` frontmatter format).
@@ -336,6 +338,7 @@
{track}
imagePoints={visibleImagePoints}
showPrivate
{trackColor}
initialCenter={heroPose?.center}
initialZoom={heroPose?.zoom}
onReady={() => (heroMapReady = true)}
@@ -451,7 +454,7 @@
<section class="scroll-area">
<aside class="trail-col">
{#if track && track.length > 0}
<HikeMap {track} imagePoints={visibleImagePoints} showPrivate />
<HikeMap {track} imagePoints={visibleImagePoints} showPrivate {trackColor} />
<ElevationProfile {track} />
{/if}
</aside>