better parallax-bg
This commit is contained in:
@@ -286,13 +286,24 @@ gsap.registerPlugin(ScrollTrigger, ScrollSmoother);
|
||||
});
|
||||
|
||||
ScrollSmoother.create({
|
||||
smooth: 1, // how long (in seconds) it takes to "catch up" to the native scroll position
|
||||
smooth: 3, // how long (in seconds) it takes to "catch up" to the native scroll position
|
||||
effects: true, // looks for data-speed and data-lag attributes on elements
|
||||
smoothTouch: 0.1, // much shorter smoothing time on touch devices (default is NO smoothing on touch devices)
|
||||
wrapper: 'main[role="main"]',
|
||||
content: 'main[role="main"]>.layout-content'
|
||||
});
|
||||
|
||||
gsap.to('#parallax-bg', {
|
||||
y: (i, target) => -(ScrollTrigger.maxScroll(window) * 1.2),
|
||||
ease: "none",
|
||||
scrollTrigger: {
|
||||
trigger: 'main[role="main"] > .layout-content > .wrapper',
|
||||
start: "top bottom",
|
||||
end: "bottom top",
|
||||
scrub: true,
|
||||
invalidateOnRefresh: true
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user