Elias207 commited on
Commit
910ef80
·
verified ·
1 Parent(s): f2a6c42

Update static/js/editor.js

Browse files
Files changed (1) hide show
  1. static/js/editor.js +18 -23
static/js/editor.js CHANGED
@@ -511,35 +511,30 @@ function updateOverlayContent(currentTime) {
511
  let textColor = '#ffffff';
512
  if (w.color) textColor = w.color;
513
 
514
- // استایل پایه برای همه کلمات جهت جلوگیری از پرش
515
- let baseStyle = `display: inline-block;
516
- font-family: inherit;
517
- padding: 2px 4px; /* پدینگ فیزیکی حداقلی برای جلوگیری از ناپدید شدن */
518
- margin: 2px;
519
- position: relative;`;
520
 
521
  if(isActive) {
522
- // در اینجا از box-shadow برای ایجاد کادر بزرگ استفاده می‌کنیم
523
- // paddingX و paddingY سایه را کنترل می‌کنند نه فاصله فیزیکی را
524
- html += `<span style="${baseStyle}
525
- background-color: ${boxColor};
526
- border-radius: ${state.st.radius}px;
527
- color: ${textColor} !important;
528
- box-shadow: 0 0 0 ${state.st.paddingY}px ${boxColor},
529
- ${state.st.paddingX}px 0 0 ${boxColor},
530
- -${state.st.paddingX}px 0 0 ${boxColor};
531
- transform: scale(1.05);
532
- z-index: 100;">${w.word}</span>`;
533
  } else {
534
- // کلمات غیرفعال هیچ پس‌زمینه و سایه‌ای ندارند
535
- html += `<span style="${baseStyle}
536
- background-color: transparent;
537
- color: ${textColor} !important;
538
- z-index: 1;">${w.word}</span>`;
 
 
539
  }
540
 
541
  if ((i + 1) % 5 === 0 && i !== seg.words.length - 1) {
542
- html += "<br>";
543
  }
544
  });
545
  tEl.innerHTML = html;
 
511
  let textColor = '#ffffff';
512
  if (w.color) textColor = w.color;
513
 
514
+ let baseStyle = `display: inline-block; line-height: 1.4; border-radius: ${state.st.radius}px; font-family: inherit;`;
 
 
 
 
 
515
 
516
  if(isActive) {
517
+ html += `<span style="${baseStyle}
518
+ background-color: ${boxColor};
519
+ color: ${textColor} !important;
520
+ box-shadow: 0 0 0 ${state.st.paddingY}px ${boxColor};
521
+ margin: 0 ${state.st.paddingX}px;
522
+ padding: 2px 0;
523
+ position: relative;
524
+ z-index: 100;
525
+ transform: scale(1.1);">${w.word}</span> `;
 
 
526
  } else {
527
+ html += `<span style="${baseStyle}
528
+ color: ${textColor} !important;
529
+ text-shadow: none;
530
+ margin: 0 ${state.st.paddingX}px;
531
+ padding: 2px 0;
532
+ position: relative;
533
+ z-index: 1;">${w.word}</span> `;
534
  }
535
 
536
  if ((i + 1) % 5 === 0 && i !== seg.words.length - 1) {
537
+ html += "<br><br>";
538
  }
539
  });
540
  tEl.innerHTML = html;