initial commit
Change-Id: Ibd100e188a43c1d92d2bc8c940b10f9127ead5d8
Reviewed-on: https://git.clicks.codes/c/Coded/ddwiki/+/86
Reviewed-by: Samuel Shuert <coded@clicks.codes>
Tested-by: Samuel Shuert <coded@clicks.codes>
diff --git a/.gitreview b/.gitreview
new file mode 100644
index 0000000..81dee96
--- /dev/null
+++ b/.gitreview
@@ -0,0 +1,5 @@
+[gerrit]
+host=ssh.clicks.codes
+port=29418
+defaultbranch=main
+project=Coded/ddwiki.git
diff --git a/app/characters/Leonel%20Morales/page.tsx b/app/characters/Leonel%20Morales/page.tsx
new file mode 100644
index 0000000..02a57fb
--- /dev/null
+++ b/app/characters/Leonel%20Morales/page.tsx
@@ -0,0 +1,10 @@
+export default function Leonel() {
+ return (
+ <>
+ <main className="flex min-h-screen flex-col justify-between bg-slate-900">
+ test
+ </main>
+ </>
+ )
+ }
+
\ No newline at end of file
diff --git "a/app/characters/\133tag\135.ts" "b/app/characters/\133tag\135.ts"
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ "b/app/characters/\133tag\135.ts"
diff --git a/app/globals.css b/app/globals.css
index fd81e88..b63fff7 100644
--- a/app/globals.css
+++ b/app/globals.css
@@ -3,25 +3,16 @@
@tailwind utilities;
:root {
- --foreground-rgb: 0, 0, 0;
- --background-start-rgb: 214, 219, 220;
- --background-end-rgb: 255, 255, 255;
+ --foreground-rgb: #5c5c5c;
}
@media (prefers-color-scheme: dark) {
:root {
--foreground-rgb: 255, 255, 255;
- --background-start-rgb: 0, 0, 0;
- --background-end-rgb: 0, 0, 0;
}
}
body {
color: rgb(var(--foreground-rgb));
- background: linear-gradient(
- to bottom,
- transparent,
- rgb(var(--background-end-rgb))
- )
- rgb(var(--background-start-rgb));
+ background: rgb(var(--foreground-rgb));
}
diff --git a/app/layout.tsx b/app/layout.tsx
index 40e027f..60246bf 100644
--- a/app/layout.tsx
+++ b/app/layout.tsx
@@ -1,12 +1,12 @@
import type { Metadata } from 'next'
import { Inter } from 'next/font/google'
import './globals.css'
-
const inter = Inter({ subsets: ['latin'] })
+import NavBar from '@/components/NavBar'
export const metadata: Metadata = {
- title: 'Create Next App',
- description: 'Generated by create next app',
+ title: 'DDWiki',
+ description: 'Dimensional Descent Wiki',
}
export default function RootLayout({
@@ -16,7 +16,10 @@
}) {
return (
<html lang="en">
- <body className={inter.className}>{children}</body>
+ <body className={inter.className}>
+ <NavBar />
+ {children}
+ </body>
</html>
)
}
diff --git a/app/page.tsx b/app/page.tsx
index e396bc7..63f95d4 100644
--- a/app/page.tsx
+++ b/app/page.tsx
@@ -1,113 +1,9 @@
-import Image from 'next/image'
-
export default function Home() {
return (
- <main className="flex min-h-screen flex-col items-center justify-between p-24">
- <div className="z-10 max-w-5xl w-full items-center justify-between font-mono text-sm lg:flex">
- <p className="fixed left-0 top-0 flex w-full justify-center border-b border-gray-300 bg-gradient-to-b from-zinc-200 pb-6 pt-8 backdrop-blur-2xl dark:border-neutral-800 dark:bg-zinc-800/30 dark:from-inherit lg:static lg:w-auto lg:rounded-xl lg:border lg:bg-gray-200 lg:p-4 lg:dark:bg-zinc-800/30">
- Get started by editing
- <code className="font-mono font-bold">app/page.tsx</code>
- </p>
- <div className="fixed bottom-0 left-0 flex h-48 w-full items-end justify-center bg-gradient-to-t from-white via-white dark:from-black dark:via-black lg:static lg:h-auto lg:w-auto lg:bg-none">
- <a
- className="pointer-events-none flex place-items-center gap-2 p-8 lg:pointer-events-auto lg:p-0"
- href="https://vercel.com?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
- target="_blank"
- rel="noopener noreferrer"
- >
- By{' '}
- <Image
- src="/vercel.svg"
- alt="Vercel Logo"
- className="dark:invert"
- width={100}
- height={24}
- priority
- />
- </a>
- </div>
- </div>
-
- <div className="relative flex place-items-center before:absolute before:h-[300px] before:w-[480px] before:-translate-x-1/2 before:rounded-full before:bg-gradient-radial before:from-white before:to-transparent before:blur-2xl before:content-[''] after:absolute after:-z-20 after:h-[180px] after:w-[240px] after:translate-x-1/3 after:bg-gradient-conic after:from-sky-200 after:via-blue-200 after:blur-2xl after:content-[''] before:dark:bg-gradient-to-br before:dark:from-transparent before:dark:to-blue-700 before:dark:opacity-10 after:dark:from-sky-900 after:dark:via-[#0141ff] after:dark:opacity-40 before:lg:h-[360px] z-[-1]">
- <Image
- className="relative dark:drop-shadow-[0_0_0.3rem_#ffffff70] dark:invert"
- src="/next.svg"
- alt="Next.js Logo"
- width={180}
- height={37}
- priority
- />
- </div>
-
- <div className="mb-32 grid text-center lg:max-w-5xl lg:w-full lg:mb-0 lg:grid-cols-4 lg:text-left">
- <a
- href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
- className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
- target="_blank"
- rel="noopener noreferrer"
- >
- <h2 className={`mb-3 text-2xl font-semibold`}>
- Docs{' '}
- <span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
- ->
- </span>
- </h2>
- <p className={`m-0 max-w-[30ch] text-sm opacity-50`}>
- Find in-depth information about Next.js features and API.
- </p>
- </a>
-
- <a
- href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
- className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
- target="_blank"
- rel="noopener noreferrer"
- >
- <h2 className={`mb-3 text-2xl font-semibold`}>
- Learn{' '}
- <span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
- ->
- </span>
- </h2>
- <p className={`m-0 max-w-[30ch] text-sm opacity-50`}>
- Learn about Next.js in an interactive course with quizzes!
- </p>
- </a>
-
- <a
- href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
- className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
- target="_blank"
- rel="noopener noreferrer"
- >
- <h2 className={`mb-3 text-2xl font-semibold`}>
- Templates{' '}
- <span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
- ->
- </span>
- </h2>
- <p className={`m-0 max-w-[30ch] text-sm opacity-50`}>
- Explore starter templates for Next.js.
- </p>
- </a>
-
- <a
- href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
- className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
- target="_blank"
- rel="noopener noreferrer"
- >
- <h2 className={`mb-3 text-2xl font-semibold`}>
- Deploy{' '}
- <span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
- ->
- </span>
- </h2>
- <p className={`m-0 max-w-[30ch] text-sm opacity-50`}>
- Instantly deploy your Next.js site to a shareable URL with Vercel.
- </p>
- </a>
- </div>
- </main>
+ <>
+ <main className="flex min-h-screen flex-col justify-between bg-slate-900">
+
+ </main>
+ </>
)
}
diff --git a/components/NavBar.tsx b/components/NavBar.tsx
new file mode 100644
index 0000000..7c846c9
--- /dev/null
+++ b/components/NavBar.tsx
@@ -0,0 +1,112 @@
+"use client"
+import { default as Image } from 'next/image'
+import { useRouter } from 'next/navigation'
+import { ReactNode, useState } from 'react'
+
+function SubgroupItem({
+ title,
+ router
+}: {
+ title: string,
+ router: ReturnType<typeof useRouter>
+}) {
+ return (
+ <div
+ className="cursor-pointer text-slate-200 hover:bg-white hover:bg-opacity-5 px-2 py-1 rounded"
+ onClick={() => void router.push(title.toLowerCase())}
+ >
+ {title}
+ </div>
+ )
+}
+
+function Subgroup({
+ title,
+ children,
+ router
+}: {
+ title: string,
+ children: ReactNode,
+ router: ReturnType<typeof useRouter>
+}) {
+ const [showChild, setShowChild] = useState<boolean>(false)
+ return (
+ <div
+ className="flex space-y-1"
+ onMouseLeave={() => void setShowChild(false)}
+ >
+ <div
+ className="w-fit px-3 text-slate-200 hover:bg-white hover:bg-opacity-5 rounded py-1 cursor-pointer"
+ onClick={() => router.push(title.toLowerCase())}
+ onMouseEnter={() => void setShowChild(true)}
+ >
+ {title}
+ </div>
+ {
+ (children)
+ ? <div className={`bg-[#383838] bg-opacity-75 w-fit rounded flex flex-col space-y-1 p-1 ${showChild ? "opacity-100" : "opacity-0"}`}>
+ { children }
+ </div>
+ : null
+ }
+ </div>
+ )
+}
+
+function NavItem({
+ title,
+ router,
+ subgroups
+}: {
+ title: string,
+ router: ReturnType<typeof useRouter>,
+ subgroups?: ReturnType<typeof SubgroupItem | typeof Subgroup>[]
+}) {
+
+ const [showChild, setShowChild] = useState<boolean>(false)
+
+ return (
+ <div
+ className="flex flex-col space-y-1"
+ onMouseLeave={() => void setShowChild(false)}
+ >
+ <div
+ className="w-fit px-3 text-slate-200 hover:bg-white hover:bg-opacity-5 rounded py-1 cursor-pointer"
+ onClick={() => router.push(title.toLowerCase())}
+ onMouseEnter={() => void setShowChild(true)}
+ >
+ {title}
+ </div>
+ {
+ (subgroups && subgroups.length > 0)
+ ? <div className={`bg-[#383838] bg-opacity-75 w-fit rounded flex flex-col space-y-1 p-1 ${showChild ? "opacity-100" : "opacity-0"}`}>
+ {
+ subgroups.map((item, i) => <div key={i}>{item}</div>)
+ }
+ </div>
+ : null
+ }
+ </div>
+ )
+}
+
+export default function NavBar() {
+ const r = useRouter();
+
+ return (
+ <nav className="flex h-12 pt-2 px-4 space-x-5 bg-slate-900 border-b-black border-b">
+ <a href="/">
+ <Image src="/vercel.svg" alt="null" height={50} width={50} />
+ </a>
+ <NavItem title="Characters" router={r} subgroups={[
+ <Subgroup title="Main Characters" router={r}>
+ <SubgroupItem title="Leonel Morales" router={r}/>
+ <SubgroupItem title="Aina Brazinger" router={r}/>
+ </Subgroup>
+ ]}/>
+ <NavItem title="Places" router={r} />
+ <NavItem title="Factions" router={r} />
+ <NavItem title="Zones" router={r} />
+ </nav>
+ )
+}