From 6d8dc6fe131c71dae7987808a121ac575854b618 Mon Sep 17 00:00:00 2001 From: Antheas Kapenekakis Date: Thu, 12 Dec 2024 15:30:04 +0100 Subject: [PATCH] add new themes --- src/components/theme.tsx | 162 ++++++++++++++++++++++++++++++++++++++- src/main.tsx | 9 +-- 2 files changed, 163 insertions(+), 8 deletions(-) diff --git a/src/components/theme.tsx b/src/components/theme.tsx index 61e1b2b..9bd0d11 100644 --- a/src/components/theme.tsx +++ b/src/components/theme.tsx @@ -151,6 +151,58 @@ export const distroThemes: Record = { "900": "#112216", }, }), + blood_orange: createTheme({ + brand: { + "50": "#FDECE7", + "100": "#f06429", + "200": "#f06429", + "300": "#f06429", + "400": "#f06429", + "500": "#f06429", + "600": "#8F270A", + "700": "#8F270A", + "800": "#5F1A07", + "900": "#300D03", + }, + gray: { + "50": "#fde8de", + "100": "#fde8de", + "200": "#f06226", + "300": "#ef5514", + "400": "#e14d0f", + "500": "#742807", + "600": "#4f1b05", + "700": "#030100", + "800": "#030100", + "900": "#030100", + }, + }), + red_gold: createTheme({ + brand: { + "50": "#FDECE7", + "100": "#FDAA31", + "200": "#FDAA31", + "300": "#FDAA31", + "400": "#FDAA31", + "500": "#FDAA31", + "600": "#f19002", + "700": "#f19002", + "800": "#905601", + "900": "#905601", + }, + gray: { + "50": "#fce0dd", + "100": "#fce0dd", + "200": "#f38c84", + "300": "#f38c84", + "400": "#c72013", + "500": "#b51d11", + "600": "#a31a10", + "700": "#7f140c", + "800": "#080100", + "900": "#080100", + }, + }), bazzite: createTheme({ brand: { "50": "#EBE8FD", @@ -205,8 +257,27 @@ export const distroThemes: Record = { }), }; +export const cleanDistroName = (distro: string | null) => { + return distro ? distro.replace("_ba", "") : null; +}; + +export const getDistroTheme = (distro: string | null) => { + let main = theme; + let controller = controllerTheme; + distro = cleanDistroName(distro); + + if (distro && distroThemes[distro]) { + main = distroThemes[distro].theme; + controller = distroThemes[distro].controllerTheme; + } + + return { theme: main, controllerTheme: controller }; +}; + export const getScrollbarStyle = (distro: string | null, colorMode: string) => { let colors; + distro = cleanDistroName(distro); + switch (distro) { case "vapor": colors = ["#66c0f4", "#171a2130"]; @@ -220,6 +291,12 @@ export const getScrollbarStyle = (distro: string | null, colorMode: string) => { case "ocean": colors = ["#E4BC1B", "#183C8130"]; break; + case "blood_orange": + colors = ["#f06429", "#1d191630"]; + break; + case "red_gold": + colors = ["#FDAA31", "#1d191630"]; + break; default: colors = ["#B69616", "#1d191630"]; break; @@ -237,6 +314,8 @@ export const getScrollbarStyle = (distro: string | null, colorMode: string) => { }; export const getBackground = (colorMode: string, theme: string | null) => { + theme = cleanDistroName(theme); + switch (theme) { // Rotation is target color hue -50 case "vapor": @@ -263,6 +342,30 @@ export const getBackground = (colorMode: string, theme: string | null) => { filter: "sepia(0.3) hue-rotate(85deg)", }; } + case "red_gold": + if (colorMode === "dark") { + return { + bgImage: BackgroundMonoDark, + filter: "sepia(1) saturate(3) hue-rotate(315deg)", + }; + } else { + return { + bgImage: BackgroundMonoLight, + filter: "sepia(0.5) saturate(0.2) hue-rotate(315deg)", + }; + } + case "blood_orange": + if (colorMode === "dark") { + return { + bgImage: BackgroundMonoDark, + filter: "sepia(1) saturate(0.4) hue-rotate(320deg)", + }; + } else { + return { + bgImage: BackgroundMonoLight, + filter: "sepia(0.5) saturate(0.2) hue-rotate(320deg)", + }; + } case "bazzite": if (colorMode === "dark") { return { @@ -305,8 +408,9 @@ export const getBackground = (colorMode: string, theme: string | null) => { export const Logo = ({ height, width, qam }: any) => { const { colorMode } = useColorMode(); const theme = useSelector(selectCurrentTheme); + const clean = cleanDistroName(theme); - switch (theme) { + switch (clean) { case "vapor": return ( { )} ); + case "blood_orange": + return ( + + {theme?.includes("_ba") && ( + + )} + {!qam && theme?.includes("_ba") && ( + + )} + + ); + case "red_gold": + return ( + + {theme?.includes("_ba") && ( + + )} + {!qam && theme?.includes("_ba") && ( + + )} + + ); } return ( diff --git a/src/main.tsx b/src/main.tsx index 5042932..2521173 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -13,6 +13,7 @@ import defaultTheme, { controllerTheme as defaultControllerTheme, distroThemes, getBackground, + getDistroTheme, getScrollbarStyle, } from "./components/theme.tsx"; @@ -158,13 +159,7 @@ function App() { function ThemeSet() { const controller = useSelector(selectHasController); const distro = useSelector(selectCurrentTheme); - let theme = defaultTheme; - let controllerTheme = defaultControllerTheme; - - if (distro && distroThemes[distro]) { - theme = distroThemes[distro].theme; - controllerTheme = distroThemes[distro].controllerTheme; - } + let {theme, controllerTheme} = getDistroTheme(distro); return (