auto-sync: 2026-05-05 20:00:01

This commit is contained in:
Stream
2026-05-05 20:00:01 +03:00
parent 71401b7ebc
commit 4d0dc890ee
3 changed files with 3 additions and 93 deletions

View File

@@ -409,41 +409,6 @@ body.has-map-mode #sheet-backdrop.visible { pointer-events: none; }
#no-data-warning { display: none; position: fixed; bottom: 80px; left: 12px; right: 12px; background: var(--red-bg); border: 1px solid var(--red); border-radius: 12px; padding: 10px 14px; font-size: 13px; color: var(--red); z-index: 200; } #no-data-warning { display: none; position: fixed; bottom: 80px; left: 12px; right: 12px; background: var(--red-bg); border: 1px solid var(--red); border-radius: 12px; padding: 10px 14px; font-size: 13px; color: var(--red); z-index: 200; }
#no-data-warning.visible { display: block; } #no-data-warning.visible { display: block; }
/* ── Share Dialog (bottom sheet style) ────────── */
#share-dialog { position: fixed; inset: 0; z-index: 600; display: flex; align-items: flex-end; justify-content: center; }
.share-dialog-backdrop { position: fixed; inset: 0; background: var(--overlay); }
.share-dialog {
position: relative; width: 100%; max-width: 420px;
background: var(--surface);
border-radius: 20px 20px 0 0;
padding: 0 16px calc(20px + env(safe-area-inset-bottom, 0px));
z-index: 1;
box-shadow: 0 -4px 24px var(--shadow);
animation: shareSheetUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes shareSheetUp {
from { transform: translateY(100%); } to { transform: translateY(0); }
}
.share-dialog .sd-handle { width: 36px; height: 4px; background: var(--border); border-radius: 2px; margin: 12px auto 12px; }
.share-dialog .sd-title { font-size: 16px; font-weight: 700; color: var(--text); text-align: center; margin-bottom: 4px; }
.share-dialog .sd-desc { font-size: 13px; color: var(--text2); text-align: center; margin-bottom: 14px; }
.share-dialog .sd-row { display: flex; gap: 8px; margin-bottom: 8px; }
.share-dialog .sd-btn {
flex: 1; height: 48px; border: none; border-radius: 14px;
background: var(--surface2); color: var(--text);
font-size: 14px; font-weight: 600; cursor: pointer;
display: inline-flex; align-items: center; justify-content: center; gap: 8px;
transition: background 0.15s, transform 0.1s;
-webkit-tap-highlight-color: transparent;
}
.share-dialog .sd-btn:active { transform: scale(0.97); background: var(--surface3); }
.share-dialog .sd-btn .sd-icon { font-size: 20px; line-height: 1; }
.share-dialog .sd-btn-primary { background: var(--accent); color: #fff; }
.share-dialog .sd-btn-primary:active { background: var(--accent-hover); }
.share-dialog .sd-btn-full { width: 100%; flex: none; margin-bottom: 8px; }
.share-dialog .sd-cancel { background: var(--surface2); color: var(--text2); }
.share-dialog .sd-cancel:active { background: var(--surface3); }
/* ── Skeleton Loading ────────────────────────── */ /* ── Skeleton Loading ────────────────────────── */
.skeleton { .skeleton {
background: linear-gradient(90deg, var(--surface2) 0%, var(--surface3) 50%, var(--surface2) 100%); background: linear-gradient(90deg, var(--surface2) 0%, var(--surface3) 50%, var(--surface2) 100%);

View File

@@ -796,60 +796,6 @@ function downloadGPX() {
URL.revokeObjectURL(url); URL.revokeObjectURL(url);
} }
async function shareRoute() {
const route = routeResults[activeRouteIdx];
if (!route) { alert('Сначала построй маршрут'); return; }
const distKm = (route.distance_m / 1000).toFixed(0);
const dirtPct = route.stats ? route.stats.dirt_total_pct : 0;
const shareText = `Эндуро маршрут: ${distKm} км, ${dirtPct}% грунт`;
const dialog = document.getElementById('share-dialog');
if (dialog) dialog.remove();
const d = document.createElement('div');
d.id = 'share-dialog';
d.innerHTML = `
<div class="sd-backdrop" onclick="closeShareDialog()"></div>
<div class="sd-sheet">
<div class="sd-handle"></div>
<div class="sd-title">Поделиться маршрутом</div>
<div class="sd-desc">${shareText}</div>
<div class="sd-btn-row">
<button class="sd-btn sd-btn-primary" onclick="shareTelegram()"><span class="sd-icon">✈️</span> Telegram</button>
<button class="sd-btn sd-btn-primary" onclick="shareWhatsApp()"><span class="sd-icon">💬</span> WhatsApp</button>
</div>
<button class="sd-btn sd-btn-full" onclick="downloadGPX(); closeShareDialog();"><span class="sd-icon">⬇️</span> Скачать GPX файл</button>
<button class="sd-btn sd-cancel" onclick="closeShareDialog()">Отмена</button>
</div>
`;
document.body.appendChild(d);
}
function closeShareDialog() {
const el = document.getElementById('share-dialog');
if (el) el.remove();
}
function shareTelegram() {
const url = 'https://t.me/share/url?url=' + encodeURIComponent(window.location.href) + '&text=' + encodeURIComponent('Маршрут эндуро: ' + window.location.href);
window.open(url, '_blank');
closeShareDialog();
}
function shareWhatsApp() {
const url = 'https://wa.me/?text=' + encodeURIComponent('Маршрут эндуро: ' + window.location.href);
window.open(url, '_blank');
closeShareDialog();
}
function shareNative() {
closeShareDialog();
if (navigator.share) {
navigator.share({ title: 'Enduro Route', text: window.location.href }).catch(() => {});
}
}
// ─── Флажки / именованные метки ──────────────────────────────────── // ─── Флажки / именованные метки ────────────────────────────────────
const MARKER_ICONS = ['🚩', '⛺', '🔧', '⛽', '💧', '📍']; const MARKER_ICONS = ['🚩', '⛺', '🔧', '⛽', '💧', '📍'];
const MARKERS_KEY = 'enduro_markers'; const MARKERS_KEY = 'enduro_markers';

View File

@@ -60,11 +60,10 @@
<div class="sheet-header"> <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> <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> <h2>Маршрут</h2>
<!-- Поделиться --> <!-- Скачать GPX -->
<button class="sheet-icon-btn" onclick="shareRoute()" title="Поделиться"> <button class="sheet-icon-btn" onclick="downloadGPX()" title="Скачать GPX">
<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"> <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">
<circle cx="18" cy="5" r="3"/><circle cx="6" cy="12" r="3"/><circle cx="18" cy="19" r="3"/> <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/>
<line x1="8.59" y1="13.51" x2="15.42" y2="17.49"/><line x1="15.41" y1="6.51" x2="8.59" y2="10.49"/>
</svg> </svg>
</button> </button>
<!-- Сброс --> <!-- Сброс -->