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:
parent
3499f331a0
commit
a1b42060b0
|
|
@ -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 = '';
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user