FormidableLabs / victory-docs

Documentation for Victory: A collection of composable React components for building interactive data visualizations
http://formidable.com/open-source/victory
30 stars 65 forks source link

Page Scroll Implementation #645

Closed BrittanyIRL closed 4 years ago

BrittanyIRL commented 4 years ago

Page Scroll Implementation

Notion Page

Requirements

  1. When clicking a linked heading in the docs page, it should auto-scroll that heading to the top of the page but NOT hidden behind the header
  2. Refreshing the page should auto-scroll to the appropriate spot if there is a hash in the url
  3. The sidebar nav should behave similarly (see existing site)

Description

Demo

On Refresh or specific hyperlink w/ hash

refreshscroll

In docs scroll

inpage scroll

boygirl commented 4 years ago

The scroll that happens when the sidebar is clicked is lovely, but I'm finding the scroll on load / refresh to be jarring.

BrittanyIRL commented 4 years ago

The scroll that happens when the sidebar is clicked is lovely, but I'm finding the scroll on load / refresh to be jarring.

What about this? I shortened the animation time. I think it works well?

faster-scroll-on-load

inpage scroll