auto-sync: 2026-05-05 09:40:01

This commit is contained in:
Stream
2026-05-05 09:40:01 +03:00
parent deb4633e91
commit 2d0021b8cc
3 changed files with 60 additions and 25 deletions

View File

@@ -73,6 +73,12 @@ html, body {
top: max(env(safe-area-inset-top, 0px), 12px);
left: 12px; right: 12px;
height: 50px;
/* Push MapLibre nav controls below search bar */
}
.maplibregl-ctrl-top-left {
top: calc(max(env(safe-area-inset-top, 0px), 12px) + 58px) !important;
left: 12px !important;
}
background: var(--surface);
border: 1px solid var(--border);
border-radius: 14px;

View File

@@ -201,6 +201,11 @@ function closeSheet(id) {
}
}
// Close sheet panel but keep the mode active (route stays on map)
function minimizeSheet(id) {
closeSheet(id);
}
function closeAllSheets() {
document.querySelectorAll('.bottom-sheet.open').forEach(s => {
s.classList.remove('open');
@@ -383,20 +388,29 @@ function getBasePath() {
// ─── Режим маршрута ────────────────────────────────────────────────
function toggleRouteMode() {
routeMode = !routeMode;
const btn = document.getElementById('tb-route');
const sheet = document.getElementById('sheet-route');
if (routeMode) {
// Already in route mode
if (sheet.classList.contains('open')) {
// Sheet is open → close sheet but keep route on map
minimizeSheet('sheet-route');
} else {
// Sheet already closed → exit route mode entirely (clear route)
routeMode = false;
btn.classList.remove('active');
clearRoute();
window._map.getCanvas().style.cursor = '';
}
} else {
// Enter route mode
deactivateAllModes();
routeMode = true;
btn.classList.add('active');
openSheet('sheet-route');
clearRoute();
window._map.getCanvas().style.cursor = 'crosshair';
} else {
btn.classList.remove('active');
closeSheet('sheet-route');
clearRoute();
window._map.getCanvas().style.cursor = '';
}
updateMapModeClass();
}
@@ -1168,18 +1182,23 @@ let reconCenter = null;
let reconRadius = 20;
function toggleReconMode() {
reconMode = !reconMode;
const btn = document.getElementById('tb-recon');
const sheet = document.getElementById('sheet-recon');
if (reconMode) {
if (sheet.classList.contains('open')) {
minimizeSheet('sheet-recon');
} else {
reconMode = false;
btn.classList.remove('active');
window._map.getCanvas().style.cursor = '';
clearRecon();
}
} else {
deactivateAllModes();
reconMode = true;
btn.classList.add('active');
window._map.getCanvas().style.cursor = 'crosshair';
openSheet('sheet-recon');
} else {
btn.classList.remove('active');
window._map.getCanvas().style.cursor = '';
clearRecon();
}
updateMapModeClass();
}
@@ -1275,9 +1294,18 @@ let linkPoints = [];
let linkMarkers = [];
function toggleLinkMode() {
linkMode = !linkMode;
const btn = document.getElementById('tb-link');
const sheet = document.getElementById('sheet-link');
if (linkMode) {
if (sheet.classList.contains('open')) {
minimizeSheet('sheet-link');
} else {
linkMode = false;
btn.classList.remove('active');
window._map.getCanvas().style.cursor = '';
clearLink();
}
} else {
deactivateAllModes();
linkMode = true;
btn.classList.add('active');
@@ -1288,10 +1316,6 @@ function toggleLinkMode() {
linkPoints = [];
linkMarkers.forEach(m => m.remove());
linkMarkers = [];
} else {
btn.classList.remove('active');
window._map.getCanvas().style.cursor = '';
clearLink();
}
updateMapModeClass();
}
@@ -1426,9 +1450,18 @@ let scenicRoutes = [];
let activeScenicIdx = 0;
function toggleScenicMode() {
scenicMode = !scenicMode;
const btn = document.getElementById('tb-scenic');
const sheet = document.getElementById('sheet-scenic');
if (scenicMode) {
if (sheet.classList.contains('open')) {
minimizeSheet('sheet-scenic');
} else {
scenicMode = false;
btn.classList.remove('active');
window._map.getCanvas().style.cursor = '';
clearScenic();
}
} else {
deactivateAllModes();
scenicMode = true;
btn.classList.add('active');
@@ -1436,10 +1469,6 @@ function toggleScenicMode() {
openSheet('sheet-scenic');
document.getElementById('scenic-status').textContent = 'Тапни точку старта на карте';
document.getElementById('btn-build-scenic').style.display = 'none';
} else {
btn.classList.remove('active');
window._map.getCanvas().style.cursor = '';
clearScenic();
}
updateMapModeClass();
}

View File

@@ -60,7 +60,7 @@
<div class="sheet-header">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14.5 10c-.83 0-1.5-.67-1.5-1.5v-5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5v5c0 .83-.67 1.5-1.5 1.5z"/><path d="M20.5 10H19V8.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5-.67 1.5-1.5 1.5z"/><path d="M9.5 14c.83 0 1.5.67 1.5 1.5v5c0 .83-.67 1.5-1.5 1.5S8 21.33 8 20.5v-5c0-.83.67-1.5 1.5-1.5z"/><path d="M3.5 14H5v1.5c0 .83-.67 1.5-1.5 1.5S2 16.33 2 15.5 2.67 14 3.5 14z"/><path d="M14 5H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-3"/></svg>
<h2>Маршрут</h2>
<button class="sheet-close" onclick="toggleRouteMode()">
<button class="sheet-close" onclick="minimizeSheet('sheet-route')">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18M6 6l12 12"/></svg>
</button>
</div>
@@ -91,7 +91,7 @@
<div class="sheet-header">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M2 12C2 6.5 6.5 2 12 2a10 10 0 0 1 8 4"/><path d="M5 19.5C5.5 18 6 15 6 12c0-.7.12-1.37.34-2"/><path d="M17.29 21.02c.12-.6.43-2.3.5-3.02"/><path d="M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4"/><path d="M8.65 22c.21-.66.45-1.32.57-2"/><path d="M14 13.12c0 2.38 0 6.38-1 8.88"/><path d="M2 16h.01"/><path d="M21.8 16c.2-2 .131-5.354 0-6"/><path d="M9 6.8a6 6 0 0 1 9 5.2c0 .47 0 1.17-.02 2"/></svg>
<h2>Разведка</h2>
<button class="sheet-close" onclick="toggleReconMode()">
<button class="sheet-close" onclick="minimizeSheet('sheet-recon')">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18M6 6l12 12"/></svg>
</button>
</div>
@@ -135,7 +135,7 @@
<div class="sheet-header">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z"/><path d="M5 3v4M19 17v4M3 5h4M17 19h4"/></svg>
<h2>Красивый маршрут</h2>
<button class="sheet-close" onclick="toggleScenicMode()">
<button class="sheet-close" onclick="minimizeSheet('sheet-scenic')">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18M6 6l12 12"/></svg>
</button>
</div>
@@ -168,7 +168,7 @@
<div class="sheet-header">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="6" y1="3" x2="6" y2="15"/><circle cx="18" cy="6" r="3"/><circle cx="6" cy="18" r="3"/><path d="M18 9a9 9 0 0 1-9 9"/></svg>
<h2>Связка</h2>
<button class="sheet-close" onclick="toggleLinkMode()">
<button class="sheet-close" onclick="minimizeSheet('sheet-link')">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18M6 6l12 12"/></svg>
</button>
</div>