Initial layout and a few pages

This commit is contained in:
Emmaline Autumn 2023-10-01 09:12:12 -06:00
parent 6fc8381e6f
commit dc4c8efeb2
36 changed files with 22694 additions and 3041 deletions

18
.gitignore vendored
View File

@ -1,2 +1,18 @@
# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local
# Fresh build directory
_fresh/
# JAR files in case one shows up
**/*.jar
.vscode
fabric/
forge/
vanilla/
# Config file for MCGRIZZ
mcgrizz.json

6
.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,6 @@
{
"recommendations": [
"denoland.vscode-deno",
"sastan.twind-intellisense"
]
}

17
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,17 @@
{
"deno.enable": true,
"deno.lint": true,
"editor.defaultFormatter": "denoland.vscode-deno",
"[typescriptreact]": {
"editor.defaultFormatter": "denoland.vscode-deno"
},
"[typescript]": {
"editor.defaultFormatter": "denoland.vscode-deno"
},
"[javascriptreact]": {
"editor.defaultFormatter": "denoland.vscode-deno"
},
"[javascript]": {
"editor.defaultFormatter": "denoland.vscode-deno"
}
}

16
README.md Normal file
View File

@ -0,0 +1,16 @@
# Fresh project
Your new Fresh project is ready to go. You can follow the Fresh "Getting
Started" guide here: https://fresh.deno.dev/docs/getting-started
### Usage
Make sure to install Deno: https://deno.land/manual/getting_started/installation
Then start the project:
```
deno task start
```
This will watch the project directory and restart as necessary.

49
components/Button.tsx Normal file
View File

@ -0,0 +1,49 @@
import { JSX } from "preact";
import { IS_BROWSER } from "$fresh/runtime.ts";
const colors = {
licorice: {
bg: "bg-licorice",
border: "border-licorice-800",
text: "text-white",
},
sky: {
bg: "bg-sky",
border: "border-sky-800",
text: "text-white",
},
grape: {
bg: "bg-grape",
border: "border-grape-800",
text: "text-white",
},
fire: {
bg: "bg-grape",
border: "border-grape-800",
text: "text-white",
},
};
export function Button(
props: JSX.HTMLAttributes<HTMLButtonElement> & { color?: keyof typeof colors },
) {
const color = props.color || 'sky';
const classes = `
px-2
py-1
rounded-xl
border-2
${colors[color].bg}
${colors[color].border}
${colors[color].text}
hover:bg-smoke-500
transition-colors
${props.class || ""}`;
return (
<button
{...props}
disabled={(!IS_BROWSER && !props.href) || props.disabled}
class={classes}
/>
);
}

9
components/Content.tsx Normal file
View File

@ -0,0 +1,9 @@
import { VNode } from "preact";
export function Content(props: { children?: VNode | VNode[] }) {
return (
<div class="mt-16 bg-smoke-200 dark:bg-smoke-900 border-4 border-licorice-800 p-8 rounded-3xl">
{props.children}
</div>
);
}

19
components/OL.tsx Normal file
View File

@ -0,0 +1,19 @@
import { VNode, toChildArray } from "preact";
export function OL(props: {children?: VNode | VNode[], color?: string;}) {
const childs = toChildArray(props.children);
props.color = props.color || 'bg-sky';
return (
<ol>
{childs.map((c,i) => (
<li class="flex gap-4 p-1 even:bg-black/10">
<div class={`w-16 h-16 relative p-2 ${props.color} rounded-md text-white`}>
<span class="text-6xl font-pixel absolute -bottom-1 right-0 text-smoke-800/30">{i+1}</span>
<span class="text-5xl font-pixel">{i+1}</span>
</div>
{c}
</li>
))}
</ol>
)
}

26
components/nav/index.tsx Normal file
View File

@ -0,0 +1,26 @@
import { NavItem } from "../../types/nav.ts";
import { getNavItems } from "../../util/getNavItems.ts";
export function NavSection(props: { items: NavItem[] }) {
return (
<ul>
{props.items.map((i) => (
<li>
{i.children
? <NavSection items={i.children} />
: <a href={i.href} target={i.external ? "_blank" : ""}>{i.title}
</a>}
</li>
))}
</ul>
);
}
export function Nav() {
const navItems = getNavItems();
return (
<NavSection
items={navItems}
/>
);
}

39
deno.json Normal file
View File

@ -0,0 +1,39 @@
{
"lock": false,
"tasks": {
"check": "deno fmt --check && deno lint && deno check **/*.ts && deno check **/*.tsx",
"start": "tailwind -i ./static/styles/main.css -o ./static/styles/tailwind.css --minify --watch & deno run -A --watch=static/,routes/ dev.ts",
"build": "deno run -A dev.ts build",
"preview": "deno run -A main.ts",
"update": "deno run -A -r https://fresh.deno.dev/update ."
},
"lint": {
"rules": {
"tags": [
"fresh",
"recommended"
]
},
"exclude": [
"_fresh"
]
},
"fmt": {
"exclude": [
"_fresh"
]
},
"imports": {
"$fresh/": "https://deno.land/x/fresh@1.4.3/",
"preact": "https://esm.sh/preact@10.15.1",
"preact/": "https://esm.sh/preact@10.15.1/",
"preact-render-to-string": "https://esm.sh/*preact-render-to-string@6.2.1",
"@preact/signals": "https://esm.sh/*@preact/signals@1.1.3",
"@preact/signals-core": "https://esm.sh/*@preact/signals-core@1.2.3",
"$std/": "https://deno.land/std@0.193.0/"
},
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "preact"
}
}

8
dev.ts Executable file
View File

@ -0,0 +1,8 @@
#!/usr/bin/env -S deno run -A --watch=static/,routes/
import dev from "$fresh/dev.ts";
import config from "./fresh.config.ts";
import "$std/dotenv/load.ts";
await dev(import.meta.url, "./main.ts", config);

File diff suppressed because it is too large Load Diff

View File

@ -1,362 +0,0 @@
[
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.11.2/fabric-installer-0.11.2.jar",
"maven": "net.fabricmc:fabric-installer:0.11.2",
"version": "0.11.2",
"stable": true
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.11.1/fabric-installer-0.11.1.jar",
"maven": "net.fabricmc:fabric-installer:0.11.1",
"version": "0.11.1",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.11.0/fabric-installer-0.11.0.jar",
"maven": "net.fabricmc:fabric-installer:0.11.0",
"version": "0.11.0",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.10.2/fabric-installer-0.10.2.jar",
"maven": "net.fabricmc:fabric-installer:0.10.2",
"version": "0.10.2",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.10.1/fabric-installer-0.10.1.jar",
"maven": "net.fabricmc:fabric-installer:0.10.1",
"version": "0.10.1",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.10.0/fabric-installer-0.10.0.jar",
"maven": "net.fabricmc:fabric-installer:0.10.0",
"version": "0.10.0",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.9.1/fabric-installer-0.9.1.jar",
"maven": "net.fabricmc:fabric-installer:0.9.1",
"version": "0.9.1",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.9.0/fabric-installer-0.9.0.jar",
"maven": "net.fabricmc:fabric-installer:0.9.0",
"version": "0.9.0",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.8.3/fabric-installer-0.8.3.jar",
"maven": "net.fabricmc:fabric-installer:0.8.3",
"version": "0.8.3",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.8.2/fabric-installer-0.8.2.jar",
"maven": "net.fabricmc:fabric-installer:0.8.2",
"version": "0.8.2",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.8.1/fabric-installer-0.8.1.jar",
"maven": "net.fabricmc:fabric-installer:0.8.1",
"version": "0.8.1",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.8.0/fabric-installer-0.8.0.jar",
"maven": "net.fabricmc:fabric-installer:0.8.0",
"version": "0.8.0",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.7.4/fabric-installer-0.7.4.jar",
"maven": "net.fabricmc:fabric-installer:0.7.4",
"version": "0.7.4",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.7.3/fabric-installer-0.7.3.jar",
"maven": "net.fabricmc:fabric-installer:0.7.3",
"version": "0.7.3",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.7.2/fabric-installer-0.7.2.jar",
"maven": "net.fabricmc:fabric-installer:0.7.2",
"version": "0.7.2",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.7.1/fabric-installer-0.7.1.jar",
"maven": "net.fabricmc:fabric-installer:0.7.1",
"version": "0.7.1",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.6.1.51/fabric-installer-0.6.1.51.jar",
"maven": "net.fabricmc:fabric-installer:0.6.1.51",
"version": "0.6.1.51",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.6.1.50/fabric-installer-0.6.1.50.jar",
"maven": "net.fabricmc:fabric-installer:0.6.1.50",
"version": "0.6.1.50",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.6.1.49/fabric-installer-0.6.1.49.jar",
"maven": "net.fabricmc:fabric-installer:0.6.1.49",
"version": "0.6.1.49",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.6.1.48/fabric-installer-0.6.1.48.jar",
"maven": "net.fabricmc:fabric-installer:0.6.1.48",
"version": "0.6.1.48",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.6.1.47/fabric-installer-0.6.1.47.jar",
"maven": "net.fabricmc:fabric-installer:0.6.1.47",
"version": "0.6.1.47",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.6.1.46/fabric-installer-0.6.1.46.jar",
"maven": "net.fabricmc:fabric-installer:0.6.1.46",
"version": "0.6.1.46",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.6.1.45/fabric-installer-0.6.1.45.jar",
"maven": "net.fabricmc:fabric-installer:0.6.1.45",
"version": "0.6.1.45",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.6.1.44/fabric-installer-0.6.1.44.jar",
"maven": "net.fabricmc:fabric-installer:0.6.1.44",
"version": "0.6.1.44",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.6.0.43/fabric-installer-0.6.0.43.jar",
"maven": "net.fabricmc:fabric-installer:0.6.0.43",
"version": "0.6.0.43",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.6.0.42/fabric-installer-0.6.0.42.jar",
"maven": "net.fabricmc:fabric-installer:0.6.0.42",
"version": "0.6.0.42",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.6.0.41/fabric-installer-0.6.0.41.jar",
"maven": "net.fabricmc:fabric-installer:0.6.0.41",
"version": "0.6.0.41",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.5.2.40/fabric-installer-0.5.2.40.jar",
"maven": "net.fabricmc:fabric-installer:0.5.2.40",
"version": "0.5.2.40",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.5.2.39/fabric-installer-0.5.2.39.jar",
"maven": "net.fabricmc:fabric-installer:0.5.2.39",
"version": "0.5.2.39",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.5.2.38/fabric-installer-0.5.2.38.jar",
"maven": "net.fabricmc:fabric-installer:0.5.2.38",
"version": "0.5.2.38",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.5.1.37/fabric-installer-0.5.1.37.jar",
"maven": "net.fabricmc:fabric-installer:0.5.1.37",
"version": "0.5.1.37",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.5.1.36/fabric-installer-0.5.1.36.jar",
"maven": "net.fabricmc:fabric-installer:0.5.1.36",
"version": "0.5.1.36",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.5.0.35/fabric-installer-0.5.0.35.jar",
"maven": "net.fabricmc:fabric-installer:0.5.0.35",
"version": "0.5.0.35",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.5.0.34/fabric-installer-0.5.0.34.jar",
"maven": "net.fabricmc:fabric-installer:0.5.0.34",
"version": "0.5.0.34",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.5.0.33/fabric-installer-0.5.0.33.jar",
"maven": "net.fabricmc:fabric-installer:0.5.0.33",
"version": "0.5.0.33",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.5.0.32/fabric-installer-0.5.0.32.jar",
"maven": "net.fabricmc:fabric-installer:0.5.0.32",
"version": "0.5.0.32",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.5.0.31/fabric-installer-0.5.0.31.jar",
"maven": "net.fabricmc:fabric-installer:0.5.0.31",
"version": "0.5.0.31",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.5.0.30/fabric-installer-0.5.0.30.jar",
"maven": "net.fabricmc:fabric-installer:0.5.0.30",
"version": "0.5.0.30",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.5.0.29/fabric-installer-0.5.0.29.jar",
"maven": "net.fabricmc:fabric-installer:0.5.0.29",
"version": "0.5.0.29",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.4.2.28/fabric-installer-0.4.2.28.jar",
"maven": "net.fabricmc:fabric-installer:0.4.2.28",
"version": "0.4.2.28",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.4.2.27/fabric-installer-0.4.2.27.jar",
"maven": "net.fabricmc:fabric-installer:0.4.2.27",
"version": "0.4.2.27",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.4.2.26/fabric-installer-0.4.2.26.jar",
"maven": "net.fabricmc:fabric-installer:0.4.2.26",
"version": "0.4.2.26",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.4.2.25/fabric-installer-0.4.2.25.jar",
"maven": "net.fabricmc:fabric-installer:0.4.2.25",
"version": "0.4.2.25",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.4.2.24/fabric-installer-0.4.2.24.jar",
"maven": "net.fabricmc:fabric-installer:0.4.2.24",
"version": "0.4.2.24",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.4.2.23/fabric-installer-0.4.2.23.jar",
"maven": "net.fabricmc:fabric-installer:0.4.2.23",
"version": "0.4.2.23",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.4.1.22/fabric-installer-0.4.1.22.jar",
"maven": "net.fabricmc:fabric-installer:0.4.1.22",
"version": "0.4.1.22",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.4.0.21/fabric-installer-0.4.0.21.jar",
"maven": "net.fabricmc:fabric-installer:0.4.0.21",
"version": "0.4.0.21",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.4.0.20/fabric-installer-0.4.0.20.jar",
"maven": "net.fabricmc:fabric-installer:0.4.0.20",
"version": "0.4.0.20",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.4.0.19/fabric-installer-0.4.0.19.jar",
"maven": "net.fabricmc:fabric-installer:0.4.0.19",
"version": "0.4.0.19",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.4.0.18/fabric-installer-0.4.0.18.jar",
"maven": "net.fabricmc:fabric-installer:0.4.0.18",
"version": "0.4.0.18",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.3.0.17/fabric-installer-0.3.0.17.jar",
"maven": "net.fabricmc:fabric-installer:0.3.0.17",
"version": "0.3.0.17",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.3.0.16/fabric-installer-0.3.0.16.jar",
"maven": "net.fabricmc:fabric-installer:0.3.0.16",
"version": "0.3.0.16",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.3.0.15/fabric-installer-0.3.0.15.jar",
"maven": "net.fabricmc:fabric-installer:0.3.0.15",
"version": "0.3.0.15",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.2.4.14/fabric-installer-0.2.4.14.jar",
"maven": "net.fabricmc:fabric-installer:0.2.4.14",
"version": "0.2.4.14",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.2.3.12/fabric-installer-0.2.3.12.jar",
"maven": "net.fabricmc:fabric-installer:0.2.3.12",
"version": "0.2.3.12",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.2.2.11/fabric-installer-0.2.2.11.jar",
"maven": "net.fabricmc:fabric-installer:0.2.2.11",
"version": "0.2.2.11",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.2.2.10/fabric-installer-0.2.2.10.jar",
"maven": "net.fabricmc:fabric-installer:0.2.2.10",
"version": "0.2.2.10",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.2.1.9/fabric-installer-0.2.1.9.jar",
"maven": "net.fabricmc:fabric-installer:0.2.1.9",
"version": "0.2.1.9",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.2.1.8/fabric-installer-0.2.1.8.jar",
"maven": "net.fabricmc:fabric-installer:0.2.1.8",
"version": "0.2.1.8",
"stable": false
},
{
"url": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.2.0.7/fabric-installer-0.2.0.7.jar",
"maven": "net.fabricmc:fabric-installer:0.2.0.7",
"version": "0.2.0.7",
"stable": false
}
]

File diff suppressed because it is too large Load Diff

4
fresh.config.ts Normal file
View File

@ -0,0 +1,4 @@
import { defineConfig } from "$fresh/server.ts";
export default defineConfig({
plugins: []
});

26
fresh.gen.ts Normal file
View File

@ -0,0 +1,26 @@
// DO NOT EDIT. This file is generated by Fresh.
// This file SHOULD be checked into source version control.
// This file is automatically updated during development when running `dev.ts`.
import * as $0 from "./routes/_404.tsx";
import * as $1 from "./routes/_app.tsx";
import * as $2 from "./routes/api/joke.ts";
import * as $3 from "./routes/index.tsx";
import * as $4 from "./routes/setup/index.tsx";
import * as $$0 from "./islands/Counter.tsx";
const manifest = {
routes: {
"./routes/_404.tsx": $0,
"./routes/_app.tsx": $1,
"./routes/api/joke.ts": $2,
"./routes/index.tsx": $3,
"./routes/setup/index.tsx": $4,
},
islands: {
"./islands/Counter.tsx": $$0,
},
baseUrl: import.meta.url,
};
export default manifest;

16
islands/Counter.tsx Normal file
View File

@ -0,0 +1,16 @@
import type { Signal } from "@preact/signals";
import { Button } from "../components/Button.tsx";
interface CounterProps {
count: Signal<number>;
}
export default function Counter(props: CounterProps) {
return (
<div class="flex gap-8 py-6">
<Button color="fire" onClick={() => props.count.value -= 1}>-1</Button>
<p class="text-3xl">{props.count}</p>
<Button color="sky" onClick={() => props.count.value += 1}>+1</Button>
</div>
);
}

12
main.ts Normal file
View File

@ -0,0 +1,12 @@
/// <reference no-default-lib="true" />
/// <reference lib="dom" />
/// <reference lib="dom.iterable" />
/// <reference lib="dom.asynciterable" />
/// <reference lib="deno.ns" />
import "$std/dotenv/load.ts";
import { start } from "$fresh/server.ts";
import manifest from "./fresh.gen.ts";
await start(manifest);

25
routes/_404.tsx Normal file
View File

@ -0,0 +1,25 @@
import { Head } from "$fresh/runtime.ts";
export default function Error404() {
return (
<>
<Head>
<title>404 - Page not found</title>
</Head>
<div class="container w-full">
<div class="max-w-screen-md mx-auto flex flex-col items-center justify-center">
<img
class="my-6"
src="/bearcam.gif"
alt="a gif of a bear playing with the camera"
/>
<h1 class="text-4xl font-bold">404 - Page not found</h1>
<p class="my-4">
Looks like we couldn't find what you were looking for, but this bear found a camera!
</p>
<a href="/" class="underline text-sky">Go back home</a>
</div>
</div>
</>
);
}

50
routes/_app.tsx Normal file
View File

@ -0,0 +1,50 @@
import { AppProps } from "$fresh/server.ts";
import { Nav } from "../components/nav/index.tsx";
export default function App({ Component }: AppProps) {
return (
<html class="dark:bg-smoke dark:text-white">
<head>
<meta charSet="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="shortcut icon" href="cyborggrizzly.svg" type="image/svg" />
<title>MC GRIZZ</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link
rel="preconnect"
href="https://fonts.gstatic.com"
crossOrigin="true"
/>
<link
href="https://fonts.googleapis.com/css2?family=Titillium+Web:ital,wght@0,200;0,300;0,400;0,600;0,700;0,900;1,200;1,300;1,400;1,600;1,700&display=swap"
rel="stylesheet"
>
</link>
<link rel="stylesheet" href="/styles/tailwind.css" />
</head>
<body>
<div class="flex h-[100vh]">
<div class="h-full min-w-[400px] bg-licorice overflow-y-auto border-r-2 p-4 dark:border-sky-950 border-sky text-white flex flex-col">
<div class="flex items-center justify-center p-4 gap-4 mb-8 rounded-3xl bg-smoke-900 border border-sky-950">
<img src="cyborggrizzly.svg" alt="" height={100} width={100} />
<div>
<h1 class="text-4xl font-pixel">MC Grizz</h1>
<hr class="color-sky" />
<small>A Minecraft Server Manager</small>
</div>
</div>
<Nav />
<small class="mt-auto text-center">
Made with love by Emma@Cyborggrizzly 🏳
</small>
</div>
<div class="max-h-full flex-1">
<Component />
</div>
</div>
</body>
</html>
);
}

21
routes/api/joke.ts Normal file
View File

@ -0,0 +1,21 @@
import { HandlerContext } from "$fresh/server.ts";
// Jokes courtesy of https://punsandoneliners.com/randomness/programmer-jokes/
const JOKES = [
"Why do Java developers often wear glasses? They can't C#.",
"A SQL query walks into a bar, goes up to two tables and says “can I join you?”",
"Wasn't hard to crack Forrest Gump's password. 1forrest1.",
"I love pressing the F5 key. It's refreshing.",
"Called IT support and a chap from Australia came to fix my network connection. I asked “Do you come from a LAN down under?”",
"There are 10 types of people in the world. Those who understand binary and those who don't.",
"Why are assembly programmers often wet? They work below C level.",
"My favourite computer based band is the Black IPs.",
"What programme do you use to predict the music tastes of former US presidential candidates? An Al Gore Rhythm.",
"An SEO expert walked into a bar, pub, inn, tavern, hostelry, public house.",
];
export const handler = (_req: Request, _ctx: HandlerContext): Response => {
const randomIndex = Math.floor(Math.random() * JOKES.length);
const body = JOKES[randomIndex];
return new Response(body);
};

65
routes/index.tsx Normal file
View File

@ -0,0 +1,65 @@
import { Button } from "../components/Button.tsx";
import { Content } from "../components/Content.tsx";
import { OL } from "../components/OL.tsx";
export default function Home() {
return (
<div class="container p-8">
<Setup />
</div>
);
}
function Setup() {
return (
<Content>
<h2 class="text-2xl font-pixel">First Time Setup</h2>
<p>
Looks like this is your first time running{" "}
<span class="font-fixel">MC Grizz</span>
</p>
<p>There are just a few steps to get you up an running.</p>
<OL color="bg-grape">
<div>
<p class="font-pixel text-lg">Select your loader</p>
<p>Choose between Forge, Fabric, or Vanilla (support for Bukkit, Spigot, and others coming... soon...)</p>
</div>
<div>
<p class="font-pixel text-lg">Accept EULA</p>
<p>
Mojang requires you to accept their{" "}
<a
class="text-sky"
href="https://www.minecraft.net/en-us/eula"
target="_blank"
>
EULA
</a>{" "}
(End-User License Agreement) in order to be able to run a server.
</p>
</div>
<div>
<p class="font-pixel text-lg">Select Mods and Datapacks</p>
<p>
We'll show you a selection of preconfigured modpacks, mods, and
datapacks for you to choose for your server
</p>
</div>
<div>
<p class="font-pixel text-lg">Game On!</p>
<p>
Time to play! We'll finish setting everything up and give you the IP
address for you and your friends to connect.
</p>
</div>
</OL>
<div className="w-full">
<a href="/setup">
<Button href="/setup" color="sky" class="ml-auto mt-8 block font-pixel text-lg">
Get Started
</Button>
</a>
</div>
</Content>
);
}

25
routes/setup/index.tsx Normal file
View File

@ -0,0 +1,25 @@
import { Button } from "../../components/Button.tsx";
import { Content } from "../../components/Content.tsx";
export default function Setup() {
return (
<div class="container p-8">
<Content>
<h2 className="font-pixel text-2xl">Select Loader</h2>
<p>Choose between Forge, Fabric, or Vanilla</p>
<div class="m-auto flex gap-4 mt-4">
<a href="/setup/vanilla">
<Button>Vanilla</Button>
</a>
<a href="/setup/fabric">
<Button>Fabric</Button>
</a>
<a href="/setup/forge">
<Button>Forge</Button>
</a>
</div>
</Content>
</div>
);
}

BIN
static/Minecraft.ttf Normal file

Binary file not shown.

BIN
static/bearcam.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 MiB

22057
static/cyborggrizzly.svg Normal file

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

32
static/styles/main.css Normal file
View File

@ -0,0 +1,32 @@
@font-face {
font-family: 'Minecraft';
src: url('/fonts/minecraft/MinecraftRegular.otf');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'Minecraft';
src: url('/fonts/minecraft/MinecraftBold.otf');
font-weight: bold;
font-style: normal;
}
@font-face {
font-family: 'Minecraft';
src: url('/fonts/minecraft/MinecraftBoldItalic.otf');
font-weight: bold;
font-style: italic;
}
@font-face {
font-family: 'Minecraft';
src: url('/fonts/minecraft/MinecraftItalic.otf');
font-weight: normal;
font-style: italic;
}
@tailwind base;
@tailwind components;
@tailwind utilities;
* {
font-family: 'Titillium Web', sans-serif;
}

File diff suppressed because one or more lines are too long

104
tailwind.config.js Normal file
View File

@ -0,0 +1,104 @@
/** @type {import('https://esm.sh/tailwindcss@3.1.8').Config} */
module.exports = {
content: [
"./routes/**/*.{tsx,ts}",
"./islands/**/*.{tsx,ts}",
"./components/**/*.{tsx,ts}",
],
theme: {
extend: {
colors: {
"licorice": {
DEFAULT: "#160a16",
"50": "#f9f0fd",
"100": "#f4e3fc",
"200": "#edcdf8",
"300": "#e3aef3",
"400": "#dd8dec",
"500": "#d971e3",
"600": "#d456d5",
"700": "#bb47b9",
"800": "#963c97",
"900": "#783679",
"950": "#160a16",
},
"sky": {
DEFAULT: "#31a7e6",
"50": "#f1f8fe",
"100": "#e2f1fc",
"200": "#bfe2f8",
"300": "#87cbf2",
"400": "#31a7e6",
"500": "#1f96d8",
"600": "#1278b7",
"700": "#106094",
"800": "#11527b",
"900": "#144566",
"950": "#0d2c44",
},
"grape": {
DEFAULT: "#400a50",
"50": "#fbf5fe",
"100": "#f6eafd",
"200": "#ecd3fb",
"300": "#e0b1f6",
"400": "#cf82f0",
"500": "#b752e3",
"600": "#9d32c7",
"700": "#8426a5",
"800": "#6d2187",
"900": "#5c206f",
"950": "#400a50",
},
"fire": {
DEFAULT: "#e61c1c",
"50": "#fff1f1",
"100": "#ffe0e0",
"200": "#ffc7c7",
"300": "#ffa0a0",
"400": "#ff6969",
"500": "#f93a3a",
"600": "#e61c1c",
"700": "#d61515",
"800": "#a01414",
"900": "#851717",
"950": "#480707",
},
"smoke": {
DEFAULT: "#18181b",
"50": "#f7f7f8",
"100": "#eeeef0",
"200": "#d9d9de",
"300": "#b8b9c1",
"400": "#91939f",
"500": "#737584",
"600": "#5d5e6c",
"700": "#4c4d58",
"800": "#41414b",
"900": "#393941",
"950": "#18181b",
},
"wasabi": {
DEFAULT: "#808627",
"50": "#fafaeb",
"100": "#f3f2d4",
"200": "#e9e9ad",
"300": "#d7d97d",
"400": "#c3c754",
"500": "#a6ac36",
"600": "#808627",
"700": "#636922",
"800": "#4f5420",
"900": "#43481f",
"950": "#23270c",
},
},
fontFamily: {
pixel: "'Minecraft', cursive",
},
},
container: {
center: true,
},
},
};

