QuiltMC / quiltmc.org

The source for quiltmc.org
https://quiltmc.org
Other
58 stars 49 forks source link

Restore/improve patchnote behaviour #220

Closed TheEpicBlock closed 6 months ago

TheEpicBlock commented 6 months ago

Thought it'd be easier to combine these instead of creating separate pr's ^^

This pr fixes the version selector on mobile. It now has the same behaviour as before it broke (which you can view here on the wayback machine). With one exception, the sidebar is now automatically opened if the url fragment is empty. Aria-roles have also been added to this button.

The sidebar is also intended to be sticky on desktop, but that broke at some point. By unsetting the overflow-x property this is now restored. This seems to have no side-effects on how the overflow works. (Don't think it would've mattered anyway unless you had an absurdly small screen).

When pressing versions, the scrolling was also very wonky. This was because all of the buttons had ids equal to their versions. When the url fragment was set to that version, the browser tried to scroll to the button. I also made the it keep the padding above the title when it scrolled to the top of the page. (It now scrolls slightly above the top of the title, instead of making the title sit right on the top of your screen). Additionally, I made sure the sidebar has enough room when the changelog is smaller than the height of your screen. This ensures that the sidebar can keep the same position on both small and large changelogs.

Combined, this means browsing through changelogs is now way smoother.


See preview on Cloudflare Pages: https://preview-220.quiltmc-org.pages.dev

ix0rai commented 6 months ago

thank you so much, this works great!