Add toggleable Minimalist Monochrome UI

Merged
BO
10mo ago
+518-32

What does this PR aim to accomplish?:

Add a new toggleable UI theme option ("MonochromeUI") that overhauls the visual design with a minimalist monochrome aesthetic: serif typography (Playfair Display + Source Serif 4), sharp corners, line-based borders, and inverted headers. The setting is under Beautify → 极简黑白界面风格 and defaults to on. When disabled, the original Bootstrap styling is fully restored.
image
image

How does this PR accomplish the above?:

  • Global CSS variables: :root and [data-bs-theme='dark'] define --mono-black, --mono-white, --mono-gray-*, and font families. Dark mode uses charcoal (#1a1a1a) instead of pure black for eye comfort.
  • Universal reset: border-radius: 0, box-shadow: none on all elements.
  • Bootstrap overrides: Monochrome styling for navbar, cards, modals, toasts, tables, dropdowns, forms, alerts, list groups — all with !important.
  • Button differentiation: btn-primary filled (black bg), btn-secondary outlined. btn-success/danger/warning/info preserve functional colors as outline style.
  • Status indicators: .status_y/n/w keep colored backgrounds. Std submission status uses text labels ([STD], [OK], [ERR]) instead of emojis. Loading spinner uses Bootstrap spinner-border instead of GIF.
  • Content links: Bottom-border underline (not text-decoration) scoped to .container content, excluding nav/buttons/dropdowns.
  • Early style injection: Lightweight CSS injected before resource loading to reduce layout shift. Font loaded via <link> element.
  • Non-blocking status fetches: ImproveACRate fetch and GetStdList API call no longer block with await, reducing layout shift on status page.
  • Responsive: Problem switcher hidden on screens < 768px. Images constrained with max-width: 100%.
  • Toggleable: UtilityEnabled("MonochromeUI") gates all changes. Disabling fully restores original Bootstrap styles including blur overlay, rounded navbar, original animations.

By submitting this pull request, I confirm the following:

  1. I have read and understood the contributor's guide, as well as this entire template. I understand which branch to base my commits and Pull Requests against.
  2. I have commented on my proposed changes within the code and I have tested my changes.
  3. I am willing to help maintain this change if there are issues with it later.
  4. It is compatible with the GNU General Public License v3.0
  5. I have squashed any insignificant commits. (git rebase)
  6. I have checked that another pull request for this purpose does not exist.
  7. I have considered and confirmed that this submission will be valuable to others.
  8. I accept that this submission may not be used, and the pull request can be closed at the will of the maintainer.
  9. I give this submission freely and claim no ownership to its content.

  • I have read the above and my PR is ready for review. Check this box to confirm

Summary by cubic

Adds a toggleable Minimalist Monochrome UI (default on) with serif typography, sharp corners, and a charcoal dark mode. Ships as 3.0.0 and restores the original Bootstrap UI when turned off.

  • New Features

    • MonochromeUI toggle under Beautify; disabling fully restores Bootstrap.
    • Monochrome CSS with variables and inverted headers; charcoal dark mode; fonts via fonts.loli.net; early style injection to reduce layout shift.
    • Navbar geometry gated by the toggle: flat, full‑width in monochrome; rounded with margin otherwise.
    • UI tweaks: filled primary vs outlined secondary buttons; centered tables with spacing; link bottom-border underline; visible copy button on dark headers; images contained; problem switcher gets a solid background and hides <768px; CodeMirror uses a solid border; blur overlay hidden.
    • Faster animations and dropdowns (100ms); non‑blocking status page fetches; loader.gif replaced by a Bootstrap spinner; std status uses [STD]/[OK]/[ERR].
  • Bug Fixes

    • Skip UploadStd when GetStdList fails to avoid redundant uploads.