darkroomengineering / lenis

How smooth scroll should be
https://lenis.darkroom.engineering
MIT License
7.33k stars 316 forks source link

Question and request for help #323

Closed gyurmey2 closed 3 months ago

gyurmey2 commented 3 months ago

Hi! I made a parallax effect for the footer using vanilla CSS. The parallax effect works, but at the same time the smooth scrolling at the bottom of the page stops working.

Is there any way to do this?

To Reproduce https://codepen.io/gyurmey2/pen/NWMErqQ

#footer {
  [...]

  /* A troublesome part */
  translate: 0 200%;
}
clementroche commented 3 months ago

It seems like your animation is changing the document dimensions, that's a bit problematic for the future. To fix that you can use __experimental__naiveDimensions: true, consider this as a hotfix since this options is not official yet.

gyurmey2 commented 3 months ago

Wow! Works great! Thank you very much.

gyurmey2 commented 3 months ago

I've noticed that it works fine while scrolling, but the issue arises when jumping using a link. @clementroche would you please take a look?