Compare commits
2 Commits
0945336463
...
163ca86734
| Author | SHA1 | Date |
|---|---|---|
|
|
163ca86734 | |
|
|
af133bae8b |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 43 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 59 KiB |
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 46 KiB |
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -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%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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;
|
||||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { buildBoard, Cell, directions, Exit } from "interface";
|
||||
import "./GameBoard.scss";
|
||||
|
||||
const GameBoard = () => {
|
||||
const board: Cell[][] = buildBoard();
|
||||
|
|
|
|||