CSS smalls changes (headers, ranking colors)

+ mode "cinema" in Game.svelte
This commit is contained in:
LuckyLaszlo
2023-01-15 20:52:08 +01:00
parent b2b54f1fdc
commit 1a07065f6a
6 changed files with 36 additions and 60 deletions

View File

@@ -1,4 +1,7 @@
.dim_background {
background-color: #222;
}
html, body { html, body {
position: relative; position: relative;

View File

@@ -42,16 +42,6 @@
</div> </div>
<style> <style>
@font-face {
font-family: "Bit5x3";
src:
url("/fonts/Bit5x3.woff2") format("woff2"),
local("Bit5x3"),
url("/fonts/Bit5x3.woff") format("woff");
font-weight: normal;
font-style: normal;
font-display: swap;
}
.container { .container {
height: 100%; height: 100%;

View File

@@ -61,7 +61,7 @@
}) })
function resetPage() { function resetPage() {
hiddenGame = true; setHiddenGame(true);
showGameOptions = true; showGameOptions = true;
showInvitations = false; showInvitations = false;
showError = false; showError = false;
@@ -98,7 +98,7 @@
watchMatchStartInterval = setInterval(watchMatchStart, watchMatchStartIntervalRate); watchMatchStartInterval = setInterval(watchMatchStart, watchMatchStartIntervalRate);
watchGameStateInterval = setInterval(watchGameState, watchGameStateIntervalRate); watchGameStateInterval = setInterval(watchGameState, watchGameStateIntervalRate);
pong.init(matchOptions, options, gameAreaId, token); pong.init(matchOptions, options, gameAreaId, token);
hiddenGame = false; setHiddenGame(false);
} }
} }
else else
@@ -136,7 +136,7 @@
} }
pong.init(invitation.gameOptions, options, gameAreaId, invitation.token); pong.init(invitation.gameOptions, options, gameAreaId, invitation.token);
showWaitPage = false; showWaitPage = false;
hiddenGame = false; setHiddenGame(false);
} }
} }
@@ -213,6 +213,16 @@
resetPage(); resetPage();
}; };
function setHiddenGame(value: boolean) {
if (value) {
document.getElementById("game_page").classList.remove("dim_background");
}
else {
document.getElementById("game_page").classList.add("dim_background");
}
hiddenGame = value;
}
</script> </script>
<Header /> <Header />
@@ -352,19 +362,9 @@
</div> <!-- div "game_page" --> </div> <!-- div "game_page" -->
<style> <style>
@font-face {
font-family: "Bit5x3";
src:
url("/fonts/Bit5x3.woff2") format("woff2"),
local("Bit5x3"),
url("/fonts/Bit5x3.woff") format("woff");
font-weight: normal;
font-style: normal;
font-display: swap;
}
#game_page { #game_page {
margin: 0; margin: 0;
background-color: #222425;
position: relative; position: relative;
width: 100%; width: 100%;
height: auto; height: auto;
@@ -384,7 +384,7 @@
} }
canvas { canvas {
/* background-color: #ff0000; */ /* background-color: #ff0000; */
background-color: #333333; background-color: #333;
max-width: 75vw; max-width: 75vw;
/* max-height: 100vh; */ /* max-height: 100vh; */
width: 80%; width: 80%;

View File

@@ -45,7 +45,7 @@
playerOneAvatar = await fetchAvatar(gameState.playerOneUsername); playerOneAvatar = await fetchAvatar(gameState.playerOneUsername);
playerTwoAvatar = await fetchAvatar(gameState.playerTwoUsername); playerTwoAvatar = await fetchAvatar(gameState.playerTwoUsername);
hiddenGame = false; setHiddenGame(false);
}; };
const watchGameState = () => { const watchGameState = () => {
@@ -70,7 +70,7 @@
}; };
async function resetPage() { async function resetPage() {
hiddenGame = true; setHiddenGame(true);
pongSpectator.destroy(); pongSpectator.destroy();
matchList = await fetchMatchList(); matchList = await fetchMatchList();
}; };
@@ -93,6 +93,16 @@
}); });
}; };
function setHiddenGame(value: boolean) {
if (value) {
document.getElementById("game_page").classList.remove("dim_background");
}
else {
document.getElementById("game_page").classList.add("dim_background");
}
hiddenGame = value;
}
</script> </script>
<!-- --> <!-- -->
@@ -164,21 +174,10 @@
<!-- --> <!-- -->
<style> <style>
@font-face {
font-family: "Bit5x3";
src:
url("/fonts/Bit5x3.woff2") format("woff2"),
local("Bit5x3"),
url("/fonts/Bit5x3.woff") format("woff");
font-weight: normal;
font-style: normal;
font-display: swap;
}
#game_page { #game_page {
margin: 0; margin: 0;
padding: 20px; padding: 20px;
background-color: #222425;
position: relative; position: relative;
width: 100%; width: 100%;
height: 100%; height: 100%;

View File

@@ -46,9 +46,9 @@
<tr> <tr>
<th>{i + 1}</th> <th>{i + 1}</th>
{#if user.username === currentUser.username} {#if user.username === currentUser.username}
<td><b>You ({user.username})</b></td> <td><b>{user.username} [You]</b></td>
{:else} {:else}
<td>{user.username}</td> <td>{user.username}</td>
{/if} {/if}
<td>{user.stats.winGame}</td> <td>{user.stats.winGame}</td>
<td>{user.stats.loseGame}</td> <td>{user.stats.loseGame}</td>
@@ -63,7 +63,7 @@
<style> <style>
.principal-div { .principal-div {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
@@ -90,15 +90,10 @@
} }
.stats-table tbody tr:nth-of-type(even) { .stats-table tbody tr:nth-of-type(even) {
background-color: #f3f3f3; background-color: #555;
} }
.stats-table tbody tr:last-of-type { .stats-table tbody tr:last-of-type {
border-bottom: 2px solid #618174; border-bottom: 2px solid #618174;
} }
.stats-table tbody tr.active-row {
font-weight: bold;
color: #618174;
}
</style> </style>

View File

@@ -34,24 +34,13 @@
</div> </div>
<style> <style>
@font-face {
font-family: "Bit5x3";
src:
url("/fonts/Bit5x3.woff2") format("woff2"),
local("Bit5x3"),
url("/fonts/Bit5x3.woff") format("woff");
font-weight: normal;
font-style: normal;
font-display: swap;
}
.header div.center button.selected { .header div.center button.selected {
text-decoration: underline; text-decoration: underline;
background-color: #2B3A67; background-color: #8c0000;
} }
.header div.center button { .header div.center button {
background-color: #8c0000; background-color: #444;
border-color: #071013; border-color: #071013;
color: white; color: white;
font-family: "Bit5x3"; font-family: "Bit5x3";