Update index.html
Browse files- index.html +105 -100
index.html
CHANGED
@@ -2235,108 +2235,113 @@
|
|
2235 |
tempoInput.value = isTMode ? 66 : 92;
|
2236 |
tempoInput.dispatchEvent(new Event('input'));
|
2237 |
});
|
2238 |
-
|
2239 |
-
|
2240 |
-
|
2241 |
-
|
2242 |
-
|
2243 |
-
|
2244 |
-
|
2245 |
-
|
2246 |
-
|
2247 |
-
|
2248 |
-
|
2249 |
-
|
2250 |
-
|
2251 |
-
|
2252 |
-
|
2253 |
-
|
2254 |
-
|
2255 |
-
|
2256 |
-
|
2257 |
-
|
2258 |
-
|
2259 |
-
|
2260 |
-
|
2261 |
-
|
2262 |
-
|
2263 |
-
|
2264 |
-
|
2265 |
-
|
2266 |
-
|
2267 |
-
|
2268 |
-
|
2269 |
-
|
2270 |
-
|
2271 |
-
|
2272 |
-
|
2273 |
-
|
2274 |
-
|
2275 |
-
|
2276 |
-
|
2277 |
-
|
2278 |
-
|
2279 |
-
|
2280 |
-
|
2281 |
-
|
2282 |
-
|
2283 |
-
|
2284 |
-
|
2285 |
-
|
2286 |
-
|
2287 |
-
|
2288 |
-
|
2289 |
-
|
2290 |
-
|
2291 |
-
|
2292 |
-
|
2293 |
-
|
2294 |
-
|
2295 |
-
|
2296 |
-
|
2297 |
-
|
2298 |
-
|
2299 |
-
|
2300 |
-
|
2301 |
-
|
2302 |
-
|
2303 |
-
|
2304 |
-
|
2305 |
-
|
2306 |
-
|
2307 |
-
|
2308 |
-
|
2309 |
-
|
2310 |
-
|
2311 |
-
|
2312 |
-
|
2313 |
-
|
2314 |
-
|
2315 |
-
|
2316 |
-
|
2317 |
-
|
2318 |
-
|
2319 |
-
|
2320 |
-
|
2321 |
-
|
2322 |
-
startTimeInput.addEventListener('input', updateProgressMarkers);
|
2323 |
-
endTimeInput.addEventListener('input', updateProgressMarkers);
|
2324 |
-
|
2325 |
-
// 既存のupdateProgressMarkers関数を再利用
|
2326 |
-
function updateProgressMarkers() {
|
2327 |
-
const duration = video.duration || videoDuration;
|
2328 |
-
const startTime = parseFloat(startTimeInput.value) || 0;
|
2329 |
-
const endTime = parseFloat(endTimeInput.value) || duration;
|
2330 |
-
|
2331 |
-
if (duration > 0) {
|
2332 |
-
startMarker.style.left = `${(startTime / duration) * 100}%`;
|
2333 |
-
endMarker.style.left = `${(endTime / duration) * 100}%`;
|
2334 |
-
|
2335 |
-
startMarker.style.display = 'block';
|
2336 |
-
endMarker.style.display = 'block';
|
2337 |
-
}
|
2338 |
}
|
2339 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2340 |
|
2341 |
</script>
|
2342 |
</body>
|
|
|
2235 |
tempoInput.value = isTMode ? 66 : 92;
|
2236 |
tempoInput.dispatchEvent(new Event('input'));
|
2237 |
});
|
2238 |
+
// タイムマーカー関連のコードを修正
|
2239 |
+
document.addEventListener('DOMContentLoaded', function() {
|
2240 |
+
// まず必要なDOM要素を取得
|
2241 |
+
const startMarker = document.getElementById('start-marker');
|
2242 |
+
const endMarker = document.getElementById('end-marker');
|
2243 |
+
const video = document.getElementById('video');
|
2244 |
+
const startTimeInput = document.getElementById('start-time');
|
2245 |
+
const endTimeInput = document.getElementById('end-time');
|
2246 |
+
|
2247 |
+
// URLパラメータをチェック
|
2248 |
+
const urlParams = new URLSearchParams(window.location.search);
|
2249 |
+
const isTMode = urlParams.has('mode') && urlParams.get('mode') === 't';
|
2250 |
+
|
2251 |
+
// タイムマーカーデータ
|
2252 |
+
const timeMarkers = isTMode ? [
|
2253 |
+
{ label: '①[1番]', time: 15.2 },
|
2254 |
+
{ label: '②[1番]', time: 43.8 },
|
2255 |
+
{ label: '①[2番]', time: 79.0 },
|
2256 |
+
{ label: '②[2番]', time: 108.0 },
|
2257 |
+
{ label: '③', time: 137.25 },
|
2258 |
+
{ label: '④', time: 162.55 },
|
2259 |
+
{ label: '⑤', time: 191.65 }
|
2260 |
+
] : [
|
2261 |
+
{ label: 'A', time: 8.35 },
|
2262 |
+
{ label: 'B', time: 72.1 },
|
2263 |
+
{ label: 'C', time: 98.67 },
|
2264 |
+
{ label: 'D', time: 155.83 },
|
2265 |
+
{ label: 'E', time: 192.55 }
|
2266 |
+
];
|
2267 |
+
|
2268 |
+
// タイムマーカーを表示
|
2269 |
+
const timeMarkersContainer = document.getElementById('time-markers-container');
|
2270 |
+
|
2271 |
+
timeMarkers.forEach(marker => {
|
2272 |
+
const markerElement = document.createElement('div');
|
2273 |
+
markerElement.className = 'time-marker';
|
2274 |
+
markerElement.innerHTML = `<b>${marker.label}</b>(${marker.time}秒)`;
|
2275 |
+
markerElement.dataset.time = marker.time;
|
2276 |
+
|
2277 |
+
// ドラッグ開始
|
2278 |
+
markerElement.addEventListener('dragstart', function(e) {
|
2279 |
+
e.dataTransfer.setData('text/plain', marker.time);
|
2280 |
+
this.classList.add('dragging');
|
2281 |
+
});
|
2282 |
+
|
2283 |
+
// ドラッグ終了
|
2284 |
+
markerElement.addEventListener('dragend', function() {
|
2285 |
+
this.classList.remove('dragging');
|
2286 |
+
});
|
2287 |
+
|
2288 |
+
// ドラッグ可能に設定
|
2289 |
+
markerElement.draggable = true;
|
2290 |
+
|
2291 |
+
// クリックで開始時間に設定
|
2292 |
+
markerElement.addEventListener('click', function() {
|
2293 |
+
startTimeInput.value = marker.time;
|
2294 |
+
updateProgressMarkers();
|
2295 |
+
});
|
2296 |
+
|
2297 |
+
timeMarkersContainer.appendChild(markerElement);
|
2298 |
+
});
|
2299 |
+
|
2300 |
+
// ドロップターゲットの設定
|
2301 |
+
[startTimeInput, endTimeInput].forEach(input => {
|
2302 |
+
// ドラッグオーバー
|
2303 |
+
input.addEventListener('dragover', function(e) {
|
2304 |
+
e.preventDefault();
|
2305 |
+
this.style.backgroundColor = 'rgba(100, 255, 218, 0.2)';
|
2306 |
+
});
|
2307 |
+
|
2308 |
+
// ドラッグリーブ
|
2309 |
+
input.addEventListener('dragleave', function() {
|
2310 |
+
this.style.backgroundColor = '';
|
2311 |
+
});
|
2312 |
+
|
2313 |
+
// ドロップ
|
2314 |
+
input.addEventListener('drop', function(e) {
|
2315 |
+
e.preventDefault();
|
2316 |
+
this.style.backgroundColor = '';
|
2317 |
+
|
2318 |
+
const time = parseFloat(e.dataTransfer.getData('text/plain'));
|
2319 |
+
if (!isNaN(time)) {
|
2320 |
+
this.value = time;
|
2321 |
+
updateProgressMarkers();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2322 |
}
|
2323 |
});
|
2324 |
+
});
|
2325 |
+
|
2326 |
+
// 入力ボックスの変更時にマーカーを更新
|
2327 |
+
startTimeInput.addEventListener('input', updateProgressMarkers);
|
2328 |
+
endTimeInput.addEventListener('input', updateProgressMarkers);
|
2329 |
+
|
2330 |
+
// updateProgressMarkers関数
|
2331 |
+
function updateProgressMarkers() {
|
2332 |
+
const duration = video.duration || 0;
|
2333 |
+
const startTime = parseFloat(startTimeInput.value) || 0;
|
2334 |
+
const endTime = parseFloat(endTimeInput.value) || duration;
|
2335 |
+
|
2336 |
+
if (duration > 0) {
|
2337 |
+
if(startMarker) startMarker.style.left = `${(startTime / duration) * 100}%`;
|
2338 |
+
if(endMarker) endMarker.style.left = `${(endTime / duration) * 100}%`;
|
2339 |
+
|
2340 |
+
if(startMarker) startMarker.style.display = 'block';
|
2341 |
+
if(endMarker) endMarker.style.display = 'block';
|
2342 |
+
}
|
2343 |
+
}
|
2344 |
+
});
|
2345 |
|
2346 |
</script>
|
2347 |
</body>
|