-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui/web/navbar): add hover effect
- Loading branch information
1 parent
5ca4fb0
commit c99c9c3
Showing
4 changed files
with
37 additions
and
8 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
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 |
---|---|---|
@@ -1,14 +1,31 @@ | ||
import { cn } from '@cuhacking/shared/utils/cn' | ||
import { Link } from '@remix-run/react' | ||
import { cva } from 'class-variance-authority' | ||
import React from 'react' | ||
// TODO: Refactor to use <Link> from Remix | ||
const navItemStyles = cva('text-xs font-bold', { | ||
variants: { | ||
index: { | ||
0: 'text-blue-400', | ||
1: 'text-lime-500', | ||
2: 'text-yellow-500', | ||
3: 'text-red-500', | ||
}, | ||
}, | ||
}) | ||
export function NavItem({ index, link, name }) { | ||
return ( | ||
<Link to={link}> | ||
<span className="text-xs text-border"> | ||
{String(index + 1).padStart(2, '0')} | ||
/ | ||
</span> | ||
{name} | ||
<p | ||
className="relative text-base before:absolute before:bottom-0 before:left-1/2 before:h-[2px] before:w-0 before:bg-current before:transition-all before:duration-300 | ||
before:origin-center hover:before:w-full hover:before:left-0" | ||
> | ||
<span className={cn(navItemStyles({ index }))}> | ||
{String(index + 1).padStart(2, '0')} | ||
/ | ||
</span> | ||
{name} | ||
</p> | ||
</Link> | ||
) | ||
} |
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
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