breadadams / scroller-motion

🛹 Elegant motion scrolling for React

Home Page:https://scroller-motion.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

flickering line between page sections

victorcodess opened this issue · comments

Hello there! Thank you so much for this wonderful package. The smooth scrolling seems to be working pretty fine, but while scrolling through sections on my page, I get this flickering line between them which fades off after I stop scrolling. I went through the docs and added the

html,
body {
  overscroll-behavior: none;
}

to my css file, but it doesn't seem to solve anything. It's a single page next.js website and here is the structure of my page.tsx:

return (
    <ScrollerMotion>
      <main className="flex flex-col items-center justify-center">
        <Hero />
        <Work />
        <About />
        <Contact />
        <Footer />
      </main>
    </ScrollerMotion>
  );

Is there a way to solve this? Thank you for your time!

Hi @victorcodess, those styles you refer to are for preventing the "elastic" overscroll effect, I don't think they are related to the issue you described.

Could you please provide a minimal reproduction? Either a repository or something like a CodeSandbox or StackBlitz demo.

The bug seems to be fixed now, but it seems I'm still having some performance issues while scrolling.

Here's a CodeSandbox demo: https://codesandbox.io/p/github/victorcodess/folio-v1/main?file=%2FREADME.md&workspaceId=a61b127f-67eb-4889-bf03-a02cb268a5d9

@victorcodess I can't access the codesandbox, I think you'll need to adjust the permissions:

image

Hey @victorcodess, ideally the repro should be a smaller example where I can reproduce the bug, as unfortunately I can't be debugging an entire app. In doing so it's also likely that you come across the combination of code/libraries that's causing the issue.

I did however play around with the code a little, and noticed this CSS being applied after the initial page load:

228760991-a514f162-9c11-461a-b748-0caee25a43f7

It looks like after your preloader animation has finished, when you change overflow-y from hidden to scroll, it changes back to hidden not long after for a couple of seconds.

Also not too sure about how compatible the blobity library is, would need to be tested in a more isolated environment of just scroller-motion + blobity to confirm.

Hello @breadadams, thank you so much for your assistance. I've been able to resolve the issue with the preloader, it seems the bug was from the gsap timeline setup in the loader.js file.

Concerning the performance issues, I'm assuming it's not directly tied to scroller-motion but to the performance of the entire website/browser. I tried testing again and it seems to work fine at times, especially in incognito mode or when only a few tabs are open.

But, when you enable scrollermotion the navbar navigation doesn't work. You can see a reproduction in the codesandbox.

@victorcodess probably related to #4, see the solution here: #4 (comment)

This doesn't really solve the problem, because the navabar was never in the ScrollerMotion component. I am able to scroll to a section in the ScrollerMotion component when it is commented out, but once I uncomment it, the click to scroll functionality seizes to work.

Here is the code structure:

<>
      <PreLoader />

      <NavBar />

      <ScrollerMotion>
      <main className="flex flex-col items-center justify-center">
        <Hero />
        <Work />
        <About />
        <Blog />
        <Contact />
        <Footer />
      </main>
      </ScrollerMotion>
</>

You can view the demo in the link above. Thank you!