soiz1 commited on
Commit
7eb220d
·
1 Parent(s): f4c4beb

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +160 -0
index.html CHANGED
@@ -718,6 +718,44 @@
718
 
719
  .lock-controls-btn.locked {
720
  color: #64ffda;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
721
  }
722
  </style>
723
  </head>
@@ -940,6 +978,26 @@ document.getElementById('sw-register-btn').addEventListener('click', async () =>
940
  <div class="tech-decoration"></div>
941
 
942
  <div class="settings">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
943
  <h2>設定</h2>
944
  <div class="setting-item">
945
  <label for="start-time">再生開始秒数:</label>
@@ -2135,6 +2193,108 @@ function pauseMedia() {
2135
  tempoInput.value = isTMode ? 66 : 92;
2136
  tempoInput.dispatchEvent(new Event('input'));
2137
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2138
  </script>
2139
  </body>
2140
  </html>
 
718
 
719
  .lock-controls-btn.locked {
720
  color: #64ffda;
721
+ }
722
+ .time-markers-container {
723
+ display: flex;
724
+ flex-wrap: wrap;
725
+ gap: 10px;
726
+ margin: 15px 0;
727
+ padding: 15px;
728
+ background-color: rgba(17, 34, 64, 0.5);
729
+ border-radius: 5px;
730
+ }
731
+
732
+ .time-marker {
733
+ padding: 8px 12px;
734
+ background-color: rgba(100, 255, 218, 0.2);
735
+ border: 1px solid #64ffda;
736
+ border-radius: 4px;
737
+ cursor: grab;
738
+ user-select: none;
739
+ transition: background-color 0.3s;
740
+ }
741
+
742
+ .time-marker:hover {
743
+ background-color: rgba(100, 255, 218, 0.3);
744
+ }
745
+
746
+ .time-marker.dragging {
747
+ opacity: 0.7;
748
+ cursor: grabbing;
749
+ }
750
+
751
+ .time-input-container {
752
+ display: flex;
753
+ align-items: center;
754
+ gap: 5px;
755
+ }
756
+
757
+ .time-input-container input {
758
+ width: 80px;
759
  }
760
  </style>
761
  </head>
 
978
  <div class="tech-decoration"></div>
979
 
980
  <div class="settings">
981
+ <div class="time-markers-container" id="time-markers-container">
982
+ <!-- ここにタイムマーカーが動的に追加されます -->
983
+ </div>
984
+
985
+ <div class="setting-item">
986
+ <label for="start-time">再生開始秒数:</label>
987
+ <div class="time-input-container">
988
+ <input type="number" id="start-time" min="0" value="0" step="0.01" disabled>
989
+ <button class="time-set-button" id="set-start-time" disabled>現在の秒数に設定</button>
990
+ </div>
991
+ </div>
992
+
993
+ <div class="setting-item">
994
+ <label for="end-time">再生終了秒数:</label>
995
+ <div class="time-input-container">
996
+ <input type="number" id="end-time" min="0" value="0" step="0.01" disabled>
997
+ <button class="time-set-button" id="set-end-time" disabled>現在の秒数に設定</button>
998
+ <button class="time-set-button" id="reset-end-time" disabled>動画の長さに戻す</button>
999
+ </div>
1000
+ </div>
1001
  <h2>設定</h2>
1002
  <div class="setting-item">
1003
  <label for="start-time">再生開始秒数:</label>
 
2193
  tempoInput.value = isTMode ? 66 : 92;
2194
  tempoInput.dispatchEvent(new Event('input'));
2195
  });
