Update camera panel ui (#388)

Update camera panel up
This commit is contained in:
Matthew Tancik authored and GitHub committed 2022-09-10 17:18:31 -07:00
1 parent f34a27511f
commit bd5967461d
4 files changed
+93 -44

No files matched your search

+3 -5
View File
@@ -234,7 +234,7 @@ $sidebar-width: 100% !default;
object-fit: fill; object-fit: fill;
} }
$viewer_button_size: 100px; $viewer_button_size: 50px;
.ViewerWindow-buttons { .ViewerWindow-buttons {
position: absolute; position: absolute;
@@ -243,11 +243,9 @@ $viewer_button_size: 100px;
right: $SidePanel-width; right: $SidePanel-width;
z-index: 1000; z-index: 1000;
width: $viewer_button_size; width: $viewer_button_size;
background-color: $base-color1; // background-color: $base-color1;
} }
.ViewerWindow-iconbutton { .ViewerWindow-iconbutton {
border: solid 1px red; margin-top: 5px;
width: 100%;
height: $viewer_button_size;
} }
@@ -225,6 +225,7 @@ export default function CameraPanel(props) {
value={slider_value} value={slider_value}
step={step_size} step={step_size}
valueLabelDisplay="on" valueLabelDisplay="on"
valueLabelFormat={slider_value.toFixed(2)}
marks={marks} marks={marks}
min={slider_min} min={slider_min}
max={slider_max} max={slider_max}
@@ -282,18 +283,35 @@ export default function CameraPanel(props) {
</div> </div>
<div className="CameraList-row-time-interval"> <div className="CameraList-row-time-interval">
<TextField <TextField
id="outlined-number"
label="Seconds" label="Seconds"
type="number" inputProps={{
onChange={(e) => setSeconds(Math.max(1, e.target.value))} inputMode: 'numeric',
pattern: '[+-]?([0-9]*[.])?[0-9]+',
}}
size="small"
onChange={(e) => {
if (e.target.validity.valid) {
setSeconds(e.target.value);
}
}}
value={seconds} value={seconds}
error={seconds <= 0}
helperText={seconds <= 0 ? 'Required' : ''}
variant="standard"
/> />
<TextField <TextField
id="outlined-number"
label="FPS" label="FPS"
type="number" inputProps={{ inputMode: 'numeric', pattern: '[0-9]*' }}
onChange={(e) => setFps(Math.max(1, e.target.value))} size="small"
onChange={(e) => {
if (e.target.validity.valid) {
setFps(e.target.value);
}
}}
value={fps} value={fps}
error={fps <= 0}
helperText={fps <= 0 ? 'Required' : ''}
variant="standard"
/> />
</div> </div>
<div className="CameraList-container"> <div className="CameraList-container">
@@ -2,7 +2,7 @@ import * as THREE from 'three';
import React, { useContext, useEffect, useRef } from 'react'; import React, { useContext, useEffect, useRef } from 'react';
import { Button } from '@mui/material'; import { IconButton } from '@mui/material';
import OpenWithIcon from '@mui/icons-material/OpenWith'; import OpenWithIcon from '@mui/icons-material/OpenWith';
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls'; import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls';
import PublicOffSharpIcon from '@mui/icons-material/PublicOffSharp'; import PublicOffSharpIcon from '@mui/icons-material/PublicOffSharp';
@@ -38,33 +38,33 @@ function TransformIcons(props) {
return ( return (
<div> <div>
<Button <div className="ViewerWindow-iconbutton">
className="ViewerWindow-iconbutton" <IconButton
onClick={() => { size="large"
transform_controls.setMode('translate'); onClick={() => {
}} transform_controls.setMode('translate');
variant="outlined" }}
> >
{/* translate */} {/* translate */}
<OpenWithIcon /> <OpenWithIcon />
</Button> </IconButton>
<Button </div>
className="ViewerWindow-iconbutton" <div className="ViewerWindow-iconbutton">
onClick={() => { <IconButton
transform_controls.setMode('rotate'); size="large"
}} onClick={() => {
variant="outlined" transform_controls.setMode('rotate');
> }}
{/* rotate */} >
<SyncOutlinedIcon /> {/* rotate */}
</Button> <SyncOutlinedIcon />
<Button </IconButton>
className="ViewerWindow-iconbutton" </div>
variant="outlined" <div className="ViewerWindow-iconbutton">
onClick={toggleLocal} <IconButton size="large" onClick={toggleLocal}>
> {world ? <PublicSharpIcon /> : <PublicOffSharpIcon />}
{world ? <PublicSharpIcon /> : <PublicOffSharpIcon />} </IconButton>
</Button> </div>
</div> </div>
); );
} }
+38 -5
View File
@@ -33,12 +33,10 @@ export const appTheme = createTheme({
}, },
}, },
}, },
MuiButtonBase: {
defaultProps: {
disableRipple: true, // No more ripple, on the whole application 💣!
},
},
MuiButton: { MuiButton: {
defaultProps: {
disableRipple: true,
},
styleOverrides: { styleOverrides: {
root: { root: {
'&.Mui-disabled': { '&.Mui-disabled': {
@@ -48,6 +46,19 @@ export const appTheme = createTheme({
}, },
}, },
}, },
MuiIconButton: {
styleOverrides: {
root: {
color: '#eeeeee',
backgroundColor: '#393e46',
'&:hover': {
color: '#FFD369',
backgroundColor: '#555555',
},
},
},
},
MuiTab: { MuiTab: {
styleOverrides: { styleOverrides: {
root: { root: {
@@ -62,5 +73,27 @@ export const appTheme = createTheme({
}, },
}, },
}, },
MuiFilledInput: {
styleOverrides: {
root: {
backgroundColor: '#393e46',
'&:hover': {
backgroundColor: '#555555',
},
},
},
},
MuiInput: {
styleOverrides: {
root: {
'&:before': {
borderBottom: '2px solid #555555',
},
'&:after': {
borderBottom: '2px solid #FFD369',
},
},
},
},
}, },
}); });