mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-15 22:32:13 +00:00
menu be sliding
This commit is contained in:
1 parent
20d8bee85b
commit
6a85eaf268
8 files changed
+23
-22
No files matched your search
@@ -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 (
|
||||
<div className="grid grid-cols-12 gap-2 ">
|
||||
<div className="col-span-6 ">
|
||||
<div className="Cube" ref={mountRef} />
|
||||
<div className="MountingPoint" ref={mountRef} />
|
||||
</div>
|
||||
<div className="col-span-6 ">
|
||||
<Button onClick={toggleStopped}> STOP </Button>
|
||||
<p className='text-white'>{rotationX ? rotationX : ""}</p>
|
||||
<p className='text-white'>{rotationY ? rotationY : ""}</p>
|
||||
<p className='text-white'>Ration X: {rotationX ? rotationX : ""}</p>
|
||||
<p className='text-white'>Ration Y: {rotationY ? rotationY : ""}</p>
|
||||
</div>
|
||||
<SidePanel>
|
||||
<p>Side Panel Text</p>
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
+2
-2
@@ -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
|
||||
}}>
|
||||
|
||||
<div className="h-10 m-4 w-screen"/>
|
||||
<div className="h-10 m-4 w-screen border-b"/>
|
||||
<Outlet />
|
||||
<TopBar />
|
||||
</TopBarInnerContext.Provider>
|
||||
|
||||
+1
-1
@@ -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<string>("");
|
||||
const [submitted, setSubmitted] = useState<boolean>(false);
|
||||
|
||||
|
||||
@@ -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(
|
||||
<Button
|
||||
className='fixed right-0 top-20'
|
||||
onClick={handleOpen}
|
||||
>
|
||||
<FontAwesomeIcon icon={faGears} />
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
return (
|
||||
|
||||
return (<>
|
||||
<Button
|
||||
className='fixed right-0 top-20 mt-2 mr-4'
|
||||
onClick={handleOpen}
|
||||
>
|
||||
<FontAwesomeIcon icon={faGears} />
|
||||
</Button>
|
||||
<Transition.Root show={open} as={Fragment}>
|
||||
<Dialog as="div" className="relative z-10" onClose={setOpen}>
|
||||
<div className="fixed inset-0" />
|
||||
@@ -78,5 +75,5 @@ export const SidePanel =(props:SidePanelPropsI)=>{
|
||||
</div>
|
||||
</Dialog>
|
||||
</Transition.Root>
|
||||
)
|
||||
</>);
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export { SidePanel } from './SidePanel';
|
||||
File renamed without changes.
File renamed without changes.
Reference in new issue
Block a user