mirror of
https://github.com/meowarex/TidaLuna-Plugins.git
synced 2026-06-18 03:43:10 +10:00
Adjust UI thingos
This commit is contained in:
@@ -21,7 +21,6 @@ declare global {
|
|||||||
|
|
||||||
export const settings = await ReactiveStore.getPluginStorage("RadiantLyrics", {
|
export const settings = await ReactiveStore.getPluginStorage("RadiantLyrics", {
|
||||||
lyricsGlowEnabled: true,
|
lyricsGlowEnabled: true,
|
||||||
trackTitleGlow: false,
|
|
||||||
hideUIEnabled: true,
|
hideUIEnabled: true,
|
||||||
playerBarVisible: false,
|
playerBarVisible: false,
|
||||||
qualityProgressColor: true,
|
qualityProgressColor: true,
|
||||||
@@ -84,9 +83,6 @@ export const Settings = () => {
|
|||||||
const [spinSpeed, setSpinSpeed] = React.useState(settings.spinSpeed);
|
const [spinSpeed, setSpinSpeed] = React.useState(settings.spinSpeed);
|
||||||
const [settingsAffectNowPlaying, setSettingsAffectNowPlaying] =
|
const [settingsAffectNowPlaying, setSettingsAffectNowPlaying] =
|
||||||
React.useState(settings.settingsAffectNowPlaying);
|
React.useState(settings.settingsAffectNowPlaying);
|
||||||
const [trackTitleGlow, setTrackTitleGlow] = React.useState(
|
|
||||||
settings.trackTitleGlow,
|
|
||||||
);
|
|
||||||
const [backgroundScale, setBackgroundScale] = React.useState(
|
const [backgroundScale, setBackgroundScale] = React.useState(
|
||||||
settings.backgroundScale,
|
settings.backgroundScale,
|
||||||
);
|
);
|
||||||
@@ -184,19 +180,7 @@ export const Settings = () => {
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<AnySwitch
|
{lyricsGlowEnabled && (
|
||||||
title="Track Title Glow"
|
|
||||||
desc="Apply glow to the track title"
|
|
||||||
checked={trackTitleGlow}
|
|
||||||
onChange={(_: unknown, checked: boolean) => {
|
|
||||||
settings.trackTitleGlow = checked;
|
|
||||||
setTrackTitleGlow(checked);
|
|
||||||
if (window.updateRadiantLyricsStyles) {
|
|
||||||
window.updateRadiantLyricsStyles();
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
{(lyricsGlowEnabled || trackTitleGlow) && (
|
|
||||||
<LunaNumberSetting
|
<LunaNumberSetting
|
||||||
title="Text Glow"
|
title="Text Glow"
|
||||||
desc="Adjust the glow size of lyrics (0-100, default: 20)"
|
desc="Adjust the glow size of lyrics (0-100, default: 20)"
|
||||||
@@ -346,7 +330,7 @@ export const Settings = () => {
|
|||||||
/>
|
/>
|
||||||
<AnySwitch
|
<AnySwitch
|
||||||
title="Floating Player Bar"
|
title="Floating Player Bar"
|
||||||
desc="Floating rounded player bar with backdrop blur"
|
desc="When disabled, the player bar becomes a square edge-to-edge bar"
|
||||||
checked={floatingPlayerBar}
|
checked={floatingPlayerBar}
|
||||||
onChange={(_: unknown, checked: boolean) => {
|
onChange={(_: unknown, checked: boolean) => {
|
||||||
settings.floatingPlayerBar = checked;
|
settings.floatingPlayerBar = checked;
|
||||||
|
|||||||
@@ -128,8 +128,7 @@ main,
|
|||||||
background: unset !important;
|
background: unset !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Make sidebar and player bar semi-transparent with optimized backdrop-filter */
|
/* Make sidebar semi-transparent with optimized backdrop-filter */
|
||||||
[data-test="footer-player"],
|
|
||||||
[data-test="main-layout-sidebar-wrapper"] {
|
[data-test="main-layout-sidebar-wrapper"] {
|
||||||
/* biome-ignore lint: Must beat app inline styles for translucency */
|
/* biome-ignore lint: Must beat app inline styles for translucency */
|
||||||
background-color: rgba(0, 0, 0, 0.3) !important;
|
background-color: rgba(0, 0, 0, 0.3) !important;
|
||||||
@@ -140,7 +139,6 @@ main,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Performance mode: reduce backdrop blur */
|
/* Performance mode: reduce backdrop blur */
|
||||||
.performance-mode [data-test="footer-player"],
|
|
||||||
.performance-mode [data-test="main-layout-sidebar-wrapper"] {
|
.performance-mode [data-test="main-layout-sidebar-wrapper"] {
|
||||||
/* biome-ignore lint: Performance mode style requires priority */
|
/* biome-ignore lint: Performance mode style requires priority */
|
||||||
backdrop-filter: blur(5px) !important;
|
backdrop-filter: blur(5px) !important;
|
||||||
|
|||||||
@@ -1,9 +1,22 @@
|
|||||||
/* Floating Rounded Player Bar from Obsidian <3 */
|
/* Square Player Bar override — injected when floating is disabled */
|
||||||
|
|
||||||
/* MARKER: Floating Player Bar CSS */
|
/* MARKER: Floating Player Bar CSS */
|
||||||
|
|
||||||
[data-test="footer-player"] {
|
[data-test="footer-player"] {
|
||||||
position: absolute !important;
|
/* biome-ignore lint: Override native floating position */
|
||||||
backdrop-filter: blur(10px);
|
bottom: 0 !important;
|
||||||
border: 1px solid var(--wave-color-opacity-contrast-fill-ultra-thin, rgba(255, 255, 255, 0.1)) !important;
|
/* biome-ignore lint: Override native floating position */
|
||||||
|
left: 0 !important;
|
||||||
|
/* biome-ignore lint: Override native floating position */
|
||||||
|
right: 0 !important;
|
||||||
|
/* biome-ignore lint: Override native floating position */
|
||||||
|
width: 100% !important;
|
||||||
|
/* biome-ignore lint: Override native floating position */
|
||||||
|
margin: 0 !important;
|
||||||
|
/* biome-ignore lint: Force square corners */
|
||||||
|
border-radius: 0 !important;
|
||||||
|
/* biome-ignore lint: Remove floating border */
|
||||||
|
border: none !important;
|
||||||
|
/* biome-ignore lint: Remove floating shadow */
|
||||||
|
box-shadow: none !important;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,13 +99,12 @@ const hexToRgb = (hex: string): { r: number; g: number; b: number } => {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
// Apply Settings to Floating Player Bar using inline styles because idk.. CSS is hard (Change my mind!)
|
// Apply inline styles to the player bar (tint + optional radius/spacing customisation)
|
||||||
const applyPlayerBarTintToElement = (): void => {
|
const applyPlayerBarTintToElement = (): void => {
|
||||||
const footerPlayer = document.querySelector(
|
const footerPlayer = document.querySelector(
|
||||||
'[data-test="footer-player"]',
|
'[data-test="footer-player"]',
|
||||||
) as HTMLElement;
|
) as HTMLElement;
|
||||||
if (!footerPlayer) return;
|
if (!footerPlayer) return;
|
||||||
// Always apply tint regardless of floating state
|
|
||||||
const alpha = settings.playerBarTint / 10;
|
const alpha = settings.playerBarTint / 10;
|
||||||
const { r, g, b } = hexToRgb(settings.playerBarTintColor);
|
const { r, g, b } = hexToRgb(settings.playerBarTintColor);
|
||||||
footerPlayer.style.setProperty(
|
footerPlayer.style.setProperty(
|
||||||
@@ -135,12 +134,12 @@ const applyPlayerBarTintToElement = (): void => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Apply/update the floating player bar stylesheet + tint
|
// When floating is disabled, inject square-bar CSS to override Tidal's native floating styles
|
||||||
const applyFloatingPlayerBar = (): void => {
|
const applyFloatingPlayerBar = (): void => {
|
||||||
if (settings.floatingPlayerBar) {
|
if (settings.floatingPlayerBar) {
|
||||||
floatingPlayerBarStyleTag.css = floatingPlayerBarCss;
|
|
||||||
} else {
|
|
||||||
floatingPlayerBarStyleTag.remove();
|
floatingPlayerBarStyleTag.remove();
|
||||||
|
} else {
|
||||||
|
floatingPlayerBarStyleTag.css = floatingPlayerBarCss;
|
||||||
}
|
}
|
||||||
applyPlayerBarTintToElement();
|
applyPlayerBarTintToElement();
|
||||||
};
|
};
|
||||||
@@ -235,18 +234,6 @@ const updateRadiantLyricsStyles = function (): void {
|
|||||||
|
|
||||||
// Toggle glow via CSS vars + class on :root (always available, no timing issues)
|
// Toggle glow via CSS vars + class on :root (always available, no timing issues)
|
||||||
updateRadiantLyricsTextGlow();
|
updateRadiantLyricsTextGlow();
|
||||||
|
|
||||||
// Track title glow toggle based on settings
|
|
||||||
const trackTitleEl = document.querySelector(
|
|
||||||
'[data-test="new-now-playing"] [class*="_titleContainer_"]',
|
|
||||||
) as HTMLElement | null;
|
|
||||||
if (trackTitleEl) {
|
|
||||||
if (settings.trackTitleGlow && settings.lyricsGlowEnabled) {
|
|
||||||
trackTitleEl.classList.remove("rl-title-glow-disabled");
|
|
||||||
} else {
|
|
||||||
trackTitleEl.classList.add("rl-title-glow-disabled");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// MARKER: UI Visibility Control
|
// MARKER: UI Visibility Control
|
||||||
@@ -4107,34 +4094,6 @@ function setupNowPlayingObserver(): void {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function setupTrackTitleObserver(): void {
|
|
||||||
const trackTitleEl = document.querySelector(
|
|
||||||
'[data-test="new-now-playing"] [class*="_titleContainer_"]',
|
|
||||||
) as HTMLElement | null;
|
|
||||||
if (trackTitleEl) {
|
|
||||||
if (settings.trackTitleGlow && settings.lyricsGlowEnabled) {
|
|
||||||
trackTitleEl.classList.remove("rl-title-glow-disabled");
|
|
||||||
} else {
|
|
||||||
trackTitleEl.classList.add("rl-title-glow-disabled");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
observe<HTMLElement>(
|
|
||||||
unloads,
|
|
||||||
'[data-test="new-now-playing"]',
|
|
||||||
() => {
|
|
||||||
const el = document.querySelector(
|
|
||||||
'[data-test="new-now-playing"] [class*="_titleContainer_"]',
|
|
||||||
) as HTMLElement | null;
|
|
||||||
if (!el) return;
|
|
||||||
if (settings.trackTitleGlow && settings.lyricsGlowEnabled) {
|
|
||||||
el.classList.remove("rl-title-glow-disabled");
|
|
||||||
} else {
|
|
||||||
el.classList.add("rl-title-glow-disabled");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Apply seeker color on track change
|
// Apply seeker color on track change
|
||||||
onGlobalTrackChange(() => {
|
onGlobalTrackChange(() => {
|
||||||
updateCoverArtBackground();
|
updateCoverArtBackground();
|
||||||
@@ -4144,6 +4103,5 @@ onGlobalTrackChange(() => {
|
|||||||
// Init observers
|
// Init observers
|
||||||
setupHeaderObserver();
|
setupHeaderObserver();
|
||||||
setupNowPlayingObserver();
|
setupNowPlayingObserver();
|
||||||
setupTrackTitleObserver();
|
|
||||||
setupStickyLyricsObserver();
|
setupStickyLyricsObserver();
|
||||||
setupTrackChangeListener();
|
setupTrackChangeListener();
|
||||||
|
|||||||
@@ -68,29 +68,6 @@
|
|||||||
transition-duration: 0.7s;
|
transition-duration: 0.7s;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Track title glow */
|
|
||||||
[data-test="new-now-playing"] [class*="_titleContainer_"] {
|
|
||||||
/* Title text color/gradient is left to default app styling; only glow is customized. */
|
|
||||||
text-shadow:
|
|
||||||
0 0 var(--rl-glow-inner, 1px) var(--cl-glow1, #fff),
|
|
||||||
/* biome-ignore lint: Title glow needs priority */
|
|
||||||
0 0 var(--rl-glow-outer, 30px) #fff !important;
|
|
||||||
/* biome-ignore lint: Reset vendor background clip */
|
|
||||||
-webkit-background-clip: initial !important;
|
|
||||||
/* biome-ignore lint: Reset background clip */
|
|
||||||
background-clip: initial !important;
|
|
||||||
/* biome-ignore lint: Reset vendor text fill */
|
|
||||||
-webkit-text-fill-color: initial !important;
|
|
||||||
/* biome-ignore lint: Ensure inherited color takes precedence */
|
|
||||||
color: inherit !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* When track title glow setting is disabled, remove glow regardless of Colorama */
|
|
||||||
[data-test="new-now-playing"] [class*="_titleContainer_"].rl-title-glow-disabled {
|
|
||||||
/* biome-ignore lint: Full reset required */
|
|
||||||
text-shadow: none !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Current line transitions */
|
/* Current line transitions */
|
||||||
[data-test="now-playing-lyrics"] span[data-test="lyrics-line"] {
|
[data-test="now-playing-lyrics"] span[data-test="lyrics-line"] {
|
||||||
transition:
|
transition:
|
||||||
|
|||||||
@@ -277,4 +277,10 @@ body.rl-dropdown-open [data-test="toggle-lyrics"] {
|
|||||||
/* Remove max-width cap on now-playing content */
|
/* Remove max-width cap on now-playing content */
|
||||||
[class*="_contentInner"] {
|
[class*="_contentInner"] {
|
||||||
max-width: none !important;
|
max-width: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Round now-playing artwork corners */
|
||||||
|
[data-test="now-playing-artwork"] {
|
||||||
|
/* biome-ignore lint: Override flat corners */
|
||||||
|
border-radius: 10px !important;
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user