diff --git a/apps/landing-page/src/sections/astro-section.astro b/apps/landing-page/src/components/astro-section.astro similarity index 100% rename from apps/landing-page/src/sections/astro-section.astro rename to apps/landing-page/src/components/astro-section.astro diff --git a/apps/landing-page/src/sections/splash.astro b/apps/landing-page/src/components/splash.astro similarity index 100% rename from apps/landing-page/src/sections/splash.astro rename to apps/landing-page/src/components/splash.astro diff --git a/apps/landing-page/src/sections/starfield.astro b/apps/landing-page/src/components/starfield.astro similarity index 100% rename from apps/landing-page/src/sections/starfield.astro rename to apps/landing-page/src/components/starfield.astro diff --git a/apps/landing-page/src/pages/index.astro b/apps/landing-page/src/pages/index.astro index f1b5c31..3ef3fbf 100644 --- a/apps/landing-page/src/pages/index.astro +++ b/apps/landing-page/src/pages/index.astro @@ -2,8 +2,9 @@ import "~/styles/index.css"; import Header from "~/components/header.astro"; // import Icon from "astro-icon"; -import Splash from "~/sections/splash.astro"; +import Splash from "~/components/splash.astro"; // import AstroSection from "~/sections/astro-section.astro"; +import Starfield from "~/components/starfield.astro"; const { site } = Astro; const image = new URL("social.jpg", site); @@ -57,20 +58,19 @@ const description = if (themeSaved) { document.documentElement.dataset.theme = themeSaved; } else { - const prefersDark = window.matchMedia( - "(prefers-color-scheme: dark)" - ).matches; - document.documentElement.dataset.theme = prefersDark ? "dark" : "light"; + // const prefersDark = window.matchMedia( + // "(prefers-color-scheme: dark)" + // ).matches; + document.documentElement.dataset.theme = forceTheme; // prefersDark ? "dark" : "light"; } window .matchMedia("(prefers-color-scheme: dark)") .addEventListener("change", (event) => { if (!localStorage.getItem("theme")) { - document.documentElement.dataset.theme = forceTheme; - // event.matches - // ? "dark" - // : "light"; + document.documentElement.dataset.theme = event.matches + ? "dark" + : "light"; } }); @@ -78,8 +78,9 @@ const description = +
- +