Fix dark mode and bring the public design in line with the taste audit
- Dark mode: the countdown card, timeline section, Giving text, error text, the Leadership button, skeletons and the admin's dark text all follow the tokens; logos get a light plate in dark mode - One BRAND accent (the button token, so the admin palette reaches every page) and one ACCENTS family in color.ts, replacing 20 local teal constants and the purple, ochre and rust section colours; neon green and gold become mint and brand green - Shadows are tinted with the site's ink; glow shadows are gone - One giving label, Give, in the nav, footer and Giving page - Phosphor icons replace the hand-drawn SVGs and the glyph icons; Pathfinder paths pick a named icon (emoji still shown) and lose the watermark - Home keeps two eyebrows; StatsBand's title is a real heading; section headings step down under the page title - Nav links switch to the menu below lg, so they never wrap; jump links land clear of the header; press feedback on buttons - Empty sections say what's coming and who to ask; loading is a skeleton; form placeholders and borders are readable; one corner-radius rule; theme-color for both modes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
f72a9604d2
commit
048c7599ce
59 changed files with 416 additions and 350 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import { X, List } from "@phosphor-icons/react";
|
||||
import { Suspense, useState, useEffect, useRef } from "react";
|
||||
import { NavLink, Link, Outlet, useLocation } from "react-router-dom";
|
||||
import { PAGE_LINKS, PAGE_SECTIONS, NAV_ACTIONS } from "../navConfig.ts";
|
||||
|
|
@ -28,7 +29,7 @@ const ACTION_VARIANTS: Record<
|
|||
},
|
||||
fancy: {
|
||||
className: "font-bold text-white hover:scale-105",
|
||||
style: { background: "#0f7183" },
|
||||
style: { background: "var(--color-action)" },
|
||||
},
|
||||
};
|
||||
|
||||
|
|
@ -47,7 +48,7 @@ function NavAction({
|
|||
onClick?: () => void;
|
||||
}) {
|
||||
const v = ACTION_VARIANTS[item.variant] ?? ACTION_VARIANTS.ghost;
|
||||
const className = `inline-block whitespace-nowrap rounded-full transition-all duration-200 ${ACTION_SIZES[size]} ${v.className}`;
|
||||
const className = `inline-block whitespace-nowrap rounded-full transition-all duration-200 active:scale-[0.98] ${ACTION_SIZES[size]} ${v.className}`;
|
||||
|
||||
return item.external ? (
|
||||
<a
|
||||
|
|
@ -74,7 +75,11 @@ const navActions = NAV_ACTIONS as NavActionItem[];
|
|||
export default function Layout() {
|
||||
const [mobileMenuOpen, setMobileMenuOpen] = useState(false);
|
||||
const [activeSection, setActiveSection] = useState<string | null>(null);
|
||||
const [headerHeight, setHeaderHeight] = useState(72);
|
||||
// Measured below; this first guess (nav, plus the section strip on
|
||||
// pages that have one) keeps the content from jumping when it lands.
|
||||
const [headerHeight, setHeaderHeight] = useState(() =>
|
||||
72 + ((PAGE_SECTIONS[window.location.pathname] ?? []).length ? 36 : 0),
|
||||
);
|
||||
const headerRef = useRef<HTMLElement>(null);
|
||||
const closeMenuRef = useRef<HTMLButtonElement>(null);
|
||||
const location = useLocation();
|
||||
|
|
@ -153,7 +158,10 @@ export default function Layout() {
|
|||
}, [location.pathname, headerHeight]);
|
||||
|
||||
return (
|
||||
<div className="min-h-screen overflow-x-hidden">
|
||||
<div
|
||||
className="min-h-screen overflow-x-hidden"
|
||||
style={{ "--header-h": `${headerHeight}px` } as React.CSSProperties}
|
||||
>
|
||||
<a
|
||||
href="#main"
|
||||
className="sr-only focus:not-sr-only focus:fixed focus:top-2 focus:left-2 focus:z-[70] focus:rounded-full focus:bg-surface focus:px-4 focus:py-2 focus:font-semibold focus:text-ink"
|
||||
|
|
@ -182,7 +190,7 @@ export default function Layout() {
|
|||
<img src={nguLogo} alt="Next Generation of Unity" className="h-10 w-auto" />
|
||||
</Link>
|
||||
|
||||
<div className="hidden md:flex items-center gap-6">
|
||||
<div className="hidden lg:flex items-center gap-6">
|
||||
{PAGE_LINKS.map((page) => (
|
||||
<NavLink
|
||||
key={page.path}
|
||||
|
|
@ -203,7 +211,7 @@ export default function Layout() {
|
|||
</div>
|
||||
|
||||
<div className="flex items-center gap-4">
|
||||
<div className="hidden md:flex items-center gap-3">
|
||||
<div className="hidden lg:flex items-center gap-3">
|
||||
{navActions.map((item) => (
|
||||
<NavAction key={item.label} item={item} />
|
||||
))}
|
||||
|
|
@ -212,14 +220,12 @@ export default function Layout() {
|
|||
<ThemeToggle className="text-white/80 hover:bg-white/10 hover:text-white" />
|
||||
|
||||
<button
|
||||
className="md:hidden text-white p-2"
|
||||
className="lg:hidden text-white p-2"
|
||||
aria-label="Open menu"
|
||||
aria-expanded={mobileMenuOpen}
|
||||
onClick={() => setMobileMenuOpen(!mobileMenuOpen)}
|
||||
>
|
||||
<div className="w-6 h-0.5 bg-white mb-1.5 transition-all" />
|
||||
<div className="w-6 h-0.5 bg-white mb-1.5" />
|
||||
<div className="w-6 h-0.5 bg-white" />
|
||||
<List size={26} weight="bold" aria-hidden="true" />
|
||||
</button>
|
||||
</div>
|
||||
</nav>
|
||||
|
|
@ -294,7 +300,7 @@ export default function Layout() {
|
|||
aria-label="Close menu"
|
||||
onClick={() => setMobileMenuOpen(false)}
|
||||
>
|
||||
×
|
||||
<X size={28} weight="bold" aria-hidden="true" />
|
||||
</button>
|
||||
|
||||
<div className="w-64">
|
||||
|
|
@ -309,7 +315,7 @@ export default function Layout() {
|
|||
end={page.path === "/"}
|
||||
className={({ isActive }) =>
|
||||
`block text-2xl font-bold py-3 transition-colors ${
|
||||
isActive ? "text-[#aac992]" : "text-white hover:text-[#10d48a]"
|
||||
isActive ? "text-[#aac992]" : "text-white hover:text-[#9fe7d0]"
|
||||
}`
|
||||
}
|
||||
>
|
||||
|
|
@ -326,7 +332,7 @@ export default function Layout() {
|
|||
<a
|
||||
key={section.hash}
|
||||
href={section.hash}
|
||||
className="text-white/80 text-lg py-2 hover:text-[#10d48a] transition-colors"
|
||||
className="text-white/80 text-lg py-2 hover:text-[#9fe7d0] transition-colors"
|
||||
onClick={() => setMobileMenuOpen(false)}
|
||||
>
|
||||
{section.label}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue