From 19481a5783359d383291ec49b1da054301f25315 Mon Sep 17 00:00:00 2001 From: Terencio Agozzino Date: Sat, 31 Oct 2026 18:43:49 +0100 Subject: [PATCH] feat(theme): switch to evening at sunset, not at 19:00 Day and evening now follow the sun where the visitor is (Brussels for its neighbours, else the middle of their time zone), and an open page darkens at sunset. Fixed hours left the site light two hours after an autumn sunset, and dark three hours before a June one. Co-Authored-By: Claude Opus 5.5 --- src/layouts/Base.astro | 58 ++++++++++++++++++++++++++++++++---------- tests/site.spec.ts | 7 ++++- 2 files changed, 51 insertions(+), 14 deletions(-) diff --git a/src/layouts/Base.astro b/src/layouts/Base.astro index e24b57f..eebaa30 100644 --- a/src/layouts/Base.astro +++ b/src/layouts/Base.astro @@ -34,15 +34,11 @@ const jsonLd = { diff --git a/tests/site.spec.ts b/tests/site.spec.ts index 8fd02a3..ae7f748 100644 --- a/tests/site.spec.ts +++ b/tests/site.spec.ts @@ -151,10 +151,15 @@ const themes = [ { at: '2026-10-15T22:00:00+02:00', season: 'autumn', time: 'evening', bg: '#1d1712' }, { at: '2027-01-15T10:00:00+01:00', season: 'winter', time: 'day', bg: '#ece8da' }, { at: '2027-01-15T22:00:00+01:00', season: 'winter', time: 'evening', bg: '#11172a' }, + // Day and evening follow the sun in Brussels, not fixed hours: dark soon + // after a 17:20 sunset in autumn, still light at 21:30 in June. + { at: '2026-10-31T17:45:00+01:00', season: 'autumn', time: 'evening', bg: '#1d1712' }, + { at: '2026-06-21T21:30:00+02:00', season: 'autumn', time: 'day', bg: '#f4f0e2' }, + { at: '2026-12-21T08:15:00+01:00', season: 'winter', time: 'evening', bg: '#11172a' }, ]; for (const { at, season, time, bg } of themes) { - test(`picks the ${season} ${time} theme from the clock`, async ({ page }) => { + test(`picks the ${season} ${time} theme at ${at}`, async ({ page }) => { await page.clock.setFixedTime(new Date(at)); await page.goto('/');