feat: drop parallax.js in favor of custom parallax code

This commit is contained in:
HarshKhandeparkar 2020-06-08 01:16:54 +05:30
parent c2b334d60b
commit 1455ac4a4f
2 changed files with 10 additions and 6 deletions

View file

@ -0,0 +1,10 @@
// Parallax
const depthFactor = 10; // Depth of the image wrt to the 0 z-index. 1 being at the same distance as the rest of the content and Infinity being as far away as possible.
$(window).on('scroll', () => {
const movedBy = window.scrollY;
$('.parallax .parallax-img').css({
transform: `translateY(${movedBy / depthFactor}px)` // Move differently than the rest of the window
})
})
// /Parallax

File diff suppressed because one or more lines are too long