koleo-izochrona/frontend/index.html

135 lines
5.4 KiB
HTML

<!DOCTYPE html>
<html lang="pl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Izochrona - Mapa połączeń kolejowych</title>
<!-- Leaflet CSS -->
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" />
<!-- Custom CSS -->
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
<aside class="sidebar">
<h1>🚂 Izochrona</h1>
<p class="subtitle">Mapa dostępności połączeń kolejowych</p>
<div class="config-section">
<details>
<summary style="cursor: pointer; font-size: 13px; margin-bottom: 10px;">⚙️ Konfiguracja API</summary>
<div style="font-size: 12px; margin-top: 8px;">
<label style="display: block; margin-bottom: 4px;">Adres backendu:</label>
<input
type="text"
id="api-url-input"
placeholder="http://hostname:5000/api"
style="width: 100%; padding: 6px; font-size: 11px; margin-bottom: 6px;"
/>
<div style="display: flex; gap: 4px;">
<button id="api-url-save" style="flex: 1; padding: 6px; font-size: 11px;">Zapisz</button>
<button id="api-url-reset" style="flex: 1; padding: 6px; font-size: 11px;">Reset</button>
</div>
<p id="api-url-status" style="margin-top: 6px; color: #666;"></p>
</div>
</details>
</div>
<div class="search-section">
<h3>Wyszukaj stację początkową</h3>
<input
type="text"
id="station-search"
placeholder="np. Wrocław Główny"
autocomplete="off"
/>
<div id="search-results" class="search-results"></div>
</div>
<div class="selected-station" id="selected-station" style="display: none;">
<h3>Wybrana stacja</h3>
<p id="station-name"></p>
<button id="clear-selection">Wyczyść wybór</button>
</div>
<div class="time-controls" id="time-controls" style="display: none;">
<h3>Przedziały czasowe (minuty)</h3>
<div class="checkbox-group">
<label>
<input type="checkbox" value="30" checked> 30 min
</label>
<label>
<input type="checkbox" value="60" checked> 60 min (1h)
</label>
<label>
<input type="checkbox" value="90" checked> 90 min (1.5h)
</label>
<label>
<input type="checkbox" value="120" checked> 120 min (2h)
</label>
<label>
<input type="checkbox" value="180"> 180 min (3h)
</label>
</div>
<div style="margin-top: 12px;">
<label style="font-size: 13px; display: block; margin-bottom: 4px;">
Własne wartości (oddziel przecinkami):
</label>
<input
type="text"
id="custom-times"
placeholder="np. 45, 75, 150"
style="width: 100%; padding: 8px; border: 1px solid #ced4da; border-radius: 4px; font-size: 13px;"
/>
<p style="font-size: 11px; color: #6c757d; margin-top: 4px;">
💡 Możesz wpisać dowolne wartości w minutach
</p>
</div>
<button id="calculate-btn" class="btn-primary">Oblicz izochrony</button>
</div>
<div class="legend" id="legend" style="display: none;">
<h3>Legenda</h3>
<!-- Dynamicznie generowane w JS -->
</div>
<div class="stats" id="stats" style="display: none;">
<h3>Statystyki</h3>
<p id="stats-content"></p>
</div>
<div class="info">
<h4>Jak używać?</h4>
<ol>
<li>Wyszukaj stację początkową w polu powyżej</li>
<li>Wybierz przedziały czasowe</li>
<li>Kliknij "Oblicz izochrony"</li>
<li>Zobacz obszary dostępne w wybranym czasie!</li>
</ol>
<p class="data-source">
Dane: <a href="https://mkuran.pl/gtfs/" target="_blank">mkuran.pl/gtfs</a>
</p>
</div>
</aside>
<main class="map-container">
<div id="map"></div>
<div id="loading" class="loading" style="display: none;">
<div class="spinner"></div>
<p>Obliczanie izochron...</p>
</div>
</main>
</div>
<!-- Leaflet JS -->
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>
<!-- Custom JS -->
<script src="map.js"></script>
</body>
</html>