2196
+ document.addEventListener('DOMContentLoaded', function() {
2197
+ // URLパラメータをチェック
2198
+ const urlParams = new URLSearchParams(window.location.search);
2199
+ const isTMode = urlParams.has('mode') && urlParams.get('mode') === 't';
2200
+
2201
+ // タイムマーカーデータ
2202
+ const timeMarkers = isTMode ? [
2203
+ { label: '①', time: 15.2 },
2204
+ { label: '②', time: 43.8 },
2205
+ { label: '①[2番]', time: 79.0 },
2206
+ { label: '②[2番]', time: 108.0 },
2207
+ { label: '③', time: 137.25 },
2208
+ { label: '④', time: 162.55 },
2209
+ { label: '⑤', time: 191.65 }
2210
+ ] : [
2211
+ { label: 'A', time: 8.35 },
2212
+ { label: 'B', time: 72.1 },
2213
+ { label: 'C', time: 98.67 },
2214
+ { label: 'D', time: 155.83 },
2215
+ { label: 'E', time: 192.55 }
2216
+ ];
2217
+
2218
+ // タイムマーカーを表示
2219
+ const timeMarkersContainer = document.getElementById('time-markers-container');
2220
+
2221
+ timeMarkers.forEach(marker => {
2222
+ const markerElement = document.createElement('div');
2223
+ markerElement.className = 'time-marker';
2224
+ markerElement.textContent = `・${marker.label}(${marker.time}秒)`;
2225
+ markerElement.dataset.time = marker.time;
2226
+
2227
+ // ドラッグ開始
2228
+ markerElement.addEventListener('dragstart', function(e) {
2229
+ e.dataTransfer.setData('text/plain', marker.time);
2230
+ this.classList.add('dragging');
2231
+ });
2232
+
2233
+ // ドラッグ終了
2234
+ markerElement.addEventListener('dragend', function() {
2235
+ this.classList.remove('dragging');
2236
+ });
2237
+
2238
+ // ドラッグ可能に設定
2239
+ markerElement.draggable = true;
2240
+
2241
+ // クリックで開始時間に設定
2242
+ markerElement.addEventListener('click', function() {
2243
+ document.getElementById('start-time').value = marker.time;
2244
+ updateProgressMarkers();
2245
+ });
2246
+
2247
+ timeMarkersContainer.appendChild(markerElement);
2248
+ });
2249
+
2250
+ // ドロップターゲットの設定
2251
+ const startTimeInput = document.getElementById('start-time');
2252
+ const endTimeInput = document.getElementById('end-time');
2253
+
2254
+ [startTimeInput, endTimeInput].forEach(input => {
2255
+ // ドラッグオーバー
2256
+ input.addEventListener('dragover', function(e) {
2257
+ e.preventDefault();
2258
+ this.style.backgroundColor = 'rgba(100, 255, 218, 0.2)';
2259
+ });
2260
+
2261
+ // ドラッグリーブ
2262
+ input.addEventListener('dragleave', function() {
2263
+ this.style.backgroundColor = '';
2264
+ });
2265
+
2266
+ // ドロップ
2267
+ input.addEventListener('drop', function(e) {
2268
+ e.preventDefault();
2269
+ this.style.backgroundColor = '';
2270
+
2271
+ const time = parseFloat(e.dataTransfer.getData('text/plain'));
2272
+ if (!isNaN(time)) {
2273
+ this.value = time;
2274
+ updateProgressMarkers();
2275
+ }
2276
+ });
2277
+ });
2278
+
2279
+ // 入力ボックスの変更時にマーカーを更新
2280
+ startTimeInput.addEventListener('input', updateProgressMarkers);
2281
+ endTimeInput.addEventListener('input', updateProgressMarkers);
2282
+
2283
+ // 既存のupdateProgressMarkers関数を再利用
2284
+ function updateProgressMarkers() {
2285
+ const duration = video.duration || videoDuration;
2286
+ const startTime = parseFloat(startTimeInput.value) || 0;
2287
+ const endTime = parseFloat(endTimeInput.value) || duration;
2288
+
2289
+ if (duration > 0) {
2290
+ startMarker.style.left = `${(startTime / duration) * 100}%`;
2291
+ endMarker.style.left = `${(endTime / duration) * 100}%`;
2292
+
2293
+ startMarker.style.display = 'block';
2294
+ endMarker.style.display = 'block';
2295
+ }
2296
+ }
2297
+ });
2298
  </script>
2299
  </body>
2300
  </html>