From 89467f19b929b742c35ae14d89abb3ca816ec435 Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Tue, 11 Aug 2026 20:36:48 +0200 Subject: feat: add interactive ride profile --- web/templates.templ | 225 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 225 insertions(+) (limited to 'web/templates.templ') diff --git a/web/templates.templ b/web/templates.templ index 78591e1..b1304a5 100644 --- a/web/templates.templ +++ b/web/templates.templ @@ -43,6 +43,14 @@ templ Layout(title string, content templ.Component) { .empty { padding: 2.5rem 1rem; text-align: center; color: #68746c; } .map-panel { padding: 0; overflow: hidden; } .ride-map { min-height: 24rem; height: min(65vh, 40rem); } + .profile-panel { padding-bottom: 1rem; } + .profile-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; } + .profile-heading h2 { margin: 0; font-size: 1.2rem; } + .profile-heading p { margin: 0; color: #68746c; font-size: .9rem; } + .profile-chart { margin-top: 1rem; } + .profile-chart canvas { display: block; width: 100%; height: 22rem; border-radius: .65rem; background: #fbfcfa; outline: none; } + .profile-chart canvas:focus-visible { box-shadow: 0 0 0 .2rem #18794e66; } + .profile-hover { display: block; min-height: 1.4rem; margin: .7rem 0 0; color: #5b675f; font-size: .9rem; } dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 0; } dt { color: #68746c; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; } dd { margin: .25rem 0 0; font-size: 1.2rem; font-weight: 700; } @@ -113,16 +121,32 @@ templ RideDetailContent(data RideDetailView) {
{ data.RouteError }
} if data.HasRoute { +
+
+

Elevation profile

+

Hover or focus the profile to inspect the ride at that distance.

+
+
+ +
+ Hover or focus the profile to inspect elevation. +
@templ.JSONScript("ride-route", data.Route) + @templ.JSONScript("ride-profile", data.Profile) } -- cgit v1.2.3