From a1b42060b0b82158adf4f992b8c1323939cf3a19 Mon Sep 17 00:00:00 2001 From: Teriuihi Date: Sat, 12 Apr 2025 16:47:17 +0200 Subject: [PATCH] Revise scroll position calculation in header component Updated the formula for calculating `inverseYPos` to use a 20% reduction approach instead of dividing by 4 and inverting. This ensures a smoother and more proportional adjustment during scrolling. --- frontend/src/app/header/header.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/app/header/header.component.ts b/frontend/src/app/header/header.component.ts index 4d31d17..2d80ab8 100644 --- a/frontend/src/app/header/header.component.ts +++ b/frontend/src/app/header/header.component.ts @@ -29,7 +29,7 @@ export class HeaderComponent { const scrollPosition = window.scrollY; if (scrollPosition > 0) { this.active = 'active'; - this.inverseYPos = (scrollPosition / 4) * -1; + this.inverseYPos = scrollPosition - (scrollPosition * 0.2); } else { this.active = ''; }