diff --git a/.gitignore b/.gitignore index fbee148..461e4a1 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,9 @@ pnpm-debug.log* playwright-report/ test-results/ +# worktrees +.worktrees/ + # project-local tool dirs .obsidian/ .vscode/ diff --git a/e2e/accessibility.spec.ts b/e2e/accessibility.spec.ts index 7a841aa..27798e8 100644 --- a/e2e/accessibility.spec.ts +++ b/e2e/accessibility.spec.ts @@ -41,3 +41,55 @@ test.describe("Accessibility", () => { expect(results.violations).toEqual([]); }); }); + +test.describe("Accessibility — Light mode", () => { + test("homepage in light mode has no axe-core violations", async ({ + page, + }) => { + await page.goto("/"); + await page.waitForLoadState("networkidle"); + + // Apply light theme directly — tests that light mode CSS has no a11y violations + await page.evaluate(() => + document.documentElement.setAttribute("data-theme", "light"), + ); + + const theme = await page.evaluate(() => + document.documentElement.getAttribute("data-theme"), + ); + expect(theme).toBe("light"); + + await page.evaluate(async () => { + await new Promise((resolve) => { + const distance = 300; + const delay = 100; + const timer = setInterval(() => { + window.scrollBy(0, distance); + if ( + window.scrollY + window.innerHeight >= + document.body.scrollHeight + ) { + clearInterval(timer); + window.scrollTo(0, 0); + resolve(); + } + }, delay); + }); + }); + await page.waitForTimeout(500); + + const results = await new AxeBuilder({ page }).analyze(); + + if (results.violations.length > 0) { + const report = results.violations + .map( + (v) => + `[${v.impact}] ${v.id}: ${v.description}\n Nodes: ${v.nodes.map((n) => n.html).join(", ")}`, + ) + .join("\n\n"); + console.error("Axe violations (light mode):\n" + report); + } + + expect(results.violations).toEqual([]); + }); +}); diff --git a/src/components/Contact.astro b/src/components/Contact.astro index 5952a72..024795f 100644 --- a/src/components/Contact.astro +++ b/src/components/Contact.astro @@ -5,7 +5,7 @@ import { config } from "../data/config";
- // CONTACT06 / 06 +

// CONTACT

06 / 06

LET'S BUILD SOMETHING
GREAT TOGETHER. diff --git a/src/components/Experience.astro b/src/components/Experience.astro index 565c88c..6da0595 100644 --- a/src/components/Experience.astro +++ b/src/components/Experience.astro @@ -2,12 +2,12 @@ import { experiences } from "../data/experiences"; --- -
+

// EXPERIENCE

04 / 06
-
    +
      {experiences.map((exp) => (
    1. diff --git a/src/components/Faq.astro b/src/components/Faq.astro index 649513c..330e725 100644 --- a/src/components/Faq.astro +++ b/src/components/Faq.astro @@ -23,12 +23,12 @@ const faqs = [ ]; --- -
      +

      // FAQ

      05 / 06
      -
      +
      { faqs.map((faq) => (
      diff --git a/src/components/Hero.astro b/src/components/Hero.astro index ec34cf2..522326f 100644 --- a/src/components/Hero.astro +++ b/src/components/Hero.astro @@ -46,6 +46,7 @@ const colorData = JSON.stringify(colorRows); diff --git a/src/components/Navbar.astro b/src/components/Navbar.astro index 0d98fe1..f913bf8 100644 --- a/src/components/Navbar.astro +++ b/src/components/Navbar.astro @@ -8,12 +8,22 @@ style="background: transparent;" > Raigato - - GET IN TOUCH → - +
      + + + GET IN TOUCH → + +
      diff --git a/src/components/ThemeTransition.astro b/src/components/ThemeTransition.astro new file mode 100644 index 0000000..3c9573c --- /dev/null +++ b/src/components/ThemeTransition.astro @@ -0,0 +1,66 @@ + diff --git a/src/pages/index.astro b/src/pages/index.astro index 4baf66b..9a596cf 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -10,12 +10,19 @@ import Hero from "../components/Hero.astro"; import Navbar from "../components/Navbar.astro"; import Projects from "../components/Projects.astro"; import PostHog from "../components/posthog.astro"; +import ThemeTransition from "../components/ThemeTransition.astro"; --- + @@ -162,5 +169,6 @@ import PostHog from "../components/posthog.astro";