Sanity-Gone / SanityGone

El Psy Congroo
https://sanitygone.help/
MIT License
0 stars 1 forks source link

Page Smooth Scrolling #1

Open cortzetroc opened 4 years ago

cortzetroc commented 4 years ago

Guides and future pages will have a sidebar "table of contents" which will allow users to jump to specific sections of the page. Smooth scrolling to avoid abrupt jumps would be preferable here.

Some early considerations of using libraries could be: https://locomotivemtl.github.io/locomotive-scroll/ http://callmecavs.com/jump.js/

Ideally these implementations should be flexible enough to work on any page without much intervention, potentially hooking onto specific classes on a page to check for functionality.

Having each sidebar label highlight as you scroll past the section on the page would be a big plus and something that should be considered.

pseudostars commented 4 years ago

mentioned this in discord but this is inbuilt in most browsers https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollTo

can write up a utility function for convenience tho