From bc9e1c3007fb31429acb64f8fc9c1295df04c0c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Sat, 17 Aug 2024 20:00:01 -0500 Subject: [PATCH] feat: more things --- src/components/Navbar/index.css.ts | 35 ++++- src/components/Navbar/index.tsx | 243 ++++++++++++++++++++--------- 2 files changed, 198 insertions(+), 80 deletions(-) diff --git a/src/components/Navbar/index.css.ts b/src/components/Navbar/index.css.ts index c3f7b51d1..db966b91f 100644 --- a/src/components/Navbar/index.css.ts +++ b/src/components/Navbar/index.css.ts @@ -1,6 +1,7 @@ -import { style } from '@vanilla-extract/css'; +import { style, styleVariants } from '@vanilla-extract/css'; -const MIN_WIDTH = 640 + 64; +const MIN_WIDTH = 640 + 128; +const HEIGHT = 48; export const hamburger = style({ display: 'inline-flex', @@ -21,3 +22,33 @@ export const tools = style({ }, }, }); + +const navbarBase = style({ + // 1px overlap with content to bleed color + marginBottom: -1, + backdropFilter: 'blur(4rem) brightness(0.75)', + WebkitBackdropFilter: 'blur(4rem) brightness(0.75)', + zIndex: 1, + transitionDuration: '250ms', + + '@media': { + [`screen and (min-width: ${MIN_WIDTH}px)`]: { + maxHeight: HEIGHT, + }, + }, +}); + +export const navbar = styleVariants({ + false: [ + navbarBase, + { + maxHeight: HEIGHT, + }, + ], + true: [ + navbarBase, + { + maxHeight: '100vh', + }, + ], +}); diff --git a/src/components/Navbar/index.tsx b/src/components/Navbar/index.tsx index 82a913ea9..22b1c1121 100644 --- a/src/components/Navbar/index.tsx +++ b/src/components/Navbar/index.tsx @@ -1,15 +1,25 @@ 'use client'; import { + Cross1Icon, DiscordLogoIcon, GearIcon, HamburgerMenuIcon, PersonIcon, } from '@radix-ui/react-icons'; -import { Box, Flex, IconButton, Separator } from '@radix-ui/themes'; +import { + Box, + Flex, + Grid, + IconButton, + ScrollArea, + Separator, + Text, +} from '@radix-ui/themes'; import { usePathname } from 'next/navigation'; import { useState } from 'react'; import { TOOLS } from '../../constants/tools'; +import { imgur, ImgurSize } from '../../core/blitzkit/imgur'; import { PatreonIcon } from '../../icons/Patreon'; import * as App from '../../stores/app'; import { Link } from '../Link'; @@ -23,93 +33,170 @@ export default function Navbar() { return ( - - - - - + + + + setShowHamburgerMenu((state) => !state)} + > + {showHamburgerMenu ? : } + - setShowHamburgerMenu(false)} + > + BlitzKit + + + + + + - BlitzKit - - + {TOOLS.map((tool, index) => { + const selected = pathname.startsWith(`/tools/${tool.id}`); - + return ( + <> + {index > 0 && } + + {tool.title} + + + ); + })} + - - {TOOLS.map((tool, index) => { - const selected = pathname.startsWith(`/tools/${tool.id}`); + - return ( - <> - {index > 0 && } - - {tool.title} - - - ); - })} - - - - - - - - - - - - - - - - - + + setShowHamburgerMenu(false)} + > + + + setShowHamburgerMenu(false)} + > + + + setShowHamburgerMenu(false)} + > + + + + + + + + + + + {TOOLS.map((tool) => ( + setShowHamburgerMenu(false)} + > + + + + + {tool.title} + + + + ))} + + + ); }