This commit is contained in:
@@ -4,7 +4,10 @@ FROM golang:1.24-alpine AS builder
|
|||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
|
||||||
# Install build dependencies (none needed for static build) and enable static build
|
# Install build dependencies (none needed for static build) and enable static build
|
||||||
ENV CGO_ENABLED=0 GOOS=linux GOARCH=amd64
|
# Make the build architecture-aware for buildx multi-arch builds
|
||||||
|
ARG TARGETOS
|
||||||
|
ARG TARGETARCH
|
||||||
|
ENV CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH}
|
||||||
|
|
||||||
# Cache go modules
|
# Cache go modules
|
||||||
COPY app/web/go.mod ./app/web/
|
COPY app/web/go.mod ./app/web/
|
||||||
|
|||||||
@@ -6,154 +6,97 @@
|
|||||||
<title>FreeMoto · Route Planner</title>
|
<title>FreeMoto · Route Planner</title>
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||||
<link href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" rel="stylesheet" />
|
<link href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" rel="stylesheet" />
|
||||||
<style>
|
<link href="/styles.css?v=20250918" rel="stylesheet" />
|
||||||
:root {
|
|
||||||
--panel-radius: 18px;
|
|
||||||
--glass-bg: rgba(255,255,255,0.82);
|
|
||||||
--glass-border: rgba(16,24,40,0.08);
|
|
||||||
}
|
|
||||||
html, body { height: 100%; }
|
|
||||||
body { margin: 0; overflow: hidden; background: linear-gradient(180deg, #f2f4f7, #eef2f6); }
|
|
||||||
#map { position: absolute; inset: 0; z-index: 1; }
|
|
||||||
|
|
||||||
/* Top app bar - new gradient look */
|
|
||||||
.appbar {
|
|
||||||
position: fixed; inset: 0 0 auto 0; z-index: 1002;
|
|
||||||
background: linear-gradient(90deg, #0ea5e9, #6366f1);
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
.appbar .navbar-brand { color: #fff; }
|
|
||||||
.appbar .btn { color: #fff; border-color: rgba(255,255,255,0.6); }
|
|
||||||
|
|
||||||
/* Floating dock panel */
|
|
||||||
.nav-panel {
|
|
||||||
position: fixed; left: 10px; right: 10px; bottom: 10px; z-index: 1001;
|
|
||||||
background: var(--glass-bg);
|
|
||||||
border: 1px solid var(--glass-border);
|
|
||||||
backdrop-filter: blur(10px) saturate(160%);
|
|
||||||
border-radius: 999px; /* pill */
|
|
||||||
box-shadow: 0 10px 30px rgba(2, 8, 20, 0.1);
|
|
||||||
padding: 8px 12px;
|
|
||||||
}
|
|
||||||
.nav-panel .form-control, .nav-panel .btn { border-radius: 999px; }
|
|
||||||
.nav-panel .input-group > .input-group-text { border-radius: 999px 0 0 999px; }
|
|
||||||
|
|
||||||
@media (min-width: 768px) {
|
|
||||||
.nav-panel {
|
|
||||||
top: 86px; bottom: auto; left: 24px; right: auto; width: 520px;
|
|
||||||
border-radius: var(--panel-radius);
|
|
||||||
padding: 14px;
|
|
||||||
}
|
|
||||||
.nav-panel .form-control, .nav-panel .btn { border-radius: var(--panel-radius); }
|
|
||||||
.nav-panel .input-group > .input-group-text { border-radius: var(--panel-radius) 0 0 var(--panel-radius); }
|
|
||||||
}
|
|
||||||
|
|
||||||
.section-title { font-weight: 600; color: #334155; }
|
|
||||||
#routeInfoCard { font-size: 0.95rem; }
|
|
||||||
|
|
||||||
/* Suggestions dropdown */
|
|
||||||
#sourceSuggestions, #destSuggestions { position: absolute; top: 100%; left: 0; right: 0; z-index: 2000; max-height: 220px; overflow: auto; border-radius: 12px; }
|
|
||||||
|
|
||||||
/* Directions bottom sheet - improved */
|
|
||||||
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1001; }
|
|
||||||
.sheet-card { border-radius: var(--panel-radius) var(--panel-radius) 0 0; max-height: 60vh; overflow: hidden; }
|
|
||||||
.sheet .handle { width: 44px; height: 5px; border-radius: 999px; background: #CBD5E1; margin: 6px auto 6px; }
|
|
||||||
.sheet-header { position: sticky; top: 0; background: #fff; z-index: 1; padding: 4px 8px; border-bottom: 1px solid #eef2f6; }
|
|
||||||
.sheet-body { overflow: auto; max-height: calc(60vh - 42px); }
|
|
||||||
#directionsSheet { display: none; }
|
|
||||||
.sheet.collapsed .sheet-card { max-height: 28vh; }
|
|
||||||
.sheet.collapsed .sheet-body { max-height: calc(28vh - 42px); }
|
|
||||||
|
|
||||||
.floating-group { position: fixed; right: 14px; bottom: 86px; z-index: 1002; display: flex; flex-direction: column; gap: 10px; }
|
|
||||||
|
|
||||||
/* Dracula-like dark theme */
|
|
||||||
[data-theme="dark"] body { background: linear-gradient(180deg, #1e1f29, #282a36); color: #f8f8f2; }
|
|
||||||
[data-theme="dark"] .appbar { background: linear-gradient(90deg, #44475a, #6272a4); color: #f8f8f2; }
|
|
||||||
[data-theme="dark"] .appbar .navbar-brand { color: #f8f8f2; }
|
|
||||||
[data-theme="dark"] .appbar .btn { color: #f8f8f2; border-color: rgba(248,248,242,0.6); }
|
|
||||||
[data-theme="dark"] .nav-panel { background: rgba(40, 42, 54, 0.85); border-color: rgba(248,248,242,0.08); box-shadow: 0 10px 30px rgba(0,0,0,0.4); }
|
|
||||||
[data-theme="dark"] .form-control, [data-theme="dark"] .input-group-text { background: #282a36; color: #f8f8f2; border-color: #44475a; }
|
|
||||||
[data-theme="dark"] .btn-outline-secondary { color: #f8f8f2; border-color: #8be9fd; }
|
|
||||||
[data-theme="dark"] .btn-primary { background-color: #6272a4; border-color: #6272a4; }
|
|
||||||
[data-theme="dark"] .btn-warning { background-color: #ffb86c; border-color: #ffb86c; color: #1e1f29; }
|
|
||||||
[data-theme="dark"] .badge.text-bg-light { background-color: #44475a !important; color: #f8f8f2 !important; }
|
|
||||||
[data-theme="dark"] .card, [data-theme="dark"] .sheet-card { background: #282a36; color: #f8f8f2; }
|
|
||||||
[data-theme="dark"] .list-group-item { background: #282a36; color: #f8f8f2; border-color: #44475a; }
|
|
||||||
[data-theme="dark"] .sheet-header { background: #282a36; border-bottom-color: #44475a; }
|
|
||||||
[data-theme="dark"] .handle { background: #44475a; }
|
|
||||||
</style>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<!-- App Bar -->
|
<!-- App Bar -->
|
||||||
<nav class="appbar navbar navbar-light px-3">
|
<header class="appbar navbar px-3">
|
||||||
<span class="navbar-brand mb-0 h1 d-flex align-items-center gap-2">
|
<div class="container-fluid d-flex align-items-center justify-content-between">
|
||||||
<span style="font-size: 1.25rem">🏍️</span>
|
<div class="d-flex align-items-center gap-2">
|
||||||
<span>FreeMoto</span>
|
<span class="navbar-brand mb-0 h1 d-flex align-items-center gap-2">
|
||||||
</span>
|
<span aria-hidden="true">🏍️</span>
|
||||||
<div class="d-flex align-items-center gap-3 flex-wrap justify-content-end">
|
<span>FreeMoto</span>
|
||||||
<div class="d-flex align-items-center gap-2" title="Prefer twisty roads (less highways)">
|
</span>
|
||||||
<label for="twistiness" class="form-label mb-0 text-white-50 d-none d-md-inline">Twistiness</label>
|
<span id="summaryPill" class="badge rounded-pill text-bg-light d-none"></span>
|
||||||
<input type="range" class="form-range" id="twistiness" min="0" max="100" value="50" style="width:140px">
|
|
||||||
<span id="twistinessValue" class="badge rounded-pill text-bg-light">50</span>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex align-items-center gap-2" title="Prefer highways (faster)">
|
<div class="d-flex align-items-center gap-2">
|
||||||
<label for="highwayPref" class="form-label mb-0 text-white-50 d-none d-md-inline">Highways</label>
|
<button class="btn btn-outline-secondary btn-sm" id="clearRouteBtn" title="Clear route">Clear</button>
|
||||||
<input type="range" class="form-range" id="highwayPref" min="0" max="100" value="50" style="width:120px">
|
<div class="btn-group btn-group-sm" role="group" aria-label="Zoom controls">
|
||||||
<span id="highwayPrefValue" class="badge rounded-pill text-bg-light">50</span>
|
<button class="btn btn-outline-secondary" id="zoomOutBtn" title="Zoom out">−</button>
|
||||||
|
<button class="btn btn-outline-secondary" id="zoomInBtn" title="Zoom in">+</button>
|
||||||
|
</div>
|
||||||
|
<button class="btn btn-outline-secondary btn-sm" id="themeToggle" title="Toggle dark mode">🌙</button>
|
||||||
</div>
|
</div>
|
||||||
<span id="summaryPill" class="badge rounded-pill text-bg-light d-none"></span>
|
|
||||||
<button class="btn btn-outline-secondary btn-sm" id="clearRouteBtn" title="Clear route">Clear</button>
|
|
||||||
<button class="btn btn-outline-secondary btn-sm" id="zoomOutBtn" title="Zoom out">−</button>
|
|
||||||
<button class="btn btn-outline-secondary btn-sm" id="zoomInBtn" title="Zoom in">+</button>
|
|
||||||
<button class="btn btn-outline-secondary btn-sm" id="themeToggle" title="Toggle dark mode">🌙</button>
|
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</header>
|
||||||
|
|
||||||
<div id="map"></div>
|
<!-- Map canvas -->
|
||||||
|
<div id="map" aria-label="Map"></div>
|
||||||
|
|
||||||
<!-- Floating actions (mobile) -->
|
<!-- Control Drawer: overlay on mobile, sidebar on desktop -->
|
||||||
<div class="floating-group d-md-none">
|
<aside class="nav-panel shadow">
|
||||||
<button class="btn btn-dark export-gpx" title="Export GPX">GPX</button>
|
|
||||||
<button class="btn btn-primary" id="plotRouteBtn" title="Plot Route">Route</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Control Panel -->
|
|
||||||
<div class="nav-panel">
|
|
||||||
<div class="d-flex align-items-center justify-content-between mb-2">
|
<div class="d-flex align-items-center justify-content-between mb-2">
|
||||||
<div class="d-flex align-items-center gap-2">
|
<div class="d-flex align-items-center gap-2">
|
||||||
<span class="badge text-bg-primary">Beta</span>
|
<span class="badge text-bg-primary">Beta</span>
|
||||||
<span class="fw-semibold">Motorcycle route planner</span>
|
<span class="fw-semibold">Motorcycle Route Planner</span>
|
||||||
</div>
|
</div>
|
||||||
<button class="btn btn-sm btn-outline-secondary d-none d-md-inline" onclick="resetMarkers()">Reset</button>
|
<button class="btn btn-sm btn-outline-secondary d-none d-md-inline" onclick="resetMarkers()">Reset</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="routeInfoCard" class="alert alert-info d-none" role="alert"></div>
|
<div id="routeInfoCard" class="alert alert-info d-none" role="alert"></div>
|
||||||
|
<div id="nextManeuverBanner" class="alert alert-secondary py-2 px-3 d-none" role="status"></div>
|
||||||
|
|
||||||
<div id="nextManeuverBanner" class="alert alert-secondary py-2 px-3 d-none" role="alert"></div>
|
<!-- Route inputs -->
|
||||||
|
|
||||||
<div class="section-title mb-1">Route</div>
|
<div class="section-title mb-1">Route</div>
|
||||||
<div class="input-group mb-2 position-relative">
|
<div class="row g-2 align-items-stretch">
|
||||||
<span class="input-group-text" title="Start">
|
<div class="col-12">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="#0d6efd" viewBox="0 0 16 16"><path d="M8 16s6-5.686 6-10A6 6 0 1 0 2 6c0 4.314 6 10 6 10zm0-7a3 3 0 1 1 0-6 3 3 0 0 1 0 6z"/></svg>
|
<div class="input-group position-relative">
|
||||||
</span>
|
<span class="input-group-text" title="Start" aria-label="Start">
|
||||||
<input type="text" class="form-control" id="sourceInput" placeholder="Start address" autocomplete="off" />
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="#0d6efd" viewBox="0 0 16 16"><path d="M8 16s6-5.686 6-10A6 6 0 1 0 2 6c0 4.314 6 10 6 10zm0-7a3 3 0 1 1 0-6 3 3 0 0 1 0 6z"/></svg>
|
||||||
<button class="btn btn-outline-secondary" type="button" id="useCurrentSource" title="Use current location">📍</button>
|
</span>
|
||||||
<div id="sourceSuggestions" class="list-group position-absolute w-100"></div>
|
<input type="text" class="form-control" id="sourceInput" placeholder="Start address" autocomplete="off" />
|
||||||
|
<button class="btn btn-outline-secondary" type="button" id="useCurrentSource" title="Use current location">📍</button>
|
||||||
|
<div id="sourceSuggestions" class="list-group position-absolute w-100"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-12 d-flex justify-content-center">
|
||||||
|
<button id="swapBtn" class="btn btn-light border rounded-circle shadow-sm" type="button" title="Swap start/end">⇅</button>
|
||||||
|
</div>
|
||||||
|
<div class="col-12">
|
||||||
|
<div class="input-group position-relative">
|
||||||
|
<span class="input-group-text" title="Destination" aria-label="Destination">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="#dc3545" viewBox="0 0 16 16"><path d="M14.778 2.222a.5.5 0 0 1 0 .707l-2.5 2.5a.5.5 0 0 1-.707 0l-2.5-2.5a.5.5 0 0 1 .707-.707L12 3.793l2.071-2.071a.5.5 0 0 1 .707 0z"/><path d="M2.5 15a.5.5 0 0 1-.5-.5v-13a.5.5 0 0 1 1 0v13a.5.5 0 0 1-.5.5z"/></svg>
|
||||||
|
</span>
|
||||||
|
<input type="text" class="form-control" id="destInput" placeholder="Destination address" autocomplete="off" />
|
||||||
|
<button class="btn btn-outline-secondary" type="button" id="useCurrentDest" title="Use current location">📍</button>
|
||||||
|
<div id="destSuggestions" class="list-group position-absolute w-100"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="input-group mb-2 position-relative">
|
<!-- Quick sliders -->
|
||||||
<span class="input-group-text" title="Destination">
|
<div class="row g-3 mt-1">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="#dc3545" viewBox="0 0 16 16"><path d="M14.778 2.222a.5.5 0 0 1 0 .707l-2.5 2.5a.5.5 0 0 1-.707 0l-2.5-2.5a.5.5 0 0 1 .707-.707L12 3.793l2.071-2.071a.5.5 0 0 1 .707 0z"/><path d="M2.5 15a.5.5 0 0 1-.5-.5v-13a.5.5 0 0 1 1 0v13a.5.5 0 0 1-.5.5z"/></svg>
|
<div class="col-12">
|
||||||
</span>
|
<label for="twistiness" class="form-label mb-1 text-muted">Twistiness</label>
|
||||||
<input type="text" class="form-control" id="destInput" placeholder="Destination address" autocomplete="off" />
|
<div class="d-flex align-items-center gap-2">
|
||||||
<button class="btn btn-outline-secondary" type="button" id="useCurrentDest" title="Use current location">📍</button>
|
<input type="range" class="form-range" id="twistiness" min="0" max="100" value="50" />
|
||||||
<div id="destSuggestions" class="list-group position-absolute w-100"></div>
|
<span id="twistinessValue" class="badge rounded-pill text-bg-light">50</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-12">
|
||||||
|
<label for="highwayPref" class="form-label mb-1 text-muted">Highways</label>
|
||||||
|
<div class="d-flex align-items-center gap-2">
|
||||||
|
<input type="range" class="form-range" id="highwayPref" min="0" max="100" value="50" />
|
||||||
|
<span id="highwayPrefValue" class="badge rounded-pill text-bg-light">50</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="d-grid gap-2 d-none d-md-grid mb-2">
|
<div class="d-grid gap-2 my-2 d-none d-md-grid">
|
||||||
<button type="button" id="plotRouteBtn" class="btn btn-success">Plot Route</button>
|
<button type="button" id="plotRouteBtn" class="btn btn-success">Plot Route</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Options accordion -->
|
||||||
<div class="accordion mb-2" id="optionsAccordion">
|
<div class="accordion mb-2" id="optionsAccordion">
|
||||||
<div class="accordion-item">
|
<div class="accordion-item">
|
||||||
<h2 class="accordion-header">
|
<h2 class="accordion-header">
|
||||||
@@ -179,7 +122,7 @@
|
|||||||
<input class="form-check-input" type="checkbox" id="avoidFerries">
|
<input class="form-check-input" type="checkbox" id="avoidFerries">
|
||||||
<label class="form-check-label" for="avoidFerries">Avoid ferries</label>
|
<label class="form-check-label" for="avoidFerries">Avoid ferries</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-check">
|
<div class="form-check mb-2">
|
||||||
<input class="form-check-input" type="checkbox" id="avoidUnpaved">
|
<input class="form-check-input" type="checkbox" id="avoidUnpaved">
|
||||||
<label class="form-check-label" for="avoidUnpaved">Avoid unpaved</label>
|
<label class="form-check-label" for="avoidUnpaved">Avoid unpaved</label>
|
||||||
</div>
|
</div>
|
||||||
@@ -210,7 +153,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
<div class="d-flex align-items-center gap-2">
|
<div class="d-flex align-items-center gap-2 flex-wrap">
|
||||||
<label class="form-label mb-0">Export</label>
|
<label class="form-label mb-0">Export</label>
|
||||||
<select id="exportMode" class="form-select form-select-sm" style="max-width: 180px;">
|
<select id="exportMode" class="form-select form-select-sm" style="max-width: 180px;">
|
||||||
<option value="both" selected>Track + Route</option>
|
<option value="both" selected>Track + Route</option>
|
||||||
@@ -221,6 +164,7 @@
|
|||||||
<input class="form-check-input" type="checkbox" id="voiceToggle">
|
<input class="form-check-input" type="checkbox" id="voiceToggle">
|
||||||
<label class="form-check-label" for="voiceToggle">Voice</label>
|
<label class="form-check-label" for="voiceToggle">Voice</label>
|
||||||
</div>
|
</div>
|
||||||
|
<button type="button" class="btn btn-warning btn-sm export-gpx">Export GPX</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -231,18 +175,23 @@
|
|||||||
<div class="section-title">Waypoints</div>
|
<div class="section-title">Waypoints</div>
|
||||||
<ul id="waypointList" class="list-group small"></ul>
|
<ul id="waypointList" class="list-group small"></ul>
|
||||||
</div>
|
</div>
|
||||||
|
</aside>
|
||||||
|
|
||||||
<div class="d-flex gap-2 d-none d-md-flex">
|
<!-- Panel toggle button (mobile portrait) -->
|
||||||
<button onclick="resetMarkers()" class="btn btn-outline-primary">Reset Points</button>
|
<button id="panelToggle" class="btn btn-outline-secondary btn-sm panel-toggle d-md-none" type="button" aria-expanded="true" title="Toggle panel">☰</button>
|
||||||
<button type="button" class="btn btn-warning export-gpx">Export GPX</button>
|
|
||||||
</div>
|
<!-- Floating actions (mobile) -->
|
||||||
|
<div class="floating-group d-md-none">
|
||||||
|
<button class="btn btn-primary fab" id="recenterBtn" title="Recenter">◎</button>
|
||||||
|
<button class="btn btn-primary" id="plotRouteBtn" title="Plot Route">Route</button>
|
||||||
|
<button class="btn btn-dark export-gpx" title="Export GPX">GPX</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Directions Bottom Sheet -->
|
<!-- Directions Bottom Sheet -->
|
||||||
<div id="directionsSheet" class="sheet">
|
<div id="directionsSheet" class="sheet" aria-live="polite">
|
||||||
<div class="card shadow-lg sheet-card">
|
<div class="card shadow-lg sheet-card">
|
||||||
<div class="card-body p-0">
|
<div class="card-body p-0">
|
||||||
<div class="handle"></div>
|
<div class="handle" role="separator" aria-label="Resize directions"></div>
|
||||||
<div class="sheet-header d-flex align-items-center justify-content-between px-3 py-2">
|
<div class="sheet-header d-flex align-items-center justify-content-between px-3 py-2">
|
||||||
<div class="fw-semibold">Directions</div>
|
<div class="fw-semibold">Directions</div>
|
||||||
<button class="btn btn-sm btn-outline-secondary" id="closeDirections">Close</button>
|
<button class="btn btn-sm btn-outline-secondary" id="closeDirections">Close</button>
|
||||||
@@ -254,6 +203,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Scripts -->
|
||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||||
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>
|
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>
|
||||||
<script src="/main.js"></script>
|
<script src="/main.js"></script>
|
||||||
|
|||||||
@@ -173,4 +173,90 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||||||
localStorage.setItem('freemoto-roundtrip-norepeat', roundTripNoRepeat.checked ? '1' : '0');
|
localStorage.setItem('freemoto-roundtrip-norepeat', roundTripNoRepeat.checked ? '1' : '0');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Swap start/end like Google Maps
|
||||||
|
(function(){
|
||||||
|
var swapBtn = document.getElementById('swapBtn');
|
||||||
|
if (!swapBtn) return;
|
||||||
|
function swapInputs() {
|
||||||
|
var s = document.getElementById('sourceInput');
|
||||||
|
var d = document.getElementById('destInput');
|
||||||
|
if (!s || !d) return;
|
||||||
|
// Swap visible values
|
||||||
|
var tmpVal = s.value; s.value = d.value; d.value = tmpVal;
|
||||||
|
// Swap lat/lon datasets
|
||||||
|
var sLat = s.dataset.lat, sLon = s.dataset.lon;
|
||||||
|
s.dataset.lat = d.dataset.lat || '';
|
||||||
|
s.dataset.lon = d.dataset.lon || '';
|
||||||
|
d.dataset.lat = sLat || '';
|
||||||
|
d.dataset.lon = sLon || '';
|
||||||
|
// If both look valid, trigger plot
|
||||||
|
var sourceLat = parseFloat(s.dataset.lat);
|
||||||
|
var sourceLon = parseFloat(s.dataset.lon);
|
||||||
|
var destLat = parseFloat(d.dataset.lat);
|
||||||
|
var destLon = parseFloat(d.dataset.lon);
|
||||||
|
if (!isNaN(sourceLat) && !isNaN(sourceLon) && !isNaN(destLat) && !isNaN(destLon)) {
|
||||||
|
var plot = document.getElementById('plotRouteBtn');
|
||||||
|
if (plot) plot.click();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
swapBtn.addEventListener('click', swapInputs);
|
||||||
|
})();
|
||||||
|
|
||||||
|
// Recenter FAB behavior
|
||||||
|
(function(){
|
||||||
|
var recenter = document.getElementById('recenterBtn');
|
||||||
|
if (!recenter) return;
|
||||||
|
recenter.addEventListener('click', function(){
|
||||||
|
if (navigator.geolocation) {
|
||||||
|
navigator.geolocation.getCurrentPosition(function(position){
|
||||||
|
var lat = position.coords.latitude;
|
||||||
|
var lon = position.coords.longitude;
|
||||||
|
map.setView([lat, lon], Math.max(map.getZoom(), 14));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|
||||||
|
// Mobile panel toggle (portrait)
|
||||||
|
try {
|
||||||
|
var panel = document.querySelector('.nav-panel');
|
||||||
|
var toggleBtn = document.getElementById('panelToggle');
|
||||||
|
function isSmallPortrait() {
|
||||||
|
var mqW = window.matchMedia('(max-width: 576px)');
|
||||||
|
var mqP = window.matchMedia('(orientation: portrait)');
|
||||||
|
return (mqW.matches && mqP.matches);
|
||||||
|
}
|
||||||
|
// Initialize collapsed state on load for small portrait
|
||||||
|
if (panel && isSmallPortrait()) {
|
||||||
|
panel.classList.add('collapsed');
|
||||||
|
if (toggleBtn) toggleBtn.setAttribute('aria-expanded', 'false');
|
||||||
|
}
|
||||||
|
// Auto-collapse panel when user hits Plot on small portrait
|
||||||
|
var plotBtn = document.getElementById('plotRouteBtn');
|
||||||
|
if (plotBtn) {
|
||||||
|
plotBtn.addEventListener('click', function(){
|
||||||
|
if (panel && isSmallPortrait()) {
|
||||||
|
panel.classList.add('collapsed');
|
||||||
|
if (toggleBtn) toggleBtn.setAttribute('aria-expanded', 'false');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (toggleBtn && panel) {
|
||||||
|
toggleBtn.addEventListener('click', function() {
|
||||||
|
panel.classList.toggle('collapsed');
|
||||||
|
var expanded = !panel.classList.contains('collapsed');
|
||||||
|
toggleBtn.setAttribute('aria-expanded', expanded ? 'true' : 'false');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// When orientation/viewport changes, ensure panel doesn't exceed screen
|
||||||
|
window.addEventListener('resize', function(){
|
||||||
|
if (!panel) return;
|
||||||
|
if (isSmallPortrait()) {
|
||||||
|
// Keep collapsed if it would cover map too much
|
||||||
|
if (!panel.classList.contains('collapsed')) panel.classList.add('collapsed');
|
||||||
|
if (toggleBtn) toggleBtn.setAttribute('aria-expanded', 'false');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (_) {}
|
||||||
});
|
});
|
||||||
280
app/web/static/styles.css
Normal file
280
app/web/static/styles.css
Normal file
@@ -0,0 +1,280 @@
|
|||||||
|
/* FreeMoto — Fresh responsive UI
|
||||||
|
Author: Cascade
|
||||||
|
*/
|
||||||
|
|
||||||
|
:root {
|
||||||
|
--panel-radius: 16px;
|
||||||
|
--pill-radius: 999px;
|
||||||
|
--glass-bg: rgba(255, 255, 255, 0.9);
|
||||||
|
--glass-border: rgba(16, 24, 40, 0.08);
|
||||||
|
--brand-start: #0ea5e9;
|
||||||
|
--brand-end: #6366f1;
|
||||||
|
--text-muted: #64748b;
|
||||||
|
--shadow-1: 0 8px 24px rgba(2, 8, 20, 0.08);
|
||||||
|
--shadow-2: 0 10px 30px rgba(2, 8, 20, 0.12);
|
||||||
|
}
|
||||||
|
|
||||||
|
html, body {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
background: linear-gradient(180deg, #f1f5f9, #e2e8f0);
|
||||||
|
color: #0f172a;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Map canvas */
|
||||||
|
#map {
|
||||||
|
position: absolute;
|
||||||
|
inset: 0;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Top App Bar */
|
||||||
|
.appbar {
|
||||||
|
position: fixed;
|
||||||
|
inset: 0 0 auto 0;
|
||||||
|
z-index: 1002;
|
||||||
|
background: linear-gradient(90deg, var(--brand-start), var(--brand-end));
|
||||||
|
color: #fff;
|
||||||
|
box-shadow: var(--shadow-1);
|
||||||
|
}
|
||||||
|
.appbar .navbar-brand {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
.appbar .btn {
|
||||||
|
color: #fff;
|
||||||
|
border-color: rgba(255, 255, 255, 0.6);
|
||||||
|
}
|
||||||
|
.appbar .badge {
|
||||||
|
background: rgba(255, 255, 255, 0.15);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Floating Control Panel (mobile: bottom pill, desktop: floating card) */
|
||||||
|
.nav-panel {
|
||||||
|
position: fixed;
|
||||||
|
left: 12px;
|
||||||
|
right: 12px;
|
||||||
|
bottom: 12px;
|
||||||
|
z-index: 1001;
|
||||||
|
background: var(--glass-bg);
|
||||||
|
border: 1px solid var(--glass-border);
|
||||||
|
backdrop-filter: blur(10px) saturate(160%);
|
||||||
|
border-radius: var(--pill-radius);
|
||||||
|
box-shadow: var(--shadow-2);
|
||||||
|
padding: 10px 12px;
|
||||||
|
transition: max-height 200ms ease, transform 200ms ease, padding 200ms ease;
|
||||||
|
}
|
||||||
|
.nav-panel .form-control,
|
||||||
|
.nav-panel .btn {
|
||||||
|
border-radius: var(--pill-radius);
|
||||||
|
}
|
||||||
|
.nav-panel .input-group > .input-group-text {
|
||||||
|
border-radius: var(--pill-radius) 0 0 var(--pill-radius);
|
||||||
|
}
|
||||||
|
.section-title {
|
||||||
|
font-weight: 600;
|
||||||
|
color: #334155;
|
||||||
|
}
|
||||||
|
#routeInfoCard {
|
||||||
|
font-size: 0.95rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Suggestions dropdown */
|
||||||
|
#sourceSuggestions,
|
||||||
|
#destSuggestions {
|
||||||
|
position: absolute;
|
||||||
|
top: 100%;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
z-index: 2000;
|
||||||
|
max-height: 240px;
|
||||||
|
overflow: auto;
|
||||||
|
border-radius: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Directions bottom sheet */
|
||||||
|
.sheet {
|
||||||
|
position: fixed;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
z-index: 1001;
|
||||||
|
}
|
||||||
|
.sheet-card {
|
||||||
|
border-radius: var(--panel-radius) var(--panel-radius) 0 0;
|
||||||
|
max-height: 60vh;
|
||||||
|
overflow: hidden;
|
||||||
|
box-shadow: var(--shadow-2);
|
||||||
|
}
|
||||||
|
.sheet .handle {
|
||||||
|
width: 44px;
|
||||||
|
height: 5px;
|
||||||
|
border-radius: var(--pill-radius);
|
||||||
|
background: #cbd5e1;
|
||||||
|
margin: 6px auto 6px;
|
||||||
|
}
|
||||||
|
.sheet-header {
|
||||||
|
position: sticky;
|
||||||
|
top: 0;
|
||||||
|
background: #fff;
|
||||||
|
z-index: 1;
|
||||||
|
padding: 4px 8px;
|
||||||
|
border-bottom: 1px solid #eef2f6;
|
||||||
|
}
|
||||||
|
.sheet-body {
|
||||||
|
overflow: auto;
|
||||||
|
max-height: calc(60vh - 42px);
|
||||||
|
}
|
||||||
|
#directionsSheet { display: none; }
|
||||||
|
.sheet.collapsed .sheet-card { max-height: 28vh; }
|
||||||
|
.sheet.collapsed .sheet-body { max-height: calc(28vh - 42px); }
|
||||||
|
|
||||||
|
/* Floating actions (mobile) */
|
||||||
|
.floating-group {
|
||||||
|
position: fixed;
|
||||||
|
right: 14px;
|
||||||
|
bottom: 90px;
|
||||||
|
z-index: 1002;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.floating-group .fab,
|
||||||
|
.floating-group .btn {
|
||||||
|
border-radius: 999px;
|
||||||
|
box-shadow: var(--shadow-2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.floating-group .fab {
|
||||||
|
width: 48px;
|
||||||
|
height: 48px;
|
||||||
|
padding: 0;
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Toggle button for control panel on mobile */
|
||||||
|
.panel-toggle {
|
||||||
|
position: fixed;
|
||||||
|
left: 14px;
|
||||||
|
bottom: 90px;
|
||||||
|
z-index: 1002;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Mobile portrait refinements */
|
||||||
|
@media (max-width: 576px) and (orientation: portrait) {
|
||||||
|
.nav-panel {
|
||||||
|
left: 8px;
|
||||||
|
right: 8px;
|
||||||
|
bottom: 8px;
|
||||||
|
max-height: 48vh;
|
||||||
|
overflow: visible; /* allow suggestion dropdowns to overflow */
|
||||||
|
}
|
||||||
|
.nav-panel.collapsed {
|
||||||
|
max-height: 56px; /* show a small header */
|
||||||
|
padding: 8px 12px;
|
||||||
|
pointer-events: none; /* let map interactions pass through when collapsed */
|
||||||
|
}
|
||||||
|
.floating-group { bottom: 76px; }
|
||||||
|
.panel-toggle { bottom: 76px; }
|
||||||
|
.section-title { font-size: 0.95rem; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Desktop layout refinements */
|
||||||
|
@media (min-width: 768px) {
|
||||||
|
.nav-panel {
|
||||||
|
top: 88px;
|
||||||
|
bottom: auto;
|
||||||
|
left: 24px;
|
||||||
|
right: auto;
|
||||||
|
width: 560px;
|
||||||
|
border-radius: var(--panel-radius);
|
||||||
|
padding: 16px;
|
||||||
|
}
|
||||||
|
.nav-panel .form-control,
|
||||||
|
.nav-panel .btn {
|
||||||
|
border-radius: var(--panel-radius);
|
||||||
|
}
|
||||||
|
.nav-panel .input-group > .input-group-text {
|
||||||
|
border-radius: var(--panel-radius) 0 0 var(--panel-radius);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Dark theme */
|
||||||
|
/* Improved dark mode for readability */
|
||||||
|
[data-theme="dark"] :root {
|
||||||
|
--glass-bg: rgba(17, 24, 39, 0.92); /* slate-900 w/ opacity */
|
||||||
|
--glass-border: rgba(255, 255, 255, 0.06);
|
||||||
|
--text-muted: #9ca3af; /* slate-400 */
|
||||||
|
}
|
||||||
|
[data-theme="dark"] body {
|
||||||
|
background: linear-gradient(180deg, #0b1220, #0f172a);
|
||||||
|
color: #e5e7eb; /* slate-200 */
|
||||||
|
}
|
||||||
|
[data-theme="dark"] a { color: #93c5fd; }
|
||||||
|
[data-theme="dark"] .appbar {
|
||||||
|
background: linear-gradient(90deg, #334155, #475569); /* slate gradient */
|
||||||
|
color: #e5e7eb;
|
||||||
|
}
|
||||||
|
[data-theme="dark"] .appbar .navbar-brand { color: #f1f5f9; }
|
||||||
|
[data-theme="dark"] .appbar .btn {
|
||||||
|
color: #e5e7eb;
|
||||||
|
border-color: rgba(148, 163, 184, 0.7);
|
||||||
|
}
|
||||||
|
[data-theme="dark"] .nav-panel {
|
||||||
|
background: var(--glass-bg);
|
||||||
|
border-color: var(--glass-border);
|
||||||
|
box-shadow: 0 10px 30px rgba(0,0,0,0.55);
|
||||||
|
}
|
||||||
|
[data-theme="dark"] .section-title { color: #e2e8f0; }
|
||||||
|
[data-theme="dark"] .form-control,
|
||||||
|
[data-theme="dark"] .input-group-text {
|
||||||
|
background: #111827; /* gray-900 */
|
||||||
|
color: #e5e7eb;
|
||||||
|
border-color: #374151; /* gray-700 */
|
||||||
|
}
|
||||||
|
[data-theme="dark"] .form-control::placeholder { color: #9ca3af; opacity: 1; }
|
||||||
|
[data-theme="dark"] .btn-outline-secondary { color: #e5e7eb; border-color: #93c5fd; }
|
||||||
|
[data-theme="dark"] .btn-primary { background-color: #4f46e5; border-color: #4338ca; }
|
||||||
|
[data-theme="dark"] .btn-success { background-color: #16a34a; border-color: #15803d; color: #f9fafb; }
|
||||||
|
[data-theme="dark"] .btn-warning { background-color: #f59e0b; border-color: #d97706; color: #111827; }
|
||||||
|
[data-theme="dark"] .badge,
|
||||||
|
[data-theme="dark"] .badge.text-bg-light { background-color: #374151 !important; color: #f9fafb !important; }
|
||||||
|
[data-theme="dark"] #summaryPill.badge { background-color: #1f2937 !important; color: #f9fafb !important; border: 1px solid #334155; }
|
||||||
|
[data-theme="dark"] .card,
|
||||||
|
[data-theme="dark"] .sheet-card { background: #0f172a; color: #e5e7eb; border-color: #334155; }
|
||||||
|
[data-theme="dark"] .list-group-item { background: #0b1220; color: #e5e7eb; border-color: #334155; }
|
||||||
|
[data-theme="dark"] .list-group-item-action:hover { background-color: #111827; color: #ffffff; }
|
||||||
|
[data-theme="dark"] .sheet-header { background: #0b1220; border-bottom-color: #334155; }
|
||||||
|
[data-theme="dark"] .handle { background: #475569; }
|
||||||
|
[data-theme="dark"] .alert { background-color: #0f172a; color: #e5e7eb; border-color: #334155; }
|
||||||
|
[data-theme="dark"] .alert-info { background-color: #0b1e2b; border-color: #1f3a5f; color: #dbeafe; }
|
||||||
|
[data-theme="dark"] .alert-secondary { background-color: #1f2937; border-color: #374151; color: #e5e7eb; }
|
||||||
|
|
||||||
|
/* Dark accordion */
|
||||||
|
[data-theme="dark"] .accordion-item { background-color: #0b1220; border: 1px solid #334155; }
|
||||||
|
[data-theme="dark"] .accordion-button { background-color: #0b1220; color: #e5e7eb; }
|
||||||
|
[data-theme="dark"] .accordion-button:not(.collapsed) { background-color: #0f172a; color: #ffffff; box-shadow: inset 0 -1px 0 #334155; }
|
||||||
|
[data-theme="dark"] .accordion-button:focus { box-shadow: 0 0 0 .2rem rgba(147, 197, 253, 0.25); border-color: #93c5fd; }
|
||||||
|
[data-theme="dark"] .accordion-body { background-color: #0f172a; color: #e5e7eb; }
|
||||||
|
|
||||||
|
/* Outline button hover/focus in dark */
|
||||||
|
[data-theme="dark"] .btn-outline-secondary:hover,
|
||||||
|
[data-theme="dark"] .btn-outline-secondary:focus { background-color: rgba(147, 197, 253, 0.12); color: #e5e7eb; border-color: #93c5fd; }
|
||||||
|
|
||||||
|
/* Range sliders in dark mode */
|
||||||
|
[data-theme="dark"] input[type="range"] { accent-color: #93c5fd; }
|
||||||
|
[data-theme="dark"] .form-range::-webkit-slider-thumb { background-color: #93c5fd; }
|
||||||
|
[data-theme="dark"] .form-range::-moz-range-thumb { background-color: #93c5fd; }
|
||||||
|
[data-theme="dark"] .form-range::-ms-thumb { background-color: #93c5fd; }
|
||||||
|
|
||||||
|
/* Suggestions dropdown contrast */
|
||||||
|
[data-theme="dark"] #sourceSuggestions .list-group-item,
|
||||||
|
[data-theme="dark"] #destSuggestions .list-group-item { background-color: #0f172a; color: #e5e7eb; border-color: #334155; }
|
||||||
|
[data-theme="dark"] #sourceSuggestions .list-group-item:hover,
|
||||||
|
[data-theme="dark"] #destSuggestions .list-group-item:hover { background-color: #111827; color: #ffffff; }
|
||||||
@@ -26,6 +26,6 @@ services:
|
|||||||
- "8002:8002"
|
- "8002:8002"
|
||||||
volumes:
|
volumes:
|
||||||
# Mount a host directory for custom files and tile caching if desired
|
# Mount a host directory for custom files and tile caching if desired
|
||||||
- ${PWD}/custom_files:/custom_files
|
- ./custom_files:/custom_files
|
||||||
environment:
|
environment:
|
||||||
- tile_urls=https://download.geofabrik.de/europe/germany-latest.osm.pbf
|
- tile_urls=https://download.geofabrik.de/europe/germany-latest.osm.pbf
|
||||||
|
|||||||
Reference in New Issue
Block a user