diff --git a/src/app/page.css.ts b/src/app/page.css.ts deleted file mode 100644 index 8b28f0eff..000000000 --- a/src/app/page.css.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { styleVariants } from '@vanilla-extract/css'; -import { theme } from '../stitches.config'; - -export const tool = styleVariants({ - enabled: { - boxShadow: `inset 0 -200px 128px -128px ${theme.colors.appBackground1}`, - - ':hover': { - boxShadow: `inset 0 -160px 128px -128px ${theme.colors.appBackground1}`, - }, - }, - disabled: { - boxShadow: `inset 0 -192px 128px -128px ${theme.colors.appBackground1}`, - }, -}); diff --git a/src/components/Navbar/index.css.ts b/src/components/Navbar/index.css.ts new file mode 100644 index 000000000..9c16c9434 --- /dev/null +++ b/src/components/Navbar/index.css.ts @@ -0,0 +1,54 @@ +import { style, styleVariants } from '@vanilla-extract/css'; + +export const hamburgerButton = style({ + '@media': { + 'screen and (min-width: 592px)': { + display: 'none', + }, + }, +}); + +const navbarBase = style({ + position: 'fixed', + top: 0, + left: 0, + width: '100%', + zIndex: 2, + padding: '1rem', + backgroundColor: 'var(--color-panel-translucent)', + backdropFilter: 'blur(4rem)', + WebkitBackdropFilter: 'blur(4rem)', + boxSizing: 'border-box', + transition: 'max-height 0.2s ease-in-out', + overflow: 'hidden', +}); +export const navbar = styleVariants({ + expanded: [ + navbarBase, + { + maxHeight: '100%', + }, + ], + collapsed: [ + navbarBase, + { + maxHeight: 65, + }, + ], +}); + +export const toolCard = style({ + boxShadow: `inset 0 -200px 128px -128px var(--color-overlay)`, + + ':hover': { + boxShadow: `inset 0 -160px 128px -128px #ffffff00`, + }, +}); + +export const toolTexts = style({ + '@media': { + 'screen and (max-width: 592px)': { + display: 'none', + }, + }, +}); diff --git a/src/components/Navbar/index.tsx b/src/components/Navbar/index.tsx index 85fef0b0a..a6e778d72 100644 --- a/src/components/Navbar/index.tsx +++ b/src/components/Navbar/index.tsx @@ -14,52 +14,33 @@ import { Flex, Heading, IconButton, - Link as LinkRadix, + Link, Popover, Spinner, Text, } from '@radix-ui/themes'; -import Link from 'next/link'; import { usePathname } from 'next/navigation'; import { Suspense, useState } from 'react'; -import * as styles from '../../app/page.css'; import { REGIONS, UNLOCALIZED_REGION_NAMES } from '../../constants/regions'; import { TOOLS } from '../../constants/tools'; import { authURL } from '../../core/blitz/authURL'; -import { useWideFormat } from '../../hooks/useWideFormat'; import { BlitzkitWide } from '../../icons/BlitzkitWide'; import { PatreonIcon } from '../../icons/Patreon'; import { theme } from '../../stitches.config'; import { useApp } from '../../stores/app'; import { LoggedIn } from './components/LoggedIn'; +import * as styles from './index.css'; export const NAVBAR_HEIGHT = 64; export default function Navbar() { - const wideFormat = useWideFormat(688 - 32 - 64); const [showHamburgerMenu, setShowHamburgerMenu] = useState(false); const pathname = usePathname(); const login = useApp((state) => state.login!); return ( - {!wideFormat && ( - setShowHamburgerMenu((state) => !state)} - > - {showHamburgerMenu ? : } - - )} + setShowHamburgerMenu((state) => !state)} + > + {showHamburgerMenu ? : } + setShowHamburgerMenu(false)} @@ -94,32 +74,26 @@ export default function Navbar() { - {wideFormat && ( - - {TOOLS.filter((tool) => !tool.href).map((tool) => { - const selected = pathname.startsWith(`/tools/${tool.id}`); + + {TOOLS.filter((tool) => !tool.href).map((tool) => { + const selected = pathname.startsWith(`/tools/${tool.id}`); - return ( - event.preventDefault()} - > - - {tool.title} - - - ); - })} - - )} + return ( + event.preventDefault()} + style={{ all: 'inherit' }} + key={tool.id} + href={`/tools/${tool.id}`} + > + {tool.title} + + ); + })} + )} - {/* TODO: re-enable in the future */} {!login && false && ( @@ -193,7 +166,7 @@ export default function Navbar() { {REGIONS.map((region) => ( - setShowHamburgerMenu(false)} key={region} href={authURL( @@ -204,7 +177,7 @@ export default function Navbar() { )} > {UNLOCALIZED_REGION_NAMES[region]} - + ))} @@ -219,9 +192,7 @@ export default function Navbar() {