From 185f9831e2061b1db71e733d746b8806854d6d28 Mon Sep 17 00:00:00 2001 From: Zaldimmar Date: Mon, 28 Sep 2026 22:07:56 -0500 Subject: [PATCH] Fix accessibility found in the audit - Text contrast: teal text and button fills use #0f7183 (5.7:1), section accents darkened to pass on white, solid CTA buttons instead of the gradient, footer and subnav text raised to white/65, event and region colours kept on borders and swatches with ink text - Hidden carousel slides and collapsed past events are inert - Admin list rows carry a real link for keyboard use - Mobile menu is a modal dialog: focus, Escape, inert background, above the header - Skip to content link, one focus-visible ring, reduced-motion rule, focus rings on the calendar inputs - Region headings hold their button instead of sitting inside it - font-700 style classes (not Tailwind v4 utilities) replaced with named weights, and the 700/800 font files loaded - Migration 038: alt text for blog covers and schedule graphics; event logos next to their title are decorative - Drop the Church Center script from index.html; Giving loads it itself Co-Authored-By: Claude Opus 5.5 --- index.html | 1 - server/src/admin-schema.js | 2 + server/src/migrations/038_image_alt_text.sql | 13 +++ server/src/routes/blog.js | 1 + server/src/shape.js | 3 +- src/components/ContentBlocks.tsx | 2 +- src/components/FeaturedCards.tsx | 2 +- src/components/Footer.tsx | 10 +-- src/components/Layout.tsx | 34 ++++++-- src/components/PageShell.tsx | 8 +- src/components/PageState.tsx | 2 +- src/components/PeopleTiles.css | 2 +- src/components/ScheduleBlock.tsx | 4 +- src/components/VideoPlayer.tsx | 2 +- src/components/admin/MediaLibrary.tsx | 8 +- src/components/admin/SectionNav.tsx | 4 +- src/components/admin/fields.tsx | 10 +-- src/index.css | 25 ++++++ src/lib/adminSchema.ts | 13 +++ src/lib/useBlog.ts | 1 + src/lib/useContent.ts | 2 + src/pages/AwardDetail.tsx | 2 +- src/pages/BlogPost.tsx | 4 +- src/pages/Community.tsx | 4 +- src/pages/EventDetail.tsx | 2 +- src/pages/Feedback.tsx | 2 +- src/pages/Giving.tsx | 2 +- src/pages/History.tsx | 4 +- src/pages/Home.tsx | 2 +- src/pages/Leadership.tsx | 8 +- src/pages/OrganizationDetail.tsx | 2 +- src/pages/PersonDetail.tsx | 2 +- src/pages/Privacy.tsx | 2 +- src/pages/QrCodes.tsx | 2 +- src/pages/Resources.tsx | 4 +- src/pages/Retreats.tsx | 10 +-- src/pages/TeamDetail.tsx | 2 +- src/pages/Terms.tsx | 2 +- src/pages/admin/AdminClips.tsx | 10 +-- src/pages/admin/AdminFeedback.tsx | 14 ++-- src/pages/admin/AdminHome.tsx | 16 ++-- src/pages/admin/AdminLayout.tsx | 14 ++-- src/pages/admin/AdminLogin.tsx | 4 +- src/pages/admin/AdminMedia.tsx | 6 +- src/pages/admin/AdminPanel.tsx | 10 +-- src/pages/admin/EntityEdit.tsx | 8 +- src/pages/admin/EntityList.tsx | 31 +++++-- src/pages/sections/CommunityBlog.tsx | 4 +- src/pages/sections/EventCalendar.tsx | 6 +- src/pages/sections/EventList-Cards.tsx | 51 ++++++------ src/pages/sections/FeedbackForm.tsx | 10 +-- src/pages/sections/OrgList-Card.tsx | 14 ++-- src/pages/sections/OrgList-Map.tsx | 82 +++++++++---------- src/pages/sections/OrgList-Vertical.tsx | 14 ++-- src/pages/sections/QrCodeMaker.tsx | 4 +- src/pages/sections/history/timeline.css | 2 +- .../sections/home/FeaturedTimelineRail.tsx | 2 +- src/pages/sections/home/HeroStage.tsx | 2 +- .../sections/home/NextEventCountdown.tsx | 2 +- src/pages/sections/home/Pathfinder.tsx | 4 +- src/pages/sections/home/RetreatsBand.tsx | 2 +- 61 files changed, 310 insertions(+), 207 deletions(-) create mode 100644 server/src/migrations/038_image_alt_text.sql diff --git a/index.html b/index.html index 2eedec2..d51965e 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,6 @@ <!-- site:title --> - diff --git a/server/src/admin-schema.js b/server/src/admin-schema.js index 03953c9..18ec7ab 100644 --- a/server/src/admin-schema.js +++ b/server/src/admin-schema.js @@ -206,6 +206,7 @@ const blocksChild = (ownerKind) => ({ text("person_id"), text("description"), text("media"), + text("media_alt"), text("map"), ], }, @@ -840,6 +841,7 @@ const blogPosts = { text("title", { required: true }), text("excerpt"), text("cover_image"), + text("cover_alt"), date("published_on"), text("tags"), text("guest_author"), diff --git a/server/src/migrations/038_image_alt_text.sql b/server/src/migrations/038_image_alt_text.sql new file mode 100644 index 0000000..cff6a0d --- /dev/null +++ b/server/src/migrations/038_image_alt_text.sql @@ -0,0 +1,13 @@ +-- ═══════════════════════════════════════════════════════════════ +-- 038 ALT TEXT FOR BLOG COVERS AND SCHEDULE GRAPHICS +-- +-- Both images can carry information (a flyer, a site map, a cover +-- photo that sets the scene), so each gets its own description for +-- screen readers. Blank means decorative: the image is skipped. +-- +-- blog_posts.cover_alt the cover image's description +-- content_block_items.media_alt a schedule entry graphic's +-- ═══════════════════════════════════════════════════════════════ + +ALTER TABLE blog_posts ADD COLUMN cover_alt TEXT; +ALTER TABLE content_block_items ADD COLUMN media_alt TEXT; diff --git a/server/src/routes/blog.js b/server/src/routes/blog.js index 3a6e665..04d6061 100644 --- a/server/src/routes/blog.js +++ b/server/src/routes/blog.js @@ -103,6 +103,7 @@ blog.get("/blog/:id", (c) => { title: row.title, excerpt: row.excerpt, cover_image: row.cover_image, + cover_alt: row.cover_alt, published_on: row.published_on, tags: splitTags(row.tags), authors, diff --git a/server/src/shape.js b/server/src/shape.js index 970cec9..c414511 100644 --- a/server/src/shape.js +++ b/server/src/shape.js @@ -99,7 +99,7 @@ export function loadBlocks(db, ownerKind, ids, slot = "body") { const itemRows = db .prepare( `SELECT i.block_id, i.text, i.detail, i.url, - i.day, i.time, i.location, i.description, i.media, i.map, + i.day, i.time, i.location, i.description, i.media, i.media_alt, i.map, p.id AS person_id, p.display_name AS person_name, p.photo AS person_photo, p.tagline AS person_tagline FROM content_block_items i @@ -122,6 +122,7 @@ export function loadBlocks(db, ownerKind, ids, slot = "body") { location: row.location, description: row.description, media: row.media, + media_alt: row.media_alt, map: row.map, person: row.person_id ? { diff --git a/src/components/ContentBlocks.tsx b/src/components/ContentBlocks.tsx index 959dcd3..30d3199 100644 --- a/src/components/ContentBlocks.tsx +++ b/src/components/ContentBlocks.tsx @@ -43,7 +43,7 @@ const BODY = '#4a6b72' export default function ContentBlocks({ blocks, - accent = '#138ba0', + accent = '#0f7183', className = '', }: { blocks?: ContentBlock[] | null diff --git a/src/components/FeaturedCards.tsx b/src/components/FeaturedCards.tsx index f6ddac3..2cbe00d 100644 --- a/src/components/FeaturedCards.tsx +++ b/src/components/FeaturedCards.tsx @@ -78,7 +78,7 @@ function Card({ card }: { card: FeaturedCard }) { const text = (
{card.eyebrow && ( -

{card.eyebrow}

+

{card.eyebrow}

)} {card.title && (

diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx index d06455e..44e71d3 100644 --- a/src/components/Footer.tsx +++ b/src/components/Footer.tsx @@ -40,13 +40,13 @@ const Footer_Links = [ ]; const footerLinkClass = - "text-white/40 hover:text-[#aac992] text-sm transition-colors"; + "text-white/65 hover:text-[#aac992] text-sm transition-colors"; const pageLinkClass = "text-white/80 hover:text-[#aac992] text-sm font-semibold transition-colors"; const sectionLinkClass = - "text-white/45 hover:text-[#aac992] text-sm transition-colors"; + "text-white/65 hover:text-[#aac992] text-sm transition-colors"; const headingClass = "text-white/90 text-sm font-semibold mb-4"; @@ -67,7 +67,7 @@ export default function Footer() {
{Organization_Details.cityLine}
- ({Organization_Details.addressNote}) + ({Organization_Details.addressNote})

{Organization_Details.nonprofit} Tax ID: {Organization_Details.taxId}. @@ -111,7 +111,7 @@ export default function Footer() { target="_blank" rel="noopener noreferrer" className="inline-block mt-8 px-6 py-2.5 rounded-full text-sm font-bold text-white whitespace-nowrap transition-all duration-200 hover:scale-105" - style={{ background: "linear-gradient(135deg, #008fa8, #88b668)" }} + style={{ background: "#0f7183" }} > Support Us @@ -161,7 +161,7 @@ export default function Footer() {

-

© 2026 Next Generation of Unity. All rights reserved.

+

© 2026 Next Generation of Unity. All rights reserved.

{Footer_Links.map((link) => ( diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx index 82b00e8..94767b0 100644 --- a/src/components/Layout.tsx +++ b/src/components/Layout.tsx @@ -25,7 +25,7 @@ const ACTION_VARIANTS: Record< }, fancy: { className: "font-bold text-white hover:scale-105", - style: { background: "linear-gradient(135deg, #008fa8, #88b668)" }, + style: { background: "#0f7183" }, }, }; @@ -73,6 +73,7 @@ export default function Layout() { const [activeSection, setActiveSection] = useState(null); const [headerHeight, setHeaderHeight] = useState(72); const headerRef = useRef(null); + const closeMenuRef = useRef(null); const location = useLocation(); const sections = PAGE_SECTIONS[location.pathname] ?? []; @@ -84,6 +85,16 @@ export default function Layout() { setActiveSection(null); }, [location.pathname]); + // The open menu is modal: focus starts on its close button, Escape + // shuts it, and everything behind it is inert (below). + useEffect(() => { + if (!mobileMenuOpen) return; + closeMenuRef.current?.focus(); + const onKey = (e: KeyboardEvent) => e.key === "Escape" && setMobileMenuOpen(false); + window.addEventListener("keydown", onKey); + return () => window.removeEventListener("keydown", onKey); + }, [mobileMenuOpen]); + // The header grows and shrinks: the banner can be dismissed and the // subnav only exists on some pages. Measure it instead of guessing, // so the spacer below always matches. @@ -140,11 +151,18 @@ export default function Layout() { return (
+ + Skip to content + {/* ── NAV ─────────────────────────────────────────────── */}
{/* Tier 0, site-wide announcement */} @@ -211,7 +229,7 @@ export default function Layout() { borderBottom: "1px solid rgba(45,200,224,0.15)", }} > - {activePage?.label} + {activePage?.label} {/* Separates the page label from its sections */} {/* Page content */} -
+
{/*Site Footer applied to every page*/} -