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