From 8ee8ba885e4e5335ab843271209eee284a58fdb6 Mon Sep 17 00:00:00 2001 From: Nathaniel Tampus Date: Mon, 20 Feb 2023 17:37:13 +0800 Subject: [PATCH] initial game page design --- client/src/app/game/[code]/page.tsx | 73 +++++++++++++++++++++++++++++ client/src/app/game/page.tsx | 5 ++ 2 files changed, 78 insertions(+) create mode 100644 client/src/app/game/[code]/page.tsx create mode 100644 client/src/app/game/page.tsx diff --git a/client/src/app/game/[code]/page.tsx b/client/src/app/game/[code]/page.tsx new file mode 100644 index 0000000..587166f --- /dev/null +++ b/client/src/app/game/[code]/page.tsx @@ -0,0 +1,73 @@ +"use client"; +// all of this in a client component for now to easily handle socket events + +import { Chessboard } from "react-chessboard"; +import { IconCopy } from "@tabler/icons-react"; +import Image from "next/image"; + +const pgn = "1. e4 e5 2. f3 Nf6 3. d4 exd4 4. Qxd4 Nxe4 5. Qxe4+ Qe7 6. Qxe7+ Bxe7"; + +export default function Game() { + return ( +
+
+
+
+
+ avatar +
+
+ nize +
+ + + +
+
+
+ avatar +
+
+ gwapo +
+
+ +
+
+ Invite friends: +
+ + ches.su/game/123abc +
+
+
+ {pgn + .split(/\d+\./) + .filter((move) => move.trim() !== "") + .map((moveSet, i) => { + const moves = moveSet.trim().split(" "); + return ( +
+
{i + 1}
+
{moves[0]}
+
{moves[1]}
+
+ ); + })} +
+
+
+ chatbox + +
+
+
observer list
+
+
+ ); +} diff --git a/client/src/app/game/page.tsx b/client/src/app/game/page.tsx new file mode 100644 index 0000000..12560fb --- /dev/null +++ b/client/src/app/game/page.tsx @@ -0,0 +1,5 @@ +import { redirect } from "next/navigation"; + +export default function GameEmpty() { + redirect("/"); +}