Skip to content

Commit b05f931

Browse files
committed
refactor: improve page layout and overflow
1 parent e822c05 commit b05f931

33 files changed

Lines changed: 1971 additions & 1960 deletions

‎.editorconfig‎

Lines changed: 0 additions & 17 deletions
This file was deleted.

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
**/node_modules
88
npm-debug.log
99
config.env
10+
config.local.env
1011
firebase-config.json
1112
client/src/environments/environment.ts
1213
client/src/environments/environment.development.ts

‎client/src/app/app.component.html‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
<div class="h-screen page flex flex-col">
2-
<div class="flex-grow overflow-y-auto">
1+
<div class="w-full flex h-dvh flex-col">
2+
<div class="flex-1 min-h-0 overflow-y-auto">
33
<router-outlet></router-outlet>
44
</div>
55

66
@if (showFooter) {
7-
<app-footer class="flex-shrink-0" />
7+
<app-footer class="shrink-0" />
88
}
99
</div>

‎client/src/app/app.component.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { NavigationEnd, Router, RouterOutlet } from '@angular/router';
33
import { FooterComponent } from './components/shared/footer/footer.component';
44
import { filter } from 'rxjs';
55

6-
76
import { Firestore } from '@angular/fire/firestore';
87
import { Auth } from '@angular/fire/auth';
98
import { AuthService } from './services/auth.service';

‎client/src/app/components/chat/chat.component.scss‎

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
* ------------------------------------------------------------------------- */
55

66
.chat {
7-
margin: 20px auto 0 auto;
8-
overflow: auto;
7+
margin: 20px auto 0;
98
display: flex;
9+
gap: 20px;
1010
}
1111

1212
#aftermatch .chat {
@@ -15,17 +15,15 @@
1515

1616
.chat--hints-container,
1717
.chat--bubbles-container {
18-
width: 100%;
18+
flex: 1 1 0;
19+
min-width: 0;
1920
height: 40vh;
2021
margin: 10px 0;
2122
box-sizing: border-box;
22-
border-style: solid;
23-
border-width: 1px;
23+
border: 1px solid white;
2424
border-radius: 8px;
25-
border-color: White;
26-
display: inline-block;
2725
background-color: rgba(255, 255, 255, 0.11);
28-
overflow: scroll;
26+
overflow: auto;
2927
}
3028

