Skip to content

Commit 0b9b7b8

Browse files
committed
better card hover effect
1 parent 6d26080 commit 0b9b7b8

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

src/renderer/src/App.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ function App({ ddbProp }): JSX.Element {
2424
{/* Sidebar */}
2525
<Squircle cornerRadius={16} cornerSmoothing={1} className="relative flex h-full w-80 flex-col bg-neutral-900">
2626
{/* Chat Cards */}
27-
<div className="scroll-secondary group my-4 grow overflow-auto scroll-smooth">
27+
<div className="scroll-secondary group/chat-cards my-4 grow overflow-auto scroll-smooth">
2828
<div className="-mt-2 flex h-full max-h-full flex-col p-2">
2929
{ddb.chat_cards.map((card, idx) => {
3030
return <ChatCard key={idx} id={card.id} name={card.name} avatar={card.avatar} msg={card.msg} />;
3131
})}
3232
</div>
3333
{/* Scrollbar Hover Fade In/Out Hack*/}
34-
<div className="absolute right-0 top-0 h-full w-2 bg-neutral-900 transition duration-300 ease-out group-hover:opacity-0"></div>
34+
<div className="absolute right-0 top-0 h-full w-2 bg-neutral-900 transition duration-300 ease-out group-hover/chat-cards:opacity-0"></div>
3535
</div>
3636

3737
{/* Utility Bar */}

src/renderer/src/components/ChatBar.tsx

+3-4
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,12 @@ export default function ChatBar({ userInput, setUserInput, typing, className, ..
3232
// TODO
3333
}
3434

35-
const base = "flex min-h-fit w-full shrink-0 rounded-full space-x-2 bg-[#4F4F4F] py-3 px-4";
3635
return (
37-
<>
36+
<div className={className}>
3837
<div className="flex h-fit w-fit items-center ">
3938
<Typing className="mb-1 ml-4 mt-1" name="Saku" typing={typing} />
4039
</div>
41-
<div className={cn(base, className)}>
40+
<div className="flex min-h-fit w-full shrink-0 space-x-2 rounded-full bg-[#4F4F4F] px-4 py-3">
4241
<div className="h-fit w-fit">
4342
<button className="flex size-6 items-center justify-center text-neutral-400 hover:text-neutral-300">
4443
<WrenchScrewdriverIcon className="size-6 fill-neutral-400 transition duration-300 ease-out hover:fill-neutral-200" />
@@ -65,6 +64,6 @@ export default function ChatBar({ userInput, setUserInput, typing, className, ..
6564
<PaperAirplaneIcon className="h-7 w-7 fill-[#E04B93] transition duration-300 ease-out hover:fill-pink-400 " />
6665
</button>
6766
</div>
68-
</>
67+
</div>
6968
);
7069
}

src/renderer/src/components/ChatCard.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ export default function ChatCard({ id, name, avatar, msg, className, ...rest }:
1414
<div
1515
{...rest}
1616
className={cn(
17-
"duration-400 flex h-[70px] w-full cursor-pointer items-center space-x-2 rounded-md p-1 transition ease-out hover:bg-neutral-600",
17+
"duration-400 group flex h-[70px] w-full cursor-pointer items-center space-x-3 rounded-md p-1 transition ease-out hover:bg-neutral-600",
1818
className
1919
)}
2020
>
21-
<img className="h-12 w-12 shrink-0 rounded-full object-cover object-top" src={avatar} alt="avatar" />
22-
<div className="flex h-full max-w-full flex-col justify-center">
23-
<h3 className="line-clamp-1 font-normal text-gray-100">{name}</h3>
24-
<p className="line-clamp-1 text-[15px] text-gray-400">{msg}</p>
21+
<img className="size-12 shrink-0 rounded-full object-cover object-top" src={avatar} alt="avatar" />
22+
<div className="flex h-full max-w-full flex-col justify-center text-gray-400 group-hover:text-gray-100">
23+
<h3 className="line-clamp-1 font-[550]">{name}</h3>
24+
<p className="line-clamp-1 text-[15px]">{msg}</p>
2525
</div>
2626
</div>
2727
);

0 commit comments

Comments
 (0)