Compare commits
No commits in common. "163ca86734e59f0331881fa46af2683bf721c3ca" and "0945336463ba8e1853f6db96af7aa748a526d752" have entirely different histories.
163ca86734
...
0945336463
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 59 KiB |
|
Before Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 46 KiB |
|
|
@ -1,3 +1,6 @@
|
||||||
@use "node_modules/@picocss/pico/scss/pico" with (
|
@use "node_modules/@picocss/pico/scss/pico" with (
|
||||||
$theme-color: "pumpkin"
|
$theme-color: "pumpkin"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@import "./pages/game/GamePage.scss";
|
||||||
|
@import "./pages/game/components/GameBoard.scss";
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
import { io } from "socket.io-client";
|
import { io } from "socket.io-client";
|
||||||
import GamePage from "./pages/game/GamePage";
|
import GamePage from "./pages/game/GamePage";
|
||||||
import "./App.scss";
|
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
const socket = io("http://localhost:3010");
|
const socket = io("http://localhost:3010");
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import ReactDOM from "react-dom/client";
|
import ReactDOM from "react-dom/client";
|
||||||
import App from "./App";
|
import App from "./App";
|
||||||
|
import "./App.scss";
|
||||||
|
|
||||||
const root = ReactDOM.createRoot(
|
const root = ReactDOM.createRoot(
|
||||||
document.getElementById("root") as HTMLElement,
|
document.getElementById("root") as HTMLElement,
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,3 @@ h1 {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.game-panel {
|
|
||||||
user-select: none; /* Standard syntax */
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
|
|
||||||
.right-panel {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import GameBoard from "./components/GameBoard";
|
import GameBoard from "./components/GameBoard";
|
||||||
import DiceSet from "./components/DiceSet";
|
|
||||||
import "./GamePage.scss";
|
|
||||||
|
|
||||||
const GamePage = () => {
|
const GamePage = () => {
|
||||||
return (
|
return (
|
||||||
|
|
@ -9,9 +7,6 @@ const GamePage = () => {
|
||||||
<h1>Game Page Title</h1>
|
<h1>Game Page Title</h1>
|
||||||
<div className="game-panel">
|
<div className="game-panel">
|
||||||
<GameBoard />
|
<GameBoard />
|
||||||
<div className="rigth-panel">
|
|
||||||
<DiceSet />
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
.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%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
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,8 +1,6 @@
|
||||||
.game-board {
|
.game-board {
|
||||||
height: 850px;
|
height: 850px;
|
||||||
width: 850px;
|
width: 850px;
|
||||||
min-height: 850px;
|
|
||||||
min-width: 850px;
|
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(7, auto);
|
grid-template-columns: repeat(7, auto);
|
||||||
gap: auto;
|
gap: auto;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
import { buildBoard, Cell, directions, Exit } from "interface";
|
import { buildBoard, Cell, directions, Exit } from "interface";
|
||||||
import "./GameBoard.scss";
|
|
||||||
|
|
||||||
const GameBoard = () => {
|
const GameBoard = () => {
|
||||||
const board: Cell[][] = buildBoard();
|
const board: Cell[][] = buildBoard();
|
||||||
|
|
|
||||||