From a397f3eac0e5a2378416b78e7d4ffd5822e208e5 Mon Sep 17 00:00:00 2001 From: Zaldimmar Date: Wed, 30 Sep 2026 16:24:36 -0500 Subject: [PATCH 1/3] 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 --- CLAUDE.md | 2 +- server/src/themeDefaults.js | 2 +- src/components/FeaturedCards.tsx | 4 +- src/components/PeopleTiles.css | 31 ++++++++++++++- src/components/PeopleTiles.tsx | 51 ++++++++++++++++++++++++- src/components/VideoPlayer.tsx | 33 ++++++++++------ src/index.css | 44 +++++++++++++-------- src/lib/embeds.ts | 5 ++- src/pages/admin/AdminLayout.tsx | 15 +++++--- src/pages/sections/OrgList-Map.tsx | 32 ++++++++-------- src/pages/sections/history/timeline.css | 1 - src/pages/sections/home/Pathfinder.tsx | 6 +-- 12 files changed, 165 insertions(+), 61 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 82a149f..24281e0 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -72,7 +72,7 @@ In dev, Vite proxies `/api` to the target set in `vite.config.ts`, so the API mu - **Colors are tokens, not hex.** Admins can override any token (Panel → Site settings → Colors). The defaults are `server/src/themeDefaults.js` plus the same values as CSS in `src/index.css`; the build fails if they differ (`themeDefaultsCheck` in `vite.config.ts`), and migration 041's CHECK lists the token names. Use the utilities from `src/index.css` (`text-ink`, `text-body`, `text-muted`, `text-link`, `bg-surface`, `bg-tint`, `bg-action`, `border-brand/20`...) so dark mode works; a literal only for something that must look the same in both modes (white on a dark band, a platform's color). Data colors (accents, event and region colors) go through `withAlpha`, `accentText` and `readableOn` in `src/lib/color.ts`, never `${color}55`. - **Icons are Phosphor** (`@phosphor-icons/react`), weight `bold` (or `fill` for play/star). No hand-drawn `` icons and no Unicode glyphs as icons (× › ▶ →). Brand marks are the exception: `DoveMark`, `PlatformIcon`, the Google logo, the group map. - **Accents come from `src/lib/color.ts`:** `BRAND` (the teal, via the button token so the admin palette reaches it) and `ACCENTS` (deep, green, olive), all from `PALETTE` (the site's 16-color grid). Not a new hex in a page. -- **No rounded corners.** Everything is square except buttons, which use the `btn` utility (Poppins Bold, a superellipse via `corner-shape`; `var(--btn-radius)` in plain CSS), and things round by nature (dots, radio marks). A note in place of content (empty section, "coming soon") uses the `notice` utility, not a dashed border. Nothing glows: no blur blobs, no glow shadows. +- **Corners: square.** Everything is square except buttons, which use the `btn` utility (Poppins Bold, a small `var(--btn-radius)` corner, also for plain CSS), video players (small rounded) and things round by nature (dots, radio marks, the play button). A note in place of content (empty section, "coming soon") uses the `notice` utility (corner brackets), not a dashed border. Cards sit on `bg-raised` with a shadow so they stand off the page. Nothing glows: no blur blobs, no glow shadows. - **Sections paint no background.** `PageBackdrop` (in Layout) draws the page's palette circles behind every public page; a band that needs its own color (the hero, the stats band, the footer) is a deliberate exception. - **No em-dashes** (U+2014) anywhere: UI text, help text, comments, docs, commit messages. Use a colon, comma or parentheses. An empty table cell shows `-`. - **Admin editor text:** blank select options read `Default: …` (what blank means), examples in help text start with `eg.`, and record ids are called "URL ID". Cut-off preview text uses `preview()` from `src/lib/text.ts`, which ends it with an ellipsis. See `docs/updating-data-in-code.md`. diff --git a/server/src/themeDefaults.js b/server/src/themeDefaults.js index aa44680..ac94cab 100644 --- a/server/src/themeDefaults.js +++ b/server/src/themeDefaults.js @@ -23,7 +23,7 @@ export const THEME_DEFAULTS = { "action-hover": ["#001011", "#004552"], surface: ["#fcfffd", "#001011"], tint: ["#c2f6ff", "#004552"], - "tint-soft": ["#dfebd6", "#27371b"], + "tint-soft": ["#e8fcfe", "#00252b"], danger: ["#b3261e", "#ff8a80"], "danger-tint": ["#fdf3f2", "#3b1714"], }; diff --git a/src/components/FeaturedCards.tsx b/src/components/FeaturedCards.tsx index d7112c5..708052a 100644 --- a/src/components/FeaturedCards.tsx +++ b/src/components/FeaturedCards.tsx @@ -112,7 +112,7 @@ function Card({ card, large }: { card: FeaturedCard; large: boolean }) { return (
  • @@ -134,7 +134,7 @@ function Card({ card, large }: { card: FeaturedCard; large: boolean }) { export default function FeaturedCards({ cards }: { cards: FeaturedCard[] }) { const leadLarge = cards.length >= 3 return ( -
    +
      {cards.map((card, index) => ( >(() => new Set()); const rootRef = useRef(null); + const probeRef = useRef(null); const resolvedSize: PeopleTilesSize = SIZE_FEATURES[size] ? size : "md"; const features = SIZE_FEATURES[resolvedSize]; @@ -433,6 +438,27 @@ export function PeopleTilesView({ .filter((group) => group.people.length > 0); }, [groups, people]); + const hasPeople = resolvedGroups.length > 0; + + // How much room a row has, and one tile's width and gap there, in + // px: the probe carries --pl-w and --pl-gap, so the CSS stays the + // one place that sizes tiles. + const [room, setRoom] = useState<{ width: number; tile: number; gap: number } | null>(null); + + useLayoutEffect(() => { + const root = rootRef.current; + const probe = probeRef.current; + if (!root || !probe || overflow === "scroll") return undefined; + const measure = () => { + const padding = parseFloat(getComputedStyle(root).paddingLeft) * 2; + setRoom({ width: root.clientWidth - padding, tile: probe.offsetWidth, gap: probe.offsetHeight }); + }; + measure(); + const observer = new ResizeObserver(measure); + observer.observe(root); + return () => observer.disconnect(); + }, [overflow, hasPeople]); + // A click anywhere outside the list closes the panel. useEffect(() => { if (!openKey) return undefined; @@ -509,6 +535,7 @@ export function PeopleTilesView({ onKeyDown={handleKeyDown} {...rest} > +