diff --git a/CLAUDE.md b/CLAUDE.md index f4630a0..d462ebd 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -71,7 +71,7 @@ In dev, Vite proxies `/api` to the target set in `vite.config.ts`, so the API mu - **Imports need explicit extensions** (`.ts`, `.tsx`, `.js`) everywhere. - **Vite resolves `.js` before `.ts`**, so a `.js` and `.ts` file with the same base name will import the wrong one. Give new hooks distinct names. - **Don't use `fallback: EMPTY` in api.ts hooks.** It silently returns empty arrays and hides server errors; let the error state surface. -- **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`. A palette color in a component or CSS file is `var(--pal--)`, not its hex, so the color blind modes reach it. +- **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. - **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. diff --git a/docs/updating-data-in-code.md b/docs/updating-data-in-code.md index 93da289..a186be5 100644 --- a/docs/updating-data-in-code.md +++ b/docs/updating-data-in-code.md @@ -166,7 +166,7 @@ also in `server/src/admin-schema/` and a CHECK): | Entity → field | Stored values | Labeled? | Also used on the public site by | | --- | --- | --- | --- | -| Organizations → Kind (+ list filter) | national, region, group, partner | no, shows values | `ORG_BASE` in `src/lib/hrefs.ts` (the route each kind uses) | +| Organizations → Kind (+ list filter) | national, region, group, partner | no, shows values | `ORG_BASE` in `src/lib/hrefs.ts` (the route each kind uses) and `orgListHref` there (its back link) | | Organizations → Region → Scope | domestic, international, virtual | no | the Community page groups regions by it | | Organizations → Region areas → Edge | top, bottom | no | the group map (`OrgList-Map.tsx`) | | Events → Type (+ list filter) | retreat, class, workshop, meeting, other | no | `EVENT_TYPES` in `src/lib/eventTypes.ts` (public labels and plurals) | @@ -279,11 +279,11 @@ The numbers band's "Number Source" dropdown works the same way: | The icons a Front page "Find your way in" path can pick | `src/data/pathIcons.ts` (keys and labels) **and** `ICONS` in `src/pages/sections/home/Pathfinder.tsx` (the Phosphor icon for each key) | Add a line to both. A path saved with an emoji from before the list shows it as it is. | | A page section's accent color | `BRAND` and `ACCENTS` in `src/lib/color.ts` | Pages pick from these (`accent: ACCENTS.green`); add a color there, not a hex in a page. Each is readable as text on white and the tints. | | The palette (the 16-color grid the theme is drawn from) | `PALETTE` in `src/lib/color.ts` | Four families, a column each. `PALETTE_LIGHT` / `PALETTE_DARK` are the fills things colored by data use (a person's initials tile, `paletteFill`); the page background's layers (how many circles, their sizes and parallax speeds) are `LAYERS` in `src/components/PageBackdrop.tsx` and its shades are in `PageBackdrop.css`; the admin home's two alternating group colors are `BLOCK_COLORS` in `src/pages/admin/AdminHome.tsx`. | -| The accessibility panel's choices (bottom right of every public page) | `SETTINGS` in `src/components/AccessibilityPanel.tsx`; the color blind modes are `VISIONS` and `SWAPS` in `src/lib/color.ts` | Each choice is an attribute on `` styled in `src/index.css`, and `index.html` sets it again before the first paint, so a new one goes in all three. A color blind mode replaces all three color families, teal, green and amber (`SWAPS`, picked by simulating each type: see the comment there), in code, in data colors as they load (`src/lib/api.ts`, never under /admin), in CSS (the `--pal-*` variables in `src/index.css`, which hold the same values as `SWAPS`: change both) and in the theme tokens drawn from them. A palette hex in a component or CSS file should be `var(--pal--)` (eg. `var(--pal-amber-2)`), or a color blind mode won't reach it. Reading mode is `src/components/ReaderView.tsx`, which reads the hidden page and writes out its headings, paragraphs, links and described pictures. A part it can't read well (a carousel, tabs, details behind a click, a map) draws its own text version when `useReadingMode()` (`src/lib/readingMode.ts`) is on: the hero, pathfinder, stats, history rail, event lists, calendar (the next six weeks), featured cards, org lists and groups map, history timeline, schedule, people tiles and video player; the countdown draws nothing. A new component with any of those should do the same. Something saved or sent (the newsletter's colors) uses `STORED_PALETTE`, which is never swapped. | +| The accessibility panel's choices (bottom right of every public page) | `SETTINGS` in `src/components/AccessibilityPanel.tsx`; the color blind modes are `VISIONS` and `SWAPS` in `src/lib/color.ts` | Each choice is an attribute on `` styled in `src/index.css`, and `index.html` sets it again before the first paint, so a new one goes in all three. A color blind mode swaps palette families (`SWAPS`, picked by simulating each type: see the comment there) in code, in data colors as they load (`src/lib/api.ts`, never under /admin) and in CSS (the `--green-*` variables in `src/index.css`); a hex from the green family in a component should be one of those variables. Something saved or sent (the newsletter's colors) uses `STORED_PALETTE`, which is never swapped. | | Privacy Policy and Terms wording | `src/pages/Privacy.tsx`, `src/pages/Terms.tsx` | The `PARTS` list, and `LAST_UPDATED` whenever the wording changes. The Privacy page must stay true of the code: what the feedback form stores, what the browser keeps, which embeds wait for a click. | | Event type labels and plurals (public site) | `src/lib/eventTypes.ts` | Also the order of the type filter chips. | | Event and person role labels (public site) | `ROLE_LABEL` in `src/pages/EventDetail.tsx` and `src/pages/PersonDetail.tsx` | | -| Organization kind labels ("Region", "Group") | the Kind options in `src/lib/adminSchema/organizations.ts` (admin) | | +| Organization kind labels ("Region", "Group") | the Kind options in `src/lib/adminSchema/organizations.ts` (admin); `orgListHref` in `src/lib/hrefs.ts` (the public back link, "All regions") | | | Admin account roles | `src/lib/roles.ts` (labels, notes) and `ROLES` in `server/src/auth.js` | Adding a role is also a CHECK change on `admin_users.role`. | | Admin navigation | `src/pages/admin/adminNav.ts` | | | Newsletter parts and their defaults (Tools → Newsletter) | `PARTS_SPEC`, `PART_TYPES` and `STARTER` in `src/pages/admin/AdminNewsletter.tsx`; `PICK_DEFAULTS`, `DEFAULT_TITLE` and `COLOR` in `src/lib/newsletter.ts` | A draft is one JSON list of parts (`newsletters.layout`, 060), so adding a part or a setting needs no migration: a field in `PARTS_SPEC` and its drawing in `newsletter.ts`. The color choices are `PALETTE`; `COLOR` holds the defaults as hex, since an inbox has no theme tokens. `STARTER` is what a new draft starts with. The social bar's icons are PNGs in `public/email/` (Gmail and Outlook don't show SVG), made from `PlatformIcon.tsx` by `node scripts/email-icons.mjs`: run it again after adding a platform. A social bar with no links shows the footer's, `SOCIAL_LINKS` in `src/data/socialLinks.ts`. The countdown picture is `server/src/routes/countdown.js`, counting to local midnight in its `TIME_ZONE` (America/Chicago). | diff --git a/src/components/AccessibilityPanel.tsx b/src/components/AccessibilityPanel.tsx index 38fd39b..9f25f16 100644 --- a/src/components/AccessibilityPanel.tsx +++ b/src/components/AccessibilityPanel.tsx @@ -6,10 +6,10 @@ Dyslexia-friendly font every typeface becomes OpenDyslexic (self-hosted, index.css) - Reading mode the page as text: its headings, - paragraphs, links and described - pictures in one column, nothing else - (ReaderView.tsx) + Reading mode the page as plain text: one column of + ink on white, no colors, pictures, + cards or motion; a picture's + description stays in its place Color blind mode the palette swapped so its colors stay apart for that type of color blindness, or grays (color.ts, VISIONS) @@ -53,7 +53,7 @@ const SETTINGS = [ key: 'site-reading', on: 'on', label: 'Reading mode', - help: 'The page as text: headings, paragraphs, links and pictures in one column, nothing else.', + help: 'The page as plain text: one column, larger type, no colors, pictures or motion.', }, ] as const @@ -87,6 +87,30 @@ function apply(attribute: string, key: string, value: string | null) { } } +/* Reading mode hides pictures, video and maps; their descriptions + (alt, title, aria-label) go on the parent as data-reading-alt, + which index.css shows in their place. An attribute rather than a + new element, so React's own nodes are left alone. */ +const DESCRIBED = 'main img[alt]:not([alt=""]), main iframe[title], main video[aria-label]' + +function describeMedia() { + for (const el of document.querySelectorAll(DESCRIBED)) { + const words = el.getAttribute('alt') ?? el.getAttribute('title') ?? el.getAttribute('aria-label') + const kind = el.tagName === 'IMG' ? 'Image' : 'Video' + el.parentElement?.setAttribute('data-reading-alt', `${kind}: ${words}`) + } +} + +function useMediaDescriptions(on: boolean) { + useEffect(() => { + if (!on) return undefined + describeMedia() + const observer = new MutationObserver(describeMedia) + observer.observe(document.body, { childList: true, subtree: true }) + return () => observer.disconnect() + }, [on]) +} + export default function AccessibilityPanel() { const [open, setOpen] = useState(false) const [state, setState] = useState(() => Object.fromEntries(SETTINGS.map((s) => [s.key, isOn(s)]))) @@ -96,6 +120,8 @@ export default function AccessibilityPanel() { const firstRef = useRef(null) const panelId = useId() + useMediaDescriptions(state['site-reading']) + useEffect(() => { const root = document.documentElement for (const { attribute, key } of PUBLIC_ONLY) { @@ -161,7 +187,7 @@ export default function AccessibilityPanel() { id={panelId} role="region" aria-label="Accessibility" - className="absolute right-0 bottom-full mb-3 w-[min(20rem,calc(100vw-2rem))] border border-brand/20 bg-raised p-4 shadow-xl" + className="reading-solid absolute right-0 bottom-full mb-3 w-[min(20rem,calc(100vw-2rem))] border border-brand/20 bg-raised p-4 shadow-xl" >

Accessibility

diff --git a/src/components/Banner.tsx b/src/components/Banner.tsx index e03d1c6..a8fb404 100644 --- a/src/components/Banner.tsx +++ b/src/components/Banner.tsx @@ -25,7 +25,7 @@ export default function Banner() { if (!visible) return null; const linkClass = - "underline underline-offset-4 decoration-[var(--pal-green-2)] hover:text-white transition-colors"; + "underline underline-offset-4 decoration-[var(--green-2)] hover:text-white transition-colors"; return (
{ - const level = (under + 1) as 3 | 4 | 5 - if (block.type === 'heading') under = 3 - if (block.type === 'subheading') under = 4 - return level - }) return (
{blocks.map((block, index) => ( - + ))}
) @@ -149,19 +135,8 @@ function Caption({ text }: { text?: string | null }) { ) } -function Block({ - block, - accent, - anchor, - level, -}: { - block: ContentBlock - accent: string - anchor?: string - level: 3 | 4 | 5 -}) { +function Block({ block, accent, anchor }: { block: ContentBlock; accent: string; anchor?: string }) { const text = block.text ?? '' - const reading = useReadingMode() switch (block.type) { case 'heading': @@ -319,14 +294,6 @@ function Block({ case 'image': { const src = mediaUrl(block.media) if (!src) return null - // The reader leaves out a picture with no alt, and its link with it. - if (reading && block.href && !block.alt) { - return ( -

- {text || 'Open link'} -

- ) - } const img = (
- {!reading && } + ) @@ -368,8 +335,8 @@ function Block({ if (!block.team_id && picked.length === 0) return null return (
- {block.team_id && } - {picked.length > 0 && } + {block.team_id && } + {picked.length > 0 && }
) } diff --git a/src/components/FeaturedCards.tsx b/src/components/FeaturedCards.tsx index 6b23755..9476633 100644 --- a/src/components/FeaturedCards.tsx +++ b/src/components/FeaturedCards.tsx @@ -23,10 +23,6 @@ fall outside), 4px thick. With three or more cards the first is the large one, two rows tall, and the next two stack beside it, so it no longer stretches its neighbor. - - Reading mode (readingMode.ts) gets each card as a linked heading - and its words, a video card linking to its video. `level` is that - heading's level, one under the heading above the cards. ═══════════════════════════════════════════════════════════════ */ @@ -35,7 +31,6 @@ import VideoPlayer from './VideoPlayer.tsx' import { refHref } from '../lib/hrefs.ts' import { mediaUrl } from '../lib/media.ts' import type { FeaturedCard } from '../lib/useFrontPage.ts' -import { useReadingMode } from '../lib/readingMode.ts' import { useSmallImage } from '../lib/useSmallImage.ts' /* Image kinds that are photographs, drawn edge to edge. Anything @@ -85,9 +80,8 @@ function VideoPicture({ card }: { card: FeaturedCard }) { const RULE = 'border-brand' -function Card({ card, large, level }: { card: FeaturedCard; large: boolean; level: 3 | 4 }) { +function Card({ card, large }: { card: FeaturedCard; large: boolean }) { const href = hrefFor(card) - const Title = level === 4 ? 'h4' : 'h3' const text = (
@@ -95,7 +89,7 @@ function Card({ card, large, level }: { card: FeaturedCard; large: boolean; leve

{card.eyebrow}

)} {card.title && ( - + <h3 className={`mt-2 font-display font-bold leading-snug text-ink ${large ? 'text-2xl md:text-3xl' : 'text-lg'}`}> {href ? ( // Stretched over the whole card, so the picture and the // blurb are part of the click without nesting links. @@ -108,7 +102,7 @@ function Card({ card, large, level }: { card: FeaturedCard; large: boolean; leve ) : ( card.title )} - + )} {card.blurb && (

{card.blurb}

@@ -137,29 +131,7 @@ function Card({ card, large, level }: { card: FeaturedCard; large: boolean; leve ) } -type FeaturedCardsProps = { cards: FeaturedCard[]; level?: 3 | 4 } - -function ReadingCards({ cards, level = 3 }: FeaturedCardsProps) { - const Title = level === 4 ? 'h4' : 'h3' - return ( - <> - {cards.map((card, index) => { - const href = card.kind === 'video' ? card.url : hrefFor(card) - return ( -
- {card.eyebrow &&

{card.eyebrow}

} - {card.title && {href ? <HomeLink url={href}>{card.title}</HomeLink> : card.title}} - {card.blurb &&

{card.blurb}

} -
- ) - })} - - ) -} - -export default function FeaturedCards({ cards, level = 3 }: FeaturedCardsProps) { - const reading = useReadingMode() - if (reading) return +export default function FeaturedCards({ cards }: { cards: FeaturedCard[] }) { const leadLarge = cards.length >= 3 return (
@@ -169,7 +141,6 @@ export default function FeaturedCards({ cards, level = 3 }: FeaturedCardsProps) key={`${card.kind}-${card.ref?.id ?? card.url}-${index}`} card={card} large={leadLarge && index === 0} - level={level} /> ))} diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx index 6b0797c..4ec43b4 100644 --- a/src/components/Footer.tsx +++ b/src/components/Footer.tsx @@ -28,14 +28,14 @@ const Footer_Links = [ ]; const footerLinkClass = - "text-white/65 hover:text-[var(--pal-green-2)] text-sm transition-colors"; + "text-white/65 hover:text-[var(--green-2)] text-sm transition-colors"; // inline-block with a little height of its own, so a finger can hit it. const pageLinkClass = - "inline-block py-1 text-white/80 hover:text-[var(--pal-green-2)] text-sm font-semibold transition-colors"; + "inline-block py-1 text-white/80 hover:text-[var(--green-2)] text-sm font-semibold transition-colors"; const sectionLinkClass = - "inline-block py-1 text-white/65 hover:text-[var(--pal-green-2)] text-sm transition-colors"; + "inline-block py-1 text-white/65 hover:text-[var(--green-2)] text-sm transition-colors"; const headingClass = "text-white/90 text-sm font-semibold mb-4"; diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx index 6ca0c67..8bbb625 100644 --- a/src/components/Layout.tsx +++ b/src/components/Layout.tsx @@ -9,10 +9,8 @@ import Footer from "./Footer.tsx"; import PrivacyNotice from "./PrivacyNotice.tsx"; import PageBackdrop from "./PageBackdrop.tsx"; import AccessibilityPanel from "./AccessibilityPanel.tsx"; -import ReaderView from "./ReaderView.tsx"; import ThemeToggle from "./ThemeToggle.tsx"; import { jumpTo } from "../lib/focus.ts"; -import { useReadingMode } from "../lib/readingMode.ts"; /* ── Right-side nav actions ──────────────────────────────── */ @@ -90,9 +88,6 @@ export default function Layout() { const [dismissed, setDismissed] = useState(null); const location = useLocation(); const lastPath = useRef(location.pathname); - const reading = useReadingMode(); - // The page itself, drawn hidden for the reader view to read. - const pageRef = useRef(null); const sectionsOf = useNavSections(); @@ -129,20 +124,19 @@ export default function Layout() { ); ro.observe(el); return () => ro.disconnect(); - }, [reading]); + }, []); // On the root, so anything can read it: index.css keeps focused // and jumped-to things clear of the header with it // (scroll-padding-top), and PostContents offsets by it. useEffect(() => { const root = document.documentElement; - // Reading mode has no header to stay clear of. - root.style.setProperty("--header-h", `${reading ? 0 : headerHeight}px`); + root.style.setProperty("--header-h", `${headerHeight}px`); // The admin has no fixed header: nothing to stay clear of there. return () => { root.style.removeProperty("--header-h"); }; - }, [headerHeight, reading]); + }, [headerHeight]); // Router does not scroll on navigation. Go to top on a new page, // or to the anchor if the URL carries one (handles deep links too). @@ -157,42 +151,17 @@ export default function Layout() { if (newPage) document.getElementById("main")?.focus({ preventScroll: true }); }, [location.pathname, location.hash, location.key]); - const skipLink = ( - - Skip to content - - ); - - // Reading mode: the page as plain text (ReaderView.tsx), with no - // header, backdrop, footer or notices; the panel stays, to turn it - // off. The page itself still renders, hidden, for the reader to - // read, so every page works without a version of its own. - if (reading) { - return ( -
- {skipLink} -
- - -
- -
- ); - } - return ( // overflow-x-clip, not -hidden: hidden makes this div a scroll // container, and then nothing inside it can be position: sticky // (a blog post's contents column scrolled away with the page).
- {skipLink} + + Skip to content + {/* ── NAV ─────────────────────────────────────────────── */}
@@ -243,7 +212,7 @@ export default function Layout() { className={({ isActive }) => `block text-base font-bold pb-1 border-b-2 transition-colors duration-200 ${ isActive - ? "text-white border-[var(--pal-green-2)]" + ? "text-white border-[var(--green-2)]" : "text-white/75 hover:text-white border-transparent" }` } @@ -264,13 +233,13 @@ export default function Layout() { >
    {pageSections.map((section) => (
  • {section.label} @@ -330,8 +299,8 @@ export default function Layout() { {/* Mobile menu */} {mobileMenuOpen && (
    `block text-2xl font-bold py-3 transition-colors ${ - isActive ? "text-[var(--pal-green-2)]" : "text-white hover:text-[var(--pal-amber-2)]" + isActive ? "text-[var(--green-2)]" : "text-white hover:text-[#f0bd4f]" }` } > @@ -368,13 +337,13 @@ export default function Layout() { {isActive && pageSections.length > 0 && (
    {pageSections.map((section) => ( setMobileMenuOpen(false)} > {section.label} diff --git a/src/components/OrgContact.tsx b/src/components/OrgContact.tsx index 8d2ad16..3df7ebb 100644 --- a/src/components/OrgContact.tsx +++ b/src/components/OrgContact.tsx @@ -5,20 +5,11 @@ filled in its accent, then its website, email and socials outlined. Nothing at all when it has none. Used on an organization's page and on the Organization page (NGU's own). - A platform's icon has its name beside it for screen readers and - reading mode, unless the label already says it (PlatformName). ═══════════════════════════════════════════════════════════════ */ import PlatformIcon from './PlatformIcon.tsx' import type { OrganizationRecord } from '../lib/useContent.ts' import { accentText } from '../lib/color.ts' -import { PLATFORMS } from '../lib/platforms.ts' - -function PlatformName({ platform, label }: { platform?: string | null; label?: string | null }) { - const name = PLATFORMS.find((p) => p.id === platform)?.label - if (!name || label?.toLowerCase().includes(name.toLowerCase())) return null - return {label ? `${name}: ` : name} -} export default function OrgContact({ org, accent }: { org: OrganizationRecord; accent: string }) { const hasAny = @@ -38,7 +29,6 @@ export default function OrgContact({ org, accent }: { org: OrganizationRecord; a style={{ background: accent }} > - {link.label} ))} @@ -61,7 +51,6 @@ export default function OrgContact({ org, accent }: { org: OrganizationRecord; a style={{ borderColor: accent, color: accentText(accent) }} > - {link.label} ))} diff --git a/src/components/PageBackdrop.css b/src/components/PageBackdrop.css index 91a5327..62c165e 100644 --- a/src/components/PageBackdrop.css +++ b/src/components/PageBackdrop.css @@ -18,10 +18,10 @@ pointer-events: none; --pb-opacity: 0.6; - --pb-0: var(--pal-teal-3); - --pb-1: var(--pal-green-3); - --pb-2: var(--pal-amber-3); - --pb-3: var(--pal-teal-3); + --pb-0: #d6f5fa; + --pb-1: var(--green-3); + --pb-2: #fdf1d6; + --pb-3: #d6f5fa; } /* A circle's place: across by its left, down its layer's whole @@ -71,18 +71,18 @@ toggle's choice, or the system's when there is none. */ :root[data-theme="dark"] .page-backdrop { --pb-opacity: 0.3; - --pb-0: var(--pal-teal-1); - --pb-1: var(--pal-green-1); - --pb-2: var(--pal-amber-1); - --pb-3: var(--pal-teal-1); + --pb-0: #003a45; + --pb-1: var(--green-1); + --pb-2: #4a2e00; + --pb-3: #003a45; } @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .page-backdrop { --pb-opacity: 0.3; - --pb-0: var(--pal-teal-1); - --pb-1: var(--pal-green-1); - --pb-2: var(--pal-amber-1); - --pb-3: var(--pal-teal-1); + --pb-0: #003a45; + --pb-1: var(--green-1); + --pb-2: #4a2e00; + --pb-3: #003a45; } } diff --git a/src/components/PageShell.css b/src/components/PageShell.css index 744d6b0..4d4bac7 100644 --- a/src/components/PageShell.css +++ b/src/components/PageShell.css @@ -5,7 +5,7 @@ on the page backdrop (PageBackdrop.css). */ .side-nav-circle { - background: var(--pal-teal-3); + background: #d6f5fa; /* A slight drop shadow, as the cards have: down and soft, no glow. */ box-shadow: 0 4px 12px rgb(0 16 17 / 0.14); /* Color by section; size and place between centered on the list @@ -18,32 +18,32 @@ top 0.6s ease-in-out; } .side-nav-circle[data-family="green"] { - background: var(--pal-green-3); + background: var(--green-3); } .side-nav-circle[data-family="amber"] { - background: var(--pal-amber-3); + background: #fdf1d6; } /* Dark mode: the toggle's choice, or the system's when there is none. */ :root[data-theme="dark"] .side-nav-circle { - background: var(--pal-teal-1); + background: #003a45; box-shadow: 0 4px 12px rgb(0 0 0 / 0.45); } :root[data-theme="dark"] .side-nav-circle[data-family="green"] { - background: var(--pal-green-1); + background: var(--green-1); } :root[data-theme="dark"] .side-nav-circle[data-family="amber"] { - background: var(--pal-amber-1); + background: #4a2e00; } @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .side-nav-circle { - background: var(--pal-teal-1); + background: #003a45; box-shadow: 0 4px 12px rgb(0 0 0 / 0.45); } :root:not([data-theme="light"]) .side-nav-circle[data-family="green"] { - background: var(--pal-green-1); + background: var(--green-1); } :root:not([data-theme="light"]) .side-nav-circle[data-family="amber"] { - background: var(--pal-amber-1); + background: #4a2e00; } } diff --git a/src/components/PeopleTiles.tsx b/src/components/PeopleTiles.tsx index a435261..33321e1 100644 --- a/src/components/PeopleTiles.tsx +++ b/src/components/PeopleTiles.tsx @@ -18,7 +18,6 @@ import { isBadId, personHref } from "../lib/hrefs.ts"; import { mediaUrl, initials } from "../lib/media.ts"; import { useSmallImage } from "../lib/useSmallImage.ts"; import { paletteFill } from "../lib/color.ts"; -import { useReadingMode } from "../lib/readingMode.ts"; import "./PeopleTiles.css"; /** @@ -72,10 +71,6 @@ import "./PeopleTiles.css"; * with no photo gets their initials on a palette color * (paletteFill in color.ts). * - * Reading mode (readingMode.ts) gets everyone, no "Show all", each - * a heading (linked to their profile) and their title, facts and bio - * as lines (ReadingPeople). - * * Field names follow the API (is_owner, location_label), so a row * from /api/teams/:id/people drops in unchanged. * @@ -127,8 +122,7 @@ export interface PeopleGroupInput extends Omit { export interface TeamSpec { id: string; - /** Heading for the members group beside a lead group, or among - * several teams. Defaults to the team's name. */ + /** Heading for the members group. Defaults to the team's name. */ label?: string; /** Heading for the lead group. Defaults to the lead's own title. */ leadLabel?: string; @@ -152,9 +146,6 @@ export interface PeopleTilesProps align?: "start" | "center"; accent?: string; tilt?: boolean; - /** The group labels' heading level, by what they sit under (3 under - * a section's h2). In reading mode the names are one level under. */ - headingLevel?: 3 | 4 | 5; /** How long a fetched team or person is reused, in ms. */ ttl?: number; emptyMessage?: string; @@ -381,10 +372,8 @@ function buildTeamGroups( return [ { id: data.team.id, - // One team alone needs no heading (its page or section names - // it); several always do. `label` names the members beside a - // lead group. - label: teamCount > 1 ? name : undefined, + // One unlabeled team needs no heading; several always do. + label: teamCount > 1 || spec.label ? name : undefined, accent, people: data.people, }, @@ -419,7 +408,6 @@ export function PeopleTilesView({ accent, tilt = false, emptyMessage = "No one listed yet.", - headingLevel = 3, onExpand, className = "", style, @@ -438,7 +426,6 @@ export function PeopleTilesView({ const [clipped, setClipped] = useState>(() => new Set()); const rootRef = useRef(null); const probeRef = useRef(null); - const reading = useReadingMode(); const resolvedSize: PeopleTilesSize = SIZE_FEATURES[size] ? size : "md"; const features = SIZE_FEATURES[resolvedSize]; @@ -545,8 +532,6 @@ export function PeopleTilesView({ if (!resolvedGroups.length) { return emptyMessage ?

    {emptyMessage}

    : null; } - if (reading) return ; - const Label = `h${headingLevel}` as "h3"; const open = openKey ? findByKey(resolvedGroups, openKey) : null; const oneRow = @@ -613,7 +598,7 @@ export function PeopleTilesView({ > {(group.label || group.note) && (
    - {group.label && } + {group.label &&

    {group.label}

    } {group.note &&

    {group.note}

    }
    )} @@ -898,52 +883,6 @@ function DetailPanel({ ); } -/* Reading mode: every person and what their details panel says. */ -function ReadingPeople({ groups, level }: { groups: PeopleGroup[]; level: 3 | 4 | 5 }) { - const Label = `h${level}` as "h3"; - return ( -
    - {groups.map((group) => { - // Names sit under the group's label, or take its place. - const Name = `h${group.label ? level + 1 : level}` as "h4"; - return ( -
    - {group.label && } - {group.note &&

    {group.note}

    } - {group.people.map((person, index) => { - const href = profileHref(person); - const title = titleOf(person); - const org = resolveOrg(person.org); - const bio = Array.isArray(person.bio) ? person.bio : [person.bio]; - return ( -
    - {href ? {person.name} : person.name} - {title &&

    {title}

    } - {person.pronouns &&

    Pronouns: {person.pronouns}

    } - {org && ( -

    - Home organization: {org.href ? {org.name} : org.name} -

    - )} - {person.location_label &&

    Based in: {person.location_label}

    } - {person.public_email && ( -

    - Email: {person.public_email} -

    - )} - {bio.filter(Boolean).map((paragraph, i) => ( -

    {paragraph}

    - ))} -
    - ); - })} -
    - ); - })} -
    - ); -} - function Chevron() { return (
    ), }, - ...(reading ? [] : [{ + { id: 'start', title: 'Start from', accent: ACCENTS.green, @@ -129,7 +126,7 @@ export default function NotFound() { ))}
    ), - }]), + }, ]} /> ) diff --git a/src/pages/OrganizationDetail.tsx b/src/pages/OrganizationDetail.tsx index 236c0a2..a25d013 100644 --- a/src/pages/OrganizationDetail.tsx +++ b/src/pages/OrganizationDetail.tsx @@ -26,12 +26,11 @@ import { useOrganization, type OrganizationRecord, } from '../lib/useContent.ts' -import { orgHref } from '../lib/hrefs.ts' +import { orgHref, orgListHref } from '../lib/hrefs.ts' import { mediaUrl } from '../lib/media.ts' import { initialsFor } from '../lib/organizations.ts' import Logo from '../components/Logo.tsx' import { withAlpha, accentText, readableOn, BRAND } from '../lib/color.ts' -import { useReadingMode } from '../lib/readingMode.ts' const BODY = 'var(--color-muted)' @@ -39,7 +38,6 @@ export default function OrganizationDetail() { const { id } = useParams() const { pathname } = useLocation() const { data: org, loading, error, notFound, reload } = useOrganization(id) - const reading = useReadingMode() if (!org) { return ( @@ -72,6 +70,7 @@ export default function OrganizationDetail() { } const accent = org.color || BRAND + const back = orgListHref(org.kind) const sections: any[] = [ { @@ -80,7 +79,7 @@ export default function OrganizationDetail() { accent, content: (
    - + {org.description.map((paragraph, index) => (

    @@ -145,25 +144,12 @@ export default function OrganizationDetail() { } if (org.awards.length > 0) { - const recipients = (count: number) => - count === 0 ? 'No recipients yet' : `${count} recipient${count === 1 ? '' : 's'}` sections.push({ id: 'awards', title: 'Awards', blurb: `Given by ${org.short_name || org.name}.`, accent, - // Reading mode: a card reads as one long link, so each award is - // a line with its name linked. - content: reading ? ( -

      - {org.awards.map((award) => ( -
    • - {award.name} - {award.description && `: ${award.description}`} ({recipients(award.recipient_count)}) -
    • - ))} -
    - ) : ( + content: (
    {org.awards.map((award) => ( )} - {recipients(award.recipient_count)} + {award.recipient_count === 0 + ? 'No recipients yet' + : `${award.recipient_count} recipient${award.recipient_count === 1 ? '' : 's'}`} ))} @@ -223,9 +211,11 @@ export default function OrganizationDetail() { function Facts({ org, accent, + back, }: { org: OrganizationRecord accent: string + back: { to: string; label: string } }) { const where = org.location_label || [org.locality, org.state_code].filter(Boolean).join(', ') @@ -258,6 +248,10 @@ function Facts({ Since {org.details.started} )} {org.is_online && Online} + + + {back.label} +
    ) } diff --git a/src/pages/PersonDetail.tsx b/src/pages/PersonDetail.tsx index a9fa9a5..8e6e4c5 100644 --- a/src/pages/PersonDetail.tsx +++ b/src/pages/PersonDetail.tsx @@ -37,7 +37,6 @@ import { mediaUrl, initials } from '../lib/media.ts' import { eventTypeLabel } from '../lib/eventTypes.ts' import { capitalize } from '../lib/text.ts' import { accentText, BRAND } from '../lib/color.ts' -import { useReadingMode } from '../lib/readingMode.ts' const BODY = 'var(--color-muted)' @@ -206,7 +205,7 @@ export default function PersonDetail() { {(posts) => (
      {posts.map((post) => ( - + ))}
    )} @@ -232,9 +231,7 @@ function Capped({ children: (shown: T[]) => ReactNode }) { const [all, setAll] = useState(false) - // Reading mode has no button to press: everything shows. - const reading = useReadingMode() - const more = !all && !reading && items.length > SHOW_FIRST + const more = !all && items.length > SHOW_FIRST return ( <> {children(more ? items.slice(0, SHOW_FIRST) : items)} @@ -256,8 +253,6 @@ function Capped({ function Facts({ person, accent }: { person: PersonRecord; accent: string }) { const photo = mediaUrl(person.photo) - // Each fact reads on a line of its own there, so it says what it is. - const reading = useReadingMode() return (
    @@ -279,35 +274,22 @@ function Facts({ person, accent }: { person: PersonRecord; accent: string }) { )} - {person.pronouns && ( - - {reading && 'Pronouns: '} - {person.pronouns} - - )} + {person.pronouns && {person.pronouns}} {person.org && ( - - {reading && 'Home organization: '} - - {person.org.name} - - + + {person.org.name} + )} - {person.location_label && ( - - {reading && 'Based in: '} - {person.location_label} - - )} + {person.location_label && {person.location_label}} - {reading ? 'All leadership' : 'Leadership'} + Leadership
    ) diff --git a/src/pages/Privacy.tsx b/src/pages/Privacy.tsx index b0213a4..a37d01a 100644 --- a/src/pages/Privacy.tsx +++ b/src/pages/Privacy.tsx @@ -24,7 +24,7 @@ const PAGE = sitePage("/privacy"); 'privacy', in Admin → Forms → Data requests. ═══════════════════════════════════════════════════════════════ */ -const LAST_UPDATED = "October 3, 2026"; +const LAST_UPDATED = "September 30, 2026"; const link = "underline underline-offset-2 text-link"; @@ -137,28 +137,11 @@ const PARTS: LegalPart[] = [ id: "cookies", heading: "Cookies and browser storage", body: [ - <> - This site doesn't use advertising or tracking cookies, and doesn't use Google Analytics. To see which - pages are read, we use{" "} - - Plausible Analytics - - , which we host ourselves on our own server using its free, open-source{" "} - - Community Edition - - : it sets no cookies, doesn't follow you across sites, and keeps no personal information, only counts - of visits to each page; nothing from it is shared or sold. The site also keeps a few small things in - your own browser so it works the way you left it: - , + "This site doesn't use advertising or tracking cookies, and doesn't use Google Analytics. To see which pages are read, we use Plausible Analytics, which we host ourselves on our own server: it sets no cookies, doesn't follow you across sites, and keeps no personal information, only counts of visits to each page; nothing from it is shared or sold. The site also keeps a few small things in your own browser so it works the way you left it:", ], list: [ "That you closed the announcement banner or the privacy notice.", "Whether you chose the light or dark look.", - "Your accessibility choices: the dyslexia-friendly font, reading mode and color blind mode.", "For staff who sign in: a sign-in cookie that keeps you signed in, and a short-lived one used while signing in with Google.", ], after: [ diff --git a/src/pages/TeamDetail.tsx b/src/pages/TeamDetail.tsx index 3a8659a..0e6b6a0 100644 --- a/src/pages/TeamDetail.tsx +++ b/src/pages/TeamDetail.tsx @@ -91,7 +91,7 @@ export default function TeamDetail() { sections.push({ id: 'members', - title: 'Members', + title: hasAbout ? 'Members' : team.name, accent, content: (
    @@ -142,6 +142,14 @@ function Facts({ {orgName} + + + Back to {orgName} +
    ) } diff --git a/src/pages/sections/CommunityBlog.tsx b/src/pages/sections/CommunityBlog.tsx index ed73083..73da079 100644 --- a/src/pages/sections/CommunityBlog.tsx +++ b/src/pages/sections/CommunityBlog.tsx @@ -35,12 +35,8 @@ const DEFAULTS = { const EXCERPT_CHARS = 180 -/* One post as a card; person pages list their posts with it too. - `level` is the title's heading level, one under the heading above - the cards. The date line comes after the title in the page, so it - reads as this post's (not the one before), and is drawn above it. */ -export function PostCard({ post, accent, level = 4 }: { post: BlogPostSummary; accent: string; level?: 3 | 4 }) { - const Title = level === 3 ? 'h3' : 'h4' +/* One post as a card; person pages list their posts with it too. */ +export function PostCard({ post, accent }: { post: BlogPostSummary; accent: string }) { const cover = useSmallImage(mediaUrl(post.cover_image)) const date = postDate(post.published_on) const authors = post.authors.map((author) => author.name).join(', ') @@ -53,19 +49,19 @@ export function PostCard({ post, accent, level = 4 }: { post: BlogPostSummary; a
    )}
    - + {(date || post.tags.length > 0) && ( + <p className="text-sm font-semibold" style={{ color: accentText(accent) }}> + {[date, ...post.tags].filter(Boolean).join(' · ')} + </p> + )} + <h4 className="mt-2 font-display text-xl font-bold leading-snug text-ink"> <Link to={blogHref(post.id)} className="after:absolute after:inset-0 after:content-[''] hover:underline" > {post.title} </Link> - - {(date || post.tags.length > 0) && ( -

    - {[date, ...post.tags].filter(Boolean).join(' · ')} -

    - )} + {post.excerpt && (

    {preview(post.excerpt, EXCERPT_CHARS)}

    )} @@ -141,7 +137,7 @@ export default function CommunityBlog({ accent = BRAND }: { accent?: string }) {
    {external.cards.length > 0 && (
    - +
    )}
    diff --git a/src/pages/sections/EventCalendar.tsx b/src/pages/sections/EventCalendar.tsx index 926fa0b..794b670 100644 --- a/src/pages/sections/EventCalendar.tsx +++ b/src/pages/sections/EventCalendar.tsx @@ -39,9 +39,6 @@ Below md the grid would be seven unreadable slivers, so the month view shows the list there instead. The toggle still works; it just has one answer on a phone. - - Reading mode (readingMode.ts) gets no grid or controls: the next - six weeks from today as a list, one line per event (ReadingList). ═══════════════════════════════════════════════════════════════ */ import { ArrowRight, ArrowLeft, CaretRight, CaretLeft } from '@phosphor-icons/react' @@ -55,7 +52,6 @@ import { eventHref } from '../../lib/hrefs.ts' import type { EventListItem } from '../../lib/useContent.ts' import { withAlpha, accentText, readableOn, BRAND } from '../../lib/color.ts' import { localISO } from '../../lib/timeline.ts' -import { useReadingMode } from '../../lib/readingMode.ts' export type CalendarControl = 'scope' | 'type' | 'online' | 'search' export type CalendarView = 'month' | 'list' @@ -229,43 +225,7 @@ function nextDateAfter(events: EventListItem[], after: string): string | null { /* ── Component ───────────────────────────────────────────────── */ -export default function EventCalendar(props: EventCalendarProps) { - return useReadingMode() ? : -} - -/* How many days from today the reading mode list covers. */ -const READING_DAYS = 42 - -/* Reading mode: what's on from today for six weeks, as text. */ -function ReadingList({ scope, host, status, type }: EventCalendarProps) { - const today = iso(new Date()) - const to = addDays(today, READING_DAYS - 1) - const { events, loading, error } = useEvents({ scope, host, status, type, from: today, to }) - const items = useMemo(() => occurrencesIn(events, today, to), [events, today, to]) - - if (error) return

    Couldn’t load the calendar. {error}

    - if (loading && items.length === 0) return

    Loading the calendar…

    - if (items.length === 0) return

    Nothing on the calendar in the next six weeks.

    - - return ( -
      - {items.map((item) => { - const { event } = item - const when = item.start !== item.end ? rangeLabel(item.start, item.end) : longDay(item.start) - const where = event.location_label || (event.is_online ? 'Online' : null) - return ( -
    • - {when}: {event.title} - {event.status === 'cancelled' && ' (canceled)'} - {[item.time, eventTypeLabel(event.event_type), where].filter(Boolean).map((part) => `, ${part}`)} -
    • - ) - })} -
    - ) -} - -function CalendarGrid({ +export default function EventCalendar({ scope, host, status, diff --git a/src/pages/sections/EventList-Cards.tsx b/src/pages/sections/EventList-Cards.tsx index 5d866c9..5d8de43 100644 --- a/src/pages/sections/EventList-Cards.tsx +++ b/src/pages/sections/EventList-Cards.tsx @@ -10,7 +10,6 @@ import { mediaUrl } from "../../lib/media.ts"; import { useSmallImage } from "../../lib/useSmallImage.ts"; import Logo from "../../components/Logo.tsx"; import { accentText, withAlpha, readableOn, BRAND } from '../../lib/color.ts' -import { useReadingMode } from "../../lib/readingMode.ts"; /* ═══════════════════════════════════════════════════════════════ EVENT LIST: CARDS @@ -30,10 +29,6 @@ import { useReadingMode } from "../../lib/readingMode.ts"; off, the band takes every kind it finds and grows a row of chips to narrow by, but only once it holds more than one, so a band of nothing but retreats shows no control at all. - - Reading mode (readingMode.ts) gets every event as the grid lists - them, carousel or not, with every past event shown and no - buttons to open or page through them. ═══════════════════════════════════════════════════════════════ */ @@ -157,11 +152,6 @@ function TitleLink({ ev, linked, children }) { `linked` is the one thing a caller turns off: a card on the event's own page shouldn't link to the page it's already on. - - `level` is the title's heading level, one under the heading the - card sits beneath. In reading mode the type badge (which would - read before the title, as if the last card's) and the "Event - details" link (the title already links there) are left out. ═══════════════════════════════════════════════════════════════ */ export function Card({ ev, @@ -171,10 +161,7 @@ export function Card({ interactive = true, linked = true, showType = false, - level = 3, }) { - const reading = useReadingMode(); - const Title = level === 4 ? "h4" : "h3"; const past = ev.status === "past"; const color = ev.color || defaultColor; const orgLogo = mediaUrl(ev.org_logo) || DEFAULT_ORG_LOGO; @@ -190,7 +177,7 @@ export function Card({ on every card in a row of nothing but retreats is noise, and the card can't tell on its own, it only ever sees one event. */ const typeBadge = - showType && ev.event_type && !reading ? ( + showType && ev.event_type ? (
    {typeBadge} - + <h3 className="text-2xl sm:text-3xl font-bold leading-tight [overflow-wrap:anywhere]"> <TitleLink ev={ev} linked={linked}> {ev.title} </TitleLink> - + {ev.theme && (

    "{ev.theme}"

    )} @@ -263,11 +250,11 @@ export function Card({
    {typeBadge} - + <h3 className="text-2xl sm:text-4xl font-bold [overflow-wrap:anywhere]"> <TitleLink ev={ev} linked={linked}> {ev.title} </TitleLink> - + {ev.theme && (

    "{ev.theme}"

    )} @@ -351,7 +338,7 @@ export function Card({ )} {/* Last, so Register reads first when there is one. */} - {linked && !reading && ( + {linked && ( setIndex(i => Math.max(0, i - 1)); const next = () => setIndex(i => Math.min(events.length - 1, i + 1)); @@ -611,7 +595,7 @@ export default function EventListCards({ ? empty : `· No ${eventTypeLabel(activeType).toLowerCase()} events in this section yet ·`, ) - ) : view === "grid" || reading ? ( + ) : view === "grid" ? ( /* ── GRID VIEW: upcoming first, past events collapsed below ── */
    {upcoming.length > 0 && ( @@ -646,16 +630,16 @@ export default function EventListCards({
    {pastDrawn.map(ev => ( ))}
    - {!reading && ( -
    - {showPast && pastShown < pastEvents.length && ( - - )} +
    + {showPast && pastShown < pastEvents.length && ( -
    - )} + )} + +
    )}
    diff --git a/src/pages/sections/OrgList-Card.tsx b/src/pages/sections/OrgList-Card.tsx index b8d44e5..b5ceb20 100644 --- a/src/pages/sections/OrgList-Card.tsx +++ b/src/pages/sections/OrgList-Card.tsx @@ -1,5 +1,4 @@ import { ArrowUpRight } from '@phosphor-icons/react'; -import { Link } from "react-router-dom"; import ArrowLink from "../../components/ArrowLink.tsx"; import OrgLogo from "../../components/OrgLogo.tsx"; import { @@ -8,7 +7,6 @@ import { byName, } from "../../lib/organizations.ts"; import { accentText } from '../../lib/color.ts' -import { useReadingMode } from '../../lib/readingMode.ts' /* ═══════════════════════════════════════════════════════════════ ORGANIZATION LIST: CARDS @@ -35,12 +33,9 @@ const FALLBACK_COLOR = "#3b5456"; const CARD_MIN = "20rem"; const GRID_MAX = "88rem"; -/* Under a block title the card names are a level below it. */ -function OrgCard({ org, accent, pageLabel, siteLabel, titled }) { +function OrgCard({ org, accent, pageLabel, siteLabel }) { const color = org.color || accent; const path = orgPath(org); - const reading = useReadingMode(); - const Name = titled ? "h4" : "h3"; // Tagline first, then where they are. Partners often have one and // not the other, so this is the line that's most likely to say @@ -56,9 +51,9 @@ function OrgCard({ org, accent, pageLabel, siteLabel, titled }) {
    - - {path ? {org.name} : org.name} - +

    + {org.name} +

    {subtitle && (

    {subtitle} @@ -68,9 +63,8 @@ function OrgCard({ org, accent, pageLabel, siteLabel, titled }) { {/* Top-right rather than in the footer: the footer holds outbound links, and the arrow goes somewhere different - in kind, deeper into this site. Reading mode has the - name's link and leaves it out. */} - {path && !reading && ( + in kind, deeper into this site. */} + {path && ( ))}

    diff --git a/src/pages/sections/OrgList-Map.tsx b/src/pages/sections/OrgList-Map.tsx index 0f5bdeb..538b9ba 100644 --- a/src/pages/sections/OrgList-Map.tsx +++ b/src/pages/sections/OrgList-Map.tsx @@ -1,5 +1,5 @@ import { CaretRight, MagnifyingGlass, X } from '@phosphor-icons/react'; -import { Fragment, useEffect, useMemo, useRef, useState } from "react"; +import { useEffect, useMemo, useRef, useState } from "react"; import { useCommunity } from "../../lib/useCommunity.ts"; import { useOrganization } from "../../lib/useContent.ts"; import { Link } from "react-router-dom"; @@ -9,7 +9,6 @@ import { orgPath } from "../../lib/organizations.ts"; import { AREAS, AREA_NAMES } from "../../data/mapGrid.ts"; import { accentText, readableOn } from '../../lib/color.ts' import { scrollBehavior } from "../../lib/motion.ts"; -import { useReadingMode } from "../../lib/readingMode.ts"; /* ═══════════════════════════════════════════════════════════════ ORGANIZATION LIST: MAP @@ -59,7 +58,6 @@ const GRID_CAP = 12; const US_TITLE = "US Unity Regions"; const INTL_TITLE = "International Unity Regions"; -const ONLINE_TITLE = "Online Unity Regions"; /* ── Body content ────────────────────────────────────────────── A group's description is ordered blocks rather than one @@ -755,65 +753,6 @@ function GroupGrid({ regions, groups, groupsIn, subtextFor, openId, setOpenId }) ); } -/* ═══════════════════════════════════════════════════════════════ - READING MODE - Either view as text: the regions grouped as the list groups them, - each with every one of its groups (no cap, no search), and no map. - ═══════════════════════════════════════════════════════════════ */ - -function ReadingRegions({ domestic, international, virtual, groupsIn, subtextFor }) { - const region = r => { - const path = orgPath(r); - const subtext = subtextFor(r); - const list = groupsIn(r.id); - return ( - -

    {path ? {r.name} : r.name}

    - {subtext &&

    {subtext}

    } - {list.length === 0 ? ( -

    No groups yet. Interested in starting one?

    - ) : ( -
      - {list.map(c => ( -
    • - {orgPath(c) ? {c.name} : c.name} - {[c.location_label, c.meets].filter(Boolean).map(part => `, ${part}`).join("")} - {c.website && ( - <> - , Website - - )} - {c.email && ( - <> - , Contact - - )} -
    • - ))} -
    - )} -
    - ); - }; - - return ( - <> - {([ - [US_TITLE, domestic], - [INTL_TITLE, international], - [ONLINE_TITLE, virtual], - ] as [string, any[]][]).map(([title, list]) => - list.length > 0 ? ( - -

    {title}

    - {list.map(region)} -
    - ) : null - )} - - ); -} - /* The control for the section heading's action bar. */ export function OrgMapToggle({ view, setView, accent }) { const btn = active => ({ @@ -867,7 +806,6 @@ export default function OrgListMap({ view = "map", accent = FALLBACK_COLOR }) { const [hovered, setHovered] = useState(null); const [openId, setOpenId] = useState(null); // no card open on arrival const [query, setQuery] = useState(""); - const reading = useReadingMode(); // The list scrolls itself to whatever the map or legend points at. const listRef = useRef(null); @@ -998,18 +936,6 @@ export default function OrgListMap({ view = "map", accent = FALLBACK_COLOR }) { ); } - if (reading) { - return shell( - - ); - } - if (view === "grid") { return ( {/* Map */}
    - {/* Scales to the column's width at every size; on a phone the - legend and the list below are the easier way in. */} - + {/* On a phone the map keeps a readable size (tiles big enough + to read and tap) and scrolls sideways in its own box. */} +
    +
    + +
    +
    ; } -function OrgRow({ org, pageLabel, siteLabel, titled }) { +function OrgRow({ org, pageLabel, siteLabel }) { const [open, setOpen] = useState(false); const panelId = useId(); - const reading = useReadingMode(); - // Under a block title the names are a level below it. - const Name = titled ? "h4" : "h3"; const color = org.color || FALLBACK_COLOR; const path = orgPath(org); @@ -107,36 +102,28 @@ function OrgRow({ org, pageLabel, siteLabel, titled }) { return (
    - {/* Reading mode can't open the row (the panel reads anyway), - so the name is a heading linked to the page instead. */} - {reading ? ( -
    - {path ? {org.name} : org.name} - {summary &&

    {summary}

    } -
    - ) : ( - - )} + {summary && ( + + {summary} + + )} + + +
    {org.website && ( @@ -153,7 +140,7 @@ function OrgRow({ org, pageLabel, siteLabel, titled }) { {/* Last in the row, so the arrow lines up down the right edge whether or not a row has an outbound site. */} - {path && !reading && ( + {path && ( )} {orgs.map(org => ( - + ))} ); diff --git a/src/pages/sections/history/TimelineEntry.tsx b/src/pages/sections/history/TimelineEntry.tsx index 422905b..eff6f4e 100644 --- a/src/pages/sections/history/TimelineEntry.tsx +++ b/src/pages/sections/history/TimelineEntry.tsx @@ -3,7 +3,6 @@ import { MONTH_LABELS, type PersonRef, type TimelineItem } from '../../../lib/ti import { hrefFor, logoSrc } from '../../../lib/timelineRefs.ts' import { initials, mediaUrl } from '../../../lib/media.ts' import { useSmallImage } from '../../../lib/useSmallImage.ts' -import { useReadingMode } from '../../../lib/readingMode.ts' const KIND_NAMES: Record = { milestone: 'Milestone', @@ -58,7 +57,6 @@ type Props = { export default function TimelineEntry({ item, variant = 'inline' }: Props) { const featured = variant === 'featured' - const reading = useReadingMode() const href = hrefFor(item) const logo = logoSrc(item) @@ -119,23 +117,6 @@ export default function TimelineEntry({ item, variant = 'inline' }: Props) { // An explicit href may point off-site; Link is for in-app routes only. const external = !!href && /^(https?:)?\/\//.test(href) - // Reading mode: the card's link has no heading to carry it, so the - // title would read twice and the date not at all. Plain lines instead. - if (reading) { - const title = !href ? item.title : external ? {item.title} : {item.title} - const facts = [item.precision === 'year' ? '' : fullMarker(item), item.meta].filter(Boolean) - return ( -
  • -

    - {title} - {facts.map((fact) => `, ${fact}`).join('')} -

    - {item.blurb ?

    {item.blurb}

    : null} - {roster} -
  • - ) - } - return (
  • {href && external ? ( diff --git a/src/pages/sections/history/TimelineUpcoming.tsx b/src/pages/sections/history/TimelineUpcoming.tsx index 3648ade..7f8b52f 100644 --- a/src/pages/sections/history/TimelineUpcoming.tsx +++ b/src/pages/sections/history/TimelineUpcoming.tsx @@ -2,7 +2,6 @@ import { CaretDown, CaretUp } from '@phosphor-icons/react' import { useState } from 'react' import type { GroupedYear, SortDirection } from '../../../lib/timeline.ts' import TimelineYear from './TimelineYear.tsx' -import { useReadingMode } from '../../../lib/readingMode.ts' type Props = { years: GroupedYear[] @@ -29,11 +28,7 @@ export default function TimelineUpcoming({ openYears, onToggleYear, }: Props) { - const [chosen, setOpen] = useState(false) - // Reading mode can't press the button: the list is open, under a - // heading (its years are h4s, like a decade's) in place of it. - const reading = useReadingMode() - const open = chosen || reading + const [open, setOpen] = useState(false) if (count === 0) return null return ( @@ -41,24 +36,22 @@ export default function TimelineUpcoming({ className={`site-tl__upcoming${open ? ' site-tl__upcoming--open' : ''}`} aria-label="Upcoming" > - {reading ?

    Still to come

    : ( - - )} + {open ? (
    diff --git a/src/pages/sections/history/TimelineYear.tsx b/src/pages/sections/history/TimelineYear.tsx index d8c01d7..2c3ad84 100644 --- a/src/pages/sections/history/TimelineYear.tsx +++ b/src/pages/sections/history/TimelineYear.tsx @@ -1,7 +1,6 @@ import type { CSSProperties } from 'react' import type { GroupedYear } from '../../../lib/timeline.ts' import TimelineEntry from './TimelineEntry.tsx' -import { useReadingMode } from '../../../lib/readingMode.ts' /** A solid teal dot per year, its size growing with the year's * entries so the rail reads as a density chart. (A vine or tree @@ -16,13 +15,8 @@ type Props = { onToggle: (year: number) => void } -export default function TimelineYear({ year, open: chosen, onToggle }: Props) { - // Reading mode can't open a year, so every year is open, the year a - // heading in place of its button, and an empty year left out. - const reading = useReadingMode() - const open = chosen || reading +export default function TimelineYear({ year, open, onToggle }: Props) { const empty = year.count === 0 - const MonthLabel = reading ? 'h5' : 'h4' const panelId = `site-tl-year-${year.year}` const className = [ @@ -34,31 +28,25 @@ export default function TimelineYear({ year, open: chosen, onToggle }: Props) { .filter(Boolean) .join(' ') - if (reading && empty) return null - return (
    - {reading ? ( -

    {year.year}

    - ) : ( - - )} + {open ? ( empty ? ( @@ -77,7 +65,7 @@ export default function TimelineYear({ year, open: chosen, onToggle }: Props) { {year.months.map((month) => (
    - {month.label} +

    {month.label}

      {month.items.map((item) => ( @@ -88,7 +76,7 @@ export default function TimelineYear({ year, open: chosen, onToggle }: Props) { {year.undated.length > 0 ? (
      - Elsewhere in {year.year} +

      Elsewhere in {year.year}

        {year.undated.map((item) => ( diff --git a/src/pages/sections/home/FeaturedTimelineRail.tsx b/src/pages/sections/home/FeaturedTimelineRail.tsx index f032ec1..fa7383a 100644 --- a/src/pages/sections/home/FeaturedTimelineRail.tsx +++ b/src/pages/sections/home/FeaturedTimelineRail.tsx @@ -17,9 +17,6 @@ doesn't open it. Nothing featured, and the section doesn't render at all. - - Reading mode (readingMode.ts) gets the entries as text, oldest - first, each a linked heading with its date and words (ReadingRail). ═══════════════════════════════════════════════════════════════ */ import { ArrowRight, CaretRight, CaretLeft } from '@phosphor-icons/react'; @@ -32,7 +29,6 @@ import { hrefFor, logoSrc } from '../../../lib/timelineRefs.ts' import { MONTH_LABELS, type TimelineItem } from '../../../lib/timeline.ts' import { accentText, BRAND } from '../../../lib/color.ts' import { scrollBehavior } from '../../../lib/motion.ts'; -import { useReadingMode } from '../../../lib/readingMode.ts' const DRAG_SLOP = 6 @@ -47,29 +43,9 @@ export default function FeaturedTimelineRail({ id, title, blurb }: RailProps) { const railRef = useRef(null) const drag = useRef({ x: 0, left: 0, moved: false, active: false }) const [dragging, setDragging] = useState(false) - const reading = useReadingMode() if (!loading && !error && featured.length === 0) return null - if (reading) { - return ( -
        -

        {title}

        - {blurb &&

        {blurb}

        } - {error ? ( -

        Couldn’t load the timeline. {error}

        - ) : loading ? ( -

        Loading the timeline…

        - ) : ( - featured.map((item) => ) - )} -

        - See the full history -

        -
        - ) - } - const step = (direction: number) => { const rail = railRef.current const card = rail?.querySelector('li') @@ -206,17 +182,6 @@ function dateLabel(item: TimelineItem): string { return y } -function ReadingEntry({ item }: { item: TimelineItem }) { - const href = hrefFor(item) - return ( - <> -

        {href ? {item.title} : item.title}

        -

        {[dateLabel(item), item.meta].filter(Boolean).join(', ')}

        - {item.blurb &&

        {item.blurb}

        } - - ) -} - function RailCard({ item, showYear }: { item: TimelineItem; showYear: boolean }) { const href = hrefFor(item) const logo = logoSrc(item) diff --git a/src/pages/sections/home/HeroStage.tsx b/src/pages/sections/home/HeroStage.tsx index 0d13328..7ca877b 100644 --- a/src/pages/sections/home/HeroStage.tsx +++ b/src/pages/sections/home/HeroStage.tsx @@ -32,10 +32,6 @@ `hero` is null while the page config loads or when it failed; the stage still draws, empty, so the page doesn't jump when it arrives. The error itself is shown by Home, not here. - - Reading mode (readingMode.ts) gets it as text (ReadingHero): the - words and buttons, every photo's caption at once (no slideshow), - then the feature as a link, or the event's card. ═══════════════════════════════════════════════════════════════ */ import { ArrowRight, Play, Pause, Star } from '@phosphor-icons/react' @@ -51,7 +47,6 @@ import { livestreamEmbedUrl, videoSource, type VideoSource } from '../../../lib/ import { mediaUrl } from '../../../lib/media.ts' import { prefersLessMotion } from '../../../lib/motion.ts' import { focusOnMount } from '../../../lib/focus.ts' -import { useReadingMode } from '../../../lib/readingMode.ts' import { eventHref } from '../../../lib/hrefs.ts' import { seriesLabel } from '../../../lib/eventSeries.ts' import type { Hero, HeroBackdrop, HeroEvent, HeroFeature, HeroSlide } from '../../../lib/useFrontPage.ts' @@ -78,14 +73,6 @@ export default function HeroStage({ hero }: { hero: Hero | null }) { // Every feature shares a layout: words left, feature right. const beside = feature !== 'none' - if (useReadingMode()) { - return ( -
        - {hero && } -
        - ) - } - return (
        ) : feature === 'event' ? (

        -

        ) : feature === 'video' ? (

        -

        ) : ( hero.eyebrow && ( -

        +

        {hero.eyebrow}

        ) @@ -199,73 +186,6 @@ function Words({ hero, feature }: { hero: Hero; feature: HeroFeature }) { ) } -/* ── Reading mode ────────────────────────────────────────────── - The hero as text: its words and buttons, the photos' captions - (all of them, not the one a timer is showing), then the feature: - a link out to the stream or the video, or the event's card, - which already reads plainly. */ - -type ReadingHeroProps = { - hero: Hero - feature: HeroFeature - slides: HeroSlide[] - video: VideoSource | null -} - -function ReadingHero({ hero, feature, slides, video }: ReadingHeroProps) { - const captions = slides.filter((slide) => slide.caption) - return ( - <> - {feature === 'none' && hero.eyebrow &&

        {hero.eyebrow}

        } -

        {hero.headline}

        - {hero.subhead &&

        {hero.subhead}

        } - {[hero.primary, hero.secondary].map( - (button) => - button && ( -

        - {button.label} -

        - ), - )} - - {captions.length > 0 && ( -
          - {captions.map((slide, index) => ( -
        • - {slide.link_url ? {slide.caption} : slide.caption} -
        • - ))} -
        - )} - - {feature === 'livestream' && hero.livestream && ( -

        - Live now{hero.livestream.title && `: ${hero.livestream.title}`}.{' '} - Watch live -

        - )} - - {feature === 'video' && hero.video && ( -

        - Featured video:{' '} - {video?.kind === 'file' ? ( - {hero.video.title || 'Watch the video'} - ) : ( - {hero.video.title || 'Watch the video'} - )} -

        - )} - - {feature === 'event' && hero.event && ( - <> -

        Featured event

        - - - )} - - ) -} - /* ── The hero's buttons ────────────────────────────────────────── Both set: one cell in two halves, the primary filled on the left and the secondary clear on the right, split by a slash (the @@ -274,7 +194,7 @@ function ReadingHero({ hero, feature, slides, video }: ReadingHeroProps) { labels side by side don't fit; the slash starts at sm (home.css, .hp-split). One set: that one alone, in its own style. */ -const PRIMARY_FILL = 'var(--pal-amber-2)' +const PRIMARY_FILL = '#f0bd4f' const PRIMARY_TEXT = '#001011' const HALF = 'relative flex items-center justify-center gap-2 px-8 py-4 text-lg transition-colors duration-200 focus-visible:outline-offset-[-6px]' @@ -324,7 +244,7 @@ function HeroActions({ primary, secondary }: { primary: HeroLink; secondary: Her /* ── Brand backdrop ──────────────────────────────────────────── */ -const BRAND_FILL = 'var(--pal-teal-1)' +const BRAND_FILL = '#003a45' function BrandBackdrop() { return ( @@ -569,7 +489,7 @@ function EventPanel({ event }: { event: HeroEvent }) { {event.title} - {event.theme &&

        "{event.theme}"

        } + {event.theme &&

        "{event.theme}"

        }
    {(when || where) && ( @@ -585,7 +505,7 @@ function EventPanel({ event }: { event: HeroEvent }) { className={`inline-flex items-center gap-2 btn px-6 py-3 transition-transform hover:scale-105 ${ index === 0 ? 'text-[#001011]' : 'border border-white/35 text-white hover:bg-white/10' }`} - style={index === 0 ? { background: 'var(--pal-amber-2)' } : undefined} + style={index === 0 ? { background: '#f0bd4f' } : undefined} > {link.label} diff --git a/src/pages/sections/home/NextEventCountdown.tsx b/src/pages/sections/home/NextEventCountdown.tsx index f14917c..7971339 100644 --- a/src/pages/sections/home/NextEventCountdown.tsx +++ b/src/pages/sections/home/NextEventCountdown.tsx @@ -26,7 +26,6 @@ import { eventHref } from '../../../lib/hrefs.ts' import { upcomingOccurrences } from '../../../lib/eventSeries.ts' import type { CountdownEvent } from '../../../lib/useFrontPage.ts' import { withAlpha, accentText, BRAND } from '../../../lib/color.ts' -import { useReadingMode } from '../../../lib/readingMode.ts' /* Local midnight (or HH:MM) on a 'YYYY-MM-DD'. */ @@ -64,7 +63,6 @@ export default function NextEventCountdown({ event: CountdownEvent overlap: boolean }) { - const reading = useReadingMode() const now = useNow(1000) const when = target(event) const accent = event.color || BRAND @@ -81,9 +79,6 @@ export default function NextEventCountdown({ const where = event.location_label || (event.is_online ? 'Online' : null) - // Reading mode: the event is already in the retreats band. - if (reading) return null - return (
    >([]) const base = useId().replace(/:/g, '') - const reading = useReadingMode() if (paths.length === 0) return null - if (reading) { - return ( -
    -

    {title}

    - {blurb &&

    {blurb}

    } - {paths.map((option, index) => ( -
    -

    {option.label}

    - {option.blurb &&

    {option.blurb}

    } -
      - {option.actions.map((action, i) => ( -
    • - {action.label} - {action.description && `: ${action.description}`} -
    • - ))} -
    -
    - ))} -
    - ) - } - const path = paths[Math.min(selected, paths.length - 1)] const accent = PATH_ACCENTS[selected % PATH_ACCENTS.length] diff --git a/src/pages/sections/home/StatsBand.tsx b/src/pages/sections/home/StatsBand.tsx index bf15ef6..8bf3839 100644 --- a/src/pages/sections/home/StatsBand.tsx +++ b/src/pages/sections/home/StatsBand.tsx @@ -6,15 +6,13 @@ band scrolls into view; a value that isn't a plain number ("Since 2004", "Coast to coast") just appears. - Reduced motion skips the count and shows the number. Reading mode - (readingMode.ts) gets one line per number: "1,200+ Members". + Reduced motion skips the count and shows the number. ═══════════════════════════════════════════════════════════════ */ import { useEffect, useRef, useState } from 'react' import type { FrontPageStat } from '../../../lib/useFrontPage.ts' import { prefersLessMotion } from '../../../lib/motion.ts' -import { useReadingMode } from '../../../lib/readingMode.ts' const COUNT_MS = 1400 @@ -27,9 +25,7 @@ type StatsBandProps = { export default function StatsBand({ id, title, blurb, stats }: StatsBandProps) { const ref = useRef(null) - // Less motion: no wait for the band to scroll into view (reading - // mode's hidden page never does). - const [seen, setSeen] = useState(prefersLessMotion) + const [seen, setSeen] = useState(false) useEffect(() => { const el = ref.current @@ -47,30 +43,12 @@ export default function StatsBand({ id, title, blurb, stats }: StatsBandProps) { return () => observer.disconnect() }, [seen]) - if (useReadingMode()) { - return ( -
    -

    {title}

    - {blurb &&

    {blurb}

    } -
      - {stats.map((stat, index) => ( -
    • - {stat.value} - {stat.suffix} {stat.label} - {stat.note && `: ${stat.note}`} -
    • - ))} -
    -
    - ) - } - return (

    @@ -87,7 +65,7 @@ export default function StatsBand({ id, title, blurb, stats }: StatsBandProps) { >
    - {stat.suffix && {stat.suffix}} + {stat.suffix && {stat.suffix}}
    {stat.label} @@ -129,7 +107,7 @@ function CountUp({ value, run }: { value: string; run: boolean }) { if (!numeric) return <>{value} - const n = reduced ? target : run ? shown : 0 + const n = reduced || !run ? (run ? target : 0) : shown return ( {n.toLocaleString(undefined, {