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.
This commit is contained in:
Teriuihi 2025-04-12 16:47:17 +02:00
parent 3499f331a0
commit a1b42060b0

View File

@ -29,7 +29,7 @@ export class HeaderComponent {
const scrollPosition = window.scrollY; const scrollPosition = window.scrollY;
if (scrollPosition > 0) { if (scrollPosition > 0) {
this.active = 'active'; this.active = 'active';
this.inverseYPos = (scrollPosition / 4) * -1; this.inverseYPos = scrollPosition - (scrollPosition * 0.2);
} else { } else {
this.active = ''; this.active = '';
} }