ahmedelmelhat commited on
Commit
2801d40
·
verified ·
1 Parent(s): f4b7717

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. index.html +1 -1250
index.html CHANGED
@@ -88,1253 +88,4 @@
88
 
89
  /* Header */
90
  header {
91
- background: linear-gradient(135deg, rgba(0, 51, 102, 0.9), rgba(0, 20, 40, 0.9));
92
- border: 1px solid var(--primary-blue);
93
- border-radius: 15px;
94
- padding: 20px;
95
- margin-bottom: 30px;
96
- box-shadow: 0 0 30px rgba(0, 212, 255, 0.5),
97
- inset 0 0 20px rgba(0, 212, 255, 0.1);
98
- backdrop-filter: blur(10px);
99
- position: relative;
100
- overflow: hidden;
101
- }
102
-
103
- header::before {
104
- content: '';
105
- position: absolute;
106
- top: -50%;
107
- left: -50%;
108
- width: 200%;
109
- height: 200%;
110
- background: linear-gradient(45deg, transparent, var(--primary-blue), transparent);
111
- opacity: 0.1;
112
- animation: rotate 10s linear infinite;
113
- }
114
-
115
- @keyframes rotate {
116
- 0% {
117
- transform: rotate(0deg);
118
- }
119
-
120
- 100% {
121
- transform: rotate(360deg);
122
- }
123
- }
124
-
125
- .header-content {
126
- position: relative;
127
- z-index: 2;
128
- display: flex;
129
- justify-content: space-between;
130
- align-items: center;
131
- flex-wrap: wrap;
132
- gap: 20px;
133
- }
134
-
135
- h1 {
136
- font-size: 2.5em;
137
- text-shadow: 0 0 20px var(--primary-blue),
138
- 0 0 40px var(--primary-blue);
139
- letter-spacing: 2px;
140
- animation: pulse 2s ease-in-out infinite;
141
- }
142
-
143
- @keyframes pulse {
144
-
145
- 0%,
146
- 100% {
147
- opacity: 1;
148
- }
149
-
150
- 50% {
151
- opacity: 0.8;
152
- }
153
- }
154
-
155
- .status-bar {
156
- display: flex;
157
- gap: 20px;
158
- align-items: center;
159
- }
160
-
161
- .status-indicator {
162
- display: flex;
163
- align-items: center;
164
- gap: 8px;
165
- padding: 8px 15px;
166
- background: rgba(0, 212, 255, 0.1);
167
- border: 1px solid var(--primary-blue);
168
- border-radius: 20px;
169
- font-size: 0.9em;
170
- }
171
-
172
- .status-dot {
173
- width: 10px;
174
- height: 10px;
175
- border-radius: 50%;
176
- animation: blink 2s infinite;
177
- }
178
-
179
- .status-dot.active {
180
- background: var(--success);
181
- box-shadow: 0 0 10px var(--success);
182
- }
183
-
184
- @keyframes blink {
185
-
186
- 0%,
187
- 100% {
188
- opacity: 1;
189
- }
190
-
191
- 50% {
192
- opacity: 0.3;
193
- }
194
- }
195
-
196
- /* Main grid layout */
197
- .main-grid {
198
- display: grid;
199
- grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
200
- gap: 25px;
201
- margin-bottom: 30px;
202
- }
203
-
204
- /* Panel styles */
205
- .panel {
206
- background: var(--panel-bg);
207
- border: 1px solid var(--primary-blue);
208
- border-radius: 15px;
209
- padding: 20px;
210
- position: relative;
211
- overflow: hidden;
212
- cursor: pointer;
213
- transition: all 0.3s ease;
214
- backdrop-filter: blur(10px);
215
- box-shadow: 0 0 20px rgba(0, 212, 255, 0.3),
216
- inset 0 0 10px rgba(0, 212, 255, 0.1);
217
- }
218
-
219
- .panel:hover {
220
- transform: translateY(-5px);
221
- box-shadow: 0 10px 40px rgba(0, 212, 255, 0.5),
222
- inset 0 0 20px rgba(0, 212, 255, 0.2);
223
- }
224
-
225
- .panel::before {
226
- content: '';
227
- position: absolute;
228
- top: 0;
229
- left: -100%;
230
- width: 100%;
231
- height: 2px;
232
- background: linear-gradient(90deg, transparent, var(--glow-blue), transparent);
233
- animation: scan 3s linear infinite;
234
- }
235
-
236
- @keyframes scan {
237
- 0% {
238
- left: -100%;
239
- }
240
-
241
- 100% {
242
- left: 100%;
243
- }
244
- }
245
-
246
- .panel-header {
247
- display: flex;
248
- justify-content: space-between;
249
- align-items: center;
250
- margin-bottom: 15px;
251
- padding-bottom: 10px;
252
- border-bottom: 1px solid rgba(0, 212, 255, 0.3);
253
- }
254
-
255
- .panel-title {
256
- font-size: 1.3em;
257
- font-weight: bold;
258
- text-shadow: 0 0 10px var(--primary-blue);
259
- }
260
-
261
- .panel-icon {
262
- width: 30px;
263
- height: 30px;
264
- background: radial-gradient(circle, var(--primary-blue), transparent);
265
- border-radius: 50%;
266
- display: flex;
267
- align-items: center;
268
- justify-content: center;
269
- font-size: 1.2em;
270
- }
271
-
272
- /* Expanded panel */
273
- .panel.expanded {
274
- position: fixed;
275
- top: 50%;
276
- left: 50%;
277
- transform: translate(-50%, -50%);
278
- width: 90%;
279
- max-width: 900px;
280
- height: 80vh;
281
- z-index: 1000;
282
- overflow-y: auto;
283
- animation: expandIn 0.3s ease;
284
- }
285
-
286
- @keyframes expandIn {
287
- from {
288
- opacity: 0;
289
- transform: translate(-50%, -50%) scale(0.8);
290
- }
291
-
292
- to {
293
- opacity: 1;
294
- transform: translate(-50%, -50%) scale(1);
295
- }
296
- }
297
-
298
- .close-btn {
299
- position: absolute;
300
- top: 10px;
301
- right: 10px;
302
- width: 30px;
303
- height: 30px;
304
- background: var(--critical);
305
- border: none;
306
- border-radius: 50%;
307
- color: white;
308
- font-size: 1.2em;
309
- cursor: pointer;
310
- transition: all 0.3s ease;
311
- z-index: 1001;
312
- }
313
-
314
- .close-btn:hover {
315
- transform: rotate(90deg) scale(1.1);
316
- box-shadow: 0 0 20px var(--critical);
317
- }
318
-
319
- /* Graph container */
320
- .graph-container {
321
- width: 100%;
322
- height: 200px;
323
- background: rgba(0, 10, 20, 0.5);
324
- border: 1px solid rgba(0, 212, 255, 0.3);
325
- border-radius: 10px;
326
- margin: 15px 0;
327
- position: relative;
328
- overflow: hidden;
329
- }
330
-
331
- canvas {
332
- width: 100%;
333
- height: 100%;
334
- }
335
-
336
- /* Control sliders */
337
- .control-group {
338
- margin: 15px 0;
339
- }
340
-
341
- .control-label {
342
- display: flex;
343
- justify-content: space-between;
344
- margin-bottom: 8px;
345
- font-size: 0.9em;
346
- color: var(--primary-blue);
347
- }
348
-
349
- .slider {
350
- width: 100%;
351
- height: 6px;
352
- background: linear-gradient(90deg, var(--dark-blue), var(--primary-blue));
353
- border-radius: 3px;
354
- outline: none;
355
- -webkit-appearance: none;
356
- position: relative;
357
- }
358
-
359
- .slider::-webkit-slider-thumb {
360
- -webkit-appearance: none;
361
- appearance: none;
362
- width: 20px;
363
- height: 20px;
364
- background: radial-gradient(circle, white, var(--primary-blue));
365
- border: 2px solid var(--primary-blue);
366
- border-radius: 50%;
367
- cursor: pointer;
368
- box-shadow: 0 0 15px var(--primary-blue);
369
- transition: all 0.3s ease;
370
- }
371
-
372
- .slider::-webkit-slider-thumb:hover {
373
- transform: scale(1.2);
374
- box-shadow: 0 0 25px var(--glow-blue);
375
- }
376
-
377
- .slider::-moz-range-thumb {
378
- width: 20px;
379
- height: 20px;
380
- background: radial-gradient(circle, white, var(--primary-blue));
381
- border: 2px solid var(--primary-blue);
382
- border-radius: 50%;
383
- cursor: pointer;
384
- box-shadow: 0 0 15px var(--primary-blue);
385
- }
386
-
387
- /* Mode cards */
388
- .mode-grid {
389
- display: grid;
390
- grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
391
- gap: 15px;
392
- margin-top: 20px;
393
- }
394
-
395
- .mode-card {
396
- background: rgba(0, 51, 102, 0.3);
397
- border: 1px solid var(--primary-blue);
398
- border-radius: 10px;
399
- padding: 15px;
400
- text-align: center;
401
- cursor: pointer;
402
- transition: all 0.3s ease;
403
- position: relative;
404
- overflow: hidden;
405
- }
406
-
407
- .mode-card::after {
408
- content: '';
409
- position: absolute;
410
- top: 50%;
411
- left: 50%;
412
- width: 0;
413
- height: 0;
414
- background: radial-gradient(circle, var(--primary-blue), transparent);
415
- transition: all 0.5s ease;
416
- transform: translate(-50%, -50%);
417
- }
418
-
419
- .mode-card:hover::after {
420
- width: 100%;
421
- height: 100%;
422
- }
423
-
424
- .mode-card:hover {
425
- transform: scale(1.05);
426
- box-shadow: 0 0 30px rgba(0, 212, 255, 0.5);
427
- }
428
-
429
- .mode-card.active {
430
- background: rgba(0, 212, 255, 0.2);
431
- border-color: var(--glow-blue);
432
- box-shadow: 0 0 20px var(--glow-blue);
433
- }
434
-
435
- .mode-name {
436
- font-weight: bold;
437
- margin-bottom: 8px;
438
- position: relative;
439
- z-index: 1;
440
- }
441
-
442
- .mode-description {
443
- font-size: 0.85em;
444
- color: rgba(0, 212, 255, 0.8);
445
- position: relative;
446
- z-index: 1;
447
- }
448
-
449
- /* Alarm styles */
450
- .alarm-container {
451
- position: fixed;
452
- top: 20px;
453
- right: 20px;
454
- z-index: 2000;
455
- max-width: 350px;
456
- }
457
-
458
- .alarm {
459
- background: var(--panel-bg);
460
- border: 2px solid var(--warning);
461
- border-radius: 10px;
462
- padding: 15px;
463
- margin-bottom: 10px;
464
- animation: slideIn 0.3s ease;
465
- box-shadow: 0 0 30px rgba(255, 107, 53, 0.5);
466
- }
467
-
468
- @keyframes slideIn {
469
- from {
470
- transform: translateX(400px);
471
- opacity: 0;
472
- }
473
-
474
- to {
475
- transform: translateX(0);
476
- opacity: 1;
477
- }
478
- }
479
-
480
- .alarm.critical {
481
- border-color: var(--critical);
482
- box-shadow: 0 0 30px rgba(255, 0, 64, 0.5);
483
- animation: criticalPulse 1s ease infinite;
484
- }
485
-
486
- @keyframes criticalPulse {
487
-
488
- 0%,
489
- 100% {
490
- transform: scale(1);
491
- box-shadow: 0 0 30px rgba(255, 0, 64, 0.5);
492
- }
493
-
494
- 50% {
495
- transform: scale(1.02);
496
- box-shadow: 0 0 40px rgba(255, 0, 64, 0.8);
497
- }
498
- }
499
-
500
- .alarm-header {
501
- display: flex;
502
- justify-content: space-between;
503
- align-items: center;
504
- margin-bottom: 8px;
505
- }
506
-
507
- .alarm-title {
508
- font-weight: bold;
509
- color: var(--warning);
510
- }
511
-
512
- .alarm.critical .alarm-title {
513
- color: var(--critical);
514
- }
515
-
516
- .alarm-close {
517
- background: none;
518
- border: none;
519
- color: var(--primary-blue);
520
- cursor: pointer;
521
- font-size: 1.2em;
522
- }
523
-
524
- /* Toggle switches */
525
- .toggle-container {
526
- display: flex;
527
- align-items: center;
528
- gap: 10px;
529
- margin: 10px 0;
530
- }
531
-
532
- .toggle-switch {
533
- position: relative;
534
- width: 50px;
535
- height: 25px;
536
- background: var(--dark-blue);
537
- border: 1px solid var(--primary-blue);
538
- border-radius: 25px;
539
- cursor: pointer;
540
- transition: all 0.3s ease;
541
- }
542
-
543
- .toggle-switch::after {
544
- content: '';
545
- position: absolute;
546
- width: 20px;
547
- height: 20px;
548
- background: white;
549
- border-radius: 50%;
550
- top: 2px;
551
- left: 2px;
552
- transition: all 0.3s ease;
553
- box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
554
- }
555
-
556
- .toggle-switch.active {
557
- background: var(--primary-blue);
558
- }
559
-
560
- .toggle-switch.active::after {
561
- left: 27px;
562
- }
563
-
564
- /* Data display */
565
- .data-grid {
566
- display: grid;
567
- grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
568
- gap: 10px;
569
- margin-top: 15px;
570
- }
571
-
572
- .data-item {
573
- background: rgba(0, 51, 102, 0.2);
574
- border: 1px solid rgba(0, 212, 255, 0.3);
575
- border-radius: 8px;
576
- padding: 10px;
577
- text-align: center;
578
- }
579
-
580
- .data-value {
581
- font-size: 1.5em;
582
- font-weight: bold;
583
- color: var(--glow-blue);
584
- text-shadow: 0 0 10px var(--glow-blue);
585
- }
586
-
587
- .data-unit {
588
- font-size: 0.8em;
589
- color: rgba(0, 212, 255, 0.7);
590
- }
591
-
592
- .data-label {
593
- font-size: 0.75em;
594
- margin-top: 5px;
595
- color: rgba(0, 212, 255, 0.6);
596
- }
597
-
598
- /* Button styles */
599
- .btn {
600
- background: linear-gradient(135deg, var(--secondary-blue), var(--primary-blue));
601
- border: 1px solid var(--primary-blue);
602
- color: white;
603
- padding: 10px 20px;
604
- border-radius: 25px;
605
- cursor: pointer;
606
- font-weight: bold;
607
- transition: all 0.3s ease;
608
- text-transform: uppercase;
609
- letter-spacing: 1px;
610
- position: relative;
611
- overflow: hidden;
612
- }
613
-
614
- .btn::before {
615
- content: '';
616
- position: absolute;
617
- top: 50%;
618
- left: 50%;
619
- width: 0;
620
- height: 0;
621
- background: rgba(255, 255, 255, 0.3);
622
- border-radius: 50%;
623
- transform: translate(-50%, -50%);
624
- transition: all 0.5s ease;
625
- }
626
-
627
- .btn:hover::before {
628
- width: 300px;
629
- height: 300px;
630
- }
631
-
632
- .btn:hover {
633
- transform: translateY(-2px);
634
- box-shadow: 0 10px 30px rgba(0, 212, 255, 0.5);
635
- }
636
-
637
- /* Overlay for expanded panels */
638
- .overlay {
639
- position: fixed;
640
- top: 0;
641
- left: 0;
642
- width: 100%;
643
- height: 100%;
644
- background: rgba(0, 0, 0, 0.8);
645
- z-index: 999;
646
- display: none;
647
- backdrop-filter: blur(5px);
648
- }
649
-
650
- .overlay.active {
651
- display: block;
652
- }
653
-
654
- /* Loading animation */
655
- .loading {
656
- display: inline-block;
657
- width: 20px;
658
- height: 20px;
659
- border: 3px solid rgba(0, 212, 255, 0.3);
660
- border-radius: 50%;
661
- border-top-color: var(--primary-blue);
662
- animation: spin 1s ease-in-out infinite;
663
- }
664
-
665
- @keyframes spin {
666
- to {
667
- transform: rotate(360deg);
668
- }
669
- }
670
-
671
- /* Footer */
672
- footer {
673
- text-align: center;
674
- padding: 20px;
675
- margin-top: 40px;
676
- border-top: 1px solid rgba(0, 212, 255, 0.3);
677
- }
678
-
679
- footer a {
680
- color: var(--primary-blue);
681
- text-decoration: none;
682
- font-weight: bold;
683
- transition: all 0.3s ease;
684
- }
685
-
686
- footer a:hover {
687
- text-shadow: 0 0 10px var(--primary-blue);
688
- }
689
-
690
- select {
691
- background: var(--panel-bg);
692
- border: 1px solid var(--primary-blue);
693
- color: var(--primary-blue);
694
- padding: 8px;
695
- border-radius: 5px;
696
- cursor: pointer;
697
- }
698
-
699
- select option {
700
- background: var(--bg-dark);
701
- }
702
-
703
- /* Responsive design */
704
- @media (max-width: 768px) {
705
- .main-grid {
706
- grid-template-columns: 1fr;
707
- }
708
-
709
- h1 {
710
- font-size: 1.8em;
711
- }
712
-
713
- .panel.expanded {
714
- width: 95%;
715
- height: 90vh;
716
- }
717
-
718
- .mode-grid {
719
- grid-template-columns: 1fr;
720
- }
721
- }
722
-
723
- /* New styles for improved functionality */
724
- .slider-value-display {
725
- text-align: center;
726
- font-size: 0.9em;
727
- margin-top: 5px;
728
- color: var(--glow-blue);
729
- }
730
-
731
- .parameter-control {
732
- display: flex;
733
- flex-direction: column;
734
- gap: 5px;
735
- }
736
-
737
- .function-status {
738
- display: inline-flex;
739
- align-items: center;
740
- gap: 8px;
741
- padding: 5px 10px;
742
- border-radius: 8px;
743
- font-size: 0.85em;
744
- }
745
-
746
- .function-status.active {
747
- background: rgba(0, 255, 136, 0.1);
748
- border: 1px solid var(--success);
749
- }
750
-
751
- .function-status.inactive {
752
- background: rgba(255, 0, 64, 0.1);
753
- border: 1px solid var(--critical);
754
- }
755
-
756
- .debug-info {
757
- position: fixed;
758
- bottom: 10px;
759
- left: 10px;
760
- background: rgba(0, 0, 0, 0.7);
761
- color: var(--success);
762
- padding: 8px 12px;
763
- border-radius: 6px;
764
- font-size: 0.8em;
765
- max-width: 300px;
766
- display: none;
767
- }
768
-
769
- .debug-info.show {
770
- display: block;
771
- }
772
-
773
- /* Fix for slider containers */
774
- .slider-container {
775
- position: relative;
776
- margin: 15px 0;
777
- }
778
-
779
- /* Fix for data updates */
780
- .data-updating {
781
- animation: dataPulse 1s ease-in-out;
782
- }
783
-
784
- @keyframes dataPulse {
785
- 0% {
786
- opacity: 1;
787
- }
788
- 50% {
789
- opacity: 0.6;
790
- }
791
- 100% {
792
- opacity: 1;
793
- }
794
- }
795
- </style>
796
- </head>
797
-
798
- <body>
799
- <!-- Animated particles background -->
800
- <div class="particles" id="particles"></div>
801
-
802
- <!-- Alarm container -->
803
- <div class="alarm-container" id="alarmContainer"></div>
804
-
805
- <!-- Overlay for expanded panels -->
806
- <div class="overlay" id="overlay"></div>
807
-
808
- <!-- Debug information -->
809
- <div class="debug-info" id="debugInfo"></div>
810
-
811
- <div class="container">
812
- <header>
813
- <div class="header-content">
814
- <h1><i class="fas fa-lungs"></i> DRAGER VN 500 VENTILATOR</h1>
815
- <div class="status-bar">
816
- <div class="status-indicator">
817
- <span class="status-dot active"></span>
818
- <span>System Active</span>
819
- </div>
820
- <div class="status-indicator">
821
- <span class="loading"></span>
822
- <span>Monitoring</span>
823
- </div>
824
- <div class="status-indicator">
825
- <span>Patient: Neonatal</span>
826
- </div>
827
- <button class="btn" onclick="toggleDebug()" style="padding: 8px 15px; font-size: 0.9em;">
828
- <i class="fas fa-bug"></i> Debug
829
- </button>
830
- </div>
831
- </div>
832
- </header>
833
-
834
- <div class="main-grid">
835
- <!-- Ventilation Settings Panel -->
836
- <div class="panel" data-panel="settings">
837
- <div class="panel-header">
838
- <div class="panel-title">Ventilation Settings</div>
839
- <div class="panel-icon"><i class="fas fa-cogs"></i></div>
840
- </div>
841
- <div class="graph-container">
842
- <canvas id="pressureGraph"></canvas>
843
- </div>
844
- <div class="parameter-control">
845
- <div class="control-label">
846
- <span>PIP (cmH₂O)</span>
847
- <span id="pipValue">20</span>
848
- </div>
849
- <input type="range" class="slider" id="pipSlider" min="10" max="40" value="20">
850
- <div class="control-label">
851
- <span>PEEP (cmH₂O)</span>
852
- <span id="peepValue">5</span>
853
- </div>
854
- <input type="range" class="slider" id="peepSlider" min="0" max="15" value="5">
855
- <div class="control-label">
856
- <span>Respiratory Rate (/min)</span>
857
- <span id="rrValue">30</span>
858
- </div>
859
- <input type="range" class="slider" id="rrSlider" min="10" max="60" value="30">
860
- <div class="control-label">
861
- <span>FiO₂ (%)</span>
862
- <span id="fiO2Value">21</span>
863
- </div>
864
- <input type="range" class="slider" id="fiO2Slider" min="21" max="100" value="21">
865
- </div>
866
- </div>
867
-
868
- <!-- Ventilation Modes Panel -->
869
- <div class="panel" data-panel="modes">
870
- <div class="panel-header">
871
- <div class="panel-title">Ventilation Modes</div>
872
- <div class="panel-icon"><i class="fas fa-sync-alt"></i></div>
873
- </div>
874
- <div class="mode-grid">
875
- <div class="mode-card active" data-mode="SIMV">
876
- <div class="mode-name"><i class="fas fa-wind"></i> SIMV</div>
877
- <div class="mode-description">Synchronized Intermittent</div>
878
- </div>
879
- <div class="mode-card" data-mode="CPAP">
880
- <div class="mode-name"><i class="fas fa-compress-alt"></i> CPAP</div>
881
- <div class="mode-description">Continuous Positive Airway</div>
882
- </div>
883
- <div class="mode-card" data-mode="HFOV">
884
- <div class="mode-name"><i class="fas fa-wave-square"></i> HFOV</div>
885
- <div class="mode-description">High Frequency Oscillation</div>
886
- </div>
887
- <div class="mode-card" data-mode="PRVC">
888
- <div class="mode-name"><i class="fas fa-tachometer-alt"></i> PRVC</div>
889
- <div class="mode-description">Pressure Regulated Volume</div>
890
- </div>
891
- </div>
892
- <div class="toggle-container">
893
- <span><i class="fas fa-shield-alt"></i> Volume Guarantee</span>
894
- <div class="toggle-switch" id="volumeGuarantee"></div>
895
- </div>
896
- <div class="function-status active" id="modeStatus">
897
- <i class="fas fa-check-circle"></i>
898
- <span>Mode: SIMV - Active</span>
899
- </div>
900
- </div>
901
-
902
- <!-- Patient Monitoring Panel -->
903
- <div class="panel" data-panel="monitoring">
904
- <div class="panel-header">
905
- <div class="panel-title">Patient Monitoring</div>
906
- <div class="panel-icon"><i class="fas fa-heartbeat"></i></div>
907
- </div>
908
- <div class="graph-container">
909
- <canvas id="flowGraph"></canvas>
910
- </div>
911
- <div class="data-grid">
912
- <div class="data-item">
913
- <div class="data-value" id="tidalVolume">45</div>
914
- <div class="data-unit">mL</div>
915
- <div class="data-label">Tidal Volume</div>
916
- </div>
917
- <div class="data-item">
918
- <div class="data-value" id="complianceValue">1.2</div>
919
- <div class="data-unit">mL/cmH₂O</div>
920
- <div class="data-label">Compliance</div>
921
- </div>
922
- <div class="data-item">
923
- <div class="data-value" id="resistanceValue">30</div>
924
- <div class="data-unit">cmH₂O/L/s</div>
925
- <div class="data-label">Resistance</div>
926
- </div>
927
- <div class="data-item">
928
- <div class="data-value" id="etCO2Value">35</div>
929
- <div class="data-unit">mmHg</div>
930
- <div class="data-label">EtCO₂</div>
931
- </div>
932
- </div>
933
- <div class="parameter-control">
934
- <div class="control-label">
935
- <span>Compliance Sensitivity</span>
936
- <span id="complianceSensValue">75%</span>
937
- </div>
938
- <input type="range" class="slider" id="complianceSens" min="50" max="100" value="75">
939
- </div>
940
- </div>
941
-
942
- <!-- Alarms & Troubleshooting Panel -->
943
- <div class="panel" data-panel="alarms">
944
- <div class="panel-header">
945
- <div class="panel-title">Alarms & Troubleshooting</div>
946
- <div class="panel-icon"><i class="fas fa-exclamation-triangle"></i></div>
947
- </div>
948
- <div style="margin: 15px 0;">
949
- <button class="btn" onclick="simulateAlarm('High Pressure')">
950
- <i class="fas fa-arrow-up"></i> Simulate High Pressure
951
- </button>
952
- <button class="btn" onclick="simulateAlarm('Low Volume')" style="margin-left: 10px;">
953
- <i class="fas fa-arrow-down"></i> Simulate Low Volume
954
- </button>
955
- </div>
956
- <div class="toggle-container">
957
- <span><i class="fas fa-bed"></i> Apnea Detection</span>
958
- <div class="toggle-switch active" id="apneaDetection"></div>
959
- </div>
960
- <div class="toggle-container">
961
- <span><i class="fas fa-fan"></i> Leak Detection</span>
962
- <div class="toggle-switch" id="leakDetection"></div>
963
- </div>
964
- <div style="margin-top: 15px; padding: 10px; background: rgba(0, 51, 102, 0.2); border-radius: 8px;">
965
- <p style="font-size: 0.85em; line-height: 1.5;">
966
- <strong><i class="fas fa-info-circle"></i> System Status:</strong> All parameters within normal range. Ventilation stable. No active alarms.
967
- </p>
968
- </div>
969
- </div>
970
-
971
- <!-- Waveform Analysis Panel -->
972
- <div class="panel" data-panel="waveforms">
973
- <div class="panel-header">
974
- <div class="panel-title">Waveform Analysis</div>
975
- <div class="panel-icon"><i class="fas fa-chart-line"></i></div>
976
- </div>
977
- <div class="graph-container">
978
- <canvas id="volumeGraph"></canvas>
979
- </div>
980
- <div class="parameter-control">
981
- <div class="control-label">
982
- <span><i class="fas fa-clock"></i> Time Scale</span>
983
- <span id="timeScaleValue">10s</span>
984
- </div>
985
- <input type="range" class="slider" id="timeScale" min="5" max="30" value="10">
986
- <div class="control-label">
987
- <span><i class="fas fa-sliders-h"></i> Amplitude</span>
988
- <span id="amplitudeValue">100%</span>
989
- </div>
990
- <input type="range" class="slider" id="amplitude" min="50" max="150" value="100">
991
- <div class="control-label">
992
- <span><i class="fas fa-filter"></i> Waveform Smoothing</span>
993
- <span id="smoothingValue">60%</span>
994
- </div>
995
- <input type="range" class="slider" id="smoothing" min="0" max="100" value="60">
996
- </div>
997
- </div>
998
-
999
- <!-- Clinical Scenarios Panel -->
1000
- <div class="panel" data-panel="scenarios">
1001
- <div class="panel-header">
1002
- <div class="panel-title">Clinical Scenarios</div>
1003
- <div class="panel-icon"><i class="fas fa-hospital-user"></i></div>
1004
- </div>
1005
- <div style="margin: 15px 0;">
1006
- <h3 style="font-size: 1.1em; margin-bottom: 10px;">
1007
- <i class="fas fa-clipboard-list"></i> Select Scenario:
1008
- </h3>
1009
- <select id="scenarioSelect" style="width: 100%; padding: 8px;">
1010
- <option>RDS - Preterm Infant</option>
1011
- <option>Apnea of Prematurity</option>
1012
- <option>Meconium Aspiration</option>
1013
- <option>PPHN</option>
1014
- <option>BPD Management</option>
1015
- </select>
1016
- </div>
1017
- <button class="btn" onclick="runScenario()">
1018
- <i class="fas fa-play"></i> Run Scenario
1019
- </button>
1020
- <div style="margin-top: 15px; padding: 10px; background: rgba(0, 51, 102, 0.2); border-radius: 8px;">
1021
- <p style="font-size: 0.85em; line-height: 1.5;">
1022
- <strong><i class="fas fa-lightbulb"></i> Recommendation:</strong> Based on current parameters, consider adjusting PIP to 22 cmH₂O and FiO₂ to 25% for optimal oxygenation.
1023
- </p>
1024
- </div>
1025
- </div>
1026
- </div>
1027
-
1028
- <footer>
1029
- <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank">
1030
- <i class="fas fa-code"></i> Built with anycoder
1031
- </a>
1032
- </footer>
1033
- </div>
1034
-
1035
- <script>
1036
- // Global variables to track application state
1037
- let currentMode = 'SIMV';
1038
- let debugMode = false;
1039
- let activeAlarms = [];
1040
- let panelStates = {
1041
- settings: false,
1042
- modes: false,
1043
- monitoring: false,
1044
- alarms: false,
1045
- waveforms: false,
1046
- scenarios: false
1047
- };
1048
-
1049
- // Initialize particles background
1050
- function createParticles() {
1051
- const particlesContainer = document.getElementById('particles');
1052
- for (let i = 0; i < 50; i++) {
1053
- const particle = document.createElement('div');
1054
- particle.className = 'particle';
1055
- particle.style.left = Math.random() * 100 + '%';
1056
- particle.style.animationDelay = Math.random() * 20 + 's';
1057
- particle.style.animationDuration = (15 + Math.random() * 10) + 's';
1058
- particlesContainer.appendChild(particle);
1059
- }
1060
- }
1061
-
1062
- // Panel expansion functionality - FIXED
1063
- document.querySelectorAll('.panel').forEach(panel => {
1064
- panel.addEventListener('click', function(e) {
1065
- // Don't expand if clicking interactive elements
1066
- if (e.target.classList.contains('close-btn') ||
1067
- e.target.tagName === 'BUTTON' ||
1068
- e.target.classList.contains('mode-card') ||
1069
- e.target.closest('.mode-card') ||
1070
- e.target.classList.contains('toggle-switch') ||
1071
- e.target.tagName === 'SELECT' ||
1072
- e.target.classList.contains('slider') ||
1073
- e.target.classList.contains('btn')) {
1074
- return;
1075
- }
1076
-
1077
- const panelId = this.getAttribute('data-panel');
1078
-
1079
- // Close any currently expanded panel
1080
- const expandedPanel = document.querySelector('.panel.expanded');
1081
- if (expandedPanel && expandedPanel !== this) {
1082
- expandedPanel.classList.remove('expanded');
1083
- document.getElementById('overlay').classList.remove('active');
1084
- }
1085
-
1086
- // Toggle current panel
1087
- this.classList.toggle('expanded');
1088
- document.getElementById('overlay').classList.toggle('active');
1089
-
1090
- // Add close button if expanded
1091
- if (this.classList.contains('expanded')) {
1092
- const closeBtn = document.createElement('button');
1093
- closeBtn.className = 'close-btn';
1094
- closeBtn.innerHTML = '<i class="fas fa-times"></i>';
1095
- closeBtn.onclick = (event) => {
1096
- event.stopPropagation();
1097
- this.classList.remove('expanded');
1098
- document.getElementById('overlay').classList.remove('active');
1099
- };
1100
- this.appendChild(closeBtn);
1101
- } else {
1102
- const closeBtn = this.querySelector('.close-btn');
1103
- if (closeBtn) closeBtn.remove();
1104
- }
1105
- });
1106
- });
1107
-
1108
- // Toggle switches - FIXED
1109
- document.querySelectorAll('.toggle-switch').forEach(toggle => {
1110
- toggle.addEventListener('click', function(e) {
1111
- e.stopPropagation();
1112
- this.classList.toggle('active');
1113
-
1114
- // Update functionality status
1115
- updateFunctionStatus();
1116
- });
1117
- });
1118
-
1119
- // Mode selection - FIXED
1120
- document.querySelectorAll('.mode-card').forEach(card => {
1121
- card.addEventListener('click', function(e) {
1122
- e.stopPropagation();
1123
- document.querySelectorAll('.mode-card').forEach(c => c.classList.remove('active'));
1124
- this.classList.add('active');
1125
- updateVentilationMode(this.dataset.mode);
1126
- });
1127
- });
1128
-
1129
- // Update ventilation mode function - FIXED
1130
- function updateVentilationMode(mode) {
1131
- currentMode = mode;
1132
- console.log(`Ventilation mode changed to: ${mode}`);
1133
-
1134
- // Update mode status display
1135
- const modeStatus = document.getElementById('modeStatus');
1136
- modeStatus.querySelector('span').textContent = `Mode: ${mode} - Active`;
1137
-
1138
- // Show debug info if enabled
1139
- if (debugMode) {
1140
- showDebugInfo(`Mode changed to: ${mode}`);
1141
- }
1142
- }
1143
-
1144
- // Slider functionality - FIXED
1145
- function initializeSliders() {
1146
- const sliders = document.querySelectorAll('.slider');
1147
- sliders.forEach(slider => {
1148
- slader.addEventListener('input', function(e) {
1149
- e.stopPropagation();
1150
- updateSliderValue(this);
1151
- });
1152
- });
1153
- }
1154
-
1155
- // Update slider value display - FIXED
1156
- function updateSliderValue(slider) {
1157
- const sliderId = slader.id;
1158
- const value = slader.value;
1159
-
1160
- switch(sliderId) {
1161
- case 'pipSlider':
1162
- document.getElementById('pipValue').textContent = value;
1163
- updatePressureWaveform(parseInt(value));
1164
- break;
1165
- case 'peepSlider':
1166
- document.getElementById('peepValue').textContent = value;
1167
- break;
1168
- case 'rrSlider':
1169
- document.getElementById('rrValue').textContent = value;
1170
- updateFlowWaveform(parseInt(value));
1171
- break;
1172
- case 'fiO2Slider':
1173
- document.getElementById('fiO2Value').textContent = value;
1174
- break;
1175
- case 'timeScale':
1176
- document.getElementById('timeScaleValue').textContent = value + 's';
1177
- break;
1178
- case 'amplitude':
1179
- document.getElementById('amplitudeValue').textContent = value + '%';
1180
- break;
1181
- case 'smoothing':
1182
- document.getElementById('smoothingValue').textContent = value + '%';
1183
- break;
1184
- case 'complianceSens':
1185
- document.getElementById('complianceSensValue').textContent = value + '%';
1186
- break;
1187
- }
1188
-
1189
- // Update data values with animation
1190
- updateDataValues();
1191
- }
1192
-
1193
- // Update data values with animation - NEW
1194
- function updateDataValues() {
1195
- const pip = parseInt(document.getElementById('pipSlider').value);
1196
- const peep = parseInt(document.getElementById('peepSlider').value);
1197
- const rr = parseInt(document.getElementById('rrSlider').value);
1198
-
1199
- // Calculate derived values based on settings
1200
- const tidalVolume = Math.round(pip * 2.2 + Math.random() * 5);
1201
- const compliance = (pip > 25 ? 0.8 : 1.2) + Math.random() * 0.1;
1202
- const resistance = Math.round(30 + (pip - 20) * 2);
1203
-
1204
- // Update values with animation
1205
- const tidalElement = document.getElementById('tidalVolume');
1206
- const complianceElement = document.getElementById('complianceValue');
1207
- const resistanceElement = document.getElementById('resistanceValue');
1208
-
1209
- tidalElement.textContent = tidalVolume;
1210
- complianceElement.textContent = compliance.toFixed(1);
1211
- resistanceElement.textContent = resistance;
1212
-
1213
- // Add pulsing animation to show update
1214
- [tidalElement, complianceElement, resistanceElement].forEach(el => {
1215
- el.classList.add('data-updating');
1216
- setTimeout(() => {
1217
- el.classList.remove('data-updating');
1218
- }, 1000);
1219
- }
1220
-
1221
- // Graph animations - FIXED
1222
- function animatePressureGraph() {
1223
- const canvas = document.getElementById('pressureGraph');
1224
- if (!canvas) return;
1225
-
1226
- const ctx = canvas.getContext('2d');
1227
- canvas.width = canvas.offsetWidth;
1228
- canvas.height = canvas.offsetHeight;
1229
-
1230
- let phase = 0;
1231
-
1232
- function draw() {
1233
- if (!canvas.parentElement) return;
1234
-
1235
- ctx.clearRect(0, 0, canvas.width, canvas.height);
1236
-
1237
- // Grid
1238
- ctx.strokeStyle = 'rgba(0, 212, 255, 0.1)';
1239
- ctx.lineWidth = 1;
1240
- for (let i = 0; i < 5; i++) {
1241
- ctx.beginPath();
1242
- ctx.moveTo(0, (canvas.height / 5) * i);
1243
- ctx.lineTo(canvas.width, (canvas.height / 5) * i);
1244
- ctx.stroke();
1245
- }
1246
-
1247
- // Pressure wave
1248
- ctx.strokeStyle = '#00d4ff';
1249
- ctx.lineWidth = 2;
1250
- ctx.shadowBlur = 10;
1251
- ctx.shadowColor = '#00d4ff';
1252
- ctx.beginPath();
1253
-
1254
- for (let x = 0; x < canvas.width; x++) {
1255
- const t = (x / canvas.width) * 4 * Math.PI;
1256
- const y = canvas.height / 2 -
1257
- (Math.sin(t + phase) * 0.7 + Math.sin(t * 2 + phase) * 0.3) *
1258
- (canvas.height * 0.3);
1259
-
1260
- if (x === 0) ctx.moveTo(x, y);
1261
- else ctx.lineTo(x, y);
1262
- }
1263
-
1264
- ctx.stroke();
1265
- phase += 0.05;
1266
- requestAnimationFrame(draw);
1267
- }
1268
-
1269
- draw();
1270
- }
1271
-
1272
- function animateFlowGraph() {
1273
- const canvas = document.getElementById('flowGraph');
1274
- if (!canvas) return;
1275
-
1276
- const ctx = canvas.getContext('2d');
1277
- canvas.width = canvas.offsetWidth;
1278
- canvas.height = canvas.offsetHeight;
1279
-
1280
- let phase = 0;
1281
-
1282
- function draw() {
1283
- if (!canvas.parentElement) return;
1284
-
1285
- ctx.clearRect(0, 0, canvas.width, canvas.height);
1286
-
1287
- // Grid
1288
- ctx.strokeStyle = 'rgba(0, 212, 255, 0.1)';
1289
- ctx.lineWidth = 1;
1290
- ctx.beginPath();
1291
- ctx.moveTo(canvas.width / 2, 0);
1292
- ctx.lineTo(canvas.width / 2, canvas.height);
1293
- ctx.stroke();
1294
-
1295
- // Flow wave
1296
- ctx.strokeStyle = '#00ff88';
1297
- ctx.lineWidth = 2;
1298
- ctx.shadowBlur = 10;
1299
- ctx.shadowColor = '#00ff88';
1300
- ctx.beginPath();
1301
-
1302
- for (let x = 0; x < canvas.width; x++) {
1303
- const t = (x / canvas.width) * 4 * Math.PI;
1304
- const y = canvas.height / 2 -
1305
- Math.sin(t + phase) *
1306
- (canvas.height * 0.3);
1307
-
1308
- if (x === 0) ctx.moveTo(x, y);
1309
- else ctx.lineTo(x, y);
1310
- }
1311
-
1312
- ctx.stroke();
1313
- phase += 0.05;
1314
- requestAnimationFrame(draw);
1315
- }
1316
-
1317
- draw();
1318
- }
1319
-
1320
- function animateVolumeGraph() {
1321
- const canvas = document.getElementById('volumeGraph');
1322
- if (!canvas) return;
1323
-
1324
- const ctx = canvas.getContext('2d');
1325
- canvas.width = canvas.offsetWidth;
1326
- canvas.height = canvas.offsetHeight;
1327
-
1328
- let phase = 0;
1329
-
1330
- function draw() {
1331
- if (!canvas.parentElement) return;
1332
-
1333
- ctx.clearRect(0, 0, canvas.width, canvas.height);
1334
-
1335
- // Grid
1336
- ctx.strokeStyle = 'rgba(0, 212, 255, 0.1)';
1337
- ctx.lineWidth = 1;
1338
- for (let i = 0; i < 5; i++) {
1339
- ctx.beginPath();
1340
- ctx.moveTo
 
88
 
89
  /* Header */
90
  header {
91
+ background: linear-gradient(135deg, rgba(0, 51, 102