Spaces:
Running
Running
Update index.html
Browse files- index.html +38 -24
index.html
CHANGED
|
@@ -579,58 +579,72 @@
|
|
| 579 |
// ๊ฐ ๊ฒฝ๊ณ ์ ์ด๊ธฐํ
|
| 580 |
try {
|
| 581 |
this.warningAudios.altitude = new Audio('sounds/altitude.ogg');
|
| 582 |
-
this.warningAudios.altitude.
|
| 583 |
-
this.warningAudios.altitude.volume = 0.5;
|
| 584 |
|
| 585 |
this.warningAudios.pullup = new Audio('sounds/pullup.ogg');
|
| 586 |
-
this.warningAudios.pullup.
|
| 587 |
-
this.warningAudios.pullup.volume = 0.6;
|
| 588 |
|
| 589 |
this.warningAudios.overg = new Audio('sounds/overg.ogg');
|
| 590 |
-
this.warningAudios.overg.
|
| 591 |
-
this.warningAudios.overg.volume = 0.5;
|
| 592 |
|
| 593 |
this.warningAudios.stall = new Audio('sounds/alert.ogg');
|
| 594 |
-
this.warningAudios.stall.
|
| 595 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 596 |
} catch (e) {
|
| 597 |
console.log('Warning audio initialization failed:', e);
|
| 598 |
}
|
| 599 |
}
|
| 600 |
|
| 601 |
updateWarningAudios() {
|
|
|
|
|
|
|
|
|
|
| 602 |
// Pull up ๊ฒฝ๊ณ (250m ์ดํ) - ์ต์ฐ์ ์์
|
| 603 |
if (this.altitude < 250) {
|
| 604 |
-
|
| 605 |
-
this.playWarningAudio('pullup');
|
| 606 |
}
|
| 607 |
// Altitude ๊ฒฝ๊ณ (250-500m)
|
| 608 |
else if (this.altitude < 500) {
|
| 609 |
-
|
| 610 |
-
this.playWarningAudio('altitude');
|
| 611 |
}
|
| 612 |
// Over-G ๊ฒฝ๊ณ
|
| 613 |
else if (this.overG) {
|
| 614 |
-
|
| 615 |
-
this.playWarningAudio('overg');
|
| 616 |
}
|
| 617 |
// Stall ๊ฒฝ๊ณ
|
| 618 |
else if (this.stallWarning) {
|
| 619 |
-
|
| 620 |
-
this.playWarningAudio('stall');
|
| 621 |
}
|
| 622 |
-
|
| 623 |
-
|
| 624 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 625 |
}
|
| 626 |
}
|
| 627 |
|
| 628 |
playWarningAudio(type) {
|
| 629 |
-
|
| 630 |
-
this.warningAudios[type].play().catch(e => {
|
| 631 |
-
// ์๋ ์ฌ์ ์ฐจ๋จ ์ ๋ฌด์
|
| 632 |
-
});
|
| 633 |
-
}
|
| 634 |
}
|
| 635 |
|
| 636 |
stopAllWarningAudios() {
|
|
|
|
| 579 |
// ๊ฐ ๊ฒฝ๊ณ ์ ์ด๊ธฐํ
|
| 580 |
try {
|
| 581 |
this.warningAudios.altitude = new Audio('sounds/altitude.ogg');
|
| 582 |
+
this.warningAudios.altitude.volume = 0.75; // 150% ์๋ (0.5 * 1.5)
|
|
|
|
| 583 |
|
| 584 |
this.warningAudios.pullup = new Audio('sounds/pullup.ogg');
|
| 585 |
+
this.warningAudios.pullup.volume = 0.9; // 150% ์๋ (0.6 * 1.5)
|
|
|
|
| 586 |
|
| 587 |
this.warningAudios.overg = new Audio('sounds/overg.ogg');
|
| 588 |
+
this.warningAudios.overg.volume = 0.75; // 150% ์๋ (0.5 * 1.5)
|
|
|
|
| 589 |
|
| 590 |
this.warningAudios.stall = new Audio('sounds/alert.ogg');
|
| 591 |
+
this.warningAudios.stall.volume = 0.75; // 150% ์๋ (0.5 * 1.5)
|
| 592 |
+
|
| 593 |
+
// ๊ฐ ์ค๋์ค์ ended ์ด๋ฒคํธ ๋ฆฌ์ค๋ ์ถ๊ฐ
|
| 594 |
+
Object.keys(this.warningAudios).forEach(key => {
|
| 595 |
+
if (this.warningAudios[key]) {
|
| 596 |
+
this.warningAudios[key].addEventListener('ended', () => {
|
| 597 |
+
// ์ค๋์ค๊ฐ ๋๋ฌ์ ๋ ๋ค์ ์ฌ์ ์กฐ๊ฑด ์ฒดํฌ
|
| 598 |
+
this.updateWarningAudios();
|
| 599 |
+
});
|
| 600 |
+
}
|
| 601 |
+
});
|
| 602 |
} catch (e) {
|
| 603 |
console.log('Warning audio initialization failed:', e);
|
| 604 |
}
|
| 605 |
}
|
| 606 |
|
| 607 |
updateWarningAudios() {
|
| 608 |
+
// ํ์ฌ ์ฌ์ ์ค์ธ ๊ฒฝ๊ณ ์ ์ถ์
|
| 609 |
+
let currentWarning = null;
|
| 610 |
+
|
| 611 |
// Pull up ๊ฒฝ๊ณ (250m ์ดํ) - ์ต์ฐ์ ์์
|
| 612 |
if (this.altitude < 250) {
|
| 613 |
+
currentWarning = 'pullup';
|
|
|
|
| 614 |
}
|
| 615 |
// Altitude ๊ฒฝ๊ณ (250-500m)
|
| 616 |
else if (this.altitude < 500) {
|
| 617 |
+
currentWarning = 'altitude';
|
|
|
|
| 618 |
}
|
| 619 |
// Over-G ๊ฒฝ๊ณ
|
| 620 |
else if (this.overG) {
|
| 621 |
+
currentWarning = 'overg';
|
|
|
|
| 622 |
}
|
| 623 |
// Stall ๊ฒฝ๊ณ
|
| 624 |
else if (this.stallWarning) {
|
| 625 |
+
currentWarning = 'stall';
|
|
|
|
| 626 |
}
|
| 627 |
+
|
| 628 |
+
// ๋ค๋ฅธ ๊ฒฝ๊ณ ์๋ค ์ ์ง
|
| 629 |
+
Object.keys(this.warningAudios).forEach(key => {
|
| 630 |
+
if (key !== currentWarning && this.warningAudios[key] && !this.warningAudios[key].paused) {
|
| 631 |
+
this.warningAudios[key].pause();
|
| 632 |
+
this.warningAudios[key].currentTime = 0;
|
| 633 |
+
}
|
| 634 |
+
});
|
| 635 |
+
|
| 636 |
+
// ํ์ฌ ๊ฒฝ๊ณ ์ ์ฌ์ (์ฌ์ ์ค์ด ์๋ ๋๋ง)
|
| 637 |
+
if (currentWarning && this.warningAudios[currentWarning]) {
|
| 638 |
+
if (this.warningAudios[currentWarning].paused) {
|
| 639 |
+
this.warningAudios[currentWarning].play().catch(e => {
|
| 640 |
+
// ์๋ ์ฌ์ ์ฐจ๋จ ์ ๋ฌด์
|
| 641 |
+
});
|
| 642 |
+
}
|
| 643 |
}
|
| 644 |
}
|
| 645 |
|
| 646 |
playWarningAudio(type) {
|
| 647 |
+
// ์ด ํจ์๋ ๋ ์ด์ ์ฌ์ฉํ์ง ์์ (updateWarningAudios์์ ์ง์ ์ฒ๋ฆฌ)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 648 |
}
|
| 649 |
|
| 650 |
stopAllWarningAudios() {
|