soiz1 commited on
Commit
cf299ae
·
1 Parent(s): f8a855f

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +36 -32
index.html CHANGED
@@ -993,16 +993,17 @@ document.addEventListener('DOMContentLoaded', function() {
993
  }
994
 
995
  // 音量を適用
996
- function applyVolume() {
997
- if (!isAudioCombined) return;
998
-
999
- const globalVolume = parseFloat(globalVolumeSlider.value);
1000
- // 音量を0-1の範囲に制限
1001
- const clampedVolume = Math.max(0, Math.min(1, globalVolume));
1002
- video.volume = clampedVolume;
1003
- volumeSlider.value = clampedVolume;
1004
- updateVolumeIcon();
1005
- }
 
1006
 
1007
  // 再生速度を適用(ピッチ維持)
1008
  function applyPlaybackRate() {
@@ -1498,29 +1499,32 @@ document.addEventListener('DOMContentLoaded', function() {
1498
  video.controls = false;
1499
 
1500
  // スライダーの背景を初期化
1501
- function initSliderBackgrounds() {
1502
- const sliders = [
1503
- volumeSlider,
1504
- speedSlider,
1505
- globalVolumeSlider,
1506
- playbackSpeedSlider,
1507
- ...audioSliders
1508
- ];
1509
-
1510
- sliders.forEach(slider => {
1511
- if (slider) {
1512
- slider.style.backgroundImage = 'linear-gradient(#64ffda, #64ffda)';
1513
- slider.style.backgroundRepeat = 'no-repeat';
1514
-
1515
- if (slider === globalVolumeSlider) {
1516
- const percent = (slider.value - slider.min) / (slider.max - slider.min) * 100;
1517
- slider.style.backgroundSize = `${percent}% 100%`;
1518
- } else {
1519
- slider.style.backgroundSize = `${slider.value * 100}% 100%`;
1520
- }
 
 
1521
  }
1522
- });
1523
- }
 
1524
 
1525
  initSliderBackgrounds();
1526
  });
 
993
  }
994
 
995
  // 音量を適用
996
+ function applyVolume() {
997
+ if (!isAudioCombined) return;
998
+
999
+ // 0-10の範囲を0-1に変換
1000
+ const globalVolume = parseFloat(globalVolumeSlider.value) / 10;
1001
+ // 音量を0-1の範囲に制限
1002
+ const clampedVolume = Math.max(0, Math.min(1, globalVolume));
1003
+ video.volume = clampedVolume;
1004
+ volumeSlider.value = clampedVolume;
1005
+ updateVolumeIcon();
1006
+ }
1007
 
1008
  // 再生速度を適用(ピッチ維持)
1009
  function applyPlaybackRate() {
 
1499
  video.controls = false;
1500
 
1501
  // スライダーの背景を初期化
1502
+ // 初期化時にスライダーの背景を設定 (修正版)
1503
+ function initSliderBackgrounds() {
1504
+ const sliders = [
1505
+ volumeSlider,
1506
+ speedSlider,
1507
+ globalVolumeSlider,
1508
+ playbackSpeedSlider,
1509
+ ...audioSliders
1510
+ ];
1511
+
1512
+ sliders.forEach(slider => {
1513
+ if (slider) {
1514
+ slider.style.backgroundImage = 'linear-gradient(#64ffda, #64ffda)';
1515
+ slider.style.backgroundRepeat = 'no-repeat';
1516
+
1517
+ if (slider === globalVolumeSlider) {
1518
+ // 0-10の範囲で初期化
1519
+ const percent = (slider.value - slider.min) / (slider.max - slider.min) * 100;
1520
+ slider.style.backgroundSize = `${percent}% 100%`;
1521
+ globalVolumeValue.textContent = slider.value;
1522
+ } else {
1523
+ slider.style.backgroundSize = `${slider.value * 100}% 100%`;
1524
  }
1525
+ }
1526
+ });
1527
+ }
1528
 
1529
  initSliderBackgrounds();
1530
  });