Spaces:
Sleeping
Sleeping
Update templates/index.html
Browse files- templates/index.html +103 -23
templates/index.html
CHANGED
|
@@ -11,9 +11,10 @@
|
|
| 11 |
<meta name="mobile-web-app-capable" content="yes">
|
| 12 |
<meta name="theme-color" content="#1e1b4b">
|
| 13 |
|
| 14 |
-
<
|
| 15 |
-
<link rel="
|
| 16 |
-
<link rel="
|
|
|
|
| 17 |
|
| 18 |
<script src="https://cdn.tailwindcss.com"></script>
|
| 19 |
<script>
|
|
@@ -183,7 +184,7 @@
|
|
| 183 |
<div class="ios-glass p-6 rounded-[32px] hover:-translate-y-1 transition-transform duration-300 shadow-sm cursor-default">
|
| 184 |
<div class="w-12 h-12 rounded-2xl bg-rose-100 dark:bg-white/10 flex items-center justify-center mb-5 border border-rose-200/50 dark:border-white/10 shadow-sm"><i class="fas fa-bolt text-rose-600 dark:text-rose-300 text-xl"></i></div>
|
| 185 |
<h4 class="text-sm font-black uppercase tracking-wider text-indigo-950 dark:text-purple-50 mb-2">Automated SOS</h4>
|
| 186 |
-
<p class="text-xs text-indigo-800/70 dark:text-purple-100 leading-relaxed font-bold">
|
| 187 |
</div>
|
| 188 |
</div>
|
| 189 |
</div>
|
|
@@ -280,6 +281,7 @@
|
|
| 280 |
</div>
|
| 281 |
|
| 282 |
<div class="space-y-7 mb-10">
|
|
|
|
| 283 |
<div id="alprSection" class="hidden">
|
| 284 |
<div class="flex justify-between items-end mb-3">
|
| 285 |
<span class="font-black text-[11px] uppercase tracking-widest text-indigo-900 dark:text-purple-50 flex items-center gap-3">
|
|
@@ -364,36 +366,112 @@
|
|
| 364 |
<div class="ios-glass-inner p-5 sm:p-6 rounded-[24px] shadow-sm border border-white/50 dark:border-white/10 hover:bg-white/50 dark:hover:bg-white/5 transition-colors group">
|
| 365 |
<div class="flex items-center gap-3 mb-4 border-b border-indigo-100/50 dark:border-white/10 pb-3"><div class="w-8 h-8 rounded-xl bg-cyan-100 dark:bg-cyan-500/20 flex items-center justify-center border border-cyan-200/50 dark:border-cyan-400/30 group-hover:scale-110 transition-transform"><i class="fas fa-cloud-sun text-cyan-600 dark:text-cyan-300 text-xs"></i></div><h4 class="font-black text-[11px] uppercase tracking-widest text-indigo-900 dark:text-purple-200">Conditions</h4></div>
|
| 366 |
<div class="space-y-4">
|
| 367 |
-
<div>
|
| 368 |
-
|
| 369 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 370 |
</div>
|
| 371 |
</div>
|
| 372 |
|
| 373 |
<div class="ios-glass-inner p-5 sm:p-6 rounded-[24px] shadow-sm border border-white/50 dark:border-white/10 hover:bg-white/50 dark:hover:bg-white/5 transition-colors group">
|
| 374 |
<div class="flex items-center gap-3 mb-4 border-b border-indigo-100/50 dark:border-white/10 pb-3"><div class="w-8 h-8 rounded-xl bg-rose-100 dark:bg-rose-500/20 flex items-center justify-center border border-rose-200/50 dark:border-rose-400/30 group-hover:scale-110 transition-transform"><i class="fas fa-road text-rose-600 dark:text-rose-300 text-xs"></i></div><h4 class="font-black text-[11px] uppercase tracking-widest text-indigo-900 dark:text-purple-200">Road Specs</h4></div>
|
| 375 |
<div class="space-y-4">
|
| 376 |
-
<div>
|
| 377 |
-
|
| 378 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 379 |
</div>
|
| 380 |
</div>
|
| 381 |
|
| 382 |
<div class="ios-glass-inner p-5 sm:p-6 rounded-[24px] shadow-sm border border-white/50 dark:border-white/10 hover:bg-white/50 dark:hover:bg-white/5 transition-colors group">
|
| 383 |
<div class="flex items-center gap-3 mb-4 border-b border-indigo-100/50 dark:border-white/10 pb-3"><div class="w-8 h-8 rounded-xl bg-amber-100 dark:bg-amber-500/20 flex items-center justify-center border border-amber-200/50 dark:border-amber-400/30 group-hover:scale-110 transition-transform"><i class="fas fa-car-side text-amber-600 dark:text-amber-300 text-xs"></i></div><h4 class="font-black text-[11px] uppercase tracking-widest text-indigo-900 dark:text-purple-200">Traffic Data</h4></div>
|
| 384 |
<div class="space-y-4">
|
| 385 |
-
<div>
|
| 386 |
-
|
| 387 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 388 |
</div>
|
| 389 |
</div>
|
| 390 |
|
| 391 |
<div class="ios-glass-inner p-5 sm:p-6 rounded-[24px] shadow-sm border border-white/50 dark:border-white/10 hover:bg-white/50 dark:hover:bg-white/5 transition-colors group">
|
| 392 |
<div class="flex items-center gap-3 mb-4 border-b border-indigo-100/50 dark:border-white/10 pb-3"><div class="w-8 h-8 rounded-xl bg-fuchsia-100 dark:bg-fuchsia-500/20 flex items-center justify-center border border-fuchsia-200/50 dark:border-fuchsia-400/30 group-hover:scale-110 transition-transform"><i class="fas fa-user text-fuchsia-600 dark:text-fuchsia-300 text-xs"></i></div><h4 class="font-black text-[11px] uppercase tracking-widest text-indigo-900 dark:text-purple-200">Driver Profile</h4></div>
|
| 393 |
<div class="space-y-4">
|
| 394 |
-
<div>
|
| 395 |
-
|
| 396 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 397 |
</div>
|
| 398 |
</div>
|
| 399 |
</div>
|
|
@@ -676,10 +754,12 @@
|
|
| 676 |
alprSec.classList.remove('hidden');
|
| 677 |
alprCont.innerHTML = data.plates.map(p => `
|
| 678 |
<div class="flex items-center gap-2 bg-white/80 dark:bg-black/40 px-3 py-1.5 rounded-lg border border-indigo-100 dark:border-white/10 shadow-sm">
|
| 679 |
-
<img src="data:image/jpeg;base64,${p.image}" class="h-6 rounded object-cover">
|
| 680 |
<span class="font-mono font-bold text-xs text-indigo-900 dark:text-white">${p.text}</span>
|
| 681 |
</div>
|
| 682 |
`).join('');
|
|
|
|
|
|
|
|
|
|
| 683 |
}
|
| 684 |
} catch(e) {}
|
| 685 |
}
|
|
@@ -728,22 +808,22 @@
|
|
| 728 |
spinner.classList.remove('hidden');
|
| 729 |
|
| 730 |
const payload = {
|
| 731 |
-
|
| 732 |
-
|
| 733 |
Time_of_Day: document.getElementById('tab_time').value,
|
| 734 |
Road_Type: document.getElementById('tab_road_type').value,
|
| 735 |
-
|
| 736 |
Speed_Limit: document.getElementById('tab_speed').value,
|
| 737 |
Traffic_Density: document.getElementById('tab_density').value,
|
| 738 |
Number_of_Vehicles: document.getElementById('tab_vehicles').value,
|
| 739 |
Vehicle_Type: document.getElementById('tab_vehicle').value,
|
| 740 |
Driver_Age: document.getElementById('tab_age').value,
|
| 741 |
Driver_Experience: document.getElementById('tab_exp').value,
|
| 742 |
-
Driver_Alcohol: document.getElementById('tab_alcohol').value === "Yes" ? 1
|
| 743 |
};
|
| 744 |
|
| 745 |
-
|
| 746 |
-
const isAllBlank =
|
| 747 |
|
| 748 |
if (isAllBlank) {
|
| 749 |
document.getElementById('predictiveFormView').classList.add('hidden');
|
|
|
|
| 11 |
<meta name="mobile-web-app-capable" content="yes">
|
| 12 |
<meta name="theme-color" content="#1e1b4b">
|
| 13 |
|
| 14 |
+
<!-- FIX: Reverted to standard static routing now that ProxyFix handles the Hugging Face URL translation. Added ?v=5 to bust mobile caches. -->
|
| 15 |
+
<link rel="icon" type="image/png" sizes="192x192" href="{{ url_for('static', filename='logo.png') }}?v=5">
|
| 16 |
+
<link rel="apple-touch-icon" href="{{ url_for('static', filename='logo.png') }}?v=5">
|
| 17 |
+
<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") }}?v=5","sizes":"192x192","type":"image/png"},{"src":"{{ url_for("static", filename="logo.png") }}?v=5","sizes":"512x512","type":"image/png"}]}'>
|
| 18 |
|
| 19 |
<script src="https://cdn.tailwindcss.com"></script>
|
| 20 |
<script>
|
|
|
|
| 184 |
<div class="ios-glass p-6 rounded-[32px] hover:-translate-y-1 transition-transform duration-300 shadow-sm cursor-default">
|
| 185 |
<div class="w-12 h-12 rounded-2xl bg-rose-100 dark:bg-white/10 flex items-center justify-center mb-5 border border-rose-200/50 dark:border-white/10 shadow-sm"><i class="fas fa-bolt text-rose-600 dark:text-rose-300 text-xl"></i></div>
|
| 186 |
<h4 class="text-sm font-black uppercase tracking-wider text-indigo-950 dark:text-purple-50 mb-2">Automated SOS</h4>
|
| 187 |
+
<p class="text-xs text-indigo-800/70 dark:text-purple-100 leading-relaxed font-bold">HTTP Push Dispatch via ntfy.sh.</p>
|
| 188 |
</div>
|
| 189 |
</div>
|
| 190 |
</div>
|
|
|
|
| 281 |
</div>
|
| 282 |
|
| 283 |
<div class="space-y-7 mb-10">
|
| 284 |
+
<!-- ALPR Section (Shows dynamically when plates are detected) -->
|
| 285 |
<div id="alprSection" class="hidden">
|
| 286 |
<div class="flex justify-between items-end mb-3">
|
| 287 |
<span class="font-black text-[11px] uppercase tracking-widest text-indigo-900 dark:text-purple-50 flex items-center gap-3">
|
|
|
|
| 366 |
<div class="ios-glass-inner p-5 sm:p-6 rounded-[24px] shadow-sm border border-white/50 dark:border-white/10 hover:bg-white/50 dark:hover:bg-white/5 transition-colors group">
|
| 367 |
<div class="flex items-center gap-3 mb-4 border-b border-indigo-100/50 dark:border-white/10 pb-3"><div class="w-8 h-8 rounded-xl bg-cyan-100 dark:bg-cyan-500/20 flex items-center justify-center border border-cyan-200/50 dark:border-cyan-400/30 group-hover:scale-110 transition-transform"><i class="fas fa-cloud-sun text-cyan-600 dark:text-cyan-300 text-xs"></i></div><h4 class="font-black text-[11px] uppercase tracking-widest text-indigo-900 dark:text-purple-200">Conditions</h4></div>
|
| 368 |
<div class="space-y-4">
|
| 369 |
+
<div>
|
| 370 |
+
<label class="block text-[10px] font-black uppercase tracking-widest text-indigo-900/70 dark:text-purple-200/70 mb-1.5 ml-1">Weather</label>
|
| 371 |
+
<select id="tab_weather" class="predict-input bg-white/60 dark:bg-black/20 border border-indigo-200/60 dark:border-white/10 text-indigo-950 dark:text-white">
|
| 372 |
+
<option value="">Select...</option>
|
| 373 |
+
<option value="Clear">Clear</option>
|
| 374 |
+
<option value="Rainy">Rainy</option>
|
| 375 |
+
<option value="Foggy">Foggy</option>
|
| 376 |
+
<option value="Snowy">Snowy</option>
|
| 377 |
+
<option value="Stormy">Stormy</option>
|
| 378 |
+
</select>
|
| 379 |
+
</div>
|
| 380 |
+
<div>
|
| 381 |
+
<label class="block text-[10px] font-black uppercase tracking-widest text-indigo-900/70 dark:text-purple-200/70 mb-1.5 ml-1">Light Cond.</label>
|
| 382 |
+
<select id="tab_light" class="predict-input bg-white/60 dark:bg-black/20 border border-indigo-200/60 dark:border-white/10 text-indigo-950 dark:text-white">
|
| 383 |
+
<option value="">Select...</option>
|
| 384 |
+
<option value="Daylight">Daylight</option>
|
| 385 |
+
<option value="Artificial Light">Artificial Light</option>
|
| 386 |
+
<option value="No Light">No Light</option>
|
| 387 |
+
</select>
|
| 388 |
+
</div>
|
| 389 |
+
<div>
|
| 390 |
+
<label class="block text-[10px] font-black uppercase tracking-widest text-indigo-900/70 dark:text-purple-200/70 mb-1.5 ml-1">Time of Day</label>
|
| 391 |
+
<select id="tab_time" class="predict-input bg-white/60 dark:bg-black/20 border border-indigo-200/60 dark:border-white/10 text-indigo-950 dark:text-white">
|
| 392 |
+
<option value="">Select...</option>
|
| 393 |
+
<option value="Morning">Morning</option>
|
| 394 |
+
<option value="Afternoon">Afternoon</option>
|
| 395 |
+
<option value="Evening">Evening</option>
|
| 396 |
+
<option value="Night">Night</option>
|
| 397 |
+
</select>
|
| 398 |
+
</div>
|
| 399 |
</div>
|
| 400 |
</div>
|
| 401 |
|
| 402 |
<div class="ios-glass-inner p-5 sm:p-6 rounded-[24px] shadow-sm border border-white/50 dark:border-white/10 hover:bg-white/50 dark:hover:bg-white/5 transition-colors group">
|
| 403 |
<div class="flex items-center gap-3 mb-4 border-b border-indigo-100/50 dark:border-white/10 pb-3"><div class="w-8 h-8 rounded-xl bg-rose-100 dark:bg-rose-500/20 flex items-center justify-center border border-rose-200/50 dark:border-rose-400/30 group-hover:scale-110 transition-transform"><i class="fas fa-road text-rose-600 dark:text-rose-300 text-xs"></i></div><h4 class="font-black text-[11px] uppercase tracking-widest text-indigo-900 dark:text-purple-200">Road Specs</h4></div>
|
| 404 |
<div class="space-y-4">
|
| 405 |
+
<div>
|
| 406 |
+
<label class="block text-[10px] font-black uppercase tracking-widest text-indigo-900/70 dark:text-purple-200/70 mb-1.5 ml-1">Road Type</label>
|
| 407 |
+
<select id="tab_road_type" class="predict-input bg-white/60 dark:bg-black/20 border border-indigo-200/60 dark:border-white/10 text-indigo-950 dark:text-white">
|
| 408 |
+
<option value="">Select...</option>
|
| 409 |
+
<option value="City Road">City Road</option>
|
| 410 |
+
<option value="Highway">Highway</option>
|
| 411 |
+
<option value="Rural Road">Rural Road</option>
|
| 412 |
+
<option value="Mountain Road">Mountain Road</option>
|
| 413 |
+
</select>
|
| 414 |
+
</div>
|
| 415 |
+
<div>
|
| 416 |
+
<label class="block text-[10px] font-black uppercase tracking-widest text-indigo-900/70 dark:text-purple-200/70 mb-1.5 ml-1">Surface</label>
|
| 417 |
+
<select id="tab_road_cond" class="predict-input bg-white/60 dark:bg-black/20 border border-indigo-200/60 dark:border-white/10 text-indigo-950 dark:text-white">
|
| 418 |
+
<option value="">Select...</option>
|
| 419 |
+
<option value="Dry">Dry</option>
|
| 420 |
+
<option value="Wet">Wet</option>
|
| 421 |
+
<option value="Icy">Icy</option>
|
| 422 |
+
<option value="Under Construction">Under Construction</option>
|
| 423 |
+
</select>
|
| 424 |
+
</div>
|
| 425 |
+
<div>
|
| 426 |
+
<label class="block text-[10px] font-black uppercase tracking-widest text-indigo-900/70 dark:text-purple-200/70 mb-1.5 ml-1">Speed Limit</label>
|
| 427 |
+
<input type="number" id="tab_speed" placeholder="e.g. 60" min="10" max="250" class="predict-input bg-white/60 dark:bg-black/20 border border-indigo-200/60 dark:border-white/10 text-indigo-950 dark:text-white">
|
| 428 |
+
</div>
|
| 429 |
</div>
|
| 430 |
</div>
|
| 431 |
|
| 432 |
<div class="ios-glass-inner p-5 sm:p-6 rounded-[24px] shadow-sm border border-white/50 dark:border-white/10 hover:bg-white/50 dark:hover:bg-white/5 transition-colors group">
|
| 433 |
<div class="flex items-center gap-3 mb-4 border-b border-indigo-100/50 dark:border-white/10 pb-3"><div class="w-8 h-8 rounded-xl bg-amber-100 dark:bg-amber-500/20 flex items-center justify-center border border-amber-200/50 dark:border-amber-400/30 group-hover:scale-110 transition-transform"><i class="fas fa-car-side text-amber-600 dark:text-amber-300 text-xs"></i></div><h4 class="font-black text-[11px] uppercase tracking-widest text-indigo-900 dark:text-purple-200">Traffic Data</h4></div>
|
| 434 |
<div class="space-y-4">
|
| 435 |
+
<div>
|
| 436 |
+
<label class="block text-[10px] font-black uppercase tracking-widest text-indigo-900/70 dark:text-purple-200/70 mb-1.5 ml-1">Density (0-5)</label>
|
| 437 |
+
<input type="number" id="tab_density" placeholder="e.g. 2" min="0" max="5" class="predict-input bg-white/60 dark:bg-black/20 border border-indigo-200/60 dark:border-white/10 text-indigo-950 dark:text-white">
|
| 438 |
+
</div>
|
| 439 |
+
<div>
|
| 440 |
+
<label class="block text-[10px] font-black uppercase tracking-widest text-indigo-900/70 dark:text-purple-200/70 mb-1.5 ml-1">Vehicles Inv.</label>
|
| 441 |
+
<input type="number" id="tab_vehicles" placeholder="e.g. 2" min="1" max="20" class="predict-input bg-white/60 dark:bg-black/20 border border-indigo-200/60 dark:border-white/10 text-indigo-950 dark:text-white">
|
| 442 |
+
</div>
|
| 443 |
+
<div>
|
| 444 |
+
<label class="block text-[10px] font-black uppercase tracking-widest text-indigo-900/70 dark:text-purple-200/70 mb-1.5 ml-1">Vehicle Type</label>
|
| 445 |
+
<select id="tab_vehicle" class="predict-input bg-white/60 dark:bg-black/20 border border-indigo-200/60 dark:border-white/10 text-indigo-950 dark:text-white">
|
| 446 |
+
<option value="">Select...</option>
|
| 447 |
+
<option value="Car">Car</option>
|
| 448 |
+
<option value="Truck">Truck</option>
|
| 449 |
+
<option value="Bus">Bus</option>
|
| 450 |
+
<option value="Motorcycle">Motorcycle</option>
|
| 451 |
+
</select>
|
| 452 |
+
</div>
|
| 453 |
</div>
|
| 454 |
</div>
|
| 455 |
|
| 456 |
<div class="ios-glass-inner p-5 sm:p-6 rounded-[24px] shadow-sm border border-white/50 dark:border-white/10 hover:bg-white/50 dark:hover:bg-white/5 transition-colors group">
|
| 457 |
<div class="flex items-center gap-3 mb-4 border-b border-indigo-100/50 dark:border-white/10 pb-3"><div class="w-8 h-8 rounded-xl bg-fuchsia-100 dark:bg-fuchsia-500/20 flex items-center justify-center border border-fuchsia-200/50 dark:border-fuchsia-400/30 group-hover:scale-110 transition-transform"><i class="fas fa-user text-fuchsia-600 dark:text-fuchsia-300 text-xs"></i></div><h4 class="font-black text-[11px] uppercase tracking-widest text-indigo-900 dark:text-purple-200">Driver Profile</h4></div>
|
| 458 |
<div class="space-y-4">
|
| 459 |
+
<div>
|
| 460 |
+
<label class="block text-[10px] font-black uppercase tracking-widest text-indigo-900/70 dark:text-purple-200/70 mb-1.5 ml-1">Driver Age</label>
|
| 461 |
+
<input type="number" id="tab_age" placeholder="e.g. 35" min="16" max="99" class="predict-input bg-white/60 dark:bg-black/20 border border-indigo-200/60 dark:border-white/10 text-indigo-950 dark:text-white">
|
| 462 |
+
</div>
|
| 463 |
+
<div>
|
| 464 |
+
<label class="block text-[10px] font-black uppercase tracking-widest text-indigo-900/70 dark:text-purple-200/70 mb-1.5 ml-1">Experience (Yrs)</label>
|
| 465 |
+
<input type="number" id="tab_exp" placeholder="e.g. 5" min="0" max="80" class="predict-input bg-white/60 dark:bg-black/20 border border-indigo-200/60 dark:border-white/10 text-indigo-950 dark:text-white">
|
| 466 |
+
</div>
|
| 467 |
+
<div>
|
| 468 |
+
<label class="block text-[10px] font-black uppercase tracking-widest text-indigo-900/70 dark:text-purple-200/70 mb-1.5 ml-1">Drunk</label>
|
| 469 |
+
<select id="tab_alcohol" class="predict-input bg-white/60 dark:bg-black/20 border border-indigo-200/60 dark:border-white/10 text-indigo-950 dark:text-white">
|
| 470 |
+
<option value="">Select...</option>
|
| 471 |
+
<option value="No">No</option>
|
| 472 |
+
<option value="Yes">Yes</option>
|
| 473 |
+
</select>
|
| 474 |
+
</div>
|
| 475 |
</div>
|
| 476 |
</div>
|
| 477 |
</div>
|
|
|
|
| 754 |
alprSec.classList.remove('hidden');
|
| 755 |
alprCont.innerHTML = data.plates.map(p => `
|
| 756 |
<div class="flex items-center gap-2 bg-white/80 dark:bg-black/40 px-3 py-1.5 rounded-lg border border-indigo-100 dark:border-white/10 shadow-sm">
|
|
|
|
| 757 |
<span class="font-mono font-bold text-xs text-indigo-900 dark:text-white">${p.text}</span>
|
| 758 |
</div>
|
| 759 |
`).join('');
|
| 760 |
+
} else {
|
| 761 |
+
alprSec.classList.add('hidden');
|
| 762 |
+
alprCont.innerHTML = '';
|
| 763 |
}
|
| 764 |
} catch(e) {}
|
| 765 |
}
|
|
|
|
| 808 |
spinner.classList.remove('hidden');
|
| 809 |
|
| 810 |
const payload = {
|
| 811 |
+
Weather: document.getElementById('tab_weather').value,
|
| 812 |
+
Road_Light_Condition: document.getElementById('tab_light').value,
|
| 813 |
Time_of_Day: document.getElementById('tab_time').value,
|
| 814 |
Road_Type: document.getElementById('tab_road_type').value,
|
| 815 |
+
Road_Condition: document.getElementById('tab_road_cond').value,
|
| 816 |
Speed_Limit: document.getElementById('tab_speed').value,
|
| 817 |
Traffic_Density: document.getElementById('tab_density').value,
|
| 818 |
Number_of_Vehicles: document.getElementById('tab_vehicles').value,
|
| 819 |
Vehicle_Type: document.getElementById('tab_vehicle').value,
|
| 820 |
Driver_Age: document.getElementById('tab_age').value,
|
| 821 |
Driver_Experience: document.getElementById('tab_exp').value,
|
| 822 |
+
Driver_Alcohol: document.getElementById('tab_alcohol').value === "Yes" ? 1 : (document.getElementById('tab_alcohol').value === "No" ? 0 : "")
|
| 823 |
};
|
| 824 |
|
| 825 |
+
const inputs = ['tab_weather', 'tab_light', 'tab_time', 'tab_road_type', 'tab_road_cond', 'tab_speed', 'tab_density', 'tab_vehicles', 'tab_vehicle', 'tab_age', 'tab_exp', 'tab_alcohol'];
|
| 826 |
+
const isAllBlank = inputs.every(id => document.getElementById(id).value.trim() === "");
|
| 827 |
|
| 828 |
if (isAllBlank) {
|
| 829 |
document.getElementById('predictiveFormView').classList.add('hidden');
|