From 8f54b8a57615fe9749a01259e70abf09b941571c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Mon, 19 Aug 2024 13:28:46 -0500 Subject: [PATCH] feat: no push content --- src/components/Navbar/index.css.ts | 30 +- src/components/Navbar/index.tsx | 547 +++++++++++++++-------------- 2 files changed, 305 insertions(+), 272 deletions(-) diff --git a/src/components/Navbar/index.css.ts b/src/components/Navbar/index.css.ts index db966b91f..02385d6b3 100644 --- a/src/components/Navbar/index.css.ts +++ b/src/components/Navbar/index.css.ts @@ -23,13 +23,22 @@ export const tools = style({ }, }); -const navbarBase = style({ - // 1px overlap with content to bleed color - marginBottom: -1, +export const navbar = style({ + height: HEIGHT, + marginBottom: -1, // 1px overlap with content to bleed color + position: 'sticky', + top: 0, + zIndex: 1, +}); + +const navbarExpanderBase = style({ + transitionDuration: '250ms', + height: '1000px', + width: '100%', + overflow: 'hidden', + backdropFilter: 'blur(4rem) brightness(0.75)', WebkitBackdropFilter: 'blur(4rem) brightness(0.75)', - zIndex: 1, - transitionDuration: '250ms', '@media': { [`screen and (min-width: ${MIN_WIDTH}px)`]: { @@ -38,17 +47,22 @@ const navbarBase = style({ }, }); -export const navbar = styleVariants({ +export const navbarExpander = styleVariants({ false: [ - navbarBase, + navbarExpanderBase, { maxHeight: HEIGHT, }, ], true: [ - navbarBase, + navbarExpanderBase, { maxHeight: '100vh', }, ], }); + +export const navbarContent = style({ + width: '100%', + maxHeight: '100vh', +}); diff --git a/src/components/Navbar/index.tsx b/src/components/Navbar/index.tsx index 384e4deda..d47486016 100644 --- a/src/components/Navbar/index.tsx +++ b/src/components/Navbar/index.tsx @@ -42,280 +42,299 @@ export default function Navbar() { const tools = [homeTool, ...TOOLS]; return ( - - - - - setShowHamburgerMenu((state) => !state)} - onBlur={() => setShowHamburgerMenu(false)} - > - {showHamburgerMenu ? : } - - - setShowHamburgerMenu(false)} - > - BlitzKit - - - - - - - {TOOLS.map((tool, index) => { - const selected = pathname.startsWith(`/tools/${tool.id}`); - - return ( - <> - {index > 0 && } - - {tool.title} - - - ); - })} - - - - - - setShowHamburgerMenu(false)} - > - - - setShowHamburgerMenu(false)} - > - - - setShowHamburgerMenu(false)} - > - - - - - - - - - - event.preventDefault()} - > - {(logins.patreon || logins.wargaming) && ( - - - Logged in accounts - - - {logins.patreon && ( - - - Patreon - - - )} - - {logins.wargaming && ( - - - Wargaming - - - )} - - )} - - {!logins.patreon !== !logins.wargaming && ( - - - - )} - - {(!logins.patreon || !logins.wargaming) && ( - - - Log in with... - - - {!logins.patreon && ( - - - - )} - - {!logins.wargaming && ( - - - - - - - - Choose your region - - - {REGIONS.map((region) => ( - - - - - - ))} - - - - - )} - - )} - - - - - - - - - - {tools.map((tool) => ( - setShowHamburgerMenu(false)} - > - + setShowHamburgerMenu((state) => !state)} + > + event.stopPropagation()} + > + + + + { + event.stopPropagation(); + setShowHamburgerMenu((state) => !state); }} > - : } + + + setShowHamburgerMenu(false)} + > + BlitzKit + + + + + + + {TOOLS.map((tool, index) => { + const selected = pathname.startsWith(`/tools/${tool.id}`); + + return ( + <> + {index > 0 && ( + + )} + setShowHamburgerMenu(false)} + color="gray" + highContrast={selected} + size="2" + href={`tools/${tool.id}`} + key={tool.title} + underline={selected ? 'always' : 'hover'} + > + {tool.title} + + + ); + })} + + + + + + setShowHamburgerMenu(false)} + > + + + setShowHamburgerMenu(false)} + > + + + setShowHamburgerMenu(false)} + > + + + + + + + + + + event.preventDefault()} + > + {(logins.patreon || logins.wargaming) && ( + + + Logged in accounts + + + {logins.patreon && ( + + + Patreon + + + )} + + {logins.wargaming && ( + + + Wargaming + + + )} + + )} + + {!logins.patreon !== !logins.wargaming && ( + + + + )} + + {(!logins.patreon || !logins.wargaming) && ( + + + Log in with... + + + {!logins.patreon && ( + + + + )} + + {!logins.wargaming && ( + + + + + + + + Choose your region + + + {REGIONS.map((region) => ( + + + + + + ))} + + + + + )} + + )} + + + + + + + + + + {tools.map((tool) => ( + setShowHamburgerMenu(false)} style={{ + position: 'relative', + borderRadius: 'var(--radius-2)', + overflow: 'hidden', backgroundImage: `url(${imgur(tool.image, { format: 'jpeg', size: ImgurSize.MediumThumbnail })})`, backgroundSize: 'cover', backgroundPosition: 'center', - }} - /> - - - {tool.title} + + + + + {tool.title} + + - - - ))} - + ))} + + + - + ); }