Update index.html
Browse files- index.html +5 -4
index.html
CHANGED
@@ -1177,10 +1177,11 @@ window.addEventListener('load', async () => {
|
|
1177 |
|
1178 |
<script>
|
1179 |
document.addEventListener('DOMContentLoaded', function() {
|
|
|
1180 |
// メトロノーム関連のグローバル変数
|
1181 |
let metronomeState = {
|
1182 |
isActive: false,
|
1183 |
-
bpm:
|
1184 |
};
|
1185 |
|
1186 |
// メトロノームのタイムライン
|
@@ -1255,12 +1256,12 @@ function setTempoFromBPM() {
|
|
1255 |
const bpmInput = document.getElementById('bpmInput');
|
1256 |
let bpm = parseInt(bpmInput.value);
|
1257 |
|
1258 |
-
if (isNaN(bpm)) bpm =
|
1259 |
-
bpm = Math.max(
|
1260 |
bpmInput.value = bpm;
|
1261 |
metronomeState.bpm = bpm;
|
1262 |
|
1263 |
-
const tempoLevel = Math.round(gsap.utils.mapRange(
|
1264 |
gsap.set('#lvl', {
|
1265 |
attr: { 'stroke-dasharray': tempoLevel * 10 + ' ' + (100 - tempoLevel * 10) }
|
1266 |
});
|
|
|
1177 |
|
1178 |
<script>
|
1179 |
document.addEventListener('DOMContentLoaded', function() {
|
1180 |
+
const urlParams = new URLSearchParams(window.location.search);
|
1181 |
// メトロノーム関連のグローバル変数
|
1182 |
let metronomeState = {
|
1183 |
isActive: false,
|
1184 |
+
bpm: urlParams.get('mode') === 't' ? 66 : 92
|
1185 |
};
|
1186 |
|
1187 |
// メトロノームのタイムライン
|
|
|
1256 |
const bpmInput = document.getElementById('bpmInput');
|
1257 |
let bpm = parseInt(bpmInput.value);
|
1258 |
|
1259 |
+
if (isNaN(bpm)) bpm = 60;
|
1260 |
+
bpm = Math.max(0, Math.min(bpm, 10000));
|
1261 |
bpmInput.value = bpm;
|
1262 |
metronomeState.bpm = bpm;
|
1263 |
|
1264 |
+
const tempoLevel = Math.round(gsap.utils.mapRange(0, 10000, 1, 10, bpm));
|
1265 |
gsap.set('#lvl', {
|
1266 |
attr: { 'stroke-dasharray': tempoLevel * 10 + ' ' + (100 - tempoLevel * 10) }
|
1267 |
});
|