From 1264003a44755e9387458b374f8e6c6fad42bb4f Mon Sep 17 00:00:00 2001 From: Teriuihi Date: Sat, 12 Apr 2025 16:51:08 +0200 Subject: [PATCH] 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. --- frontend/src/app/header/header.component.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/header/header.component.ts b/frontend/src/app/header/header.component.ts index 2d80ab8..f066ba4 100644 --- a/frontend/src/app/header/header.component.ts +++ b/frontend/src/app/header/header.component.ts @@ -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 = ''; } }