Reading mode: every page and section reads as text
The reader (ReaderView.tsx) now reads an icon-only link's label, puts a card's link on its first line or picture when it has no heading, gives each item of a row of facts or links its own line, keeps line breaks, skips what CSS hides, turns a form into one line saying it can't be used there, shows empty table cells as "-", keeps section and heading ids so #links land, and opens file links as files. What it can't read draws its own text version (useReadingMode()): the hero, pathfinder, front page history, event lists (every event, past ones too), org lists and groups map (every region and group, linked), history timeline (every year open), schedules (every day, fold-outs included), people tiles (everyone, with details) and videos. Also: org names are linked headings, heading levels fixed where cards repeated their section's, Team pages lose the doubled "Members", Giving links the treasurer's email and names Church Center. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
c79910ef8d
commit
27e5fbd690
24 changed files with 788 additions and 180 deletions
|
|
@ -1,4 +1,5 @@
|
|||
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 {
|
||||
|
|
@ -7,6 +8,7 @@ import {
|
|||
byName,
|
||||
} from "../../lib/organizations.ts";
|
||||
import { accentText } from '../../lib/color.ts'
|
||||
import { useReadingMode } from '../../lib/readingMode.ts'
|
||||
|
||||
/* ═══════════════════════════════════════════════════════════════
|
||||
ORGANIZATION LIST: CARDS
|
||||
|
|
@ -33,9 +35,12 @@ const FALLBACK_COLOR = "#3b5456";
|
|||
const CARD_MIN = "20rem";
|
||||
const GRID_MAX = "88rem";
|
||||
|
||||
function OrgCard({ org, accent, pageLabel, siteLabel }) {
|
||||
/* Under a block title the card names are a level below it. */
|
||||
function OrgCard({ org, accent, pageLabel, siteLabel, titled }) {
|
||||
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
|
||||
|
|
@ -51,9 +56,9 @@ function OrgCard({ org, accent, pageLabel, siteLabel }) {
|
|||
<OrgLogo org={org} color={color} size="h-10 w-10 sm:h-14 sm:w-14" />
|
||||
|
||||
<div className="min-w-0 flex-1">
|
||||
<h3 className="text-lg sm:text-xl font-bold leading-tight [overflow-wrap:anywhere]" style={{ color }}>
|
||||
{org.name}
|
||||
</h3>
|
||||
<Name className="text-lg sm:text-xl font-bold leading-tight [overflow-wrap:anywhere]" style={{ color }}>
|
||||
{path ? <Link to={path}>{org.name}</Link> : org.name}
|
||||
</Name>
|
||||
{subtitle && (
|
||||
<p className="text-sm mt-0.5" style={{ color: MUTED }}>
|
||||
{subtitle}
|
||||
|
|
@ -63,8 +68,9 @@ function OrgCard({ org, accent, pageLabel, siteLabel }) {
|
|||
|
||||
{/* Top-right rather than in the footer: the footer holds
|
||||
outbound links, and the arrow goes somewhere different
|
||||
in kind, deeper into this site. */}
|
||||
{path && (
|
||||
in kind, deeper into this site. Reading mode has the
|
||||
name's link and leaves it out. */}
|
||||
{path && !reading && (
|
||||
<ArrowLink
|
||||
to={path}
|
||||
label={`${org.name}: ${pageLabel}`}
|
||||
|
|
@ -135,6 +141,7 @@ function Block({ title, orgs, accent, pageLabel, siteLabel }) {
|
|||
accent={accent}
|
||||
pageLabel={pageLabel}
|
||||
siteLabel={siteLabel}
|
||||
titled={!!title}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue