WIP | Switch to Local CSS

This commit is contained in:
2025-06-02 11:26:43 +10:00
parent 40d6e25d00
commit 14a8521940
6 changed files with 453 additions and 162 deletions
+3 -127
View File
@@ -1,139 +1,15 @@
import { LunaUnload, Tracer, ftch } from "@luna/core";
import { settings, Settings } from "./Settings";
// Import CSS directly using Luna's file:// syntax
import styles from "file://styles.css?minify";
export const { trace } = Tracer("[Clean View]");
export { Settings };
// clean up resources
export const unloads = new Set<LunaUnload>();
const styles = `
[class*="tabItems"] {
opacity: 0 !important;
transition: opacity 0.3s ease-in-out;
}
[class*="_imageContainer"] {
margin-top: 40px !important;
}
[class*="_tabItems"]:hover {
opacity: 1 !important;
}
[data-test="header-container"] {
opacity: 0;
margin: -40px;
}
/* Only prevent specific text elements in player bar from being affected by margin adjustments */
[data-test="footer-player"] [class*="_trackTitle"],
[data-test="footer-player"] [class*="_artistName"],
[data-test="footer-player"] [class*="_trackInfo"],
[data-test="footer-player"] [class*="_trackContainer"] {
margin-top: 0 !important;
transform: none !important;
}
[class*="_nowPlayingContainer"] {
padding-left: 6%;
padding-top: 20px !important;
}
/* Move main content areas up */
[class*="_trackTitleContainer"],
[class*="_artistContainer"],
[class*="_albumContainer"] {
margin-top: -20px !important;
}
/* Move album art and lyrics content up */
[class*="_lyricsContainer"],
[class*="_mediaContainer"] {
margin-top: -30px !important;
}
/* Move play queue content up to fill button space */
[class*="_playQueueContainer"],
[class*="_queueContainer"],
[data-test="play-queue"],
#playQueueSidebar {
margin-top: -40px !important;
padding-top: 10px !important;
}
/* Move play queue list content up - more aggressive */
[class*="_playQueueList"],
[class*="_queueList"],
[class*="_trackList"] {
margin-top: -60px !important;
padding-top: 0px !important;
}
/* Target specific play queue elements more aggressively */
#playQueueSidebar > div,
#playQueueSidebar > div > div {
margin-top: -40px !important;
padding-top: 0px !important;
}
/* Override any existing padding in queue content area */
[class*="_queueContent"],
[class*="_playQueueContent"] {
margin-top: -50px !important;
padding-top: 20px !important;
}
[class^="_bar"] {
background-color: transparent;
}
[class^="_bar"]>* {
opacity: 0;
}
/* Hide bottom left controls completely - no hover reveal */
[data-test="add-to-playlist"],
[data-test="remove-from-playlist"],
[data-test="like-toggle"],
[data-test="dislike-toggle"],
[data-test="favorite-toggle"],
[data-test="heart-button"],
[data-test="playlist-add"],
[class*="_trackActions"],
[class*="_bottomLeftControls"],
[class*="_actionButtons"],
[class*="_favoriteButton"],
[class*="_addToPlaylist"],
[class*="_lowerLeft"],
[class*="_bottomActions"],
[class*="_mediaControls"] > div:first-child,
button[title*="Add to"],
button[title*="Remove from"],
button[title*="Like"],
button[title*="Favorite"],
button[title*="Heart"],
button[aria-label*="Add to"],
button[aria-label*="Remove from"],
button[aria-label*="Like"],
button[aria-label*="Favorite"],
button[aria-label*="Heart"],
/* Target buttons in bottom left area specifically */
[class*="_nowPlayingContainer"] button[class*="_button"]:not(.unhide-ui-button),
[class*="_nowPlayingContainer"] [class*="_iconButton"]:not(.unhide-ui-button),
/* Additional catch-all for bottom left area buttons */
[class*="_nowPlayingContainer"] > div > div:first-child button:not(.unhide-ui-button),
[class*="_nowPlayingContainer"] > div:first-child button:not(.unhide-ui-button) {
display: none !important;
}
/* Keep the Unhide button always visible with special styling */
.unhide-ui-button {
opacity: 1 !important;
display: flex !important;
}
`;
const themeUrl = "https://raw.githubusercontent.com/itzzexcel/neptune-projects/refs/heads/main/plugins/plugins/not-actual-fullscreen/src/separated-lyrics.css";
function ApplyCSS(style: string): HTMLStyleElement {
+124
View File
@@ -0,0 +1,124 @@
[class*="tabItems"] {
opacity: 0 !important;
transition: opacity 0.3s ease-in-out;
}
[class*="_imageContainer"] {
margin-top: 40px !important;
}
[class*="_tabItems"]:hover {
opacity: 1 !important;
}
[data-test="header-container"] {
opacity: 0;
margin: -40px;
}
/* Only prevent specific text elements in player bar from being affected by margin adjustments */
[data-test="footer-player"] [class*="_trackTitle"],
[data-test="footer-player"] [class*="_artistName"],
[data-test="footer-player"] [class*="_trackInfo"],
[data-test="footer-player"] [class*="_trackContainer"] {
margin-top: 0 !important;
transform: none !important;
}
[class*="_nowPlayingContainer"] {
padding-left: 6%;
padding-top: 20px !important;
}
/* Move main content areas up */
[class*="_trackTitleContainer"],
[class*="_artistContainer"],
[class*="_albumContainer"] {
margin-top: -20px !important;
}
/* Move album art and lyrics content up */
[class*="_lyricsContainer"],
[class*="_mediaContainer"] {
margin-top: -30px !important;
}
/* Move play queue content up to fill button space */
[class*="_playQueueContainer"],
[class*="_queueContainer"],
[data-test="play-queue"],
#playQueueSidebar {
margin-top: -40px !important;
padding-top: 10px !important;
}
/* Move play queue list content up - more aggressive */
[class*="_playQueueList"],
[class*="_queueList"],
[class*="_trackList"] {
margin-top: -60px !important;
padding-top: 0px !important;
}
/* Target specific play queue elements more aggressively */
#playQueueSidebar > div,
#playQueueSidebar > div > div {
margin-top: -40px !important;
padding-top: 0px !important;
}
/* Override any existing padding in queue content area */
[class*="_queueContent"],
[class*="_playQueueContent"] {
margin-top: -50px !important;
padding-top: 20px !important;
}
[class^="_bar"] {
background-color: transparent;
}
[class^="_bar"]>* {
opacity: 0;
}
/* Hide bottom left controls completely - no hover reveal */
[data-test="add-to-playlist"],
[data-test="remove-from-playlist"],
[data-test="like-toggle"],
[data-test="dislike-toggle"],
[data-test="favorite-toggle"],
[data-test="heart-button"],
[data-test="playlist-add"],
[class*="_trackActions"],
[class*="_bottomLeftControls"],
[class*="_actionButtons"],
[class*="_favoriteButton"],
[class*="_addToPlaylist"],
[class*="_lowerLeft"],
[class*="_bottomActions"],
[class*="_mediaControls"] > div:first-child,
button[title*="Add to"],
button[title*="Remove from"],
button[title*="Like"],
button[title*="Favorite"],
button[title*="Heart"],
button[aria-label*="Add to"],
button[aria-label*="Remove from"],
button[aria-label*="Like"],
button[aria-label*="Favorite"],
button[aria-label*="Heart"],
/* Target buttons in bottom left area specifically */
[class*="_nowPlayingContainer"] button[class*="_button"]:not(.unhide-ui-button),
[class*="_nowPlayingContainer"] [class*="_iconButton"]:not(.unhide-ui-button),
/* Additional catch-all for bottom left area buttons */
[class*="_nowPlayingContainer"] > div > div:first-child button:not(.unhide-ui-button),
[class*="_nowPlayingContainer"] > div:first-child button:not(.unhide-ui-button) {
display: none !important;
}
/* Keep the Unhide button always visible with special styling */
.unhide-ui-button {
opacity: 1 !important;
display: flex !important;
}
+3 -13
View File
@@ -1,23 +1,13 @@
import { LunaUnload, Tracer } from "@luna/core";
// Import CSS directly using Luna's file:// syntax
import unlockSelection from "file://styles.css?minify";
export const { trace } = Tracer("[Copy Lyrics]");
// clean up resources
export const unloads = new Set<LunaUnload>();
const unlockSelection = `
[class^="_lyricsText"]>div>span {
user-select: text;
cursor: text;
}
::selection {
background: rgb(0, 0, 0);
color: rgb(255, 255, 255);
}
`;
function ApplyCSS(style: string): HTMLStyleElement {
const styleElement = document.createElement("style");
styleElement.type = "text/css";
+9
View File
@@ -0,0 +1,9 @@
[class^="_lyricsText"]>div>span {
user-select: text;
cursor: text;
}
::selection {
background: rgb(72, 0, 60);
color: rgb(255, 255, 255);
}
+13 -22
View File
@@ -1,21 +1,20 @@
import { LunaUnload, Tracer, ftch } from "@luna/core";
import { LunaUnload, Tracer } from "@luna/core";
import { settings, Settings } from "./Settings";
// Import CSS directly using Luna's file:// syntax.. Took me a while to figure out this existed
import originalStyle from "file://theme.css?minify";
export const { trace } = Tracer("[OLED Theme]");
export { Settings };
const themeUrl = "https://raw.githubusercontent.com/ItzzExcel/neptune-projects/refs/heads/main/themes/black-neptune-theme.css";
// called when plugin is unloaded.
// clean up resources
export const unloads = new Set<LunaUnload>();
let originalStyle: string | null = null;
let appliedStyleElement: HTMLStyleElement | null = null;
// Function to apply theme styles based on current settings
const applyThemeStyles = function(): void {
if (!originalStyle) return;
// Remove existing style element if it exists
if (appliedStyleElement && appliedStyleElement.parentNode) {
@@ -73,7 +72,7 @@ const applyThemeStyles = function(): void {
/\[class[^=]*=["'][^"']*action/i.test(rule) ||
/\[class[^=]*=["'][^"']*control/i.test(rule);
// Return true to keep the rule (i.e., if it's NOT a button rule)
// Return true to keep the rule if it's NOT a button rule
return !isButtonRule;
});
@@ -89,20 +88,12 @@ const applyThemeStyles = function(): void {
// Make this function available globally so Settings can call it
(window as any).updateOLEDThemeStyles = applyThemeStyles;
// Added Top-level async since Luna plugins are modules <3
originalStyle = await ftch.text(themeUrl).catch((error: Error) => {
trace.msg.err(`Failed to fetch theme CSS: ${error.message}`);
return null;
});
// Apply the OLED theme
applyThemeStyles();
// Apply the OLED theme if CSS was fetched successfully
if (originalStyle) {
applyThemeStyles();
// Add cleanup to unloads
unloads.add(() => {
if (appliedStyleElement && appliedStyleElement.parentNode) {
appliedStyleElement.parentNode.removeChild(appliedStyleElement);
}
});
}
// Add cleanup to unloads
unloads.add(() => {
if (appliedStyleElement && appliedStyleElement.parentNode) {
appliedStyleElement.parentNode.removeChild(appliedStyleElement);
}
});
+301
View File
@@ -0,0 +1,301 @@
/*
{
"name": "Abyss Neptune",
"author": "@itzzexcel",
"description": "Abyss Neptune: ShadowX Theme from Spicetify to TIDAL (17/Jan/2025)"
}
*/
::-webkit-scrollbar {
display: none;
}
:root {
--wave-color-solid-accent-fill: white;
--wave-color-solid-rainbow-yellow-fill: white;
--wave-color-solid-contrast-fill: white;
--wave-color-solid-base-brighter: black;
--wave-text-body-medium: white !important;
--track-vibrant-color: white !important;
--wave-color-opacity-contrast-fill-ultra-thin: #fffafa1a !important;
--wave-color-solid-rainbow-yellow-darkest: #fffafa1a !important;
--wave-color-solid-accent-dark: rgb(128, 128, 128);
}
/* Credits to https://github.com/surfbryce for the fonts */
@font-face {
font-family: "AbyssFont";
font-weight: 400;
src: url("https://excel.lexploits.top/extra/tidal/LyricsRegular.woff2") format("woff2");
}
@font-face {
font-family: "AbyssFont";
font-weight: 500;
src: url("https://excel.lexploits.top/extra/tidal/LyricsMedium.woff2") format("woff2");
}
@font-face {
font-family: "AbyssFont";
font-weight: 600;
src: url("https://excel.lexploits.top/extra/tidal/LyricsSemibold.woff2") format("woff2");
}
@font-face {
font-family: "AbyssFont";
font-weight: 700;
src: url("https://excel.lexploits.top/extra/tidal/LyricsBold.woff2") format("woff2");
}
[class^="followingButton"],
[title="Unfollow"],
[title="Follow"],
[title="Unfollow"]>span,
[title="Follow"]>span {
background-color: var(--wave-color-solid-rainbow-yellow-fill) !important;
color: var(--wave-color-solid-base-brighter);
}
[class^="_wave-badge-color-max"] {
color: black !important;
background-color: var(--wave-color-solid-accent-fill);
border-radius: 3px;
}
[data-test="main-layout-sidebar-wrapper"] {
border-right: rgb(25, 25, 25) 1px solid;
}
[class^="_wave-badge"] {
background-color: var(--wave-color-solid-accent-fill);
border-radius: 4px;
color: black;
}
[class^="_progressBarWrapper"] {
color: var(--wave-color-solid-accent-fill) !important;
}
[class^="_sidebarItem"]>span {
color: var(--wave-color-solid-accent-dark);
}
[data-test="main-layout-header"] {
border-left: 0 !important;
}
[class^="_sidebarItem"]:hover span {
color: var(--wave-color-solid-contrast-fill);
}
[class^="_sidebarItem"] [class^="active"]>span {
color: var(--wave-color-solid-accent-dark) !important;
}
[class^="_active"] {
color: var(--wave-color-solid-accent-fill) !important;
}
[class^="ReactVirtualized__Grid"] {
border-radius: 10px;
margin: 5px;
}
[data-test="media-table"]>div>div>div {
border: 1px solid rgb(25, 25, 25) !important;
}
[class^="ReactVirtualized__Grid__innerScrollContainer"] {
border: none;
margin: 5px;
}
[class^="button"]>span {
color: black;
}
[class^="_explicitBadge"] {
color: var(--wave-color-solid-accent-fill);
}
[class^="viewAllButton"] {
border-radius: 4px;
display: grid;
place-items: center;
}
[data-test="current-media-imagery"] {
border: 0 !important;
margin: none;
}
[class^="_imageBorder"] {
display: none;
}
[class^="_headerButtons"]>button,
[class^="_headerButtons"]>button>span,
[data-test="toggle-picture-in-picture"] {
background-color: var(--wave-color-solid-accent-fill) !important;
color: black;
}
[class^="_container"]>[class^="_navigationArrows"] {
color: black;
background-color: var(--wave-color-solid-accent-fill) !important;
border-radius: 4px;
}
[class^="_buttons"]>button>span {
color: black !important;
}
[class^="_container"]>button {
border: 0px none;
}
[data-test="feed-sidebar"] {
margin-top: 10px;
}
[data-test="footer-player"] {
width: calc(100% - 20px);
bottom: 10px;
left: 10px;
border: 1px solid rgb(25, 25, 25);
border-radius: 4px !important;
position: absolute !important;
}
[class^="_tooltipContainer"]>button {
background-color: var(--wave-color-solid-accent-fill);
color: black;
}
[class^="_tooltipContainer"]>button:hover {
background-color: lightgray !important;
}
[class^="_tableRow"]:hover>*,
[data-test-is-playing="true"]>* {
color: var(--wave-color-solid-accent-fill) !important;
}
[class^="_tableRow"]>*,
[data-test-is-playing="false"]>* {
color: lightgray !important;
}
[class*="coverColumn"] {
padding-left: 5px !important;
}
[class^="actionList"] {
background-color: transparent;
margin: 0px;
border-radius: 5px;
}
button[data-test="request-fullscreen"],
button[data-test="close-now-playing"],
button[data-test="play-all"],
button[data-test="shuffle-all"] {
color: black;
background-color: var(--wave-color-solid-accent-fill);
border-radius: 12px;
}
button[data-test="request-fullscreen"]:hover,
button[data-test="close-now-playing"]:hover {
color: black;
background-color: lightgray !important;
}
.neptune-switch-checkbox:checked+.neptune-switch {
background-color: rgba(255, 255, 255, 0.1);
}
[data-test="navigation-arrows"]>button {
background-color: var(--wave-color-solid-accent-fill) !important;
color: black !important;
border-radius: 5px;
}
[data-test="navigation-arrows"]>button:disabled {
background-color: lightgray !important;
opacity: 1;
}
[data-test="main-layout-header"],
[data-test="feed-sidebar"],
[data-test="stream-metadata"],
[data-test="footer-player"] {
background-color: rgba(0, 0, 0, 0.8) !important;
backdrop-filter: blur(10px);
border: 1px solid var(--wave-color-opacity-contrast-fill-ultra-thin) !important;
}
[data-wave-color=textUrl] {
color: var(--wave-color-solid-accent-fill);
}
[class^="_smallHeader"] {
margin-top: 7.5px;
}
[data-test="play-all"]>div>*,
[data-test="shuffle-all"]>div>*,
[data-test="play-all"],
[data-test="shuffle-all"] {
color: var(--wave-color-solid-accent-fill) !important;
background-color: transparent !important;
}
[class^="__NEPTUNE_PAGE"],
[data-test="main"] {
margin-top: 35px;
}
[data-test="button-desktop-release-notes"],
[data-test="button-release-notes"] {
background-color: white;
}
[data-test="button-desktop-release-notes"]:hover,
[data-test="button-release-notes"]:hover {
background-color: lightgray !important;
transition: none !important;
}
#playQueueSidebar {
top: 50px !important;
border: 1px solid var(--wave-color-opacity-contrast-fill-ultra-thin);
margin: 2px;
margin-right: -14px !important;
background-color: rgba(0, 0, 0, 0.8) !important;
backdrop-filter: blur(10px);
}
[class^="_bottomGradient"] {
visibility: hidden;
}
[data-test="settings-page"] {
padding-bottom: 60px !important;
}
[data-test="query-suggestions"],
[data-test="recent-searches-container"] {
background-color: rgba(0, 0, 0, 0.6);
backdrop-filter: blur(10px);
}
[data-test="contextmenu"] {
border: 1px solid var(--wave-color-opacity-contrast-fill-ultra-thin) !important;
}
[class^="_dataContainer_"]::before {
background-image: var(--img);
filter: blur(10px) brightness(0.4);
}