diff --git a/src/components/common/header/header.module.scss b/src/components/common/header/header.module.scss index f489fbb..d22d6a4 100644 --- a/src/components/common/header/header.module.scss +++ b/src/components/common/header/header.module.scss @@ -41,12 +41,22 @@ align-items: center; justify-content: center; + span { + text-transform: none; + line-height: 1; + letter-spacing: tovw(-0.5px, 'default', -0.5px); + font-family: var(--font-tt-hoves); + font-size: tovw(16px, 'default', 14px); + color: var(--color-white); + } + a.active { font-weight: 600 !important; } .no_content { margin-right: tovw(21px, 'default', 20px); + padding: 0 tovw(3px, 'default', 1px); } .trigger { @@ -56,6 +66,7 @@ background-color: unset; text-transform: none; line-height: 1; + padding: 0 tovw(3px, 'default', 1px); &[data-state='open'] { .caret { @@ -142,6 +153,16 @@ } } + span { + opacity: 0.6; + letter-spacing: tovw(-1px, 'mobile'); + font-size: tovw(50px, 'mobile'); + + @media screen and (max-height: 750px) { + font-size: calc(var(--vh) * 5.2); + } + } + div:first-child { display: flex; align-content: center; @@ -281,6 +302,14 @@ background-color: rgb(255 255 255 / 0.8); } + .list > .item { + .trigger { + .caret { + filter: brightness(20%); + } + } + } + ul li a { color: var(--color-white); } diff --git a/src/components/common/header/index.tsx b/src/components/common/header/index.tsx index 54d85f0..7402858 100644 --- a/src/components/common/header/index.tsx +++ b/src/components/common/header/index.tsx @@ -15,13 +15,23 @@ import { useMeasure } from '~/hooks/use-measure' import { DURATION, gsap } from '~/lib/gsap' import { ConnectLinks } from '../footer/footer' -import { defaultHeaderLinks } from './header' import s from './header.module.scss' +interface Props { + data: { + navMenu: { + href: string + title: string + content: { href: string; title: string }[] + }[] + } +} + const HeaderMobile = React.forwardRef< HTMLDivElement, JSX.IntrinsicElements['div'] ->(({ className, ...props }, ref) => { + // @ts-ignore +>(({ className, data, ...props }, ref) => { const router = useRouter() const { theme, setTheme } = useTheme() @@ -43,47 +53,65 @@ const HeaderMobile = React.forwardRef<
- {defaultHeaderLinks.map((item, i) => ( - - {item.content ? ( - <> -
- - {item.title} - - - - -
- - {item.content.map((contentItem, i) => ( - - {contentItem.title} - - ))} - - - ) : ( - - {item.title} - - )} -
- ))} + { + // @ts-ignore + data?.navMenu.map((item, i) => ( + + {item.content.length >= 1 ? ( + <> +
+ {item.href ? ( + <> + {' '} + + {item.title} + + + + + + ) : ( + <> + {item.title} + + + + + )} +
+ + { + // @ts-ignore + item.content.map((contentItem, i) => ( + + {contentItem.title} + + )) + } + + + ) : ( + + {item.title} + + )} +
+ )) + }
@@ -112,7 +140,7 @@ const HeaderMobile = React.forwardRef< ) }) -export const Header = () => { +export const Header = ({ data }: Props) => { const [isOpen, setIsOpen] = React.useState(false) const headerMobileRef = React.useRef(null) const timelineRef = React.useRef() @@ -154,7 +182,7 @@ export const Header = () => { `.${s.item}` ) const socialItems = headerMobileRef.current.querySelectorAll('.social li') - const button = headerMobileRef.current.querySelector('button') + // const button = headerMobileRef.current.querySelector('button') const text = headerMobileRef.current.querySelector('p') timelineRef.current = gsap.timeline({ @@ -168,8 +196,7 @@ export const Header = () => { }, { xPercent: 0, duration: DURATION } ) - timelineRef.current.fadeIn([navigationItems, button, socialItems, text]), - '>-40%' + timelineRef.current.fadeIn([navigationItems, socialItems, text]), '>-40%' }, []) useIsomorphicLayoutEffect(() => { @@ -192,25 +219,29 @@ export const Header = () => { - {defaultHeaderLinks.map((item, i) => ( + {data?.navMenu.map((item, i) => ( - {item.content ? ( + {item?.content?.length >= 1 ? ( <> - - {item.title} - + {item.href ? ( + + {item.title} + + ) : ( + {item.title} + )} - {item.content.map((contentItem, i) => ( + {item?.content.map((contentItem, i) => ( { /> Menu - + {/* + // @ts-ignore */} +
) diff --git a/src/components/layout/page.tsx b/src/components/layout/page.tsx index 86cb4d9..cd050cb 100644 --- a/src/components/layout/page.tsx +++ b/src/components/layout/page.tsx @@ -10,18 +10,21 @@ type Props = { extras?: React.ReactNode smoothScroll?: boolean footerData?: any + headerData?: any } -const ContentMemo = React.memo(({ children, extras, footerData }: Props) => { - return ( - <> -
- {extras} -
{children}
-