Skip to content

Commit

Permalink
Fixed the little lag with the backdrop filter change
Browse files Browse the repository at this point in the history
  • Loading branch information
pap-24 authored May 30, 2024
1 parent 48026d3 commit d333837
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions client/src/scripts/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,14 +395,6 @@ export async function setUpUI(game: Game): Promise<void> {
const data = JSON.parse(message.data) as CustomTeamMessage;
switch (data.type) {
case CustomTeamMessages.Join: {

// ----------------------------------------------
// Added.
// ----------------------------------------------
$("#splash-ui").css("filter", "brightness(0.6)");
$("#splash-ui").css("pointer-events", "none");
// ----------------------------------------------

joinedTeam = true;
playerID = data.id;
teamID = data.teamID;
Expand Down Expand Up @@ -447,12 +439,12 @@ export async function setUpUI(game: Game): Promise<void> {
resetPlayButtons();
createTeamMenu.fadeOut(250);

// ----------------------------------------------
// Added. (Probably not needed here)
// ----------------------------------------------
// ---------------------------------------------------------
// Dimmed backdrop on team menu. (Probably not needed here)
// ---------------------------------------------------------
$("#splash-ui").css("filter", "");
$("#splash-ui").css("pointer-events", "");
// ----------------------------------------------
// ---------------------------------------------------------
};

teamSocket.onclose = (): void => {
Expand All @@ -474,14 +466,21 @@ export async function setUpUI(game: Game): Promise<void> {
createTeamMenu.fadeOut(250);

// ----------------------------------------------
// Added.
// Dimmed Backdrop on team menu.
// ----------------------------------------------
$("#splash-ui").css("filter", "");
$("#splash-ui").css("pointer-events", "");
// ----------------------------------------------
};

createTeamMenu.fadeIn(250);

// ----------------------------------------------
// Dimmed Backdrop on team menu.
// ----------------------------------------------
$("#splash-ui").css("filter", "brightness(0.6)");
$("#splash-ui").css("pointer-events", "none");
// ----------------------------------------------
});

$("#close-create-team").on("click", () => {
Expand Down

0 comments on commit d333837

Please sign in to comment.