Skip to content

feat(theme): add NTNU blue default, dark mode, and color/theme toggles#6

Open
G36maid wants to merge 5 commits into
su-nz:mainfrom
G36maid:feat/theme-mode
Open

feat(theme): add NTNU blue default, dark mode, and color/theme toggles#6
G36maid wants to merge 5 commits into
su-nz:mainfrom
G36maid:feat/theme-mode

Conversation

@G36maid
Copy link
Copy Markdown

@G36maid G36maid commented Jun 5, 2026

Summary

  • Set NTNU blue (#2E3192) as the default theme while preserving red as a color toggle option
  • Add orthogonal color (blue/red) and theme (light/dark/auto) toggles with localStorage persistence
  • Share theme variables/toggle logic through theme.css and theme.js to keep the diff smaller and avoid duplicated dark-mode overrides
  • Swap NTNU logo assets based on selected color

Verification

  • Browser QA via Wrangler dev for homepage, redirect preview, generated not-found page, and 404 styling across blue/red × light/dark
  • Clicked the actual toggle controls and verified localStorage persistence across homepage → redirect preview
  • LSP diagnostics: no errors in changed files
  • Browser console: no errors

Closes #5

G36maid added 5 commits June 5, 2026 12:47
…e toggle

- Replace all red CSS variables with NTNU blue (#2E3192) from official
  Wikipedia SVG logo
- Add [data-theme="dark"] block with lightened accent (#7A7DC4) for
  contrast on dark backgrounds
- Add FOUC prevention script inline in <head> across all pages
- Add 3-way theme toggle (light / auto / dark) in homepage nav and
  redirect preview page; persist choice via localStorage
- Replace NTNU_Red.png with NTNU_Blue.png (PNG converted from the
  official Wikipedia SVG via rsvg-convert) and add the source SVG
- Apply dark mode overrides to cards, inputs, buttons, banners,
  testimonials section, stats banner, and 404 page
- Update QR code colorDark to NTNU blue on homepage
…oggle

- Restore original NTNU red palette (#9B2335) as a user-selectable
option
  alongside the new blue (#2E3192)
- Wrap blue palette under :root + [data-color="blue"], add red palette
  under [data-color="red"]
- Add color-aware dark mode primary overrides:
    [data-color="blue"][data-theme="dark"] -> #7A7DC4
    [data-color="red"][data-theme="dark"]  -> #D67485
- Add 2-way color toggle (🔵/🔴) in homepage nav and redirect preview
  page; persist via localStorage.color
- Update FOUC script on all 3 pages to apply data-color on initial load
- Fix dark mode elements that did not respect color override:
  submit button (.btn-submit), feature icons (.feature-icon), and
  testimonial avatars (.author-avatar) — all now use var(--primary)
  instead of the dark gradient in dark mode
- 404 page honors localStorage.color via FOUC script (no UI toggle)
- Restore public/NTNU_Red.png for red mode
- Add two <img> elements (logo-blue / logo-red) in homepage nav,
  homepage footer, and redirect preview card; toggle visibility via
  CSS attribute selectors on [data-color]
- Hide red logo by default; show only when data-color="red"
The .btn class used var(--bg-gradient), which in dark mode becomes a
neutral dark gradient — losing the blue/red color identity. Override
to var(--accent) (already color-aware per [data-color]) so the redirect
preview '立即前往' button keeps its color in dark mode.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Theme toggle mode (Blue Theme, Dark Mode) & Improve Redirect UX

1 participant