From 6a85eaf26894c5cb54fe728f82c43bbebced328b Mon Sep 17 00:00:00 2001 From: dev Date: Thu, 21 Mar 2024 18:42:22 -0400 Subject: [PATCH] menu be sliding --- app/pages/PageCube/PageCube.tsx | 13 +++++++---- app/pages/PageEnigma/PageEnigma.tsx | 2 +- app/root.tsx | 4 ++-- app/routes/Cube.tsx | 2 +- .../SidePanel}/SidePanel.tsx | 23 ++++++++----------- app/templates/SidePanel/index.tsx | 1 + app/{template => templates}/TopBar/TopBar.tsx | 0 app/{template => templates}/TopBar/index.tsx | 0 8 files changed, 23 insertions(+), 22 deletions(-) rename app/{pages/PageEnigma/comp => templates/SidePanel}/SidePanel.tsx (92%) create mode 100644 app/templates/SidePanel/index.tsx rename app/{template => templates}/TopBar/TopBar.tsx (100%) rename app/{template => templates}/TopBar/index.tsx (100%) diff --git a/app/pages/PageCube/PageCube.tsx b/app/pages/PageCube/PageCube.tsx index fc0a60153d..0ff62d3fb6 100644 --- a/app/pages/PageCube/PageCube.tsx +++ b/app/pages/PageCube/PageCube.tsx @@ -15,7 +15,7 @@ import { Button } from '~/components/Button'; import { ButtonLink } from '~/components/ButtonLink'; import { TopBarInnerContext } from "~/contexts/TopBarInner"; -import { SidePanel } from '../PageEnigma/comp/SidePanel'; +import { SidePanel } from '~/templates/SidePanel'; import { SceneWithCube } from './SceneWithCube'; @@ -42,7 +42,10 @@ export const PageCube = () => { const listeningXYRotation = useCallback(( {x,y}:{x:number;y:number} )=>{ - setRotations({x:x, y:y}) + setRotations({ + x:Math.round(x*100)/100, + y:Math.round(y*100)/100, + }) },[]); useEffect(() => { //componentDidMount @@ -78,12 +81,12 @@ export const PageCube = () => { return (
-
+
-

{rotationX ? rotationX : ""}

-

{rotationY ? rotationY : ""}

+

Ration X: {rotationX ? rotationX : ""}

+

Ration Y: {rotationY ? rotationY : ""}

Side Panel Text

diff --git a/app/pages/PageEnigma/PageEnigma.tsx b/app/pages/PageEnigma/PageEnigma.tsx index fda7672046..e939461d13 100644 --- a/app/pages/PageEnigma/PageEnigma.tsx +++ b/app/pages/PageEnigma/PageEnigma.tsx @@ -16,7 +16,7 @@ import { import { Button } from '~/components/Button'; import { ButtonLink } from '~/components/ButtonLink'; import { TopBarInnerContext } from "~/contexts/TopBarInner"; -import { SidePanel } from './comp/SidePanel'; +import { SidePanel } from '~/templates/SidePanel'; import Editor from './js/editor'; diff --git a/app/root.tsx b/app/root.tsx index f13544a5e4..04637c4c01 100644 --- a/app/root.tsx +++ b/app/root.tsx @@ -11,7 +11,7 @@ import { import tailwindCss from "./styles/tailwind.css?url"; import normalizeCss from "./styles/normalize.css?url"; -import { TopBar } from "./template/TopBar"; +import { TopBar } from "./templates/TopBar"; import { TopBarInnerContext } from '~/contexts/TopBarInner'; @@ -40,7 +40,7 @@ export default function App() { setTopBarInner: setTopBarInnerComponent }}> -
+
diff --git a/app/routes/Cube.tsx b/app/routes/Cube.tsx index 0431699d12..909c2f0521 100644 --- a/app/routes/Cube.tsx +++ b/app/routes/Cube.tsx @@ -2,7 +2,7 @@ import { useState } from 'react'; import { PageCube } from "../pages/PageCube"; import { Button } from '~/components/Button'; export default function Cube(){ - const pausedRiddle = false; + const pausedRiddle = true; const [riddle, setRiddle] = useState(""); const [submitted, setSubmitted] = useState(false); diff --git a/app/pages/PageEnigma/comp/SidePanel.tsx b/app/templates/SidePanel/SidePanel.tsx similarity index 92% rename from app/pages/PageEnigma/comp/SidePanel.tsx rename to app/templates/SidePanel/SidePanel.tsx index d5eed1700a..1fadde6c32 100644 --- a/app/pages/PageEnigma/comp/SidePanel.tsx +++ b/app/templates/SidePanel/SidePanel.tsx @@ -12,21 +12,18 @@ interface SidePanelPropsI{ } export const SidePanel =(props:SidePanelPropsI)=>{ - const [open, setOpen] = useState(true) + const [open, setOpen] = useState(false) const handleOpen = ()=>{ setOpen(true); } - if(!open){ - return( - - ); - } - return ( + + return (<> +
@@ -78,5 +75,5 @@ export const SidePanel =(props:SidePanelPropsI)=>{
- ) + ); } \ No newline at end of file diff --git a/app/templates/SidePanel/index.tsx b/app/templates/SidePanel/index.tsx new file mode 100644 index 0000000000..a48bbce375 --- /dev/null +++ b/app/templates/SidePanel/index.tsx @@ -0,0 +1 @@ +export { SidePanel } from './SidePanel'; \ No newline at end of file diff --git a/app/template/TopBar/TopBar.tsx b/app/templates/TopBar/TopBar.tsx similarity index 100% rename from app/template/TopBar/TopBar.tsx rename to app/templates/TopBar/TopBar.tsx diff --git a/app/template/TopBar/index.tsx b/app/templates/TopBar/index.tsx similarity index 100% rename from app/template/TopBar/index.tsx rename to app/templates/TopBar/index.tsx