-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: 인터랙션 가이드 추가 * chore: 인터랙션 가이드 내용 추가
- Loading branch information
Showing
5 changed files
with
159 additions
and
54 deletions.
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
63 changes: 63 additions & 0 deletions
63
packages/frontend/src/components/space/InteractionGuide.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,63 @@ | ||
import { InfoIcon } from "lucide-react"; | ||
|
||
import { | ||
HoverCard, | ||
HoverCardContent, | ||
HoverCardTrigger, | ||
} from "@/components/ui/hover-card"; | ||
|
||
const interactions = [ | ||
{ | ||
id: "node-drag", | ||
title: "새로운 노드 생성", | ||
description: "노드 드래그", | ||
}, | ||
{ | ||
id: "node-move", | ||
title: "노드 이동", | ||
description: "클릭 + 0.5초 이상 홀드", | ||
}, | ||
{ | ||
id: "screen-move", | ||
title: "화면 이동", | ||
description: "스페이스 빈 공간 클릭 후 드래그", | ||
}, | ||
{ | ||
id: "screen-zoom", | ||
title: "화면 줌", | ||
description: "ctrl + 마우스 휠 또는 트랙패드 제스처", | ||
}, | ||
{ | ||
id: "node-edit", | ||
title: "노드 편집", | ||
description: "노드 위에서 우클릭", | ||
}, | ||
{ | ||
id: "edge-edit", | ||
title: "간선 편집", | ||
description: "간선 위에서 우클릭", | ||
}, | ||
]; | ||
|
||
export default function InteractionGuide() { | ||
return ( | ||
<HoverCard> | ||
<HoverCardTrigger> | ||
<InfoIcon fill="#FFFFFF" /> | ||
</HoverCardTrigger> | ||
<HoverCardContent align="end"> | ||
<div className="flex flex-col space-y-2"> | ||
<h2 className="text-lg font-bold">상호작용 가이드 🐝</h2> | ||
<ul className="list-disc list-inside"> | ||
{interactions.map((interaction) => ( | ||
<li key={interaction.id}> | ||
<span className="font-bold">{interaction.title}</span>: | ||
{interaction.description} | ||
</li> | ||
))} | ||
</ul> | ||
</div> | ||
</HoverCardContent> | ||
</HoverCard> | ||
); | ||
} |
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,28 @@ | ||
import * as React from "react"; | ||
|
||
import * as HoverCardPrimitive from "@radix-ui/react-hover-card"; | ||
|
||
import { cn } from "@/lib/utils"; | ||
|
||
const HoverCard = HoverCardPrimitive.Root; | ||
|
||
const HoverCardTrigger = HoverCardPrimitive.Trigger; | ||
|
||
const HoverCardContent = React.forwardRef< | ||
React.ElementRef<typeof HoverCardPrimitive.Content>, | ||
React.ComponentPropsWithoutRef<typeof HoverCardPrimitive.Content> | ||
>(({ className, align = "center", sideOffset = 4, ...props }, ref) => ( | ||
<HoverCardPrimitive.Content | ||
ref={ref} | ||
align={align} | ||
sideOffset={sideOffset} | ||
className={cn( | ||
"z-50 w-96 rounded-md border bg-popover p-4 text-popover-foreground break-keep shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", | ||
className, | ||
)} | ||
{...props} | ||
/> | ||
)); | ||
HoverCardContent.displayName = HoverCardPrimitive.Content.displayName; | ||
|
||
export { HoverCard, HoverCardTrigger, HoverCardContent }; |
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
Oops, something went wrong.