mirror of
https://iceshrimp.dev/Crimekillz/jointrashposs.git
synced 2024-11-24 09:49:06 +01:00
10 lines
272 B
TypeScript
10 lines
272 B
TypeScript
|
export const vParallax = {
|
||
|
mounted: (src: HTMLElement, binding: Ref<number>) => {
|
||
|
src.style.willChange = 'transform';
|
||
|
|
||
|
window.addEventListener('scroll', () => {
|
||
|
src.style.transform = `translateY(${window.scrollY / binding.value}px)`;
|
||
|
}, { passive: true });
|
||
|
}
|
||
|
}
|