From 77e75ff7b3371bb2db09df71f786d25c7928cb1f Mon Sep 17 00:00:00 2001 From: veenm Date: Sat, 19 Apr 2025 13:02:32 +0200 Subject: [PATCH] mobiele layout toegevoegd --- src/app/pages/agenda/agenda.component.scss | 7 + src/app/pages/home/home.component.html | 49 +++---- src/app/pages/home/home.component.scss | 154 +++++++++++++-------- src/app/pages/home/home.component.ts | 6 +- 4 files changed, 132 insertions(+), 84 deletions(-) diff --git a/src/app/pages/agenda/agenda.component.scss b/src/app/pages/agenda/agenda.component.scss index 91bc3fc..2a75217 100644 --- a/src/app/pages/agenda/agenda.component.scss +++ b/src/app/pages/agenda/agenda.component.scss @@ -4,6 +4,13 @@ padding: 20px; } +@media (max-width: 768px) { + .container { + max-width: 95vw; + } +} + + ul { list-style-type: none; padding: 0; diff --git a/src/app/pages/home/home.component.html b/src/app/pages/home/home.component.html index eee53cd..e543500 100644 --- a/src/app/pages/home/home.component.html +++ b/src/app/pages/home/home.component.html @@ -4,40 +4,33 @@
diff --git a/src/app/pages/home/home.component.scss b/src/app/pages/home/home.component.scss index 38e8645..5cd9216 100644 --- a/src/app/pages/home/home.component.scss +++ b/src/app/pages/home/home.component.scss @@ -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; + } + } } diff --git a/src/app/pages/home/home.component.ts b/src/app/pages/home/home.component.ts index 1f68cbf..ca537e8 100644 --- a/src/app/pages/home/home.component.ts +++ b/src/app/pages/home/home.component.ts @@ -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) { }