From 1241d92f68c338cb9ad6ea01d28a2e7a88f6c1a5 Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Sat, 9 Jul 2022 20:40:20 +0200 Subject: [PATCH] Burger menu now works --- components/burgermenu.tsx | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/components/burgermenu.tsx b/components/burgermenu.tsx index 1b75a84..41b701c 100644 --- a/components/burgermenu.tsx +++ b/components/burgermenu.tsx @@ -62,16 +62,19 @@ const BurgerContainer = styled.div<{open: boolean}>` ` const BNavCont = styled.nav<{show: boolean}>` - display: none; + display: flex; + opacity: 0; backdrop-filter: blur(25px); position: fixed; flex-direction: column; - background: #222a; + background: #21242baf; left: 0; top: 0; + pointer-events: none; width: 100vw; height: 100vh; z-index: 2; + transition: opacity .2s; align-items: center; justify-content: center; @@ -94,12 +97,21 @@ const BNavCont = styled.nav<{show: boolean}>` ${({show}) => show && css` display: flex; + opacity: 1; + pointer-events: unset; `} + + + @media screen and (min-width: 960px) { + display: none; + position: absolute; + top: 0; + } ` -const BNav: React.FC<{show: boolean}> = ({show}) => { +const BNav: React.FC<{show: boolean, onClick: () => void}> = ({show, onClick}) => { return ( - + ) @@ -109,7 +121,7 @@ const Menu = () => { const [open, setOpen] = useState(false); return ( <> - + setOpen(false)}/> setOpen(!open)}>