mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-29 20:39:48 +08:00
re-theme ui (#349)
This commit is contained in:
1 parent
ea1de7fa2c
commit
e907bc5c71
4 files changed
+82
-22
No files matched your search
@@ -1,5 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
|
import { CssBaseline, ThemeProvider } from '@mui/material';
|
||||||
|
import { appTheme } from './themes/theme.ts';
|
||||||
import { BasicTabs } from './modules/SidePanel/SidePanel';
|
import { BasicTabs } from './modules/SidePanel/SidePanel';
|
||||||
import {
|
import {
|
||||||
SceneTreeWebSocketListener,
|
SceneTreeWebSocketListener,
|
||||||
@@ -15,20 +17,23 @@ export default function App() {
|
|||||||
const sceneTree = get_scene_tree();
|
const sceneTree = get_scene_tree();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="App">
|
<ThemeProvider theme={appTheme}>
|
||||||
{/*
|
<CssBaseline enableColorScheme />
|
||||||
|
<div className="App">
|
||||||
|
{/*
|
||||||
Code that listens for websocket 'write' messages and updates the redux store.
|
Code that listens for websocket 'write' messages and updates the redux store.
|
||||||
*/}
|
*/}
|
||||||
<SceneTreeWebSocketListener />
|
<SceneTreeWebSocketListener />
|
||||||
{/* ----- */}
|
{/* ----- */}
|
||||||
<Banner />
|
<Banner />
|
||||||
<div className="App-body">
|
<div className="App-body">
|
||||||
<div className="SidePanel">
|
<div className="SidePanel">
|
||||||
<BasicTabs sceneTree={sceneTree} />
|
<BasicTabs sceneTree={sceneTree} />
|
||||||
|
</div>
|
||||||
|
<RenderControls />
|
||||||
|
<ViewerWindow scene={sceneTree.object} />
|
||||||
</div>
|
</div>
|
||||||
<RenderControls />
|
|
||||||
<ViewerWindow scene={sceneTree.object} />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</ThemeProvider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -19,7 +19,15 @@ code {
|
|||||||
height: 100vh;
|
height: 100vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
$banner-color: #84c3ff4d;
|
$base-color1: #292d39;
|
||||||
|
$base-color2: #181c20;
|
||||||
|
$base-color3: #373c4b;
|
||||||
|
$accent-color1: #db5200;
|
||||||
|
$accent-color2: #ff8600;
|
||||||
|
$accent-color3: #ffd65c;
|
||||||
|
$highlight-color1: #606980;
|
||||||
|
$highlight-color2: #d1d4db;
|
||||||
|
$highlight-color3: #ffffff;
|
||||||
|
|
||||||
.banner {
|
.banner {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@@ -29,7 +37,7 @@ $banner-color: #84c3ff4d;
|
|||||||
height: 50px;
|
height: 50px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
z-index: 1000;
|
z-index: 1000;
|
||||||
background-color: $banner-color;
|
background-color: $base-color2;
|
||||||
|
|
||||||
.banner-button {
|
.banner-button {
|
||||||
margin: 10px;
|
margin: 10px;
|
||||||
@@ -45,12 +53,13 @@ $banner-color: #84c3ff4d;
|
|||||||
bottom: 0;
|
bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$SidePanel-width: 500px;
|
$SidePanel-width: 400px;
|
||||||
$custom-border: solid 1px #ddd;
|
$custom-border: solid 1px $base-color1;
|
||||||
|
|
||||||
.SidePanel {
|
.SidePanel {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
background-color: #f0f0f080;
|
background-color: $base-color2;
|
||||||
|
color: $highlight-color2;
|
||||||
top: 0;
|
top: 0;
|
||||||
width: $SidePanel-width;
|
width: $SidePanel-width;
|
||||||
right: 0;
|
right: 0;
|
||||||
@@ -67,6 +76,10 @@ $custom-border: solid 1px #ddd;
|
|||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.simple-tabpanel-0 {
|
||||||
|
padding: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
.Scene-container {
|
.Scene-container {
|
||||||
height: 500px;
|
height: 500px;
|
||||||
}
|
}
|
||||||
@@ -101,7 +114,7 @@ $sidebar-width: 100% !default;
|
|||||||
}
|
}
|
||||||
|
|
||||||
.StatusPanel-metrics {
|
.StatusPanel-metrics {
|
||||||
background-color: $banner-color;
|
background-color: $base-color1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.StatusPanel-metrics div {
|
.StatusPanel-metrics div {
|
||||||
@@ -117,15 +130,13 @@ $sidebar-width: 100% !default;
|
|||||||
// display: block;
|
// display: block;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
$background-paper-color: #fff;
|
|
||||||
|
|
||||||
.LandingModal-box {
|
.LandingModal-box {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
transform: translate(-50%, -50%);
|
transform: translate(-50%, -50%);
|
||||||
width: 400px; // 400
|
width: 400px; // 400
|
||||||
background-color: $background-paper-color;
|
background-color: $base-color2;
|
||||||
border: 2px solid #000;
|
border: 2px solid #000;
|
||||||
// box-shadow: 24px 24px;
|
// box-shadow: 24px 24px;
|
||||||
padding: 32px;
|
padding: 32px;
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ function TabPanel(props: TabPanelProps) {
|
|||||||
{...other}
|
{...other}
|
||||||
>
|
>
|
||||||
{value === index && (
|
{value === index && (
|
||||||
<Box sx={{ p: 3 }}>
|
<Box sx={{ p: 3, padding: 0 }}>
|
||||||
<Typography component="div">{children}</Typography>
|
<Typography component="div">{children}</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
)}
|
)}
|
||||||
@@ -146,7 +146,13 @@ export function BasicTabs(props: BasicTabsProps) {
|
|||||||
</Box>
|
</Box>
|
||||||
<TabPanel value={value} index={0}>
|
<TabPanel value={value} index={0}>
|
||||||
<div className="Leva-container">
|
<div className="Leva-container">
|
||||||
<Leva className="Leva-panel" theme={LevaTheme} titleBar={false} />
|
<Leva
|
||||||
|
className="Leva-panel"
|
||||||
|
theme={LevaTheme}
|
||||||
|
titleBar={false}
|
||||||
|
fill
|
||||||
|
flat
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
<TabPanel value={value} index={1}>
|
<TabPanel value={value} index={1}>
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
import { createTheme } from '@mui/material/styles';
|
||||||
|
|
||||||
|
export const appTheme = createTheme({
|
||||||
|
palette: {
|
||||||
|
primary: { main: '#d1d4db' },
|
||||||
|
secondary: { main: '#ffd65c' },
|
||||||
|
text: {
|
||||||
|
primary: '#d1d4db',
|
||||||
|
secondary: '#ff8600',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
MuiTextField: {
|
||||||
|
styleOverrides: {
|
||||||
|
root: {
|
||||||
|
'& label': {
|
||||||
|
color: '#606980',
|
||||||
|
},
|
||||||
|
'& label.Mui-focused': {
|
||||||
|
color: '#ff8600',
|
||||||
|
},
|
||||||
|
'& .MuiOutlinedInput-root': {
|
||||||
|
'& fieldset': {
|
||||||
|
borderColor: '#373c4b',
|
||||||
|
},
|
||||||
|
'&:hover fieldset': {
|
||||||
|
borderColor: '#606980',
|
||||||
|
borderWidth: '0.15rem',
|
||||||
|
},
|
||||||
|
'&.Mui-focused fieldset': {
|
||||||
|
borderColor: '#ff8600',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
Reference in new issue
Block a user