mobiele layout toegevoegd
All checks were successful
Docker Image CI / build-and-push (push) Successful in 1m46s
Docker Image CI / deploy (push) Successful in 43s
Docker Image CI / notify-failure (push) Has been skipped

This commit is contained in:
2025-04-19 13:02:32 +02:00
parent 524aa879de
commit 77e75ff7b3
4 changed files with 132 additions and 84 deletions

View File

@@ -4,6 +4,13 @@
padding: 20px; padding: 20px;
} }
@media (max-width: 768px) {
.container {
max-width: 95vw;
}
}
ul { ul {
list-style-type: none; list-style-type: none;
padding: 0; padding: 0;

View File

@@ -4,12 +4,14 @@
</div> </div>
<header> <header>
<div class="navbar"> <div class="navbar">
<img src="assets/logo-minimal.png" alt="App Logo" class="img-fluid"> <img src="assets/logo-minimal.png" alt="App Logo" class="img-fluid" />
<button class="hamburger" (click)="menuOpen = !menuOpen">&#9776;</button>
<div class="nav-wrapper" [ngClass]="{ 'open': menuOpen }">
<ul> <ul>
<li><a routerLink="/home/agenda" id="agenda" routerLinkActive="active">Agenda</a></li> <li><a routerLink="/home/agenda" routerLinkActive="active">Agenda</a></li>
<li><a routerLink="/home/klanten" id="klanten" routerLinkActive="active">Klanten</a></li> <li><a routerLink="/home/klanten" routerLinkActive="active">Klanten</a></li>
</ul> </ul>
<hr/>
<button <button
tuiChevron tuiChevron
type="button" type="button"
@@ -17,27 +19,18 @@
[tuiDropdown]="dropdownContent" [tuiDropdown]="dropdownContent"
[tuiDropdownManual]="open" [tuiDropdownManual]="open"
[tuiObscuredEnabled]="open" [tuiObscuredEnabled]="open"
(click)="onClick()" (click)="onClick(); $event.stopPropagation()"
(tuiActiveZoneChange)="onActiveZone($event)" (tuiActiveZoneChange)="onActiveZone($event)"
(tuiObscured)="onObscured($event)"> (tuiObscured)="onObscured($event)">
<tui-avatar src="{{getInitials()}}"/> <tui-avatar [src]="getInitials()"></tui-avatar>
</button> </button>
</div>
<ng-template #dropdownContent> <ng-template #dropdownContent>
<div class="dropdown"> <div class="dropdown">
<h3>{{ fullName }}</h3> <h3>{{ fullName }}</h3>
<h4>{{ userService.currentCompany.name }}</h4> <h4>{{ userService.currentCompany.name }}</h4>
<button tuiButton size="m" type="button" (click)="logout()">Uitloggen</button>
<button
size="m"
tuiButton
type="button"
id="uitloggen"
(click)="logout()">
Uitloggen
</button>
</div> </div>
</ng-template> </ng-template>
</div> </div>

View File

@@ -1,62 +1,106 @@
.navbar { @keyframes slideDown {
background-color: #f8f9fa; 0% {
display: flex; opacity: 0;
align-items: center; transform: translateY(-10%);
} }
100% {
ul { opacity: 1;
display: flex; transform: translateY(0);
flex-direction: row;
justify-content: center;
list-style-type: none;
align-items: center;
} }
li {
margin: 0 10px;
} }
a {
text-decoration: none;
color: black;
font-size: 16px;
}
img {
display: block;
max-width: 230px;
max-height: 95px;
width: auto;
height: auto;
}
hr {
clear: both;
visibility: hidden;
}
tui-avatar {
margin-right: 32px;
cursor: pointer;
}
.active{ .active{
font-weight: bold; font-weight: bold;
} }
.dropdown { .navbar {
font-size: 0.8125rem; background-color: #f8f9fa;
line-height: 1.25rem; padding: 10px 16px;
padding: 0.25rem 0.75rem; display: flex;
margin: 20px 20px 8px 4px; align-items: center;
min-width: 200px; flex-wrap: wrap;
}
ui-scrollbar.t-scroll.ng-tns-c452864359-10._native-hidden { > img {
max-height: 50px;
width: auto;
margin-right: 24px; margin-right: 24px;
} }
button { .hamburger {
background: transparent; font-size: 24px;
background: none;
border: none; border: none;
cursor: pointer;
display: none;
margin-left: auto;
}
.nav-wrapper {
display: flex;
align-items: center;
flex-grow: 1;
justify-content: space-between;
ul {
display: flex;
list-style: none;
padding: 0;
margin: 0;
li a {
text-decoration: none;
color: black;
font-size: 16px;
padding: 0 8px;
}
}
button#userMenu {
background: none;
border: none;
margin-left: 16px;
}
}
.dropdown {
font-size: 0.8125rem;
padding: 0.25rem 0.75rem;
min-width: 200px;
}
@media (max-width: 768px) {
flex-direction: column;
align-items: flex-start;
.hamburger {
display: block;
align-self: flex-end;
}
.nav-wrapper {
display: none;
width: 100%;
flex-direction: column;
margin-top: 10px;
}
.nav-wrapper.open {
display: flex;
animation: slideDown 0.3s ease-out;
}
ul {
flex-direction: column;
width: 100%;
}
ul li {
padding: 10px 0;
}
button#userMenu {
align-self: flex-end;
margin-right: 16px;
margin-top: 10px;
}
}
} }

View File

@@ -9,10 +9,11 @@ import {environment} from '../../../environments/environment';
import {TuiSelectModule} from '@taiga-ui/legacy'; import {TuiSelectModule} from '@taiga-ui/legacy';
import {UserService} from '../../services/user.service'; import {UserService} from '../../services/user.service';
import {AppUserDto, CompanyDTO} from '../../models/app-user-dto'; import {AppUserDto, CompanyDTO} from '../../models/app-user-dto';
import {NgClass} from '@angular/common';
@Component({ @Component({
selector: 'app-home', selector: 'app-home',
imports: [TuiAvatar, RouterModule, FormsModule, RouterLink, RouterLinkActive, TuiDropdown, TuiObscured, TuiActiveZone, TuiButton, TuiChevron, TuiSelectModule, ReactiveFormsModule], imports: [TuiAvatar, RouterModule, FormsModule, RouterLink, RouterLinkActive, TuiDropdown, TuiObscured, TuiActiveZone, TuiButton, TuiChevron, TuiSelectModule, ReactiveFormsModule, NgClass],
templateUrl: './home.component.html', templateUrl: './home.component.html',
styleUrl: './home.component.scss' styleUrl: './home.component.scss'
}) })
@@ -20,6 +21,8 @@ export class HomeComponent implements OnInit {
user: AppUserDto; user: AppUserDto;
fullName: string fullName: string
companies: CompanyDTO[]; companies: CompanyDTO[];
menuOpen = false;
getInitials(): string { getInitials(): string {
this.user = this.userService.userValue this.user = this.userService.userValue
@@ -43,6 +46,7 @@ export class HomeComponent implements OnInit {
this.open = active && this.open; this.open = active && this.open;
} }
constructor(private authService: AuthService, private router: Router, protected userService: UserService) { constructor(private authService: AuthService, private router: Router, protected userService: UserService) {
} }