Show HN: Vue.js sliding header(s) for top navigation bar
github.com
github.com
However, upon mentioning my frustration to a friend in the digital advertising business, she brought up the point that sticky headers save users from the carpal-tunnel inducing action of scrolling all the way to the top of a site in order to take an action (e.g. sign up for a service).
We landed in the middle ground of debouncing sticky headers, i.e. the user should firmly establish their intent to view the top portion of a site by scrolling in that direction for at least one second.
These thoughts aside, great work and thanks for contributing to the industry!
I could see a potential argument for increasing screen real estate for content-heavy apps though.
The behaviour if you instantaneously scroll from the top to the bottom (`scrollTo({top:scrollMaxY})` and `scrollTo({top:0})`; to toggle between the two every two seconds, `x=1;setInterval(()=>scrollTo({top:(x=!x)?0:scrollMaxY}),2000)`), where it transitions from one header to the other, is much more what I would expect from something like this. (If you scroll any less than instantaneously, you get a glitch in the animation as it briefly starts hiding one before deciding that no, it should actually just transition to the other.)
If the headers are continuous, and you’re transitioning between them, this sort of thing makes sense, but headers sliding in and out is… risky, at best. I’d strongly recommend against it. I haven’t thought too deeply about this way of expressing it, but I think animations or transitions should almost always go with the grain, that is, in the direction the user is panning. Going against the grain (in which I include the most common examples, 90° and 180°) is distracting. For some personal background so you can see potential biases I may have (though I make this whole comment in good-faith belief about fundamental principles of usability and accessibility), I heartily dislike pages that have content slide in you scroll and they enter the viewport, yet that’s a very common technique on front pages of websites. I find it both distracts and slows me down. Fortunately by disabling JavaScript by default I don’t see many such things ever.
But anyway both thresholds are customizable. They can be set to one number
And for Vue.js guys i advice to take a look at the main and only component to check out how gracefully Vue.js solved this task https://github.com/altrusl/vuesence-sliding-header/blob/mast...
1. Stack two headers on top of each other, both of them sticky. (Only topmost header is visible.)
2. At a certain scroll position, fade/scroll/hide the top header.
I don't understand why you'd chose an incredibly more complex solution that is objectively worse in nearly every way.
On Android Firefox Preview as well as Kiwi Browser (chromium) I simply see a list without anything sticky.
Same for desktop mode in both Android browsers.