diff --git a/web/src/App.scss b/web/src/App.scss index 26c60db..55aefe1 100644 --- a/web/src/App.scss +++ b/web/src/App.scss @@ -2,8 +2,5 @@ $theme-color: "pumpkin" ); -#root, #app { - height: 100%; - width: 100%; - padding: 0; -} +@import "./pages/game/GamePage.scss"; +@import "./pages/game/components/GameBoard.scss"; diff --git a/web/src/App.tsx b/web/src/App.tsx index cdcaab0..e5edccc 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -1,6 +1,7 @@ import React from "react"; import { Socket } from "socket.io-client"; import LandingPage from "./pages/landing/LandingPage"; +import GamePage from "./pages/game/GamePage"; export interface AppProps { socket: Socket; @@ -10,6 +11,7 @@ const App = (props: AppProps) => { return (
+
); }; diff --git a/web/src/pages/game/GamePage.scss b/web/src/pages/game/GamePage.scss new file mode 100644 index 0000000..1cbf756 --- /dev/null +++ b/web/src/pages/game/GamePage.scss @@ -0,0 +1,5 @@ +h1 { + text-align: center; + padding: 10px; + margin: 0; +} diff --git a/web/src/pages/game/GamePage.tsx b/web/src/pages/game/GamePage.tsx new file mode 100644 index 0000000..663aefc --- /dev/null +++ b/web/src/pages/game/GamePage.tsx @@ -0,0 +1,15 @@ +import React from "react"; +import GameBoard from "./components/GameBoard"; + +const GamePage = () => { + return ( + +

Game Page Title

+
+ +
+
+ ); +}; + +export default GamePage; diff --git a/web/src/pages/game/components/GameBoard.scss b/web/src/pages/game/components/GameBoard.scss new file mode 100644 index 0000000..477f4cc --- /dev/null +++ b/web/src/pages/game/components/GameBoard.scss @@ -0,0 +1,79 @@ +.game-board { + height: 700px; + width: 700px; + display: grid; + grid-template-columns: repeat(11, auto); + gap: auto; + padding: 10px; + + .cell { + width: 60px; + height: 60px; + border: 2px solid black; + border-radius: 10%; + } + + .v-exit { + width: 60px; + height: 30px; + + > div { + width: 20px; + height: 100%; + margin: auto; + border: solid black; + border-width: 0 1px; + + .dotted { + margin: auto; + border: dashed black; + border-width: 0 1px; + height: 100%; + width: 0; + } + } + + &:has(.v-exit-up) { + margin-bottom: -9px; + } + + &:has(.v-exit-down) { + margin-top: -9px; + } + } + + .h-exit { + height: 60px; + width: 30px; + + > div { + height: 20px; + width: 100%; + margin: auto; + border: solid black; + border-width: 1px 0; + position: relative; + top: 50%; + transform: translateY(-50%); + + .dotted { + margin: auto; + border: dashed black; + border-width: 1px 0; + width: 100%; + height: 0; + position: relative; + top: 50%; + transform: translateY(-50%); + } + } + + &:has(.h-exit-left) { + margin-right: -9px; + } + + &:has(.h-exit-right) { + margin-left: -9px; + } + } +} \ No newline at end of file diff --git a/web/src/pages/game/components/GameBoard.tsx b/web/src/pages/game/components/GameBoard.tsx new file mode 100644 index 0000000..31078b1 --- /dev/null +++ b/web/src/pages/game/components/GameBoard.tsx @@ -0,0 +1,76 @@ +const GameBoard = () => { + const range = (n: number) => Array.from(Array(n).keys()); + const cells = range(11).flatMap((rowIndex) => { + return range(11).map((colIndex) => { + return { rowIndex, colIndex }; + }); + }); + + return ( +
+ {cells.map(({ rowIndex, colIndex }) => { + if ( + (rowIndex === 0 || rowIndex === 10) && + (colIndex === 0 || colIndex === 10) + ) { + return
; + } + if (rowIndex === 0) { + return ( +
+
+
+
+
+ ); + } + if (rowIndex === 10) { + return ( +
+
+
+
+
+ ); + } + if (colIndex === 0) { + return ( +
+
+
+
+
+ ); + } + if (colIndex === 10) { + return ( +
+
+
+
+
+ ); + } + return
; + })} +
+ ); + + /* + {range(9).map(() => ( +
+
+
+ ))} + {range(81).map(() => ( +
+ ))} + {range(9).map(() => ( +
+
+
+ ))} + */ +}; + +export default GameBoard;