banner & styling
This commit is contained in:
@ -1,16 +1,16 @@
|
||||
<mat-toolbar>
|
||||
<mat-toolbar-row>
|
||||
<div>
|
||||
<a class="navbar-brand d-flex align-items-center" href="#">
|
||||
<a class="navbar-brand d-flex align-items-center" routerLink="/" fragment="banner">
|
||||
<img src="assets/img/capricorn.png" alt="Capricorn" height="45" width="45">
|
||||
<div class="px-2">LEGIO · XXX</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="flex-grow-1"></div>
|
||||
<div *ngIf="!hamburger">
|
||||
<a href="#about"><button mat-button class="navbar-button">About</button></a>
|
||||
<a href="#contact"><button mat-button class="navbar-button">Contact</button ></a>
|
||||
<a href="#gallery"><button mat-button class="navbar-button">Gallery</button></a>
|
||||
<a routerLink="/" fragment="about"><button mat-button class="navbar-button">About</button></a>
|
||||
<a routerLink="/" fragment="contact"><button mat-button class="navbar-button">Contact</button ></a>
|
||||
<a routerLink="gallery"><button mat-button class="navbar-button">Gallery</button></a>
|
||||
<button mat-button [matMenuTriggerFor]="eventsMenu" class="navbar-button">
|
||||
Events <mat-icon>expand_more</mat-icon>
|
||||
</button>
|
||||
|
@ -17,18 +17,21 @@
|
||||
|
||||
.navbar-brand {
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
font-weight: lighter;
|
||||
|
||||
&:hover img {
|
||||
filter: brightness(5%) sepia(75) saturate(100) hue-rotate(25deg);
|
||||
}
|
||||
}
|
||||
|
||||
.navbar-button {
|
||||
color: rgba(255, 255, 255, 0.55);
|
||||
//color: rgba(255, 255, 255, 0.55);
|
||||
font-weight: normal;
|
||||
padding: 0 8px 0 8px;
|
||||
|
||||
&:hover {
|
||||
color: rgba(255, 255, 255, 0.75);
|
||||
}
|
||||
//&:hover {
|
||||
// color: rgba(255, 255, 255, 0.75);
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,12 +1,34 @@
|
||||
import {Component, EventEmitter, Input, Output} from '@angular/core';
|
||||
import {AfterViewInit, Component, EventEmitter, Input, OnDestroy, Output} from '@angular/core';
|
||||
import {ActivatedRoute, NavigationEnd, Router} from '@angular/router';
|
||||
import {filter, Subscription} from 'rxjs';
|
||||
|
||||
@Component({
|
||||
selector: 'xxx-navbar',
|
||||
templateUrl: './navbar.component.html',
|
||||
styleUrls: ['./navbar.component.scss']
|
||||
})
|
||||
export class NavbarComponent {
|
||||
export class NavbarComponent implements AfterViewInit, OnDestroy {
|
||||
private sub!: Subscription;
|
||||
|
||||
@Input() hamburger = true;
|
||||
|
||||
@Output() hamburgerClick = new EventEmitter<void>();
|
||||
|
||||
constructor(private route: ActivatedRoute) { }
|
||||
|
||||
ngAfterViewInit() {
|
||||
this.sub = this.route.fragment.subscribe(frag => {
|
||||
if(frag) this.scroll(frag);
|
||||
});
|
||||
}
|
||||
|
||||
ngOnDestroy(): void {
|
||||
if(this.sub) this.sub.unsubscribe();
|
||||
}
|
||||
|
||||
scroll(id: string) {
|
||||
const el = document.getElementById(id);
|
||||
if(el) el.scrollIntoView({behavior: 'smooth'});
|
||||
else setTimeout(() => this.scroll(id), 500);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user