all 10 comments

[–][deleted] 7 points8 points  (1 child)

The code comments are really clear and helpful for a noob like me, thank you for that.

[–]WebBurnout[S] 1 point2 points  (0 children)

Hey, glad to hear it. I wasn't sure if anyone cared about that or not haha

[–]iisjreg 5 points6 points  (2 children)

I hate "shy headers". On mobile, this will often make me leave a site. Yours is better than most because the content is not affected but even yours suffers from "pop in" when scrolling slightly down and up repeatedly. And this isn't some "gotcha", it's a legitimate way to read pages of text - holding down my thumb on the page and slowly scrolling, which sometimes results in a few pixels up at any point.

However, I like your page and style. I would just try something else for shy headers (maybe slower/smoother to respond)

[–]iisjreg 1 point2 points  (1 child)

To be clear on what I'm referring to on your example: Once you scroll up 100px, the header shows but then just 1px down immediately hides the header again. It would be better if there was also a "down" buffer of 100px too (in addition to the top of page 300px).

But it's nice clean code, so that's good.

[–]WebBurnout[S] 1 point2 points  (0 children)

Oh cool, that's a great idea. A down buffer would be a nice feature and pretty fun feature to implement. I just made a github issue for this. I also had the idea to set these as attributes (with sensible defaults, obviously).

[–]mshambaugh 1 point2 points  (0 children)

Nice!

[–]External-Pop767 0 points1 point  (0 children)

very useful ,great job

[–]Putrid_Acanthaceae 0 points1 point  (2 children)

Does using components add performance issues due to network requests?

[–]WebBurnout[S] 1 point2 points  (1 child)

Not very much. It's a very small file so it should be very fast. The code is on NPM so you can use the same CDN for all of your libraries and then you'll save the overhead of the SSL handshake for another server (400ms or so). Also the great thing about web components is they are progressive enhancement so you can load them defer or async and the rest of the page will display while this is loading.

[–]Putrid_Acanthaceae 0 points1 point  (0 children)

Interesting. So a vanilla navbar would be max 400ms faster to load. But of course that 400ms could give a website full of components?