From 39d02b28d92ab5ffc460adf12e83fdb3558b6d5b Mon Sep 17 00:00:00 2001 From: BFlat Date: Sun, 23 Jun 2024 03:08:31 +0700 Subject: [PATCH] outliner styling fixes and responsiveness (#519) - outliner now responsive and fits the screen on resize for all views (squared, verical, horizontal) - vertical video styling bug fix others styling fixes: - login page no scrollbars --- app/pages/PageEnigma/PageEditor.tsx | 24 +++++++- .../ControlPanelSceneObject.tsx | 5 +- .../PageEnigma/comps/Outliner/Outliner.tsx | 43 ++++++++++++-- .../PreviewEngineCamera.tsx | 56 +++++++++++++++++-- app/routes/Login.tsx | 5 +- 5 files changed, 115 insertions(+), 18 deletions(-) diff --git a/app/pages/PageEnigma/PageEditor.tsx b/app/pages/PageEnigma/PageEditor.tsx index 73f401a799..a89516eeb7 100644 --- a/app/pages/PageEnigma/PageEditor.tsx +++ b/app/pages/PageEnigma/PageEditor.tsx @@ -19,11 +19,14 @@ import { dndTimelineHeight, editorLoader, sidePanelHeight, + cameraAspectRatio, + outlinerIsShowing, } from "~/pages/PageEnigma/signals"; import { EditorCanvas } from "./comps/EngineCanvases"; import { SceneContainer } from "./comps/SceneContainer"; import { AspectRatioMenu } from "./comps/AspectRatioMenu"; import { Outliner } from "./comps/Outliner"; +import { CameraAspectRatio } from "./enums"; export const PageEditor = () => { useSignals(); @@ -55,7 +58,26 @@ export const PageEditor = () => { const getScale = () => { const height = sidePanelHeight.value; - const scaleHeight = height < 640 ? height / 640 : 1; + const scaleHeight = height < 610 ? height / 610 : 1; + + if ( + cameraAspectRatio.value === CameraAspectRatio.VERTICAL_9_16 && + outlinerIsShowing.value && + height < 900 + ) { + if (pageWidth.value > 2000) { + return scaleHeight; + } + return scaleHeight * 0.78; + } + + if ( + cameraAspectRatio.value === CameraAspectRatio.SQUARE_1_1 && + pageWidth.value < 2000 + ) { + return scaleHeight * 0.85; + } + return scaleHeight; }; diff --git a/app/pages/PageEnigma/comps/ControlPanelSceneObject/ControlPanelSceneObject.tsx b/app/pages/PageEnigma/comps/ControlPanelSceneObject/ControlPanelSceneObject.tsx index 3aa43a82f7..6b2e5f4e58 100644 --- a/app/pages/PageEnigma/comps/ControlPanelSceneObject/ControlPanelSceneObject.tsx +++ b/app/pages/PageEnigma/comps/ControlPanelSceneObject/ControlPanelSceneObject.tsx @@ -215,7 +215,7 @@ export const ControlPanelSceneObject = () => { const getScale = () => { const height = sidePanelHeight.value; - return height < 660 ? height / 660 : 1; + return height < 620 ? height / 620 : 1; }; return ( @@ -236,7 +236,8 @@ export const ControlPanelSceneObject = () => {

- {currentSceneObject.object_name.charAt(0).toUpperCase() + currentSceneObject.object_name.slice(1)} + {currentSceneObject.object_name.charAt(0).toUpperCase() + + currentSceneObject.object_name.slice(1)}

{ useSignals(); @@ -29,8 +32,7 @@ const OutlinerItem = ({ item }: { item: SceneObject }) => { const isSelected = outlinerState.selectedItem.value?.id === item.id; - - const editorEngine = useContext(EngineContext) + const editorEngine = useContext(EngineContext); // Delete object logic here const handleDeleteKeyPress = (event: React.KeyboardEvent) => { @@ -69,7 +71,10 @@ const OutlinerItem = ({ item }: { item: SceneObject }) => { @@ -95,7 +139,7 @@ export const PreviewEngineCamera = () => {
-
+
diff --git a/app/routes/Login.tsx b/app/routes/Login.tsx index 4b806e3d03..4a952cd6d1 100644 --- a/app/routes/Login.tsx +++ b/app/routes/Login.tsx @@ -52,10 +52,7 @@ export default function LoginScreen() { }); return ( -
+

Login to Storyteller