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;
}
@media (max-width: 768px) {
.container {
max-width: 95vw;
}
}
ul {
list-style-type: none;
padding: 0;

View File

@@ -4,40 +4,33 @@
</div>
<header>
<div class="navbar">
<img src="assets/logo-minimal.png" alt="App Logo" class="img-fluid">
<ul>
<li><a routerLink="/home/agenda" id="agenda" routerLinkActive="active">Agenda</a></li>
<li><a routerLink="/home/klanten" id="klanten" routerLinkActive="active">Klanten</a></li>
</ul>
<hr/>
<button
tuiChevron
type="button"
id="userMenu"
[tuiDropdown]="dropdownContent"
[tuiDropdownManual]="open"
[tuiObscuredEnabled]="open"
(click)="onClick()"
(tuiActiveZoneChange)="onActiveZone($event)"
(tuiObscured)="onObscured($event)">
<tui-avatar src="{{getInitials()}}"/>
<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>
<li><a routerLink="/home/agenda" routerLinkActive="active">Agenda</a></li>
<li><a routerLink="/home/klanten" routerLinkActive="active">Klanten</a></li>
</ul>
<button
tuiChevron
type="button"
id="userMenu"
[tuiDropdown]="dropdownContent"
[tuiDropdownManual]="open"
[tuiObscuredEnabled]="open"
(click)="onClick(); $event.stopPropagation()"
(tuiActiveZoneChange)="onActiveZone($event)"
(tuiObscured)="onObscured($event)">
<tui-avatar [src]="getInitials()"></tui-avatar>
</button>
</div>
</button>
<ng-template #dropdownContent>
<div class="dropdown">
<h3>{{ fullName }}</h3>
<h4>{{ userService.currentCompany.name }}</h4>
<button
size="m"
tuiButton
type="button"
id="uitloggen"
(click)="logout()">
Uitloggen
</button>
<button tuiButton size="m" type="button" (click)="logout()">Uitloggen</button>
</div>
</ng-template>
</div>

View File

@@ -1,62 +1,106 @@
.navbar {
background-color: #f8f9fa;
display: flex;
align-items: center;
@keyframes slideDown {
0% {
opacity: 0;
transform: translateY(-10%);
}
100% {
opacity: 1;
transform: translateY(0);
}
}
ul {
display: flex;
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;
}
.dropdown {
font-size: 0.8125rem;
line-height: 1.25rem;
padding: 0.25rem 0.75rem;
margin: 20px 20px 8px 4px;
min-width: 200px;
}
.navbar {
background-color: #f8f9fa;
padding: 10px 16px;
display: flex;
align-items: center;
flex-wrap: wrap;
ui-scrollbar.t-scroll.ng-tns-c452864359-10._native-hidden {
margin-right: 24px;
}
> img {
max-height: 50px;
width: auto;
margin-right: 24px;
}
button {
background: transparent;
border: none;
.hamburger {
font-size: 24px;
background: 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 {UserService} from '../../services/user.service';
import {AppUserDto, CompanyDTO} from '../../models/app-user-dto';
import {NgClass} from '@angular/common';
@Component({
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',
styleUrl: './home.component.scss'
})
@@ -20,6 +21,8 @@ export class HomeComponent implements OnInit {
user: AppUserDto;
fullName: string
companies: CompanyDTO[];
menuOpen = false;
getInitials(): string {
this.user = this.userService.userValue
@@ -43,6 +46,7 @@ export class HomeComponent implements OnInit {
this.open = active && this.open;
}
constructor(private authService: AuthService, private router: Router, protected userService: UserService) {
}