Skip to content

Commit 8464a19

Browse files
committed
サイドバーの下部をフェード
1 parent 29c798e commit 8464a19

2 files changed

Lines changed: 39 additions & 31 deletions

File tree

app/(docs)/@chat/chat/[chatId]/chatArea.tsx

Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -20,42 +20,49 @@ export function ChatAreaContainer(props: {
2020
<aside
2121
className={clsx(
2222
// モバイルでは全画面表示する
23-
"fixed inset-0 pt-20 bg-base-100",
23+
"fixed inset-0 bg-base-100",
2424
// PCではスクロールで動かない右サイドバー
25-
"has-chat-1:sticky has-chat-1:top-16 has-sidebar:top-0 has-chat-1:pt-4",
25+
// 左にサイドバーがない=navvarがある とき、navbar分のスペースをあける(top-16, h-[100vh-4rem])
26+
"has-chat-1:sticky has-chat-1:top-16 has-sidebar:top-0",
2627
"has-chat-1:basis-2/5 has-chat-1:max-w-chat-area has-chat-1:h-[calc(100vh-4rem)] has-sidebar:h-screen",
2728
"has-chat-1:shadow-md has-chat-1:bg-base-200",
2829
// navbar(z-40)よりは下、ChatListForSectionのdropdown(デフォルトでz-999だがz-30に変えている)よりも上
29-
"z-35",
30-
"p-4 pb-16",
31-
"flex flex-col",
32-
"overflow-y-auto"
30+
"z-35"
3331
)}
3432
>
35-
<ChatAreaStateUpdater chatId={props.chatId} />
36-
<div className="flex flex-row items-center">
37-
<span className="flex-1 text-base font-bold opacity-40">
38-
AIへの質問
39-
</span>
40-
<Link className="btn btn-ghost" href="/chat" scroll={false}>
41-
<svg
42-
className="w-8 h-8 -scale-x-100"
43-
viewBox="0 0 24 24"
44-
fill="none"
45-
xmlns="http://www.w3.org/2000/svg"
46-
>
47-
<path
48-
d="M18 17L13 12L18 7M11 17L6 12L11 7"
49-
stroke="currentColor"
50-
strokeWidth="1.5"
51-
strokeLinecap="round"
52-
strokeLinejoin="round"
53-
/>
54-
</svg>
55-
<span className="text-lg">閉じる</span>
56-
</Link>
33+
<div className="absolute inset-x-0 bottom-0 h-16 bg-linear-to-t from-base-200 to-base-200/0 z-1" />
34+
<div
35+
className={clsx(
36+
"p-4 pb-16",
37+
"pt-20 has-chat-1:pt-4",
38+
"h-full flex flex-col overflow-y-auto"
39+
)}
40+
>
41+
<ChatAreaStateUpdater chatId={props.chatId} />
42+
<div className="flex flex-row items-center">
43+
<span className="flex-1 text-base font-bold opacity-40">
44+
AIへの質問
45+
</span>
46+
<Link className="btn btn-ghost" href="/chat" scroll={false}>
47+
<svg
48+
className="w-8 h-8 -scale-x-100"
49+
viewBox="0 0 24 24"
50+
fill="none"
51+
xmlns="http://www.w3.org/2000/svg"
52+
>
53+
<path
54+
d="M18 17L13 12L18 7M11 17L6 12L11 7"
55+
stroke="currentColor"
56+
strokeWidth="1.5"
57+
strokeLinecap="round"
58+
strokeLinejoin="round"
59+
/>
60+
</svg>
61+
<span className="text-lg">閉じる</span>
62+
</Link>
63+
</div>
64+
{props.children}
5765
</div>
58-
{props.children}
5966
</aside>
6067
);
6168
}

app/sidebar.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export function Sidebar({ pagesList }: { pagesList: LanguageEntry[] }) {
118118
}, [currentLangIndex]);
119119

120120
return (
121-
<div className="bg-base-200 h-full w-sidebar flex flex-col">
121+
<div className="bg-base-200 h-full w-sidebar flex flex-col relative">
122122
<h2 className="hidden has-sidebar:flex flex-row items-center p-4 gap-2">
123123
{/* サイドバーが常時表示されている場合のみ */}
124124
<Link href="/" className="flex-1 flex items-center">
@@ -156,10 +156,11 @@ export function Sidebar({ pagesList }: { pagesList: LanguageEntry[] }) {
156156
</label>
157157
</span>
158158

159+
<div className="absolute inset-x-0 bottom-0 h-16 bg-linear-to-t from-base-200 to-base-200/0 z-1" />
159160
<ul
160161
className={clsx(
161162
"menu w-full h-max flex-nowrap grow-1 overflow-y-auto overflow-x-clip",
162-
"pb-8 md:pb-12 lg:pb-16"
163+
"pb-16"
163164
)}
164165
style={{
165166
scrollbarGutter: "stable",

0 commit comments

Comments
 (0)