@uimaxbai/am-lyrics 1.2.4 → 1.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/src/react.js CHANGED
@@ -322,7 +322,7 @@ class GoogleService {
322
322
  }
323
323
  }
324
324
 
325
- const VERSION = '1.2.4';
325
+ const VERSION = '1.2.5';
326
326
  const INSTRUMENTAL_THRESHOLD_MS = 7000; // Show dots for gaps >= 7s
327
327
  const FETCH_TIMEOUT_MS = 8000; // Timeout for all lyrics fetch requests
328
328
  const SEEK_THRESHOLD_MS = 500;
@@ -1897,29 +1897,25 @@ let AmLyrics$1 = class AmLyrics extends i {
1897
1897
  !this.isUserScrolling &&
1898
1898
  !this.isClickSeeking &&
1899
1899
  this.lyrics) {
1900
- // Condition: ONLY pre-scroll if no other lyric is currently playing.
1901
- // If a lyric is playing, we must wait for it to finish (handled by updated()).
1902
- if (this.activeLineIndices.length === 0) {
1903
- let preActiveLineIndex = null;
1904
- for (let i = 0; i < this.lyrics.length; i += 1) {
1905
- const line = this.lyrics[i];
1906
- const timeUntilStart = line.timestamp - newTime;
1907
- const nextLineEl = this.lyricsContainer.querySelector(`#lyrics-line-${i}`);
1908
- if (timeUntilStart > 0 && timeUntilStart <= PRE_SCROLL_LEAD_MS) {
1909
- // Time to pre-scroll and pre-activate!
1910
- if (nextLineEl) {
1911
- // Apply unblur & zoom effect ahead of lyric start
1912
- preActiveLineIndex = i;
1913
- nextLineEl.classList.add('pre-active');
1914
- this.clearPreActiveClasses(i);
1915
- const slowScrollDuration = Math.max(SCROLL_ANIMATION_DURATION_MS, timeUntilStart);
1916
- this.focusLine(nextLineEl, false, slowScrollDuration, !!currentGap);
1917
- }
1918
- break;
1900
+ let preActiveLineIndex = null;
1901
+ for (let i = 0; i < this.lyrics.length; i += 1) {
1902
+ const line = this.lyrics[i];
1903
+ const timeUntilStart = line.timestamp - newTime;
1904
+ const nextLineEl = this.lyricsContainer.querySelector(`#lyrics-line-${i}`);
1905
+ if (timeUntilStart > 0 && timeUntilStart <= PRE_SCROLL_LEAD_MS) {
1906
+ // Time to pre-scroll and pre-activate!
1907
+ if (nextLineEl) {
1908
+ // Apply unblur & zoom effect ahead of lyric start
1909
+ preActiveLineIndex = i;
1910
+ nextLineEl.classList.add('pre-active');
1911
+ this.clearPreActiveClasses(i);
1912
+ const slowScrollDuration = Math.max(SCROLL_ANIMATION_DURATION_MS, timeUntilStart);
1913
+ this.focusLine(nextLineEl, false, slowScrollDuration, !!currentGap);
1919
1914
  }
1915
+ break;
1920
1916
  }
1921
- this.clearPreActiveClasses(preActiveLineIndex);
1922
1917
  }
1918
+ this.clearPreActiveClasses(preActiveLineIndex);
1923
1919
  }
1924
1920
  }
1925
1921
  }