Files
AndreaSlopFotografie/web/components/NavigationBar/NavLink.tsx
T
Sluijsens b3b78e7d6f Adds Chakra theme tokens, hero background, and animated nav underline
Defines bg/fg semantic tokens and heading/body font tokens (Marcellus + Jost), sets the hero image as the page background, and gives NavigationBar's links a hover/active underline that mirrors the design's left-to-right wipe animation.
2026-10-02 00:18:23 +02:00

44 lines
1.3 KiB
TypeScript

import { chakra } from '@chakra-ui/react';
import { Link } from '@tanstack/react-router';
const ChakraLink = chakra(Link);
type NavLinkProps = React.ComponentProps<typeof ChakraLink>;
export default function NavLink({ children, ...props }: NavLinkProps) {
return (
<ChakraLink
textTransform="uppercase"
fontWeight="300"
fontSize="0.72rem"
letterSpacing="0.22em"
position="relative"
display="inline-block"
py="2"
mx="4"
css={{
'&::after': {
content: '""',
position: 'absolute',
left: 0,
bottom: 0,
width: '100%',
height: '1px',
bg: 'currentColor',
transform: 'scaleX(0)',
transformOrigin: 'right',
transition: 'transform 0.45s cubic-bezier(.22,.61,.36,1)',
},
'&:hover::after, &:focus-visible::after, &[aria-current="page"]::after':
{
transform: 'scaleX(1)',
transformOrigin: 'left',
},
}}
{...props}
>
{children}
</ChakraLink>
);
}