Sticky tab

This commit is contained in:
Sumire Isshiki 2024-03-11 19:49:17 +09:00
parent 56d18f25b4
commit 65dd7bf23c
5 changed files with 43 additions and 41 deletions

View File

@ -77,7 +77,7 @@ export default function App() {
<div className="hidden md:block md:col-span-1">
<VerticalMenu />
</div>
<div className="block md:hidden">
<div className="sticky top-5 md:hidden">
<HorizontalMenu />
</div>
<div className="px-5 md:col-span-4 md:px-0">

View File

@ -140,7 +140,7 @@ export default function Chat() {
</button>
</div>
<div className="overflow-auto max-h-96 mt-5 rounded-lg max-w-xl">
<div className="overflow-auto h-96 mt-5 rounded-lg max-w-xl">
{
messages &&
messages.map((message, index) => {

View File

@ -16,7 +16,7 @@ export default function HorizontalMenu() {
return (
<RecoilRoot>
<div className="text-lg font-medium text-center hover:cursor-pointer grid grid-cols-5 grid-flow-col">
<div className="relative text-lg font-medium text-center hover:cursor-pointer grid grid-cols-5 grid-flow-col backdrop-blur-2xl bg-zinc-100/30 dark:bg-neutral-900/30 rounded-lg">
<div
className={`self-start py-3 rounded-lg${page === Pages.Profile ? activeColor : ""}`}
onClick={() => {setPage(Pages.Profile)}}

View File

@ -9,7 +9,7 @@ export default function Profile() {
<ol className="relative border-s border-gray-700 left-2">
<li className="mb-2 ms-4">
<div className="absolute w-3 h-3 bg-gray-200 rounded-full mt-1.5 -start-1.5 border border-gray-900 bg-gray-700"></div>
<div className="absolute w-3 h-3 rounded-full mt-1.5 -start-1.5 border border-gray-900 bg-gray-700"></div>
<time className="mb-1 text-sm font-normal leading-none dark:text-gray-400">
2020 4 &ndash;
</time>

View File

@ -25,7 +25,8 @@ export default function VerticalMenu() {
return (
<RecoilRoot>
<ul className="w-full text-lg font-medium text-center hover:cursor-pointer">
<div className="sticky top-5">
<ul className="text-lg font-medium text-center hover:cursor-pointer">
<li
className={`w-full px-4 py-2 rounded-lg${page === Pages.Profile ? activeColor : ""}`}
onClick={() => {setPage(Pages.Profile)}}
@ -62,6 +63,7 @@ export default function VerticalMenu() {
<p></p>
</li>
</ul>
</div>
</RecoilRoot>
)
}