Spaces:
Running
Running
onboarding popup, speed profile card in stats, shortcuts, etc..
Browse files- frontend/vehicles.html +155 -13
frontend/vehicles.html
CHANGED
|
@@ -365,12 +365,13 @@
|
|
| 365 |
.stats-empty-overlay {
|
| 366 |
position: absolute;
|
| 367 |
inset: 0;
|
| 368 |
-
z-index:
|
| 369 |
display: flex;
|
| 370 |
flex-direction: column;
|
| 371 |
align-items: center;
|
| 372 |
justify-content: center;
|
| 373 |
-
background: rgba(
|
|
|
|
| 374 |
border-radius: 12px;
|
| 375 |
}
|
| 376 |
|
|
@@ -668,12 +669,8 @@
|
|
| 668 |
<div class="absolute inset-0 flex flex-col items-center justify-center pointer-events-none">
|
| 669 |
<span class="text-3xl font-black text-slate-900" id="cnt-total">0</span>
|
| 670 |
<span class="text-[10px] font-bold text-slate-400 uppercase tracking-wider">Total Units</span>
|
| 671 |
-
<span class="text-[9px] font-bold mt-
|
| 672 |
<span id="cnt-pcu">0</span> PCU
|
| 673 |
-
<span class="info-wrap" style="margin-left:2px">
|
| 674 |
-
<span class="info-btn" style="width:11px;height:11px;font-size:6px"><i class="fa-solid fa-info"></i></span>
|
| 675 |
-
<span class="info-tip">Passenger Car Units (IRC:106-1990). Normalizes mixed traffic into a single unit for capacity analysis.</span>
|
| 676 |
-
</span>
|
| 677 |
</span>
|
| 678 |
</div>
|
| 679 |
</div>
|
|
@@ -725,6 +722,34 @@
|
|
| 725 |
</div>
|
| 726 |
</div>
|
| 727 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 728 |
</div>
|
| 729 |
|
| 730 |
<!-- TAB: Run -->
|
|
@@ -742,8 +767,8 @@
|
|
| 742 |
Execution Telemetry</p>
|
| 743 |
</div>
|
| 744 |
<div id="results-status-badge"
|
| 745 |
-
class="px-
|
| 746 |
-
|
| 747 |
</div>
|
| 748 |
</div>
|
| 749 |
<div class="p-8">
|
|
@@ -818,9 +843,40 @@
|
|
| 818 |
|
| 819 |
<!-- TAB: Reports -->
|
| 820 |
<div id="tab-reports" class="hidden flex-1 min-h-0 overflow-y-auto">
|
| 821 |
-
<div id="reports-pending" class="
|
| 822 |
-
<
|
| 823 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 824 |
</div>
|
| 825 |
<div id="reports-grid" class="hidden grid grid-cols-2 xl:grid-cols-3 gap-4"></div>
|
| 826 |
</div>
|
|
@@ -1242,6 +1298,44 @@
|
|
| 1242 |
infoRow('PCU In / Out', `${pcu.pcu_in || 0} / ${pcu.pcu_out || 0}`, 'Directional PCU split.'),
|
| 1243 |
infoRow('Speed Profile', `${dist.slow || 0}% slow · ${dist.normal || 0}% normal · ${dist.fast || 0}% fast`, 'Relative speed categories within this video.'),
|
| 1244 |
].join('');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1245 |
}
|
| 1246 |
|
| 1247 |
// =========== Run Details helpers ===========
|
|
@@ -2051,6 +2145,51 @@
|
|
| 2051 |
</div>
|
| 2052 |
</div>
|
| 2053 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2054 |
<script>
|
| 2055 |
|
| 2056 |
function openAppModal(id) {
|
|
@@ -2062,8 +2201,11 @@
|
|
| 2062 |
if (el) { el.style.display = 'none'; document.body.style.overflow = ''; }
|
| 2063 |
}
|
| 2064 |
document.addEventListener('keydown', function (e) {
|
| 2065 |
-
if (e.key === 'Escape') { closeAppModal('privacyModal'); closeAppModal('termsModal'); }
|
| 2066 |
});
|
|
|
|
|
|
|
|
|
|
| 2067 |
</script>
|
| 2068 |
</body>
|
| 2069 |
|
|
|
|
| 365 |
.stats-empty-overlay {
|
| 366 |
position: absolute;
|
| 367 |
inset: 0;
|
| 368 |
+
z-index: 50;
|
| 369 |
display: flex;
|
| 370 |
flex-direction: column;
|
| 371 |
align-items: center;
|
| 372 |
justify-content: center;
|
| 373 |
+
background: rgba(10, 10, 10, 0.85);
|
| 374 |
+
backdrop-filter: blur(8px);
|
| 375 |
border-radius: 12px;
|
| 376 |
}
|
| 377 |
|
|
|
|
| 669 |
<div class="absolute inset-0 flex flex-col items-center justify-center pointer-events-none">
|
| 670 |
<span class="text-3xl font-black text-slate-900" id="cnt-total">0</span>
|
| 671 |
<span class="text-[10px] font-bold text-slate-400 uppercase tracking-wider">Total Units</span>
|
| 672 |
+
<span class="text-[9px] font-bold mt-1 uppercase tracking-wider" style="color:#8b5e3c" id="cnt-pcu-wrap" title="Passenger Car Units (IRC:106-1990) — normalizes mixed traffic for capacity analysis">
|
| 673 |
<span id="cnt-pcu">0</span> PCU
|
|
|
|
|
|
|
|
|
|
|
|
|
| 674 |
</span>
|
| 675 |
</div>
|
| 676 |
</div>
|
|
|
|
| 722 |
</div>
|
| 723 |
</div>
|
| 724 |
|
| 725 |
+
<!-- Speed Distribution -->
|
| 726 |
+
<div
|
| 727 |
+
class="col-span-6 xl:col-span-3 bg-white rounded-xl p-5 border border-slate-200 shadow-sm flex flex-col min-h-0">
|
| 728 |
+
<div class="flex justify-between items-center mb-2 relative">
|
| 729 |
+
<h3 class="font-bold text-slate-900 text-sm flex items-center">Speed Profile
|
| 730 |
+
<span class="info-wrap"><span class="info-btn"><i class="fa-solid fa-info"></i></span>
|
| 731 |
+
<span class="info-tip">Relative speed categories based on pixel displacement between frames. Slow/Normal/Fast are percentile-based within this video — not km/h.</span></span>
|
| 732 |
+
</h3>
|
| 733 |
+
</div>
|
| 734 |
+
<div class="flex-1 flex items-center justify-center" id="speed-stats-card">
|
| 735 |
+
<div class="text-center text-slate-300 text-xs"><i class="fa-solid fa-gauge-high text-2xl mb-2"></i><br>Available after processing</div>
|
| 736 |
+
</div>
|
| 737 |
+
</div>
|
| 738 |
+
|
| 739 |
+
<!-- PCU Summary -->
|
| 740 |
+
<div
|
| 741 |
+
class="col-span-6 xl:col-span-3 bg-white rounded-xl p-5 border border-slate-200 shadow-sm flex flex-col min-h-0">
|
| 742 |
+
<div class="flex justify-between items-center mb-2 relative">
|
| 743 |
+
<h3 class="font-bold text-slate-900 text-sm flex items-center">PCU Analysis
|
| 744 |
+
<span class="info-wrap"><span class="info-btn"><i class="fa-solid fa-info"></i></span>
|
| 745 |
+
<span class="info-tip">Passenger Car Units (IRC:106-1990). Converts heterogeneous Indian traffic into standardized units for road capacity analysis.</span></span>
|
| 746 |
+
</h3>
|
| 747 |
+
</div>
|
| 748 |
+
<div class="flex-1 flex items-center justify-center" id="pcu-stats-card">
|
| 749 |
+
<div class="text-center text-slate-300 text-xs"><i class="fa-solid fa-car text-2xl mb-2"></i><br>Available after processing</div>
|
| 750 |
+
</div>
|
| 751 |
+
</div>
|
| 752 |
+
|
| 753 |
</div>
|
| 754 |
|
| 755 |
<!-- TAB: Run -->
|
|
|
|
| 767 |
Execution Telemetry</p>
|
| 768 |
</div>
|
| 769 |
<div id="results-status-badge"
|
| 770 |
+
class="px-3 py-1.5 bg-amber-900/30 border border-amber-800/50 text-amber-500 text-[10px] font-bold rounded-full uppercase tracking-widest shadow-sm flex items-center gap-2">
|
| 771 |
+
<div class="w-1.5 h-1.5 rounded-full bg-amber-500 animate-pulse"></div>System Standby
|
| 772 |
</div>
|
| 773 |
</div>
|
| 774 |
<div class="p-8">
|
|
|
|
| 843 |
|
| 844 |
<!-- TAB: Reports -->
|
| 845 |
<div id="tab-reports" class="hidden flex-1 min-h-0 overflow-y-auto">
|
| 846 |
+
<div id="reports-pending" class="grid grid-cols-2 xl:grid-cols-3 gap-4 w-full">
|
| 847 |
+
<!-- Skeleton Loader 1 -->
|
| 848 |
+
<div class="bg-[#0a0a0a] rounded-xl border border-[#222] shadow-sm flex flex-col overflow-hidden animate-pulse">
|
| 849 |
+
<div class="flex flex-col items-center justify-center py-12">
|
| 850 |
+
<div class="w-16 h-16 bg-[#1a1a1a] rounded mb-4"></div>
|
| 851 |
+
<div class="w-24 h-2 bg-[#1a1a1a] rounded"></div>
|
| 852 |
+
</div>
|
| 853 |
+
<div class="px-5 py-4 border-t border-[#1a1a1a] bg-[#050505]">
|
| 854 |
+
<div class="w-3/4 h-3 bg-[#1a1a1a] rounded mb-2"></div>
|
| 855 |
+
<div class="w-1/2 h-2 bg-[#111] rounded"></div>
|
| 856 |
+
</div>
|
| 857 |
+
</div>
|
| 858 |
+
<!-- Skeleton Loader 2 -->
|
| 859 |
+
<div class="bg-[#0a0a0a] rounded-xl border border-[#222] shadow-sm flex flex-col overflow-hidden animate-pulse" style="animation-delay: 150ms;">
|
| 860 |
+
<div class="flex flex-col items-center justify-center py-12">
|
| 861 |
+
<div class="w-16 h-16 bg-[#1a1a1a] rounded mb-4"></div>
|
| 862 |
+
<div class="w-24 h-2 bg-[#1a1a1a] rounded"></div>
|
| 863 |
+
</div>
|
| 864 |
+
<div class="px-5 py-4 border-t border-[#1a1a1a] bg-[#050505]">
|
| 865 |
+
<div class="w-2/3 h-3 bg-[#1a1a1a] rounded mb-2"></div>
|
| 866 |
+
<div class="w-1/3 h-2 bg-[#111] rounded"></div>
|
| 867 |
+
</div>
|
| 868 |
+
</div>
|
| 869 |
+
<!-- Skeleton Loader 3 -->
|
| 870 |
+
<div class="bg-[#0a0a0a] rounded-xl border border-[#222] shadow-sm flex flex-col overflow-hidden animate-pulse" style="animation-delay: 300ms;">
|
| 871 |
+
<div class="flex flex-col items-center justify-center py-12">
|
| 872 |
+
<div class="w-16 h-16 bg-[#1a1a1a] rounded mb-4"></div>
|
| 873 |
+
<div class="w-24 h-2 bg-[#1a1a1a] rounded"></div>
|
| 874 |
+
</div>
|
| 875 |
+
<div class="px-5 py-4 border-t border-[#1a1a1a] bg-[#050505]">
|
| 876 |
+
<div class="w-4/5 h-3 bg-[#1a1a1a] rounded mb-2"></div>
|
| 877 |
+
<div class="w-1/2 h-2 bg-[#111] rounded"></div>
|
| 878 |
+
</div>
|
| 879 |
+
</div>
|
| 880 |
</div>
|
| 881 |
<div id="reports-grid" class="hidden grid grid-cols-2 xl:grid-cols-3 gap-4"></div>
|
| 882 |
</div>
|
|
|
|
| 1298 |
infoRow('PCU In / Out', `${pcu.pcu_in || 0} / ${pcu.pcu_out || 0}`, 'Directional PCU split.'),
|
| 1299 |
infoRow('Speed Profile', `${dist.slow || 0}% slow · ${dist.normal || 0}% normal · ${dist.fast || 0}% fast`, 'Relative speed categories within this video.'),
|
| 1300 |
].join('');
|
| 1301 |
+
|
| 1302 |
+
// ---- Also populate Stats tab cards ----
|
| 1303 |
+
// Speed card in Stats
|
| 1304 |
+
const speedCard = document.getElementById('speed-stats-card');
|
| 1305 |
+
if (speedCard) {
|
| 1306 |
+
speedCard.innerHTML = `<div class="flex gap-5 items-end justify-center w-full">
|
| 1307 |
+
${['slow', 'normal', 'fast'].map(cat => {
|
| 1308 |
+
const pct = dist[cat] || 0;
|
| 1309 |
+
const h = Math.max(12, pct * 1.0);
|
| 1310 |
+
return `<div class="flex flex-col items-center gap-1.5 flex-1">
|
| 1311 |
+
<span class="text-lg font-black" style="color:${colors[cat]}">${pct}%</span>
|
| 1312 |
+
<div style="width:100%;max-width:48px;height:${h}px;background:${colors[cat]};border-radius:8px;transition:height 0.5s"></div>
|
| 1313 |
+
<span class="text-[10px] font-bold text-slate-500 uppercase">${labels[cat]}</span>
|
| 1314 |
+
</div>`;
|
| 1315 |
+
}).join('')}
|
| 1316 |
+
</div>`;
|
| 1317 |
+
}
|
| 1318 |
+
|
| 1319 |
+
// PCU card in Stats
|
| 1320 |
+
const pcuCard = document.getElementById('pcu-stats-card');
|
| 1321 |
+
if (pcuCard) {
|
| 1322 |
+
pcuCard.innerHTML = `<div class="space-y-3 w-full">
|
| 1323 |
+
<div class="flex justify-between items-center">
|
| 1324 |
+
<span class="text-xs font-medium text-slate-500">Total PCU</span>
|
| 1325 |
+
<span class="text-2xl font-black" style="color:#8b5e3c">${pcu.total_pcu || 0}</span>
|
| 1326 |
+
</div>
|
| 1327 |
+
<div class="flex gap-3">
|
| 1328 |
+
<div class="flex-1 bg-green-50 rounded-lg p-2.5 text-center border border-green-100">
|
| 1329 |
+
<div class="text-lg font-bold text-green-700">${pcu.pcu_in || 0}</div>
|
| 1330 |
+
<div class="text-[9px] font-bold text-green-500 uppercase">PCU In</div>
|
| 1331 |
+
</div>
|
| 1332 |
+
<div class="flex-1 bg-red-50 rounded-lg p-2.5 text-center border border-red-100">
|
| 1333 |
+
<div class="text-lg font-bold text-red-700">${pcu.pcu_out || 0}</div>
|
| 1334 |
+
<div class="text-[9px] font-bold text-red-500 uppercase">PCU Out</div>
|
| 1335 |
+
</div>
|
| 1336 |
+
</div>
|
| 1337 |
+
</div>`;
|
| 1338 |
+
}
|
| 1339 |
}
|
| 1340 |
|
| 1341 |
// =========== Run Details helpers ===========
|
|
|
|
| 2145 |
</div>
|
| 2146 |
</div>
|
| 2147 |
|
| 2148 |
+
<!-- Keyboard Shortcuts Modal -->
|
| 2149 |
+
<div id="appModal-shortcutsModal" onclick="if(event.target===this)closeAppModal('shortcutsModal')"
|
| 2150 |
+
style="display:none;position:fixed;inset:0;background:rgba(0,0,0,0.85);z-index:9999;align-items:center;justify-content:center;padding:24px">
|
| 2151 |
+
<div
|
| 2152 |
+
style="background:#0a0a0a;border:1px solid #2a2a2a;border-radius:14px;max-width:380px;width:100%;padding:28px;position:relative">
|
| 2153 |
+
<button onclick="closeAppModal('shortcutsModal')"
|
| 2154 |
+
style="position:absolute;top:14px;right:16px;background:none;border:none;color:#a89f97;font-size:18px;cursor:pointer">×</button>
|
| 2155 |
+
<h2 style="color:#f0ece6;font-size:1rem;font-weight:700;margin-bottom:4px">
|
| 2156 |
+
<i class="fa-solid fa-keyboard" style="color:#c89a6c;margin-right:6px"></i>Keyboard Shortcuts
|
| 2157 |
+
</h2>
|
| 2158 |
+
<p style="color:#555;font-size:10px;margin-bottom:16px">Navigate faster with these shortcuts</p>
|
| 2159 |
+
<div style="display:flex;flex-direction:column;gap:8px">
|
| 2160 |
+
<div style="display:flex;justify-content:space-between;align-items:center;padding:6px 0;border-bottom:1px solid #1a1a1a">
|
| 2161 |
+
<span style="color:#a89f97;font-size:11px;font-weight:500">About</span>
|
| 2162 |
+
<kbd style="background:#1a1a1a;color:#c89a6c;font-size:11px;font-weight:700;padding:3px 10px;border-radius:6px;border:1px solid #2a2a2a;font-family:'JetBrains Mono',monospace">1</kbd>
|
| 2163 |
+
</div>
|
| 2164 |
+
<div style="display:flex;justify-content:space-between;align-items:center;padding:6px 0;border-bottom:1px solid #1a1a1a">
|
| 2165 |
+
<span style="color:#a89f97;font-size:11px;font-weight:500">Stats</span>
|
| 2166 |
+
<kbd style="background:#1a1a1a;color:#c89a6c;font-size:11px;font-weight:700;padding:3px 10px;border-radius:6px;border:1px solid #2a2a2a;font-family:'JetBrains Mono',monospace">2</kbd>
|
| 2167 |
+
</div>
|
| 2168 |
+
<div style="display:flex;justify-content:space-between;align-items:center;padding:6px 0;border-bottom:1px solid #1a1a1a">
|
| 2169 |
+
<span style="color:#a89f97;font-size:11px;font-weight:500">Run</span>
|
| 2170 |
+
<kbd style="background:#1a1a1a;color:#c89a6c;font-size:11px;font-weight:700;padding:3px 10px;border-radius:6px;border:1px solid #2a2a2a;font-family:'JetBrains Mono',monospace">3</kbd>
|
| 2171 |
+
</div>
|
| 2172 |
+
<div style="display:flex;justify-content:space-between;align-items:center;padding:6px 0;border-bottom:1px solid #1a1a1a">
|
| 2173 |
+
<span style="color:#a89f97;font-size:11px;font-weight:500">Artifacts</span>
|
| 2174 |
+
<kbd style="background:#1a1a1a;color:#c89a6c;font-size:11px;font-weight:700;padding:3px 10px;border-radius:6px;border:1px solid #2a2a2a;font-family:'JetBrains Mono',monospace">4</kbd>
|
| 2175 |
+
</div>
|
| 2176 |
+
<div style="display:flex;justify-content:space-between;align-items:center;padding:6px 0;border-bottom:1px solid #1a1a1a">
|
| 2177 |
+
<span style="color:#a89f97;font-size:11px;font-weight:500">Settings</span>
|
| 2178 |
+
<kbd style="background:#1a1a1a;color:#c89a6c;font-size:11px;font-weight:700;padding:3px 10px;border-radius:6px;border:1px solid #2a2a2a;font-family:'JetBrains Mono',monospace">5</kbd>
|
| 2179 |
+
</div>
|
| 2180 |
+
<div style="display:flex;justify-content:space-between;align-items:center;padding:6px 0;border-bottom:1px solid #1a1a1a">
|
| 2181 |
+
<span style="color:#a89f97;font-size:11px;font-weight:500">Feedback</span>
|
| 2182 |
+
<kbd style="background:#1a1a1a;color:#c89a6c;font-size:11px;font-weight:700;padding:3px 10px;border-radius:6px;border:1px solid #2a2a2a;font-family:'JetBrains Mono',monospace">6</kbd>
|
| 2183 |
+
</div>
|
| 2184 |
+
<div style="display:flex;justify-content:space-between;align-items:center;padding:6px 0">
|
| 2185 |
+
<span style="color:#a89f97;font-size:11px;font-weight:500">Download Artifacts</span>
|
| 2186 |
+
<kbd style="background:#1a1a1a;color:#c89a6c;font-size:11px;font-weight:700;padding:3px 10px;border-radius:6px;border:1px solid #2a2a2a;font-family:'JetBrains Mono',monospace">D</kbd>
|
| 2187 |
+
</div>
|
| 2188 |
+
</div>
|
| 2189 |
+
<p style="color:#333;font-size:9px;margin-top:14px;text-align:center">Press <strong style="color:#555">Esc</strong> to close</p>
|
| 2190 |
+
</div>
|
| 2191 |
+
</div>
|
| 2192 |
+
|
| 2193 |
<script>
|
| 2194 |
|
| 2195 |
function openAppModal(id) {
|
|
|
|
| 2201 |
if (el) { el.style.display = 'none'; document.body.style.overflow = ''; }
|
| 2202 |
}
|
| 2203 |
document.addEventListener('keydown', function (e) {
|
| 2204 |
+
if (e.key === 'Escape') { closeAppModal('privacyModal'); closeAppModal('termsModal'); closeAppModal('shortcutsModal'); }
|
| 2205 |
});
|
| 2206 |
+
|
| 2207 |
+
// Auto-show keyboard shortcuts on every page visit
|
| 2208 |
+
setTimeout(function() { openAppModal('shortcutsModal'); }, 800);
|
| 2209 |
</script>
|
| 2210 |
</body>
|
| 2211 |
|