What's the Secret Behind This Website's Smooth Scrolling?
Asked by
0p2um-filter
I came across this website and I'm amazed by how smoothly it scrolls without any lag or stutter in animations. As a front-end developer with a few years of experience and having built various static websites, I'm curious if I've overlooked something crucial in creating smoother interactions. I tend to notice micro-stutters in my projects, regardless of whether I'm using Lenis, GSAP, or ScrollReveal for animations. What should I be checking or implementing in my projects to achieve that level of smoothness?
Answers
Honestly, I noticed a lot of stutter in the hero background on that site. It wasn't super smooth for me, which makes me think it might have issues depending on the device.
Reply to this answer
I think they're doing some clever stuff with CSS variables and animations, which offers a pretty seamless experience if implemented correctly. But, I can see how it might be a pain on lower-end devices.
Reply to this answer
It's funny that people still criticize parallax effects over a decade later. Websites like this one often use libraries like [Swup](https://swup.js.org/) to manage transitions efficiently. To get that kind of effect, using a decent parallax framework, optimizing your assets, and deferring content load until it's visible can really help. But bewareโit might not be ideal for an informational site due to performance variations across devices based on how browsers handle rendering and animations.
Reply to this answer
You might want to check out Lenis, it focuses on smooth scrolling. It could be what that website is using. Here's the link: [Lenis](https://lenis.darkroom.engineering/) for reference!
~!brick arch: I tried it on my phone and felt like the scroll acceleration was totally off. It seemed designed more for iPhone and didn't translate well to other devices.
unpainted_surface: I agree, I didn't find it very smooth either, especially on mobile.
Reply to this answer
Add your answer
Answers are reviewed before publication.
bracket+64: Definitely smart tricks there, but the overall performance can be hit or miss depending on the deviceโmy mobile struggled to keep up.
!pour in stages+: Right? Sometimes I wish for simpler sites with snappier scrolls over flashy effects!