From 1d4061a9351dfb78c074f1b736b2cd691b3c2572 Mon Sep 17 00:00:00 2001 From: liyunze <50455574+liyunze-coding@users.noreply.github.com> Date: Tue, 12 Aug 2025 00:33:27 +1000 Subject: [PATCH] added accessibility and improved font performance --- src/components/projects/Project.astro | 4 +- src/components/ui/NavigationBar.tsx | 113 ++++++++++++++------------ src/layouts/Layout.astro | 4 + 3 files changed, 68 insertions(+), 53 deletions(-) diff --git a/src/components/projects/Project.astro b/src/components/projects/Project.astro index 9ee7e90..3cad325 100644 --- a/src/components/projects/Project.astro +++ b/src/components/projects/Project.astro @@ -55,12 +55,12 @@ const leftProject = position == "left"; class:list={leftProject ? "left" : "right"} - width="700" + width={700} /> {alt} - - {items.map((item, idx) => ( - setHoveredIndex(idx)} - onMouseLeave={() => setHoveredIndex(null)} - > - - {hoveredIndex === idx && ( - - )} - - {item.label} - - ))} - + + {items.map((item, idx) => ( +
  • + + setHoveredIndex(idx) + } + onMouseLeave={() => + setHoveredIndex(null) + } + > + + {hoveredIndex === idx && ( + + )} + + {item.label} + +
  • + ))} +
    +
    {items.map((item, idx) => ( - - {item.label} - +
  • + + {item.label} + +
  • ))}
    diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index bcaf6f0..018f2a7 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -48,6 +48,7 @@ import { ClientRouter } from "astro:transitions"; src: url("/fonts/Fredoka-Regular.ttf") format("truetype"); font-weight: normal; font-style: normal; + font-display: swap; } @font-face { @@ -55,6 +56,7 @@ import { ClientRouter } from "astro:transitions"; src: url("/fonts/Antonio-Bold.ttf") format("truetype"); font-weight: bold; font-style: normal; + font-display: swap; } /* Montserrat Fonts */ @@ -63,6 +65,7 @@ import { ClientRouter } from "astro:transitions"; src: url("/fonts/Montserrat-Bold.ttf") format("truetype"); font-weight: bold; font-style: normal; + font-display: swap; } @font-face { @@ -70,6 +73,7 @@ import { ClientRouter } from "astro:transitions"; src: url("/fonts/Montserrat-Regular.ttf") format("truetype"); font-weight: normal; font-style: normal; + font-display: swap; } html {