type fixes and build

This commit is contained in:
caranicas 2022-09-30 17:17:22 -04:00
parent ac021f38da
commit 3da75494b0
12 changed files with 89 additions and 170 deletions

View File

@ -1,24 +1,19 @@
import React, { useState } from "react"; import React from "react";
import { ReactLocation, Router } from "@tanstack/react-location"; import { ReactLocation, Router } from "@tanstack/react-location";
import Home from "./pages/Home"; import Home from "./pages/Home";
import Settings from "./pages/Settings"; import Settings from "./pages/Settings";
import { darkTheme, lightTheme } from "./styles/theme/index.css";
import "./Translation/config"; import "./Translation/config";
const location = new ReactLocation(); const location = new ReactLocation();
function App() { function App() {
// just check for the theme one 1 time
// var { matches } = window.matchMedia('(prefers-color-scheme: dark)')
const matches = true;
const themeClass = matches ? darkTheme : lightTheme;
return ( return (
<Router <Router
location={location} location={location}
routes={[ routes={[
{ path: "/", element: <Home className={themeClass} /> }, { path: "/", element: <Home /> },
{ path: "/settings", element: <Settings className={themeClass} /> }, { path: "/settings", element: <Settings /> },
]} ]}
></Router> ></Router>
); );

View File

@ -4,7 +4,7 @@ import { vars } from "../../styles/theme/index.css";
export const card = recipe({ export const card = recipe({
base: { base: {
background: vars.colors.background, background: vars.backgroundMain,
color: vars.colors.text.normal, color: vars.colors.text.normal,
padding: vars.spacing.medium, padding: vars.spacing.medium,
borderRadius: vars.trim.smallBorderRadius, borderRadius: vars.trim.smallBorderRadius,

View File

@ -25,7 +25,7 @@ export const PopoverPanelMain = style({
top: '100%', top: '100%',
right: '0', right: '0',
zIndex: '1', zIndex: '1',
background: vars.colors.backgroundDark, background: vars.backgroundMain,
color: vars.colors.text.normal, color: vars.colors.text.normal,
padding: vars.spacing.medium, padding: vars.spacing.medium,
borderRadius: vars.trim.smallBorderRadius, borderRadius: vars.trim.smallBorderRadius,

View File

@ -1,8 +1,6 @@
import React, { useState } from "react"; import React, { useState } from "react";
import { import {
PanelBox,
MenuButton, MenuButton,
} from "../../../../styles/shared.css"; } from "../../../../styles/shared.css";

View File

@ -3,13 +3,13 @@ import { style } from "@vanilla-extract/css";
import { vars } from "../../../../styles/theme/index.css"; import { vars } from "../../../../styles/theme/index.css";
export const StartingStatus = style({ export const StartingStatus = style({
color: vars.colors.warning, color: `hsl(${vars.warningHue}, ${vars.colorMod.saturation.normal}, ${vars.colorMod.lightness.normal})`,
}); });
export const ErrorStatus = style({ export const ErrorStatus = style({
color: vars.colors.error, color: `hsl(${vars.errorHue}, ${vars.colorMod.saturation.normal}, ${vars.colorMod.lightness.normal})`,
}); });
export const SuccessStatus = style({ export const SuccessStatus = style({
color: vars.colors.success, color: `hsl(${vars.successHue}, ${vars.colorMod.saturation.normal}, ${vars.colorMod.lightness.normal})`,
}); });

View File

@ -31,23 +31,22 @@ globalStyle(`${QueueItemInfo} p`, {
marginBottom: vars.spacing.small, marginBottom: vars.spacing.small,
}); });
globalStyle(`${QueueItemMain}.${QueueStatus.complete}`, {
backgroundColor: `hsl(${vars.tertiaryHue}, ${vars.colorMod.saturation.normal}, ${vars.colorMod.lightness.normal})`,
});
globalStyle(`${QueueItemMain}.${QueueStatus.processing}`, { globalStyle(`${QueueItemMain}.${QueueStatus.processing}`, {
backgroundColor: `hsl(${vars.secondaryHue}, ${vars.colorMod.saturation.normal}, ${vars.colorMod.lightness.normal})`, backgroundColor: `hsl(${vars.secondaryHue}, ${vars.colorMod.saturation.bright}, ${vars.colorMod.lightness.bright})`,
}); });
globalStyle(`${QueueItemMain}.${QueueStatus.pending}`, { globalStyle(`${QueueItemMain}.${QueueStatus.pending}`, {
backgroundColor: vars.backgroundDark, backgroundColor: `hsl(${vars.secondaryHue}, ${vars.colorMod.saturation.dim}, ${vars.colorMod.lightness.normal})`,
// `hsl(${vars.warningHue}, ${vars.colorMod.saturation.normal}, ${vars.colorMod.lightness.normal})`,
}); });
globalStyle(`${QueueItemMain}.${QueueStatus.paused}`, { globalStyle(`${QueueItemMain}.${QueueStatus.paused}`, {
backgroundColor: vars.backgroundDark, backgroundColor: `hsl(${vars.secondaryHue}, ${vars.colorMod.saturation.dim}, ${vars.colorMod.lightness.dim})`,
//`hsl(${vars.tertiaryHue}, ${vars.colorMod.saturation.normal}, ${vars.colorMod.lightness.normal})`,
}); });
globalStyle(`${QueueItemMain}.${QueueStatus.complete}`, {
backgroundColor: `hsl(${vars.successHue}, ${vars.colorMod.saturation.normal}, ${vars.colorMod.lightness.normal})`,
});
globalStyle(`${QueueItemMain}.${QueueStatus.error}`, { globalStyle(`${QueueItemMain}.${QueueStatus.error}`, {
backgroundColor: `hsl(${vars.errorHue}, ${vars.colorMod.saturation.normal}, ${vars.colorMod.lightness.normal})`, backgroundColor: `hsl(${vars.errorHue}, ${vars.colorMod.saturation.normal}, ${vars.colorMod.lightness.normal})`,

View File

@ -16,12 +16,11 @@ import { useImageCreate } from "../../stores/imageCreateStore";
// Todo - import components here // Todo - import components here
import HeaderDisplay from "../../components/organisms/headerDisplay"; import HeaderDisplay from "../../components/organisms/headerDisplay";
import CreationPanel from "../../components/organisms/creationPanel";
import DisplayPanel from "../../components/organisms/displayPanel"; import DisplayPanel from "../../components/organisms/displayPanel";
import FooterDisplay from "../../components/organisms/footerDisplay"; import FooterDisplay from "../../components/organisms/footerDisplay";
import CreationTabs from "../../components/layouts/CreationTabs"; import CreationTabs from "../../components/layouts/CreationTabs";
function Home({ className }: { className: any }) { function Home() {
// Get the original save directory // Get the original save directory
const setRequestOption = useImageCreate((state) => state.setRequestOptions); const setRequestOption = useImageCreate((state) => state.setRequestOptions);
@ -52,13 +51,12 @@ function Home({ className }: { className: any }) {
}, [setRequestOption, statusMods, dataMoads]); }, [setRequestOption, statusMods, dataMoads]);
return ( return (
<div className={[AppLayout, className].join(" ")}> <div className={[AppLayout].join(" ")}>
<header className={HeaderLayout}> <header className={HeaderLayout}>
<HeaderDisplay></HeaderDisplay> <HeaderDisplay></HeaderDisplay>
</header> </header>
<nav className={CreateLayout}> <nav className={CreateLayout}>
<CreationTabs></CreationTabs> <CreationTabs></CreationTabs>
{/* <CreationPanel></CreationPanel> */}
</nav> </nav>
<main className={DisplayLayout}> <main className={DisplayLayout}>
<DisplayPanel></DisplayPanel> <DisplayPanel></DisplayPanel>

View File

@ -1,6 +1,6 @@
import React from "react"; import React from "react";
export default function Settings({ className }: { className: any }) { export default function Settings() {
return ( return (
<div> <div>
<h1>Settings</h1> <h1>Settings</h1>

View File

@ -2,7 +2,7 @@ import { style, globalStyle } from "@vanilla-extract/css";
import { vars } from "./theme/index.css"; import { vars } from "./theme/index.css";
export const PanelBox = style({ export const PanelBox = style({
background: vars.colors.backgroundAlt, background: vars.backgroundLight,
color: vars.colors.text.normal, color: vars.colors.text.normal,
padding: vars.spacing.medium, padding: vars.spacing.medium,
borderRadius: vars.trim.smallBorderRadius, borderRadius: vars.trim.smallBorderRadius,

View File

@ -5,47 +5,47 @@ import {
} from "@vanilla-extract/css"; } from "@vanilla-extract/css";
const colors = createThemeContract({ // const colors = createThemeContract({
brand: null, // brand: null,
brandDimmed: null, // brandDimmed: null,
brandHover: null, // brandHover: null,
brandActive: null, // brandActive: null,
brandAccent: null, // brandAccent: null,
brandAccentDimmed: null, // brandAccentDimmed: null,
brandAccentActive: null, // brandAccentActive: null,
secondary: null, // secondary: null,
secondaryDimmed: null, // secondaryDimmed: null,
secondaryHover: null, // secondaryHover: null,
secondaryActive: null, // secondaryActive: null,
secondaryAccent: null, // secondaryAccent: null,
secondaryAccentDimmed: null, // secondaryAccentDimmed: null,
secondaryAccentActive: null, // secondaryAccentActive: null,
background: null, // background: null,
backgroundAccent: null, // backgroundAccent: null,
backgroundAlt: null, // backgroundAlt: null,
backgroundAltAccent: null, // backgroundAltAccent: null,
backgroundDark: null, // backgroundDark: null,
backgroundDarkAccent: null, // backgroundDarkAccent: null,
text: { // text: {
normal: null, // normal: null,
dimmed: null, // dimmed: null,
secondary: null, // secondary: null,
secondaryDimmed: null, // secondaryDimmed: null,
accent: null, // accent: null,
accentDimmed: null, // accentDimmed: null,
}, // },
link: null, // link: null,
warning: null, // warning: null,
error: null, // error: null,
success: null, // success: null,
}); // });
const app = createGlobalTheme(":root", { const app = createGlobalTheme(":root", {
spacing: { spacing: {
@ -74,14 +74,16 @@ const app = createGlobalTheme(":root", {
Overline: ".5em", Overline: ".5em",
}, },
}, },
colors, // colors,
// 6 0degree color difference // 6 0degree color difference
// step downs
brandHue: '265', // purple brandHue: '265', // purple
secondaryHue: '205', // light blue secondaryHue: '205', // light blue
tertiaryHue: '145', // grass green tertiaryHue: '145', // grass green
errorHue: '325', // magenta // step ups
errorHue: '0', // magenta
warningHue: '25', // orange warningHue: '25', // orange
successHue: '85', // green successHue: '85', // green
@ -101,38 +103,10 @@ const app = createGlobalTheme(":root", {
backgroundMain: 'hsl(225, 6%, 13%)', backgroundMain: 'hsl(225, 6%, 13%)',
backgroundLight: 'hsl(225, 4%, 18%)', backgroundLight: 'hsl(225, 4%, 18%)',
backgroundDark: 'hsl(225, 3%, 7%)', backgroundDark: 'hsl(225, 3%, 7%)',
backgroundAccentMain: 'hsl(225, 6%, 30%)', backgroundAccentMain: 'hsl(225, 6%, 30%)',
// this is depricated
}); colors: {
export const darkTheme = createTheme(colors, {
brand: "#5000b9", // purple
brandDimmed: "#433852", // muted purple
brandHover: "#5d00d6", // bringhter purple
brandActive: "#5d00d6", // bringhter purple
brandAccent: "#28004e", // darker purple
brandAccentDimmed: "#28004e", // darker purple
brandAccentActive: "#28004e", // darker purple
secondary: "#0b8334", // green
secondaryDimmed: "#0b8334", // green
secondaryHover: "#0b8334", // green
secondaryActive: "#0b8334", // green
secondaryAccent: "#0b8334", // green
secondaryAccentDimmed: "#0b8334", // green
secondaryAccentActive: "#0b8334", // green
background: "#202124", // dark grey
backgroundAccent: " #383838", // lighter grey
backgroundAlt: "#2c2d30", // med grey
backgroundAltAccent: "#383838", // lighter grey
backgroundDark: "#121213", // darker grey
backgroundDarkAccent: "#383838", // lighter grey
text: { text: {
normal: "#ffffff", // white normal: "#ffffff", // white
dimmed: "#d1d5db", // off white dimmed: "#d1d5db", // off white
@ -143,53 +117,8 @@ export const darkTheme = createTheme(colors, {
accent: "#e7ba71", // orange accent: "#e7ba71", // orange
accentDimmed: "#7d6641", // muted orange accentDimmed: "#7d6641", // muted orange
}, },
link: "#0066cc", // blue link: "#0066cc", // blue
warning: "#f0ad4e", }
error: "#d9534f",
success: "#5cb85c",
}); });
// Generated by co-pilot export const vars = { ...app };
export const lightTheme = createTheme(colors, {
brand: "#1E40AF",
brandDimmed: "#1E40AF",
brandHover: "#1E40AF",
brandActive: "#1E40AF",
brandAccent: "#1E40AF",
brandAccentDimmed: "#1E40AF",
brandAccentActive: "#1E40AF",
secondary: "#DB2777",
secondaryDimmed: "#DB2777",
secondaryHover: "#DB2777",
secondaryActive: "#DB2777",
secondaryAccent: "#DB2777",
secondaryAccentDimmed: "#DB2777",
secondaryAccentActive: "#DB2777",
background: "#EFF6FF",
backgroundAccent: "#EFF6FF",
backgroundAlt: "#EFF6FF",
backgroundAltAccent: "#EFF6FF",
backgroundDark: "#EFF6FF",
backgroundDarkAccent: "#EFF6FF",
text: {
normal: "#1F2937",
dimmed: "#6B7280",
secondary: "#1F2937",
secondaryDimmed: "#6B7280",
accent: "#1F2937",
accentDimmed: "#6B7280",
},
link: "#0066cc", // blue
warning: "yellow",
error: "red",
success: "green",
});
export const vars = { ...app, colors };

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long