Fix UI
This commit is contained in:
24
index.html
24
index.html
@@ -196,7 +196,7 @@
|
|||||||
if (state == -1) {
|
if (state == -1) {
|
||||||
document.getElementById('stats').textCotnent = "";
|
document.getElementById('stats').textCotnent = "";
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const differenceMs = Math.abs(start_time.getTime() - now.getTime());
|
const differenceMs = 30 * 60 * 1000 - Math.abs(start_time.getTime() - now.getTime());
|
||||||
const totalSeconds = Math.floor(differenceMs / 1000);
|
const totalSeconds = Math.floor(differenceMs / 1000);
|
||||||
|
|
||||||
const minutes = Math.floor(totalSeconds / 60);
|
const minutes = Math.floor(totalSeconds / 60);
|
||||||
@@ -205,31 +205,31 @@
|
|||||||
const paddedMinutes = String(minutes).padStart(2, '0');
|
const paddedMinutes = String(minutes).padStart(2, '0');
|
||||||
const paddedSeconds = String(seconds).padStart(2, '0');
|
const paddedSeconds = String(seconds).padStart(2, '0');
|
||||||
|
|
||||||
document.getElementById('clock').textCotnent = `${paddedMinutes}:${paddedSeconds}`;
|
document.getElementById('clock').innerText = `${paddedMinutes}:${paddedSeconds}`;
|
||||||
|
|
||||||
if (UID === undefined || turn != color) {
|
if (UID === undefined || turn != color) {
|
||||||
if (turn == 0) {
|
if (turn == 0) {
|
||||||
document.getElementById('turn').textCotnent = "White's Turn";
|
document.getElementById('turn').innerText = "White's Turn";
|
||||||
} else if (turn == 0) {
|
} else if (turn == 0) {
|
||||||
document.getElementById('turn').textCotnent = "Black's Turn";
|
document.getElementById('turn').innerText = "Black's Turn";
|
||||||
}
|
}
|
||||||
} else if (turn == color) {
|
} else if (turn == color) {
|
||||||
document.getElementById('turn').textCotnent = "Your Turn";
|
document.getElementById('turn').innerText = "Your Turn";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
document.getElementById('turn').textCotnent = "";
|
document.getElementById('turn').innerText = "";
|
||||||
if (state == 0) {
|
if (state == 0) {
|
||||||
document.getElementById('stats').textCotnent = "Tie";
|
document.getElementById('stats').innerText = "Tie";
|
||||||
} else if (state == 1) {
|
} else if (state == 1) {
|
||||||
document.getElementById('stats').textCotnent = "White Won";
|
document.getElementById('stats').innerText = "White Won";
|
||||||
} else if (state == 2) {
|
} else if (state == 2) {
|
||||||
document.getElementById('stats').textCotnent = "Black Won";
|
document.getElementById('stats').innerText = "Black Won";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
document.getElementById('turn').textCotnent = "";
|
document.getElementById('turn').innerText = "";
|
||||||
document.getElementById('clock').textCotnent = "";
|
document.getElementById('clock').innerText = "";
|
||||||
document.getElementById('stats').textCotnent = "Waiting for Opponent";
|
document.getElementById('stats').innerText = "Waiting for Opponent";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user