Update index.html
Browse files- index.html +41 -36
index.html
CHANGED
@@ -992,7 +992,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
|
992 |
}
|
993 |
}
|
994 |
|
995 |
-
|
996 |
function applyVolume() {
|
997 |
if (!isAudioCombined) return;
|
998 |
|
@@ -1332,28 +1332,34 @@ function applyVolume() {
|
|
1332 |
togglePlayPause();
|
1333 |
});
|
1334 |
|
1335 |
-
|
1336 |
-
|
1337 |
-
if (!isAudioCombined) return;
|
1338 |
-
video.volume = this.value;
|
1339 |
-
lastVolume = this.value;
|
1340 |
-
updateVolumeIcon();
|
1341 |
-
});
|
1342 |
|
1343 |
-
//
|
1344 |
-
|
1345 |
-
|
1346 |
-
|
1347 |
-
|
1348 |
-
|
1349 |
-
|
1350 |
-
|
1351 |
-
|
1352 |
-
|
1353 |
-
|
1354 |
-
|
1355 |
-
|
1356 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1357 |
|
1358 |
// 音量アイコンを更新
|
1359 |
function updateVolumeIcon() {
|
@@ -1456,20 +1462,19 @@ function applyVolume() {
|
|
1456 |
});
|
1457 |
});
|
1458 |
|
1459 |
-
|
1460 |
-
|
1461 |
-
|
1462 |
-
|
1463 |
-
|
1464 |
-
|
1465 |
-
|
1466 |
-
|
1467 |
-
|
1468 |
-
|
1469 |
-
|
1470 |
-
|
1471 |
-
|
1472 |
-
});
|
1473 |
|
1474 |
// ループ設定変更時
|
1475 |
loopCheckbox.addEventListener('change', function() {
|
|
|
992 |
}
|
993 |
}
|
994 |
|
995 |
+
// 音量を適用 (リアルタイムで反映)
|
996 |
function applyVolume() {
|
997 |
if (!isAudioCombined) return;
|
998 |
|
|
|
1332 |
togglePlayPause();
|
1333 |
});
|
1334 |
|
1335 |
+
volumeSlider.addEventListener('input', function() {
|
1336 |
+
if (!isAudioCombined) return;
|
|
|
|
|
|
|
|
|
|
|
1337 |
|
1338 |
+
// グローバル音量係数を考慮
|
1339 |
+
const baseVolume = parseFloat(this.value);
|
1340 |
+
const globalVolume = parseFloat(globalVolumeSlider.value) / 10;
|
1341 |
+
const finalVolume = Math.max(0, Math.min(1, baseVolume * globalVolume));
|
1342 |
+
|
1343 |
+
video.volume = finalVolume;
|
1344 |
+
lastVolume = baseVolume; // ベース音量を保存
|
1345 |
+
updateVolumeIcon();
|
1346 |
+
});
|
1347 |
+
|
1348 |
+
volumeBtn.addEventListener('click', function() {
|
1349 |
+
if (!isAudioCombined) return;
|
1350 |
+
|
1351 |
+
if (video.volume > 0) {
|
1352 |
+
lastVolume = volumeSlider.value; // ベース音量を保存
|
1353 |
+
video.volume = 0;
|
1354 |
+
volumeSlider.value = 0;
|
1355 |
+
} else {
|
1356 |
+
// グローバル音量係数を考慮して復元
|
1357 |
+
const globalVolume = parseFloat(globalVolumeSlider.value) / 10;
|
1358 |
+
video.volume = Math.max(0, Math.min(1, lastVolume * globalVolume));
|
1359 |
+
volumeSlider.value = lastVolume;
|
1360 |
+
}
|
1361 |
+
updateVolumeIcon();
|
1362 |
+
});
|
1363 |
|
1364 |
// 音量アイコンを更新
|
1365 |
function updateVolumeIcon() {
|
|
|
1462 |
});
|
1463 |
});
|
1464 |
|
1465 |
+
// グローバル音量スライダーのイベントリスナーを更新
|
1466 |
+
globalVolumeSlider.addEventListener('input', function() {
|
1467 |
+
const value = parseFloat(this.value);
|
1468 |
+
// 表示値は0-10の範囲で表示
|
1469 |
+
globalVolumeValue.textContent = value.toFixed(1);
|
1470 |
+
|
1471 |
+
// スライダーの背景を更新
|
1472 |
+
const percent = (value - this.min) / (this.max - this.min) * 100;
|
1473 |
+
this.style.backgroundSize = `${percent}% 100%`;
|
1474 |
+
|
1475 |
+
// 音量をリアルタイムで適用
|
1476 |
+
applyVolume();
|
1477 |
+
});
|
|
|
1478 |
|
1479 |
// ループ設定変更時
|
1480 |
loopCheckbox.addEventListener('change', function() {
|