diff --git a/src/components/colorchooser.tsx b/src/components/colorchooser.tsx index 2a4979e..12af96b 100644 --- a/src/components/colorchooser.tsx +++ b/src/components/colorchooser.tsx @@ -52,7 +52,7 @@ export default function ColorChooser(props: ColorChooserProps) { {Object.keys(theme.colors).map((color) => shades.map((shade) => ( { - props.onChange({ color, shade }); + props.onChange({ color, shade, computed: theme.colors[color][shade] }); setOpened(false); }}> diff --git a/src/components/modals/interfacepanel.tsx b/src/components/modals/interfacepanel.tsx index c566308..8a98201 100644 --- a/src/components/modals/interfacepanel.tsx +++ b/src/components/modals/interfacepanel.tsx @@ -77,12 +77,12 @@ export function InterfaceSettigsPanel(props: { fo }, [style, setStyle, setFieldValue]); const defaultColor = theme.colorScheme === "dark" - ? { color: "dark", shade: 0 } - : { color: "dark", shade: 9 }; + ? { color: "dark", shade: 0, computed: theme.colors.dark[0] } + : { color: "dark", shade: 9, computed: theme.colors.dark[9] }; const defaultBg = theme.colorScheme === "dark" - ? { color: "dark", shade: 7 } - : { color: "gray", shade: 0 }; + ? { color: "dark", shade: 7, computed: theme.colors.dark[7] } + : { color: "gray", shade: 0, computed: theme.colors.gray[0] }; return ( diff --git a/src/config.ts b/src/config.ts index 668870d..8fb93a8 100644 --- a/src/config.ts +++ b/src/config.ts @@ -101,6 +101,7 @@ export type WindowCloseOption = typeof WindowCloseOptions[number]; export interface ColorSetting { color: DefaultMantineColor, shade: number, + computed: string, } export interface StyleOverrideColors { diff --git a/src/css/loader.css b/src/css/loader.css index d186a0e..560eeee 100644 --- a/src/css/loader.css +++ b/src/css/loader.css @@ -3,6 +3,14 @@ * https://loading.io/css/ */ +.loader-container { + display: flex; + justify-content: center; + align-items: center; + width: 100%; + height: 100%; +} + .lds-ring { display: inline-block; position: relative; @@ -17,10 +25,9 @@ width: 64px; height: 64px; margin: 8px; - border: 8px solid #fff; + border: 8px solid transparent; border-radius: 50%; animation: lds-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite; - border-color: #0037b860 transparent transparent transparent; } .lds-ring div:nth-child(1) { diff --git a/src/index.tsx b/src/index.tsx index beab628..37250af 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -20,7 +20,8 @@ import "css/loader.css"; import { Config, ConfigContext } from "./config"; import { createRoot } from "react-dom/client"; import type { Root } from "react-dom/client"; -import React, { lazy, Suspense } from "react"; +import React, { lazy, Suspense, useContext } from "react"; +import type { CSSProperties } from "react"; const { TAURI, appWindow, invoke } = await import(/* webpackChunkName: "taurishim" */"taurishim"); const TauriApp = lazy(async () => await import("components/app")); @@ -94,9 +95,31 @@ function setupWebEvents(config: Config) { } function Loader() { + const config = useContext(ConfigContext); + + const interfaceConfig = config.values.interface; + const theme = interfaceConfig.theme; + const backgroundColorOverride = + interfaceConfig.styleOverrides[theme ?? "light"]?.backgroundColor; + const spinnerStyle: CSSProperties = { + borderTopColor: `hsla(222, 100%, ${theme === "dark" ? "50%" : "36%"}, 0.376)`, + }; + return ( -
-
+
+
+
+
+
+
+
); }