Compare commits

..

2 Commits

31 changed files with 57 additions and 4 deletions

BIN
web/public/pieces/P01.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
web/public/pieces/P02.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

BIN
web/public/pieces/P03.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

BIN
web/public/pieces/P04.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
web/public/pieces/P05.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
web/public/pieces/P06.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
web/public/pieces/P07.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

BIN
web/public/pieces/P08.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

BIN
web/public/pieces/P09.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

BIN
web/public/pieces/P10.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
web/public/pieces/P11.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
web/public/pieces/P12.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

BIN
web/public/pieces/P13.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
web/public/pieces/P14.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
web/public/pieces/P15.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
web/public/pieces/P16.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

BIN
web/public/pieces/P17.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
web/public/pieces/P18.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
web/public/pieces/P19.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

BIN
web/public/pieces/P20.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

BIN
web/public/pieces/P21.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

BIN
web/public/pieces/P22.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

View File

@ -1,6 +1,3 @@
@use "node_modules/@picocss/pico/scss/pico" with (
$theme-color: "pumpkin"
);
@import "./pages/game/GamePage.scss";
@import "./pages/game/components/GameBoard.scss";

View File

@ -1,5 +1,6 @@
import { io } from "socket.io-client";
import GamePage from "./pages/game/GamePage";
import "./App.scss";
function App() {
const socket = io("http://localhost:3010");

View File

@ -1,7 +1,6 @@
import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App";
import "./App.scss";
const root = ReactDOM.createRoot(
document.getElementById("root") as HTMLElement,

View File

@ -3,3 +3,14 @@ h1 {
padding: 10px;
margin: 0;
}
.game-panel {
user-select: none; /* Standard syntax */
display: flex;
flex-direction: row;
.right-panel {
display: flex;
flex-direction: column;
}
}

View File

@ -1,5 +1,7 @@
import React from "react";
import GameBoard from "./components/GameBoard";
import DiceSet from "./components/DiceSet";
import "./GamePage.scss";
const GamePage = () => {
return (
@ -7,6 +9,9 @@ const GamePage = () => {
<h1>Game Page Title</h1>
<div className="game-panel">
<GameBoard />
<div className="rigth-panel">
<DiceSet />
</div>
</div>
</React.Fragment>
);

View File

@ -0,0 +1,17 @@
.dice-set {
display: grid;
grid-template-columns: repeat(2, auto);
gap: 20px;
padding: 50px;
.dice {
height: 150px;
width: 150px;
border: 2px solid black;
border-radius: 10%;
img{
border-radius: 10%;
}
}
}

View File

@ -0,0 +1,20 @@
import "./DiceSet.scss";
const DiceSet = () => {
const diceImages = [1, 2, 3, 4]
.map(() => Math.floor(Math.random() * 22 + 1))
.map((index) => ("0" + index).slice(-2))
.map((index) => `${process.env.PUBLIC_URL}/pieces/P${index}.jpeg`);
return (
<div className="dice-set">
{diceImages.map((file) => (
<div className="dice">
<img src={file}></img>
</div>
))}
</div>
);
};
export default DiceSet;

View File

@ -1,6 +1,8 @@
.game-board {
height: 850px;
width: 850px;
min-height: 850px;
min-width: 850px;
display: grid;
grid-template-columns: repeat(7, auto);
gap: auto;

View File

@ -1,4 +1,5 @@
import { buildBoard, Cell, directions, Exit } from "interface";
import "./GameBoard.scss";
const GameBoard = () => {
const board: Cell[][] = buildBoard();