Deleted functions keys that could be dangerous
This commit is contained in:
parent
9e93306db1
commit
946478f301
4 changed files with 67 additions and 80 deletions
|
|
@ -83,14 +83,11 @@ const sendtextbox = document.getElementById(
|
||||||
) as HTMLButtonElement;
|
) as HTMLButtonElement;
|
||||||
const systemWindow = document.getElementById("chat-system-box") as HTMLDivElement;
|
const systemWindow = document.getElementById("chat-system-box") as HTMLDivElement;
|
||||||
|
|
||||||
|
|
||||||
function chatKeyToggle() {
|
function chatKeyToggle() {
|
||||||
let anti_flicker_control = false;
|
let anti_flicker_control = false;
|
||||||
const chat_hide_key = 'escape';
|
const chat_hide_key = 'escape';
|
||||||
const chat_display_key = 'f2';
|
const chat_display_key = 'f2';
|
||||||
const pong_display_key = 'f4';
|
const home_display_key = 'f8';
|
||||||
const ttt_display_key = 'f8';
|
|
||||||
const home_display_key = 'f9';
|
|
||||||
document.addEventListener("keydown", (event) => {
|
document.addEventListener("keydown", (event) => {
|
||||||
if (event.repeat && keysPressed[chat_hide_key] === true) {
|
if (event.repeat && keysPressed[chat_hide_key] === true) {
|
||||||
anti_flicker_control = true;
|
anti_flicker_control = true;
|
||||||
|
|
@ -126,17 +123,9 @@ function chatKeyToggle() {
|
||||||
windowStateVisable();
|
windowStateVisable();
|
||||||
|
|
||||||
}
|
}
|
||||||
if (keysPressed[pong_display_key] === true) {
|
|
||||||
quitChat();
|
|
||||||
navigateTo('/app/pong');
|
|
||||||
}
|
|
||||||
if (keysPressed[ttt_display_key] === true) {
|
|
||||||
quitChat();
|
|
||||||
navigateTo('/app/ttt');
|
|
||||||
}
|
|
||||||
if (keysPressed[home_display_key] === true) {
|
if (keysPressed[home_display_key] === true) {
|
||||||
quitChat();
|
|
||||||
navigateTo('/app/');
|
navigateTo('/app/');
|
||||||
|
quitChat();
|
||||||
}
|
}
|
||||||
}, 1000/10);
|
}, 1000/10);
|
||||||
};
|
};
|
||||||
|
|
@ -163,7 +152,6 @@ function initChatSocket() {
|
||||||
!sendButton ||
|
!sendButton ||
|
||||||
!sendtextbox ||
|
!sendtextbox ||
|
||||||
!systemWindow
|
!systemWindow
|
||||||
|
|
||||||
) return showError("fatal error");
|
) return showError("fatal error");
|
||||||
|
|
||||||
// Listen for the 'connect' event
|
// Listen for the 'connect' event
|
||||||
|
|
@ -289,9 +277,7 @@ function initChatSocket() {
|
||||||
let message = "";
|
let message = "";
|
||||||
if (data.userState === "block") {
|
if (data.userState === "block") {
|
||||||
(message = "un-block");
|
(message = "un-block");
|
||||||
// ((message = "un-block"), (blockMessage = true));
|
|
||||||
} else {
|
} else {
|
||||||
// ((message = "block"), (blockMessage = false));
|
|
||||||
(message = "block");
|
(message = "block");
|
||||||
}
|
}
|
||||||
blockUserBtn.textContent = message;
|
blockUserBtn.textContent = message;
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,7 @@ export function cmdList() {
|
||||||
addMessage('** ********** function keys ********** **');
|
addMessage('** ********** function keys ********** **');
|
||||||
addMessage('\'ESC\' - chat box display toggles off');
|
addMessage('\'ESC\' - chat box display toggles off');
|
||||||
addMessage('\'F2\' - chat box display toggles on');
|
addMessage('\'F2\' - chat box display toggles on');
|
||||||
addMessage('\'F4\' - navigates to Pong Box');
|
addMessage('\'F8\' - navigates to Home Page');
|
||||||
addMessage('\'F8\' - navigates to TTT Box');
|
|
||||||
addMessage('\'F9\' - navigates to Home Page');
|
|
||||||
addMessage('** *********************************** **');
|
addMessage('** *********************************** **');
|
||||||
addMessage('*');
|
addMessage('*');
|
||||||
}
|
}
|
||||||
|
|
@ -4,66 +4,68 @@
|
||||||
<div class="flex flex-col gap-2">
|
<div class="flex flex-col gap-2">
|
||||||
<button id="QueueBtn" class="fit-all dflt-btn-style gray-color rounded-elem blue-hover">Queue
|
<button id="QueueBtn" class="fit-all dflt-btn-style gray-color rounded-elem blue-hover">Queue
|
||||||
Up</button>
|
Up</button>
|
||||||
<button id="LocalBtn" class="fit-all dflt-btn-style gray-color rounded-elem blue-hover">Local
|
<button id="LocalBtn" class="fit-all dflt-btn-style gray-color rounded-elem blue-hover">Local
|
||||||
Game</button>
|
Game</button>
|
||||||
<button id="TourBtn" class="fit-all dflt-btn-style gray-color rounded-elem blue-hover">
|
<button id="TourBtn" class="fit-all dflt-btn-style gray-color rounded-elem blue-hover">
|
||||||
<span class="mx-2">Create Tournament</span>
|
<span class="mx-2">Create Tournament</span>
|
||||||
</button>
|
</button>
|
||||||
<!-- tournament hdl -->
|
<!-- tournament hdl -->
|
||||||
</div>
|
|
||||||
<div class="flex flex-col gap-2">
|
|
||||||
<h1 class="page-title">Pong Box</h1>
|
|
||||||
<br />
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-col gap-2 items-end">
|
|
||||||
<span id="queue-info" class="fit-all rounded-elem gray-color text-white">?👤 ?⏳ ?▮•▮</span>
|
|
||||||
<!-- total | in queue | games-->
|
|
||||||
<button id="tour-info" class="blue-hover pong-btn-style fit-all rounded-elem gray-color text-white">⚪️ ?👤 ?▮•▮</button>
|
|
||||||
<!-- [Owner|Registered|NotRegisterd|nonExistant] | Player | games -->
|
|
||||||
<!-- 👑 ✅ ❌ ⚪️ -->
|
|
||||||
<button id="play-info" class="circle-8 pong-btn-style gray-color blue-hover">?</button>
|
|
||||||
<!-- how to play? pong-how-to-play rounded-elem rounded-full blue-hover-->
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- Horizontal Message Box -->
|
|
||||||
<div id="score-box" class="grid grid-cols-3 items-center">
|
|
||||||
<h4 id="player-left" class="text-5xl"></h4>
|
|
||||||
<h1 id="score-board" class="justify-self-center text-p10 font-bold text-gray-800">0:0</h1>
|
|
||||||
<h4 id="player-right" class="text-5xl"></h4>
|
|
||||||
</div>
|
|
||||||
<!-- Pong Box -->
|
|
||||||
<div class="flex justify-center mt-2">
|
|
||||||
<div id="pongspace" class="flex flex-col">
|
|
||||||
<div id="pongbox" class="pongbox-style base-box">
|
|
||||||
<div id="pong-end-screen" class="white-color rounded-elem focus-elem hidden">you won</div>
|
|
||||||
<div id="protips-box" class="white-color rounded-elem focus-elem text-2xl hidden">
|
|
||||||
up:
|
|
||||||
<kbd class="pong-protips-key">W</kbd>
|
|
||||||
down:
|
|
||||||
<kbd class="pong-protips-key">S</kbd>
|
|
||||||
<br />
|
|
||||||
You are <span class="text-red-500">red</span>.
|
|
||||||
<br />
|
|
||||||
Your goal is to bounce the ball back to the adversary.
|
|
||||||
<br />
|
|
||||||
<span class="text-gray-400">local games keys for the left paddle:
|
|
||||||
<br />
|
|
||||||
up:
|
|
||||||
<kbd class="disp-key">P</kbd>
|
|
||||||
down:
|
|
||||||
<kbd class="disp-key">L</kbd>
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
<div id="tourscore-box" class="white-color rounded-elem focus-elem text-2xl hidden">We havent seen any tournament yet !</div>
|
<div class="flex flex-col gap-2">
|
||||||
<button id="readyup-btn" class="justify-center white-color focus-elem rounded-elem">ready!</button>
|
<h1 class="page-title">Pong Box</h1>
|
||||||
<div class="pong-field">
|
<br />
|
||||||
<div id="batleft" class="pong-bat pong-batleft top-0"></div>
|
</div>
|
||||||
<div class="pong-center-line"></div>
|
<div class="flex flex-col gap-2 items-end">
|
||||||
<div id="batright" class="pong-bat pong-batright top-0"></div>
|
<span id="queue-info" class="fit-all rounded-elem gray-color text-white">?👤 ?⏳ ?▮•▮</span>
|
||||||
<div id="ball" class="rounded-full border-4 bg-white border-gray-400"></div>
|
<!-- total | in queue | games-->
|
||||||
|
<button id="tour-info" class="blue-hover pong-btn-style fit-all rounded-elem gray-color text-white">⚪️ ?👤 ?▮•▮</button>
|
||||||
|
<!-- [Owner|Registered|NotRegisterd|nonExistant] | Player | games -->
|
||||||
|
<!-- 👑 ✅ ❌ ⚪️ -->
|
||||||
|
<button id="play-info" class="circle-8 pong-btn-style gray-color blue-hover">?</button>
|
||||||
|
<!-- how to play? pong-how-to-play rounded-elem rounded-full blue-hover-->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- Horizontal Message Box -->
|
||||||
|
<div id="score-box" class="grid grid-cols-3 items-center">
|
||||||
|
<h4 id="player-left" class="text-5xl"></h4>
|
||||||
|
<h1 id="score-board" class="justify-self-center text-p10 font-bold text-gray-800">0:0</h1>
|
||||||
|
<h4 id="player-right" class="text-5xl"></h4>
|
||||||
|
</div>
|
||||||
|
<!-- Pong Box -->
|
||||||
|
<div class="flex justify-center mt-2">
|
||||||
|
<div id="pongspace" class="flex flex-col">
|
||||||
|
<div id="pongbox" class="pongbox-style base-box">
|
||||||
|
<div id="pong-end-screen" class="white-color rounded-elem focus-elem hidden">you won</div>
|
||||||
|
<div id="protips-box" class="white-color rounded-elem focus-elem text-2xl hidden">
|
||||||
|
up:
|
||||||
|
<kbd class="pong-protips-key">W</kbd>
|
||||||
|
down:
|
||||||
|
<kbd class="pong-protips-key">S</kbd>
|
||||||
|
<br />
|
||||||
|
You are <span class="text-red-500">red</span>.
|
||||||
|
<br />
|
||||||
|
Your goal is to bounce the ball back to the adversary.
|
||||||
|
<br />
|
||||||
|
<span class="text-gray-400">local games keys for the left paddle:
|
||||||
|
<br />
|
||||||
|
up:
|
||||||
|
<kbd class="disp-key">P</kbd>
|
||||||
|
down:
|
||||||
|
<kbd class="disp-key">L</kbd>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div id="tourscore-box" class="white-color rounded-elem focus-elem text-2xl hidden">We havent seen any tournament yet !</div>
|
||||||
|
<button id="readyup-btn" class="justify-center white-color focus-elem rounded-elem">ready!</button>
|
||||||
|
<div class="pong-field">
|
||||||
|
<div id="batleft" class="pong-bat pong-batleft top-0"></div>
|
||||||
|
<div class="pong-center-line"></div>
|
||||||
|
<div id="batright" class="pong-bat pong-batright top-0"></div>
|
||||||
|
<div id="ball" class="rounded-full border-4 bg-white border-gray-400"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
<button class="dflt-btn-style fit-all gray-color rounded-elem blue-hover" id="historyBtn">History</button>
|
<button class="dflt-btn-style fit-all gray-color rounded-elem blue-hover" id="historyBtn">History</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col gap-2">
|
<div class="flex flex-col gap-2">
|
||||||
<h1 class="page-title">Tic-tac-toe Box<span id="t-username"></span></h1>
|
<h1 class="page-title">Tic-tac-toe<span id="t-username"></span></h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col gap-2 p-8 items-end">
|
<div class="flex flex-col gap-2 p-8 items-end">
|
||||||
<button class="dflt-btn-style fit-all gray-color rounded-elem blue-hover" id="JoinQueueBtn">Join Queue</button>
|
<button class="dflt-btn-style fit-all gray-color rounded-elem blue-hover" id="JoinQueueBtn">Join Queue</button>
|
||||||
|
|
@ -13,9 +13,10 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="grid grid-cols-[auto_1fr_auto_1fr_auto] items-center px-4 py-3">
|
<div class="grid grid-cols-[auto_1fr_auto_1fr_auto] items-center px-4 py-3">
|
||||||
<div class="text-7xl text-gray-800 mx-4 font-bold" id="playerX">X</div>
|
<div class="text-7xl text-gray-800 mx-4 font-bold" id="playerX">X</div>
|
||||||
<div class="text-left">
|
<div class="text-left text-2xl">
|
||||||
<div class="player-name" id="playerX-name"></div>
|
<div class="player-name" id="playerX-name"></div>
|
||||||
<div class="player-timer" id="playerX-timer"></div>
|
<div class="player-timer" id="playerX-timer"></div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="text-center text-sm text-gray-800 px-4 whitespace-nowrap">
|
<div class="text-center text-sm text-gray-800 px-4 whitespace-nowrap">
|
||||||
|
|
@ -23,7 +24,7 @@
|
||||||
<div id="currentPlayerTimer">Waiting for match...</div>
|
<div id="currentPlayerTimer">Waiting for match...</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="text-right">
|
<div class="text-right text-2xl">
|
||||||
<div class="player-name" id="playerO-name"></div>
|
<div class="player-name" id="playerO-name"></div>
|
||||||
<div class="player-timer" id="playerO-timer"></div>
|
<div class="player-timer" id="playerO-timer"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue