mirror of
https://github.com/meowarex/TidaLuna-Plugins.git
synced 2026-06-18 03:43:10 +10:00
WIP | Switch to Local CSS
This commit is contained in:
@@ -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);
|
||||
}
|
||||
});
|
||||
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user