feat(ui): organize desktop controls into single-row primary bar with categorized tools dropdown (v21)

This commit is contained in:
2026-09-12 11:41:19 -07:00
parent b21a306790
commit c1228a8908
4 changed files with 305 additions and 82 deletions
+191 -7
View File
@@ -702,25 +702,154 @@ body {
box-shadow: 0 0 10px rgba(34, 211, 238, 0.4);
}
/* Floating Top Controls (Simulator, Audio, GPS) */
/* Floating Top Controls (Single-Row Primary Bar + Tools Dropdown on Desktop) */
.map-top-controls {
position: absolute;
top: 20px;
left: 360px;
right: 20px;
left: auto;
z-index: 500;
display: flex;
align-items: center;
justify-content: flex-end;
gap: 10px;
flex-wrap: wrap;
flex-direction: column;
align-items: flex-end;
pointer-events: none;
}
.map-top-controls > * {
.controls-primary-bar {
display: flex;
align-items: center;
gap: 6px;
background: rgba(13, 17, 26, 0.92);
backdrop-filter: blur(16px);
-webkit-backdrop-filter: blur(16px);
padding: 5px 8px;
border-radius: var(--radius-lg);
border: 1px solid rgba(56, 189, 248, 0.28);
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65);
pointer-events: auto;
}
.controls-primary-bar .btn-hud-action {
padding: 7px 13px;
font-size: 0.82rem;
font-weight: 600;
border-radius: 8px;
background: rgba(255, 255, 255, 0.04);
border: 1px solid rgba(255, 255, 255, 0.08);
color: #f1f5f9;
box-shadow: none;
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
white-space: nowrap;
}
.controls-primary-bar .btn-hud-action:hover {
background: rgba(56, 189, 248, 0.15);
border-color: rgba(56, 189, 248, 0.4);
color: #38bdf8;
transform: translateY(-1px);
}
.controls-primary-bar .btn-hud-action.active {
background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
color: #ffffff;
border-color: rgba(255, 255, 255, 0.4);
box-shadow: 0 0 14px rgba(239, 68, 68, 0.5);
}
.controls-primary-bar .btn-tools-dropdown-trigger {
background: rgba(56, 189, 248, 0.1);
border-color: rgba(56, 189, 248, 0.35);
color: #38bdf8;
}
.controls-primary-bar .btn-tools-dropdown-trigger:hover,
.controls-primary-bar .btn-tools-dropdown-trigger.active {
background: rgba(56, 189, 248, 0.25);
border-color: #38bdf8;
color: #ffffff;
}
/* Dropdown Menu for Secondary Tools on Desktop */
.controls-tools-menu {
display: none;
position: absolute;
top: 50px;
right: 0;
width: 280px;
background: rgba(13, 17, 26, 0.96);
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
border: 1px solid rgba(56, 189, 248, 0.3);
border-radius: var(--radius-lg);
padding: 14px;
box-shadow: 0 14px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(6, 182, 212, 0.15);
pointer-events: auto;
z-index: 600;
animation: dropdown-fade-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.controls-tools-menu.is-open {
display: flex;
flex-direction: column;
gap: 12px;
}
@keyframes dropdown-fade-in {
from { opacity: 0; transform: translateY(-8px); }
to { opacity: 1; transform: translateY(0); }
}
.controls-tools-menu .drawer-header {
display: none;
}
.tools-group {
display: flex;
flex-direction: column;
gap: 5px;
padding-bottom: 8px;
border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.tools-group:last-child {
padding-bottom: 0;
border-bottom: none;
}
.tools-group-label {
font-size: 0.65rem;
font-weight: 700;
letter-spacing: 0.8px;
color: #64748b;
padding: 2px 6px;
text-transform: uppercase;
}
.controls-tools-menu .btn-tool-item {
width: 100%;
justify-content: flex-start;
padding: 9px 12px;
font-size: 0.82rem;
border-radius: 8px;
background: rgba(255, 255, 255, 0.04);
border: 1px solid rgba(255, 255, 255, 0.07);
color: #e2e8f0;
box-shadow: none;
transition: all 0.18s ease;
white-space: nowrap;
}
.controls-tools-menu .btn-tool-item:hover {
background: rgba(56, 189, 248, 0.15);
border-color: rgba(56, 189, 248, 0.35);
color: #38bdf8;
transform: translateX(3px);
}
.controls-tools-menu .btn-tool-item:active {
transform: scale(0.98);
}
.btn-hud-action {
padding: 9px 16px;
background: var(--bg-hud);
@@ -2555,6 +2684,7 @@ body {
.map-top-controls.open-drawer {
transform: translateY(0);
pointer-events: auto;
}
.drawer-header {
@@ -2586,6 +2716,60 @@ body {
justify-content: center;
}
/* Mobile Controls Drawer Adaptations */
.controls-primary-bar {
display: grid !important;
grid-template-columns: 1fr 1fr;
gap: 8px;
width: 100%;
background: transparent !important;
border: none !important;
padding: 0 !important;
box-shadow: none !important;
backdrop-filter: none !important;
-webkit-backdrop-filter: none !important;
margin-bottom: 6px;
}
.controls-primary-bar #btn-desktop-tools-menu {
display: none !important;
}
.controls-primary-bar .btn-hud-action {
width: 100%;
justify-content: center;
padding: 11px 10px;
font-size: 0.82rem;
background: rgba(30, 41, 59, 0.85);
border-radius: 10px;
border: 1px solid rgba(255, 255, 255, 0.1);
}
.controls-tools-menu {
display: flex !important;
flex-direction: column !important;
position: static !important;
width: 100% !important;
background: transparent !important;
border: none !important;
box-shadow: none !important;
padding: 0 !important;
animation: none !important;
gap: 12px !important;
backdrop-filter: none !important;
-webkit-backdrop-filter: none !important;
}
.controls-tools-menu .btn-tool-item {
width: 100%;
justify-content: flex-start;
padding: 11px 14px;
font-size: 0.86rem;
background: rgba(30, 41, 59, 0.7);
border-radius: 10px;
border: 1px solid rgba(255, 255, 255, 0.08);
}
.btn-hud-action {
width: 100%;
justify-content: flex-start;
+69 -59
View File
@@ -54,7 +54,7 @@
<meta name="apple-mobile-web-app-title" content="FlockRadar">
<!-- Main Stylesheet -->
<link rel="stylesheet" href="css/styles.css?v=20">
<link rel="stylesheet" href="css/styles.css?v=21">
</head>
<body>
@@ -297,76 +297,86 @@
</aside>
<!-- Floating Navigation & Driving Controls (Drawer on Mobile, Top-Right on Desktop) -->
<!-- Floating Navigation & Driving Controls (Desktop Single-Row Bar + Categorized Tools Dropdown / Mobile Drawer) -->
<div class="map-top-controls" id="map-top-controls">
<!-- Mobile Drawer Header -->
<div class="drawer-header" id="drawer-header">
<span class="drawer-title" style="display: flex; align-items: center; gap: 8px;">
<svg class="flock-svg flock-svg-md" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg>
Driving Controls & Settings
Driving Controls & Tools
</span>
<button type="button" id="btn-close-tools" class="btn-close-drawer" aria-label="Close controls">
<svg class="flock-svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
</button>
</div>
<button id="btn-follow-car" class="btn-hud-action active" title="Automatically keep map centered on your vehicle">
<svg class="flock-svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><circle cx="12" cy="12" r="6"/><circle cx="12" cy="12" r="2"/></svg>
<span>Follow Car: ON</span>
</button>
<!-- Primary 1-Click Driving Bar (Desktop) -->
<div class="controls-primary-bar" id="controls-primary-bar">
<button id="btn-live-gps" class="btn-hud-action btn-action-gps" title="Start continuous real-time GPS tracking on your device">
<svg class="flock-svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="2"/><path d="M16.24 7.76a6 6 0 0 1 0 8.49m-8.48-.01a6 6 0 0 1 0-8.49m11.31-2.82a10 10 0 0 1 0 14.14m-14.14 0a10 10 0 0 1 0-14.14"/></svg>
<span id="btn-live-gps-text">Live GPS Drive</span>
</button>
<button id="btn-live-gps" class="btn-hud-action" title="Start continuous real-time GPS tracking on your device">
<svg class="flock-svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="2"/><path d="M16.24 7.76a6 6 0 0 1 0 8.49m-8.48-.01a6 6 0 0 1 0-8.49m11.31-2.82a10 10 0 0 1 0 14.14m-14.14 0a10 10 0 0 1 0-14.14"/></svg>
<span>Live GPS Drive</span>
</button>
<button id="btn-follow-car" class="btn-hud-action active" title="Automatically keep map centered on your vehicle">
<svg class="flock-svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><circle cx="12" cy="12" r="6"/><circle cx="12" cy="12" r="2"/></svg>
<span>Follow Car: ON</span>
</button>
<button id="btn-map-layer" class="btn-hud-action" title="Toggle between Dark Canvas and Satellite View">
<svg class="flock-svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polygon points="12 2 2 7 12 12 22 7 12 2"/><polyline points="2 17 12 22 22 17"/><polyline points="2 12 12 17 22 12"/></svg>
<span>Satellite / Dark</span>
</button>
<button id="btn-map-layer" class="btn-hud-action" title="Toggle between Dark Canvas and Satellite View">
<svg class="flock-svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polygon points="12 2 2 7 12 12 22 7 12 2"/><polyline points="2 17 12 22 22 17"/><polyline points="2 12 12 17 22 12"/></svg>
<span>Satellite / Dark</span>
</button>
<button id="btn-fullscreen-mount" class="btn-hud-action" title="Toggle Fullscreen Dashboard Mount Mode">
<svg class="flock-svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"/></svg>
<span>Dashboard Fullscreen</span>
</button>
<button id="btn-fullscreen-mount" class="btn-hud-action" title="Toggle Fullscreen Dashboard Mount Mode">
<svg class="flock-svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"/></svg>
<span>Fullscreen</span>
</button>
<button id="btn-drawer-support" class="btn-hud-action btn-support-highlight" title="Help support developer ($10/mo, $10, $20, $50)">
<svg class="flock-svg" viewBox="0 0 24 24" fill="currentColor" stroke="none"><path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/></svg>
<span>Help Support Developer</span>
</button>
<!-- Desktop Tools Dropdown Trigger -->
<button type="button" id="btn-desktop-tools-menu" class="btn-hud-action btn-tools-dropdown-trigger" title="Open Simulation, Pins & Audio Tools">
<svg class="flock-svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg>
<span>Tools ▾</span>
</button>
</div>
<button id="btn-test-camera" class="btn-hud-action" title="Drop a test camera 400ft ahead of your current location to test proximity alerts">
<svg class="flock-svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"/></svg>
<span>Place Camera 400ft Ahead</span>
</button>
<!-- Categorized Dropdown (Desktop) / Slide-Up Drawer (Mobile) -->
<div class="controls-tools-menu" id="controls-tools-menu">
<div class="tools-group">
<div class="tools-group-label">SIMULATION & DRIVES</div>
<button id="btn-sim-drive" class="btn-hud-action btn-tool-item" title="Simulate driving through Palmdale camera corridors">
<svg class="flock-svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polygon points="5 3 19 12 5 21 5 3"/></svg>
<span>Simulate Palmdale Drive</span>
</button>
<button id="btn-reset-sim" class="btn-hud-action btn-tool-item" title="Reset drive position">
<svg class="flock-svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"/><path d="M3 3v5h5"/></svg>
<span>Reset Car</span>
</button>
</div>
<button id="btn-admin-manage-pins" class="btn-hud-action" title="Admin: Manage and remove cameras you placed (the 1,439 official municipal portals are protected)">
<svg class="flock-svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="3 6 5 6 21 6"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/><line x1="10" y1="11" x2="10" y2="17"/><line x1="14" y1="11" x2="14" y2="17"/></svg>
<span>Admin: Placed Pins</span>
</button>
<div class="tools-group">
<div class="tools-group-label">RADAR TESTING & PINS</div>
<button id="btn-test-camera" class="btn-hud-action btn-tool-item" title="Drop a test camera 400ft ahead of your current location to test proximity alerts">
<svg class="flock-svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"/></svg>
<span>Place Camera 400ft Ahead</span>
</button>
<button id="btn-admin-manage-pins" class="btn-hud-action btn-tool-item" title="Admin: Manage and remove cameras you placed">
<svg class="flock-svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="3 6 5 6 21 6"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/><line x1="10" y1="11" x2="10" y2="17"/><line x1="14" y1="11" x2="14" y2="17"/></svg>
<span>Admin: Placed Pins</span>
</button>
</div>
<button id="btn-test-alert" class="btn-hud-action" title="Immediately test voice alert and radar siren">
<svg class="flock-svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"/><path d="M19.07 4.93a10 10 0 0 1 0 14.14"/><path d="M15.54 8.46a5 5 0 0 1 0 7.07"/></svg>
<span>Test Alert Voice</span>
</button>
<button id="btn-sim-drive" class="btn-hud-action" title="Simulate driving through Palmdale camera corridors">
<svg class="flock-svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polygon points="5 3 19 12 5 21 5 3"/></svg>
<span>Simulate Palmdale Drive</span>
</button>
<button id="btn-reset-sim" class="btn-hud-action" title="Reset drive position">
<svg class="flock-svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"/><path d="M3 3v5h5"/></svg>
<span>Reset Car</span>
</button>
<button id="btn-mute-sound" class="btn-hud-action" title="Toggle audio alert chime and voice">
<svg class="flock-svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"/><path d="M19.07 4.93a10 10 0 0 1 0 14.14"/><path d="M15.54 8.46a5 5 0 0 1 0 7.07"/></svg>
<span>Sound: ON</span>
</button>
<button id="btn-mobile-connect" class="btn-hud-action" title="Show mobile network link to open on phone in car">
<svg class="flock-svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="5" y="2" width="14" height="20" rx="2" ry="2"/><line x1="12" y1="18" x2="12.01" y2="18"/></svg>
<span>Phone Link</span>
</button>
<div class="tools-group">
<div class="tools-group-label">DIAGNOSTICS & SYSTEM</div>
<button id="btn-test-alert" class="btn-hud-action btn-tool-item" title="Immediately test voice alert and radar siren">
<svg class="flock-svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"/><path d="M19.07 4.93a10 10 0 0 1 0 14.14"/><path d="M15.54 8.46a5 5 0 0 1 0 7.07"/></svg>
<span>Test Alert Voice</span>
</button>
<button id="btn-mobile-connect" class="btn-hud-action btn-tool-item" title="Show mobile network link to open on phone in car">
<svg class="flock-svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="5" y="2" width="14" height="20" rx="2" ry="2"/><line x1="12" y1="18" x2="12.01" y2="18"/></svg>
<span>Phone Link</span>
</button>
</div>
</div>
</div>
<!-- Backdrop Overlay for Mobile Drawer -->
@@ -1303,11 +1313,11 @@
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js" integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo=" crossorigin=""></script>
<!-- Data & Application Logic with Cache Busting -->
<script src="data/portals.js?v=20"></script>
<script src="js/icons.js?v=20"></script>
<script src="js/auth.js?v=20"></script>
<script src="js/radar.js?v=20"></script>
<script src="js/app.js?v=20"></script>
<script src="data/portals.js?v=21"></script>
<script src="js/icons.js?v=21"></script>
<script src="js/auth.js?v=21"></script>
<script src="js/radar.js?v=21"></script>
<script src="js/app.js?v=21"></script>
<!-- Service Worker Instant Cache Invalidation -->
<script>
+32 -3
View File
@@ -216,14 +216,16 @@
btnAdminClearAllPlaced: document.getElementById('btn-admin-clear-all-placed'),
btnAdminManagePins: document.getElementById('btn-admin-manage-pins'),
// Mobile Driving Controls & Drawer
// Mobile & Desktop Driving Controls & Drawer
driverHud: document.getElementById('driver-hud'),
btnToggleTools: document.getElementById('btn-toggle-tools'),
btnToggleHudDetails: document.getElementById('btn-toggle-hud-details'),
hudDetailsArrow: document.getElementById('hud-details-arrow'),
mapTopControls: document.getElementById('map-top-controls'),
btnCloseTools: document.getElementById('btn-close-tools'),
toolsOverlay: document.getElementById('tools-overlay')
toolsOverlay: document.getElementById('tools-overlay'),
btnDesktopToolsMenu: document.getElementById('btn-desktop-tools-menu'),
controlsToolsMenu: document.getElementById('controls-tools-menu')
};
// --- INITIALIZATION ---
@@ -2487,11 +2489,38 @@
if (el.btnCloseTools) el.btnCloseTools.addEventListener('click', closeToolsDrawer);
if (el.toolsOverlay) el.toolsOverlay.addEventListener('click', closeToolsDrawer);
// Desktop Tools Dropdown Toggle
if (el.btnDesktopToolsMenu && el.controlsToolsMenu) {
el.btnDesktopToolsMenu.addEventListener('click', (e) => {
e.stopPropagation();
const isOpen = el.controlsToolsMenu.classList.toggle('is-open');
el.btnDesktopToolsMenu.classList.toggle('active', isOpen);
});
// Close desktop dropdown on outside click
document.addEventListener('click', (e) => {
if (!el.controlsToolsMenu.contains(e.target) && !el.btnDesktopToolsMenu.contains(e.target)) {
el.controlsToolsMenu.classList.remove('is-open');
el.btnDesktopToolsMenu.classList.remove('active');
}
});
// Auto-close desktop dropdown when any tool item is clicked
el.controlsToolsMenu.querySelectorAll('.btn-tool-item').forEach(btn => {
btn.addEventListener('click', () => {
if (window.innerWidth > 900) {
el.controlsToolsMenu.classList.remove('is-open');
el.btnDesktopToolsMenu.classList.remove('active');
}
});
});
}
// Auto-close tools drawer on mobile when clicking any action button
if (el.mapTopControls) {
el.mapTopControls.querySelectorAll('.btn-hud-action').forEach(btn => {
btn.addEventListener('click', () => {
if (window.innerWidth <= 768) {
if (window.innerWidth <= 900 && btn !== el.btnDesktopToolsMenu) {
closeToolsDrawer();
}
});
+13 -13
View File
@@ -1,20 +1,20 @@
// Service Worker for FlockRadar Offline Driving & Live Updates
const CACHE_NAME = 'flockradar-v20';
const CACHE_NAME = 'flockradar-v21';
const ASSETS_TO_CACHE = [
'./',
'./index.html',
'./css/styles.css?v=20',
'./js/icons.js?v=20',
'./js/app.js?v=20',
'./js/auth.js?v=20',
'./js/radar.js?v=20',
'./data/portals.js?v=20',
'./favicon.svg?v=20',
'./favicon.ico?v=20',
'./apple-touch-icon.png?v=20',
'./icon-192.png?v=20',
'./icon-512.png?v=20',
'./og-image.png?v=20',
'./css/styles.css?v=21',
'./js/icons.js?v=21',
'./js/app.js?v=21',
'./js/auth.js?v=21',
'./js/radar.js?v=21',
'./data/portals.js?v=21',
'./favicon.svg?v=21',
'./favicon.ico?v=21',
'./apple-touch-icon.png?v=21',
'./icon-192.png?v=21',
'./icon-512.png?v=21',
'./og-image.png?v=21',
'./assets/img/logo.svg',
'./assets/img/flock_pole_cam_palmdale.jpg',
'./manifest.json'