Skip to content

Commit

Permalink
chore: having fun
Browse files Browse the repository at this point in the history
  • Loading branch information
gustaveWPM committed May 1, 2024
1 parent bc3c45a commit 423d506
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
8 changes: 8 additions & 0 deletions src/app/pages-layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,20 @@

.search-menu-result-link {
font-size: max(clamp(1.6625vh, 2.0625vw, 1.1875em), 3.75vh);
padding-left: max(0.2vh, 0.2vw);
padding-right: max(0.2vh, 0.2vw);
}

.search-menu-result-link h3 {
font-size: max(clamp(1.82875vh, 2.26875vw, 1.1875em), 4.125vh);
}

.search-menu-result-link mark {
background-color: hsl(var(--primary));
padding: 0 0.2em;
color: white;
}

@media only screen and (max-width: 1024px) {
.search-menu-tabslist-item {
height: max(4vw, 4vh);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ const NavbarSearchButtonInner = <AllTabValues extends typeof navbarSearchBtnProp
</DialogHeader>
<div
className={cn('flex-1 rounded-md', {
'min-h-0 overflow-y-auto break-words border border-input px-2 [&>*>*]:pb-2 first:[&>*>*]:py-2': results !== null,
'min-h-0 overflow-y-auto break-words border border-input px-8 [&>*>*]:mb-8 first:[&>*>*]:my-8': results !== null,
"after:block after:h-10 after:content-['']": searchText === SEARCH_TEXT_INITIAL_STATE
})}
>
Expand Down
16 changes: 13 additions & 3 deletions src/components/ui/search/Result.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { usePathname } from 'next/navigation';
import { cn } from '@/lib/tailwind';
import Link from 'next/link';

import { CardContent, CardHeader, CardTitle, Card } from '../Card';

interface ResultProps extends Partial<WithClassname> {
metaTitle: string;
excerpt: string;
Expand All @@ -20,7 +22,7 @@ const Result: FunctionComponent<ResultProps> = ({ className, metaTitle, excerpt,
<Link
className={cn(
'search-menu-result-link',
'w-full',
'flex h-full w-full flex-col transition-transform duration-300 hover:delay-0 hover:duration-100 focus:delay-0 focus:duration-100 dark:hover:brightness-125 dark:focus:brightness-125',
{
'pointer-events-none opacity-50': exactMatch
},
Expand All @@ -29,8 +31,16 @@ const Result: FunctionComponent<ResultProps> = ({ className, metaTitle, excerpt,
aria-current={exactMatch ? 'page' : undefined}
href={href}
>
<h3>{metaTitle}</h3>
<p dangerouslySetInnerHTML={{ __html: excerpt }} />
<Card className="overflow-hidden rounded shadow-lg transition-[box-shadow] duration-300 hover:shadow-xl focus:shadow-xl">
<CardHeader className="pb-2">
<CardTitle className="flex justify-between" titleType="h3">
{metaTitle}
</CardTitle>
</CardHeader>
<CardContent>
<p dangerouslySetInnerHTML={{ __html: excerpt }} />
</CardContent>
</Card>
</Link>
);
};
Expand Down

0 comments on commit 423d506

Please sign in to comment.