BlueUU commited on
Commit
8a61845
·
verified ·
1 Parent(s): 1f646cd

Visualization放在输入区的右侧 - Initial Deployment

Browse files
Files changed (2) hide show
  1. README.md +7 -5
  2. index.html +793 -19
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Blueuu
3
- emoji: 🌍
4
- colorFrom: green
5
- colorTo: purple
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: blueuu
3
+ emoji: 🐳
4
+ colorFrom: pink
5
+ colorTo: red
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
index.html CHANGED
@@ -1,19 +1,793 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Ship Fuel Leakage Safety Assessment Platform</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9
+ <style>
10
+ .gradient-bg {
11
+ background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
12
+ }
13
+ .risk-high {
14
+ background-color: #ef4444;
15
+ }
16
+ .risk-medium {
17
+ background-color: #f97316;
18
+ }
19
+ .risk-low {
20
+ background-color: #f59e0b;
21
+ }
22
+ .risk-safe {
23
+ background-color: #10b981;
24
+ }
25
+ .ship-deck {
26
+ background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect width="100" height="100" fill="%232d3748"/><path d="M0,50 L100,50 M50,0 L50,100" stroke="%234a5568" stroke-width="1"/></svg>');
27
+ background-size: 20px 20px;
28
+ }
29
+ .concentration-map {
30
+ background: rgba(0, 0, 0, 0.5);
31
+ border-radius: 8px;
32
+ }
33
+ #concentrationCanvas {
34
+ mix-blend-mode: multiply;
35
+ }
36
+ .blink-warning {
37
+ animation: blink 1s infinite;
38
+ }
39
+ @keyframes blink {
40
+ 0% { opacity: 1; }
41
+ 50% { opacity: 0.5; }
42
+ 100% { opacity: 1; }
43
+ }
44
+ </style>
45
+ </head>
46
+ <body class="bg-gray-900 text-gray-100 font-sans">
47
+ <!-- Header -->
48
+ <header class="gradient-bg text-white shadow-lg">
49
+ <div class="container mx-auto px-4 py-6">
50
+ <div class="flex flex-col md:flex-row justify-between items-center">
51
+ <div class="flex items-center mb-4 md:mb-0">
52
+ <i class="fas fa-ship text-3xl mr-3"></i>
53
+ <h1 class="text-2xl font-bold">Ship Fuel Leakage Safety Assessment Platform</h1>
54
+ </div>
55
+ <div class="flex space-x-4">
56
+ <button id="designModeBtn" class="px-4 py-2 bg-blue-600 rounded-lg font-medium hover:bg-blue-700 transition">Design Mode</button>
57
+ <button id="operationModeBtn" class="px-4 py-2 bg-blue-600 rounded-lg font-medium hover:bg-blue-700 transition">Operation Mode</button>
58
+ </div>
59
+ </div>
60
+ </div>
61
+ </header>
62
+
63
+ <!-- Main Content -->
64
+ <main class="container mx-auto px-4 py-8">
65
+ <!-- System Mode Indicator with Simulation Button -->
66
+ <div class="flex items-center space-x-4 mb-8">
67
+ <div id="modeIndicator" class="bg-gray-800 text-white rounded-lg shadow-md p-4 flex items-center">
68
+ <div class="w-3 h-3 rounded-full bg-green-500 mr-2"></div>
69
+ <span class="font-semibold">Current Mode: <span id="currentMode">Design Mode</span></span>
70
+ </div>
71
+ <button id="simulateBtn" class="px-3 py-2 bg-blue-600 text-white rounded-lg font-medium hover:bg-blue-700 transition flex items-center">
72
+ <i class="fas fa-play mr-2"></i> Run
73
+ </button>
74
+ <button id="resetBtn" class="px-3 py-2 bg-gray-200 text-gray-700 rounded-lg font-medium hover:bg-gray-300 transition">
75
+ <i class="fas fa-redo"></i>
76
+ </button>
77
+ </div>
78
+
79
+ <div class="grid grid-cols-1 lg:grid-cols-5 gap-8">
80
+ <!-- Input Parameters Panel -->
81
+ <div class="bg-gray-900 rounded-lg shadow-md p-6 lg:col-span-2 border border-gray-800">
82
+ <h2 class="text-xl font-bold mb-4 flex items-center">
83
+ <i class="fas fa-sliders-h mr-2 text-blue-600"></i> Input Parameters
84
+ </h2>
85
+
86
+ <!-- Fuel Type Selection -->
87
+ <div class="mb-6">
88
+ <label class="block text-sm font-medium text-gray-300 mb-1">Fuel Type</label>
89
+ <select id="fuelType" class="w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 text-white">
90
+ <option value="ammonia" selected>氨 (Ammonia)</option>
91
+ <option value="methanol">甲醇 (Methanol)</option>
92
+ <option value="hydrogen">氢 (Hydrogen)</option>
93
+ </select>
94
+ </div>
95
+
96
+ <!-- Leakage Scenario -->
97
+ <div class="mb-6">
98
+ <label class="block text-sm font-medium text-gray-700 mb-1">泄漏场景</label>
99
+ <div class="mb-3">
100
+ <label class="block text-xs text-gray-400 mb-1">位置</label>
101
+ <select id="leakLocation" class="w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 text-white">
102
+ <option value="bunkering">加注站</option>
103
+ <option value="preparation">燃料准备间</option>
104
+ <option value="vent" selected>透气桅</option>
105
+ <option value="connection">接管区</option>
106
+ </select>
107
+ </div>
108
+ <div class="grid grid-cols-2 gap-6">
109
+ <div>
110
+ <label class="block text-xs text-gray-500 mb-1">泄漏压力 (bar)</label>
111
+ <input id="leakPressure" type="number" min="0" step="0.1" value="8" class="w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 text-white placeholder-gray-400">
112
+ </div>
113
+ <div>
114
+ <label class="block text-xs text-gray-500 mb-1">泄漏温度 (℃)</label>
115
+ <input id="leakTemp" type="number" value="-33" class="w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 text-white placeholder-gray-400">
116
+ </div>
117
+ </div>
118
+ <div class="grid grid-cols-2 gap-4 mt-3">
119
+ <div>
120
+ <label class="block text-xs text-gray-500 mb-1">孔径 (mm)</label>
121
+ <input id="leakSize" type="number" value="25" class="w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 text-white placeholder-gray-400">
122
+ </div>
123
+ <div>
124
+ <label class="block text-xs text-gray-500 mb-1">速率 (kg/s)</label>
125
+ <input id="leakRate" type="number" min="0" step="0.1" value="1" class="w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 text-white">
126
+ </div>
127
+ <div>
128
+ <label class="block text-xs text-gray-500 mb-1">泄放方向</label>
129
+ <select id="leakDirection" class="w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 text-white">
130
+ <option value="horizontal">水平</option>
131
+ <option value="vertical">垂直</option>
132
+ <option value="any">任意</option>
133
+ </select>
134
+ </div>
135
+ <div>
136
+ <label class="block text-xs text-gray-500 mb-1">舱容积 (m³)</label>
137
+ <input id="compartmentVolume" type="number" min="0" value="7000" class="w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 text-white">
138
+ </div>
139
+ <div>
140
+ <label class="block text-xs text-gray-500 mb-1">持续时间 (s)</label>
141
+ <input id="leakDuration" type="number" min="0" value="30" class="w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 text-white">
142
+ </div>
143
+ </div>
144
+ </div>
145
+
146
+ <!-- Exposure Point -->
147
+ <div class="mb-6">
148
+ <label class="block text-white font-medium mb-1">暴露点位置</label>
149
+ <div class="mb-3">
150
+ <label class="block text-xs text-gray-500 mb-1">位置类型</label>
151
+ <select id="exposureLocation" class="w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 text-white">
152
+ <option value="anchoring">锚泊操作站</option>
153
+ <option value="escape">逃口</option>
154
+ <option value="bridge">驾驶室</option>
155
+ <option value="lifeboat" selected>救生艇集合站</option>
156
+ <option value="electrical">近旁电气设备</option>
157
+ <option value="other">其他位置</option>
158
+ </select>
159
+ </div>
160
+ </div>
161
+
162
+ <!-- Environmental Conditions -->
163
+ <div class="mb-6">
164
+ <label class="block text-white font-medium mb-1">环境条件</label>
165
+ <div class="grid grid-cols-2 gap-4">
166
+ <div>
167
+ <label class="block text-xs text-gray-500 mb-1">风速 (m/s)</label>
168
+ <input id="windSpeed" type="number" min="0" step="0.1" value="2.5" class="w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 text-white">
169
+ </div>
170
+ <div>
171
+ <label class="block text-xs text-gray-500 mb-1">风向 (°)</label>
172
+ <input id="windDirection" type="number" min="0" max="360" value="90" class="w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 text-white">
173
+ </div>
174
+ </div>
175
+ <div class="grid grid-cols-2 gap-4 mt-3">
176
+ <div>
177
+ <label class="block text-xs text-gray-500 mb-1">点火源类型</label>
178
+ <select id="ignitionType" class="w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 text-white">
179
+ <option value="none">无</option>
180
+ <option value="flame" selected>明火</option>
181
+ <option value="surface">热表面</option>
182
+ <option value="electrical">电气</option>
183
+ </select>
184
+ </div>
185
+ </div>
186
+ </div>
187
+
188
+ <!-- Ventilation -->
189
+ <div class="mb-6">
190
+ <label class="block text-white font-medium mb-1">Ventilation Status</label>
191
+ <div class="flex items-center space-x-4">
192
+ <div class="flex items-center">
193
+ <input id="ventilationOn" name="ventilation" type="radio" class="h-4 w-4 text-blue-500 focus:ring-blue-500" checked>
194
+ <label for="ventilationOn" class="ml-2 block text-sm text-gray-300">On</label>
195
+ </div>
196
+ <div class="flex items-center">
197
+ <input id="ventilationOff" name="ventilation" type="radio" class="h-4 w-4 text-blue-500 focus:ring-blue-500">
198
+ <label for="ventilationOff" class="ml-2 block text-sm text-gray-300">Off</label>
199
+ </div>
200
+ </div>
201
+ <div class="mt-2">
202
+ <label class="block text-xs text-gray-500 mb-1">Ventilation Rate (ACH)</label>
203
+ <input id="ventilationRate" type="number" min="0" step="0.1" value="5.0" class="w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 text-white">
204
+ </div>
205
+ </div>
206
+
207
+
208
+ <!-- Personnel Location (shown only when "other" is selected) -->
209
+ <div id="personnelLocationContainer" class="hidden">
210
+ <div class="grid grid-cols-2 gap-4 mt-3">
211
+ <div>
212
+ <label class="block text-xs text-gray-500 mb-1">X Coordinate (m)</label>
213
+ <input id="personX" type="number" min="0" step="0.1" value="10.0" disabled class="w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 text-white">
214
+ </div>
215
+ <div>
216
+ <label class="block text-xs text-gray-500 mb-1">Y Coordinate (m)</label>
217
+ <input id="personY" type="number" min="0" step="0.1" value="10.0" disabled class="w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 text-white">
218
+ </div>
219
+ </div>
220
+ </div>
221
+ </div>
222
+
223
+
224
+ <!-- Sensor Data Connection (Operation Mode) -->
225
+ <div id="sensorConnection" class="mt-6 hidden">
226
+ <div class="flex items-center justify-between mb-2">
227
+ <h3 class="text-sm font-medium text-gray-700">Sensor Data Connection</h3>
228
+ <span class="px-2 py-1 text-xs rounded-full bg-green-100 text-green-800">Connected</span>
229
+ </div>
230
+ <div class="bg-gray-700 p-3 rounded-md">
231
+ <div class="grid grid-cols-3 gap-2 text-xs">
232
+ <div class="text-gray-500">Gas Conc:</div>
233
+ <div class="col-span-2 font-mono">0.0 ppm</div>
234
+
235
+ <div class="text-gray-500">Wind Speed:</div>
236
+ <div class="col-span-2 font-mono">0.0 m/s</div>
237
+
238
+ <div class="text-gray-500">Wind Dir:</div>
239
+ <div class="col-span-2 font-mono">0°</div>
240
+
241
+ <div class="text-gray-500">Temp:</div>
242
+ <div class="col-span-2 font-mono">20.0 °C</div>
243
+ </div>
244
+ </div>
245
+ </div>
246
+ </div>
247
+
248
+ <!-- Visualization Panel -->
249
+ <div class="bg-gray-900 rounded-lg shadow-md p-6 lg:col-span-3 border border-gray-800">
250
+ <h2 class="text-xl font-bold mb-4 flex items-center">
251
+ <i class="fas fa-chart-area mr-2 text-blue-600"></i> Visualization
252
+ </h2>
253
+
254
+ <!-- Ship Deck Visualization -->
255
+ <div class="ship-deck relative h-[500px] w-full rounded-md overflow-hidden mb-6">
256
+ <div id="leakSource" class="absolute w-4 h-4 rounded-full bg-red-600 shadow-lg transform -translate-x-2 -translate-y-2" style="left: 50px; top: 50px;"></div>
257
+ <div id="personMarker" class="absolute w-4 h-4 rounded-full bg-blue-600 shadow-lg transform -translate-x-2 -translate-y-2 flex items-center justify-center">
258
+ <div class="w-2 h-2 rounded-full bg-white"></div>
259
+ </div>
260
+ <div id="escapeRoute" class="absolute w-full h-full pointer-events-none"></div>
261
+ <canvas id="concentrationCanvas" class="absolute w-full h-full"></canvas>
262
+
263
+ <!-- Default Risk Zones -->
264
+ <div class="absolute rounded-full border-2 border-red-500" style="width: 100px; height: 100px; left: 0; top: 0; transform: translate(25px, 25px);"></div>
265
+ <div class="absolute rounded-full border-2 border-orange-500" style="width: 200px; height: 200px; left: 0; top: 0; transform: translate(-25px, -25px);"></div>
266
+ <div class="absolute rounded-full border-2 border-yellow-500" style="width: 300px; height: 300px; left: 0; top: 0; transform: translate(-75px, -75px);"></div>
267
+
268
+ <!-- Legend -->
269
+ <div class="concentration-map absolute bottom-4 right-4 p-2 text-white text-xs">
270
+ <div class="flex items-center mb-1">
271
+ <div class="w-3 h-3 rounded-full bg-red-500 mr-1"></div>
272
+ <span>High Risk (IDLH)</span>
273
+ </div>
274
+ <div class="flex items-center mb-1">
275
+ <div class="w-3 h-3 rounded-full bg-orange-500 mr-1"></div>
276
+ <span>Medium Risk (LFL)</span>
277
+ </div>
278
+ <div class="flex items-center mb-1">
279
+ <div class="w-3 h-3 rounded-full bg-yellow-500 mr-1"></div>
280
+ <span>Low Risk</span>
281
+ </div>
282
+ <div class="flex items-center">
283
+ <div class="w-3 h-3 rounded-full bg-green-500 mr-1"></div>
284
+ <span>Safe</span>
285
+ </div>
286
+ </div>
287
+ </div>
288
+
289
+ <!-- Concentration Time Curve -->
290
+ <div class="bg-gray-900 p-4 rounded-lg shadow mb-6 border border-gray-800">
291
+ <h3 class="font-medium text-gray-700 mb-3 text-lg">Concentration Over Time at Observation Point</h3>
292
+ <div class="h-64">
293
+ <canvas id="concentrationChart"></canvas>
294
+ </div>
295
+ <div class="mt-2 text-sm text-gray-500">
296
+ <div class="flex items-center">
297
+ <div class="w-3 h-3 rounded-full bg-red-500 mr-2"></div>
298
+ <span>IDLH Level (300 ppm)</span>
299
+ </div>
300
+ <div class="flex items-center">
301
+ <div class="w-3 h-3 rounded-full bg-orange-500 mr-2"></div>
302
+ <span>LFL Level (150 ppm)</span>
303
+ </div>
304
+ </div>
305
+ <div class="mt-2 text-xs text-gray-400">
306
+ Sample data showing typical concentration buildup over time
307
+ </div>
308
+ </div>
309
+
310
+ <!-- Hazard and Escape Time Summary -->
311
+ <div id="hazardSummary" class="mb-8">
312
+ <h3 class="font-medium text-gray-700 mb-3 text-lg">Hazard Radius Analysis</h3>
313
+ <div class="grid grid-cols-4 gap-4 text-center mb-6">
314
+ <div class="bg-gray-700 p-2 rounded">
315
+ <div class="text-xs text-red-400">High Risk</div>
316
+ <div class="font-bold text-white" id="highRiskRadius">3.2 m</div>
317
+ </div>
318
+ <div class="bg-gray-700 p-2 rounded">
319
+ <div class="text-xs text-orange-400">Medium Risk</div>
320
+ <div class="font-bold text-white" id="mediumRiskRadius">5.8 m</div>
321
+ </div>
322
+ <div class="bg-gray-700 p-2 rounded">
323
+ <div class="text-xs text-yellow-400">Low Risk</div>
324
+ <div class="font-bold text-white" id="lowRiskRadius">8.4 m</div>
325
+ </div>
326
+ <div class="bg-gray-700 p-2 rounded">
327
+ <div class="text-xs text-green-400">Safe Distance</div>
328
+ <div class="font-bold text-white" id="safeDistance">10.0 m</div>
329
+ </div>
330
+ </div>
331
+
332
+ <h3 class="font-medium text-gray-700 mb-3 text-lg">Escape Time Analysis</h3>
333
+ <div class="grid grid-cols-3 gap-6">
334
+ <div class="bg-blue-50 p-3 rounded">
335
+ <div class="text-xs text-blue-800 mb-1">Available Safe Egress Time</div>
336
+ <div class="text-xl font-bold text-blue-600" id="asetTime">0 s</div>
337
+ </div>
338
+ <div class="bg-purple-50 p-3 rounded">
339
+ <div class="text-xs text-purple-800 mb-1">Required Safe Egress Time</div>
340
+ <div class="text-xl font-bold text-purple-600" id="rsetTime">0 s</div>
341
+ </div>
342
+ <div class="p-3 rounded" id="escapeResultContainer">
343
+ <div class="text-xs mb-1">Safety Margin</div>
344
+ <div class="text-xl font-bold" id="escapeResult">0 s</div>
345
+ </div>
346
+ </div>
347
+ <div class="mt-3">
348
+ <div class="flex justify-between text-xs text-gray-500 mb-1">
349
+ <span>Leak Start</span>
350
+ <span>Critical Time</span>
351
+ </div>
352
+ <div class="w-full bg-gray-200 rounded-full h-2.5">
353
+ <div id="timeProgress" class="bg-blue-600 h-2.5 rounded-full" style="width: 0%"></div>
354
+ </div>
355
+ </div>
356
+ </div>
357
+
358
+ <!-- Alarm Status -->
359
+ <div id="alarmStatus" class="mt-6 p-4 rounded-lg hidden">
360
+ <div class="flex items-center">
361
+ <div class="w-3 h-3 rounded-full mr-2 blink-warning"></div>
362
+ <div class="font-bold" id="alarmMessage">WARNING: Immediate evacuation required!</div>
363
+ </div>
364
+ <div class="mt-2 text-sm" id="alarmDetails">
365
+ The current location will reach dangerous concentration levels in <span class="font-bold">15 seconds</span>.
366
+ Estimated escape time is <span class="font-bold">25 seconds</span>.
367
+ </div>
368
+ </div>
369
+ </div>
370
+ </div>
371
+
372
+ <!-- Conclusion Card -->
373
+ <div class="bg-gray-900 rounded-lg shadow-md p-6 mt-8 border border-gray-800">
374
+ <h2 class="text-xl font-bold mb-4 flex items-center">
375
+ <i class="fas fa-clipboard-check mr-2 text-blue-600"></i> Safety Assessment Conclusion
376
+ </h2>
377
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
378
+ <div class="bg-gray-800 p-4 rounded-md text-white">
379
+ <div class="grid grid-cols-2 gap-4">
380
+ <div class="text-sm font-medium text-white">Primary Risk Type</div>
381
+ <div class="font-semibold" id="riskType">Toxicity Limit Exceeded</div>
382
+
383
+ <div class="text-sm font-medium text-white">Alarm Trigger Time</div>
384
+ <div class="font-semibold" id="alarmTime">17.2 s (First IDLH exceedance)</div>
385
+
386
+ <div class="text-sm font-medium text-white">Recommended Alarm Setpoint</div>
387
+ <div class="font-semibold" id="alarmSetting">150 ppm (Early warning)</div>
388
+ </div>
389
+ </div>
390
+ <div class="bg-gray-800 p-4 rounded-md text-white">
391
+ <div class="grid grid-cols-2 gap-4">
392
+ <div class="text-sm font-medium text-white">LFL Zone Formed</div>
393
+ <div class="font-semibold" id="lflArea">No (Max concentration < 5%)</div>
394
+
395
+ <div class="text-sm font-medium text-white">Recommended Escape Window</div>
396
+ <div class="font-semibold" id="escapeWindow">Complete evacuation within 15s</div>
397
+
398
+ <div class="text-sm font-medium text-white">Recommended Actions</div>
399
+ <div class="font-semibold" id="suggestions">Enhanced early warning + Point concentration monitoring</div>
400
+ </div>
401
+ </div>
402
+ </div>
403
+ </div>
404
+
405
+ <!-- Simulation Log -->
406
+ <div class="bg-gray-900 rounded-lg shadow-md p-6 mt-8 border border-gray-800">
407
+ <h2 class="text-xl font-bold mb-4 flex items-center">
408
+ <i class="fas fa-clipboard-list mr-2 text-blue-600"></i> Simulation Log
409
+ </h2>
410
+ <div class="bg-gray-700 p-4 rounded-md h-40 overflow-y-auto font-mono text-sm" id="simulationLog">
411
+ <div class="text-gray-500">No simulation data available. Run simulation to see results.</div>
412
+ </div>
413
+ </div>
414
+ </main>
415
+
416
+ <!-- Footer -->
417
+ <footer class="bg-gradient-to-r from-gray-900 to-gray-950 text-white py-6 mt-12 border-t border-gray-800">
418
+ <div class="container mx-auto px-4">
419
+ <div class="flex flex-col md:flex-row justify-between items-center">
420
+ <div class="mb-4 md:mb-0">
421
+ <h2 class="text-lg font-bold">Ship Fuel Leakage Safety Assessment Platform</h2>
422
+ <p class="text-sm opacity-80">CFD-based Alternative Marine Fuel Risk Assessment System</p>
423
+ </div>
424
+ <div class="flex space-x-4">
425
+ <a href="#" class="hover:text-blue-200 transition"><i class="fab fa-github"></i></a>
426
+ <a href="#" class="hover:text-blue-200 transition"><i class="fab fa-linkedin"></i></a>
427
+ <a href="#" class="hover:text-blue-200 transition"><i class="fas fa-envelope"></i></a>
428
+ </div>
429
+ </div>
430
+ <div class="mt-6 pt-4 border-t border-blue-400 text-center text-sm opacity-70">
431
+ &copy; 2023 Marine Safety Systems. All rights reserved.
432
+ </div>
433
+ </div>
434
+ </footer>
435
+
436
+ <script>
437
+ // DOM Elements
438
+ const concentrationChartCtx = document.getElementById('concentrationChart').getContext('2d');
439
+ const designModeBtn = document.getElementById('designModeBtn');
440
+ const operationModeBtn = document.getElementById('operationModeBtn');
441
+ const modeIndicator = document.getElementById('modeIndicator');
442
+ const currentMode = document.getElementById('currentMode');
443
+ const sensorConnection = document.getElementById('sensorConnection');
444
+ const simulateBtn = document.getElementById('simulateBtn');
445
+ const resetBtn = document.getElementById('resetBtn');
446
+ const viewHazardBtn = document.getElementById('viewHazardBtn');
447
+ const viewEscapeBtn = document.getElementById('viewEscapeBtn');
448
+ const hazardSummary = document.getElementById('hazardSummary');
449
+ const escapeTimePrediction = document.getElementById('escapeTimePrediction');
450
+ const alarmStatus = document.getElementById('alarmStatus');
451
+ const simulationLog = document.getElementById('simulationLog');
452
+ const concentrationCanvas = document.getElementById('concentrationCanvas');
453
+ const ctx = concentrationCanvas.getContext('2d');
454
+
455
+ // Set canvas dimensions
456
+ function resizeCanvas() {
457
+ const container = concentrationCanvas.parentElement;
458
+ concentrationCanvas.width = container.offsetWidth;
459
+ concentrationCanvas.height = container.offsetHeight;
460
+ }
461
+
462
+ // Initialize
463
+ window.addEventListener('load', () => {
464
+ resizeCanvas();
465
+ drawConcentrationGradient();
466
+
467
+ // Set initial positions based on input values
468
+ updateMarkerPositions();
469
+ });
470
+
471
+ window.addEventListener('resize', () => {
472
+ resizeCanvas();
473
+ drawConcentrationGradient();
474
+ });
475
+
476
+ // Mode Switching
477
+ designModeBtn.addEventListener('click', () => {
478
+ currentMode.textContent = 'Design Mode';
479
+ modeIndicator.querySelector('div').className = 'w-3 h-3 rounded-full bg-green-500 mr-2';
480
+ sensorConnection.classList.add('hidden');
481
+ designModeBtn.classList.add('bg-blue-700');
482
+ operationModeBtn.classList.remove('bg-blue-700');
483
+ });
484
+
485
+ operationModeBtn.addEventListener('click', () => {
486
+ currentMode.textContent = 'Operation Mode';
487
+ modeIndicator.querySelector('div').className = 'w-3 h-3 rounded-full bg-yellow-500 mr-2';
488
+ sensorConnection.classList.remove('hidden');
489
+ operationModeBtn.classList.add('bg-blue-700');
490
+ designModeBtn.classList.remove('bg-blue-700');
491
+ });
492
+
493
+ // View Switching
494
+ viewHazardBtn.addEventListener('click', () => {
495
+ hazardSummary.classList.remove('hidden');
496
+ escapeTimePrediction.classList.add('hidden');
497
+ viewHazardBtn.classList.add('bg-blue-100', 'text-blue-700');
498
+ viewHazardBtn.classList.remove('bg-gray-100', 'text-gray-700');
499
+ viewEscapeBtn.classList.add('bg-gray-100', 'text-gray-700');
500
+ viewEscapeBtn.classList.remove('bg-blue-100', 'text-blue-700');
501
+ });
502
+
503
+ viewEscapeBtn.addEventListener('click', () => {
504
+ hazardSummary.classList.add('hidden');
505
+ escapeTimePrediction.classList.remove('hidden');
506
+ viewEscapeBtn.classList.add('bg-blue-100', 'text-blue-700');
507
+ viewEscapeBtn.classList.remove('bg-gray-100', 'text-gray-700');
508
+ viewHazardBtn.classList.add('bg-gray-100', 'text-gray-700');
509
+ viewHazardBtn.classList.remove('bg-blue-100', 'text-blue-700');
510
+ });
511
+
512
+ // Initialize Chart with default data
513
+ let concentrationChart = new Chart(concentrationChartCtx, {
514
+ type: 'line',
515
+ data: {
516
+ labels: ['0', '5', '10', '15', '20', '25', '30', '35', '40', '45', '50'],
517
+ datasets: [{
518
+ label: 'Concentration (ppm)',
519
+ data: [0, 20, 45, 80, 120, 180, 220, 260, 300, 320, 350],
520
+ borderColor: '#3b82f6',
521
+ backgroundColor: 'rgba(59, 130, 246, 0.1)',
522
+ borderWidth: 2,
523
+ fill: true,
524
+ tension: 0.1
525
+ }]
526
+ },
527
+ options: {
528
+ responsive: true,
529
+ maintainAspectRatio: false,
530
+ scales: {
531
+ y: {
532
+ beginAtZero: true,
533
+ title: {
534
+ display: true,
535
+ text: 'Concentration (ppm)'
536
+ }
537
+ },
538
+ x: {
539
+ title: {
540
+ display: true,
541
+ text: 'Time (seconds)'
542
+ }
543
+ }
544
+ },
545
+ plugins: {
546
+ legend: {
547
+ display: false
548
+ },
549
+ annotation: {
550
+ annotations: {
551
+ idlhLine: {
552
+ type: 'line',
553
+ yMin: 300,
554
+ yMax: 300,
555
+ borderColor: 'red',
556
+ borderWidth: 2,
557
+ borderDash: [6, 6],
558
+ label: {
559
+ content: 'IDLH',
560
+ enabled: true,
561
+ position: 'left'
562
+ }
563
+ },
564
+ lflLine: {
565
+ type: 'line',
566
+ yMin: 150,
567
+ yMax: 150,
568
+ borderColor: 'orange',
569
+ borderWidth: 2,
570
+ borderDash: [6, 6],
571
+ label: {
572
+ content: 'LFL',
573
+ enabled: true,
574
+ position: 'left'
575
+ }
576
+ }
577
+ }
578
+ }
579
+ }
580
+ }
581
+ });
582
+
583
+ // Simulation
584
+ simulateBtn.addEventListener('click', () => {
585
+ // Show loading state
586
+ simulateBtn.innerHTML = '<i class="fas fa-spinner fa-spin mr-2"></i> Running';
587
+ simulateBtn.disabled = true;
588
+
589
+ // Update marker positions
590
+ updateMarkerPositions();
591
+
592
+ // Simulate delay for CFD calculation
593
+ setTimeout(() => {
594
+ // Update hazard radii
595
+ document.getElementById('highRiskRadius').textContent = '3.2 m';
596
+ document.getElementById('mediumRiskRadius').textContent = '5.8 m';
597
+ document.getElementById('lowRiskRadius').textContent = '8.4 m';
598
+ document.getElementById('safeDistance').textContent = '10.0 m';
599
+
600
+ // Update escape times
601
+ document.getElementById('asetTime').textContent = '45 s';
602
+ document.getElementById('rsetTime').textContent = '32 s';
603
+
604
+ const safetyMargin = 45 - 32;
605
+ const escapeResult = document.getElementById('escapeResult');
606
+ const escapeResultContainer = document.getElementById('escapeResultContainer');
607
+
608
+ if (safetyMargin >= 0) {
609
+ escapeResult.textContent = `${safetyMargin} s`;
610
+ escapeResultContainer.className = 'p-3 rounded bg-green-50';
611
+ escapeResult.className = 'text-xl font-bold text-green-600';
612
+ alarmStatus.classList.add('hidden');
613
+ } else {
614
+ escapeResult.textContent = `${Math.abs(safetyMargin)} s`;
615
+ escapeResultContainer.className = 'p-3 rounded bg-red-50';
616
+ escapeResult.className = 'text-xl font-bold text-red-600';
617
+ alarmStatus.classList.remove('hidden');
618
+ alarmStatus.className = 'mt-6 p-4 rounded-lg bg-red-100';
619
+ document.getElementById('alarmMessage').textContent = 'WARNING: Immediate evacuation required!';
620
+ document.getElementById('alarmDetails').innerHTML = `The current location will reach dangerous concentration levels in <span class="font-bold">45 seconds</span>. Estimated escape time is <span class="font-bold">32 seconds</span>.`;
621
+ }
622
+
623
+ // Update progress bar
624
+ document.getElementById('timeProgress').style.width = '70%';
625
+
626
+ // Draw concentration gradient
627
+ drawConcentrationGradient();
628
+
629
+ // Update simulation log
630
+ const fuelType = document.getElementById('fuelType').value;
631
+ const logEntry = `
632
+ <div class="text-green-600">[${new Date().toLocaleTimeString()}] Simulation completed for ${fuelType} leak</div>
633
+ <div class="ml-4">- High risk radius: 3.2 m</div>
634
+ <div class="ml-4">- Medium risk radius: 5.8 m</div>
635
+ <div class="ml-4">- Low risk radius: 8.4 m</div>
636
+ <div class="ml-4">- ASET: 45 s, RSET: 32 s</div>
637
+ `;
638
+ simulationLog.innerHTML = logEntry + simulationLog.innerHTML;
639
+
640
+ // Reset button state
641
+ simulateBtn.innerHTML = '<i class="fas fa-play mr-2"></i> Run';
642
+ simulateBtn.disabled = false;
643
+ }, 1500);
644
+ });
645
+
646
+ // Reset
647
+ resetBtn.addEventListener('click', () => {
648
+ // Reset input values
649
+ document.getElementById('leakRate').value = '0.5';
650
+ document.getElementById('leakDuration').value = '60';
651
+ document.getElementById('leakDiameter').value = '10';
652
+ document.getElementById('leakDirection').value = '0';
653
+ document.getElementById('windSpeed').value = '3.0';
654
+ document.getElementById('windDirection').value = '90';
655
+ document.getElementById('ventilationRate').value = '5.0';
656
+ document.getElementById('leakX').value = '5.0';
657
+ document.getElementById('leakY').value = '5.0';
658
+ document.getElementById('personX').value = '10.0';
659
+ document.getElementById('personY').value = '10.0';
660
+
661
+ // Reset visualization
662
+ document.getElementById('highRiskRadius').textContent = '0.0 m';
663
+ document.getElementById('mediumRiskRadius').textContent = '0.0 m';
664
+ document.getElementById('lowRiskRadius').textContent = '0.0 m';
665
+ document.getElementById('safeDistance').textContent = '0.0 m';
666
+ document.getElementById('asetTime').textContent = '0 s';
667
+ document.getElementById('rsetTime').textContent = '0 s';
668
+ document.getElementById('escapeResult').textContent = '0 s';
669
+ document.getElementById('escapeResultContainer').className = 'p-3 rounded';
670
+ document.getElementById('escapeResult').className = 'text-xl font-bold';
671
+ document.getElementById('timeProgress').style.width = '0%';
672
+ alarmStatus.classList.add('hidden');
673
+
674
+ // Clear canvas
675
+ ctx.clearRect(0, 0, concentrationCanvas.width, concentrationCanvas.height);
676
+
677
+ // Reset log
678
+ simulationLog.innerHTML = '<div class="text-gray-500">No simulation data available. Run a simulation to see results.</div>';
679
+
680
+ // Update marker positions
681
+ updateMarkerPositions();
682
+ });
683
+
684
+ // Update marker positions based on input values
685
+ function updateMarkerPositions() {
686
+ const container = concentrationCanvas.parentElement;
687
+ const containerWidth = container.offsetWidth;
688
+ const containerHeight = container.offsetHeight;
689
+
690
+ // Scale factors (assuming 20m x 20m deck area)
691
+ const scaleX = containerWidth / 20;
692
+ const scaleY = containerHeight / 20;
693
+
694
+ // Get input values
695
+ const leakX = parseFloat(document.getElementById('leakX').value);
696
+ const leakY = parseFloat(document.getElementById('leakY').value);
697
+ const personX = parseFloat(document.getElementById('personX').value);
698
+ const personY = parseFloat(document.getElementById('personY').value);
699
+
700
+ // Position markers
701
+ const leakMarker = document.getElementById('leakSource');
702
+ const personMarker = document.getElementById('personMarker');
703
+
704
+ leakMarker.style.left = `${leakX * scaleX}px`;
705
+ leakMarker.style.top = `${containerHeight - (leakY * scaleY)}px`;
706
+
707
+ personMarker.style.left = `${personX * scaleX}px`;
708
+ personMarker.style.top = `${containerHeight - (personY * scaleY)}px`;
709
+
710
+ // Draw escape route
711
+ const escapeRoute = document.getElementById('escapeRoute');
712
+ const svg = `
713
+ <svg width="100%" height="100%" viewBox="0 0 ${containerWidth} ${containerHeight}" xmlns="http://www.w3.org/2000/svg">
714
+ <path d="M${personX * scaleX},${containerHeight - (personY * scaleY)} L${containerWidth - 20},20"
715
+ stroke="#3b82f6" stroke-width="2" stroke-dasharray="5,3" fill="none" />
716
+ <circle cx="${containerWidth - 20}" cy="20" r="6" fill="#10b981" />
717
+ </svg>
718
+ `;
719
+ escapeRoute.innerHTML = svg;
720
+ }
721
+
722
+ // Draw concentration gradient (simplified for demo)
723
+ function drawConcentrationGradient() {
724
+ const width = concentrationCanvas.width;
725
+ const height = concentrationCanvas.height;
726
+
727
+ // Get leak position (scaled to canvas)
728
+ const container = concentrationCanvas.parentElement;
729
+ const scaleX = container.offsetWidth / 20;
730
+ const scaleY = container.offsetHeight / 20;
731
+ const leakX = parseFloat(document.getElementById('leakX').value) * scaleX;
732
+ const leakY = height - (parseFloat(document.getElementById('leakY').value) * scaleY);
733
+
734
+ // Create gradient
735
+ const gradient = ctx.createRadialGradient(leakX, leakY, 5, leakX, leakY, Math.min(width, height) * 0.6);
736
+
737
+ // Set gradient stops based on risk levels
738
+ gradient.addColorStop(0, 'rgba(239, 68, 68, 0.8)'); // High risk
739
+ gradient.addColorStop(0.3, 'rgba(249, 115, 22, 0.6)'); // Medium risk
740
+ gradient.addColorStop(0.5, 'rgba(245, 158, 11, 0.4)'); // Low risk
741
+ gradient.addColorStop(0.8, 'rgba(59, 130, 246, 0.1)'); // Very low
742
+ gradient.addColorStop(1, 'rgba(16, 185, 129, 0)'); // Safe
743
+
744
+ // Apply wind direction effect
745
+ const windDirection = parseFloat(document.getElementById('windDirection').value);
746
+ const windSpeed = parseFloat(document.getElementById('windSpeed').value);
747
+
748
+ // Draw gradient
749
+ ctx.clearRect(0, 0, width, height);
750
+ ctx.fillStyle = gradient;
751
+
752
+ // Create an ellipse to simulate wind direction
753
+ ctx.save();
754
+ ctx.translate(leakX, leakY);
755
+ ctx.rotate((windDirection - 90) * Math.PI / 180);
756
+ ctx.scale(1, 1 + (windSpeed * 0.1));
757
+ ctx.translate(-leakX, -leakY);
758
+
759
+ ctx.beginPath();
760
+ ctx.arc(leakX, leakY, Math.min(width, height) * 0.6, 0, Math.PI * 2);
761
+ ctx.fill();
762
+
763
+ ctx.restore();
764
+ }
765
+
766
+ // Exposure location change handler
767
+ document.getElementById('exposureLocation').addEventListener('change', function() {
768
+ const personnelContainer = document.getElementById('personnelLocationContainer');
769
+ const coordInputs = personnelContainer.querySelectorAll('input');
770
+
771
+ if (this.value === 'other') {
772
+ personnelContainer.classList.remove('hidden');
773
+ coordInputs.forEach(input => {
774
+ input.disabled = false;
775
+ });
776
+ } else {
777
+ personnelContainer.classList.add('hidden');
778
+ coordInputs.forEach(input => {
779
+ input.disabled = true;
780
+ });
781
+ }
782
+ });
783
+
784
+ // Input change listeners
785
+ document.getElementById('leakX').addEventListener('change', updateMarkerPositions);
786
+ document.getElementById('leakY').addEventListener('change', updateMarkerPositions);
787
+ document.getElementById('personX').addEventListener('change', updateMarkerPositions);
788
+ document.getElementById('personY').addEventListener('change', updateMarkerPositions);
789
+ document.getElementById('windDirection').addEventListener('change', drawConcentrationGradient);
790
+ document.getElementById('windSpeed').addEventListener('change', drawConcentrationGradient);
791
+ </script>
792
+ <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>
793
+ </html>