Adjust scroll activation threshold and reset inverseYPos.

Increased the scroll threshold for activating the header to 5 for better usability. Added a reset for `inverseYPos` to 0 when the scroll position is at the top, ensuring consistent behavior.
This commit is contained in:
Teriuihi 2025-04-12 16:51:08 +02:00
parent a1b42060b0
commit 1264003a44

View File

@ -27,10 +27,11 @@ export class HeaderComponent {
@HostListener('window:scroll', [])
onWindowScroll(): void {
const scrollPosition = window.scrollY;
if (scrollPosition > 0) {
if (scrollPosition > 5) {
this.active = 'active';
this.inverseYPos = scrollPosition - (scrollPosition * 0.2);
} else {
this.inverseYPos = 0;
this.active = '';
}
}