2025-04-04 22:20:07 +00:00
|
|
|
import {Component, HostListener, Input} from '@angular/core';
|
2025-04-03 19:37:48 +00:00
|
|
|
import {ALTITUDE_VERSION} from '../constant';
|
2025-04-02 20:52:15 +00:00
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
standalone: false,
|
|
|
|
|
selector: 'app-header',
|
|
|
|
|
templateUrl: './header.component.html',
|
|
|
|
|
styleUrls: ['./header.component.scss']
|
|
|
|
|
})
|
2025-04-04 18:31:20 +00:00
|
|
|
export class HeaderComponent {
|
2025-04-02 20:52:15 +00:00
|
|
|
@Input() title: string = '';
|
2025-04-03 19:37:48 +00:00
|
|
|
@Input() sub_title: string = '';
|
2025-04-02 20:52:15 +00:00
|
|
|
@Input() current_page: string = ''
|
|
|
|
|
|
2025-04-04 22:20:07 +00:00
|
|
|
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.');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2025-04-02 20:52:15 +00:00
|
|
|
public getCurrentPageId(options: string[]) {
|
|
|
|
|
if (options.includes(this.current_page)) {
|
|
|
|
|
return 'current_page'
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-03 19:37:48 +00:00
|
|
|
protected readonly ALTITUDE_VERSION = ALTITUDE_VERSION;
|
2025-04-02 20:52:15 +00:00
|
|
|
}
|