Fixed anchorpoint and tiny-ing of navbar

This commit is contained in:
Peter
2025-04-05 00:20:07 +02:00
parent 8b76a729b8
commit ca96b36246
7 changed files with 179 additions and 14 deletions
+23 -1
View File
@@ -1,4 +1,4 @@
import {Component, Input} from '@angular/core';
import {Component, HostListener, Input} from '@angular/core';
import {ALTITUDE_VERSION} from '../constant';
@Component({
@@ -12,6 +12,28 @@ export class HeaderComponent {
@Input() sub_title: string = '';
@Input() current_page: string = ''
public active: string = ''
@HostListener('window:scroll', [])
onWindowScroll(): void {
const scrollPosition = window.scrollY;
if (scrollPosition > 0) {
this.active = 'active';
} else {
this.active = '';
}
}
scrollToSection(): void {
const element = document.getElementById('scrollingpoint');
if (element) {
element.scrollIntoView({ behavior: 'smooth', block: 'start' });
} else {
console.error('Element with id "scrollingpoint" not found.');
}
}
public getCurrentPageId(options: string[]) {
if (options.includes(this.current_page)) {
return 'current_page'