diff --git a/Frontend/bun.lockb b/Frontend/bun.lockb index 40c3a24..8174155 100644 Binary files a/Frontend/bun.lockb and b/Frontend/bun.lockb differ diff --git a/Frontend/config.json b/Frontend/config.json index f2ff49e..7f0bf66 100644 --- a/Frontend/config.json +++ b/Frontend/config.json @@ -32,6 +32,7 @@ "navbarLinks": { "Player": "/player", "Server": "/player", - "Mojang": "/mojang" + "Mojang": "/mojang", + "Docs": "/docs" } } diff --git a/Frontend/package.json b/Frontend/package.json index b1cd836..28865c9 100644 --- a/Frontend/package.json +++ b/Frontend/package.json @@ -27,13 +27,14 @@ "tailwindcss-animate": "^1.0.7" }, "devDependencies": { - "typescript": "^5", "@types/node": "^20", "@types/react": "^18", "@types/react-dom": "^18", - "postcss": "^8", - "tailwindcss": "^3.4.1", "eslint": "^8", - "eslint-config-next": "14.2.1" + "eslint-config-next": "14.2.1", + "postcss": "^8", + "sleep-promise": "^9.1.0", + "tailwindcss": "^3.4.1", + "typescript": "^5" } } diff --git a/Frontend/src/app/(pages)/layout.tsx b/Frontend/src/app/(pages)/layout.tsx index 163f9f0..c66e991 100644 --- a/Frontend/src/app/(pages)/layout.tsx +++ b/Frontend/src/app/(pages)/layout.tsx @@ -1,11 +1,11 @@ import Navbar from "@/components/navbar"; import { TooltipProvider } from "@/components/ui/tooltip"; import config from "@/config"; +import { notoSans } from "@/font/fonts"; import { cn } from "@/lib/utils"; import ThemeProvider from "@/provider/theme-provider"; import type { Metadata, Viewport } from "next"; import PlausibleProvider from "next-plausible"; -import { Noto_Sans } from "next/font/google"; import "../globals.css"; /** @@ -14,11 +14,6 @@ import "../globals.css"; export const metadata: Metadata = config.metadata; export const viewport: Viewport = config.viewport; -/** - * The default Minecraft font to use. - */ -const notoSans = Noto_Sans({ subsets: ["latin"] }); - /** * The root layout for this site. * diff --git a/Frontend/src/app/components/github-star-count.tsx b/Frontend/src/app/components/github-star-count.tsx new file mode 100644 index 0000000..e0d2c32 --- /dev/null +++ b/Frontend/src/app/components/github-star-count.tsx @@ -0,0 +1,28 @@ +/** + * The github star count component. + * + * @returns the star count jsx + */ +const GitHubStarCount = async (): Promise => { + const stars: number = await getStarCount(); // Get the repo star count + return ( + {stars} + ); +}; + +/** + * Get the amount of stars + * the repository has. + * + * @returns the star count + */ +const getStarCount = async (): Promise => { + const response: Response = await fetch( + "https://api.github.com/repos/Rainnny7/RESTfulMC", + { next: { revalidate: 300 } } // Revalidate every 5 minutes + ); + const json: any = await response.json(); // Get the JSON response + return json.stargazers_count; // Return the stars +}; + +export default GitHubStarCount; diff --git a/Frontend/src/app/components/landing/featured-content.tsx b/Frontend/src/app/components/landing/featured-content.tsx index 74a73ca..4958536 100644 --- a/Frontend/src/app/components/landing/featured-content.tsx +++ b/Frontend/src/app/components/landing/featured-content.tsx @@ -3,30 +3,12 @@ import { cn } from "@/lib/utils"; import Link from "next/link"; const FeaturedContent = (): JSX.Element => ( -
+
- - -
@@ -46,7 +28,7 @@ const FeaturedItem = ({ }): JSX.Element => ( diff --git a/Frontend/src/app/components/landing/hero.tsx b/Frontend/src/app/components/landing/hero.tsx index d184037..752ca16 100644 --- a/Frontend/src/app/components/landing/hero.tsx +++ b/Frontend/src/app/components/landing/hero.tsx @@ -1,18 +1,34 @@ +import MinecraftButton from "@/components/minecraft-button"; import config from "@/config"; import { minecrafter } from "@/font/fonts"; import { cn } from "@/lib/utils"; +import Link from "next/link"; +/** + * The hero content. + * + * @returns the hero jsx + */ const Hero = (): JSX.Element => ( -
- {/* Title */} -

- {config.siteName} -

+
+
+ {/* Title */} +

+ {config.siteName} +

- {/* Subtitle */} -

{config.metadata.description}

+ {/* Subtitle */} +

{config.metadata.description}

+
+ + {/* Links */} +
+ + Get Started + +
); export default Hero; diff --git a/Frontend/src/app/components/navbar.tsx b/Frontend/src/app/components/navbar.tsx index 6a9be54..2f28b30 100644 --- a/Frontend/src/app/components/navbar.tsx +++ b/Frontend/src/app/components/navbar.tsx @@ -1,10 +1,13 @@ +import GitHubStarCount from "@/components/github-star-count"; import MinecraftButton from "@/components/minecraft-button"; +import { Skeleton } from "@/components/ui/skeleton"; import config from "@/config"; import { minecrafter } from "@/font/fonts"; import { cn } from "@/lib/utils"; import { StarIcon } from "@heroicons/react/24/outline"; import Image from "next/image"; import Link from "next/link"; +import { Suspense } from "react"; /** * The navbar for the site. @@ -25,7 +28,7 @@ const Navbar = (): JSX.Element => ( > {/* Small Screens */} Site Logo ( /> {/* Large Screens */} - {config.siteName} + {config.siteName} {/* Links */} @@ -51,14 +54,23 @@ const Navbar = (): JSX.Element => (
{/* Social Buttons */} -
+
{/* Star on Github <3 */} - + - + {/* Star Count */} + }> + + + + Star on GitHub diff --git a/Frontend/src/app/components/ui/skeleton.tsx b/Frontend/src/app/components/ui/skeleton.tsx new file mode 100644 index 0000000..cebdb00 --- /dev/null +++ b/Frontend/src/app/components/ui/skeleton.tsx @@ -0,0 +1,15 @@ +import { cn } from "@/app/lib/utils" + +function Skeleton({ + className, + ...props +}: React.HTMLAttributes) { + return ( +
+ ) +} + +export { Skeleton } diff --git a/Frontend/src/app/font/fonts.ts b/Frontend/src/app/font/fonts.ts index 0f75a29..164a5fd 100644 --- a/Frontend/src/app/font/fonts.ts +++ b/Frontend/src/app/font/fonts.ts @@ -1,8 +1,15 @@ +import { NextFont } from "next/dist/compiled/@next/font"; +import { Noto_Sans } from "next/font/google"; import localFont from "next/font/local"; /** - * The title font to use to brand the site. + * The default font to use for the site. */ -export const minecrafter = localFont({ +export const notoSans: NextFont = Noto_Sans({ subsets: ["latin"] }); + +/** + * The Minecraft font to use for the site. + */ +export const minecrafter: NextFont = localFont({ src: "../font/Minecrafter.ttf", });