5
types/mcgrizzconf.ts Normal file
View File

@ -0,0 +1,5 @@
export type Loader = 'forge' | 'fabric' | 'vanilla' | 'unset';
export type MCGrizzConf = {
loader: Loader
}

6
types/nav.ts Normal file
View File

@ -0,0 +1,6 @@
export type NavItem = {
title: string;
href: string;
external?: boolean;
children?: NavItem[]
}

27
util/getNavItems.ts Normal file
View File

@ -0,0 +1,27 @@
import { MCGrizzConf } from "../types/mcgrizzconf.ts";
import { NavItem } from "../types/nav.ts";
import { makeConfFile } from "./makeConfFile.ts";
/**
* @description Determines the state of setup and returns the nav items for that state
*/
export function getNavItems(): NavItem[] {
let conf: MCGrizzConf;
try {
conf = JSON.parse(Deno.readTextFileSync('mcgrizz.json'));
} catch {
conf = makeConfFile();
}
switch (conf.loader) {
case "unset":
return [{
title: 'Setup',
href: '/',
}]
case "forge":
case "fabric":
case "vanilla":
return [];
}
}

11
util/makeConfFile.ts Normal file
View File

@ -0,0 +1,11 @@
import { MCGrizzConf } from "../types/mcgrizzconf.ts";
export function makeConfFile(): MCGrizzConf {
const conf: MCGrizzConf = {
loader: 'unset',
}
Deno.writeTextFileSync('mcgrizz.json', JSON.stringify(conf), {create: true});
return conf;
}