Hamed744 commited on
Commit
931fd4e
·
verified ·
1 Parent(s): 222e784

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +17 -28
index.html CHANGED
@@ -19,7 +19,7 @@
19
  .new-proj-btn { background: #333; color: #ccc; border: 1px solid #444; padding: 8px 15px; border-radius: 12px; font-size: 0.9rem; cursor: pointer; transition: 0.2s; display: flex; align-items: center; gap: 8px; font-family: inherit; }
20
  .new-proj-btn:hover { background: #444; color: #fff; border-color: #666; }
21
 
22
- /* --- مدال تایید خروج (انیمیشن دار) --- */
23
  .modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); backdrop-filter: blur(5px); z-index: 3000; display: none; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s; }
24
  .modal-overlay.show { opacity: 1; }
25
 
@@ -64,13 +64,12 @@
64
  .tool-section.active-section { display: block; }
65
  @keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
66
 
67
- /* --- لیست زیرنویس (بخش متن) --- */
68
  #subtitleListArea { width: 100%; }
69
  .sub-card { background: #222; border-right: 4px solid #444; border-radius: 8px; margin-bottom: 10px; padding: 15px; display: flex; flex-direction: column; gap: 10px; transition: 0.2s; cursor: pointer; position: relative; overflow: hidden; }
70
  .sub-card-header { display: flex; align-items: center; justify-content: space-between; width: 100%; }
71
  .sub-card:hover { background: #2a2a2a; }
72
  .sub-card.active { background: #2b2535; border-right-color: var(--primary); box-shadow: 0 4px 15px rgba(0,0,0,0.3); transform: scale(1.01); }
73
- .sub-card.is-hidden-seg { opacity: 0.5; background: #2a1a1a; border-right-color: #d32f2f; }
74
 
75
  .sub-time { font-size: 0.75rem; color: #666; margin-left: 10px; min-width: 50px; text-align: left; font-family: monospace; }
76
  .sub-text-content { flex: 1; font-size: 1rem; color: #ddd; line-height: 1.6; }
@@ -80,7 +79,7 @@
80
  .sub-card:hover .card-actions, .sub-card.active .card-actions { opacity: 1; }
81
  .mini-btn { width: 32px; height: 32px; border-radius: 50%; border: none; background: rgba(255,255,255,0.1); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.2s; }
82
  .mini-btn:hover { background: var(--primary); }
83
- .mini-btn.eye-btn.off { background: #522; color: #f88; }
84
 
85
  /* استایل ویرایشگر درجا */
86
  .inline-editor-container { width: 100%; display: flex; flex-direction: column; gap: 8px; animation: fadeIn 0.2s; margin-top: 5px; cursor: default; }
@@ -93,7 +92,6 @@
93
  .btn-exp { background: var(--primary); color: #fff; border: none; padding: 10px 25px; border-radius: 12px; font-weight: bold; cursor: pointer; transition: 0.2s; font-family: inherit; }
94
  .btn-exp:active { transform: scale(0.95); }
95
 
96
- /* استایل‌های پنل‌ها */
97
  .row { margin-bottom: 20px; }
98
  label { display: block; margin-bottom: 8px; color: #ccc; font-size: 0.9rem; }
99
  input[type=range] { width: 100%; accent-color: var(--primary); height: 6px; cursor: pointer; border-radius:3px; }
@@ -292,31 +290,23 @@
292
  const btnId = 'btn-' + toolName;
293
  const section = document.getElementById(sectionId);
294
 
295
- // منطق باز و بسته شدن
296
- // اگر پنل باز است و کاربر دوباره روی همان دکمه کلیک کرد -> بستن
297
- // اگر پنل بسته است -> باز کردن
298
- // اگر پنل باز است و کاربر روی دکمه دیگری کلیک کرد -> سوییچ کردن
299
-
300
  const isAlreadyOpen = toolsContainer.classList.contains('open') && section.style.display === 'block';
301
 
302
  if (isAlreadyOpen) {
303
  toolsContainer.classList.remove('open');
304
  setTimeout(() => { section.style.display = 'none'; }, 200);
305
  } else {
306
- // مخفی کردن قبلی‌ها
307
  document.querySelectorAll('.tool-section').forEach(s => s.style.display = 'none');
308
 
309
- // فعال کردن جدید
310
  document.getElementById(btnId).classList.add('active-tool');
311
  section.style.display = 'block';
312
  section.classList.add('active-section');
313
 
314
- // اگر لیست متن است، کانتینر باید کامل باز شود (بدون محدودیت ارتفاع)
315
  if(toolName === 'text') {
316
  toolsContainer.style.maxHeight = 'none';
317
  toolsContainer.classList.add('open');
318
  } else {
319
- toolsContainer.style.maxHeight = ''; // ریست به CSS
320
  toolsContainer.classList.add('open');
321
  }
322
  }
@@ -392,10 +382,18 @@
392
  const actionsDiv = document.createElement('div');
393
  actionsDiv.className = 'card-actions';
394
 
395
- const eyeBtn = document.createElement('button');
396
- eyeBtn.className = 'mini-btn eye-btn' + (s.isHidden ? ' off' : '');
397
- eyeBtn.innerHTML = s.isHidden ? '<i class="fa-solid fa-eye-slash"></i>' : '<i class="fa-solid fa-eye"></i>';
398
- eyeBtn.onclick = (e) => { e.stopPropagation(); toggleVisibility(i, eyeBtn, card); };
 
 
 
 
 
 
 
 
399
 
400
  const editBtn = document.createElement('button');
401
  editBtn.className = 'mini-btn';
@@ -405,7 +403,7 @@
405
  startInlineEdit(i);
406
  };
407
 
408
- actionsDiv.appendChild(eyeBtn);
409
  actionsDiv.appendChild(editBtn);
410
 
411
  header.appendChild(timeDiv);
@@ -475,15 +473,6 @@
475
  curSeg = i;
476
  }
477
 
478
- function toggleVisibility(index, btn, card) {
479
- state.segs[index].isHidden = !state.segs[index].isHidden;
480
- const isH = state.segs[index].isHidden;
481
- btn.innerHTML = isH ? '<i class="fa-solid fa-eye-slash"></i>' : '<i class="fa-solid fa-eye"></i>';
482
- btn.className = 'mini-btn eye-btn' + (isH ? ' off' : '');
483
- if(isH) card.classList.add('is-hidden-seg'); else card.classList.remove('is-hidden-seg');
484
- if(curSeg === index) showTextOverlay(curSeg);
485
- }
486
-
487
  function showTextOverlay(index) {
488
  if(index === -1) { tEl.style.opacity = 0; return; }
489
  const seg = state.segs[index];
 
19
  .new-proj-btn { background: #333; color: #ccc; border: 1px solid #444; padding: 8px 15px; border-radius: 12px; font-size: 0.9rem; cursor: pointer; transition: 0.2s; display: flex; align-items: center; gap: 8px; font-family: inherit; }
20
  .new-proj-btn:hover { background: #444; color: #fff; border-color: #666; }
21
 
22
+ /* --- مدال تایید خروج --- */
23
  .modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); backdrop-filter: blur(5px); z-index: 3000; display: none; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s; }
24
  .modal-overlay.show { opacity: 1; }
25
 
 
64
  .tool-section.active-section { display: block; }
65
  @keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
66
 
67
+ /* --- لیست زیرنویس --- */
68
  #subtitleListArea { width: 100%; }
69
  .sub-card { background: #222; border-right: 4px solid #444; border-radius: 8px; margin-bottom: 10px; padding: 15px; display: flex; flex-direction: column; gap: 10px; transition: 0.2s; cursor: pointer; position: relative; overflow: hidden; }
70
  .sub-card-header { display: flex; align-items: center; justify-content: space-between; width: 100%; }
71
  .sub-card:hover { background: #2a2a2a; }
72
  .sub-card.active { background: #2b2535; border-right-color: var(--primary); box-shadow: 0 4px 15px rgba(0,0,0,0.3); transform: scale(1.01); }
 
73
 
74
  .sub-time { font-size: 0.75rem; color: #666; margin-left: 10px; min-width: 50px; text-align: left; font-family: monospace; }
75
  .sub-text-content { flex: 1; font-size: 1rem; color: #ddd; line-height: 1.6; }
 
79
  .sub-card:hover .card-actions, .sub-card.active .card-actions { opacity: 1; }
80
  .mini-btn { width: 32px; height: 32px; border-radius: 50%; border: none; background: rgba(255,255,255,0.1); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.2s; }
81
  .mini-btn:hover { background: var(--primary); }
82
+ .mini-btn.play-btn:hover { background: #00C853; }
83
 
84
  /* استایل ویرایشگر درجا */
85
  .inline-editor-container { width: 100%; display: flex; flex-direction: column; gap: 8px; animation: fadeIn 0.2s; margin-top: 5px; cursor: default; }
 
92
  .btn-exp { background: var(--primary); color: #fff; border: none; padding: 10px 25px; border-radius: 12px; font-weight: bold; cursor: pointer; transition: 0.2s; font-family: inherit; }
93
  .btn-exp:active { transform: scale(0.95); }
94
 
 
95
  .row { margin-bottom: 20px; }
96
  label { display: block; margin-bottom: 8px; color: #ccc; font-size: 0.9rem; }
97
  input[type=range] { width: 100%; accent-color: var(--primary); height: 6px; cursor: pointer; border-radius:3px; }
 
290
  const btnId = 'btn-' + toolName;
291
  const section = document.getElementById(sectionId);
292
 
 
 
 
 
 
293
  const isAlreadyOpen = toolsContainer.classList.contains('open') && section.style.display === 'block';
294
 
295
  if (isAlreadyOpen) {
296
  toolsContainer.classList.remove('open');
297
  setTimeout(() => { section.style.display = 'none'; }, 200);
298
  } else {
 
299
  document.querySelectorAll('.tool-section').forEach(s => s.style.display = 'none');
300
 
 
301
  document.getElementById(btnId).classList.add('active-tool');
302
  section.style.display = 'block';
303
  section.classList.add('active-section');
304
 
 
305
  if(toolName === 'text') {
306
  toolsContainer.style.maxHeight = 'none';
307
  toolsContainer.classList.add('open');
308
  } else {
309
+ toolsContainer.style.maxHeight = '';
310
  toolsContainer.classList.add('open');
311
  }
312
  }
 
382
  const actionsDiv = document.createElement('div');
383
  actionsDiv.className = 'card-actions';
384
 
385
+ // دکمه Play به جای Eye
386
+ const playBtn = document.createElement('button');
387
+ playBtn.className = 'mini-btn play-btn';
388
+ playBtn.innerHTML = '<i class="fa-solid fa-play"></i>';
389
+ playBtn.onclick = (e) => {
390
+ e.stopPropagation();
391
+ manualOverride = true;
392
+ selectSegment(i);
393
+ v.currentTime = s.start + 0.01;
394
+ v.play();
395
+ togglePlayIcon(true);
396
+ };
397
 
398
  const editBtn = document.createElement('button');
399
  editBtn.className = 'mini-btn';
 
403
  startInlineEdit(i);
404
  };
405
 
406
+ actionsDiv.appendChild(playBtn);
407
  actionsDiv.appendChild(editBtn);
408
 
409
  header.appendChild(timeDiv);
 
473
  curSeg = i;
474
  }
475
 
 
 
 
 
 
 
 
 
 
476
  function showTextOverlay(index) {
477
  if(index === -1) { tEl.style.opacity = 0; return; }
478
  const seg = state.segs[index];