mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-06-24 11:51:26 +02:00
using vanilla extract for main and app
This commit is contained in:
parent
6afd4b0dc7
commit
8a354e6187
690
ui/frontend/build_src/package-lock.json
generated
690
ui/frontend/build_src/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -12,6 +12,8 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tanstack/react-query": "^4.2.3",
|
"@tanstack/react-query": "^4.2.3",
|
||||||
"@tanstack/react-query-devtools": "^4.2.3",
|
"@tanstack/react-query-devtools": "^4.2.3",
|
||||||
|
"@vanilla-extract/css": "^1.9.0",
|
||||||
|
"@vanilla-extract/vite-plugin": "^3.5.0",
|
||||||
"immer": "^9.0.15",
|
"immer": "^9.0.15",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
@ -26,5 +28,10 @@
|
|||||||
"prettier": "^2.7.1",
|
"prettier": "^2.7.1",
|
||||||
"typescript": "^4.6.4",
|
"typescript": "^4.6.4",
|
||||||
"vite": "^3.0.7"
|
"vite": "^3.0.7"
|
||||||
|
},
|
||||||
|
"overrides": {
|
||||||
|
"@vanilla-extract/vite-plugin": {
|
||||||
|
"vite": "^3"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,18 +1,3 @@
|
|||||||
.App {
|
|
||||||
position: relative;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
pointer-events: auto;
|
|
||||||
display: grid;
|
|
||||||
background-color: rgb(32, 33, 36);
|
|
||||||
grid-template-columns: 360px 1fr;
|
|
||||||
grid-template-rows: 100px 1fr 300px;
|
|
||||||
grid-template-areas:
|
|
||||||
"header header header"
|
|
||||||
"create display display"
|
|
||||||
"footer footer footer";
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Very basic mobile stacked UI*/
|
/* Very basic mobile stacked UI*/
|
||||||
@media screen and (max-width: 768px) {
|
@media screen and (max-width: 768px) {
|
||||||
.App {
|
.App {
|
||||||
|
@ -1,5 +1,14 @@
|
|||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import "./App.css";
|
|
||||||
|
|
||||||
|
import {
|
||||||
|
AppLayout,
|
||||||
|
HeaderLayout,
|
||||||
|
CreateLayout,
|
||||||
|
DisplayLayout,
|
||||||
|
FooterLayout
|
||||||
|
}
|
||||||
|
from './app.css.ts';
|
||||||
|
|
||||||
import { useQuery } from "@tanstack/react-query";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
import { getSaveDirectory } from "./api";
|
import { getSaveDirectory } from "./api";
|
||||||
@ -22,17 +31,17 @@ function App() {
|
|||||||
}, [setRequestOption, status, data]);
|
}, [setRequestOption, status, data]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="App">
|
<div className={AppLayout}>
|
||||||
<header className="header-layout">
|
<header className={HeaderLayout}>
|
||||||
<HeaderDisplay></HeaderDisplay>
|
<HeaderDisplay></HeaderDisplay>
|
||||||
</header>
|
</header>
|
||||||
<nav className="create-layout">
|
<nav className={CreateLayout}>
|
||||||
<CreationPanel></CreationPanel>
|
<CreationPanel></CreationPanel>
|
||||||
</nav>
|
</nav>
|
||||||
<main className="display-layout">
|
<main className={DisplayLayout}>
|
||||||
<DisplayPanel></DisplayPanel>
|
<DisplayPanel></DisplayPanel>
|
||||||
</main>
|
</main>
|
||||||
<footer className="footer-layout">
|
<footer className={FooterLayout}>
|
||||||
<FooterDisplay></FooterDisplay>
|
<FooterDisplay></FooterDisplay>
|
||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
|
33
ui/frontend/build_src/src/app.css.ts
Normal file
33
ui/frontend/build_src/src/app.css.ts
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
import { style } from '@vanilla-extract/css';
|
||||||
|
|
||||||
|
export const AppLayout = style({
|
||||||
|
position: 'relative',
|
||||||
|
width: '100%',
|
||||||
|
height: '100%',
|
||||||
|
pointerEvents: 'auto',
|
||||||
|
display: 'grid',
|
||||||
|
backgroundColor: 'rgb(32, 33, 36)',
|
||||||
|
gridTemplateColumns: '360px 1fr',
|
||||||
|
gridTemplateRows: '100px 1fr 50px',
|
||||||
|
gridTemplateAreas: `
|
||||||
|
"header header header"
|
||||||
|
"create display display"
|
||||||
|
"footer footer footer"
|
||||||
|
`,
|
||||||
|
});
|
||||||
|
|
||||||
|
export const HeaderLayout = style({
|
||||||
|
gridArea: 'header',
|
||||||
|
});
|
||||||
|
|
||||||
|
export const CreateLayout = style({
|
||||||
|
gridArea: 'create',
|
||||||
|
});
|
||||||
|
|
||||||
|
export const DisplayLayout = style({
|
||||||
|
gridArea: 'display',
|
||||||
|
});
|
||||||
|
|
||||||
|
export const FooterLayout = style({
|
||||||
|
gridArea: 'footer',
|
||||||
|
});
|
@ -1,13 +0,0 @@
|
|||||||
body {
|
|
||||||
margin: 0;
|
|
||||||
min-width: 320px;
|
|
||||||
min-height: 100vh;
|
|
||||||
}
|
|
||||||
|
|
||||||
#root {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100vw;
|
|
||||||
height: 100vh;
|
|
||||||
}
|
|
@ -7,7 +7,9 @@ import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
|
|||||||
|
|
||||||
import { enableMapSet } from "immer";
|
import { enableMapSet } from "immer";
|
||||||
import App from "./App";
|
import App from "./App";
|
||||||
import "./index.css";
|
|
||||||
|
import './styles.css.ts';
|
||||||
|
|
||||||
|
|
||||||
const queryClient = new QueryClient({
|
const queryClient = new QueryClient({
|
||||||
defaultOptions: {
|
defaultOptions: {
|
||||||
|
17
ui/frontend/build_src/src/styles.css.ts
Normal file
17
ui/frontend/build_src/src/styles.css.ts
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
|
||||||
|
import { globalStyle } from '@vanilla-extract/css';
|
||||||
|
|
||||||
|
globalStyle('body', {
|
||||||
|
margin: 0,
|
||||||
|
minWidth: '320px',
|
||||||
|
minHeight: '100vh',
|
||||||
|
});
|
||||||
|
|
||||||
|
globalStyle('#root', {
|
||||||
|
position: 'absolute',
|
||||||
|
top: 0,
|
||||||
|
left: 0,
|
||||||
|
width: '100vw',
|
||||||
|
height: '100vh',
|
||||||
|
});
|
||||||
|
|
@ -1,12 +1,20 @@
|
|||||||
import { defineConfig } from "vite";
|
import { defineConfig } from "vite";
|
||||||
import react from "@vitejs/plugin-react";
|
import react from "@vitejs/plugin-react";
|
||||||
|
import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin';
|
||||||
|
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [react()],
|
plugins: [
|
||||||
|
react(),
|
||||||
|
vanillaExtractPlugin({
|
||||||
|
// configuration
|
||||||
|
})
|
||||||
|
],
|
||||||
server: {
|
server: {
|
||||||
port: 9001,
|
port: 9001,
|
||||||
},
|
},
|
||||||
|
|
||||||
build: {
|
build: {
|
||||||
// make sure everythign is in the same directory
|
// make sure everythign is in the same directory
|
||||||
outDir: "../dist",
|
outDir: "../dist",
|
||||||
@ -18,6 +26,7 @@ export default defineConfig({
|
|||||||
chunkFileNames: `[name].js`,
|
chunkFileNames: `[name].js`,
|
||||||
assetFileNames: `[name].[ext]`,
|
assetFileNames: `[name].[ext]`,
|
||||||
},
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user