Compare commits
4 Commits
8e14646806
...
fe84972374
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fe84972374 | ||
|
|
ebfe70f0bb | ||
|
|
6e61b4d3d0 | ||
|
|
1d7defd069 |
39
index.html
@@ -70,14 +70,21 @@
|
|||||||
|
|
||||||
.game {
|
.game {
|
||||||
width: 600px;
|
width: 600px;
|
||||||
height: 600px;
|
aspect-ratio: 1/1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.game {
|
||||||
|
width: 80%;
|
||||||
|
aspect-ratio: 1/1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
<img src="/static/logo.png" alt="">
|
<img src="/static/logo.webp" alt="">
|
||||||
</header>
|
</header>
|
||||||
<div class="center">
|
<div class="center">
|
||||||
<div id="join-menu" class="join-menu"><input type="text" id="room-id" placeholder="Room ID"><button
|
<div id="join-menu" class="join-menu"><input type="text" id="room-id" placeholder="Room ID"><button
|
||||||
@@ -151,9 +158,6 @@
|
|||||||
i = mHouse[0];
|
i = mHouse[0];
|
||||||
j = mHouse[1];
|
j = mHouse[1];
|
||||||
if (ready && board) {
|
if (ready && board) {
|
||||||
console.log(turn);
|
|
||||||
console.log(color);
|
|
||||||
console.log(selected);
|
|
||||||
if (board[j][i] !== "E" && (board[j][i] === board[j][i].toUpperCase() ? 0 : 1) === color && turn == color) {
|
if (board[j][i] !== "E" && (board[j][i] === board[j][i].toUpperCase() ? 0 : 1) === color && turn == color) {
|
||||||
|
|
||||||
selected = [i, j];
|
selected = [i, j];
|
||||||
@@ -178,7 +182,6 @@
|
|||||||
moves.forEach(move => {
|
moves.forEach(move => {
|
||||||
console.log(move);
|
console.log(move);
|
||||||
if (move[0] == i && move[1] == j) {
|
if (move[0] == i && move[1] == j) {
|
||||||
console.log("YAY");
|
|
||||||
fetch('{{ API_ROOT }}/move/' + ROOM_ID, {
|
fetch('{{ API_ROOT }}/move/' + ROOM_ID, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
@@ -349,19 +352,19 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const assets = {
|
const assets = {
|
||||||
p: '/static/black_pawn.png',
|
p: '/static/black_pawn.webp',
|
||||||
r: '/static/black_rook.png',
|
r: '/static/black_rook.webp',
|
||||||
c: '/static/black_castle.png',
|
c: '/static/black_castle.webp',
|
||||||
b: '/static/black_bishop.png',
|
b: '/static/black_bishop.webp',
|
||||||
k: '/static/black_king.png',
|
k: '/static/black_king.webp',
|
||||||
q: '/static/black_queen.png',
|
q: '/static/black_queen.webp',
|
||||||
|
|
||||||
P: '/static/white_pawn.png',
|
P: '/static/white_pawn.webp',
|
||||||
R: '/static/white_rook.png',
|
R: '/static/white_rook.webp',
|
||||||
C: '/static/white_castle.png',
|
C: '/static/white_castle.webp',
|
||||||
B: '/static/white_bishop.png',
|
B: '/static/white_bishop.webp',
|
||||||
K: '/static/white_king.png',
|
K: '/static/white_king.webp',
|
||||||
Q: '/static/white_queen.png',
|
Q: '/static/white_queen.webp',
|
||||||
};
|
};
|
||||||
|
|
||||||
const loadPromises = Object.entries(assets).map(([key, src]) => {
|
const loadPromises = Object.entries(assets).map(([key, src]) => {
|
||||||
|
|||||||
BIN
static/black_bishop.webp
Normal file
|
After Width: | Height: | Size: 400 B |
BIN
static/black_castle.webp
Normal file
|
After Width: | Height: | Size: 324 B |
BIN
static/black_king.webp
Normal file
|
After Width: | Height: | Size: 608 B |
BIN
static/black_pawn.webp
Normal file
|
After Width: | Height: | Size: 364 B |
BIN
static/black_queen.webp
Normal file
|
After Width: | Height: | Size: 462 B |
BIN
static/black_rook.webp
Normal file
|
After Width: | Height: | Size: 444 B |
BIN
static/logo.webp
Normal file
|
After Width: | Height: | Size: 69 KiB |
BIN
static/white_bishop.webp
Normal file
|
After Width: | Height: | Size: 508 B |
BIN
static/white_castle.webp
Normal file
|
After Width: | Height: | Size: 424 B |
BIN
static/white_king.webp
Normal file
|
After Width: | Height: | Size: 684 B |
BIN
static/white_pawn.webp
Normal file
|
After Width: | Height: | Size: 602 B |
BIN
static/white_queen.webp
Normal file
|
After Width: | Height: | Size: 794 B |
BIN
static/white_rook.webp
Normal file
|
After Width: | Height: | Size: 554 B |