Overhaul fixes: raised cards, balanced people rows, solid map, small button radius
- Cards sit on a raised surface (white, or a touch of tint in dark mode) with a shadow: featured cards, the connect block, people tiles. tint-soft is a faint teal again, not green. - Buttons: a small plain radius everywhere; no superellipse. - Video stills use YouTube's 16:9 frame (the 4:3 one cropped as a fallback), have small rounded corners, and show a round, centered play button on hover or focus (always on touch screens). - People tiles: rows balanced between 2 and 10 across, never ending on a lone tile where it can be helped. - Map tiles and region tags are solid, dimmed by color, not opacity. - Admin: white (surface) background, header and footer as wide as the content. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
582c65077d
commit
a397f3eac0
12 changed files with 165 additions and 61 deletions
|
|
@ -114,6 +114,9 @@ export default function AdminLayout() {
|
|||
// Whether the page below asked for extra room (the record editor,
|
||||
// for its section nav). setWide is a state setter, so it's stable.
|
||||
const [wide, setWide] = useState(false);
|
||||
// The header, its strip and the footer line up with the content,
|
||||
// however wide the page asked for.
|
||||
const column = wide ? "max-w-[82rem]" : "max-w-5xl";
|
||||
|
||||
useEffect(() => {
|
||||
// Sections only exist in the CMS. Home and Panel already say
|
||||
|
|
@ -133,9 +136,9 @@ export default function AdminLayout() {
|
|||
const wordmark = <span className="text-lg font-bold text-link">{areaTitle}</span>;
|
||||
|
||||
return (
|
||||
<div className="flex min-h-screen flex-col bg-tint-soft">
|
||||
<div className="flex min-h-screen flex-col bg-surface">
|
||||
<header className="border-b border-brand/20 bg-surface">
|
||||
<div className="mx-auto flex max-w-5xl flex-wrap items-center gap-x-8 gap-y-3 px-6 py-4">
|
||||
<div className={`mx-auto flex ${column} flex-wrap items-center gap-x-8 gap-y-3 px-6 py-4`}>
|
||||
{/* Already home, so nothing to link to. */}
|
||||
{isHome ? (
|
||||
wordmark
|
||||
|
|
@ -183,8 +186,8 @@ export default function AdminLayout() {
|
|||
{/* Subnav. Only drawn where there is something to draw, so
|
||||
Events and People don't get an empty gray strip. */}
|
||||
{subnav.length > 0 && (
|
||||
<div className="border-t border-brand/10 bg-tint-soft">
|
||||
<div className="mx-auto flex max-w-5xl flex-wrap gap-6 px-6 py-2.5 text-sm">
|
||||
<div className="border-t border-brand/10 bg-surface">
|
||||
<div className={`mx-auto flex ${column} flex-wrap gap-6 px-6 py-2.5 text-sm`}>
|
||||
{subnav.map((child) => (
|
||||
<NavLink
|
||||
key={child.to}
|
||||
|
|
@ -206,7 +209,7 @@ export default function AdminLayout() {
|
|||
{/* flex-1 rather than a fixed height: the footer sits at the
|
||||
bottom of a short page and below the content of a long one,
|
||||
without ever floating over it. */}
|
||||
<main className={`mx-auto w-full flex-1 px-6 py-10 ${wide ? "max-w-[82rem]" : "max-w-5xl"}`}>
|
||||
<main className={`mx-auto w-full flex-1 px-6 py-10 ${column}`}>
|
||||
<AdminTitleContext.Provider value={titleContext}>
|
||||
<AdminWidthContext.Provider value={setWide}>
|
||||
<Suspense fallback={null}>
|
||||
|
|
@ -217,7 +220,7 @@ export default function AdminLayout() {
|
|||
</main>
|
||||
|
||||
<footer className="border-t border-brand/15 bg-surface">
|
||||
<div className="mx-auto flex max-w-5xl items-center gap-4 px-6 py-3">
|
||||
<div className={`mx-auto flex ${column} items-center gap-4 px-6 py-3`}>
|
||||
<Link to={ADMIN_HOME} className="transition-opacity hover:opacity-70">
|
||||
<img src={siteLogo} alt="NGU" className="h-6 w-auto" />
|
||||
</Link>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import ArrowLink from "../../components/ArrowLink.tsx";
|
|||
import OrgLogo from "../../components/OrgLogo.tsx";
|
||||
import { orgPath } from "../../lib/organizations.ts";
|
||||
import { AREAS, AREA_NAMES } from "../../data/mapGrid.ts";
|
||||
import { withAlpha, accentText, readableOn } from '../../lib/color.ts'
|
||||
import { accentText, readableOn } from '../../lib/color.ts'
|
||||
import { scrollBehavior } from "../../lib/motion.ts";
|
||||
|
||||
/* ═══════════════════════════════════════════════════════════════
|
||||
|
|
@ -163,7 +163,11 @@ function Tile({
|
|||
const active = ids.includes(selected) || ids.includes(hovered);
|
||||
const dimmed = selected && !ids.includes(selected);
|
||||
const clipId = `clip-${code}`;
|
||||
const opacity = count ? 1 : active ? 0.5 : 0.28;
|
||||
// Solid, never see-through: a tile with no groups, or one dimmed
|
||||
// while another region is picked, is its color mixed toward the
|
||||
// page's rather than faded, so the backdrop doesn't show through.
|
||||
const strength = dimmed ? (count ? 35 : 15) : count ? 100 : active ? 50 : 28;
|
||||
const tileFill = (color: string) => `color-mix(in srgb, ${color} ${strength}%, var(--color-surface))`;
|
||||
|
||||
// Clicking a shared tile cycles through its regions and then
|
||||
// clears, so every slice is reachable without a second control.
|
||||
|
|
@ -179,8 +183,6 @@ function Tile({
|
|||
onMouseEnter={() => setHovered(primary.regionId)}
|
||||
onMouseLeave={() => setHovered(null)}
|
||||
style={{ cursor: "pointer" }}
|
||||
opacity={dimmed ? 0.25 : 1}
|
||||
className="transition-opacity duration-200"
|
||||
>
|
||||
<title>
|
||||
{AREA_NAMES[code] || code}: {slices.map(s => s.name).join(" / ")}
|
||||
|
|
@ -188,7 +190,7 @@ function Tile({
|
|||
</title>
|
||||
|
||||
<clipPath id={clipId}>
|
||||
<rect x={x} y={y} width={width} height={size} rx={14} />
|
||||
<rect x={x} y={y} width={width} height={size} />
|
||||
</clipPath>
|
||||
|
||||
<g clipPath={`url(#${clipId})`}>
|
||||
|
|
@ -202,8 +204,7 @@ function Tile({
|
|||
y={top}
|
||||
width={width}
|
||||
height={h}
|
||||
fill={colorOf(slice)}
|
||||
fillOpacity={opacity}
|
||||
style={{ fill: tileFill(colorOf(slice)) }}
|
||||
className="transition-all duration-200"
|
||||
/>
|
||||
);
|
||||
|
|
@ -215,7 +216,6 @@ function Tile({
|
|||
y={y}
|
||||
width={width}
|
||||
height={size}
|
||||
rx={14}
|
||||
fill="none"
|
||||
stroke={active ? colorOf(primary) : "var(--color-surface)"}
|
||||
strokeOpacity={active ? 1 : 0.55}
|
||||
|
|
@ -230,7 +230,7 @@ function Tile({
|
|||
dominantBaseline="middle"
|
||||
fontSize={fontSize}
|
||||
fontWeight="800"
|
||||
fill={count ? "var(--color-surface)" : colorOf(primary)}
|
||||
fill={count && !dimmed ? "var(--color-surface)" : colorOf(primary)}
|
||||
style={{ pointerEvents: "none" }}
|
||||
>
|
||||
{label || code}
|
||||
|
|
@ -242,7 +242,6 @@ function Tile({
|
|||
cy={y + 14}
|
||||
r={7}
|
||||
fill="#ffffff"
|
||||
fillOpacity={0.9}
|
||||
style={{ pointerEvents: "none" }}
|
||||
/>
|
||||
)}
|
||||
|
|
@ -293,10 +292,11 @@ function LegendButton({ region, selected, setSelected, hovered, setHovered }) {
|
|||
aria-pressed={selected === region.id}
|
||||
className="flex items-center gap-2 py-1.5 px-3 text-sm font-bold transition-all duration-200"
|
||||
style={{
|
||||
border: `1px solid ${colorOf(region)}`,
|
||||
background: on ? colorOf(region) : "transparent",
|
||||
color: on ? readableOn(colorOf(region)) : INK,
|
||||
opacity: selected && selected !== region.id ? 0.45 : 1,
|
||||
// Solid like the tiles: another region picked dims this one
|
||||
// by color, not by letting the page show through.
|
||||
border: `1px solid ${selected && !on ? `color-mix(in srgb, ${colorOf(region)} 40%, var(--color-raised))` : colorOf(region)}`,
|
||||
background: on ? colorOf(region) : "var(--color-raised)",
|
||||
color: on ? readableOn(colorOf(region)) : selected ? "var(--color-muted)" : INK,
|
||||
}}
|
||||
>
|
||||
<span
|
||||
|
|
@ -473,7 +473,7 @@ function GroupCard({ group, color, open, onOpen }) {
|
|||
className="p-4 flex items-start gap-4 transition-all duration-200"
|
||||
style={{
|
||||
border: `1px solid ${color}`,
|
||||
background: open ? `${withAlpha(color, 8)}` : "transparent",
|
||||
background: open ? `color-mix(in srgb, ${color} 8%, var(--color-raised))` : "var(--color-raised)",
|
||||
}}
|
||||
>
|
||||
<OrgLogo org={group} color={color} />
|
||||
|
|
@ -541,7 +541,7 @@ function GroupDetail({ group, region, onClose }) {
|
|||
return (
|
||||
<div
|
||||
className="p-6 mb-6"
|
||||
style={{ border: `2px solid ${colorOf(region)}`, background: `${withAlpha(colorOf(region), 6)}` }}
|
||||
style={{ border: `2px solid ${colorOf(region)}`, background: `color-mix(in srgb, ${colorOf(region)} 6%, var(--color-raised))` }}
|
||||
>
|
||||
<div className="flex items-start gap-4">
|
||||
<OrgLogo org={group} color={colorOf(region)} size="h-20 w-20" />
|
||||
|
|
|
|||
|
|
@ -429,7 +429,6 @@ a.site-tl__entry--featured:hover {
|
|||
padding: 0.375rem 0.75rem;
|
||||
border: 1px solid var(--tl-rail);
|
||||
border-radius: var(--btn-radius);
|
||||
corner-shape: squircle;
|
||||
background: none;
|
||||
color: var(--tl-muted);
|
||||
font: inherit;
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ export default function Pathfinder({ id, title, blurb, paths }: PathfinderProps)
|
|||
<h2 className="font-display text-4xl font-bold text-ink md:text-5xl">{title}</h2>
|
||||
{blurb && <p className="mt-4 max-w-2xl text-lg text-muted">{blurb}</p>}
|
||||
|
||||
<div className="mt-12 overflow-hidden">
|
||||
<div className="mt-12 overflow-hidden shadow-md">
|
||||
<div className="-mr-[4px] -mb-[4px]">
|
||||
<div
|
||||
role="tablist"
|
||||
|
|
@ -134,7 +134,7 @@ export default function Pathfinder({ id, title, blurb, paths }: PathfinderProps)
|
|||
tabIndex={on ? 0 : -1}
|
||||
onClick={() => setSelected(index)}
|
||||
className={`${cell} flex items-center gap-4 px-6 py-6 text-left transition-colors duration-300 ${
|
||||
on ? '' : 'bg-surface hover:bg-tint-soft'
|
||||
on ? '' : 'bg-raised hover:bg-tint-soft'
|
||||
}`}
|
||||
style={on ? { background: color, color: readableOn(color) } : undefined}
|
||||
>
|
||||
|
|
@ -173,7 +173,7 @@ export default function Pathfinder({ id, title, blurb, paths }: PathfinderProps)
|
|||
<HomeLink
|
||||
key={`${action.url}-${index}`}
|
||||
url={action.url}
|
||||
className={`${cell} hp-pop group flex flex-col bg-surface p-8 transition-colors duration-200 hover:bg-tint-soft`}
|
||||
className={`${cell} hp-pop group flex flex-col bg-raised p-8 transition-colors duration-200 hover:bg-tint-soft`}
|
||||
style={{ animationDelay: `${120 + index * 90}ms` }}
|
||||
>
|
||||
<span className="flex items-start gap-2 font-display text-lg font-bold text-ink">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue