-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add buttons bar with all the controls
- Loading branch information
1 parent
6e2fed1
commit 14cd5e8
Showing
2 changed files
with
78 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
applications/visualizer/frontend/src/components/viewers/EM/SceneControls.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import { | ||
FileDownloadOutlined, | ||
HomeOutlined, | ||
TextsmsOutlined | ||
} from "@mui/icons-material"; | ||
import ZoomInIcon from "@mui/icons-material/ZoomIn"; | ||
import ZoomOutIcon from "@mui/icons-material/ZoomOut"; | ||
import { Box, Divider, IconButton } from "@mui/material"; | ||
import Tooltip from "@mui/material/Tooltip"; | ||
|
||
function SceneControls({ cameraControlRef }) { | ||
return ( | ||
<Box | ||
sx={{ | ||
display: "flex", | ||
flexDirection: "column", | ||
gap: ".25rem", | ||
position: "absolute", | ||
top: ".5rem", | ||
left: ".5rem", | ||
backgroundColor: "#fff", | ||
borderRadius: "0.5rem", | ||
border: "1px solid #ECECE9", | ||
boxShadow: "0px 1px 2px 0px rgba(16, 24, 40, 0.05)", | ||
padding: "0.25rem", | ||
}} | ||
> | ||
<Tooltip title="Zoom in" placement="right-start"> | ||
<IconButton | ||
onClick={() => { | ||
cameraControlRef.current?.zoom(cameraControlRef.current?._camera.zoom / 2, true); | ||
}} | ||
> | ||
<ZoomInIcon /> | ||
</IconButton> | ||
</Tooltip> | ||
<Tooltip title="Reset to original size and position" placement="right-start"> | ||
<IconButton | ||
onClick={() => { | ||
cameraControlRef.current?.reset(true); | ||
}} | ||
> | ||
<HomeOutlined /> | ||
</IconButton> | ||
</Tooltip> | ||
<Tooltip title="Zoom out" placement="right-start"> | ||
<IconButton | ||
onClick={() => { | ||
cameraControlRef.current?.zoom(-cameraControlRef.current?._camera.zoom / 2, true); | ||
}} | ||
> | ||
<ZoomOutIcon /> | ||
</IconButton> | ||
</Tooltip> | ||
<Divider /> | ||
<Tooltip title="Add comment" placement="right-start"> | ||
<IconButton> | ||
<TextsmsOutlined /> | ||
</IconButton> | ||
</Tooltip> | ||
<Divider /> | ||
<Tooltip title="Download graph" placement="right-start"> | ||
<IconButton> | ||
<FileDownloadOutlined /> | ||
</IconButton> | ||
</Tooltip> | ||
</Box> | ||
); | ||
} | ||
|
||
export default SceneControls; |