Skip to content

Commit

Permalink
Revert "Make 4-player chess app responsive and refactor chess piece m…
Browse files Browse the repository at this point in the history
…echanics"
  • Loading branch information
prrockzed authored Dec 4, 2024
1 parent 22b9017 commit 4d940e7
Show file tree
Hide file tree
Showing 14 changed files with 240 additions and 537 deletions.
1 change: 0 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import './App.css'
import './mediaQueries.css'
import Arbiter from './components/Arbiter/Arbiter'

// The app component
Expand Down
3 changes: 3 additions & 0 deletions src/Constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import { PieceType, TeamType } from './Types'
export const VERTICAL_AXIS = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
export const HORIZONTAL_AXIS = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]

// Grid Size
export const GRID_SIZE = 50

// InitialBoardState
export const initialBoard: Board = new Board(
[
Expand Down
15 changes: 5 additions & 10 deletions src/components/Arbiter/Arbiter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import { initialBoard } from '../../Constants'
import { PieceType, TeamType } from '../../Types'
import { Piece, Position } from '../../models'
import { useRef, useState } from 'react'
import { ChessProvider } from '../context/ChessContext'
import ChessWrapper from '../ChessWrapper/ChessWrapper'
//import {
// bishopMove,
// kingMove,
Expand Down Expand Up @@ -257,14 +255,11 @@ export default function Arbiter() {
</div>
</div>

<ChessProvider whoseTurn={board.totalTurns}>
<ChessWrapper>
<Chessboard
playMove={playMove}
pieces={board.pieces}
/>
</ChessWrapper>
</ChessProvider>
<Chessboard
playMove={playMove}
pieces={board.pieces}
whoseTurn={board.totalTurns}
/>
</>
)
}
93 changes: 0 additions & 93 deletions src/components/ChessWrapper/ChessWrapper.css

This file was deleted.

88 changes: 0 additions & 88 deletions src/components/ChessWrapper/ChessWrapper.tsx

This file was deleted.

39 changes: 17 additions & 22 deletions src/components/Chessboard/Chessboard.css
Original file line number Diff line number Diff line change
@@ -1,42 +1,39 @@
#chessboard {
display: grid;
grid-template-columns: repeat(14, var(--tile-size));
grid-template-rows: repeat(14, var(--tile-size));
width: calc(var(--tile-size) * 14);
height: calc(var(--tile-size) * 14);
grid-template-columns: repeat(14, 50px);
grid-template-rows: repeat(14, 50px);
width: 700px;
height: 700px;
background-color: black;
}

.modal {
position: fixed;
top: 0;
left: 0;
display: flex;
align-items: center;
justify-content: center;
width: 100dvw;
height: 100dvh;
background-color: rgba(0, 0, 0, 0.75);
z-index: 20;
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
left: 0px;
}

.modal.hidden {
display: none;
}

.modal > .modal-body {
position: absolute;
top: calc(50% - 75px);
left: calc(50% - 350px);
display: flex;
align-items: center;
justify-content: space-around;
gap: 10px;
height: 20vh;
width: calc(var(--tile-size) * 14);
height: 150px;
width: 700px;
background-color: rgba(0, 0, 0, 0.75);
}

.modal > .modal-body > img {
width: 100%;
padding: 10px;
height: 90px;
padding: 20px;
border-radius: 50%;
}

Expand All @@ -48,13 +45,11 @@
.modal > .modal-body > .checkmate-body {
display: flex;
flex-direction: column;
padding: 10px;
gap: 24px;
}

.modal > .modal-body > .checkmate-body > span {
font-size: 1.5rem;
text-align: center;
font-size: 28px;
color: white;
}

Expand Down
Loading

0 comments on commit 4d940e7

Please sign in to comment.