Download index.html from BlueUU/blueuu: direct link, hf CLI and curl.
- Browser
- Download file 36.3 kB
-
https://huggingface.co/spaces/BlueUU/blueuu/resolve/main/index.html
- Command line
-
hf download hf://spaces/BlueUU/blueuu/index.html
-
curl -L -o index.html https://huggingface.co/spaces/BlueUU/blueuu/resolve/main/index.html
36.3 kB
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>MarineFuelSafe - Ship Fuel Leakage Assessment</title> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> | |
| <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet"> | |
| <script src="https://cdn.jsdelivr.net/npm/chart.js"></script> | |
| <style> | |
| body { | |
| font-family: 'Inter', sans-serif; | |
| } | |
| .gradient-bg { | |
| background: linear-gradient(135deg, #1a237e 0%, #283593 100%); | |
| } | |
| .deck-grid { | |
| background-image: radial-gradient(circle, #2d3748 1px, transparent 1px); | |
| background-size: 20px 20px; | |
| } | |
| .concentration-gradient { | |
| background: radial-gradient(circle at center, rgba(239, 68, 68, 0.3) 0%, rgba(239, 68, 68, 0) 70%); | |
| } | |
| .risk-indicator { | |
| position: relative; | |
| z-index: 10; | |
| } | |
| .risk-indicator::after { | |
| content: ''; | |
| position: absolute; | |
| width: 100%; | |
| height: 100%; | |
| border-radius: 9999px; | |
| box-shadow: 0 0 15px currentColor; | |
| opacity: 0.3; | |
| } | |
| .pulse-warning { | |
| animation: pulse 2s infinite; | |
| } | |
| @keyframes pulse { | |
| 0% { transform: scale(0.95); opacity: 0.7; } | |
| 50% { transform: scale(1); opacity: 1; } | |
| 100% { transform: scale(0.95); opacity: 0.7; } | |
| } | |
| .blink-alarm { | |
| animation: blink 1s step-end infinite; | |
| } | |
| @keyframes blink { | |
| 50% { opacity: 0; } | |
| } | |
| #concentrationCanvas { | |
| mix-blend-mode: multiply; | |
| } | |
| </style> | |
| </head> | |
| <body class="bg-gray-50 text-gray-800"> | |
| <!-- Header --> | |
| <header class="gradient-bg text-white shadow-xl"> | |
| <div class="container mx-auto px-4 py-5"> | |
| <div class="flex flex-col lg:flex-row justify-between items-center"> | |
| <div class="flex items-center mb-4 lg:mb-0"> | |
| <div class="w-12 h-12 bg-white/10 rounded-xl flex items-center justify-center mr-3"> | |
| <i class="fas fa-ship text-2xl text-blue-300"></i> | |
| </div> | |
| <div> | |
| <h1 class="text-2xl font-bold">MarineFuelSafe</h1> | |
| <p class="text-sm text-blue-100">Ship Fuel Leakage Safety Assessment Platform</p> | |
| </div> | |
| </div> | |
| <div class="flex space-x-3"> | |
| <button id="designModeBtn" class="px-4 py-2 bg-blue-500/90 hover:bg-blue-600 rounded-lg font-medium transition flex items-center"> | |
| <i class="fas fa-drafting-compass mr-2"></i> Design Mode | |
| </button> | |
| <button id="operationModeBtn" class="px-4 py-2 bg-blue-500/20 hover:bg-blue-500/30 rounded-lg font-medium transition flex items-center"> | |
| <i class="fas fa-cogs mr-2"></i> Operation Mode | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| </header> | |
| <!-- Main Content --> | |
| <main class="container mx-auto px-4 py-6"> | |
| <!-- Mode Controls --> | |
| <div class="bg-white rounded-xl shadow-md p-4 mb-6"> | |
| <div class="flex flex-wrap items-center justify-between gap-4"> | |
| <div class="flex items-center space-x-4"> | |
| <div id="modeIndicator" class="bg-blue-50 text-blue-800 rounded-lg px-4 py-2 flex items-center"> | |
| <div class="w-2 h-2 rounded-full bg-blue-600 mr-2"></div> | |
| <span class="font-semibold text-sm">Design Mode Active</span> | |
| </div> | |
| <div class="hidden md:flex items-center space-x-1 text-sm text-gray-500"> | |
| <i class="fas fa-info-circle text-blue-500"></i> | |
| <span>Configure parameters in Design Mode</span> | |
| </div> | |
| </div> | |
| <div class="flex items-center space-x-2"> | |
| <button id="simulateBtn" class="px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg font-medium transition flex items-center"> | |
| <i class="fas fa-play mr-2"></i> Run Simulation | |
| </button> | |
| <button id="resetBtn" class="p-2 text-gray-500 hover:text-gray-700 rounded-lg transition"> | |
| <i class="fas fa-redo"></i> | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="grid grid-cols-1 lg:grid-cols-12 gap-6"> | |
| <!-- Input Parameters Panel --> | |
| <div class="lg:col-span-4"> | |
| <div class="bg-white rounded-xl shadow-md overflow-hidden"> | |
| <div class="bg-gradient-to-r from-blue-600 to-blue-700 text-white px-6 py-4"> | |
| <h2 class="text-xl font-bold flex items-center"> | |
| <i class="fas fa-sliders-h mr-3"></i> Input Parameters | |
| </h2> | |
| </div> | |
| <div class="p-6 space-y-6"> | |
| <!-- Fuel Type Selection --> | |
| <div class="space-y-2"> | |
| <label class="block text-sm font-medium text-gray-700">Fuel Type</label> | |
| <div class="grid grid-cols-3 gap-2"> | |
| <button class="fuel-type-btn bg-blue-100 border-2 border-blue-500 text-blue-700" data-value="ammonia"> | |
| <i class="fas fa-fire-extinguisher mr-1"></i> Ammonia | |
| </button> | |
| <button class="fuel-type-btn bg-gray-100 border border-gray-300 text-gray-700 hover:bg-gray-50" data-value="methanol"> | |
| <i class="fas fa-flask mr-1"></i> Methanol | |
| </button> | |
| <button class="fuel-type-btn bg-gray-100 border border-gray-300 text-gray-700 hover:bg-gray-50" data-value="hydrogen"> | |
| <i class="fas fa-atom mr-1"></i> Hydrogen | |
| </button> | |
| </div> | |
| </div> | |
| <!-- Leakage Scenario --> | |
| <div class="space-y-4"> | |
| <h3 class="text-sm font-semibold text-gray-800 uppercase tracking-wider">Leakage Scenario</h3> | |
| <div class="space-y-2"> | |
| <label class="block text-sm font-medium text-gray-700">Location</label> | |
| <select class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-blue-500 focus:border-blue-500"> | |
| <option value="bunkering" selected>Bunkering Station</option> | |
| <option value="preparation">Fuel Preparation Room</option> | |
| <option value="vent">Vent Mast</option> | |
| <option value="connection">Connection Area</option> | |
| </select> | |
| </div> | |
| <div class="grid grid-cols-2 gap-4"> | |
| <div> | |
| <label class="block text-sm font-medium text-gray-700">Leak Size (mm)</label> | |
| <div class="relative"> | |
| <input type="number" value="25" class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-blue-500 focus:border-blue-500"> | |
| <div class="absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none text-sm text-gray-500"> | |
| mm | |
| </div> | |
| </div> | |
| </div> | |
| <div> | |
| <label class="block text-sm font-medium text-gray-700">Flow Rate (kg/s)</label> | |
| <div class="relative"> | |
| <input type="number" value="1.2" step="0.1" class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-blue-500 focus:border-blue-500"> | |
| <div class="absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none text-sm text-gray-500"> | |
| kg/s | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Environmental Conditions --> | |
| <div class="space-y-4"> | |
| <h3 class="text-sm font-semibold text-gray-800 uppercase tracking-wider">Environment</h3> | |
| <div class="space-y-2"> | |
| <label class="block text-sm font-medium text-gray-700">Wind Conditions</label> | |
| <div class="grid grid-cols-2 gap-4"> | |
| <div> | |
| <label class="block text-xs text-gray-500">Speed (m/s)</label> | |
| <input type="number" value="2.5" step="0.1" class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-blue-500 focus:border-blue-500"> | |
| </div> | |
| <div> | |
| <label class="block text-xs text-gray-500">Direction</label> | |
| <select class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-blue-500 focus:border-blue-500"> | |
| <option value="0">N (0°)</option> | |
| <option value="45">NE (45°)</option> | |
| <option value="90" selected>E (90°)</option> | |
| <option value="135">SE (135°)</option> | |
| <option value="180">S (180°)</option> | |
| <option value="225">SW (225°)</option> | |
| <option value="270">W (270°)</option> | |
| <option value="315">NW (315°)</option> | |
| </select> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="space-y-2"> | |
| <label class="block text-sm font-medium text-gray-700">Ventilation</label> | |
| <div class="grid grid-cols-2 gap-4"> | |
| <div> | |
| <label class="block text-xs text-gray-500">Status</label> | |
| <select class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-blue-500 focus:border-blue-500"> | |
| <option value="on" selected>Active</option> | |
| <option value="off">Inactive</option> | |
| </select> | |
| </div> | |
| <div> | |
| <label class="block text-xs text-gray-500">Rate (ACH)</label> | |
| <input type="number" value="6" class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-blue-500 focus:border-blue-500"> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Emergency Procedures (Operation Mode) --> | |
| <div id="emergencyProcedures" class="bg-white rounded-xl shadow-md mt-6 hidden"> | |
| <div class="bg-gradient-to-r from-red-600 to-red-700 text-white px-6 py-4"> | |
| <h2 class="text-xl font-bold flex items-center"> | |
| <i class="fas fa-exclamation-triangle mr-3"></i> Emergency Procedures | |
| </h2> | |
| </div> | |
| <div class="p-6"> | |
| <div class="space-y-4"> | |
| <div class="flex items-start"> | |
| <div class="flex-shrink-0 bg-red-100 p-2 rounded-lg text-red-600"> | |
| <i class="fas fa-skull-crossbones"></i> | |
| </div> | |
| <div class="ml-3"> | |
| <h3 class="text-sm font-medium text-gray-800">Immediate Actions</h3> | |
| <p class="text-sm text-gray-600 mt-1">1. Activate emergency shutdown<br>2. Initiate evacuation protocol</p> | |
| </div> | |
| </div> | |
| <div class="flex items-start"> | |
| <div class="flex-shrink-0 bg-yellow-100 p-2 rounded-lg text-yellow-600"> | |
| <i class="fas fa-bell"></i> | |
| </div> | |
| <div class="ml-3"> | |
| <h3 class="text-sm font-medium text-gray-800">Alarm Settings</h3> | |
| <p class="text-sm text-gray-600 mt-1">Primary: 150 ppm (LFL threshold)<br>Secondary: 300 ppm (IDLH threshold)</p> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Visualization Panel --> | |
| <div class="lg:col-span-8"> | |
| <div class="bg-white rounded-xl shadow-md overflow-hidden h-full"> | |
| <div class="bg-gradient-to-r from-blue-600 to-blue-700 text-white px-6 py-4"> | |
| <div class="flex justify-between items-center"> | |
| <h2 class="text-xl font-bold flex items-center"> | |
| <i class="fas fa-chart-network mr-3"></i> Risk Heatmap Visualization | |
| </h2> | |
| <div class="flex space-x-2"> | |
| <button class="view-btn px-3 py-1 bg-white/20 hover:bg-white/30 rounded-lg text-sm transition"> | |
| <i class="fas fa-fire mr-1"></i> Hazards | |
| </button> | |
| <button class="view-btn px-3 py-1 bg-white/5 hover:bg-white/10 rounded-lg text-sm transition"> | |
| <i class="fas fa-route mr-1"></i> Escape Routes | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="p-4 h-[calc(100%-68px)]"> | |
| <!-- Ship Deck Visualization --> | |
| <div class="deck-grid relative h-full w-full rounded-lg overflow-hidden border border-gray-200"> | |
| <!-- Leak source marker --> | |
| <div id="leakSource" class="absolute w-8 h-8 rounded-full bg-red-600 shadow-xl flex items-center justify-center pulse-warning" style="left: 20%; top: 40%;"> | |
| <div class="w-4 h-4 rounded-full bg-white/90"></div> | |
| </div> | |
| <!-- Risk zones --> | |
| <div id="highRiskZone" class="risk-indicator absolute rounded-full bg-red-500/20 border-2 border-red-500" style="width: 15%; height: 15%; left: 20%; top: 40%; transform: translate(-50%, -50%); color: rgba(239, 68, 68, 0.3);"> | |
| <div class="absolute inset-0 flex items-center justify-center text-white font-bold text-xs">HIGH</div> | |
| </div> | |
| <div id="mediumRiskZone" class="risk-indicator absolute rounded-full bg-orange-500/20 border-2 border-orange-500" style="width: 25%; height: 25%; left: 20%; top: 40%; transform: translate(-50%, -50%); color: rgba(249, 115, 22, 0.3);"> | |
| <div class="absolute inset-0 flex items-center justify-center text-white font-bold text-xs">MEDIUM</div> | |
| </div> | |
| <div id="lowRiskZone" class="risk-indicator absolute rounded-full bg-yellow-500/20 border-2 border-yellow-500" style="width: 35%; height: 35%; left: 20%; top: 40%; transform: translate(-50%, -50%); color: rgba(234, 179, 8, 0.3);"> | |
| <div class="absolute inset-0 flex items-center justify-center text-white font-bold text-xs">LOW</div> | |
| </div> | |
| <!-- Concentration gradient --> | |
| <canvas id="concentrationCanvas" class="absolute inset-0 w-full h-full"></canvas> | |
| <!-- Legend --> | |
| <div class="absolute bottom-4 right-4 bg-white/90 rounded-lg shadow-md p-3 text-sm"> | |
| <div class="flex items-center mb-2"> | |
| <div class="w-4 h-4 rounded-full bg-red-500 mr-2"></div> | |
| <span>High Risk (IDLH)</span> | |
| </div> | |
| <div class="flex items-center mb-2"> | |
| <div class="w-4 h-4 rounded-full bg-orange-500 mr-2"></div> | |
| <span>Medium Risk (LFL)</span> | |
| </div> | |
| <div class="flex items-center mb-2"> | |
| <div class="w-4 h-4 rounded-full bg-yellow-500 mr-2"></div> | |
| <span>Low Risk</span> | |
| </div> | |
| <div class="flex items-center"> | |
| <div class="w-4 h-4 rounded-full bg-green-500 mr-2"></div> | |
| <span>Safe</span> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Graphs and Data Panels --> | |
| <div class="grid grid-cols-1 md:grid-cols-2 gap-6 mt-6"> | |
| <!-- Concentration Chart --> | |
| <div class="bg-white rounded-xl shadow-md overflow-hidden"> | |
| <div class="bg-gradient-to-r from-blue-600/10 to-blue-700/10 px-6 py-3 border-b border-gray-200"> | |
| <h3 class="text-lg font-semibold text-gray-800"> | |
| <i class="fas fa-chart-line mr-2 text-blue-600"></i> Concentration Timeline | |
| </h3> | |
| </div> | |
| <div class="p-4"> | |
| <div class="h-64"> | |
| <canvas id="concentrationChart"></canvas> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Risk Summary --> | |
| <div class="bg-white rounded-xl shadow-md overflow-hidden"> | |
| <div class="bg-gradient-to-r from-blue-600/10 to-blue-700/10 px-6 py-3 border-b border-gray-200"> | |
| <h3 class="text-lg font-semibold text-gray-800"> | |
| <i class="fas fa-shield-alt mr-2 text-blue-600"></i> Risk Assessment | |
| </h3> | |
| </div> | |
| <div class="p-4 space-y-4"> | |
| <div> | |
| <h4 class="text-sm font-medium text-gray-700 mb-2">Hazard Radius</h4> | |
| <div class="grid grid-cols-2 gap-2"> | |
| <div class="bg-red-50 p-3 rounded-lg text-center"> | |
| <div class="text-xs text-red-600 mb-1">High Risk</div> | |
| <div class="font-bold text-red-700">2.8 m</div> | |
| </div> | |
| <div class="bg-orange-50 p-3 rounded-lg text-center"> | |
| <div class="text-xs text-orange-600 mb-1">Medium Risk</div> | |
| <div class="font-bold text-orange-700">5.4 m</div> | |
| </div> | |
| <div class="bg-yellow-50 p-3 rounded-lg text-center"> | |
| <div class="text-xs text-yellow-600 mb-1">Low Risk</div> | |
| <div class="font-bold text-yellow-700">8.1 m</div> | |
| </div> | |
| <div class="bg-green-50 p-3 rounded-lg text-center"> | |
| <div class="text-xs text-green-600 mb-1">Safe Distance</div> | |
| <div class="font-bold text-green-700">10.5 m</div> | |
| </div> | |
| </div> | |
| </div> | |
| <div> | |
| <h4 class="text-sm font-medium text-gray-700 mb-2">Time to Hazard</h4> | |
| <div class="grid grid-cols-2 gap-4"> | |
| <div> | |
| <div class="text-xs text-gray-500 mb-1">To Critical (ASET)</div> | |
| <div class="text-xl font-bold text-blue-600">52 s</div> | |
| </div> | |
| <div> | |
| <div class="text-xs text-gray-500 mb-1">To Escape (RSET)</div> | |
| <div class="text-xl font-bold text-purple-600">35 s</div> | |
| </div> | |
| </div> | |
| <div class="mt-3"> | |
| <div class="flex justify-between text-xs text-gray-500 mb-1"> | |
| <span>Safe Margin</span> | |
| <span>+17 s</span> | |
| </div> | |
| <div class="w-full bg-gray-200 rounded-full h-2"> | |
| <div class="bg-green-500 h-2 rounded-full" style="width: 100%"></div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Simulation Log --> | |
| <div class="bg-white rounded-xl shadow-md mt-6"> | |
| <div class="bg-gradient-to-r from-blue-600/10 to-blue-700/10 px-6 py-3 border-b border-gray-200"> | |
| <h3 class="text-lg font-semibold text-gray-800"> | |
| <i class="fas fa-clipboard-list mr-2 text-blue-600"></i> Simulation Log | |
| </h3> | |
| </div> | |
| <div class="p-4"> | |
| <div class="bg-gray-50 rounded-lg p-4 font-mono text-sm h-40 overflow-y-auto"> | |
| <div class="text-gray-500">No simulation data available. Run a simulation to see results.</div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </main> | |
| <!-- Footer --> | |
| <footer class="bg-gray-800 text-white py-8 mt-12"> | |
| <div class="container mx-auto px-4"> | |
| <div class="flex flex-col md:flex-row justify-between items-center"> | |
| <div class="mb-6 md:mb-0"> | |
| <h2 class="text-lg font-bold">MarineFuelSafe</h2> | |
| <p class="text-sm opacity-80">Advanced Marine Fuel Risk Assessment System</p> | |
| </div> | |
| <div class="flex space-x-6"> | |
| <a href="#" class="hover:text-blue-300 transition"> | |
| <i class="fab fa-github text-xl"></i> | |
| </a> | |
| <a href="#" class="hover:text-blue-300 transition"> | |
| <i class="fab fa-linkedin text-xl"></i> | |
| </a> | |
| <a href="#" class="hover:text-blue-300 transition"> | |
| <i class="fas fa-envelope text-xl"></i> | |
| </a> | |
| </div> | |
| </div> | |
| <div class="mt-6 pt-6 border-t border-gray-700 text-sm text-center opacity-70"> | |
| © 2023 MarineFuelSafe. All rights reserved. | |
| </div> | |
| </div> | |
| </footer> | |
| <script> | |
| // Initialize UI components | |
| document.addEventListener('DOMContentLoaded', function() { | |
| // Fuel type selection buttons | |
| const fuelTypeBtns = document.querySelectorAll('.fuel-type-btn'); | |
| fuelTypeBtns.forEach(btn => { | |
| btn.addEventListener('click', function() { | |
| fuelTypeBtns.forEach(b => { | |
| b.classList.remove('bg-blue-100', 'border-blue-500', 'text-blue-700'); | |
| b.classList.add('bg-gray-100', 'border-gray-300', 'text-gray-700', 'hover:bg-gray-50'); | |
| }); | |
| this.classList.add('bg-blue-100', 'border-blue-500', 'text-blue-700'); | |
| this.classList.remove('bg-gray-100', 'border-gray-300', 'hover:bg-gray-50'); | |
| // Update visualization based on fuel type | |
| updateVisualization(); | |
| }); | |
| }); | |
| // Mode switching | |
| const designModeBtn = document.getElementById('designModeBtn'); | |
| const operationModeBtn = document.getElementById('operationModeBtn'); | |
| const emergencyProcedures = document.getElementById('emergencyProcedures'); | |
| operationModeBtn.addEventListener('click', function() { | |
| designModeBtn.classList.remove('bg-blue-500/90'); | |
| designModeBtn.classList.add('bg-blue-500/20', 'hover:bg-blue-500/30'); | |
| this.classList.remove('bg-blue-500/20', 'hover:bg-blue-500/30'); | |
| this.classList.add('bg-blue-500/90', 'hover:bg-blue-600'); | |
| emergencyProcedures.classList.remove('hidden'); | |
| // Update visualization for operation mode | |
| document.getElementById('modeIndicator').innerHTML = ` | |
| <div class="w-2 h-2 rounded-full bg-green-500 mr-2"></div> | |
| <span class="font-semibold text-sm">Operation Mode Active</span> | |
| `; | |
| }); | |
| designModeBtn.addEventListener('click', function() { | |
| operationModeBtn.classList.remove('bg-blue-500/90'); | |
| operationModeBtn.classList.add('bg-blue-500/20', 'hover:bg-blue-500/30'); | |
| this.classList.remove('bg-blue-500/20', 'hover:bg-blue-500/30'); | |
| this.classList.add('bg-blue-500/90', 'hover:bg-blue-600'); | |
| emergencyProcedures.classList.add('hidden'); | |
| // Update visualization for design mode | |
| document.getElementById('modeIndicator').innerHTML = ` | |
| <div class="w-2 h-2 rounded-full bg-blue-600 mr-2"></div> | |
| <span class="font-semibold text-sm">Design Mode Active</span> | |
| `; | |
| }); | |
| // Initialize concentration chart | |
| const concentrationChartCtx = document.getElementById('concentrationChart').getContext('2d'); | |
| const concentrationChart = new Chart(concentrationChartCtx, { | |
| type: 'line', | |
| data: { | |
| labels: ['0', '5', '10', '15', '20', '25', '30', '35', '40', '45', '50'], | |
| datasets: [{ | |
| label: 'Concentration (ppm)', | |
| data: [0, 5, 15, 30, 50, 90, 150, 220, 290, 320, 350], | |
| borderColor: '#3b82f6', | |
| backgroundColor: 'rgba(59, 130, 246, 0.1)', | |
| borderWidth: 2, | |
| fill: true, | |
| tension: 0.4 | |
| }, { | |
| label: 'IDLH Threshold', | |
| data: Array(11).fill(300), | |
| borderColor: '#ef4444', | |
| borderWidth: 1, | |
| borderDash: [6, 6], | |
| fill: false | |
| }, { | |
| label: 'LFL Threshold', | |
| data: Array(11).fill(150), | |
| borderColor: '#f97316', | |
| borderWidth: 1, | |
| borderDash: [6, 6], | |
| fill: false | |
| }] | |
| }, | |
| options: { | |
| responsive: true, | |
| maintainAspectRatio: false, | |
| plugins: { | |
| legend: { | |
| display: false | |
| } | |
| }, | |
| scales: { | |
| y: { | |
| beginAtZero: true, | |
| title: { | |
| display: true, | |
| text: 'Concentration (ppm)' | |
| } | |
| }, | |
| x: { | |
| title: { | |
| display: true, | |
| text: 'Time (seconds)' | |
| } | |
| } | |
| }, | |
| elements: { | |
| point: { | |
| radius: 0 | |
| } | |
| } | |
| } | |
| }); | |
| // Draw concentration visualization | |
| drawConcentrationGradient(); | |
| // Simulate button action | |
| document.getElementById('simulateBtn').addEventListener('click', function() { | |
| const btn = this; | |
| btn.innerHTML = '<i class="fas fa-spinner fa-spin mr-2"></i> Simulating...'; | |
| btn.disabled = true; | |
| setTimeout(function() { | |
| btn.innerHTML = '<i class="fas fa-check-circle mr-2"></i> Simulation Complete'; | |
| // Update results | |
| updateSimulationResults(); | |
| setTimeout(function() { | |
| btn.innerHTML = '<i class="fas fa-play mr-2"></i> Run Simulation'; | |
| btn.disabled = false; | |
| }, 2000); | |
| }, 3000); | |
| }); | |
| }); | |
| function drawConcentrationGradient() { | |
| const canvas = document.getElementById('concentrationCanvas'); | |
| const ctx = canvas.getContext('2d'); | |
| // Set canvas dimensions to match its display size | |
| canvas.width = canvas.offsetWidth; | |
| canvas.height = canvas.offsetHeight; | |
| // Clear canvas | |
| ctx.clearRect(0, 0, canvas.width, canvas.height); | |
| // Create gradient (positioned at leak source) | |
| const leakX = canvas.width * 0.2; | |
| const leakY = canvas.height * 0.4; | |
| const gradient = ctx.createRadialGradient( | |
| leakX, leakY, 10, | |
| leakX, leakY, canvas.width * 0.4 | |
| ); | |
| gradient.addColorStop(0, 'rgba(239, 68, 68, 0.8)'); | |
| gradient.addColorStop(0.2, 'rgba(239, 68, 68, 0.5)'); | |
| gradient.addColorStop(0.4, 'rgba(249, 115, 22, 0.4)'); | |
| gradient.addColorStop(0.6, 'rgba(234, 179, 8, 0.3)'); | |
| gradient.addColorStop(0.8, 'rgba(59, 130, 246, 0.1)'); | |
| gradient.addColorStop(1, 'rgba(59, 130, 246, 0)'); | |
| // Apply wind effect | |
| const windDirection = document.querySelector('select[value="90"]').value * Math.PI / 180; | |
| const windSpeed = parseFloat(document.querySelector('input[value="2.5"]').value); | |
| ctx.save(); | |
| ctx.translate(leakX, leakY); | |
| ctx.rotate(windDirection - Math.PI/2); | |
| ctx.scale(1, 0.7 + (windSpeed * 0.1)); | |
| ctx.translate(-leakX, -leakY); | |
| // Draw gradient | |
| ctx.fillStyle = gradient; | |
| ctx.beginPath(); | |
| ctx.arc(leakX, leakY, canvas.width * 0.4, 0, Math.PI * 2); | |
| ctx.fill(); | |
| ctx.restore(); | |
| } | |
| function updateVisualization() { | |
| // This would update the visualization based on selected fuel type | |
| drawConcentrationGradient(); | |
| } | |
| function updateSimulationResults() { | |
| // Update hazard radii | |
| document.getElementById('highRiskRadius').textContent = '3.2 m'; | |
| document.getElementById('mediumRiskRadius').textContent = '5.8 m'; | |
| document.getElementById('lowRiskRadius').textContent = '8.4 m'; | |
| // Update timeline | |
| document.querySelector('#concentrationChart').textContent = 'Updated Chart Data'; | |
| // Update log | |
| const logDiv = document.querySelector('.bg-gray-50'); | |
| logDiv.innerHTML = ` | |
| <div class="text-green-600">[${new Date().toLocaleTimeString()}] Simulation completed successfully</div> | |
| <div class="ml-4 text-green-700">- Hazard radii calculated</div> | |
| <div class="ml-4 text-green-700">- Concentration timeline updated</div> | |
| <div class="ml-4 text-green-700">- Safety assessment generated</div> | |
| <div class="mt-2 text-blue-600">[${new Date().toLocaleTimeString()}] Initializing gas dispersion model</div> | |
| <div class="mt-2 text-blue-600">[${new Date().toLocaleTimeString()}] Calculating risk zones</div> | |
| ` + logDiv.innerHTML; | |
| } | |
| </script> | |
| <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=BlueUU/blueuu" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> | |
| </html> |