@@ -350,6 +347,7 @@ const menuItems: MenuItem[] = [
href="https://github.com/rommapp/marketing-site"
target="_blank"
class="text-900 hover:text-purple-500 text-end"
+ label="github repository"
>
@@ -377,12 +375,26 @@ const menuItems: MenuItem[] = [
}
#discord {
- background: rgb(2, 6, 23);
background: linear-gradient(
128deg,
- rgba(2, 6, 23, 1) 0%,
- rgba(23, 2, 40, 1) 50%,
- rgba(2, 6, 23, 1) 100%
+ theme("colors.purple.50") 0%,
+ theme("colors.purple.100") 50%,
+ theme("colors.purple.50") 100%
);
+
+ @media (prefers-color-scheme: dark) {
+ background: linear-gradient(
+ 128deg,
+ theme("colors.slate.950") 0%,
+ #1d0332 50%,
+ theme("colors.slate.950") 100%
+ );
+ }
+}
+
+.footer-logo {
+ @media (prefers-color-scheme: light) {
+ filter: invert(1);
+ }
}
diff --git a/assets/css/tailwind.css b/assets/css/tailwind.css
index 64faa7f..0d03f75 100644
--- a/assets/css/tailwind.css
+++ b/assets/css/tailwind.css
@@ -8,5 +8,7 @@
}
body {
- background-color: rgb(2 6 23);
+ @media (prefers-color-scheme: dark) {
+ background-color: theme("colors.slate.950");
+ }
}
diff --git a/nuxt.config.ts b/nuxt.config.ts
index caff79c..a849f78 100644
--- a/nuxt.config.ts
+++ b/nuxt.config.ts
@@ -19,18 +19,17 @@ export default defineNuxtConfig({
nitro: {
preset: "github-pages",
},
- css: ["primevue/resources/themes/aura-dark-purple/theme.css"],
image: {
quality: 80,
- format: ['webp'],
- provider: 'ipx',
+ format: ["webp"],
+ provider: "ipx",
presets: {
responsive: {
modifiers: {
- format: 'webp'
- }
- }
- }
+ format: "webp",
+ },
+ },
+ },
},
app: {
head: {
@@ -41,6 +40,19 @@ export default defineNuxtConfig({
charset: "utf-8",
viewport: "width=device-width, initial-scale=1",
title: "The RomM Project",
+ link: [
+ {
+ rel: "stylesheet",
+ href: "https://unpkg.com/primevue@3.52.0/resources/themes/aura-light-purple/theme.css",
+ id: "theme-link",
+ },
+ ],
+ script: [
+ {
+ children:
+ 'let m=window.matchMedia("(prefers-color-scheme: dark)");if(m.matches){const e=document.getElementById("theme-link");e.href=e.href.replace("light","dark");document.documentElement.classList.add("dark")}',
+ },
+ ],
meta: [
{ name: "author", content: "The RomM Team" },
{ name: "keywords", content: "romm, rom, manager, game, collection" },
diff --git a/plugins/theme.ts b/plugins/theme.ts
index d89ab32..d43f97b 100644
--- a/plugins/theme.ts
+++ b/plugins/theme.ts
@@ -4,11 +4,27 @@ export default defineNuxtPlugin((nuxtApp) => {
if (process.client) {
const { $primevue } = nuxtApp.vueApp.config.globalProperties;
$primevue.config.ripple = true;
-
+
const mediaMatch = window.matchMedia("(prefers-color-scheme: dark)");
function handleColorSchemeChange(matches: boolean) {
// Set the theme in the runtime config
nuxtApp.$config.theme = matches ? "dark" : "light";
+
+ if (matches) {
+ $primevue.changeTheme(
+ "aura-light-purple",
+ "aura-dark-purple",
+ "theme-link"
+ );
+ document.documentElement.classList.add("dark");
+ } else {
+ $primevue.changeTheme(
+ "aura-dark-purple",
+ "aura-light-purple",
+ "theme-link"
+ );
+ document.documentElement.classList.remove("dark");
+ }
}
// Call the function initially to set the correct theme