Spaces:
Sleeping
Sleeping
Update templates/index.html
Browse files- templates/index.html +13 -13
templates/index.html
CHANGED
|
@@ -14,11 +14,9 @@
|
|
| 14 |
<meta name="mobile-web-app-capable" content="yes">
|
| 15 |
<meta name="theme-color" content="#1e1b4b">
|
| 16 |
|
| 17 |
-
<!-- Custom App Icon from Static Folder -->
|
| 18 |
<link rel="icon" type="image/png" sizes="192x192" href="{{ url_for('static', filename='logo.png') }}">
|
| 19 |
<link rel="apple-touch-icon" href="{{ url_for('static', filename='logo.png') }}">
|
| 20 |
-
|
| 21 |
-
<!-- Inline PWA Manifest for Android Home Screen Icon Mapping (Fix: Dynamic Jinja Paths for HuggingFace) -->
|
| 22 |
<link rel="manifest" href='data:application/manifest+json;utf8,{"name":"CrashVision AI","short_name":"CrashVision","start_url":"./","display":"standalone","background_color":"#F4F4F9","theme_color":"#1e1b4b","icons":[{"src":"{{ url_for("static", filename="logo.png") }}","sizes":"192x192","type":"image/png"},{"src":"{{ url_for("static", filename="logo.png") }}","sizes":"512x512","type":"image/png"}]}'>
|
| 23 |
<!-- ========================================== -->
|
| 24 |
|
|
@@ -182,10 +180,10 @@
|
|
| 182 |
</button>
|
| 183 |
</div>
|
| 184 |
|
| 185 |
-
<!-- Emergency Dispatch Banner -->
|
| 186 |
<div id="emergencyBanner" class="hidden fixed top-0 left-0 w-full bg-red-600 text-white py-3 px-4 z-50 flex items-center justify-center gap-4 animate-pulse shadow-lg shadow-red-500/50">
|
| 187 |
<i class="fas fa-exclamation-triangle text-xl"></i>
|
| 188 |
-
<span class="font-black uppercase tracking-widest text-sm sm:text-base">
|
| 189 |
<i class="fas fa-exclamation-triangle text-xl"></i>
|
| 190 |
</div>
|
| 191 |
|
|
@@ -296,7 +294,7 @@
|
|
| 296 |
<i class="fas fa-bolt text-rose-600 dark:text-rose-300 text-xl"></i>
|
| 297 |
</div>
|
| 298 |
<h4 class="text-sm font-black uppercase tracking-wider text-indigo-950 dark:text-purple-50 mb-2">Automated SOS</h4>
|
| 299 |
-
<p class="text-xs text-indigo-800/70 dark:text-purple-100 leading-relaxed font-bold">
|
| 300 |
</div>
|
| 301 |
</div>
|
| 302 |
|
|
@@ -313,7 +311,7 @@
|
|
| 313 |
<span class="px-4 py-1.5 text-[10px] font-black uppercase tracking-widest bg-white/60 dark:bg-white/10 rounded-full text-indigo-900 dark:text-white border border-indigo-200/50 dark:border-white/20 shadow-sm">Channel: CV-PRIME</span>
|
| 314 |
</div>
|
| 315 |
|
| 316 |
-
<!-- Interactive Media Player Area
|
| 317 |
<div class="rounded-[32px] overflow-hidden shadow-2xl border border-white/50 dark:border-white/20 relative bg-black aspect-video flex items-center justify-center group">
|
| 318 |
<!-- Display Image -->
|
| 319 |
<img id="previewImg" src="" class="w-full h-full object-contain z-10 hidden" alt="Video View">
|
|
@@ -345,14 +343,12 @@
|
|
| 345 |
</span>
|
| 346 |
</div>
|
| 347 |
|
| 348 |
-
<!-- Integrated Video Controls Overlay -->
|
| 349 |
<div id="playerControlsOverlay" class="hidden absolute bottom-0 left-0 w-full p-4 sm:p-6 bg-gradient-to-t from-black/90 via-black/50 to-transparent z-40 transition-opacity duration-300 opacity-0 group-hover:opacity-100 flex-col gap-3">
|
| 350 |
-
|
| 351 |
<!-- Progress Bar -->
|
| 352 |
<div class="w-full h-1.5 bg-white/30 rounded-full cursor-pointer relative" onclick="seekVideo(event)" id="progressBarContainer">
|
| 353 |
<div id="progressFill" class="absolute top-0 left-0 h-full bg-indigo-500 rounded-full pointer-events-none transition-all duration-300" style="width: 0%"></div>
|
| 354 |
</div>
|
| 355 |
-
|
| 356 |
<!-- Bottom Control Row -->
|
| 357 |
<div class="flex items-center justify-center w-full mt-2">
|
| 358 |
<!-- Playback -->
|
|
@@ -674,7 +670,7 @@
|
|
| 674 |
</form>
|
| 675 |
</div>
|
| 676 |
|
| 677 |
-
<!-- Tabular Results View
|
| 678 |
<div id="predictiveResultView" class="hidden text-center animate-fade-in py-6">
|
| 679 |
<h3 class="text-xs font-black uppercase tracking-[0.3em] text-indigo-800/50 dark:text-purple-200 mb-6">Prediction Outcome</h3>
|
| 680 |
|
|
@@ -915,18 +911,22 @@
|
|
| 915 |
document.getElementById('severityLevel').innerText = data.severity || "--";
|
| 916 |
|
| 917 |
if (data.progress !== undefined) {
|
| 918 |
-
document.getElementById('progressFill').style.width = `
|
|
|
|
| 919 |
}
|
| 920 |
|
| 921 |
const statusCard = document.getElementById('statusCard');
|
| 922 |
const statusIcon = document.getElementById('statusIcon');
|
| 923 |
const emergencyBanner = document.getElementById('emergencyBanner');
|
|
|
|
| 924 |
|
| 925 |
if(data.is_accident || data.final_decision) {
|
| 926 |
statusCard.className = "ios-glass-inner p-8 rounded-[32px] mb-8 shadow-sm dark:shadow-lg relative overflow-hidden border-l-4 border-rose-500 bg-rose-50/50 dark:bg-rose-900/20 transition-colors duration-500";
|
| 927 |
statusIcon.className = "fas fa-exclamation-triangle text-rose-600";
|
| 928 |
|
| 929 |
-
if(data.severity
|
|
|
|
|
|
|
| 930 |
emergencyBanner.classList.remove('hidden');
|
| 931 |
}
|
| 932 |
} else {
|
|
|
|
| 14 |
<meta name="mobile-web-app-capable" content="yes">
|
| 15 |
<meta name="theme-color" content="#1e1b4b">
|
| 16 |
|
| 17 |
+
<!-- Custom App Icon from Static Folder (Forcefully lowercase to match Linux server rules) -->
|
| 18 |
<link rel="icon" type="image/png" sizes="192x192" href="{{ url_for('static', filename='logo.png') }}">
|
| 19 |
<link rel="apple-touch-icon" href="{{ url_for('static', filename='logo.png') }}">
|
|
|
|
|
|
|
| 20 |
<link rel="manifest" href='data:application/manifest+json;utf8,{"name":"CrashVision AI","short_name":"CrashVision","start_url":"./","display":"standalone","background_color":"#F4F4F9","theme_color":"#1e1b4b","icons":[{"src":"{{ url_for("static", filename="logo.png") }}","sizes":"192x192","type":"image/png"},{"src":"{{ url_for("static", filename="logo.png") }}","sizes":"512x512","type":"image/png"}]}'>
|
| 21 |
<!-- ========================================== -->
|
| 22 |
|
|
|
|
| 180 |
</button>
|
| 181 |
</div>
|
| 182 |
|
| 183 |
+
<!-- Emergency Dispatch Banner (Dynamically updates severity) -->
|
| 184 |
<div id="emergencyBanner" class="hidden fixed top-0 left-0 w-full bg-red-600 text-white py-3 px-4 z-50 flex items-center justify-center gap-4 animate-pulse shadow-lg shadow-red-500/50">
|
| 185 |
<i class="fas fa-exclamation-triangle text-xl"></i>
|
| 186 |
+
<span id="emergencyText" class="font-black uppercase tracking-widest text-sm sm:text-base">Collision Detected. Automated SOS Dispatched.</span>
|
| 187 |
<i class="fas fa-exclamation-triangle text-xl"></i>
|
| 188 |
</div>
|
| 189 |
|
|
|
|
| 294 |
<i class="fas fa-bolt text-rose-600 dark:text-rose-300 text-xl"></i>
|
| 295 |
</div>
|
| 296 |
<h4 class="text-sm font-black uppercase tracking-wider text-indigo-950 dark:text-purple-50 mb-2">Automated SOS</h4>
|
| 297 |
+
<p class="text-xs text-indigo-800/70 dark:text-purple-100 leading-relaxed font-bold">HTTP Push Dispatch via ntfy.sh.</p>
|
| 298 |
</div>
|
| 299 |
</div>
|
| 300 |
|
|
|
|
| 311 |
<span class="px-4 py-1.5 text-[10px] font-black uppercase tracking-widest bg-white/60 dark:bg-white/10 rounded-full text-indigo-900 dark:text-white border border-indigo-200/50 dark:border-white/20 shadow-sm">Channel: CV-PRIME</span>
|
| 312 |
</div>
|
| 313 |
|
| 314 |
+
<!-- Interactive Media Player Area -->
|
| 315 |
<div class="rounded-[32px] overflow-hidden shadow-2xl border border-white/50 dark:border-white/20 relative bg-black aspect-video flex items-center justify-center group">
|
| 316 |
<!-- Display Image -->
|
| 317 |
<img id="previewImg" src="" class="w-full h-full object-contain z-10 hidden" alt="Video View">
|
|
|
|
| 343 |
</span>
|
| 344 |
</div>
|
| 345 |
|
| 346 |
+
<!-- Integrated Video Controls Overlay (Timeline Only) -->
|
| 347 |
<div id="playerControlsOverlay" class="hidden absolute bottom-0 left-0 w-full p-4 sm:p-6 bg-gradient-to-t from-black/90 via-black/50 to-transparent z-40 transition-opacity duration-300 opacity-0 group-hover:opacity-100 flex-col gap-3">
|
|
|
|
| 348 |
<!-- Progress Bar -->
|
| 349 |
<div class="w-full h-1.5 bg-white/30 rounded-full cursor-pointer relative" onclick="seekVideo(event)" id="progressBarContainer">
|
| 350 |
<div id="progressFill" class="absolute top-0 left-0 h-full bg-indigo-500 rounded-full pointer-events-none transition-all duration-300" style="width: 0%"></div>
|
| 351 |
</div>
|
|
|
|
| 352 |
<!-- Bottom Control Row -->
|
| 353 |
<div class="flex items-center justify-center w-full mt-2">
|
| 354 |
<!-- Playback -->
|
|
|
|
| 670 |
</form>
|
| 671 |
</div>
|
| 672 |
|
| 673 |
+
<!-- Tabular Results View -->
|
| 674 |
<div id="predictiveResultView" class="hidden text-center animate-fade-in py-6">
|
| 675 |
<h3 class="text-xs font-black uppercase tracking-[0.3em] text-indigo-800/50 dark:text-purple-200 mb-6">Prediction Outcome</h3>
|
| 676 |
|
|
|
|
| 911 |
document.getElementById('severityLevel').innerText = data.severity || "--";
|
| 912 |
|
| 913 |
if (data.progress !== undefined) {
|
| 914 |
+
if (data.progress >= 100) { document.getElementById('progressFill').style.width = `100%`; }
|
| 915 |
+
else { document.getElementById('progressFill').style.width = `${data.progress}%`; }
|
| 916 |
}
|
| 917 |
|
| 918 |
const statusCard = document.getElementById('statusCard');
|
| 919 |
const statusIcon = document.getElementById('statusIcon');
|
| 920 |
const emergencyBanner = document.getElementById('emergencyBanner');
|
| 921 |
+
const emergencyText = document.getElementById('emergencyText');
|
| 922 |
|
| 923 |
if(data.is_accident || data.final_decision) {
|
| 924 |
statusCard.className = "ios-glass-inner p-8 rounded-[32px] mb-8 shadow-sm dark:shadow-lg relative overflow-hidden border-l-4 border-rose-500 bg-rose-50/50 dark:bg-rose-900/20 transition-colors duration-500";
|
| 925 |
statusIcon.className = "fas fa-exclamation-triangle text-rose-600";
|
| 926 |
|
| 927 |
+
if(data.severity) {
|
| 928 |
+
const sevLevel = data.severity.toUpperCase();
|
| 929 |
+
emergencyText.innerText = `${sevLevel} COLLISION DETECTED. AUTOMATED SOS DISPATCHED.`;
|
| 930 |
emergencyBanner.classList.remove('hidden');
|
| 931 |
}
|
| 932 |
} else {
|