Skip to content

Show the sidebar toggle buttons with a pop-up when you scroll up #823

@choldgraf

Description

@choldgraf

Context

We've been discussing the proper UI/UX to use for making the sidebar toggle buttons accessible from anywhere on the page:

However, we haven't yet converged on a pattern that doesn't feel intrusive or awkward.

One common pattern is to have a little "pop up" that occurs when people scroll upwards on mobile. For example, here's a pop-up for Furo:

chrome_GZEZLTjK3a

Proposal

We should try implementing a similar pop-up that shows the article-header w/ the sidebar toggles when people scroll upwards after they've scrolled down by a certain amount on the page. This could be implemented by either:

  • Making the article-header change its behavior when on mobile and when scrolled down enough, so that it is fixed position and hidden
  • Adding a second article header UI element that is hidden by default, and only becomes active on mobile + scrolled down (so effectively the two headers trade off, when one is activated the other is deactivated / hidden).

We could probably implement this by plugging into the scroll event and adding a function that checks whether the person has scrolled up. That could add a class to our body document that we can use to trigger different kinds of behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions