Update index.html
Browse files- index.html +23 -6
index.html
CHANGED
@@ -601,6 +601,18 @@
|
|
601 |
</style>
|
602 |
</head>
|
603 |
<body>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
604 |
<!-- テクノロジー風背景 -->
|
605 |
<div class="tech-background" id="techBg"></div>
|
606 |
|
@@ -736,6 +748,7 @@
|
|
736 |
|
737 |
<script>
|
738 |
document.addEventListener('DOMContentLoaded', function() {
|
|
|
739 |
// テクノロジー風背景を生成
|
740 |
function createTechBackground() {
|
741 |
const bg = document.getElementById('techBg');
|
@@ -788,7 +801,11 @@ document.addEventListener('DOMContentLoaded', function() {
|
|
788 |
}
|
789 |
|
790 |
createTechBackground();
|
791 |
-
|
|
|
|
|
|
|
|
|
792 |
// ローディング状態を管理
|
793 |
let loadingCount = 0;
|
794 |
let totalToLoad = 6; // 動画 + 5つの音声ファイル
|
@@ -874,22 +891,22 @@ document.addEventListener('DOMContentLoaded', function() {
|
|
874 |
function loadAudioFiles() {
|
875 |
audioFiles.forEach(file => {
|
876 |
try {
|
877 |
-
const audio = new Audio(`${file}.mp3`);
|
878 |
audio.preload = 'auto';
|
879 |
audio.loop = false;
|
880 |
audioElements[file] = audio;
|
881 |
|
882 |
audio.addEventListener('loadedmetadata', function() {
|
883 |
-
console.log(`${file}.mp3 loaded`);
|
884 |
checkLoadingComplete();
|
885 |
});
|
886 |
|
887 |
audio.addEventListener('error', function() {
|
888 |
-
console.error(`音声ファイル読み込みエラー (${file}.mp3):`, audio.error);
|
889 |
checkLoadingComplete();
|
890 |
});
|
891 |
} catch (error) {
|
892 |
-
console.error(`音声ファイル初期化エラー (${file}.mp3):`, error);
|
893 |
checkLoadingComplete();
|
894 |
}
|
895 |
});
|
@@ -916,7 +933,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
|
916 |
const audio = audioElements[file];
|
917 |
if (!audio) return null;
|
918 |
|
919 |
-
const response = await fetch(`${file}.mp3`);
|
920 |
const arrayBuffer = await response.arrayBuffer();
|
921 |
return await audioContext.decodeAudioData(arrayBuffer);
|
922 |
});
|
|
|
601 |
</style>
|
602 |
</head>
|
603 |
<body>
|
604 |
+
<script>
|
605 |
+
// 動画パスを再設定
|
606 |
+
document.addEventListener('DOMContentLoaded', function() {
|
607 |
+
const urlParams = new URLSearchParams(window.location.search);
|
608 |
+
const isTMode = urlParams.has('mode') && urlParams.get('mode') === 't';
|
609 |
+
const video = document.getElementById('video');
|
610 |
+
|
611 |
+
if (isTMode) {
|
612 |
+
video.querySelector('source').src = '/t/v.mp4';
|
613 |
+
}
|
614 |
+
});
|
615 |
+
</script>
|
616 |
<!-- テクノロジー風背景 -->
|
617 |
<div class="tech-background" id="techBg"></div>
|
618 |
|
|
|
748 |
|
749 |
<script>
|
750 |
document.addEventListener('DOMContentLoaded', function() {
|
751 |
+
|
752 |
// テクノロジー風背景を生成
|
753 |
function createTechBackground() {
|
754 |
const bg = document.getElementById('techBg');
|
|
|
801 |
}
|
802 |
|
803 |
createTechBackground();
|
804 |
+
|
805 |
+
const urlParams = new URLSearchParams(window.location.search);
|
806 |
+
const isTMode = urlParams.has('mode') && urlParams.get('mode') === 't';
|
807 |
+
const basePath = isTMode ? '/t/' : '/';
|
808 |
+
|
809 |
// ローディング状態を管理
|
810 |
let loadingCount = 0;
|
811 |
let totalToLoad = 6; // 動画 + 5つの音声ファイル
|
|
|
891 |
function loadAudioFiles() {
|
892 |
audioFiles.forEach(file => {
|
893 |
try {
|
894 |
+
const audio = new Audio(`${basePath}${file}.mp3`);
|
895 |
audio.preload = 'auto';
|
896 |
audio.loop = false;
|
897 |
audioElements[file] = audio;
|
898 |
|
899 |
audio.addEventListener('loadedmetadata', function() {
|
900 |
+
console.log(`${basePath}${file}.mp3 loaded`);
|
901 |
checkLoadingComplete();
|
902 |
});
|
903 |
|
904 |
audio.addEventListener('error', function() {
|
905 |
+
console.error(`音声ファイル読み込みエラー (${basePath}${file}.mp3):`, audio.error);
|
906 |
checkLoadingComplete();
|
907 |
});
|
908 |
} catch (error) {
|
909 |
+
console.error(`音声ファイル初期化エラー (${basePath}${file}.mp3):`, error);
|
910 |
checkLoadingComplete();
|
911 |
}
|
912 |
});
|
|
|
933 |
const audio = audioElements[file];
|
934 |
if (!audio) return null;
|
935 |
|
936 |
+
const response = await fetch(`${basePath}${file}.mp3`);
|
937 |
const arrayBuffer = await response.arrayBuffer();
|
938 |
return await audioContext.decodeAudioData(arrayBuffer);
|
939 |
});
|