This commit is contained in:
2025-08-09 03:56:42 +02:00
parent 679427a6f9
commit 0cc8bddfa1
6 changed files with 64 additions and 25 deletions

View File

@@ -1,17 +1,24 @@
<header> <header>
<logo></logo> <logo></logo>
<events-link></events-link> @if(!hideButtons) {
<tags-link></tags-link> <div class="header-links" id="header-buttons">
<services-link></services-link> <events-link></events-link>
@if (user.isLoggedIn) { <tags-link></tags-link>
<user-galleries-link></user-galleries-link> <services-link></services-link>
} @if (user.isContentManager) { @if (user.isLoggedIn) {
<content-manager-panel-link></content-manager-panel-link> <user-galleries-link></user-galleries-link>
} @if (user.isAdmin) { } @if (user.isContentManager) {
<admin-panel-link></admin-panel-link> <content-manager-panel-link></content-manager-panel-link>
} @if (user.isLoggedIn) { } @if (user.isAdmin) {
<user-profile-link></user-profile-link> <admin-panel-link></admin-panel-link>
} @else { }
<login-link></login-link> <div class="user-profile">
@if (user.isLoggedIn) {
<user-profile-link></user-profile-link>
} @else {
<login-link (click)="login($event)"></login-link>
}
</div>
</div>
} }
</header> </header>

View File

@@ -3,23 +3,35 @@ header {
top: 0; top: 0;
z-index: 1000; z-index: 1000;
background: transparent; background: transparent;
margin: 0; padding-left: 2rem;
padding: 0; max-width: 100%;
width: 100%; height: 10%;
height: 7%;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: baseline; align-items: center;
align-content: center; align-content: center;
justify-content: space-evenly;
gap: 0; gap: 0;
logo { logo {
width: 10%; width: 30%;
height: 100%; height: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
order: 0; order: 0;
flex-grow: 1;
}
.header-links {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-around;
gap: 1rem;
margin: 0;
padding: 0;
flex-grow: 1;
.user-profile {
order: 9999;
}
} }
} }

View File

@@ -42,4 +42,14 @@ export class Header implements OnInit {
get user() { get user() {
return this.currentUser; return this.currentUser;
} }
hideButtons = false;
login(event: Event) {
event.preventDefault();
this.hideButtons = true;
// const headerButtons = document.getElementById('header-buttons');
// if (headerButtons) {
// headerButtons.style.display = 'none';
// }
}
} }

View File

@@ -1,4 +1,4 @@
import { Component } from '@angular/core'; import { Component, EventEmitter, Output, output } from '@angular/core';
import { SvgButton } from '../../../utils/svg-button/svg-button'; import { SvgButton } from '../../../utils/svg-button/svg-button';
@Component({ @Component({
@@ -7,4 +7,6 @@ import { SvgButton } from '../../../utils/svg-button/svg-button';
templateUrl: './login-link.html', templateUrl: './login-link.html',
styleUrl: './login-link.scss', styleUrl: './login-link.scss',
}) })
export class LoginLink {} export class LoginLink {
@Output() login = new EventEmitter<void>();
}

View File

@@ -1,3 +1,3 @@
<a routerLink="/"> <a href="/">
<img [src]="logoSrc" alt="Logo" /> <img [src]="logoSrc" alt="Logo" />
</a> </a>

View File

@@ -1,6 +1,14 @@
a { a {
max-width: 100%;
height: 100%;
margin: 0;
padding: 0;
img { img {
width: 100%; width: auto;
height: auto; max-width: 100%;
height: 100%;
margin: 0;
padding: 0;
object-fit: scale-down;
} }
} }