mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-06 15:59:16 +08:00
Prettified Code!
This commit is contained in:
1 parent
825c8e7d29
commit
94a5479287
2 files changed
+40
-21
No files matched your search
@@ -142,7 +142,8 @@ function CameraList(props) {
|
|||||||
Camera {index}
|
Camera {index}
|
||||||
</Button>
|
</Button>
|
||||||
<div className="CameraList-row-buttons">
|
<div className="CameraList-row-buttons">
|
||||||
<Button size="small"
|
<Button
|
||||||
|
size="small"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
set_camera_position(camera_main, camera.matrix);
|
set_camera_position(camera_main, camera.matrix);
|
||||||
}}
|
}}
|
||||||
@@ -504,7 +505,8 @@ export default function CameraPanel(props) {
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
<div className="CameraPanel-top-button">
|
<div className="CameraPanel-top-button">
|
||||||
<Button size="small"
|
<Button
|
||||||
|
size="small"
|
||||||
className="CameraPanel-top-button"
|
className="CameraPanel-top-button"
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
onClick={export_camera_path}
|
onClick={export_camera_path}
|
||||||
@@ -524,7 +526,8 @@ export default function CameraPanel(props) {
|
|||||||
<div className="CameraPanel-top-button">
|
<div className="CameraPanel-top-button">
|
||||||
<Tooltip className="curve-button" title="Close/Open camera spline">
|
<Tooltip className="curve-button" title="Close/Open camera spline">
|
||||||
{!is_cycle ? (
|
{!is_cycle ? (
|
||||||
<Button size="small"
|
<Button
|
||||||
|
size="small"
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setIsCycle(true);
|
setIsCycle(true);
|
||||||
@@ -533,7 +536,8 @@ export default function CameraPanel(props) {
|
|||||||
<GestureOutlined />
|
<GestureOutlined />
|
||||||
</Button>
|
</Button>
|
||||||
) : (
|
) : (
|
||||||
<Button size="small"
|
<Button
|
||||||
|
size="small"
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setIsCycle(false);
|
setIsCycle(false);
|
||||||
@@ -547,7 +551,8 @@ export default function CameraPanel(props) {
|
|||||||
<div className="CameraPanel-top-button">
|
<div className="CameraPanel-top-button">
|
||||||
<Tooltip title="Non-linear/Linear camera speed">
|
<Tooltip title="Non-linear/Linear camera speed">
|
||||||
{!is_linear ? (
|
{!is_linear ? (
|
||||||
<Button size="small"
|
<Button
|
||||||
|
size="small"
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setIsLinear(true);
|
setIsLinear(true);
|
||||||
@@ -556,7 +561,8 @@ export default function CameraPanel(props) {
|
|||||||
<LinearScaleOutlined />
|
<LinearScaleOutlined />
|
||||||
</Button>
|
</Button>
|
||||||
) : (
|
) : (
|
||||||
<Button size="small"
|
<Button
|
||||||
|
size="small"
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setIsLinear(false);
|
setIsLinear(false);
|
||||||
@@ -568,7 +574,10 @@ export default function CameraPanel(props) {
|
|||||||
</Tooltip>
|
</Tooltip>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="CameraPanel-slider-container" style={{marginTop: "5px"}}>
|
<div
|
||||||
|
className="CameraPanel-slider-container"
|
||||||
|
style={{ marginTop: '5px' }}
|
||||||
|
>
|
||||||
<Stack spacing={2} direction="row" sx={{ mb: 1 }} alignItems="center">
|
<Stack spacing={2} direction="row" sx={{ mb: 1 }} alignItems="center">
|
||||||
<p style={{ fontSize: 'smaller', color: '#999999' }}>Smoothness</p>
|
<p style={{ fontSize: 'smaller', color: '#999999' }}>Smoothness</p>
|
||||||
<ChangeHistory />
|
<ChangeHistory />
|
||||||
@@ -601,7 +610,8 @@ export default function CameraPanel(props) {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="CameraPanel-slider-button-container">
|
<div className="CameraPanel-slider-button-container">
|
||||||
<Button size="small"
|
<Button
|
||||||
|
size="small"
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setIsPlaying(false);
|
setIsPlaying(false);
|
||||||
@@ -610,7 +620,8 @@ export default function CameraPanel(props) {
|
|||||||
>
|
>
|
||||||
<FirstPageIcon />
|
<FirstPageIcon />
|
||||||
</Button>
|
</Button>
|
||||||
<Button size="small"
|
<Button
|
||||||
|
size="small"
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
onClick={() => set_slider_value(slider_value - step_size)}
|
onClick={() => set_slider_value(slider_value - step_size)}
|
||||||
>
|
>
|
||||||
@@ -618,7 +629,8 @@ export default function CameraPanel(props) {
|
|||||||
</Button>
|
</Button>
|
||||||
{/* eslint-disable-next-line no-nested-ternary */}
|
{/* eslint-disable-next-line no-nested-ternary */}
|
||||||
{!is_playing && slider_max === slider_value ? (
|
{!is_playing && slider_max === slider_value ? (
|
||||||
<Button size="small"
|
<Button
|
||||||
|
size="small"
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
set_slider_value(slider_min);
|
set_slider_value(slider_min);
|
||||||
@@ -627,7 +639,8 @@ export default function CameraPanel(props) {
|
|||||||
<Replay />
|
<Replay />
|
||||||
</Button>
|
</Button>
|
||||||
) : !is_playing ? (
|
) : !is_playing ? (
|
||||||
<Button size="small"
|
<Button
|
||||||
|
size="small"
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (cameras.length > 1) {
|
if (cameras.length > 1) {
|
||||||
@@ -638,7 +651,8 @@ export default function CameraPanel(props) {
|
|||||||
<PlayArrowIcon />
|
<PlayArrowIcon />
|
||||||
</Button>
|
</Button>
|
||||||
) : (
|
) : (
|
||||||
<Button size="small"
|
<Button
|
||||||
|
size="small"
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setIsPlaying(false);
|
setIsPlaying(false);
|
||||||
@@ -647,13 +661,18 @@ export default function CameraPanel(props) {
|
|||||||
<PauseIcon />
|
<PauseIcon />
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
<Button size="small"
|
<Button
|
||||||
|
size="small"
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
onClick={() => set_slider_value(slider_value + step_size)}
|
onClick={() => set_slider_value(slider_value + step_size)}
|
||||||
>
|
>
|
||||||
<ArrowForwardIosIcon />
|
<ArrowForwardIosIcon />
|
||||||
</Button>
|
</Button>
|
||||||
<Button size="small" variant="outlined" onClick={() => set_slider_value(slider_max)}>
|
<Button
|
||||||
|
size="small"
|
||||||
|
variant="outlined"
|
||||||
|
onClick={() => set_slider_value(slider_max)}
|
||||||
|
>
|
||||||
<LastPageIcon />
|
<LastPageIcon />
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -43,14 +43,14 @@ export default function StatusPanel(props: StatusPanelProps) {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const labels = document.getElementsByClassName('label');
|
const labels = document.getElementsByClassName('label');
|
||||||
for(let i =0; i < labels.length; i+=1) {
|
for (let i = 0; i < labels.length; i += 1) {
|
||||||
if(!value){
|
if (!value) {
|
||||||
labels[i].style.visibility = 'hidden';
|
labels[i].style.visibility = 'hidden';
|
||||||
} else {
|
} else {
|
||||||
labels[i].style.visibility = 'visible';
|
labels[i].style.visibility = 'visible';
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}, [value])
|
}
|
||||||
|
}, [value]);
|
||||||
|
|
||||||
const handlePlayChange = () => {
|
const handlePlayChange = () => {
|
||||||
dispatch({
|
dispatch({
|
||||||
|
|||||||
Reference in new issue
Block a user