From f496dd0ccd248c2db21e32eda920021ae5d36d66 Mon Sep 17 00:00:00 2001 From: prototypa Date: Sun, 28 Aug 2022 18:07:47 -0400 Subject: [PATCH] Make mobile menu full height and fix transition --- src/components/core/BasicScripts.astro | 9 ++------- src/components/widgets/Header.astro | 22 +++++++++++++--------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/components/core/BasicScripts.astro b/src/components/core/BasicScripts.astro index 2d7b485..ec6d05c 100644 --- a/src/components/core/BasicScripts.astro +++ b/src/components/core/BasicScripts.astro @@ -17,13 +17,7 @@ const { } = Astro.props; const matches = document.querySelectorAll(selector); if (matches && matches.length) { matches.forEach((elem) => { - elem.addEventListener( - event, - function () { - fn(elem); - }, - false - ); + elem.addEventListener(event, () => fn(elem), false); }); } } @@ -31,6 +25,7 @@ const { } = Astro.props; window.onload = function () { attachEvent("[data-aw-toggle-menu]", "click", function (elem) { elem.classList.toggle("expanded"); + document.documentElement.classList.toggle("overflow-hidden"); document.getElementById("menu")?.classList.toggle("hidden"); }); diff --git a/src/components/widgets/Header.astro b/src/components/widgets/Header.astro index 568c87b..278c140 100644 --- a/src/components/widgets/Header.astro +++ b/src/components/widgets/Header.astro @@ -6,7 +6,7 @@ const { } = Astro.props; ---
+ class="sticky top-0 z-40 flex-none mx-auto w-full bg-white md:bg-white/90 dark:bg-slate-900 dark:md:bg-slate-900/90 md:backdrop-blur-sm border-b dark:border-b-0"> -
\ No newline at end of file