A simple super-vanilla (HTML/JS/CSS) implementation of the idea for UI component. A navigation containing anchor links (#) to scroll & position to corresponding sections of text.
Usage of Intersection Observer API along with code/logic for portrait viewports where as, with just a little JavaScript and CSS, this becomes separate UI widget, i.e. on phones. Usage of zenscroll, not mandatory and the script will fallback to window.scroll, but recommended for "smoothness", on the phone especially.
- Clone this repository
- If you do not plan tu use zenscroll, comment it out in "index.html" file, two lines by the bottom. Else: get "zenscroll-min.js" from its repository and place it in "js" folder and leave "index.html" intact.