From 85c31ee8d278ac6fa1f0ba143b78d65e5f665f32 Mon Sep 17 00:00:00 2001 From: Tyler Flowers Date: Sun, 26 Nov 2023 15:57:52 -0500 Subject: initial cleanup --- apps/website/config.ts | 36 - apps/website/package.json | 2 +- apps/website/public/media/index/index1.svg | 10 + apps/website/public/media/index/index2.svg | 11 + apps/website/public/media/index/index3.svg | 105 + apps/website/src/components/base/Button.astro | 3 +- apps/website/src/components/base/CodeBlock.astro | 70 +- apps/website/src/components/base/Section.astro | 6 +- apps/website/src/components/logos/Logo.astro | 7 +- apps/website/src/layouts/Layout.astro | 1 + apps/website/src/pages/index.astro | 138 +- apps/website/tailwind.config.cjs | 3 + apps/website/yarn.lock | 3815 ++++++++++++++++++++++ 13 files changed, 4019 insertions(+), 188 deletions(-) create mode 100644 apps/website/public/media/index/index1.svg create mode 100644 apps/website/public/media/index/index2.svg create mode 100644 apps/website/public/media/index/index3.svg create mode 100644 apps/website/yarn.lock diff --git a/apps/website/config.ts b/apps/website/config.ts index 19c92a4..b483705 100644 --- a/apps/website/config.ts +++ b/apps/website/config.ts @@ -28,42 +28,6 @@ export const configConst = { function getProjects(): Project[] { return [ - { - name: 'OneConfig', - description: 'The next-generation config library for Forge and Fabric', - logo: 'oneconfig.minimal', - tag: 'BETA' - }, - { - name: 'OneLauncher', - description: 'The next-generation launcher for Forge and Fabric', - logo: 'polyfrost.minimal', - tag: 'SOON' - }, - { - name: 'OneConfig', - description: 'The next-generation config library for Forge and Fabric', - logo: 'oneconfig.minimal', - tag: 'BETA' - }, - { - name: 'OneLauncher', - description: 'The next-generation launcher for Forge and Fabric', - logo: 'polyfrost.minimal', - tag: 'SOON' - }, - { - name: 'OneConfig', - description: 'The next-generation config library for Forge and Fabric', - logo: 'oneconfig.minimal', - tag: 'BETA' - }, - { - name: 'OneLauncher', - description: 'The next-generation launcher for Forge and Fabric', - logo: 'polyfrost.minimal', - tag: 'SOON' - }, { name: 'OneConfig', description: 'The next-generation config library for Forge and Fabric', diff --git a/apps/website/package.json b/apps/website/package.json index 7d10673..0cd0c4e 100644 --- a/apps/website/package.json +++ b/apps/website/package.json @@ -14,7 +14,7 @@ "tailwindcss": "^3.3.3" }, "devDependencies": { - "@polyfrost/config": "workspace:*", + "@polyfrost/config": "../../packages/config", "@types/node": "~18.17.19", "node-html-parser": "^6.1.10", "typescript": "^5.2.2" diff --git a/apps/website/public/media/index/index1.svg b/apps/website/public/media/index/index1.svg new file mode 100644 index 0000000..46c9513 --- /dev/null +++ b/apps/website/public/media/index/index1.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/apps/website/public/media/index/index2.svg b/apps/website/public/media/index/index2.svg new file mode 100644 index 0000000..4abfa8b --- /dev/null +++ b/apps/website/public/media/index/index2.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/apps/website/public/media/index/index3.svg b/apps/website/public/media/index/index3.svg new file mode 100644 index 0000000..fc10294 --- /dev/null +++ b/apps/website/public/media/index/index3.svg @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/website/src/components/base/Button.astro b/apps/website/src/components/base/Button.astro index adbc656..0a4dc9f 100644 --- a/apps/website/src/components/base/Button.astro +++ b/apps/website/src/components/base/Button.astro @@ -4,8 +4,9 @@ import Icon from "@components/icons/Icon.astro"; import type { HTMLAttributes } from "astro/types"; const styles = { + // TODO: adjust active / disabled colors primary: "bg-blue-500 text-white hover:bg-blue-400 active:bg-blue-600 disabled:bg-blue-800 disabled:text-white-1/4", - secondary: "bg-blue-100 text-blue-500 hover:bg-blue-200 active:bg-blue-300 disabled:bg-blue-50 disabled:text-blue-200", + secondary: "bg-blue-20 text-blue-60 border-[1px] border-blue-30 hover:bg-blue-200 active:bg-blue-300 disabled:bg-blue-50 disabled:text-blue-200", } const sizes = { diff --git a/apps/website/src/components/base/CodeBlock.astro b/apps/website/src/components/base/CodeBlock.astro index 5991428..ceeecc0 100644 --- a/apps/website/src/components/base/CodeBlock.astro +++ b/apps/website/src/components/base/CodeBlock.astro @@ -2,20 +2,62 @@ --- -
-	{`public class MyConfig {
-
-	@Switch(name = "Sub Switch", type = OptionType.SWITCH)
-	public static boolean subSwitch = false;
-
-	public MyConfig() {
-		super(new Mod("My Mod", ModType.UTIL_QOL), "config.json");
+
+	
+	public class MyConfig {
+	
+	    @Switch(name = "Sub Switch", type = OptionType.SWITCH)
+	    public static boolean subSwitch = false;
+	
+	    public MyConfig() {
+	        super(new Mod("My Mod", ModType.UTIL_QOL), "config.json");
+	
+	        addDependency("subSwitch", () -> {
+	            // Do stuff here!
+	        });
+	    }
+	
+	}
+
- addDependency("subSwitch", () -> { - // TODO: Make codeblocks better lmao - }); + diff --git a/apps/website/src/components/base/Section.astro b/apps/website/src/components/base/Section.astro index 0d177ef..bb7a062 100644 --- a/apps/website/src/components/base/Section.astro +++ b/apps/website/src/components/base/Section.astro @@ -5,23 +5,25 @@ interface Props extends HTMLAttributes<"section"> { maxWidth?: "none" | String; colReverse?: boolean; wrapperClass?: string; + wFull?: boolean; } const { maxWidth = "1080px", colReverse = true, wrapperClass = "", + wFull = true, ...props } = Astro.props; const twoColumn = Astro.slots.has("left") || Astro.slots.has("right"); -const className = `max-w-[${maxWidth}] w-full px-5 md:p-0 flex gap-4` +const className = `max-w-[${maxWidth}] ${wFull ? "w-full" : ""} px-5 md:p-0 flex gap-4` + (twoColumn ? ` ${maxWidth == "none" ? "justify-center" : "justify-between md:justify-evenly lg:justify-between"} ${colReverse ? "flex-col-reverse" : "flex-col"} md:flex-row md:items-center md:flex-row` : "") + (props.class ? ` ${props.class}` : ""); --- -
+
{twoColumn ? (
diff --git a/apps/website/src/components/logos/Logo.astro b/apps/website/src/components/logos/Logo.astro index 2fd6bea..0b72b91 100644 --- a/apps/website/src/components/logos/Logo.astro +++ b/apps/website/src/components/logos/Logo.astro @@ -1,7 +1,5 @@ --- import type { LogoType } from "@webtypes/Config"; -import { dirname } from "path"; -import { fileURLToPath } from "url"; import type { HTMLAttributes } from "astro/types"; export interface Props extends HTMLAttributes<"svg"> { @@ -20,7 +18,7 @@ let svg: string | undefined; try { if (logo == undefined) return; - const dir = dirname(fileURLToPath(import.meta.url)) + "/../../../public/media"; + const dir = "../../../public/media"; svg = (await import(`${dir}/${logo.replaceAll(".", "/")}.svg?raw` /* @vite-ignore */)).default; if (svg == undefined) return; @@ -44,7 +42,8 @@ try { svg = svg.replace(/ `${key}="${value}"`).join(" ")}`); } catch (err) { - + console.error(`Error occurred while loading SVG. Logo name is ${logo}.`) + console.error(err); } --- diff --git a/apps/website/src/layouts/Layout.astro b/apps/website/src/layouts/Layout.astro index 298071d..51b9922 100644 --- a/apps/website/src/layouts/Layout.astro +++ b/apps/website/src/layouts/Layout.astro @@ -27,6 +27,7 @@ const { + {title} diff --git a/apps/website/src/pages/index.astro b/apps/website/src/pages/index.astro index 87ee0eb..30b3ee6 100644 --- a/apps/website/src/pages/index.astro +++ b/apps/website/src/pages/index.astro @@ -27,32 +27,14 @@ import CodeBlock from "@components/base/CodeBlock.astro"; Modding Minecraft has always been difficult, particularly with their configuration. Remembering all of the keybinds, commands; it just isn't intuitive.
- - - - - - - - - - + + stuff
- - - - - - - - - - - + stuff
@@ -68,123 +50,19 @@ import CodeBlock from "@components/base/CodeBlock.astro";
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + stuff
-
+
-
Written for developers
- - OneConfig's API was designed to give developers all of the tools available in the simplest way possible +
Written for developers
+ + With Polyfrost's simple APIs, it's easy to integrate your mods into Polyfrost something