Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flickering line between page sections #38

Open
victorcodess opened this issue Mar 21, 2023 · 10 comments
Open

flickering line between page sections #38

victorcodess opened this issue Mar 21, 2023 · 10 comments

Comments

@victorcodess
Copy link

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!

@breadadams
Copy link
Owner

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.

@victorcodess
Copy link
Author

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

@breadadams
Copy link
Owner

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

image

@breadadams
Copy link
Owner

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.

@victorcodess
Copy link
Author

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.

@victorcodess
Copy link
Author

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

@breadadams
Copy link
Owner

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

@victorcodess
Copy link
Author

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!

@seanjermey
Copy link

Adding a unstyled containing div fixed this for me

<ScrollerMotion>
  <div>
     ....
  </div>
</ScrollerMotion>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants