From 932ab5463115ba6cb3d88c2742156a8bad2cf6f7 Mon Sep 17 00:00:00 2001 From: Nalvazhuthi Date: Wed, 26 Mar 2025 10:03:43 +0530 Subject: [PATCH] added 2d 3d view --- app/src/components/ui/Tools.tsx | 211 +++++++++++++++----------------- 1 file changed, 97 insertions(+), 114 deletions(-) diff --git a/app/src/components/ui/Tools.tsx b/app/src/components/ui/Tools.tsx index 64a5ade..7f66584 100644 --- a/app/src/components/ui/Tools.tsx +++ b/app/src/components/ui/Tools.tsx @@ -78,80 +78,76 @@ const Tools: React.FC = () => { return (
- {!isPlaying && ( -
-
- {activeSubTool == "cursor" && ( -
+
+ {activeSubTool == "cursor" && ( +
{ - setActiveTool("cursor"); - }} - > - -
- )} - {activeSubTool == "free-hand" && ( -
{ + setActiveTool("cursor"); + }} + > + +
+ )} + {activeSubTool == "free-hand" && ( +
{ - setActiveTool("free-hand"); - }} - > - -
- )} - {activeModule !== "visualization" && ( -
{ - setOpenDrop(!openDrop); - console.log(openDrop); - }} - > - - {openDrop && ( -
-
{ - setOpenDrop(false); - setActiveTool("cursor"); - setActiveSubTool("cursor"); - }} - > -
- {activeSubTool === "cursor" && } -
- -
Cursor
-
-
{ - setOpenDrop(false); - setActiveTool("free-hand"); - setActiveSubTool("free-hand"); - }} - > -
- {activeSubTool === "free-hand" && } -
- -
Free Hand
+ onClick={() => { + setActiveTool("free-hand"); + }} + > + +
+ )} + {activeModule !== "visualization" && ( +
{ + setOpenDrop(!openDrop); + console.log(openDrop); + }} + > + + {openDrop && ( +
+
{ + setOpenDrop(false); + setActiveTool("cursor"); + setActiveSubTool("cursor"); + }} + > +
+ {activeSubTool === "cursor" && }
+ +
Cursor
- )} -
- )} -
+
{ + setOpenDrop(false); + setActiveTool("free-hand"); + setActiveSubTool("free-hand"); + }} + > +
+ {activeSubTool === "free-hand" && } +
+ +
Free Hand
+
+
+ )} +
+ )}
- )} +
{!toggleThreeD && activeModule === "builder" && ( <>
@@ -210,7 +206,7 @@ const Tools: React.FC = () => {
)} - {activeModule === "visualization" && !isPlaying && ( + {activeModule === "visualization" && ( <>
@@ -229,51 +225,38 @@ const Tools: React.FC = () => {
)} - {!isPlaying && ( - <> -
-
-
{ - setActiveTool("comment"); - }} - > - -
-
{ - setActiveTool("play"); - setIsPlaying(!isPlaying); - }} - > - -
-
-
-
{ - setToggleThreeD(!toggleThreeD); - }} - > -
- 2d -
-
- 3d -
-
- - )} - {isPlaying && ( -
setIsPlaying(false)}> - X +
+
+
{ + setActiveTool("comment"); + }} + > +
- )} +
{ + setActiveTool("play"); + setIsPlaying(!isPlaying); + }} + > + +
+
+
+
+
+ 2d +
+
+ 3d +
+
); };