From d1e11118da0ff8ee1c88c8875d9395e299dc388e Mon Sep 17 00:00:00 2001 From: Sebastian Beltran Date: Mon, 18 Aug 2025 16:18:46 -0500 Subject: [PATCH 01/13] update hamburger component to use button element Signed-off-by: Sebastian Beltran --- src/components/Hamburger.astro | 4 ++-- src/styles/global.css | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/Hamburger.astro b/src/components/Hamburger.astro index 7093515..6cec202 100644 --- a/src/components/Hamburger.astro +++ b/src/components/Hamburger.astro @@ -1,8 +1,8 @@ --- --- -
+
+ diff --git a/src/styles/global.css b/src/styles/global.css index 0768104..a1e71aa 100644 --- a/src/styles/global.css +++ b/src/styles/global.css @@ -23,6 +23,8 @@ h1 { /* nav styles */ .hamburger { + background: transparent; + border: none; padding-right: 20px; cursor: pointer; } From cf50bfa81f578f2e61e66c684f7945663dcb2e5d Mon Sep 17 00:00:00 2001 From: Sebastian Beltran Date: Tue, 19 Aug 2025 12:52:01 -0500 Subject: [PATCH 02/13] improve accesibilidad of menu Signed-off-by: Sebastian Beltran --- src/components/Hamburger.astro | 2 +- src/components/Header.astro | 2 +- src/components/Navigation.astro | 4 ++-- src/scripts/menu.js | 7 +++++-- src/styles/global.css | 11 ++++++++--- 5 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/components/Hamburger.astro b/src/components/Hamburger.astro index 6cec202..3ecedb6 100644 --- a/src/components/Hamburger.astro +++ b/src/components/Hamburger.astro @@ -1,7 +1,7 @@ --- --- - diff --git a/src/components/Header.astro b/src/components/Header.astro index 5b7d4ea..1a4b946 100644 --- a/src/components/Header.astro +++ b/src/components/Header.astro @@ -1,13 +1,21 @@ --- -import Hamburger from "./Hamburger.astro"; +import Menu from "./Menu.astro"; import Navigation from "./Navigation.astro"; import ThemeIcon from "./ThemeIcon.astro"; ---
+ + \ No newline at end of file diff --git a/src/components/Menu.astro b/src/components/Menu.astro new file mode 100644 index 0000000..f601af2 --- /dev/null +++ b/src/components/Menu.astro @@ -0,0 +1,6 @@ +--- +--- + + diff --git a/src/scripts/menu.js b/src/scripts/menu.js index 268fd35..bafb83d 100644 --- a/src/scripts/menu.js +++ b/src/scripts/menu.js @@ -1,4 +1,4 @@ -const hamburger = document.querySelector('.hamburger') +const hamburger = document.querySelector('.menu') hamburger.addEventListener('click', () => { const isExpanded = hamburger.getAttribute('aria-expanded') === 'true'; diff --git a/src/styles/global.css b/src/styles/global.css index 509b773..e1440cb 100644 --- a/src/styles/global.css +++ b/src/styles/global.css @@ -22,21 +22,15 @@ h1 { /* nav styles */ -.hamburger { - background: transparent; - display: block; +.menu { + background-color: #0d0950; border: none; - padding-right: 20px; - cursor: pointer; + color: #fff; + font-size: 1.2rem; + font-weight: bold; + padding: 5px 10px; } -.hamburger .line { - display: block; - width: 40px; - height: 5px; - margin-bottom: 10px; - background-color: #ff9776; -} .nav-links { width: 100%; @@ -54,6 +48,7 @@ h1 { font-size: 1.2rem; font-weight: bold; text-transform: uppercase; + color: #0d0950; } .nav-links a:hover, @@ -61,7 +56,7 @@ h1 { background-color: #ff9776; } -.hamburger[aria-expanded="true"] ~ .nav-links { +:has(.menu[aria-expanded="true"]) .nav-links { display: unset; } @@ -79,7 +74,7 @@ h1 { padding: 15px 20px; } - .hamburger { + .menu { display: none; } } @@ -89,9 +84,14 @@ html.dark { color: #fff; } +.dark .menu { + background-color: #fff; + color: #000; +} + .dark .nav-links a:hover, .dark .nav-links a:focus { - color: #000; + color: #0d0950; } .dark .nav-links a { From fef95703cfd083aac86aceee588174619f040c62 Mon Sep 17 00:00:00 2001 From: Sebastian Beltran Date: Thu, 21 Aug 2025 11:04:25 -0500 Subject: [PATCH 05/13] rename hambuguer variable and remove some unused lines Signed-off-by: Sebastian Beltran --- src/scripts/menu.js | 8 ++++---- src/styles/global.css | 2 -- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/scripts/menu.js b/src/scripts/menu.js index bafb83d..c895b64 100644 --- a/src/scripts/menu.js +++ b/src/scripts/menu.js @@ -1,6 +1,6 @@ -const hamburger = document.querySelector('.menu') +const menu = document.querySelector('.menu') -hamburger.addEventListener('click', () => { - const isExpanded = hamburger.getAttribute('aria-expanded') === 'true'; - hamburger.setAttribute('aria-expanded', !isExpanded); +menu.addEventListener('click', () => { + const isExpanded = menu.getAttribute('aria-expanded') === 'true'; + menu.setAttribute('aria-expanded', !isExpanded); }); diff --git a/src/styles/global.css b/src/styles/global.css index e1440cb..354f8eb 100644 --- a/src/styles/global.css +++ b/src/styles/global.css @@ -34,8 +34,6 @@ h1 { .nav-links { width: 100%; - top: 5rem; - left: 48px; display: none; margin: 0; } From ad95b970dc35ca0f7ee3ba30a90fa3131641961f Mon Sep 17 00:00:00 2001 From: Sebastian Beltran Date: Thu, 21 Aug 2025 11:10:55 -0500 Subject: [PATCH 06/13] fix link colors in dark mode Signed-off-by: Sebastian Beltran --- src/styles/global.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/styles/global.css b/src/styles/global.css index 354f8eb..94c5150 100644 --- a/src/styles/global.css +++ b/src/styles/global.css @@ -92,6 +92,6 @@ html.dark { color: #0d0950; } -.dark .nav-links a { +.dark a { color: #fff; } From d27559788906ccfa663b1db7275dd5891b08d3f7 Mon Sep 17 00:00:00 2001 From: Sebastian Beltran Date: Thu, 21 Aug 2025 11:49:16 -0500 Subject: [PATCH 07/13] improve links in dark mode Signed-off-by: Sebastian Beltran --- src/styles/global.css | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/styles/global.css b/src/styles/global.css index 94c5150..7ab5ecc 100644 --- a/src/styles/global.css +++ b/src/styles/global.css @@ -92,6 +92,10 @@ html.dark { color: #0d0950; } -.dark a { +.dark .nav-links a { color: #fff; } + +.dark a { + color: #ff9776; +} \ No newline at end of file From 0ed17f0e4d5833ecafd001a138f5f640180805f4 Mon Sep 17 00:00:00 2001 From: Sebastian Beltran Date: Sat, 23 Aug 2025 10:20:41 -0500 Subject: [PATCH 08/13] add aria attributes to theme toggle button for accessibility Signed-off-by: Sebastian Beltran --- src/components/ThemeIcon.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ThemeIcon.astro b/src/components/ThemeIcon.astro index 61c4fd5..f62c1b0 100644 --- a/src/components/ThemeIcon.astro +++ b/src/components/ThemeIcon.astro @@ -2,7 +2,7 @@ --- -