diff --git a/config.json b/config.json index 35612fb..f8de304 100644 --- a/config.json +++ b/config.json @@ -11,6 +11,7 @@ }, "backgroundImage": "https://cdn.fascinated.cc/8twdW8.jpg" }, + "theme": "dark", "infoCard": { "transparency": 0.85 }, diff --git a/src/app/page.tsx b/src/app/page.tsx index 5c6570c..2099e12 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -9,12 +9,40 @@ import Config from "../../config.json"; library.add(fab, far, fas); // Loading in the icons from FontAwesome export default function Home() { - const { background, infoCard, avatar, name, links, options, description } = - Config; // All of the settings pulled from the config file + const { + background, + infoCard, + avatar, + name, + links, + options, + description, + theme = "dark", // Fallback to dark if no theme was found + } = Config; // All of the settings pulled from the config file + + // Theme colors to use when using the selected theme + const themeColors: { + [key: string]: { + background: string; + textColor: string; + }; + } = { + dark: { + background: "bg-neutral-900", + textColor: "text-white", + }, + light: { + background: "bg-white", + textColor: "text-black", + }, + }; + const selectedTheme = themeColors[theme]; // The theme to use return ( <> -
+
{link.icon && ( <>