OxfordRSE / gutenberg

https://oxfordrse.github.io/gutenberg
BSD 3-Clause "New" or "Revised" License
5 stars 7 forks source link

Mobile and narrow-resolution improvements #235

Closed dankimberley closed 4 months ago

dankimberley commented 4 months ago

A few questions about a few proposed changes to improve UI at mobile and narrow-desktop resolutions. Breaking down changes in each file:

Navbar.tsx

Presents navbar as burger menu at narrow resolutions. A few things:

{(windowSize.width ?? 1024) >= 1024 ? <NavbarWide /> : <NavbarBurger />

Current:

Screenshot 2024-07-03 at 12 41 03

Proposed:

Screenshot 2024-07-03 at 12 41 50

Screenshot 2024-07-03 at 12 42 11

Footer.tsx & ThemeSwitcher.tsx

Improves positioning within the footer when it condenses.

Current:

Screenshot 2024-07-03 at 12 38 10

Proposed:

Screenshot 2024-07-03 at 12 39 13

ThemeCards.tsx & /material/index.tsx

Current:

Screenshot 2024-07-03 at 13 00 18

Proposed:

Screenshot 2024-07-03 at 13 00 50

Content.tsx

Adds padding to content

Current: Screenshot 2024-07-03 at 13 05 33

Proposed:

Screenshot 2024-07-03 at 13 06 47

dankimberley commented 4 months ago

A few questions about a few proposed changes to improve UI at mobile and narrow-desktop resolutions. Breaking down changes in each file:

Navbar.tsx

Presents navbar as burger menu at narrow resolutions. A few things:

  • At the moment I have implemented this with a ternary operator using the useWindowSize hook, returning a different navbar beyond the breakpoint. This works but adds loads of lines to the file so readability isn't great. Should I separate the standard and narrow versions into new components? e.g.

{(windowSize.width ?? 1024) >= 1024 ? <NavbarWide /> : <NavbarBurger />

I think this might be best (to split it into two component files), there is probably a out-of-the-box solution for this e.g. AppBar component but I think I am happy with this homebrew solution for now.

  • Open to suggestions here
  • The burger menu drawer is currently quite minimally styled, any ideas for this? I could add the same arrows as the wide navbar but going down vertically?

So this is all fantastic, great work @dankimberley .

I think for the burger menu styling something as simple as adding an icon for the material, (an open book?) and making it clear that the theme/course/section links are part of that:

e.g.

image

I don't know if both the horizontal line and the indentation are necessary but at least the indentation.

I don't have anything to say about your other changes, I am on board with them. The tiny padding on the content column is in particular a huge improvement.

Great! I'll make some changes to the burger drawer 👍

dankimberley commented 4 months ago

@alasdairwilson burger drawer changed as you suggested and dark mode added:

Screenshot 2024-07-04 at 15 19 40 Screenshot 2024-07-04 at 15 20 00
alasdairwilson commented 4 months ago

Brilliant, the tweaks to the burger menu look great