I'm building a blog site. The blog page will have the standard components: A header (image, h1, h2), and then any number of sections. Each section starts with an h3. The sections will be of varying length. The design should be minimal. The only thing new is the scrollbar should be custom. As you can see in the image, the scroll bar should have breaks representing each section. These breaks will serve as a visual indicator of how long each section is, and therefore show you your progress through the section. The key thing is that each section is of varying length, so we want to breaks on the scrollbar to reflect these lengths, just scaled down to fit the viewport. The final thing in this scrollbar is your scroll progress down the page should be reflected by the component filling in with white
I'll create a blog site with a custom scrollbar that shows section breaks proportional to their content length and fills with white to indicate scroll progress. The design will be minimal and clean.
I've created a blog page with a custom scrollbar that matches your design requirements:
The blog includes sample content with varying section lengths to demonstrate how the scrollbar adapts to different content sizes. The design maintains the minimal aesthetic you requested while providing clear visual feedback about reading progress.
Almost there. make it so that clicking on a location on the scrollbar navigates the user to that location on the page. Also since the scroll progress is calculated from the top of the viewport, the scrollbar doesn't indicate that the user has scrolled to the bottom of the page. Finally make the default scrollbar color white
I'll fix those issues - adding click navigation, improving the scroll progress calculation to properly indicate when you've reached the bottom, and changing the default scrollbar color to white.
Perfect! I've made the following improvements:
The scrollbar now provides a much more accurate and interactive reading experience - you can click to jump to any part of the article, and the progress indication properly reflects when you've reached the end of the content!
It's looking better but the scroll progress got messed up. getscrollprogressinsection only ever returns 0 or 1 now, when it should reflect the scroll progress in the individual section. And to fix the issue of the scrollbar not reaching the end, let's add a footer that doesn't count as a section in the scrollbar. This way we can go back to using the top of the viewport for scroll height