3129
@media only screen and (min-width: 716px) {
@@ -47,6 +45,7 @@
4745
.chat--hints-sub-container {
4846
width: 100%;
4947
box-sizing: border-box;
48+
color: black;
5049
}
5150

5251
button.chat--hint {
@@ -66,35 +65,34 @@ button.chat--hint {
6665
}
6766

6867
.chat--bubble-row {
69-
overflow: auto;
70-
margin: 10px auto 0 auto;
68+
display: flex;
69+
width: 100%;
70+
margin-top: 10px;
71+
box-sizing: border-box;
7172
}
7273

7374
.chat--bubble-player,
7475
.chat--bubble-enemy {
75-
display: inline-block;
76-
max-width: 100%;
76+
display: block;
77+
max-width: calc(100% - 40px);
7778
box-sizing: border-box;
78-
margin: 0 10px;
7979
border-radius: 8px;
8080
color: white;
8181
padding: 10px 20px;
8282
position: relative;
8383
}
8484

85-
.chat--bubble-sender {
86-
box-sizing: border-box;
87-
font-size: small;
88-
text-align: inherit;
89-
}
90-
9185
.chat--bubble-player {
92-
float: left;
93-
text-align: left;
9486
margin-left: 20px;
9587
background-color: #48af9b;
9688
}
9789

90+
.chat--bubble-enemy {
91+
margin-left: auto;
92+
margin-right: 20px;
93+
background-color: #ba793a;
94+
}
95+
9896
.chat--bubble-enemy {
9997
float: right;
10098
text-align: right;
@@ -140,4 +138,11 @@ button.chat--hint {
140138
.chat {
141139
flex-direction: column;
142140
}
141+
142+
.chat--hints-container,
143+
.chat--bubbles-container {
144+
width: 100%;
145+
flex: none;
146+
margin: 10px 0;
147+
}
143148
}

‎client/src/app/components/match-grid/match-grid.component.scss‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.small-grid {
22
position: relative;
33
display: grid;
4+
gap: 5px;
45
justify-items: center;
56
grid-template-columns: 1fr repeat(5, 50px) 1fr;
67
grid-template-rows: 1fr repeat(5, 50px) 1fr;

‎client/src/app/components/shared/footer/footer.component.html‎

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,32 @@
1-
<div class="page--footer flex justify-between">
2-
<div class="page--footer-column-left ellipsize flex items-center">
1+
<div class="flex justify-between mx-6 my-2 items-center">
2+
<div class="ellipsize flex justify-center items-center gap-4">
33
@if (showExitButton) {
4-
<button
5-
class="page--footer-button material-symbols-outlined"
6-
(click)="openExitGameDialog()"
7-
>
8-
close
9-
</button>
4+
<button class="material-symbols-outlined" (click)="openExitGameDialog()">
5+
home
6+
</button>
107
}
118

12-
<button class="page--footer-button" (click)="toggleBase()">
13-
<span class="page--footer-icons material-symbols-outlined">
14-
{{ basePlaying ? "volume_up" : "volume_off" }}
15-
</span>
9+
<button class="material-symbols-outlined" (click)="toggleBase()">
10+
{{ basePlaying ? "volume_up" : "volume_off" }}
1611
</button>
17-
<button
18-
class="page--footer-button material-symbols-outlined"
19-
(click)="openLanguageModal()"
20-
>
12+
<button class="material-symbols-outlined" (click)="openLanguageModal()">
2113
<span class="page--footer-icons">
2214
<img
2315
[src]="'assets/img/flags/' + language + '.svg'"
2416
alt=""
2517
width="30"
2618
height="24"
27-
/>
19+
/>
2820
</span>
29-
3021
</button>
3122
</div>
3223

33-
<div class="page--footer-column-right ellipsize">
34-
<button class="page--footer-button" (click)="navigateToLogin()">
24+
<div class="ellipsize">
25+
<button class="" (click)="navigateToLogin()">
3526
<span class="page--footer-icons material-symbols-outlined">
3627
account_circle
3728
</span>
3829
<span class="ellipsize">
39-
4030
{{ userNickname }}
4131
</span>
4232
</button>

‎client/src/app/components/shared/footer/footer.component.ts‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import { Component, OnInit } from '@angular/core';
32
import { MatDialog } from '@angular/material/dialog';
43
import { ActivatedRouteSnapshot, NavigationEnd, Router } from '@angular/router';
@@ -46,20 +45,26 @@ export class FooterComponent implements OnInit {
4645
private translate: TranslateService
4746
) {}
4847

48+
private updateExitButton(url: string): void {
49+
this.showExitButton = url !== '/home';
50+
}
51+
4952
ngOnInit(): void {
5053
this.userLogin();
51-
// get current lang
54+
5255
this.language =
5356
this.translate.currentLang || this.translate.getDefaultLang() || 'it';
5457

55-
// react to language changes
5658
this.translate.onLangChange.subscribe((event) => {
5759
this.language = event.lang;
5860
});
61+
62+
this.updateExitButton(this.router.url);
63+
5964
this.router.events
6065
.pipe(filter((event) => event instanceof NavigationEnd))
61-
.subscribe((event: any) => {
62-
this.showExitButton = event.urlAfterRedirects !== '/home';
66+
.subscribe((event: NavigationEnd) => {
67+
this.updateExitButton(event.urlAfterRedirects);
6368
});
6469
}
6570

0 commit comments

Comments
 (0)