mirror of
https://github.com/meowarex/TidaLuna-Plugins.git
synced 2026-06-18 03:43:10 +10:00
Hotfix #7000...
This commit is contained in:
@@ -1273,6 +1273,9 @@ const tryActivateStickyLyricsTab = (): boolean => {
|
||||
|
||||
if (!lyricsTab) return false;
|
||||
|
||||
// Already active — nothing to do
|
||||
if (lyricsTab.getAttribute("aria-selected") === "true") return true;
|
||||
|
||||
if (lyricsTab.getAttribute("data-rl-injected") === "true") {
|
||||
showInjectedLyricsTab();
|
||||
} else {
|
||||
@@ -1801,6 +1804,9 @@ const clearLineSlideTimers = (): void => {
|
||||
lineSlideTimers.clear();
|
||||
};
|
||||
|
||||
// Defer blur until the first lyric activates each track
|
||||
let blurActivated = false;
|
||||
|
||||
// Scroll sync (unhook on user scroll)
|
||||
let scrollSynced = true;
|
||||
let userScrollListener: (() => void) | null = null;
|
||||
@@ -2395,7 +2401,8 @@ const buildWordSpans = (): {
|
||||
// create lyrics container for word/syllable lines
|
||||
const wbwContainer = document.createElement("div");
|
||||
wbwContainer.className = "rl-wbw-container";
|
||||
if (settings.blurInactive) wbwContainer.classList.add("rl-blur-active");
|
||||
if (settings.blurInactive && blurActivated)
|
||||
wbwContainer.classList.add("rl-blur-active");
|
||||
if (settings.bubbledLyrics) wbwContainer.classList.add("rl-bubbled");
|
||||
const effectiveStyle = getLyricsStyle();
|
||||
const allowWordSylStyles = isWordMode();
|
||||
@@ -2727,7 +2734,8 @@ const buildTidalLines = (
|
||||
|
||||
const wbwContainer = document.createElement("div");
|
||||
wbwContainer.className = "rl-wbw-container";
|
||||
if (settings.blurInactive) wbwContainer.classList.add("rl-blur-active");
|
||||
if (settings.blurInactive && blurActivated)
|
||||
wbwContainer.classList.add("rl-blur-active");
|
||||
if (settings.bubbledLyrics) wbwContainer.classList.add("rl-bubbled");
|
||||
forceStyle(wbwContainer, {
|
||||
display: "block",
|
||||
@@ -2875,6 +2883,13 @@ const updateTidalFollowActiveLine = (): void => {
|
||||
primaryLineIdx = activeIndex;
|
||||
activeLineIdxs = newActiveSet;
|
||||
|
||||
if (settings.blurInactive && !blurActivated) {
|
||||
blurActivated = true;
|
||||
document
|
||||
.querySelector(".rl-wbw-container")
|
||||
?.classList.add("rl-blur-active");
|
||||
}
|
||||
|
||||
if (settings.blurInactive) {
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
lines[i].el.classList.remove(
|
||||
@@ -3015,6 +3030,7 @@ const teardown = (): void => {
|
||||
unhookSyncButton();
|
||||
unlockScroll();
|
||||
scrollSynced = true;
|
||||
blurActivated = false;
|
||||
isActive = false;
|
||||
lyricsMode = "none";
|
||||
lyricsData = null;
|
||||
@@ -3132,7 +3148,7 @@ const scrollToActiveLine = (): void => {
|
||||
// Resync lyric scroll (scrubbing and lyric jumps)
|
||||
const resync = (): void => {
|
||||
scrollSynced = true;
|
||||
if (settings.blurInactive) {
|
||||
if (settings.blurInactive && blurActivated) {
|
||||
document
|
||||
.querySelector(".rl-wbw-container")
|
||||
?.classList.add("rl-blur-active");
|
||||
@@ -3340,6 +3356,14 @@ const startTickLoop = (): void => {
|
||||
}
|
||||
}
|
||||
|
||||
// activate blur on first lyric of the track
|
||||
if (settings.blurInactive && !blurActivated && newActiveSet.size > 0) {
|
||||
blurActivated = true;
|
||||
document
|
||||
.querySelector(".rl-wbw-container")
|
||||
?.classList.add("rl-blur-active");
|
||||
}
|
||||
|
||||
// instrumental gaps, keep the last-active line unblurred
|
||||
if (settings.blurInactive) {
|
||||
if (
|
||||
@@ -3612,14 +3636,6 @@ const onTrackChange = async (): Promise<void> => {
|
||||
}
|
||||
if (injectedTabEl && settings.stickyLyrics) {
|
||||
showInjectedLyricsTab();
|
||||
safeTimeout(
|
||||
unloads,
|
||||
() => {
|
||||
if (!settings.stickyLyrics || token !== trackChangeToken) return;
|
||||
showInjectedLyricsTab();
|
||||
},
|
||||
180,
|
||||
);
|
||||
}
|
||||
lyricsData =
|
||||
response.type === "Word"
|
||||
|
||||
Reference in New Issue
Block a user