Update component props and styles for App and ViewportCanvas
This commit is contained in:
@@ -431,7 +431,7 @@ export function App({ store, initialStatusMessage }: AppProps) {
|
|||||||
</div>
|
</div>
|
||||||
<ViewportCanvas
|
<ViewportCanvas
|
||||||
world={editorState.document.world}
|
world={editorState.document.world}
|
||||||
document={editorState.document}
|
sceneDocument={editorState.document}
|
||||||
selection={editorState.selection}
|
selection={editorState.selection}
|
||||||
onBrushSelectionChange={(brushId) => handleBrushSelection(brushId, "viewport")}
|
onBrushSelectionChange={(brushId) => handleBrushSelection(brushId, "viewport")}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -227,6 +227,18 @@ button:disabled {
|
|||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.form-section {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vector-inputs {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
.placeholder-list {
|
.placeholder-list {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -244,6 +256,45 @@ button:disabled {
|
|||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.outliner-list {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.outliner-item {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 6px;
|
||||||
|
width: 100%;
|
||||||
|
padding: 12px 14px;
|
||||||
|
color: var(--color-text);
|
||||||
|
text-align: left;
|
||||||
|
background: rgba(255, 255, 255, 0.03);
|
||||||
|
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||||
|
border-radius: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.outliner-item:hover:not(:disabled) {
|
||||||
|
border-color: rgba(255, 255, 255, 0.16);
|
||||||
|
}
|
||||||
|
|
||||||
|
.outliner-item--selected {
|
||||||
|
background: var(--color-accent-soft);
|
||||||
|
border-color: rgba(207, 123, 66, 0.55);
|
||||||
|
}
|
||||||
|
|
||||||
|
.outliner-item__title {
|
||||||
|
font-size: 0.92rem;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.outliner-item__meta {
|
||||||
|
color: var(--color-muted);
|
||||||
|
font-size: 0.8rem;
|
||||||
|
}
|
||||||
|
|
||||||
.viewport-region {
|
.viewport-region {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-rows: 42px minmax(0, 1fr);
|
grid-template-rows: 42px minmax(0, 1fr);
|
||||||
@@ -279,6 +330,7 @@ button:disabled {
|
|||||||
.viewport-canvas {
|
.viewport-canvas {
|
||||||
position: relative;
|
position: relative;
|
||||||
min-height: 420px;
|
min-height: 420px;
|
||||||
|
cursor: crosshair;
|
||||||
background:
|
background:
|
||||||
radial-gradient(circle at top, rgba(130, 154, 188, 0.28) 0%, rgba(130, 154, 188, 0) 38%),
|
radial-gradient(circle at top, rgba(130, 154, 188, 0.28) 0%, rgba(130, 154, 188, 0) 38%),
|
||||||
linear-gradient(180deg, #55657c 0%, #2c3440 34%, #151920 100%);
|
linear-gradient(180deg, #55657c 0%, #2c3440 34%, #151920 100%);
|
||||||
@@ -375,6 +427,10 @@ button:disabled {
|
|||||||
min-height: 320px;
|
min-height: 320px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.vector-inputs {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
}
|
||||||
|
|
||||||
.status-bar {
|
.status-bar {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
|
|||||||
@@ -7,12 +7,12 @@ import { ViewportHost } from "./viewport-host";
|
|||||||
|
|
||||||
interface ViewportCanvasProps {
|
interface ViewportCanvasProps {
|
||||||
world: WorldSettings;
|
world: WorldSettings;
|
||||||
document: SceneDocument;
|
sceneDocument: SceneDocument;
|
||||||
selection: EditorSelection;
|
selection: EditorSelection;
|
||||||
onBrushSelectionChange(brushId: string | null): void;
|
onBrushSelectionChange(brushId: string | null): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function ViewportCanvas({ world, document, selection, onBrushSelectionChange }: ViewportCanvasProps) {
|
export function ViewportCanvas({ world, sceneDocument, selection, onBrushSelectionChange }: ViewportCanvasProps) {
|
||||||
const containerRef = useRef<HTMLDivElement | null>(null);
|
const containerRef = useRef<HTMLDivElement | null>(null);
|
||||||
const hostRef = useRef<ViewportHost | null>(null);
|
const hostRef = useRef<ViewportHost | null>(null);
|
||||||
const [viewportMessage, setViewportMessage] = useState<string | null>(null);
|
const [viewportMessage, setViewportMessage] = useState<string | null>(null);
|
||||||
@@ -57,8 +57,8 @@ export function ViewportCanvas({ world, document, selection, onBrushSelectionCha
|
|||||||
}, [world]);
|
}, [world]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
hostRef.current?.updateDocument(document, selection);
|
hostRef.current?.updateDocument(sceneDocument, selection);
|
||||||
}, [document, selection]);
|
}, [sceneDocument, selection]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
hostRef.current?.setBrushSelectionChangeHandler(onBrushSelectionChange);
|
hostRef.current?.setBrushSelectionChangeHandler(onBrushSelectionChange);
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import {
|
|||||||
Color,
|
Color,
|
||||||
DirectionalLight,
|
DirectionalLight,
|
||||||
EdgesGeometry,
|
EdgesGeometry,
|
||||||
|
GridHelper,
|
||||||
Group,
|
Group,
|
||||||
LineBasicMaterial,
|
LineBasicMaterial,
|
||||||
LineSegments,
|
LineSegments,
|
||||||
|
|||||||
Reference in New Issue
Block a user