mirror of
https://github.com/meowarex/TidaLuna-Plugins.git
synced 2026-06-18 03:43:10 +10:00
@@ -201,7 +201,7 @@ export const Settings = () => {
|
|||||||
title="Lyrics Style"
|
title="Lyrics Style"
|
||||||
desc="0 = Line (default), 1 = Word, 2 = Syllable (mirrored in lyrics dropdown)"
|
desc="0 = Line (default), 1 = Word, 2 = Syllable (mirrored in lyrics dropdown)"
|
||||||
min={0}
|
min={0}
|
||||||
max={1}
|
max={2}
|
||||||
step={1}
|
step={1}
|
||||||
value={lyricsStyle}
|
value={lyricsStyle}
|
||||||
onNumber={(value: number) => {
|
onNumber={(value: number) => {
|
||||||
|
|||||||
@@ -1298,13 +1298,13 @@ let syncButtonEl: HTMLElement | null = null;
|
|||||||
// scroll bounce animation state
|
// scroll bounce animation state
|
||||||
let scrollAnimIsAnimating = false;
|
let scrollAnimIsAnimating = false;
|
||||||
let scrollAnimPending: { parent: HTMLElement; refIdx: number; target: number } | null = null;
|
let scrollAnimPending: { parent: HTMLElement; refIdx: number; target: number } | null = null;
|
||||||
let scrollUnlockTimeout: ReturnType<typeof setTimeout> | null = null;
|
let scrollUnlockTimeout: LunaUnload | null = null;
|
||||||
let scrollCleanupTimeout: ReturnType<typeof setTimeout> | null = null;
|
let scrollCleanupTimeout: LunaUnload | null = null;
|
||||||
let animatingEls: HTMLElement[] = [];
|
let animatingEls: HTMLElement[] = [];
|
||||||
|
|
||||||
const clearScrollAnim = (): void => {
|
const clearScrollAnim = (): void => {
|
||||||
if (scrollUnlockTimeout) { clearTimeout(scrollUnlockTimeout); scrollUnlockTimeout = null; }
|
if (scrollUnlockTimeout) { scrollUnlockTimeout(); scrollUnlockTimeout = null; }
|
||||||
if (scrollCleanupTimeout) { clearTimeout(scrollCleanupTimeout); scrollCleanupTimeout = null; }
|
if (scrollCleanupTimeout) { scrollCleanupTimeout(); scrollCleanupTimeout = null; }
|
||||||
for (const el of animatingEls) {
|
for (const el of animatingEls) {
|
||||||
el.classList.remove("rl-scroll-animate");
|
el.classList.remove("rl-scroll-animate");
|
||||||
el.style.removeProperty("--rl-scroll-delta");
|
el.style.removeProperty("--rl-scroll-delta");
|
||||||
@@ -1323,8 +1323,8 @@ const applyScrollBounce = (scrollParent: HTMLElement, referenceIdx: number, scro
|
|||||||
}
|
}
|
||||||
|
|
||||||
// clear previous animation timeouts
|
// clear previous animation timeouts
|
||||||
if (scrollUnlockTimeout) { clearTimeout(scrollUnlockTimeout); scrollUnlockTimeout = null; }
|
if (scrollUnlockTimeout) { scrollUnlockTimeout(); scrollUnlockTimeout = null; }
|
||||||
if (scrollCleanupTimeout) { clearTimeout(scrollCleanupTimeout); scrollCleanupTimeout = null; }
|
if (scrollCleanupTimeout) { scrollCleanupTimeout(); scrollCleanupTimeout = null; }
|
||||||
|
|
||||||
// clean up previous animation classes
|
// clean up previous animation classes
|
||||||
for (const el of animatingEls) {
|
for (const el of animatingEls) {
|
||||||
@@ -1386,7 +1386,7 @@ const applyScrollBounce = (scrollParent: HTMLElement, referenceIdx: number, scro
|
|||||||
|
|
||||||
// unlock animation state after base duration, process pending if queued
|
// unlock animation state after base duration, process pending if queued
|
||||||
const BASE_DURATION = 400;
|
const BASE_DURATION = 400;
|
||||||
scrollUnlockTimeout = setTimeout(() => {
|
scrollUnlockTimeout = safeTimeout(unloads, () => {
|
||||||
scrollAnimIsAnimating = false;
|
scrollAnimIsAnimating = false;
|
||||||
if (scrollAnimPending) {
|
if (scrollAnimPending) {
|
||||||
const pending = scrollAnimPending;
|
const pending = scrollAnimPending;
|
||||||
@@ -1396,7 +1396,7 @@ const applyScrollBounce = (scrollParent: HTMLElement, referenceIdx: number, scro
|
|||||||
}, BASE_DURATION);
|
}, BASE_DURATION);
|
||||||
|
|
||||||
// clean up animation classes after all staggered animations complete
|
// clean up animation classes after all staggered animations complete
|
||||||
scrollCleanupTimeout = setTimeout(() => {
|
scrollCleanupTimeout = safeTimeout(unloads, () => {
|
||||||
for (const el of animatingEls) {
|
for (const el of animatingEls) {
|
||||||
el.classList.remove("rl-scroll-animate");
|
el.classList.remove("rl-scroll-animate");
|
||||||
el.style.removeProperty("--rl-scroll-delta");
|
el.style.removeProperty("--rl-scroll-delta");
|
||||||
|
|||||||
Reference in New Issue
Block a user