Compare commits

...

4 commits

Author SHA1 Message Date
Zaldimmar
f94f1a6584 Point the docs at the split admin schema files
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 22:49:36 -05:00
Zaldimmar
e4a9c96f7e Finish the audit leftovers
- One mediaUrl in media.ts instead of 12 identical aliases and a
  kind map; orgPath builds on hrefs.ts's orgHref
- One Logo component (hides itself or shows a fallback when the file
  is missing) for event cards, org lists and chapter marks
- useHistory is a thin wrapper over useRecord
- adminSchema.ts split into adminSchema/, one file per entity plus
  shared.ts; the registry is unchanged (checked by loading both)
- JS smooth scrolls respect reduced motion (lib/motion.ts)
- Content-Security-Policy in Report-Only, with /api/csp-report logging
  what it would block

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 22:49:07 -05:00
Zaldimmar
c74ad746f5 Add colour tokens, dark mode and drop gradients
- Colour tokens in index.css named by role (ink, body, muted, link,
  brand, action, surface, tint, danger), used everywhere instead of hex
- Dark mode: follows the system, a header toggle (site and admin)
  overrides it and is remembered; set before first paint in index.html
- Data colours go through src/lib/color.ts: withAlpha for tints,
  accentText (lighter on dark) for text in an accent, readableOn for
  text on one, so an admin's pale colour still reads
- Migration 040 drops events.gradient: a card is its photo or plain,
  with its colour as the border; other decorative gradients are solid
- The countdown and a hero event without a photo mix their colour
  toward ink behind white text

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 22:42:59 -05:00
Zaldimmar
ee61568911 Add the Privacy and Terms pages, data requests and click-to-load embeds
- Privacy Policy (with cookies and storage) and Terms of Service, from
  what the code actually stores and loads; shared LegalText layout
- Data requests: a 'privacy' feedback type sent from the Privacy page's
  form, email required, triaged in Admin -> Feedback
- Migration 039: Panel -> Site settings -> Privacy contact email (over
  site.json's privacyEmail), shown on the Privacy page
- The hero livestream, the hero featured video and schedule maps load
  only when pressed, so no third party sets anything before a click
- A small dismissible privacy notice instead of a consent banner

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 22:34:46 -05:00
100 changed files with 3288 additions and 2704 deletions

View file

@ -66,11 +66,12 @@ 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.
- **Colours are tokens, not hex.** 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 colour). Data colours (accents, event and region colours) go through `withAlpha`, `accentText` and `readableOn` in `src/lib/color.ts`, never `${color}55`.
- **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`.
## Admin CRUD engine
Descriptor-driven: `server/src/admin-crud.js` and `server/src/admin-schema.js` (server) and `adminSchema.ts` (client) generate SQL and form fields from declarative entity configs. Adding an entity should mean adding a descriptor, not new CRUD code.
Descriptor-driven: `server/src/admin-crud.js` and `server/src/admin-schema.js` (server) and `src/lib/adminSchema/` (client, one file per entity, registered in `adminSchema.ts`) generate SQL and form fields from declarative entity configs. Adding an entity should mean adding a descriptor, not new CRUD code.
- Child collections are deleted and reinserted wholesale. Unsafe for entities referenced by foreign keys elsewhere.
- `reindex: false` prevents cross-entity sort order collisions.
- The `OMIT` sentinel distinguishes unsent fields from deliberate clears.

View file

@ -12,9 +12,15 @@ carries Hono's `secureHeaders()` (`server/src/index.js`):
- `Referrer-Policy: strict-origin-when-cross-origin`: kept to the origin,
because YouTube embeds refuse to play without a referrer.
- `Cross-Origin-Opener-Policy` and `Cross-Origin-Resource-Policy: same-origin`
- no HSTS (nginx sends it, below) and no Content-Security-Policy yet
(it needs trying in Report-Only first: pages carry an inline
`window.__NGU_SITE__` script and YouTube, Facebook and Maps iframes).
- no HSTS (nginx sends it, below)
- `Content-Security-Policy-Report-Only`: blocks nothing yet. Browsers
post what it would have blocked to `/api/csp-report`, which logs one
line per report (`journalctl -u ngu-api | grep csp`). The allowed
embed hosts are `EMBEDS` in `server/src/index.js`. After a while of
real use with nothing unexpected in the log, rename
`contentSecurityPolicyReportOnly` to `contentSecurityPolicy` there to
enforce it. A new embed host (a new video site, say) has to be added
to `EMBEDS` first.
The API also refuses a form-style write (`text/plain`, form or
multipart body) sent from another site, including a sibling subdomain

View file

@ -33,7 +33,7 @@ what a dropdown in the admin editor says.
| The **label** a dropdown shows in the admin | code | [one file](#renaming-what-a-dropdown-shows) |
| The **list of allowed values** behind a fixed dropdown | database CHECK + code | [a migration and three files](#adding-removing-or-renaming-a-stored-value) |
| Navigation, page section titles, colours, the site banner, history decades, the map grid | code | [the file named below](#other-content-that-lives-in-code) |
| A static page's title and intro (also its search title and description), the site's name, description, preview image, icons, search indexing | the database, over `site.json` | Admin → Panel → Site settings (superadmins). Blank uses `site.json`, which also holds the site's address and the pages' defaults. See `docs/seo.md` |
| A static page's title and intro (also its search title and description), the site's name, description, preview image, icons, search indexing, privacy contact email | the database, over `site.json` | Admin → Panel → Site settings (superadmins). Blank uses `site.json`, which also holds the site's address and the pages' defaults. See `docs/seo.md` |
| Uploaded images | disk + the `media` table | Admin → Tools → Media, or any image field. See `docs/media-uploads.md` |
The rule of thumb from `CLAUDE.md`: data belongs in the database,
@ -49,7 +49,7 @@ each entity:
| File | What it holds |
| ----------------------------- | ----------------------------------------------------- |
| `src/lib/adminSchema.ts` | The **form**: field labels, help text, dropdown labels, list columns and filters |
| `src/lib/adminSchema/` (one file per entity, `shared.ts` for common fields; `src/lib/adminSchema.ts` lists them) | The **form**: field labels, help text, dropdown labels, list columns and filters |
| `server/src/admin-schema.js` | What the server **accepts**: columns, types, the allowed values of each `enumeration(...)` |
And the database itself holds the final word: most fixed lists are a
@ -76,7 +76,7 @@ organization name in the label, as the `awards` query does.
> are changed with a migration: `UPDATE event_scopes SET name = '…' WHERE id = '…';`
**2. A fixed list in code (`options`).** The choices are written in
`src/lib/adminSchema.ts`. Each option is one of two shapes:
the entity's file in `src/lib/adminSchema/`. Each option is one of two shapes:
```ts
options: ["speaker", "leader", "host"] // shows: speaker, leader, host
@ -90,7 +90,7 @@ relabelling cheap.
### Renaming what a dropdown shows
If the stored value stays the same and you only want the dropdown to
read differently, **only `src/lib/adminSchema.ts` changes**. No
read differently, **only the file in `src/lib/adminSchema/` changes**. No
migration, no server change, and every existing row keeps working.
Find the field (search for its column name) and give the option a
@ -147,7 +147,7 @@ together, in one branch:
decide what existing rows become first.
2. **`server/src/admin-schema.js`**: the `enumeration("column", [...])`
list for that column.
3. **`src/lib/adminSchema.ts`**: the `options` on the form field, and on
3. **`src/lib/adminSchema/<entity>.ts`**: the `options` on the form field, and on
the list filter if there is one.
4. **Anywhere the public site renders or relies on the value**, listed in
the table below (for example `EVENT_TYPES` for event types, or the
@ -160,7 +160,7 @@ wrong rather than working around it.
### Every dropdown in the editor
**Fixed lists** (`options`: labels in `src/lib/adminSchema.ts`, values
**Fixed lists** (`options`: labels in `src/lib/adminSchema/`, values
also in `admin-schema.js` and a CHECK):
| Entity → field | Stored values | Labelled? | Also used on the public site by |
@ -176,7 +176,7 @@ also in `admin-schema.js` and a CHECK):
| Links → Kind (on organizations, events, people, teams) | action, social, website, email | no | `splitLinks` in `server/src/shape.js` |
| Links → Platform | instagram, facebook, discord, youtube, tiktok, x, substack, spotify, linkedin | **yes**, `PLATFORMS` | `PlatformIcon.tsx` draws the icon on the button. **No CHECK and no `enumeration`**: the column is plain text, so adding one is an entry in `PLATFORMS` (`src/lib/platforms.ts`) and its icon in `src/components/PlatformIcon.tsx`, no migration. |
| Content blocks → Shown in (slot) | card, body | **yes** | `paragraphs()` in `server/src/shape.js` (card), `ContentBlocks.tsx` (body) |
| Content blocks → Type | heading, subheading, paragraph, list, links, quote, image, divider, video, button, callout, schedule | **yes**, `BLOCK_TYPES` (with each type's description) | `ContentBlocks.tsx` (one renderer per type). Which fields each type shows is `when` on the fields in `blocksChild` (`src/lib/adminSchema.ts`). |
| Content blocks → Type | heading, subheading, paragraph, list, links, quote, image, divider, video, button, callout, schedule | **yes**, `BLOCK_TYPES` (with each type's description) | `ContentBlocks.tsx` (one renderer per type). Which fields each type shows is `when` on the fields in `blocksChild` (`src/lib/adminSchema/shared.ts`). |
| Timeline → Kind (+ list filter) | milestone, event, organization, award, people | no | `KIND_NAMES` in `src/pages/sections/history/TimelineEntry.tsx` |
| Timeline → Points at (+ list filter) | event, organization, award, person, team | no | `refHref` in `src/lib/hrefs.ts` |
| Timeline → Precision (and on events/orgs) | year, month, day | no | the history page's grouping |
@ -219,7 +219,7 @@ each is changed in a different place:
| --- | --- |
| **The heading on the page** ("National Retreats", "What's on") | **Admin → Pages → Front page → Page sections → Heading.** Blank uses the default below. |
| The default heading when that field is blank | `SECTIONS` in `src/pages/Home.tsx`, the `title` of each entry |
| **The name in the admin's Section dropdown** ("Events Carousel (National Retreats)") | `FRONT_PAGE_SECTIONS` in `src/lib/adminSchema.ts` |
| **The name in the admin's Section dropdown** ("Events Carousel (National Retreats)") | `FRONT_PAGE_SECTIONS` in `src/lib/adminSchema/frontPage.ts` |
| The subnav links under the header ("#Retreats", "#Calendar") | `PAGE_SECTIONS["/"]` in `src/navConfig.ts` |
To rename a band **for visitors**, use the admin. To rename how it
@ -253,7 +253,7 @@ CHECK on `front_page_sections.section` via a migration.
The numbers band's "Number Source" dropdown works the same way:
- **Relabel a source:** `STAT_SOURCES` in `src/lib/adminSchema.ts`.
- **Relabel a source:** `STAT_SOURCES` in `src/lib/adminSchema/frontPage.ts`.
- **Change what a count counts:** its query in `STAT_QUERIES` in
`server/src/routes/home.js`. Keep it counting exactly what the
matching public page shows (published rows), or the number and the
@ -273,7 +273,9 @@ The numbers band's "Number Source" dropdown works the same way:
| Site-wide announcement banner | `src/data/bannerConfig.ts` | `enabled: false` hides it. Bump `id` when the message changes, so people who dismissed the old one see the new one. |
| History page decade headers | `src/data/historyDecades.ts` | Title, tagline and blurb per decade. |
| Chapter map tiles and area names | `src/data/mapGrid.ts` | `AREAS` (tile positions) and `AREA_NAMES`. Which region paints which tile is in the database (Admin → Data → Organizations → a region → Map areas). |
| Feedback form types | `src/data/feedbackTypes.ts` **and** `TYPES` in `server/src/routes/feedback.js` | Keep the ids identical in both; the server stores unknown ids as `general`. Labels and hints are client-only. |
| Feedback form types | `src/data/feedbackTypes.ts` **and** `TYPES` in `server/src/routes/feedback.js` | Keep the ids identical in both; the server stores unknown ids as `general`. Labels and hints are client-only. `DATA_REQUEST` ('privacy') isn't a tile: the Privacy page's form sends it, and the server requires an email for it. |
| The site's colours, light and dark | `src/index.css` (`@theme` tokens and the dark overrides under them) | Change a token's value in both modes and every use follows. Use the token utilities (`text-muted`, `bg-surface`, `border-brand/20`) or `var(--color-…)`, not hex. A colour that arrives as data (a page accent, an event's or region's colour) goes through `src/lib/color.ts`: `withAlpha` for tints, `accentText` for text in it, `readableOn` for text on it. |
| 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", "Chapter") | `ORG_KIND_LABEL` in `src/lib/hrefs.ts` | |

View file

@ -5,6 +5,15 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title><!-- site:title --></title>
<!-- Theme before first paint, so a dark visitor never sees a white
flash: this browser's choice (ThemeToggle), else the system. -->
<script>
try {
var t = localStorage.getItem("ngu-theme");
document.documentElement.dataset.theme =
t === "dark" || t === "light" ? t : matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
} catch (e) {}
</script>
<!-- site:head-end -->
</head>
<body>

View file

@ -378,7 +378,6 @@ const events = {
text("org_logo"),
text("event_logo"),
text("color"),
text("gradient"),
text("card_image"),
bool("is_published"),
bool("is_listed"),
@ -935,6 +934,7 @@ const siteSettings = {
text("favicon"),
text("apple_touch_icon"),
enumeration("indexing", ["on", "off"]),
text("privacy_email"),
],
children: [

View file

@ -62,17 +62,64 @@ app.use("*", logger());
/* Headers for every response. Referrer kept to the origin (YouTube
embeds refuse to play without one). No HSTS here: nginx sends it on
everything, including the files it serves from disk
(docs/security-headers.md). No CSP yet: pages carry an inline
window.__NGU_SITE__ script and YouTube, Facebook and Maps iframes,
so one needs trying in Report-Only first. */
(docs/security-headers.md).
The Content-Security-Policy is Report-Only for now: nothing is
blocked, and each thing it would have blocked is logged by
/api/csp-report (journalctl -u ngu-api). Once a while of real use
logs nothing unexpected, switch contentSecurityPolicyReportOnly to
contentSecurityPolicy. 'unsafe-inline' scripts cover the page's
window.__NGU_SITE__ and the theme script in index.html. */
const EMBEDS = [
"https://www.youtube-nocookie.com",
"https://www.youtube.com",
"https://www.facebook.com",
"https://player.vimeo.com",
"https://www.google.com",
"https://maps.google.com",
"https://*.churchcenter.com",
"https://*.churchcenteronline.com",
];
app.use(
"*",
secureHeaders({
referrerPolicy: "strict-origin-when-cross-origin",
strictTransportSecurity: false,
contentSecurityPolicyReportOnly: {
defaultSrc: ["'self'"],
scriptSrc: ["'self'", "'unsafe-inline'", "https://js.churchcenter.com"],
styleSrc: ["'self'", "'unsafe-inline'"],
imgSrc: ["'self'", "data:", "https:"],
mediaSrc: ["'self'"],
fontSrc: ["'self'"],
connectSrc: ["'self'"],
frameSrc: EMBEDS,
frameAncestors: ["'self'"],
baseUri: ["'self'"],
formAction: ["'self'"],
objectSrc: ["'none'"],
reportUri: "/api/csp-report",
},
}),
);
/* What the policy above would have blocked. Browsers post these on
their own; a short line per report is plenty to go on. */
app.use("/api/csp-report", rateLimit({ windowMs: 60_000, max: 30 }));
app.post("/api/csp-report", async (c) => {
const text = (await c.req.text()).slice(0, 4000);
try {
const report = JSON.parse(text)["csp-report"] ?? {};
console.warn(
`csp ${report["violated-directive"] ?? "?"} blocked ${report["blocked-uri"] ?? "?"} on ${report["document-uri"] ?? "?"}`,
);
} catch {
// Not a report; nothing to log.
}
return c.body(null, 204);
});
/* Refuse a form-style write (text/plain, form or multipart body)
that another site sent, including a sibling subdomain, which
SameSite=Lax cookies don't stop. Browsers mark their own requests

View file

@ -0,0 +1,11 @@
-- ═══════════════════════════════════════════════════════════════
-- 039 PRIVACY CONTACT
--
-- The address the Privacy page gives for privacy questions and data
-- requests (Panel → Site settings). Null falls back to site.json's
-- privacyEmail; blank in both, the page points to its request form
-- only. Data requests themselves are feedback rows of type
-- 'privacy' (routes/feedback.js), triaged in Admin → Feedback.
-- ═══════════════════════════════════════════════════════════════
ALTER TABLE site_settings ADD COLUMN privacy_email TEXT;

View file

@ -0,0 +1,12 @@
-- ═══════════════════════════════════════════════════════════════
-- 040 NO MORE CARD GRADIENTS
--
-- An event card is its photo (card_image) under a light veil, or a
-- plain card, always with the event's colour as its border. The
-- gradient layer went over the photo and hid it, and gradients are
-- leaving the design, so the column goes. Any gradient saved on an
-- event is dropped with it; the card falls back to its photo or the
-- plain surface.
-- ═══════════════════════════════════════════════════════════════
ALTER TABLE events DROP COLUMN gradient;

View file

@ -102,12 +102,13 @@ export function siteFor(db) {
...base.robots,
index: row.indexing ? row.indexing === "on" : base.robots?.index !== false,
},
privacyEmail: row.privacy_email || base.privacyEmail || "",
pages,
};
}
/* What the browser app reads for headings and titles. */
const forBrowser = (site) => ({ title: site.title, pages: site.pages });
const forBrowser = (site) => ({ title: site.title, pages: site.pages, privacyEmail: site.privacyEmail });
/* robots.txt for this database's setting, as the build writes it. */
export function robotsTxt(site) {

View file

@ -147,7 +147,6 @@ function shapeEvent(row, links, cardBlocks, hosts = []) {
org_logo: row.effective_org_logo,
event_logo: row.event_logo,
color: row.effective_color,
gradient: row.gradient,
card_image: row.card_image,
hosts: hosts.map(shapeHost),

View file

@ -29,10 +29,10 @@ const LIMITS = {
const MIN_MESSAGE = 10;
// Must match FEEDBACK_TYPES in src/pages/sections/FeedbackForm.jsx.
// Must match FEEDBACK_TYPES and DATA_REQUEST in src/data/feedbackTypes.ts.
// Anything else falls back to 'general' rather than being rejected,
// a renamed option shouldn't lose someone's submission.
const TYPES = ["broken", "confusing", "outdated", "request", "praise", "other"];
const TYPES = ["broken", "confusing", "outdated", "request", "praise", "other", "privacy"];
/* ── Input cleaning ──────────────────────────────────────────── */
@ -76,6 +76,10 @@ feedback.post("/", async (c) => {
const errors = {};
if (message.length < MIN_MESSAGE) errors.message = "Please write a little more.";
if (!looksLikeEmail(email)) errors.email = "That email doesn't look right.";
// A data request (Privacy page) has to be answerable.
else if (feedbackType === "privacy" && !email) {
errors.email = "We need an email address to reply to a data request.";
}
if (Object.keys(errors).length > 0) {
return c.json({ error: "Validation failed", fields: errors }, 422);

View file

@ -352,7 +352,6 @@ tx(db, () => {
org_logo: IMAGE,
event_logo: IMAGE,
color: "#d62976",
gradient: "linear-gradient(160deg, rgba(214,41,118,0.10), rgba(19,139,160,0.10))",
card_image: IMAGE,
is_published: 1,
is_listed: LISTED,

View file

@ -2,6 +2,7 @@
"title": "Next Generation of Unity",
"url": "https://nextgenerationofunity.org",
"description": "",
"privacyEmail": "",
"robots": {
"index": true
},

View file

@ -33,13 +33,14 @@
visible even if the renderer hasn't caught up with it.
═══════════════════════════════════════════════════════════════ */
import { blockMedia } from '../lib/media.ts'
import { mediaUrl } from '../lib/media.ts'
import type { ContentBlock } from '../lib/useContent.ts'
import { Anchor, Inline, Paragraphs } from './InlineText.tsx'
import VideoPlayer from './VideoPlayer.tsx'
import ScheduleBlock from './ScheduleBlock.tsx'
import { accentText } from '../lib/color.ts'
const BODY = '#4a6b72'
const BODY = 'var(--color-muted)'
export default function ContentBlocks({
blocks,
@ -76,14 +77,14 @@ function Block({ block, accent }: { block: ContentBlock; accent: string }) {
switch (block.type) {
case 'heading':
return (
<h3 className="text-2xl font-bold" style={{ color: accent }}>
<h3 className="text-2xl font-bold" style={{ color: accentText(accent) }}>
{text}
</h3>
)
case 'subheading':
return (
<h4 className="text-lg font-semibold" style={{ color: accent }}>
<h4 className="text-lg font-semibold" style={{ color: accentText(accent) }}>
{text}
</h4>
)
@ -93,12 +94,12 @@ function Block({ block, accent }: { block: ContentBlock; accent: string }) {
<ul className="space-y-2">
{(block.items ?? []).map((item, index) => (
<li key={index} className="flex gap-3">
<span aria-hidden="true" style={{ color: accent }}>
<span aria-hidden="true" style={{ color: accentText(accent) }}>
•
</span>
<span style={{ color: BODY }}>
{item.url ? (
<Anchor href={item.url} className="underline" style={{ color: accent }}>
<Anchor href={item.url} className="underline" style={{ color: accentText(accent) }}>
{item.text}
</Anchor>
) : (
@ -120,8 +121,8 @@ function Block({ block, accent }: { block: ContentBlock; accent: string }) {
<Anchor
key={index}
href={item.url as string}
className="rounded-full border px-4 py-1.5 text-sm font-medium transition-colors hover:bg-[#eef9fb]"
style={{ borderColor: accent, color: accent }}
className="rounded-full border px-4 py-1.5 text-sm font-medium transition-colors hover:bg-tint"
style={{ borderColor: accent, color: accentText(accent) }}
>
{item.text}
</Anchor>
@ -150,7 +151,7 @@ function Block({ block, accent }: { block: ContentBlock; accent: string }) {
<Inline text={text} accent={accent} />
</blockquote>
{block.cite && (
<figcaption className="mt-2 text-sm font-semibold not-italic" style={{ color: accent }}>
<figcaption className="mt-2 text-sm font-semibold not-italic" style={{ color: accentText(accent) }}>
{block.cite}
</figcaption>
)}
@ -162,14 +163,14 @@ function Block({ block, accent }: { block: ContentBlock; accent: string }) {
return (
<aside
className="space-y-3 rounded-2xl border-l-4 px-6 py-5 leading-relaxed"
style={{ borderColor: accent, background: `color-mix(in srgb, ${accent} 8%, white)`, color: '#26454c' }}
style={{ borderColor: accent, background: `color-mix(in srgb, ${accent} 8%, var(--color-surface))`, color: 'var(--color-body)' }}
>
<Paragraphs text={text} accent={accent} />
</aside>
)
case 'image': {
const src = blockMedia(block.media)
const src = mediaUrl(block.media)
if (!src) return null
const img = (
<img
@ -195,7 +196,7 @@ function Block({ block, accent }: { block: ContentBlock; accent: string }) {
return (
<figure>
<div className="overflow-hidden rounded-lg">
<VideoPlayer url={block.href} still={blockMedia(block.media)} title={text || null} />
<VideoPlayer url={block.href} still={mediaUrl(block.media)} title={text || null} />
</div>
<Caption text={text} />
</figure>
@ -213,7 +214,7 @@ function Block({ block, accent }: { block: ContentBlock; accent: string }) {
if (!text) return null
return block.href ? (
<p className="leading-relaxed" style={{ color: BODY }}>
<Anchor href={block.href} className="underline" style={{ color: accent }}>
<Anchor href={block.href} className="underline" style={{ color: accentText(accent) }}>
{text}
</Anchor>
</p>

View file

@ -23,7 +23,7 @@ import { useState } from 'react'
import HomeLink from '../pages/sections/home/HomeLink.tsx'
import VideoPlayer from './VideoPlayer.tsx'
import { refHref } from '../lib/hrefs.ts'
import { logoForKind } from '../lib/media.ts'
import { mediaUrl } from '../lib/media.ts'
import type { FeaturedCard } from '../lib/useFrontPage.ts'
/* Image kinds that are photographs, drawn edge to edge. Anything
@ -39,11 +39,11 @@ function hrefFor(card: FeaturedCard): string | null {
function Picture({ card }: { card: FeaturedCard }) {
const [failed, setFailed] = useState(false)
const src = card.image ? logoForKind(card.image.kind, card.image.file) : null
const src = card.image ? mediaUrl(card.image.file) : null
const photo = card.image ? PHOTO_KINDS.has(card.image.kind) : false
if (!src || failed) {
return <div className="aspect-video w-full bg-gradient-to-br from-[#eef9fb] to-[#d9f0f3]" />
return <div className="aspect-video w-full bg-tint" />
}
return photo ? (
@ -55,7 +55,7 @@ function Picture({ card }: { card: FeaturedCard }) {
className="aspect-video w-full object-cover"
/>
) : (
<div className="flex aspect-video w-full items-center justify-center bg-[#eef9fb] p-8">
<div className="flex aspect-video w-full items-center justify-center bg-tint p-8">
<img
src={src}
alt=""
@ -68,7 +68,7 @@ function Picture({ card }: { card: FeaturedCard }) {
}
function VideoPicture({ card }: { card: FeaturedCard }) {
const own = card.image ? logoForKind(card.image.kind, card.image.file) : null
const own = card.image ? mediaUrl(card.image.file) : null
return <VideoPlayer url={card.url} still={own} title={card.title} />
}
@ -78,10 +78,10 @@ function Card({ card }: { card: FeaturedCard }) {
const text = (
<div className="flex flex-1 flex-col p-6">
{card.eyebrow && (
<p className="text-xs font-bold uppercase tracking-[0.2em] text-[#0f7183]">{card.eyebrow}</p>
<p className="text-xs font-bold uppercase tracking-[0.2em] text-link">{card.eyebrow}</p>
)}
{card.title && (
<h3 className="mt-2 font-display text-xl font-extrabold leading-snug text-[#073d4a]">
<h3 className="mt-2 font-display text-xl font-extrabold leading-snug text-ink">
{href ? (
// Stretched over the whole card, so the picture and the
// blurb are part of the click without nesting links.
@ -96,12 +96,12 @@ function Card({ card }: { card: FeaturedCard }) {
)}
</h3>
)}
{card.blurb && <p className="mt-2 leading-relaxed text-[#4a6b72]">{card.blurb}</p>}
{card.blurb && <p className="mt-2 leading-relaxed text-muted">{card.blurb}</p>}
</div>
)
return (
<li className="relative flex flex-col overflow-hidden rounded-2xl border border-[#138ba0]/15 bg-white shadow-sm transition-shadow hover:shadow-lg">
<li className="relative flex flex-col overflow-hidden rounded-2xl border border-brand/15 bg-surface shadow-sm transition-shadow hover:shadow-lg">
{card.kind === 'video' ? (
// Above the stretched link, which a video card doesn't have
// anyway, so the play button always gets the click.

View file

@ -20,6 +20,7 @@
import { Fragment, type CSSProperties, type ReactNode } from 'react'
import { Link } from 'react-router-dom'
import { accentText } from '../lib/color.ts'
const TOKEN = /\*\*(.+?)\*\*|\*(.+?)\*|\[([^\]]+)\]\(([^)\s]+)\)/g
const SAFE_URL = /^(\/(?!\/)|#|https?:\/\/|mailto:|tel:)/i
@ -88,7 +89,7 @@ function line(text: string, accent: string, key: string): ReactNode[] {
else if (italic != null) out.push(<em key={k}>{italic}</em>)
else if (label != null && SAFE_URL.test(url)) {
out.push(
<Anchor key={k} href={url} className="underline underline-offset-2" style={{ color: accent }}>
<Anchor key={k} href={url} className="underline underline-offset-2" style={{ color: accentText(accent) }}>
{label}
</Anchor>,
)

View file

@ -4,6 +4,9 @@ import { PAGE_LINKS, PAGE_SECTIONS, NAV_ACTIONS } from "../navConfig.ts";
import Banner from "./Banner.tsx";
import nguLogo from "../assets/logos/NGU_Logo.svg";
import Footer from "./Footer.tsx";
import PrivacyNotice from "./PrivacyNotice.tsx";
import ThemeToggle from "./ThemeToggle.tsx";
import { scrollBehavior } from "../lib/motion.ts";
/* ── Right-side nav actions ──────────────────────────────── */
@ -115,7 +118,7 @@ export default function Layout() {
if (location.hash) {
const el = document.querySelector(location.hash);
if (el) {
el.scrollIntoView({ behavior: "smooth" });
el.scrollIntoView({ behavior: scrollBehavior() });
return;
}
}
@ -153,7 +156,7 @@ export default function Layout() {
<div className="min-h-screen overflow-x-hidden">
<a
href="#main"
className="sr-only focus:not-sr-only focus:fixed focus:top-2 focus:left-2 focus:z-[70] focus:rounded-full focus:bg-white focus:px-4 focus:py-2 focus:font-semibold focus:text-[#073d4a]"
className="sr-only focus:not-sr-only focus:fixed focus:top-2 focus:left-2 focus:z-[70] focus:rounded-full focus:bg-surface focus:px-4 focus:py-2 focus:font-semibold focus:text-ink"
>
Skip to content
</a>
@ -206,6 +209,8 @@ export default function Layout() {
))}
</div>
<ThemeToggle className="text-white/80 hover:bg-white/10 hover:text-white" />
<button
className="md:hidden text-white p-2"
aria-label="Open menu"
@ -269,6 +274,7 @@ export default function Layout() {
{/*Site Footer applied to every page*/}
<div inert={mobileMenuOpen}>
<Footer />
<PrivacyNotice />
</div>
{/* Mobile menu */}

View file

@ -0,0 +1,46 @@
/* ═══════════════════════════════════════════════════════════════
LEGAL TEXT
The Privacy and Terms pages: a list of headed parts, each a few
paragraphs or a bullet list, in a readable column. The words live
in the page files; this only lays them out the same way.
═══════════════════════════════════════════════════════════════ */
import type { ReactNode } from 'react'
export type LegalPart = {
/** Anchor for linking to one part, eg. 'cookies'. */
id: string
heading: string
body: ReactNode[]
list?: ReactNode[]
/** After the list. */
after?: ReactNode[]
}
export default function LegalText({ parts }: { parts: LegalPart[] }) {
return (
<div className="mx-auto max-w-3xl space-y-10 px-6 leading-relaxed text-body">
{parts.map((part) => (
<section key={part.id} id={part.id} style={{ scrollMarginTop: '6rem' }}>
<h3 className="text-xl font-bold text-ink">{part.heading}</h3>
<div className="mt-3 space-y-3">
{part.body.map((paragraph, i) => (
<p key={i}>{paragraph}</p>
))}
{part.list && (
<ul className="list-disc space-y-2 pl-6">
{part.list.map((item, i) => (
<li key={i}>{item}</li>
))}
</ul>
)}
{part.after?.map((paragraph, i) => (
<p key={i}>{paragraph}</p>
))}
</div>
</section>
))}
</div>
)
}

27
src/components/Logo.tsx Normal file
View file

@ -0,0 +1,27 @@
/* ═══════════════════════════════════════════════════════════════
LOGO
An <img> for a logo or mark that may not exist: no src, or a file
that 404s, and it draws `fallback` instead (initials, a colour dot,
or nothing). `src` is already resolved (mediaUrl in media.ts).
Decorative by default (alt ""), since a logo sits next to the
name it stands for.
═══════════════════════════════════════════════════════════════ */
import { useState, type ReactNode } from 'react'
export default function Logo({
src,
alt = '',
className,
fallback = null,
}: {
src?: string | null
alt?: string
className?: string
fallback?: ReactNode
}) {
const [failed, setFailed] = useState(false)
if (!src || failed) return <>{fallback}</>
return <img src={src} alt={alt} loading="lazy" className={className} onError={() => setFailed(true)} />
}

View file

@ -21,7 +21,7 @@
title: "Local Chapters",
blurb: "Optional line under the section heading.",
accent: "#0f7183", // heading, banner, rule
background: "#eef9fb",
background: "var(--color-tint)",
actions: <SomeButton />, // optional, right of the heading
content: <YourStuff />,
},
@ -32,6 +32,7 @@
import { useEffect, type ReactNode } from "react";
import { documentTitle } from "../lib/site.ts";
import { accentText } from '../lib/color.ts'
const TEAL = "#0f7183";
@ -75,10 +76,10 @@ export function Section({ section }: { section: ShellSection }) {
<div className="max-w-6xl mx-auto px-6 mb-10">
<div className="flex flex-wrap items-end justify-between gap-4">
<div>
<h2 className="text-4xl md:text-5xl font-extrabold" style={{ color: accent }}>
<h2 className="text-4xl md:text-5xl font-extrabold" style={{ color: accentText(accent) }}>
{title}
</h2>
{blurb && <p className="mt-2 text-[#4a6b72] max-w-xl">{blurb}</p>}
{blurb && <p className="mt-2 text-muted max-w-xl">{blurb}</p>}
</div>
{actions}
</div>
@ -101,12 +102,12 @@ export default function PageShell({ title, intro, sections }: PageShellProps) {
return (
<>
{/* Page header */}
<div className="pt-24 pb-12 px-6" style={{ background: "#eef9fb" }}>
<div className="pt-24 pb-12 px-6" style={{ background: "var(--color-tint)" }}>
<div className="max-w-6xl mx-auto">
<h1 className="text-5xl md:text-6xl font-extrabold" style={{ color: TEAL }}>
<h1 className="text-5xl md:text-6xl font-extrabold" style={{ color: accentText(TEAL) }}>
{title}
</h1>
{intro && <p className="mt-3 text-lg text-[#4a6b72] max-w-2xl">{intro}</p>}
{intro && <p className="mt-3 text-lg text-muted max-w-2xl">{intro}</p>}
</div>
</div>

View file

@ -16,9 +16,10 @@
import { Link } from 'react-router-dom'
import PageShell from './PageShell.tsx'
import { accentText } from '../lib/color.ts'
const TEAL = '#0f7183'
const BODY = '#4a6b72'
const BODY = 'var(--color-muted)'
export default function PageState({
loading,
@ -51,8 +52,8 @@ export default function PageState({
</p>
<Link
to={backTo}
className="mt-4 inline-block rounded-full border px-4 py-1.5 text-sm font-medium transition-colors hover:bg-[#eef9fb]"
style={{ borderColor: TEAL, color: TEAL }}
className="mt-4 inline-block rounded-full border px-4 py-1.5 text-sm font-medium transition-colors hover:bg-tint"
style={{ borderColor: TEAL, color: accentText(TEAL) }}
>
{backLabel}
</Link>
@ -66,8 +67,8 @@ export default function PageState({
<button
type="button"
onClick={onRetry}
className="mt-3 rounded-full border px-4 py-1.5 text-sm font-medium transition-colors hover:bg-[#eef9fb]"
style={{ borderColor: TEAL, color: TEAL }}
className="mt-3 rounded-full border px-4 py-1.5 text-sm font-medium transition-colors hover:bg-tint"
style={{ borderColor: TEAL, color: accentText(TEAL) }}
>
Try again
</button>
@ -85,7 +86,7 @@ export default function PageState({
return (
<PageShell
title={title}
sections={[{ id: 'status', title: '', accent: TEAL, background: '#ffffff', content }]}
sections={[{ id: 'status', title: '', accent: TEAL, background: 'var(--color-surface)', content }]}
/>
)
}

View file

@ -14,11 +14,11 @@
/* color */
--pl-accent: #0f7183;
--pl-frame-bg: #fff;
--pl-frame-bg: var(--color-surface);
--pl-frame-edge: rgba(15, 23, 42, 0.1);
--pl-photo-bg: #e7edef;
--pl-ink: #16262b;
--pl-muted: #4a6b72;
--pl-photo-bg: color-mix(in srgb, var(--color-muted) 15%, var(--color-surface));
--pl-ink: var(--color-ink);
--pl-muted: var(--color-muted);
--pl-rule: rgba(45, 200, 224, 0.3);
--pl-shadow: 0 1px 1px rgba(15, 23, 42, 0.06), 0 10px 18px -14px rgba(15, 23, 42, 0.5);
@ -249,7 +249,7 @@
padding: 1rem 1.1rem;
border-left: 3px solid var(--pl-accent);
border-radius: 6px;
background: color-mix(in srgb, var(--pl-accent) 7%, #fff);
background: color-mix(in srgb, var(--pl-accent) 7%, var(--color-surface));
max-width: 68ch;
}
@ -278,7 +278,7 @@
height: 1.75rem;
border: 1px solid var(--pl-frame-edge);
border-radius: 999px;
background: #fff;
background: var(--color-surface);
color: var(--pl-muted);
font-size: 1.1rem;
line-height: 1;
@ -309,7 +309,7 @@
}
.pl__fact a {
color: var(--pl-accent);
color: color-mix(in srgb, var(--pl-accent) var(--accent-text-mix), #fff);
text-decoration: underline;
text-underline-offset: 2px;
}
@ -326,7 +326,7 @@
margin-top: 0.75rem;
font-size: 0.9375rem;
font-weight: 600;
color: var(--pl-accent);
color: color-mix(in srgb, var(--pl-accent) var(--accent-text-mix), #fff);
text-decoration: none;
}

View file

@ -12,7 +12,7 @@ import { Link } from "react-router-dom";
import { get } from "../lib/api.ts";
import { isBadId, personHref } from "../lib/hrefs.ts";
import { initials, personPhoto } from "../lib/media.ts";
import { mediaUrl, initials } from "../lib/media.ts";
import "./PeopleTiles.css";
/**
@ -548,7 +548,7 @@ function Tile({
const content = (
<span className="pl__frame">
<span className="pl__photo">
<Photo src={personPhoto(person.photo)} name={person.name} />
<Photo src={mediaUrl(person.photo)} name={person.name} />
</span>
<span className="pl__caption">
<span className="pl__name">{person.name}</span>

View file

@ -0,0 +1,63 @@
/* ═══════════════════════════════════════════════════════════════
PRIVACY NOTICE
A small note on a first visit, until closed: the site sets no
tracking cookies, and videos and maps from other companies wait
for a click (VideoPlayer, HeroStage, ScheduleBlock). Because
nothing loads before that, a notice is enough, rather than a
consent banner that blocks the page. If an embed ever loads on
its own, or analytics are added, this has to become a real
consent choice.
Closed is remembered in this browser; blocked storage just
means it shows again next time.
═══════════════════════════════════════════════════════════════ */
import { useEffect, useState } from 'react'
import { Link } from 'react-router-dom'
const STORAGE_KEY = 'ngu-privacy-notice-closed'
export default function PrivacyNotice() {
const [visible, setVisible] = useState(false)
useEffect(() => {
try {
if (!localStorage.getItem(STORAGE_KEY)) setVisible(true)
} catch {
setVisible(true)
}
}, [])
const close = () => {
setVisible(false)
try {
localStorage.setItem(STORAGE_KEY, '1')
} catch {}
}
if (!visible) return null
return (
<div
role="region"
aria-label="Privacy notice"
className="fixed bottom-4 left-4 right-4 z-40 mx-auto max-w-md rounded-2xl border border-brand/20 bg-surface p-4 text-sm text-body shadow-xl sm:right-auto"
>
<p>
No tracking cookies here. Videos and maps come from YouTube, Facebook or Google only when you press
play or show them, and those services may set their own cookies then.{' '}
<Link to="/privacy#cookies" className="font-semibold text-link underline underline-offset-2">
Privacy Policy
</Link>
</p>
<button
type="button"
onClick={close}
className="mt-3 rounded-full bg-action px-4 py-1.5 font-semibold text-white hover:bg-action-hover"
>
Got it
</button>
</div>
)
}

View file

@ -24,11 +24,12 @@ import { useId, useState, type KeyboardEvent } from 'react'
import { Link } from 'react-router-dom'
import { personHref } from '../lib/hrefs.ts'
import { blockMedia, initials, personPhoto } from '../lib/media.ts'
import { mediaUrl, initials } from '../lib/media.ts'
import type { ContentBlockItem } from '../lib/useContent.ts'
import { Anchor, Paragraphs } from './InlineText.tsx'
import { withAlpha, accentText, readableOn } from '../lib/color.ts'
const BODY = '#4a6b72'
const BODY = 'var(--color-muted)'
const WEEKDAYS = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday']
type Day = { name: string; entries: ContentBlockItem[] }
@ -65,13 +66,13 @@ const mapLink = (place: string) =>
function Avatar({ person, size }: { person: NonNullable<ContentBlockItem['person']>; size: string }) {
const [failed, setFailed] = useState(false)
const src = personPhoto(person.photo)
const src = mediaUrl(person.photo)
return src && !failed ? (
<img src={src} alt="" onError={() => setFailed(true)} className={`${size} shrink-0 rounded-full object-cover`} />
) : (
<span
aria-hidden="true"
className={`${size} flex shrink-0 items-center justify-center rounded-full bg-[#eef9fb] text-xs font-bold text-[#0f7183]`}
className={`${size} flex shrink-0 items-center justify-center rounded-full bg-tint text-xs font-bold text-link`}
>
{initials(person.name)}
</span>
@ -80,13 +81,15 @@ function Avatar({ person, size }: { person: NonNullable<ContentBlockItem['person
function Entry({ entry, accent }: { entry: ContentBlockItem; accent: string }) {
const [open, setOpen] = useState(false)
// Google's map loads only when asked for (Privacy page).
const [showMap, setShowMap] = useState(false)
const panelId = useId()
const graphic = blockMedia(entry.media)
const graphic = mediaUrl(entry.media)
const place = entry.map?.trim()
const more = Boolean(entry.description || graphic || place || entry.person)
const title = entry.url ? (
<Anchor href={entry.url} className="underline-offset-2 hover:underline" style={{ color: accent }}>
<Anchor href={entry.url} className="underline-offset-2 hover:underline" style={{ color: accentText(accent) }}>
{entry.text}
</Anchor>
) : (
@ -94,14 +97,14 @@ function Entry({ entry, accent }: { entry: ContentBlockItem; accent: string }) {
)
return (
<li className="border-b border-[#138ba0]/10 last:border-b-0">
<li className="border-b border-brand/10 last:border-b-0">
<div className="flex gap-4 py-4 sm:gap-6">
<p className="w-24 shrink-0 pt-0.5 text-sm font-semibold sm:w-32" style={{ color: accent }}>
<p className="w-24 shrink-0 pt-0.5 text-sm font-semibold sm:w-32" style={{ color: accentText(accent) }}>
{entry.time}
</p>
<div className="min-w-0 flex-1">
<p className="font-semibold text-[#26454c]">{title}</p>
<p className="font-semibold text-body">{title}</p>
{(entry.location || entry.person) && (
<p className="mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 text-sm" style={{ color: BODY }}>
{entry.location && <span>{entry.location}</span>}
@ -127,8 +130,8 @@ function Entry({ entry, accent }: { entry: ContentBlockItem; accent: string }) {
aria-expanded={open}
aria-controls={panelId}
aria-label={open ? `Less about ${entry.text}` : `More about ${entry.text}`}
className="h-8 w-8 shrink-0 rounded-full border text-sm transition-colors hover:bg-[#eef9fb]"
style={{ borderColor: `${accent}55`, color: accent }}
className="h-8 w-8 shrink-0 rounded-full border text-sm transition-colors hover:bg-tint"
style={{ borderColor: `${withAlpha(accent, 33)}`, color: accentText(accent) }}
>
<span aria-hidden="true" className={`inline-block transition-transform ${open ? 'rotate-180' : ''}`}>
▾
@ -138,7 +141,7 @@ function Entry({ entry, accent }: { entry: ContentBlockItem; accent: string }) {
</div>
{more && open && (
<div id={panelId} className="mb-5 space-y-5 rounded-2xl bg-[#f6fbfc] p-5 sm:ml-38">
<div id={panelId} className="mb-5 space-y-5 rounded-2xl bg-tint-soft p-5 sm:ml-38">
{entry.person && (
<div className="flex items-center gap-4">
<Avatar person={entry.person} size="h-16 w-16" />
@ -146,7 +149,7 @@ function Entry({ entry, accent }: { entry: ContentBlockItem; accent: string }) {
<Link
to={personHref(entry.person.id)}
className="font-semibold hover:underline"
style={{ color: accent }}
style={{ color: accentText(accent) }}
>
{entry.person.name}
</Link>
@ -169,19 +172,31 @@ function Entry({ entry, accent }: { entry: ContentBlockItem; accent: string }) {
{place && (
<div>
<iframe
src={mapEmbed(place)}
title={`Map: ${place}`}
loading="lazy"
referrerPolicy="no-referrer-when-downgrade"
className="aspect-video w-full rounded-lg border-0"
/>
{showMap ? (
<iframe
src={mapEmbed(place)}
title={`Map: ${place}`}
loading="lazy"
referrerPolicy="no-referrer-when-downgrade"
className="aspect-video w-full rounded-lg border-0"
/>
) : (
<button
type="button"
onClick={() => setShowMap(true)}
className="flex aspect-video w-full flex-col items-center justify-center gap-1 rounded-lg border border-dashed text-sm"
style={{ borderColor: `${withAlpha(accent, 33)}`, color: BODY }}
>
<span className="font-semibold">Show map</span>
<span className="text-xs">{place}, from Google Maps</span>
</button>
)}
<a
href={mapLink(place)}
target="_blank"
rel="noreferrer"
className="mt-2 inline-block text-sm underline"
style={{ color: accent }}
style={{ color: accentText(accent) }}
>
Open in Google Maps
</a>
@ -244,8 +259,8 @@ export default function ScheduleBlock({
className="rounded-full border px-5 py-2 text-sm font-semibold transition-colors"
style={
selected
? { background: accent, borderColor: accent, color: '#ffffff' }
: { borderColor: `${accent}55`, color: accent }
? { background: accent, borderColor: accent, color: readableOn(accent) }
: { borderColor: `${withAlpha(accent, 33)}`, color: accentText(accent) }
}
>
{day.name || 'Schedule'}
@ -259,7 +274,7 @@ export default function ScheduleBlock({
id={`${baseId}-panel`}
role={days.length > 1 ? 'tabpanel' : undefined}
aria-labelledby={days.length > 1 ? `${baseId}-tab-${days.indexOf(current)}` : undefined}
className="rounded-2xl border border-[#138ba0]/15 bg-white px-5"
className="rounded-2xl border border-brand/15 bg-surface px-5"
>
{current.entries.map((entry, index) => (
<Entry key={`${current.name}-${index}`} entry={entry} accent={accent} />

View file

@ -0,0 +1,79 @@
/* ═══════════════════════════════════════════════════════════════
THEME TOGGLE
Light or dark. The theme lives on <html data-theme>, which
index.html sets before the first paint (from this browser's
choice, else the system setting) so a dark visitor never sees a
white flash. Pressing this makes an explicit choice and remembers
it; until then the site follows the system, including a change
made while the page is open. Colours come from the tokens in
index.css.
═══════════════════════════════════════════════════════════════ */
import { useEffect, useState } from 'react'
type Theme = 'light' | 'dark'
export const THEME_STORAGE_KEY = 'ngu-theme'
const current = (): Theme =>
document.documentElement.dataset.theme === 'dark' ? 'dark' : 'light'
function chosen(): Theme | null {
try {
const value = localStorage.getItem(THEME_STORAGE_KEY)
return value === 'dark' || value === 'light' ? value : null
} catch {
return null
}
}
export default function ThemeToggle({ className = '' }: { className?: string }) {
const [theme, setTheme] = useState<Theme>(current)
// No choice made: follow the system as it changes.
useEffect(() => {
const media = window.matchMedia('(prefers-color-scheme: dark)')
const follow = () => {
if (chosen()) return
const next: Theme = media.matches ? 'dark' : 'light'
document.documentElement.dataset.theme = next
setTheme(next)
}
media.addEventListener('change', follow)
return () => media.removeEventListener('change', follow)
}, [])
const toggle = () => {
const next: Theme = theme === 'dark' ? 'light' : 'dark'
document.documentElement.dataset.theme = next
setTheme(next)
try {
localStorage.setItem(THEME_STORAGE_KEY, next)
} catch {}
}
const dark = theme === 'dark'
return (
<button
type="button"
onClick={toggle}
aria-label={dark ? 'Switch to light mode' : 'Switch to dark mode'}
title={dark ? 'Light mode' : 'Dark mode'}
className={`flex h-9 w-9 items-center justify-center rounded-full transition-colors ${className}`}
>
{dark ? (
// Sun
<svg viewBox="0 0 24 24" className="h-5 w-5" fill="none" stroke="currentColor" strokeWidth="2" aria-hidden="true">
<circle cx="12" cy="12" r="4" />
<path d="M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4" strokeLinecap="round" />
</svg>
) : (
// Moon
<svg viewBox="0 0 24 24" className="h-5 w-5" fill="none" stroke="currentColor" strokeWidth="2" aria-hidden="true">
<path d="M20 14.5A8 8 0 0 1 9.5 4a8 8 0 1 0 10.5 10.5z" strokeLinejoin="round" />
</svg>
)}
</button>
)
}

View file

@ -55,7 +55,7 @@ export default function VideoPlayer({
{image ? (
<img src={image} alt="" loading="lazy" className={`aspect-video w-full object-cover ${className}`} />
) : (
<div className={`aspect-video w-full bg-gradient-to-br from-[#073d4a] to-[#04262e] ${className}`} />
<div className={`aspect-video w-full bg-[#073d4a] ${className}`} />
)}
<span
aria-hidden="true"

View file

@ -49,8 +49,8 @@ export type MediaItem = {
};
const button =
"rounded-full border border-[#138ba0] px-3 py-1 text-sm font-medium text-[#0f7183] " +
"transition-colors hover:bg-[#eef9fb] disabled:cursor-default disabled:opacity-50";
"rounded-full border border-brand px-3 py-1 text-sm font-medium text-link " +
"transition-colors hover:bg-tint disabled:cursor-default disabled:opacity-50";
/* A light checkerboard, so a white logo on a transparent background
is still visible in its thumbnail. */
@ -166,18 +166,18 @@ export function UploadButton({
className="hidden"
onChange={(e) => send(e.target.files)}
/>
<label htmlFor={keepId} className="flex items-center gap-1.5 text-xs text-[#4a6b72]">
<label htmlFor={keepId} className="flex items-center gap-1.5 text-xs text-muted">
<input
id={keepId}
type="checkbox"
checked={keepOriginal}
onChange={(e) => setKeepOriginal(e.target.checked)}
className="h-3.5 w-3.5 rounded border-[#4a6b72]/40 text-[#0f7183]"
className="h-3.5 w-3.5 rounded border-muted/40 text-link"
/>
Keep original
</label>
</div>
{error && <p className="mt-1 text-xs text-[#b3261e]">{error}</p>}
{error && <p className="mt-1 text-xs text-danger">{error}</p>}
</div>
);
}
@ -200,7 +200,7 @@ export function MediaGrid({
renderActions?: (item: MediaItem) => ReactNode;
}) {
if (items.length === 0) {
return <p className="text-sm text-[#4a6b72]">Nothing here yet.</p>;
return <p className="text-sm text-muted">Nothing here yet.</p>;
}
return (
@ -214,7 +214,7 @@ export function MediaGrid({
// A still of the first frame; metadata only, not the file.
<video src={item.url} preload="metadata" muted className="h-full w-full bg-black object-contain" />
) : item.content_type.startsWith("audio/") ? (
<div className="flex h-full w-full items-center justify-center bg-[#eef9fb] text-3xl" aria-hidden="true">
<div className="flex h-full w-full items-center justify-center bg-tint text-3xl" aria-hidden="true">
♪
</div>
) : (
@ -226,18 +226,18 @@ export function MediaGrid({
/>
)}
</div>
<p className="mt-1.5 truncate text-xs font-medium text-[#26454c]" title={item.original_name}>
<p className="mt-1.5 truncate text-xs font-medium text-body" title={item.original_name}>
{item.original_name}
</p>
<p className="text-xs text-[#4a6b72]/80">{mediaSize(item)}</p>
<p className="text-xs text-muted/80">{mediaSize(item)}</p>
</>
);
return (
<li
key={item.id}
className={`rounded-xl border bg-white p-2 ${
isSelected ? "border-[#138ba0] ring-2 ring-[#138ba0]/30" : "border-[#4a6b72]/20"
className={`rounded-xl border bg-surface p-2 ${
isSelected ? "border-brand ring-2 ring-brand/30" : "border-muted/20"
}`}
>
{onPick ? (
@ -292,27 +292,27 @@ export function MediaPicker({
className="w-[min(56rem,calc(100vw-2rem))] rounded-2xl p-0 backdrop:bg-[#0f2f36]/40"
>
<div className="flex max-h-[85vh] flex-col">
<div className="flex flex-wrap items-center gap-3 border-b border-[#138ba0]/15 px-5 py-4">
<h2 className="text-lg font-semibold text-[#0f7183]">Choose an image</h2>
<div className="flex flex-wrap items-center gap-3 border-b border-brand/15 px-5 py-4">
<h2 className="text-lg font-semibold text-link">Choose an image</h2>
<input
type="search"
value={query}
onChange={(e) => setQuery(e.target.value)}
placeholder="Search by file name"
className="ml-auto w-56 rounded-lg border border-[#4a6b72]/25 px-3 py-1.5 text-sm outline-none focus:border-[#138ba0]"
className="ml-auto w-56 rounded-lg border border-muted/25 px-3 py-1.5 text-sm outline-none focus:border-brand"
/>
<button
type="button"
onClick={() => dialogRef.current?.close()}
aria-label="Close"
className="h-8 w-8 rounded-full text-[#4a6b72] hover:bg-[#eef9fb]"
className="h-8 w-8 rounded-full text-muted hover:bg-tint"
>
✕
</button>
</div>
{roleCanWrite(user) && (
<div className="border-b border-[#138ba0]/10 px-5 py-3">
<div className="border-b border-brand/10 px-5 py-3">
<UploadButton
label="Upload new"
onUploaded={(item) => {
@ -321,15 +321,15 @@ export function MediaPicker({
dialogRef.current?.close();
}}
/>
<p className="mt-1 text-xs text-[#4a6b72]">{UPLOAD_HELP}</p>
<p className="mt-1 text-xs text-muted">{UPLOAD_HELP}</p>
</div>
)}
<div className="overflow-y-auto px-5 py-4">
{error ? (
<p className="text-sm text-[#b3261e]">{error}</p>
<p className="text-sm text-danger">{error}</p>
) : items === null ? (
<p className="text-sm text-[#4a6b72]">Loading…</p>
<p className="text-sm text-muted">Loading…</p>
) : (
<MediaGrid
items={items}
@ -375,13 +375,13 @@ export function ImageInput({
return (
<div className="flex gap-3">
<div
className="flex h-20 w-20 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-[#4a6b72]/20"
className="flex h-20 w-20 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-muted/20"
style={CHECKER}
>
{src && !broken ? (
<img src={src} alt="" className="h-full w-full object-contain" onError={() => setBroken(true)} />
) : (
<span className="px-1 text-center text-[10px] text-[#4a6b72]/70">
<span className="px-1 text-center text-[10px] text-muted/70">
{src ? "Not found" : "No image"}
</span>
)}
@ -406,7 +406,7 @@ export function ImageInput({
<button
type="button"
onClick={() => onChange("")}
className="px-2 py-1 text-sm text-[#4a6b72] hover:text-[#b3261e]"
className="px-2 py-1 text-sm text-muted hover:text-danger"
>
Clear
</button>
@ -498,7 +498,7 @@ export function LinkPreviewInput({
{busy ? "Fetching…" : "Fetch preview"}
</button>
{note && (
<span className={`text-xs ${note.tone === "ok" ? "text-[#0f7183]" : "text-[#b3261e]"}`}>
<span className={`text-xs ${note.tone === "ok" ? "text-link" : "text-danger"}`}>
{note.text}
</span>
)}

View file

@ -16,6 +16,7 @@
═══════════════════════════════════════════════════════════════ */
import { useEffect, useState } from "react";
import { scrollBehavior } from "../../lib/motion.ts";
export type EditorSection = {
id: string;
@ -63,7 +64,7 @@ function useActiveSection(sections: EditorSection[]) {
}
function jump(id: string) {
document.getElementById(id)?.scrollIntoView({ behavior: "smooth", block: "start" });
document.getElementById(id)?.scrollIntoView({ behavior: scrollBehavior(), block: "start" });
}
function Label({ section }: { section: EditorSection }) {
@ -71,10 +72,10 @@ function Label({ section }: { section: EditorSection }) {
<>
<span className="truncate">{section.label}</span>
{section.count != null && (
<span className="text-xs text-[#4a6b72]/70">({section.count})</span>
<span className="text-xs text-muted/70">({section.count})</span>
)}
{section.hasError && (
<span aria-label="needs attention" className="h-1.5 w-1.5 shrink-0 rounded-full bg-[#b3261e]" />
<span aria-label="needs attention" className="h-1.5 w-1.5 shrink-0 rounded-full bg-danger" />
)}
</>
);
@ -87,10 +88,10 @@ export function SectionNav({ sections }: { sections: EditorSection[] }) {
return (
<nav aria-label="Sections" className="hidden max-h-[calc(100vh-8rem)] overflow-y-auto lg:block">
<p className="mb-2 px-3 text-xs font-semibold uppercase tracking-wider text-[#4a6b72]/70">
<p className="mb-2 px-3 text-xs font-semibold uppercase tracking-wider text-muted/70">
On this page
</p>
<ul className="space-y-0.5 border-l border-[#138ba0]/15">
<ul className="space-y-0.5 border-l border-brand/15">
{sections.map((section) => {
const lit = section.id === active;
return (
@ -101,8 +102,8 @@ export function SectionNav({ sections }: { sections: EditorSection[] }) {
aria-current={lit ? "location" : undefined}
className={`-ml-px flex w-full items-center gap-1.5 border-l-2 px-3 py-1.5 text-left text-sm transition-colors ${
lit
? "border-[#138ba0] font-semibold text-[#0f7183]"
: "border-transparent text-[#4a6b72] hover:border-[#138ba0]/40 hover:text-[#0f7183]"
? "border-brand font-semibold text-link"
: "border-transparent text-muted hover:border-brand/40 hover:text-link"
}`}
>
<Label section={section} />
@ -120,13 +121,13 @@ export function SectionJump({ sections }: { sections: EditorSection[] }) {
const active = useActiveSection(sections);
return (
<div className="sticky top-0 z-20 -mx-6 mt-4 mb-2 border-b border-[#138ba0]/15 bg-[#f6fbfc]/95 px-6 py-2 backdrop-blur lg:hidden">
<label className="flex items-center gap-3 text-sm text-[#4a6b72]">
<div className="sticky top-0 z-20 -mx-6 mt-4 mb-2 border-b border-brand/15 bg-tint-soft/95 px-6 py-2 backdrop-blur lg:hidden">
<label className="flex items-center gap-3 text-sm text-muted">
<span className="shrink-0">Jump to</span>
<select
value={active ?? ""}
onChange={(e) => jump(e.target.value)}
className="w-full rounded-lg border border-[#4a6b72]/25 bg-white px-3 py-1.5 text-sm text-[#26454c] outline-none focus:border-[#138ba0]"
className="w-full rounded-lg border border-muted/25 bg-surface px-3 py-1.5 text-sm text-body outline-none focus:border-brand"
>
{sections.map((section) => (
<option key={section.id} value={section.id}>

View file

@ -104,24 +104,24 @@ const PREVIEWS = {
};
const input =
"w-full rounded-lg border border-[#4a6b72]/25 bg-white px-3 py-2 text-sm text-[#26454c] " +
"outline-none transition-colors focus:border-[#138ba0] focus:ring-2 focus:ring-[#138ba0]/25";
"w-full rounded-lg border border-muted/25 bg-surface px-3 py-2 text-sm text-body " +
"outline-none transition-colors focus:border-brand focus:ring-2 focus:ring-brand/25";
/* Same box, but lit by the real input nested inside it. */
const inputShell =
"flex w-full items-center rounded-lg border border-[#4a6b72]/25 bg-white px-3 py-2 text-sm " +
"text-[#26454c] transition-colors focus-within:border-[#138ba0] focus-within:ring-2 " +
"focus-within:ring-[#138ba0]/25";
"flex w-full items-center rounded-lg border border-muted/25 bg-surface px-3 py-2 text-sm " +
"text-body transition-colors focus-within:border-brand focus-within:ring-2 " +
"focus-within:ring-brand/25";
const inputError = "border-[#b3261e] focus:border-[#b3261e] focus:ring-[#b3261e]/20";
const inputError = "border-danger focus:border-danger focus:ring-danger/20";
const shellError =
"border-[#b3261e] focus-within:border-[#b3261e] focus-within:ring-[#b3261e]/20";
"border-danger focus-within:border-danger focus-within:ring-danger/20";
/* Reads as settled fact rather than as an empty box someone forgot
to fill in. */
const inputLocked =
"w-full rounded-lg border border-[#4a6b72]/20 bg-[#f6fbfc] px-3 py-2 text-sm " +
"text-[#4a6b72] outline-none cursor-default focus:border-[#4a6b72]/40";
"w-full rounded-lg border border-muted/20 bg-tint-soft px-3 py-2 text-sm " +
"text-muted outline-none cursor-default focus:border-muted/40";
/* ── Dotted paths ────────────────────────────────────────────── */
@ -226,21 +226,21 @@ export function Field({ field, value, row, options, error, onChange, onPatch }:
return (
<div className={field.full ? "sm:col-span-2" : ""}>
<label htmlFor={id} className="block text-sm font-medium text-[#26454c]">
<label htmlFor={id} className="block text-sm font-medium text-body">
{typeof field.label === "function" ? field.label(row) : field.label}
{field.required && !locked && <span className="ml-1 text-[#b3261e]">*</span>}
{field.required && !locked && <span className="ml-1 text-danger">*</span>}
</label>
<div className="mt-1.5">
{widget === "checkbox" ? (
<label className="flex items-center gap-2 text-sm text-[#4a6b72]">
<label className="flex items-center gap-2 text-sm text-muted">
<input
id={id}
type="checkbox"
checked={value === 1 || value === true}
disabled={locked}
onChange={(e) => onChange(e.target.checked ? 1 : 0)}
className="h-4 w-4 rounded border-[#4a6b72]/40 text-[#0f7183] focus:ring-[#138ba0]/40 disabled:opacity-50"
className="h-4 w-4 rounded border-muted/40 text-link focus:ring-brand/40 disabled:opacity-50"
/>
{helpText(field, row) ?? "Yes"}
</label>
@ -277,7 +277,7 @@ export function Field({ field, value, row, options, error, onChange, onPatch }:
value={/^#[0-9a-f]{6}$/i.test(value ?? "") ? value : "#138ba0"}
disabled={locked}
onChange={(e) => onChange(e.target.value)}
className="h-9 w-12 shrink-0 rounded border border-[#4a6b72]/25 bg-white disabled:opacity-50"
className="h-9 w-12 shrink-0 rounded border border-muted/25 bg-surface disabled:opacity-50"
/>
<input
{...common}
@ -318,7 +318,7 @@ export function Field({ field, value, row, options, error, onChange, onPatch }:
<span
aria-hidden="true"
className={`shrink-0 select-none ${
field.prefixPending ? "text-[#4a6b72]/45" : "text-[#4a6b72]"
field.prefixPending ? "text-muted/45" : "text-muted"
}`}
>
{field.prefix}
@ -329,7 +329,7 @@ export function Field({ field, value, row, options, error, onChange, onPatch }:
value={value ?? ""}
onChange={(e) => onChange(e.target.value)}
placeholder={field.placeholder}
className="w-full border-0 bg-transparent p-0 text-[#26454c] outline-none placeholder:text-[#4a6b72]/45"
className="w-full border-0 bg-transparent p-0 text-body outline-none placeholder:text-muted/45"
/>
</div>
) : (
@ -347,15 +347,15 @@ export function Field({ field, value, row, options, error, onChange, onPatch }:
</div>
{error ? (
<p className="mt-1 text-xs text-[#b3261e]">{error}</p>
<p className="mt-1 text-xs text-danger">{error}</p>
) : orphaned && !locked ? (
<p className="mt-1 text-xs text-[#b3261e]">
<p className="mt-1 text-xs text-danger">
This points at something that has been deleted. Pick a replacement before saving.
</p>
) : (
helpText(field, row) &&
widget !== "checkbox" && (
<p className="mt-1 text-xs text-[#4a6b72]">{helpText(field, row)}</p>
<p className="mt-1 text-xs text-muted">{helpText(field, row)}</p>
)
)}
</div>
@ -467,25 +467,25 @@ export function Repeater({
return (
<section className={className}>
<div className="flex flex-wrap items-center gap-3">
<h3 className="text-base font-semibold text-[#26454c]">
<h3 className="text-base font-semibold text-body">
{spec.label}
{list.length > 0 && (
<span className="ml-2 text-sm font-normal text-[#4a6b72]/80">{list.length}</span>
<span className="ml-2 text-sm font-normal text-muted/80">{list.length}</span>
)}
</h3>
{list.length > 1 && (
<div className="flex gap-3 text-xs text-[#4a6b72]">
<div className="flex gap-3 text-xs text-muted">
<button
type="button"
onClick={() => setOpen(new Set(list.map((_, i) => i)))}
className="hover:text-[#0f7183] hover:underline"
className="hover:text-link hover:underline"
>
Expand all
</button>
<button
type="button"
onClick={() => setOpen(new Set())}
className="hover:text-[#0f7183] hover:underline"
className="hover:text-link hover:underline"
>
Collapse all
</button>
@ -494,15 +494,15 @@ export function Repeater({
<button
type="button"
onClick={add}
className="ml-auto rounded-full border border-[#138ba0] px-3 py-1 text-sm font-medium text-[#0f7183] transition-colors hover:bg-[#eef9fb]"
className="ml-auto rounded-full border border-brand px-3 py-1 text-sm font-medium text-link transition-colors hover:bg-tint"
>
{spec.addLabel ?? "Add"}
</button>
</div>
{spec.note && <p className="mt-1 text-sm text-[#4a6b72]">{spec.note}</p>}
{spec.note && <p className="mt-1 text-sm text-muted">{spec.note}</p>}
{list.length === 0 && <p className="mt-2 text-sm text-[#4a6b72]">None yet.</p>}
{list.length === 0 && <p className="mt-2 text-sm text-muted">None yet.</p>}
<div className="mt-3 space-y-3">
{list.map((row, index) => {
@ -533,10 +533,10 @@ export function Repeater({
endDrag();
}}
className={
`rounded-xl border bg-[#f6fbfc] ${expanded ? "p-4" : "px-4 py-2.5"} transition-colors ` +
`rounded-xl border bg-tint-soft ${expanded ? "p-4" : "px-4 py-2.5"} transition-colors ` +
(over
? "border-[#138ba0] ring-2 ring-[#138ba0]/25 "
: "border-[#4a6b72]/20 ") +
? "border-brand ring-2 ring-brand/25 "
: "border-muted/20 ") +
(dragging ? "opacity-50" : "")
}
>
@ -556,7 +556,7 @@ export function Repeater({
onDragEnd={endDrag}
title="Drag to reorder"
aria-hidden="true"
className="cursor-grab select-none px-1 text-[#4a6b72]/60 active:cursor-grabbing"
className="cursor-grab select-none px-1 text-muted/60 active:cursor-grabbing"
>
⠿
</span>
@ -565,11 +565,11 @@ export function Repeater({
type="button"
onClick={() => toggle(index)}
aria-expanded={expanded}
className="flex min-w-0 flex-1 items-center gap-2 text-left text-sm font-medium text-[#26454c] hover:text-[#0f7183]"
className="flex min-w-0 flex-1 items-center gap-2 text-left text-sm font-medium text-body hover:text-link"
>
<span
aria-hidden="true"
className={`inline-block text-xs text-[#4a6b72] transition-transform ${
className={`inline-block text-xs text-muted transition-transform ${
expanded ? "rotate-90" : ""
}`}
>
@ -579,7 +579,7 @@ export function Repeater({
{spec.title ? spec.title(row, options) : `#${index + 1}`}
</span>
{!expanded && hasError(index) && (
<span className="text-xs text-[#b3261e]">needs attention</span>
<span className="text-xs text-danger">needs attention</span>
)}
</button>
@ -642,7 +642,7 @@ export function Repeater({
{(spec.children ?? [])
.filter((nested) => fieldShown(nested, row, parentRow))
.map((nested) => (
<div key={nested.key} className="mt-4 border-t border-[#4a6b72]/15 pt-4">
<div key={nested.key} className="mt-4 border-t border-muted/15 pt-4">
<Repeater
spec={nested}
rows={row[nested.key]}
@ -657,8 +657,8 @@ export function Repeater({
))}
{spec.preview && PREVIEWS[spec.preview] && (
<div className="mt-4 rounded-lg border border-dashed border-[#138ba0]/30 bg-white p-4">
<p className="mb-3 text-xs font-semibold uppercase tracking-wider text-[#4a6b72]/70">
<div className="mt-4 rounded-lg border border-dashed border-brand/30 bg-surface p-4">
<p className="mb-3 text-xs font-semibold uppercase tracking-wider text-muted/70">
Preview
</p>
{PREVIEWS[spec.preview](row, options)}
@ -685,10 +685,10 @@ function IconButton({ label, onClick, danger = false, disabled = false, children
className={
"h-7 w-7 rounded-full border text-sm leading-none transition-colors " +
(disabled
? "cursor-default border-[#4a6b72]/20 text-[#4a6b72]/40"
? "cursor-default border-muted/20 text-muted/40"
: danger
? "border-[#b3261e]/30 text-[#b3261e] hover:bg-[#fdf3f2]"
: "border-[#4a6b72]/30 text-[#4a6b72] hover:bg-white")
? "border-danger/30 text-danger hover:bg-danger-tint"
: "border-muted/30 text-muted hover:bg-surface")
}
>
{children}

View file

@ -7,6 +7,9 @@
the server isn't in this workspace, and it's the thing that
decides what's storable.
DATA_REQUEST is kept out of the tiles: the Privacy page's form
sends it (FeedbackForm's fixedType), with an email required.
'general' isn't offered anywhere; it's the server's fallback for
a type it doesn't recognise, so old rows still read sensibly.
═══════════════════════════════════════════════════════════════ */
@ -44,7 +47,13 @@ export const FEEDBACK_TYPES = [
},
];
const BY_ID = new Map(FEEDBACK_TYPES.map((t) => [t.id, t.label]));
export const DATA_REQUEST = {
id: "privacy",
label: "Privacy or data request",
hint: "A question about your data, or a request to see or delete it",
};
const BY_ID = new Map([...FEEDBACK_TYPES, DATA_REQUEST].map((t) => [t.id, t.label]));
export function feedbackTypeLabel(id) {
return BY_ID.get(id) ?? (id === "general" ? "Unsorted" : id);

View file

@ -11,6 +11,74 @@
@theme {
--font-display: 'Poppins', sans-serif;
--font-body: 'Montserrat', sans-serif;
/* ── Colour tokens ─────────────────────────────────────────────
Named for what they do, not what they look like, because dark
mode (below) swaps the values. Use them as utilities
(text-muted, bg-surface, border-brand/20) or, in a style prop,
as var(--color-muted). Every text colour passes WCAG AA (4.5:1)
on surface, tint and tint-soft in both modes.
A colour that must stay the same in both modes (white text on
a dark band, a platform's own colour) stays a literal. Colours
that arrive as data (page accents, event and region colours) go
through withAlpha() and accentText() in src/lib/color.ts. */
--color-ink: #073d4a; /* headings */
--color-body: #26454c; /* body text */
--color-muted: #4a6b72; /* secondary text, quiet borders */
--color-link: #0f7183; /* links and teal text */
--color-brand: #138ba0; /* decoration: borders, rings, rules */
--color-action: #0f7183; /* button fills, under white text */
--color-action-hover: #0b5c6a;
--color-surface: #ffffff; /* page and cards */
--color-tint: #eef9fb; /* tinted sections and panels */
--color-tint-soft: #f6fbfc; /* hover rows, faint panels */
--color-danger: #b3261e;
--color-danger-tint: #fdf3f2;
}
/* How much of an accent colour its text keeps (src/lib/color.ts,
accentText): all of it on light, half (the rest white) on dark. */
:root {
--accent-text-mix: 100%;
}
/* Dark mode: the visitor's system setting, unless the header toggle
chose (data-theme on <html>, set before first paint in index.html
and by ThemeToggle). */
@custom-variant dark (&:where([data-theme="dark"], [data-theme="dark"] *));
@layer base {
:root[data-theme="dark"] {
--color-ink: #eaf6f8;
--color-body: #cde0e4;
--color-muted: #9fb9bf;
--color-link: #5ccbdc;
--color-brand: #2aa7bc;
--color-surface: #0c1d21;
--color-tint: #11292e;
--color-tint-soft: #0f2428;
--color-danger: #ff8a80;
--color-danger-tint: #3b1714;
--accent-text-mix: 50%;
color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) {
--color-ink: #eaf6f8;
--color-body: #cde0e4;
--color-muted: #9fb9bf;
--color-link: #5ccbdc;
--color-brand: #2aa7bc;
--color-surface: #0c1d21;
--color-tint: #11292e;
--color-tint-soft: #0f2428;
--color-danger: #ff8a80;
--color-danger-tint: #3b1714;
--accent-text-mix: 50%;
color-scheme: dark;
}
}
}
* {
@ -24,7 +92,7 @@ html {
/* One visible focus ring for keyboard users, wherever a component
doesn't draw its own. */
:focus-visible {
outline: 2px solid #0f7183;
outline: 2px solid var(--color-link);
outline-offset: 2px;
}
@ -45,8 +113,8 @@ html {
body {
font-family: 'Montserrat', sans-serif;
background-color: #ffffff;
color: #073d4a;
background-color: var(--color-surface);
color: var(--color-ink);
-webkit-font-smoothing: antialiased;
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,54 @@
import { mediaUrl } from "../media.ts";
import { PUBLISH_FIELDS } from "./shared.ts";
/* ── Awards ──────────────────────────────────────────────────── */
export const awards = {
key: "awards",
label: "Awards",
singular: "award",
idLabel: "URL ID",
slugFrom: "name",
list: {
columns: [
{ key: "name", label: "Name", primary: true },
{ key: "org_id", label: "Awarded by" },
{ key: "description", label: "Description" },
{ key: "is_published", label: "Live", widget: "bool" },
{ key: "is_listed", label: "Listed", widget: "bool" },
],
filters: [
{ key: "org_id", label: "Awarded by", optionsFrom: "organizations" },
{ key: "is_published", label: "Published", options: [["1", "Live"], ["0", "Hidden"]] },
{ key: "is_listed", label: "Listed", options: [["1", "Listed"], ["0", "Link only"]] },
],
},
groups: [
{
legend: "Identity",
note:
"An award exists whether or not anyone has received it. " +
"Who received it is edited on the person.",
fields: [
{
path: "org_id",
label: "Awarded by",
widget: "select",
optionsFrom: "organizations",
blankLabel: "- unattributed -",
help: "The organization that gives this award",
},
{ path: "name", label: "Name", required: true },
{ path: "description", label: "Description", widget: "textarea", full: true },
{ path: "logo", label: "Logo", widget: "image", resolve: mediaUrl, full: true },
],
},
{
legend: "Publishing",
note: "An unpublished award is a draft: off the site, and a 404 at its own page.",
fields: PUBLISH_FIELDS,
},
],
};

184
src/lib/adminSchema/blog.ts Normal file
View file

@ -0,0 +1,184 @@
import { preview } from "../text.ts";
import { mediaUrl } from "../media.ts";
import { PUBLISHED_FIELD, LISTED_FIELD, FEATURED_KINDS, featuredCardsChild, blocksChild } from "./shared.ts";
/* ── Blog (031_blog.sql) ─────────────────────────────────────────
Posts at /blog/:id, and the Community page's blog section. The
section's community posts reuse the featured cards, limited to
links: a pinned Substack post is a link card, and Fetch preview
fills it from the post. */
/* A post's body is the content blocks without the card/body choice:
a post only has a body. */
const blogBlocksChild = {
...blocksChild,
label: "Post body",
note: "The post, top to bottom. The first paragraph doubles as the excerpt when that's left blank.",
fields: blocksChild.fields.filter((field) => field.path !== "slot"),
};
export const blogPosts = {
key: "blog_posts",
label: "Blog posts",
singular: "blog post",
idLabel: "URL ID",
slugFrom: "title",
list: {
columns: [
{ key: "title", label: "Title", primary: true },
{ key: "published_on", label: "Date" },
{ key: "tags", label: "Tags" },
{ key: "is_published", label: "Live", widget: "bool" },
{ key: "is_listed", label: "Listed", widget: "bool" },
],
filters: [
{ key: "is_published", label: "Published", options: [["1", "Live"], ["0", "Draft"]] },
{ key: "is_listed", label: "Listed", options: [["1", "Listed"], ["0", "Link only"]] },
],
},
groups: [
{
legend: "Post",
fields: [
{ path: "title", label: "Title", required: true, full: true },
{ path: "published_on", label: "Date", widget: "date", help: "Newest first on the Community page" },
{ path: "tags", label: "Tags", help: "Comma separated, eg. Reflection, Event recap" },
{
path: "excerpt",
label: "Excerpt",
widget: "textarea",
full: true,
help: "A sentence or two for the card. Default: the body's first paragraph.",
},
{ path: "cover_image", label: "Cover image", widget: "image", resolve: mediaUrl, full: true },
{
path: "cover_alt",
label: "Cover description",
full: true,
help: "For screen readers: what the cover shows. Default: skipped as decoration.",
},
],
},
{
legend: "Guest author",
note: "For a writer with no People record. People who wrote it go under Authors below; both can be set.",
fields: [
{ path: "guest_author", label: "Name" },
{ path: "guest_photo", label: "Photo", widget: "image", resolve: mediaUrl, full: true },
],
},
{
legend: "Publishing",
note: "A new post is a draft until Published is ticked. Unlisted posts keep their page and can still be pinned.",
fields: [PUBLISHED_FIELD, LISTED_FIELD],
},
],
children: [
{
key: "authors",
label: "Authors",
note: "Shown as person tiles at the end of the post, in this order.",
addLabel: "Add author",
title: (row, options) =>
options?.people?.find((p) => p.id === row.person_id)?.label ?? "New author",
blank: { person_id: "" },
fields: [
{
path: "person_id",
label: "Person",
widget: "select",
optionsFrom: "people",
required: true,
},
],
},
blogBlocksChild,
],
};
export const communityPage = {
key: "community_page",
label: "Community blog section",
singular: "community blog section",
idLabel: "Page",
singleton: "community",
list: { columns: [], filters: [] },
groups: [
{
legend: "Section",
note: "The first section of the Community page.",
fields: [
{ path: "blog_title", label: "Heading", help: "Default: Community Blog" },
{ path: "blog_blurb", label: "Blurb", widget: "textarea", full: true },
],
},
{
legend: "Our posts",
note: "Pinned posts first, then the newest published, listed posts, up to the number of slots.",
fields: [
{ path: "internal_title", label: "Heading", help: "Default: From NGU" },
{ path: "internal_slots", label: "Slots", widget: "number", help: "0 to 12. Default: 3" },
],
},
{
legend: "Community posts",
note: "Pinned cards first, then the newest items from the feeds below, up to the number of slots.",
fields: [
{ path: "external_title", label: "Heading", help: "Default: From our community" },
{ path: "external_slots", label: "Slots", widget: "number", help: "0 to 12. Default: 3" },
{ path: "external_url", label: "Button link", help: "eg. https://ngu.substack.com", full: true },
{ path: "external_label", label: "Button text", help: "Default: Read more on Substack" },
],
},
],
children: [
{
key: "pinned_posts",
label: "Pinned posts (ours)",
note: "Always shown, before the newest.",
addLabel: "Pin a post",
title: (row, options) =>
options?.blog_posts?.find((p) => p.id === row.post_id)?.label ?? "New pin",
blank: { post_id: "" },
fields: [
{
path: "post_id",
label: "Post",
widget: "select",
optionsFrom: "blog_posts",
required: true,
},
],
},
{
...featuredCardsChild,
label: "Pinned community posts",
note: "Always shown, before the feeds' newest. Paste a post's link and press Fetch preview.",
addLabel: "Pin a post",
blank: { kind: "", url: "", title: "" },
fields: featuredCardsChild.fields.map((field) =>
field.path === "kind"
? { ...field, options: FEATURED_KINDS.filter(([kind]) => kind !== "record") }
: field,
),
},
{
key: "feeds",
label: "Feeds",
note: "RSS or Atom feeds whose newest posts fill the community slots. Read about every 30 minutes.",
addLabel: "Add feed",
title: (row) => row.label || row.url || "New feed",
blank: { url: "", label: "" },
fields: [
{ path: "url", label: "Feed URL", required: true, full: true, help: "eg. https://ngu.substack.com/feed" },
{ path: "label", label: "Source name", help: "Shown on its cards. Default: the feed's own title" },
],
},
],
};

View file

@ -0,0 +1,203 @@
import { mediaUrl } from "../media.ts";
import { PLACE_FIELDS, PUBLISHED_FIELD, LISTED_FIELD, timelineGroup, timelineDetailGroup, linksChild, hostsChild, blocksChild } from "./shared.ts";
/* ── Events ──────────────────────────────────────────────────── */
/* The panel the Series checkbox opens. Starts and Ends above stay
the series' bounds (the first meeting and the last day it can
meet), so nothing here repeats them. */
const SERIES_WEEKDAYS = [
["sun", "Sunday"],
["mon", "Monday"],
["tue", "Tuesday"],
["wed", "Wednesday"],
["thu", "Thursday"],
["fri", "Friday"],
["sat", "Saturday"],
];
const seriesGroup = {
legend: "Series",
when: { path: "is_series", value: 1 },
note:
"Starts is the first meeting and anchors the schedule; Ends, if set, is the last " +
"day it can meet. The weekdays only apply to a weekly series; with none ticked it " +
"meets on the start date's day. Leave Date label blank and the site describes " +
"the schedule itself.",
fields: [
{
path: "series_frequency",
label: "Repeats",
widget: "select",
options: [
["weekly", "Weekly, on the days ticked below"],
["monthly_date", "Monthly, on the day of the start date (eg. the 13th)"],
["monthly_weekday", "Monthly, on the weekday of the start date (eg. 2nd Tuesday)"],
],
blankLabel: "Default: weekly",
},
{
path: "series_interval",
label: "Every",
widget: "number",
help: "1 for every week or month, 2 for every other, and so on",
},
{ path: "series_start_time", label: "Start time", widget: "time" },
{ path: "series_end_time", label: "End time", widget: "time" },
{
path: "series_count",
label: "Number of meetings",
widget: "number",
help: "Stops after this many. Blank to run until Ends, or indefinitely",
},
...SERIES_WEEKDAYS.map(([day, name]) => ({
path: `series_${day}`,
label: name,
widget: "checkbox",
help: `Meets on ${name}s`,
})),
],
};
export const events = {
key: "events",
label: "Events",
singular: "event",
idLabel: "URL ID",
slugFrom: "title",
list: {
columns: [
{ key: "title", label: "Title", primary: true },
{ key: "scope_id", label: "Scope" },
{ key: "event_type", label: "Type" },
{ key: "date_label", label: "Dates" },
{ key: "status", label: "Status" },
{ key: "is_published", label: "Live", widget: "bool" },
{ key: "is_listed", label: "Listed", widget: "bool" },
],
filters: [
{ key: "scope_id", label: "Scope", optionsFrom: "event_scopes" },
{
key: "event_type",
label: "Type",
options: ["retreat", "class", "workshop", "meeting", "other"],
},
{ key: "status", label: "Status", options: ["upcoming", "past", "cancelled"] },
{ key: "is_published", label: "Published", options: [["1", "Live"], ["0", "Hidden"]] },
{ key: "is_listed", label: "Listed", options: [["1", "Listed"], ["0", "Link only"]] },
],
},
groups: [
{
legend: "Identity",
fields: [
{
path: "scope_id",
label: "Scope",
widget: "select",
optionsFrom: "event_scopes",
required: true,
help: "Whose gathering this is.",
},
{
path: "event_type",
label: "Type",
widget: "select",
options: ["retreat", "class", "workshop", "meeting", "other"],
required: true,
help: "What kind of gathering. Independent of the scope",
},
{ path: "title", label: "Title", required: true },
{ path: "theme", label: "Theme" },
{ path: "tagline", label: "Tagline", full: true },
],
},
{
legend: "When",
fields: [
{ path: "starts_on", label: "Starts", widget: "date" },
{ path: "ends_on", label: "Ends", widget: "date" },
{
path: "date_label",
label: "Date label",
help: "Text override of what the card shows (eg. March/April 2026)",
},
{
path: "status",
label: "Status",
widget: "select",
options: ["upcoming", "past", "cancelled"],
blankLabel: "Default: derive from end date",
},
{
path: "is_series",
label: "Series",
widget: "checkbox",
help: "Repeats on a schedule, such as a weekly class, a monthly meeting",
},
],
},
seriesGroup,
{ legend: "Where", fields: PLACE_FIELDS },
{
legend: "Appearance",
fields: [
{ path: "event_logo", label: "Event logo", widget: "image", resolve: mediaUrl, full: true },
{ path: "org_logo", label: "Org logo override", widget: "image", resolve: mediaUrl, full: true },
{ path: "color", label: "Colour", widget: "color" },
{
path: "card_image",
label: "Card background",
widget: "image",
resolve: mediaUrl,
full: true,
help: "A photo behind the event's card, faded so the text stays readable.",
},
],
},
timelineGroup("event"),
timelineDetailGroup("event"),
{ legend: "Publishing", fields: [PUBLISHED_FIELD, LISTED_FIELD] },
],
children: [
hostsChild,
{
key: "event_people",
label: "People at this event",
addLabel: "Add person",
title: (row, options) =>
options?.people?.find((p) => p.id === row.person_id)?.label ?? "New person",
blank: { person_id: "", role: "speaker", is_public: 1 },
fields: [
{
path: "person_id",
label: "Person",
widget: "select",
optionsFrom: "people",
required: true,
},
{
path: "role",
label: "Role",
widget: "select",
options: [
"speaker",
"leader",
"facilitator",
"host",
"musician",
"volunteer",
"attendee",
],
},
{ path: "title", label: "Title", help: "eg. Keynote Speaker" },
{ path: "is_public", label: "Show on the site", widget: "checkbox" },
],
},
linksChild,
blocksChild,
],
};

View file

@ -0,0 +1,244 @@
import { mediaUrl } from "../media.ts";
import { featuredCardsChild } from "./shared.ts";
/* ── Front page ──────────────────────────────────────────────────
One record (see the singleton note in server/src/admin-schema.js).
The groups are the hero; the collections below are the rest of
the page. Photos, the livestream and the featured video are
editable whatever the mode, so each can be ready before the
switch is flipped.
Section keys and stat sources are the CHECK lists on
front_page_sections and front_page_stats. The labels here are what the admin reads; the values are
what the page and the API key on. */
const FRONT_PAGE_SECTIONS = [
["countdown", "Event Countdown"],
["retreats", "Events Carousel (National Retreats)"],
["calendar", "Event Calendar"],
["stats", "Stats"],
["timeline", "Featured Timeline"],
["connect", "Connect Nav"],
["featured", "Featured Content"],
];
const STAT_SOURCES = [
["manual", "Print Value Field"],
["years_since", "Years Since Value"],
["regions", "Count: regions"],
["chapters", "Count: chapters"],
["partners", "Count: partners"],
["events_held", "Count: past events"],
["retreats_held", "Count: past retreats"],
["people", "Count: people in database"],
["awards_given", "Count: public awards given"],
];
export const frontPage = {
key: "front_page",
label: "Front page",
singular: "front page",
idLabel: "Page",
singleton: "home",
list: { columns: [], filters: [] },
groups: [
{
legend: "Hero - Primary Section",
note: "The first thing a visitor sees. Blank buttons don't render.",
fields: [
{
path: "hero_backdrop",
label: "Background",
widget: "select",
options: [
["brand", "Brand: animated colour and the dove"],
["photos", "Photos: cycles through the photos below"],
],
blankLabel: "Default: brand",
help: "Photos with none added shows the brand background",
},
{
path: "hero_feature",
label: "Feature",
widget: "select",
options: [
["none", "Nothing: No additional overlay"],
["livestream", "Livestream: the stream, with a LIVE badge"],
["video", "Featured video: click to play"],
["event", "Featured event: an event's card"],
],
blankLabel: "Default: nothing",
help: "Switch to Livestream when you go live, and back when you're done",
},
{ path: "eyebrow", label: "Eyebrow", help: "Small line above the headline" },
{ path: "headline", label: "Headline", full: true },
{ path: "subhead", label: "Subhead", widget: "textarea", full: true },
{ path: "primary_label", label: "Main button label" },
{ path: "primary_url", label: "Main button link", help: "/page, #section-id or a full URL" },
{ path: "secondary_label", label: "Second button label" },
{ path: "secondary_url", label: "Second button link" },
],
},
{
legend: "Photos, livestream, video and event",
fields: [
{
path: "slide_seconds",
label: "Seconds per photo",
widget: "number",
help: "Photos Background. Set from 3 to 60 seconds",
},
{
path: "livestream_url",
label: "Livestream link",
full: true,
help: "A YouTube, Facebook or Vimeo link, or any embed URL",
},
{ path: "livestream_title", label: "Livestream title", full: true },
{
path: "video_url",
label: "Featured video",
full: true,
help:
"A YouTube, Vimeo or Facebook link, or a video file: a filename in " +
"the uploads folder, or a link ending in .mp4 or .webm",
},
{ path: "video_title", label: "Video title", full: true, help: "Shown after \"Featured video\" above the headline" },
{
path: "hero_event_id",
label: "Featured event",
widget: "select",
optionsFrom: "events",
blankLabel: "Default: the countdown's event",
full: true,
help: "For the Featured event feature. A pinned event that's over falls back to the countdown's",
},
],
},
{
legend: "Countdown",
fields: [
{
path: "countdown_event_id",
label: "Count down to",
widget: "select",
optionsFrom: "events",
blankLabel: "Default: the next upcoming event",
help: "Leave blank almost always. A pinned event that's over falls back to the next one",
},
{
path: "countdown_scope_id",
label: "Only this scope",
widget: "select",
optionsFrom: "event_scopes",
blankLabel: "Default: any scope",
help: "Narrows the next upcoming event. Ignored when an event is pinned above",
},
{
path: "countdown_event_type",
label: "Only this type",
widget: "select",
options: [
["retreat", "Retreat"],
["class", "Class"],
["workshop", "Workshop"],
["meeting", "Meeting"],
["other", "Other"],
],
blankLabel: "Default: any type",
help: "Combines with the scope: National + Retreat counts down to the next national retreat",
},
],
},
],
children: [
{
key: "sections",
label: "Page sections",
note: "Drag to reorder. Each section can appear once; leave one out to drop it.",
addLabel: "Add section",
title: (row) =>
FRONT_PAGE_SECTIONS.find(([key]) => key === row.section)?.[1] ?? "New section",
blank: { section: "", title: "", blurb: "" },
fields: [
{
path: "section",
label: "Section",
widget: "select",
options: FRONT_PAGE_SECTIONS,
required: true,
},
{ path: "title", label: "Heading", help: "Heading Override" },
{ path: "blurb", label: "Blurb", full: true },
{ path: "is_hidden", label: "Hidden", widget: "checkbox", help: "Hide for now" },
],
},
{
key: "slides",
label: "Hero photos",
note: "Shown in Photos mode, in this order.",
addLabel: "Add photo",
title: (row) => row.caption || row.media || "New photo",
blank: { media: "", alt: "", caption: "" },
fields: [
{ path: "media", label: "Photo", required: true, widget: "image", resolve: mediaUrl, full: true },
{ path: "alt", label: "Description", help: "For screen readers" },
{ path: "caption", label: "Caption", full: true },
{ path: "link_url", label: "Link", help: "Optional; makes the caption a link" },
],
},
{
key: "stats",
label: "Numbers",
note: "Counts update themselves. A typed-in number with no value is left out.",
addLabel: "Add number",
title: (row) => row.label || "New number",
blank: { label: "", source: "", value: "" },
fields: [
{ path: "label", label: "Label", required: true },
{
path: "source",
label: "Number Source",
widget: "select",
options: STAT_SOURCES,
blankLabel: "Default: Print Value",
},
{ path: "value", label: "Value", help: "The number thats printed" },
{ path: "suffix", label: "Suffix", help: "+, k, % …" },
{ path: "note", label: "Note", full: true },
],
},
featuredCardsChild,
{
key: "paths",
label: "Connect Nav",
note: "Each path is a choice a visitor can pick; its actions appear when they do.",
addLabel: "Add path",
title: (row) => [row.icon, row.label].filter(Boolean).join(" ") || "New path",
blank: { label: "", icon: "", blurb: "" },
fields: [
{ path: "label", label: "Label", required: true, help: "eg. Attend, Serve…" },
{ path: "icon", label: "Icon", help: "Emoji" },
{ path: "blurb", label: "Blurb", full: true },
],
children: [
{
key: "actions",
label: "Actions",
addLabel: "Add action",
title: (row) => row.label || "New action",
blank: { label: "", url: "" },
fields: [
{ path: "label", label: "Label", required: true },
{ path: "url", label: "Link", required: true },
{ path: "description", label: "Description", full: true },
],
},
],
},
],
};

View file

@ -0,0 +1,107 @@
import { mediaUrl } from "../media.ts";
import { PLACE_FIELDS, PUBLISH_FIELDS, timelineGroup, timelineDetailGroup, linksChild, blocksChild } from "./shared.ts";
/* ── Organizations ───────────────────────────────────────────── */
export const organizations = {
key: "organizations",
label: "Organizations",
singular: "organization",
idLabel: "URL ID",
slugFrom: "name",
list: {
columns: [
{ key: "name", label: "Name", primary: true },
{ key: "kind", label: "Kind" },
{ key: "locality", label: "City" },
{ key: "state_code", label: "State" },
{ key: "is_published", label: "Live", widget: "bool" },
{ key: "is_listed", label: "Listed", widget: "bool" },
],
filters: [
{ key: "kind", label: "Kind", options: ["national", "region", "chapter", "partner"] },
{ key: "is_published", label: "Published", options: [["1", "Live"], ["0", "Hidden"]] },
{ key: "is_listed", label: "Listed", options: [["1", "Listed"], ["0", "Link only"]] },
],
},
groups: [
{
legend: "Identity",
fields: [
{
path: "kind",
label: "Kind",
widget: "select",
options: ["national", "region", "chapter", "partner"],
required: true,
help: "Changing this swaps which extra fields apply",
},
{ path: "name", label: "Name", required: true },
{ path: "short_name", label: "Short name" },
{ path: "tagline", label: "Tagline", full: true },
{ path: "color", label: "Colour", widget: "color" },
{ path: "logo", label: "Logo", widget: "image", resolve: mediaUrl, full: true },
],
},
{
legend: "Region",
when: { path: "kind", value: "region" },
fields: [
{
path: "region.scope",
label: "Scope",
widget: "select",
options: ["domestic", "international", "virtual"],
required: true,
},
{ path: "region.map_note", label: "Map note", full: true },
],
},
{
legend: "Chapter",
when: { path: "kind", value: "chapter" },
fields: [
{
path: "chapter.region_id",
label: "Region",
widget: "select",
optionsFrom: "regions",
blankLabel: "Default: none",
},
{ path: "chapter.meets", label: "Meets", help: "2nd Sundays, 6:00pm" },
{ path: "chapter.started", label: "Started", help: "Since 2021" },
],
},
{ legend: "Place", fields: PLACE_FIELDS },
timelineGroup("organization"),
timelineDetailGroup("organization"),
{ legend: "Publishing", fields: PUBLISH_FIELDS },
],
children: [
{
key: "region_areas",
label: "Map areas",
when: { path: "kind", value: "region" },
addLabel: "Add area",
title: (row) => row.area_code || "New area",
blank: { area_code: "", share: 1 },
fields: [
{ path: "area_code", label: "Area code", required: true, help: "Two letter state code or Country name" },
{ path: "share", label: "Share", widget: "number", help: "1 for the whole tile, 0.5 for half" },
{
path: "edge",
label: "Edge",
widget: "select",
options: ["top", "bottom"],
blankLabel: "Default: whole tile",
},
{ path: "note", label: "Note", help: "details to explain why it's half or other note" },
],
},
linksChild,
blocksChild,
],
};

View file

@ -0,0 +1,148 @@
import { mediaUrl } from "../media.ts";
import { PUBLISHED_FIELD, LISTED_FIELD, AFFILIATION_ROLE_FIELDS, linksChild, blocksChild } from "./shared.ts";
/* ── People ──────────────────────────────────────────────────── */
export const people = {
key: "people",
label: "People",
singular: "person",
idLabel: "URL ID",
slugFrom: "display_name",
list: {
columns: [
{ key: "display_name", label: "Name", primary: true },
{ key: "tagline", label: "Tagline" },
{ key: "locality", label: "City" },
{ key: "is_published", label: "Live", widget: "bool" },
{ key: "is_listed", label: "Listed", widget: "bool" },
],
filters: [
{ key: "is_published", label: "Published", options: [["1", "Live"], ["0", "Hidden"]] },
{ key: "is_listed", label: "Listed", options: [["1", "Listed"], ["0", "Link only"]] },
],
},
groups: [
{
legend: "Identity",
fields: [
{ path: "display_name", label: "Display name", required: true },
{ path: "sort_name", label: "Sort name", help: "Doe, Jane" },
{ path: "pronouns", label: "Pronouns" },
{ path: "tagline", label: "Tagline", full: true },
{ path: "photo", label: "Photo", widget: "image", resolve: mediaUrl, full: true },
{
path: "primary_org_id",
label: "Home organization",
widget: "select",
optionsFrom: "organizations",
blankLabel: "Default: none",
help: "Optional. Shown above their bio",
},
{
path: "bio",
label: "Bio",
widget: "textarea",
full: true,
help: "Leave a blank line between paragraphs",
},
],
},
{
legend: "Public contact",
fields: [
{ path: "public_email", label: "Email", help: "Printed on the site" },
{ path: "public_phone", label: "Phone" },
{ path: "locality", label: "City" },
{ path: "state_code", label: "State" },
{ path: "country", label: "Country" },
{ path: "location_label", label: "Display location" },
],
},
{
legend: "Private",
note: "Never sent to the public site. Only admins see this.",
fields: [
{ path: "private.birth_date", label: "Birth date", widget: "date" },
{ path: "private.private_email", label: "Email" },
{ path: "private.private_phone", label: "Phone" },
{ path: "private.address", label: "Address", full: true },
{ path: "private.notes", label: "Notes", widget: "textarea", full: true },
],
},
{
legend: "Publishing",
note: "Unpublished people are invisible everywhere.",
fields: [PUBLISHED_FIELD, LISTED_FIELD],
},
],
children: [
{
key: "affiliations",
label: "Roles and organizations",
addLabel: "Add role",
note:
"Where someone appears within a team is set on that team's page, " +
"not by the order of this list.",
title: (row, options) =>
[row.title, options?.organizations?.find((o) => o.id === row.org_id)?.label]
.filter(Boolean)
.join(" · ") || "New role",
blank: { org_id: "", role: "member", is_public: 1, is_owner: 0 },
fields: [
{
path: "org_id",
label: "Organization",
widget: "select",
optionsFrom: "organizations",
required: true,
},
{
path: "team_id",
label: "Team",
widget: "select",
optionsFrom: "teams",
blankLabel: "Default: none",
// A team belongs to an org; offering one from another
// org would fail the composite foreign key on save.
filterBy: (option, row) => option.org_id === row.org_id,
help: "Only teams of the chosen organization",
},
...AFFILIATION_ROLE_FIELDS,
],
},
{
key: "person_awards",
label: "Awards",
addLabel: "Add award",
title: (row, options) =>
options?.awards?.find((a) => a.id === row.award_id)?.label ?? "New award",
blank: { award_id: "", is_public: 1 },
fields: [
{
path: "award_id",
label: "Award",
widget: "select",
optionsFrom: "awards",
required: true,
help: "Labelled with the organization that gives it",
},
{
path: "event_id",
label: "Presented at",
widget: "select",
optionsFrom: "events",
blankLabel: "Default: none",
},
{ path: "awarded_on", label: "Date", widget: "date" },
{ path: "citation", label: "Citation", widget: "textarea", full: true },
{ path: "is_public", label: "Public", widget: "checkbox" },
],
},
linksChild,
blocksChild,
],
};

View file

@ -0,0 +1,446 @@
/* Field sets, groups and child collections shared by several entity
manifests (adminSchema.ts has the overview). */
import { preview } from "../text.ts";
import { PLATFORMS } from "../platforms.ts";
import { FORMATTING_HELP } from "../../components/InlineText.tsx";
import { mediaUrl } from "../media.ts";
export const PLACE_FIELDS = [
{ path: "venue", label: "Venue" },
{ path: "address", label: "Address", full: true },
{ path: "locality", label: "City" },
{ path: "state_code", label: "State", help: "Two letters, US only" },
{ path: "country", label: "Country", help: "Defaults to US" },
{ path: "location_label", label: "Display location", help: "Overrides the line built from city and state" },
{ path: "latitude", label: "Latitude", widget: "number" },
{ path: "longitude", label: "Longitude", widget: "number" },
{ path: "is_online", label: "Online", widget: "checkbox" },
];
export const PUBLISHED_FIELD = { path: "is_published", label: "Published", widget: "checkbox" };
/* Only means anything on a published record. Unticked, its own page
still works but the site's lists, counts and the QR page leave it
out. See 027_listed.sql for exactly which. */
export const LISTED_FIELD = {
path: "is_listed",
label: "Listed",
widget: "checkbox",
help: "Unticked: only reachable by its link",
};
/* For entities whose lists the site orders by hand. Events sort by
date and people by sort_name, so they take the first two alone. */
export const PUBLISH_FIELDS = [
PUBLISHED_FIELD,
LISTED_FIELD,
{ path: "sort_order", label: "Sort order", widget: "number" },
];
/* The parts of an affiliation that read the same from either end:
the person's list of roles, and the team's list of members. */
export const AFFILIATION_ROLE_FIELDS = [
{ path: "title", label: "Title", help: "eg. Board Chair, Team Lead" },
{
path: "role",
label: "Role",
widget: "select",
options: ["lead", "board", "staff", "volunteer", "member"],
},
{ path: "is_owner", label: "Owner", widget: "checkbox", help: "Listed first (can be more than one)" },
{ path: "started_on", label: "Started", widget: "date" },
{ path: "ended_on", label: "Ended", widget: "date", help: "Blank means current" },
{ path: "is_public", label: "Public", widget: "checkbox" },
];
/* The timeline panel that appears on an event or organization once the
box is ticked. Paths are prefixed with the extension key, exactly as
'region.scope' and 'private.notes' are.
Everything here is an override. Left blank, the history page falls
back to the record's own title, date and logo through v_timeline,
which is the point of referencing rather than copying. */
export const timelineExtensionFields = (noun) => [
{
path: "timeline.occurred_on",
label: "Date on the timeline",
help: `Blank uses the ${noun}'s own date. Partial dates are fine: 2012, 2012-06`,
},
{
path: "timeline.precision",
label: "Date precision",
widget: "select",
options: ["year", "month", "day"],
help: "How much of the date to trust. 'year' files it under 'Elsewhere in 2012'",
},
{
path: "timeline.title",
label: "Title override",
full: true,
help: `Blank uses the ${noun}'s name`,
},
{
path: "timeline.blurb",
label: "Blurb override",
widget: "textarea",
full: true,
help: `Blank uses the ${noun}'s tagline`,
},
{ path: "timeline.meta", label: "Secondary line", help: "Region, venue, recipient" },
{
path: "timeline.link_url",
label: "Link override",
help: `Blank links to the ${noun}'s own page`,
},
{
path: "timeline.is_featured",
label: "Featured",
widget: "checkbox",
help: "Shown large, above the month list for its year",
},
{ path: "timeline.is_published", label: "Visible on the history page", widget: "checkbox" },
{ path: "timeline.sort_order", label: "Sort order", widget: "number" },
];
/* The checkbox itself, plus the panel it gates. One entry in `groups`. */
export const timelineGroup = (noun) => ({
legend: "Timeline",
note:
`Adds this ${noun} to the history page. Nothing is copied, the entry ` +
`reads this record, so editing it here updates the timeline too.`,
fields: [
{
path: "in_timeline",
label: "On the timeline",
widget: "checkbox",
help: "Show this on the history page",
},
],
});
export const timelineDetailGroup = (noun) => ({
legend: "Timeline entry",
when: { path: "in_timeline", value: 1 },
note: "Every field here is optional. Blank means \u201cuse the record's own value\u201d.",
fields: timelineExtensionFields(noun),
});
/* Featured cards (030_featured_cards.sql), a front page collection
now and the Community blog's next, so it's written once. Fields
show by kind; switching kind clears the ones that stop applying
(see `when` in fields.tsx). */
export const FEATURED_KINDS = [
["record", "A page on this site (event, org, person…)"],
["link", "A link (article, post, any URL)"],
["video", "A video (YouTube, Vimeo, Facebook)"],
];
export const featuredCardsChild = {
key: "featured_cards",
label: "Featured cards",
note: "Shown by the Featured Content section, in this order.",
addLabel: "Add card",
title: (row, options) =>
row.title ||
options?.record_refs?.find((o) => o.kind === row.ref_kind && o.id === row.ref_id)?.label ||
row.url ||
"New card",
blank: { kind: "", ref_kind: "", ref_id: "", url: "", title: "" },
fields: [
{
path: "kind",
label: "Card type",
widget: "select",
options: FEATURED_KINDS,
required: true,
},
{
path: "ref_kind",
label: "Record type",
widget: "select",
options: ["event", "organization", "person", "team", "award"],
required: true,
when: { path: "kind", value: "record" },
},
{
path: "ref_id",
label: "Record",
widget: "select",
optionsFrom: "record_refs",
filterBy: (option, row) => option.kind === row.ref_kind,
required: true,
when: { path: "kind", value: "record" },
help: "Its title, picture and link fill the card. Anything typed below overrides them.",
},
{
path: "url",
label: "URL",
widget: "linkPreview",
previewWhen: { path: "kind", value: "link" },
required: true,
full: true,
when: { path: "kind", value: ["link", "video"] },
},
{ path: "eyebrow", label: "Label", help: "Small text above the title, eg. Article, Watch" },
{ path: "title", label: "Title" },
{ path: "blurb", label: "Blurb", widget: "textarea", full: true },
{
path: "image",
label: "Image",
widget: "image",
resolve: mediaUrl,
full: true,
help: "Default: the record's own picture, or for a YouTube video, its thumbnail.",
},
],
};
/* The two collections every entity carries. */
export const linksChild = {
key: "links",
label: "Links and socials",
addLabel: "Add link",
title: (row) => row.label || row.url || "New link",
blank: { kind: "action", label: "", url: "", is_primary: 0 },
fields: [
{
path: "kind",
label: "Kind",
widget: "select",
options: ["action", "social", "website", "email"],
},
{
path: "platform",
label: "Platform",
widget: "select",
options: PLATFORMS.map((platform) => [platform.id, platform.label]),
blankLabel: "Default: no icon",
help: "Shows the platform's icon on the button.",
},
{ path: "label", label: "Label", required: true },
{ path: "url", label: "URL", required: true, full: true },
{ path: "is_primary", label: "Primary", widget: "checkbox" },
],
};
/* Hosts. One row is one host, ordered, and each is either an
organization or a person, never both, which the CHECK on
event_hosts enforces and this form can only ask nicely about.
The first row supplies the logo and colour when the event sets
neither, so the order here is data rather than a display choice.
A person supplies neither: there is no colour on a person and a
headshot is not a logo, so a person-hosted event with no colour
of its own falls through to the section default. */
export const hostsChild = {
key: "event_hosts",
label: "Hosts",
addLabel: "Add host",
title: (row, options) =>
options?.organizations?.find((o) => o.id === row.org_id)?.label ??
options?.people?.find((p) => p.id === row.person_id)?.label ??
"New host",
blank: { org_id: "", person_id: "" },
fields: [
{
path: "org_id",
label: "Organization",
widget: "select",
optionsFrom: "organizations",
blankLabel: "Default: none",
help: "Host Organization"
},
{
path: "person_id",
label: "Person",
widget: "select",
optionsFrom: "people",
blankLabel: "Default: none",
help: "Use if the host is an individual, choose between person and org host, not both.",
},
],
};
/* Content blocks. The type decides which fields appear (`when`),
what the text box is for (`help` as a function), and whether the
block has items; the preview under each open block is the site's
own renderer. Types and what they read: ContentBlocks.tsx. */
export const BLOCK_TYPES = [
["paragraph", "Paragraph", "Body text. Formatting: " + FORMATTING_HELP],
["heading", "Heading", "A section heading."],
["subheading", "Subheading", "A smaller heading under a heading."],
["callout", "Callout", "A note or announcement in a tinted box. Formatting: " + FORMATTING_HELP],
["quote", "Quote", "A quotation, with who said it. Formatting: " + FORMATTING_HELP],
["list", "List", "Bulleted items, each optionally linked, with an optional detail."],
["links", "Link buttons", "A row of outlined buttons, one per item."],
["button", "Button", "One filled call-to-action button, eg. Register, Donate."],
["image", "Image", "A picture, with alt text and an optional caption and link."],
["video", "Video", "A YouTube, Vimeo or Facebook video, or a video file, played in place."],
["schedule", "Schedule", "Entries in one tab per day, each folding out for more. The text is an optional intro."],
["divider", "Divider", "A thin line between parts."],
];
/* An item field that only a schedule's entries have. */
export const SCHEDULE_ENTRY = { scope: "parent", path: "type", value: "schedule" };
export const blockTypeLabel = (type) => BLOCK_TYPES.find(([value]) => value === type)?.[1] ?? type;
export const TEXT_TYPES = ["paragraph", "heading", "subheading", "callout", "quote", "button", "image", "video", "schedule"];
export const TEXT_HELP = {
paragraph: FORMATTING_HELP,
callout: FORMATTING_HELP,
quote: FORMATTING_HELP,
button: "The button's label, eg. Register now",
image: "Caption shown under the image. Optional.",
video: "Caption shown under the video. Optional.",
schedule: "Optional intro above the tabs. " + FORMATTING_HELP,
};
export const TEXT_LABEL = { button: "Label", image: "Caption", video: "Caption", schedule: "Intro" };
export const HREF_HELP = {
paragraph: "Optional. Makes the whole paragraph one link. For a link inside the text, use [text](url).",
button: "Where the button goes, eg. /give or https://…",
image: "Optional. Makes the image a link.",
video: "The video's page, eg. https://www.youtube.com/watch?v=…, or a video file",
};
export const blocksChild = {
key: "content_blocks",
label: "Content blocks",
addLabel: "Add block",
preview: "contentBlock",
title: (row) => {
const label = blockTypeLabel(row.type) || "Block";
const text = preview(row.text || row.href || row.media || "", 40);
return text ? `${label}: ${text}` : label;
},
blank: { slot: "body", type: "paragraph", text: "" },
fields: [
{
path: "slot",
label: "Shown in",
widget: "select",
options: [
["body", "The page"],
["card", "The card (paragraphs only)"],
],
},
{
path: "type",
label: "Type",
widget: "select",
options: BLOCK_TYPES.map(([value, label]) => [value, label]),
help: (row) => BLOCK_TYPES.find(([value]) => value === row?.type)?.[2],
},
{
path: "text",
label: (row) => TEXT_LABEL[row?.type] ?? "Text",
widget: "textarea",
full: true,
when: { path: "type", value: TEXT_TYPES },
help: (row) => TEXT_HELP[row?.type],
},
{
path: "cite",
label: "Attribution",
help: "Who said it, eg. Jane Doe, Retreat 2024",
full: true,
when: { path: "type", value: "quote" },
},
{
path: "href",
label: "Link",
full: true,
when: { path: "type", value: ["paragraph", "button", "image", "video"] },
help: (row) => HREF_HELP[row?.type],
},
{
path: "media",
label: "Image",
widget: "image",
resolve: mediaUrl,
full: true,
when: { path: "type", value: ["image", "video"] },
help: (row) =>
row?.type === "video" ? "Still shown before it plays. Default: YouTube's own thumbnail." : undefined,
},
{
path: "alt",
label: "Alt text",
full: true,
when: { path: "type", value: "image" },
help: "Describes the picture for someone who can't see it, eg. Campers around a fire at dusk",
},
],
children: [
{
key: "items",
label: "Items",
addLabel: "Add item",
when: { path: "type", value: ["list", "links", "schedule"] },
title: (row) => [row.day, row.time, row.text].filter(Boolean).join(" · ") || "New item",
blank: { text: "" },
fields: [
{
path: "day",
label: "Day",
help: "The tab it's under, eg. Friday. Entries with the same day share a tab, in this order.",
when: SCHEDULE_ENTRY,
},
{ path: "time", label: "Time", help: "eg. 7:00pm, or 9:00 to 10:30am", when: SCHEDULE_ENTRY },
{ path: "text", label: "Text", required: true, help: "Schedules: the entry's title" },
{
path: "location",
label: "Location",
help: "eg. Main Hall",
when: SCHEDULE_ENTRY,
},
{
path: "person_id",
label: "Person",
widget: "select",
optionsFrom: "people",
blankLabel: "Default: none",
help: "Who hosts or speaks: shown with their photo, linked to their page",
when: SCHEDULE_ENTRY,
},
{ path: "detail", label: "Detail", help: "A line under the text. Lists: shown after the text" },
{ path: "url", label: "URL", help: "Blank for plain text. Link buttons need one." },
{
path: "description",
label: "More",
widget: "textarea",
full: true,
help: "Shown when the entry is folded out. " + FORMATTING_HELP,
when: SCHEDULE_ENTRY,
},
{
path: "media",
label: "Graphic",
widget: "image",
resolve: mediaUrl,
full: true,
help: "Optional, in the fold-out: a map of the site, a slide, a poster",
when: SCHEDULE_ENTRY,
},
{
path: "media_alt",
label: "Graphic description",
full: true,
help: "For screen readers: what the graphic shows, eg. a map of the camp. Default: skipped as decoration.",
when: SCHEDULE_ENTRY,
},
{
path: "map",
label: "Map",
full: true,
help: "Optional, in the fold-out: a place or address for a Google map, eg. Camp Hebron, Halifax PA",
when: SCHEDULE_ENTRY,
},
],
},
],
};

View file

@ -0,0 +1,120 @@
import siteConfiguration from "../../../site.json";
import { mediaUrl } from "../media.ts";
/* ── Site settings (035_site_settings.sql) ───────────────────────
Overrides for site.json, superadmins only: every blank falls back
to what site.json says, which is shown as the default. */
const SITE_PAGES: [string, string][] = Object.entries(siteConfiguration.pages).map(
([path, page]) => [path, `${page.title} (${path})`],
);
export const siteSettings = {
key: "site_settings",
label: "Site settings",
singular: "site settings",
idLabel: "Settings",
singleton: "site",
writeRole: "superadmin",
list: { columns: [], filters: [] },
groups: [
{
legend: "The site",
note: "Anything left blank uses site.json, so the build and these settings agree until you change one.",
fields: [
{ path: "site_name", label: "Site name", help: `Default: ${siteConfiguration.title}` },
{
path: "description",
label: "Description",
widget: "textarea",
full: true,
help: "Search engines and link previews show this for pages without their own. Default: site.json's, or the front page's subhead.",
},
{
path: "preview_image",
label: "Preview image",
widget: "image",
resolve: mediaUrl,
full: true,
help: "Shown when a page without its own image is shared. 1200 × 630 works everywhere.",
},
],
},
{
legend: "Icons",
fields: [
{
path: "favicon",
label: "Favicon",
widget: "image",
resolve: mediaUrl,
full: true,
help: "The browser-tab icon: a square PNG (512px) or an SVG. Keep original when uploading an SVG.",
},
{
path: "apple_touch_icon",
label: "Home-screen icon",
widget: "image",
resolve: mediaUrl,
full: true,
help: "For iPhones saving the site to their home screen: a square PNG, 180px, no transparency.",
},
],
},
{
legend: "Search engines",
fields: [
{
path: "indexing",
label: "Let search engines list this site",
widget: "select",
options: [
["on", "On: pages can appear in Google"],
["off", "Off: hidden from search (use on the dev server)"],
],
blankLabel: `Default: site.json (${siteConfiguration.robots?.index === false ? "off" : "on"})`,
help: "Applies to this server's database only, so dev can be off while production is on.",
},
],
},
{
legend: "Privacy",
fields: [
{
path: "privacy_email",
label: "Privacy contact email",
help: `The Privacy page gives this for privacy questions and data requests, eg. privacy@nextgenerationofunity.org. ${
siteConfiguration.privacyEmail ? `Default: ${siteConfiguration.privacyEmail}` : "Default: none, the page offers its request form only"
}.`,
},
],
},
],
children: [
{
key: "pages",
label: "Page titles and intros",
note: "Change a static page's heading and intro, which are also its search title and description. Blank fields keep site.json's.",
addLabel: "Change a page",
title: (row) => SITE_PAGES.find(([path]) => path === row.path)?.[1] ?? "New page",
blank: { path: "", title: "", description: "" },
fields: [
{ path: "path", label: "Page", widget: "select", options: SITE_PAGES, required: true },
{
path: "title",
label: "Title",
help: (row) => (row?.path ? `Default: ${siteConfiguration.pages[row.path]?.title ?? ""}` : undefined),
},
{
path: "description",
label: "Intro",
widget: "textarea",
full: true,
help: (row) => (row?.path ? `Default: ${siteConfiguration.pages[row.path]?.description ?? ""}` : undefined),
},
],
},
],
};

View file

@ -0,0 +1,83 @@
import { mediaUrl } from "../media.ts";
import { PUBLISH_FIELDS, AFFILIATION_ROLE_FIELDS, linksChild, blocksChild } from "./shared.ts";
/* ── Teams ───────────────────────────────────────────────────── */
export const teams = {
key: "teams",
label: "Teams",
singular: "team",
idLabel: "URL ID",
// teams.id is a global primary key, not scoped to the org, so
// 'board' can only exist once across the whole site. Composing
// the slug from both fields is what keeps NGU's board and the
// Northwest's board from colliding.
slugFrom: ["org_id", "name"],
list: {
columns: [
{ key: "name", label: "Name", primary: true },
{ key: "org_id", label: "Organization" },
{ key: "tagline", label: "Tagline" },
{ key: "is_published", label: "Live", widget: "bool" },
{ key: "is_listed", label: "Listed", widget: "bool" },
],
filters: [
{ key: "org_id", label: "Organization", optionsFrom: "organizations" },
{ key: "is_published", label: "Published", options: [["1", "Live"], ["0", "Hidden"]] },
{ key: "is_listed", label: "Listed", options: [["1", "Listed"], ["0", "Link only"]] },
],
},
groups: [
{
legend: "Identity",
note:
"Pick the organization first: the id is built from it, " +
"and it can't be changed once anyone is filed under this team.",
fields: [
{
path: "org_id",
label: "Organization",
widget: "select",
optionsFrom: "organizations",
required: true,
help: "Who this team belongs to",
},
{ path: "name", label: "Name", required: true, help: "Board, Leadership Team" },
{ path: "tagline", label: "Tagline", full: true },
{ path: "color", label: "Colour", widget: "color" },
{ path: "logo", label: "Logo", widget: "image", resolve: mediaUrl, full: true },
],
},
{ legend: "Publishing", fields: PUBLISH_FIELDS },
],
children: [
{
key: "members",
label: "Members",
addLabel: "Add member",
note:
"This order is the order they appear on the site. Owners are " +
"still listed first, in this order among themselves.",
title: (row, options) =>
[options?.people?.find((p) => p.id === row.person_id)?.label, row.title]
.filter(Boolean)
.join(" · ") || "New member",
blank: { person_id: "", role: "member", is_public: 1, is_owner: 0 },
fields: [
{
path: "person_id",
label: "Person",
widget: "select",
optionsFrom: "people",
required: true,
},
...AFFILIATION_ROLE_FIELDS,
],
},
linksChild,
blocksChild,
],
};

View file

@ -0,0 +1,152 @@
/* ── Timeline ─────────────────────────────────────────── */
// The only entity with no slug: the table assigns the id, because an
// entry referencing an event has no name of its own and one gets
// created every time somebody ticks a checkbox. `idKind: "auto"` tells
// EntityEdit to show the id rather than ask for it.
//
// Most rows here are created from an event or organization page, not
// this one. What this page is for: hand-authored milestones with no
// record behind them, 'people' entries about a team forming, and fixing
// up the entries the checkboxes made.
export const timeline = {
key: "timeline",
label: "Timeline",
singular: "entry",
idLabel: "Entry",
idKind: "auto",
titleFrom: "title",
list: {
columns: [
{ key: "title", label: "Title", primary: true },
{ key: "occurred_on", label: "Date" },
{ key: "kind", label: "Kind" },
{ key: "ref_id", label: "References" },
{ key: "is_featured", label: "Featured", widget: "bool" },
{ key: "is_published", label: "Live", widget: "bool" },
],
filters: [
{
key: "kind",
label: "Kind",
options: ["milestone", "event", "organization", "award", "people"],
},
{
key: "ref_kind",
label: "References",
options: ["event", "organization", "award", "person", "team"],
},
{ key: "is_featured", label: "Featured", options: [["1", "Featured"], ["0", "Normal"]] },
{ key: "is_published", label: "Published", options: [["1", "Live"], ["0", "Hidden"]] },
],
},
groups: [
{
legend: "What this is",
note:
"An entry either points at a record or stands on its own. " +
"Pointing at one means its title, date and logo come from that " +
"record and nothing is copied, so editing the record updates this.",
fields: [
{
path: "kind",
label: "Kind",
widget: "select",
options: ["milestone", "event", "organization", "award", "people"],
required: true,
help: "Drives the marker and the layout. 'people' renders a roster",
},
{
path: "ref_kind",
label: "Points at",
widget: "select",
options: ["event", "organization", "award", "person", "team"],
blankLabel: "Default: nothing",
help: "Changing this leaves the record below orphaned, pick a new one",
},
{
path: "ref_id",
label: "Record",
widget: "select",
optionsFrom: "record_refs",
blankLabel: "Default: none",
// One flat list of every referenceable row, narrowed to the
// kind chosen above. Five dropdowns of which four are always
// wrong would be worse.
filterBy: (option, row) => option.kind === row.ref_kind,
help: "Only records of the kind chosen above",
},
],
},
{
legend: "When",
note:
"Blank takes the referenced record's own date. Precision is what " +
"says how much of the date to believe, a backfilled entry that " +
"only knows the year should say so.",
fields: [
{
path: "occurred_on",
label: "Date",
help: "2012, 2012-06 or 2012-06-14",
},
{
path: "precision",
label: "Precision",
widget: "select",
options: ["year", "month", "day"],
},
],
},
{
legend: "Text",
note: "All optional. Blank uses the referenced record's own wording.",
fields: [
{ path: "title", label: "Title", full: true },
{ path: "blurb", label: "Blurb", widget: "textarea", full: true },
{ path: "meta", label: "Secondary line", help: "Region, venue, recipient" },
{ path: "link_url", label: "Link", help: "Blank links to the record's own page" },
],
},
{
legend: "Publishing",
fields: [
{
path: "is_featured",
label: "Featured",
widget: "checkbox",
help: "Shown large, above the month list for its year",
},
{ path: "is_published", label: "Published", widget: "checkbox" },
{ path: "sort_order", label: "Sort order", widget: "number" },
],
},
],
children: [
{
key: "people",
label: "People",
addLabel: "Add person",
note:
"For an entry about people. A 'people' entry pointing at a team " +
"already shows that team's members, this is for the cases where " +
"the list is editorial rather than structural.",
title: (row, options) =>
options?.people?.find((p) => p.id === row.person_id)?.label ?? "New person",
blank: { person_id: "" },
fields: [
{
path: "person_id",
label: "Person",
widget: "select",
optionsFrom: "people",
required: true,
},
{ path: "note", label: "Note", help: "Founding lead, first chair" },
],
},
],
};

View file

@ -83,7 +83,7 @@ export function RequireAuth() {
if (loading) {
return (
<div className="flex min-h-screen items-center justify-center text-[#4a6b72]">
<div className="flex min-h-screen items-center justify-center text-muted">
Checking your session…
</div>
);

39
src/lib/color.ts Normal file
View file

@ -0,0 +1,39 @@
/* ═══════════════════════════════════════════════════════════════
COLOR
Two helpers for colours that arrive as data (a page's accent, an
event's or region's colour), so they work with the theme tokens
in index.css as well as with hex.
withAlpha(color, 20) is that colour at 20% opacity, for tints and
borders. It replaces `${color}33`, which only works on hex.
accentText(color) is that colour as text: itself in light mode,
mixed halfway to white in dark mode (--accent-text-mix), so an
accent picked for a white page still reads on a dark one.
═══════════════════════════════════════════════════════════════ */
export const withAlpha = (color: string, percent: number): string =>
`color-mix(in srgb, ${color} ${percent}%, transparent)`
export const accentText = (color: string): string =>
`color-mix(in srgb, ${color} var(--accent-text-mix), #ffffff)`
/* Text for on top of a colour that arrives as data: white or deep
ink, whichever has more contrast (WCAG), so a pale colour an admin
picks still gets readable text. Anything that isn't #rrggbb (a
CSS variable, say) gets white, which suits the site's own dark
accents. */
export function readableOn(color: string): string {
const hex = /^#([0-9a-f]{6})$/i.exec(color ?? '')?.[1]
if (!hex) return '#ffffff'
const channel = (i: number) => {
const c = parseInt(hex.slice(i, i + 2), 16) / 255
return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4
}
const lum = 0.2126 * channel(0) + 0.7152 * channel(2) + 0.0722 * channel(4)
const INK_LUM = 0.0161 // #04262e
const onWhite = 1.05 / (lum + 0.05)
const onInk = (lum + 0.05) / (INK_LUM + 0.05)
return onWhite >= onInk ? '#ffffff' : '#04262e'
}

View file

@ -20,7 +20,7 @@
hand a file to <video> and a link to an <iframe>.
═══════════════════════════════════════════════════════════════ */
import { heroVideo } from './media.ts'
import { mediaUrl } from './media.ts'
const VIDEO_FILE = /\.(mp4|webm|m4v|mov|ogv)$/i
@ -91,7 +91,7 @@ export function videoSource(raw?: string | null): VideoSource | null {
if (VIDEO_FILE.test(value.split(/[?#]/)[0])) {
if (/^https:\/\//i.test(value) || !/^[a-z][a-z0-9+.-]*:/i.test(value)) {
const src = heroVideo(value)
const src = mediaUrl(value)
if (src) return { kind: 'file', src }
}
return null

View file

@ -152,8 +152,6 @@ export function refHref(
}
}
/* What to call the kind in a breadcrumb or a back link. */
/* Where "back" goes from a record page. A chapter belongs to
/community, a retreat to /retreats. */
export function orgListHref(kind?: string | null): { to: string; label: string } {

View file

@ -24,72 +24,17 @@
const ABSOLUTE = /^(https?:|\/|data:)/
function inDir(dir: string) {
return (file?: string | null): string | null => {
if (!file) return null
if (ABSOLUTE.test(file)) return file
return `${dir}/${file}`
}
}
const UPLOADS = '/uploads'
export const UPLOADS = '/uploads'
const inUploads = inDir(UPLOADS)
/* One helper per field, all the same rule, so a caller says what the
image is and a future exception is one line here. */
export const personPhoto = inUploads
export const eventLogo = inUploads
export const eventBackground = inUploads
export const orgLogo = inUploads
export const teamLogo = inUploads
export const awardLogo = inUploads
/* front_page_slides.media, the hero's photos. */
export const heroPhoto = inUploads
/* front_page.video_url when it names a file rather than a link.
Videos can't be uploaded through the media library, so a file is
one copied into the uploads directory by hand. */
export const heroVideo = inUploads
/* content_blocks.media and content_block_items.media. */
export const blockMedia = inUploads
/* featured_cards.image. */
export const featuredImage = inUploads
/* blog_posts.cover_image and guest_photo. */
export const blogImage = inUploads
/* ── By record kind ────────────────────────────────────────────
The timeline sends `logo: { file, kind }` rather than a path,
because v_timeline COALESCEs across five tables and only the
ref_kind says which one the filename came from. Featured cards
send the same shape. Every kind resolves to the uploads directory
today; the map is what lets one kind differ later.
───────────────────────────────────────────────────────────── */
const BY_KIND: Record<string, (file?: string | null) => string | null> = {
event: eventLogo,
organization: orgLogo,
team: teamLogo,
award: awardLogo,
person: personPhoto,
// Featured cards (loadFeaturedCards in shape.js) add two of their own.
'event-background': eventBackground,
featured: featuredImage,
}
export function logoForKind(
kind?: string | null,
file?: string | null,
): string | null {
/* Any record image or media field (photos, logos, backgrounds, hero
slides and video files, block and card images, blog covers), and
the timeline's and featured cards' `{ file, kind }` logos by their
file. One rule for all of them; if a kind ever needs its own
directory, that's the time to add a parameter. */
export function mediaUrl(file?: string | null): string | null {
if (!file) return null
// An unrecognised kind still renders: a filename with no home
// directory is a bug, but a broken <img> says so louder than a
// silently absent one.
return (BY_KIND[kind ?? ''] ?? blockMedia)(file)
if (ABSOLUTE.test(file)) return file
return `${UPLOADS}/${file}`
}
/* Initials for a photo that is missing or fails to load. Same

5
src/lib/motion.ts Normal file
View file

@ -0,0 +1,5 @@
/* Smooth scrolling, unless the visitor has asked for less motion.
index.css covers CSS scrolling; this is for scrollIntoView and
scrollTo calls, which don't read that setting themselves. */
export const scrollBehavior = (): ScrollBehavior =>
window.matchMedia('(prefers-reduced-motion: reduce)').matches ? 'auto' : 'smooth'

View file

@ -23,6 +23,7 @@
fetch.
═══════════════════════════════════════════════════════════════ */
import { isBadId, orgHref } from "./hrefs.ts";
import { useResource } from "./useResource.ts";
@ -41,20 +42,15 @@ export function useOrganizations(kind) {
}
/* ── Where an organization's page lives ────────────────────────
One place to change when routes move. Kinds with no page of
their own return null, and a list should render no link rather
than a dead one.
The route is hrefs.ts's (orgHref). A list links only the kinds
with a page of their own, and renders no link rather than a dead
one for the rest (NGU itself) or a bad id.
───────────────────────────────────────────────────────────── */
const PATHS = {
region: "/regions",
chapter: "/chapters",
partner: "/partners",
};
const WITH_PAGE = new Set(["region", "chapter", "partner"]);
export function orgPath(org) {
const base = PATHS[org?.kind];
return base ? `${base}/${org.id}` : null;
return WITH_PAGE.has(org?.kind) && !isBadId(org.id) ? orgHref(org.id, org.kind) : null;
}
/* ── "AK, ID, MT, OR, UT (Salt Lake City area), WA" ────────────

View file

@ -24,7 +24,7 @@ import siteConfiguration from '../../site.json'
type PageText = { title: string; description: string }
type SiteText = { title?: string; pages?: Record<string, PageText> }
type SiteText = { title?: string; pages?: Record<string, PageText>; privacyEmail?: string }
/* What the server wrote into the page, if it did. */
const fromServer: SiteText =
@ -34,12 +34,15 @@ export const SITE_NAME: string = fromServer.title || siteConfiguration.title
export const SITE_ORIGIN: string = siteConfiguration.url
/** Where privacy questions and data requests go (Panel → Site
* settings, else site.json). Blank: the Privacy page's form only. */
export const PRIVACY_EMAIL: string = fromServer.privacyEmail ?? siteConfiguration.privacyEmail
/** A site path as a full URL on the live site. */
export const siteUrl = (path: string): string => new URL(path, SITE_ORIGIN).href
const PAGES: Record<string, PageText> = { ...siteConfiguration.pages, ...fromServer.pages }
/** The static pages site.json knows, for the admin's page list. */
/** A static page's title and intro, from site.json's "pages". */
export function sitePage(path: string): PageText {
const page = PAGES[path]

View file

@ -30,7 +30,7 @@
═══════════════════════════════════════════════════════════════ */
import { refHref } from './hrefs.ts'
import { logoForKind, personPhoto } from './media.ts'
import { mediaUrl } from './media.ts'
import type { TimelineItem } from './timeline.ts'
/**
@ -58,18 +58,9 @@ export function hrefFor(item: TimelineItem): string | null {
}
/**
* The entry's image, resolved against the directory for whatever
* kind of record the filename came from.
* The entry's image, whatever kind of record the filename came from.
*/
export function logoSrc(item: TimelineItem): string | null {
if (!item.logo) return null
return logoForKind(item.logo.kind, item.logo.file)
}
/**
* A roster member's photo. Same rule as everywhere else, the API
* sends a bare filename.
*/
export function photoSrc(photo?: string | null): string | null {
return personPhoto(photo)
return mediaUrl(item.logo.file)
}

View file

@ -125,7 +125,6 @@ export type EventRecord = {
org_logo?: string | null
event_logo?: string | null
color?: string | null
gradient?: string | null
/** Behind the card. See 029_event_card_image.sql. */
card_image?: string | null
/* In billing order. The first is the one `color` and `org_logo`

View file

@ -104,7 +104,7 @@ export type FeaturedCard = {
eyebrow?: string | null
title?: string | null
blurb?: string | null
/** Resolve with logoForKind in media.ts. */
/** Resolve the file with mediaUrl in media.ts. */
image: { file: string; kind: string } | null
}

View file

@ -1,83 +1,17 @@
/**
* Loads the history timeline from `GET /api/history`.
* Loads the history timeline from `GET /api/history`, through
* useRecord (its `items`), so it shares the cache, the reload that
* invalidates first, and the error handling with every detail page.
*
* Goes through the shared client, so the request is deduped and cached
* for 60s like every other read. Two consequences worth knowing:
*
* · `reload` has to invalidate before it refetches. Without that, the
* retry button inside the TTL would hand back the same settled
* promise and look like it did nothing. A *failed* request is
* already evicted by the client, so this matters for the refresh
* case rather than the error case.
*
* · there's no AbortController. `get` shares one promise between
* callers, so aborting on unmount would cancel someone else's
* request. The `live` flag drops the result instead.
*
*
* `undated` is the number of published entries the API left out because
* nothing gave them a date. Not rendered publicly, a visitor can't act
* on it, but returned so it's reachable if you want a warning in the
* admin later.
* The API also sends `undated`, the number of published entries it
* left out for having no date. Nothing shows it; read it here if the
* admin ever wants a warning.
*/
import { useCallback, useEffect, useState } from 'react'
import { get, invalidate, ApiError } from './api.ts'
import type { TimelineItem } from './timeline.ts'
import { useRecord } from './useRecord.ts'
const PATH = '/history'
type HistoryResponse = {
items?: TimelineItem[]
undated?: number
}
type State = {
items: TimelineItem[]
undated: number
loading: boolean
error: string | null
reload: () => void
}
export function useHistory(): State {
const [items, setItems] = useState<TimelineItem[]>([])
const [undated, setUndated] = useState(0)
const [loading, setLoading] = useState(true)
const [error, setError] = useState<string | null>(null)
const [attempt, setAttempt] = useState(0)
const reload = useCallback(() => {
invalidate(PATH)
setAttempt((n) => n + 1)
}, [])
useEffect(() => {
let live = true
async function load() {
setLoading(true)
setError(null)
try {
const data: HistoryResponse = await get(PATH)
if (!live) return
setItems(Array.isArray(data?.items) ? data.items : [])
setUndated(Number(data?.undated) || 0)
} catch (err) {
if (!live) return
setError(
err instanceof ApiError ? err.message : "Couldn't reach the server.",
)
} finally {
if (live) setLoading(false)
}
}
load()
return () => {
live = false
}
}, [attempt])
return { items, undated, loading, error, reload }
export function useHistory() {
const { data, loading, error, reload } = useRecord<TimelineItem[]>('/history', 'items')
return { items: data ?? [], loading, error, reload }
}

View file

@ -1,6 +1,5 @@
/**
* useRecord, one record from one endpoint, on the useHistory
* pattern.
* useRecord, one record (one top-level key) from one endpoint.
*
* Named for what it returns, and deliberately not useResource:
* src/lib/useResource.ts is a different hook, it hands back the
@ -21,7 +20,7 @@
* out would silently use a stale closure. A string has neither
* problem.
*
* Carried over from useHistory, and worth restating:
* Worth knowing:
*
* · `reload` invalidates before it refetches. Without that, the
* retry button inside the 60s TTL hands back the same settled

View file

@ -22,10 +22,11 @@ import PageShell from '../components/PageShell.tsx'
import PageState from '../components/PageState.tsx'
import { useAward, type Recipient } from '../lib/useContent.ts'
import { eventHref, orgHref, personHref } from '../lib/hrefs.ts'
import { awardLogo, initials, personPhoto } from '../lib/media.ts'
import { mediaUrl, initials } from '../lib/media.ts'
import { accentText } from '../lib/color.ts'
const TEAL = '#0f7183'
const BODY = '#4a6b72'
const BODY = 'var(--color-muted)'
export default function AwardDetail() {
const { id } = useParams()
@ -46,7 +47,7 @@ export default function AwardDetail() {
}
const accent = TEAL
const logo = awardLogo(award.logo)
const logo = mediaUrl(award.logo)
return (
<PageShell
@ -61,7 +62,7 @@ export default function AwardDetail() {
? 'Nobody has received this yet.'
: undefined,
accent,
background: '#ffffff',
background: 'var(--color-surface)',
content: (
<div className="max-w-6xl mx-auto px-6 space-y-8">
<div className="flex flex-wrap items-center gap-x-6 gap-y-3 text-sm">
@ -75,7 +76,7 @@ export default function AwardDetail() {
<Link
to={orgHref(award.org.id, award.org.kind)}
className="font-medium hover:underline"
style={{ color: accent }}
style={{ color: accentText(accent) }}
>
{award.org.name}
</Link>
@ -104,7 +105,7 @@ export default function AwardDetail() {
}
function RecipientRow({ recipient, accent }: { recipient: Recipient; accent: string }) {
const photo = personPhoto(recipient.photo)
const photo = mediaUrl(recipient.photo)
return (
<div className="flex gap-5">
@ -131,7 +132,7 @@ function RecipientRow({ recipient, accent }: { recipient: Recipient; accent: str
<Link
to={personHref(recipient.id)}
className="hover:underline"
style={{ color: accent }}
style={{ color: accentText(accent) }}
>
{recipient.name}
</Link>
@ -150,7 +151,7 @@ function RecipientRow({ recipient, accent }: { recipient: Recipient; accent: str
<Link
to={eventHref(recipient.event.id)}
className="hover:underline"
style={{ color: accent }}
style={{ color: accentText(accent) }}
>
{recipient.event.title}
</Link>

View file

@ -16,11 +16,12 @@ import PageShell, { type ShellSection } from '../components/PageShell.tsx'
import PageState from '../components/PageState.tsx'
import ContentBlocks from '../components/ContentBlocks.tsx'
import PeopleTiles from '../components/PeopleTiles.tsx'
import { blogImage, personPhoto } from '../lib/media.ts'
import { mediaUrl } from '../lib/media.ts'
import { postDate, useBlogPost } from '../lib/useBlog.ts'
import { accentText } from '../lib/color.ts'
const ACCENT = '#0f7183'
const BODY = '#4a6b72'
const BODY = 'var(--color-muted)'
/* Where "back" goes: the section on the Community page. */
const BACK = { to: '/community#blog', label: 'Community Blog' }
@ -44,7 +45,7 @@ export default function BlogPost() {
}
const date = postDate(post.published_on)
const cover = blogImage(post.cover_image)
const cover = mediaUrl(post.cover_image)
const byline = [
...post.authors.map((author) => author.name),
...(post.guest ? [post.guest.name] : []),
@ -56,9 +57,9 @@ export default function BlogPost() {
name: author.name,
tagline: author.tagline,
pronouns: author.pronouns,
photo: personPhoto(author.photo),
photo: mediaUrl(author.photo),
})),
...(post.guest ? [{ name: post.guest.name, title: 'Guest author', photo: blogImage(post.guest.photo) }] : []),
...(post.guest ? [{ name: post.guest.name, title: 'Guest author', photo: mediaUrl(post.guest.photo) }] : []),
]
const sections: ShellSection[] = [
@ -66,7 +67,7 @@ export default function BlogPost() {
id: 'post',
title: 'Post',
accent: ACCENT,
background: '#ffffff',
background: 'var(--color-surface)',
content: (
<article className="mx-auto max-w-3xl space-y-8 px-6">
<div className="flex flex-wrap items-center gap-x-4 gap-y-2 text-sm" style={{ color: BODY }}>
@ -76,12 +77,12 @@ export default function BlogPost() {
<span
key={tag}
className="rounded-full px-3 py-0.5 text-xs font-semibold"
style={{ background: '#eef9fb', color: ACCENT }}
style={{ background: 'var(--color-tint)', color: accentText(ACCENT) }}
>
{tag}
</span>
))}
<Link to={BACK.to} className="ml-auto hover:underline" style={{ color: ACCENT }}>
<Link to={BACK.to} className="ml-auto hover:underline" style={{ color: accentText(ACCENT) }}>
{BACK.label}
</Link>
</div>
@ -101,7 +102,7 @@ export default function BlogPost() {
id: 'authors',
title: authors.length === 1 ? 'About the author' : 'About the authors',
accent: ACCENT,
background: '#eef9fb',
background: 'var(--color-tint)',
content: (
<div className="mx-auto max-w-6xl px-6">
<PeopleTiles size="md" accent={ACCENT} people={authors} />

View file

@ -31,7 +31,7 @@ const SECTIONS = [
blurb:
"Young adult groups meeting in person and online across the movement.",
accent: "#0f7183",
background: "#eef9fb",
background: "var(--color-tint)",
Component: OrgListMap,
views: { options: ["map", "grid"], default: "map", Toggle: OrgMapToggle },
},
@ -41,7 +41,7 @@ const SECTIONS = [
blurb:
"The regional organizations that support chapters and host their own gatherings.",
accent: "#4a6b72",
background: "#ffffff",
background: "var(--color-surface)",
Component: OrgListVertical,
props: {
kind: "region",
@ -59,7 +59,7 @@ const SECTIONS = [
blurb:
"Organizations we collaborate with across the Unity movement and beyond.",
accent: "#7a5ea8",
background: "#eef9fb",
background: "var(--color-tint)",
Component: OrgListCards,
props: {
kind: "partner",
@ -78,7 +78,7 @@ export default function CommunityPage() {
title: blog?.title || BLOG_DEFAULT_TITLE,
blurb: blog?.blurb ?? undefined,
accent: "#0f7183",
background: "#ffffff",
background: "var(--color-surface)",
Component: CommunityBlog,
},
...SECTIONS,

View file

@ -30,13 +30,14 @@ import {
type EventRecord,
} from '../lib/useContent.ts'
import { awardHref, personHref, refHref } from '../lib/hrefs.ts'
import { personPhoto } from '../lib/media.ts'
import { mediaUrl } from '../lib/media.ts'
import { eventTypeLabel } from '../lib/eventTypes.ts'
import { occurrenceLabel, seriesLabel, seriesTimes, upcomingOccurrences } from '../lib/eventSeries.ts'
import { capitalize } from '../lib/text.ts'
import { accentText, readableOn } from '../lib/color.ts'
const TEAL = '#0f7183'
const BODY = '#4a6b72'
const BODY = 'var(--color-muted)'
/* Billing order. A role missing from here still renders, at the
end, under its own name, better than a speaker vanishing
@ -94,7 +95,7 @@ export default function EventDetail() {
title: event.theme || 'About',
blurb: event.theme ? event.tagline ?? undefined : undefined,
accent,
background: '#ffffff',
background: 'var(--color-surface)',
content: (
<div className="max-w-6xl mx-auto px-6 space-y-8">
<Facts event={event} accent={accent} />
@ -145,17 +146,17 @@ export default function EventDetail() {
title: 'Upcoming dates',
blurb: seriesLabel(event.series, event.starts_on) ?? undefined,
accent,
background: '#eef9fb',
background: 'var(--color-tint)',
content: (
<div className="max-w-6xl mx-auto px-6">
<ul className="grid gap-3 sm:grid-cols-2 lg:grid-cols-3">
{upcoming.map((date) => (
<li
key={date}
className="rounded-xl border-l-4 bg-white px-5 py-3"
className="rounded-xl border-l-4 bg-surface px-5 py-3"
style={{ borderColor: accent }}
>
<p className="font-semibold" style={{ color: accent }}>
<p className="font-semibold" style={{ color: accentText(accent) }}>
{occurrenceLabel(date)}
</p>
{times && (
@ -176,7 +177,7 @@ export default function EventDetail() {
id: 'people',
title: 'Who’s there',
accent,
background: '#eef9fb',
background: 'var(--color-tint)',
content: (
<div className="max-w-6xl mx-auto px-6">
<PeopleTiles size="lg" groups={groups} accent={accent} />
@ -191,7 +192,7 @@ export default function EventDetail() {
title: 'Presented here',
blurb: 'Awards given at this gathering.',
accent,
background: '#ffffff',
background: 'var(--color-surface)',
content: (
<div className="max-w-6xl mx-auto px-6 space-y-6">
{event.awards.map((entry, index) => (
@ -201,7 +202,7 @@ export default function EventDetail() {
style={{ borderColor: accent }}
>
<div>
<p className="font-semibold" style={{ color: accent }}>
<p className="font-semibold" style={{ color: accentText(accent) }}>
<Link to={awardHref(entry.award.id)} className="hover:underline">
{entry.award.name}
</Link>
@ -254,7 +255,7 @@ function Facts({ event, accent }: { event: EventRecord; accent: string }) {
className="rounded-full px-3 py-1 font-semibold uppercase tracking-wide"
style={{
background: event.status === 'cancelled' ? '#b3261e' : accent,
color: '#ffffff',
color: event.status === 'cancelled' ? '#ffffff' : readableOn(accent),
}}
>
{STATUS_LABEL[event.status] ?? event.status}
@ -269,7 +270,7 @@ function Facts({ event, accent }: { event: EventRecord; accent: string }) {
{event.event_type && (
<span
className="rounded-full px-3 py-1 font-semibold uppercase tracking-wide"
style={{ border: `1px solid ${accent}`, color: accent }}
style={{ border: `1px solid ${accent}`, color: accentText(accent) }}
>
{eventTypeLabel(event.event_type)}
</span>
@ -288,7 +289,7 @@ function Facts({ event, accent }: { event: EventRecord; accent: string }) {
</span>
)}
<Link to="/retreats" className="ml-auto hover:underline" style={{ color: accent }}>
<Link to="/retreats" className="ml-auto hover:underline" style={{ color: accentText(accent) }}>
All retreats
</Link>
</div>
@ -314,7 +315,7 @@ function HostList({ hosts, accent }: { hosts: EventHost[]; accent: string }) {
<Link
to={to}
className="font-medium hover:underline"
style={{ color: accent }}
style={{ color: accentText(accent) }}
>
{host.name}
</Link>
@ -394,7 +395,7 @@ function peopleGroups(people: EventPerson[], accent: string): PeopleGroupInput[]
pronouns: person.pronouns,
// PeopleTiles resolves a bare filename itself; this is here
// so a hand-written entry elsewhere can't diverge.
photo: personPhoto(person.photo),
photo: mediaUrl(person.photo),
})),
}))
}

View file

@ -26,7 +26,7 @@ const SECTIONS = [
blurb:
"Found a broken link, spotted something out of date, or want the site to do something it doesn't? This form goes straight to the people who maintain it.",
accent: ACCENT,
background: "#eef9fb",
background: "var(--color-tint)",
content: (
// Narrower than the usual max-w-6xl: full-width form fields
// are unpleasant to fill in.

View file

@ -78,7 +78,7 @@ export default function GivingPage() {
blurb:
"Your giving funds scholarships, retreats, leadership development and the continued growth of the Next Generation of Unity leaders, teachers and community members.",
accent: ACCENT,
background: "#eef9fb",
background: "var(--color-tint)",
content: <GivingPanel />,
},
];

View file

@ -15,7 +15,7 @@ const PAGE = sitePage("/history");
const PROGRAM_START_YEAR = 2000;
const ACCENT = "#0f7183";
const BACKGROUND = "#ffffff";
const BACKGROUND = "var(--color-surface)";
export default function History() {
const { items, loading, error, reload } = useHistory();
@ -37,7 +37,7 @@ export default function History() {
if (loading) {
content = wrap(
<p className="py-12 text-[#4a6b72]" role="status">
<p className="py-12 text-muted" role="status">
Loading the timeline…
</p>,
);
@ -47,11 +47,11 @@ export default function History() {
// organization with no history.
content = wrap(
<div className="py-12">
<p className="text-[#b3261e]">Couldn’t load the timeline. {error}</p>
<p className="text-danger">Couldn’t load the timeline. {error}</p>
<button
type="button"
onClick={reload}
className="mt-3 rounded-full border border-[#138ba0] px-4 py-1.5 text-sm font-medium text-[#0f7183] transition-colors hover:bg-[#eef9fb]"
className="mt-3 rounded-full border border-brand px-4 py-1.5 text-sm font-medium text-link transition-colors hover:bg-tint"
>
Try again
</button>

View file

@ -116,11 +116,11 @@ export default function Home() {
{error && (
<section className="px-6 py-24 text-center">
<p className="text-[#b3261e]">Couldn’t load the front page. {error}</p>
<p className="text-danger">Couldn’t load the front page. {error}</p>
<button
type="button"
onClick={reload}
className="mt-4 rounded-full border border-[#138ba0] px-5 py-2 font-semibold text-[#0f7183] hover:bg-[#eef9fb]"
className="mt-4 rounded-full border border-brand px-5 py-2 font-semibold text-link hover:bg-tint"
>
Try again
</button>

View file

@ -11,7 +11,7 @@ const SECTIONS = [
title: "Board & Staff",
blurb: "The people guiding Next Generation of Unity day to day.",
accent: "#0f7183",
background: "#eef9fb",
background: "var(--color-tint)",
content: (
<div className="max-w-6xl mx-auto px-6">
<PeopleTiles size="lg" teams={{ id: "ngu-board",}} />
@ -23,7 +23,7 @@ const SECTIONS = [
title: "Retreat Team",
blurb: "Volunteers who plan and lead our gatherings throughout the year.",
accent: "#4a7a2f",
background: "#ffffff",
background: "var(--color-surface)",
content: (
<div className="max-w-6xl mx-auto px-6">
<PeopleTiles size="lg" teams="ngu-retreat-team" />
@ -35,7 +35,7 @@ const SECTIONS = [
title: "Committees & Volunteers",
blurb: "Additional roles and contributors.",
accent: "#7a5ea8",
background: "#eef9fb",
background: "var(--color-tint)",
content: (
<div className="max-w-6xl mx-auto px-6">
{/* Other roles content */}
@ -47,7 +47,7 @@ const SECTIONS = [
title: "Contact Us",
blurb: "Reach out to our staff",
accent: "#004c52",
background: "#ffffff",
background: "var(--color-surface)",
content: (
<div className="max-w-6xl mx-auto px-6">
<a

View file

@ -30,10 +30,12 @@ import {
type OrganizationRecord,
} from '../lib/useContent.ts'
import { orgHref, orgListHref, teamHref } from '../lib/hrefs.ts'
import { orgLogo, personPhoto } from '../lib/media.ts'
import { initials, mediaUrl } from '../lib/media.ts'
import Logo from '../components/Logo.tsx'
import { withAlpha, accentText, readableOn } from '../lib/color.ts'
const TEAL = '#0f7183'
const BODY = '#4a6b72'
const BODY = 'var(--color-muted)'
export default function OrganizationDetail() {
const { id } = useParams()
@ -78,7 +80,7 @@ export default function OrganizationDetail() {
id: 'about',
title: 'About',
accent,
background: '#ffffff',
background: 'var(--color-surface)',
content: (
<div className="max-w-6xl mx-auto px-6 space-y-8">
<Facts org={org} accent={accent} back={back} />
@ -106,7 +108,7 @@ export default function OrganizationDetail() {
id: 'leadership',
title: 'Who runs it',
accent,
background: '#eef9fb',
background: 'var(--color-tint)',
content: (
<div className="max-w-6xl mx-auto px-6 space-y-12">
{teamBlocks.map((block) => (
@ -117,14 +119,14 @@ export default function OrganizationDetail() {
<Link
to={teamHref(block.teamId)}
className="hover:underline"
style={{ color: accent }}
style={{ color: accentText(accent) }}
>
{block.label}
</Link>
</h3>
) : (
block.label && (
<h3 className="text-xl font-bold" style={{ color: accent }}>
<h3 className="text-xl font-bold" style={{ color: accentText(accent) }}>
{block.label}
</h3>
)
@ -146,7 +148,7 @@ export default function OrganizationDetail() {
title: leader.title,
pronouns: leader.pronouns,
public_email: leader.public_email,
photo: personPhoto(leader.photo),
photo: mediaUrl(leader.photo),
is_owner: leader.is_owner,
}))}
/>
@ -168,19 +170,19 @@ export default function OrganizationDetail() {
title: 'Chapters',
blurb: org.details.map_note ?? undefined,
accent,
background: '#ffffff',
background: 'var(--color-surface)',
content: (
<div className="max-w-6xl mx-auto px-6 grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
{(org.details.chapters ?? []).map((chapter) => (
<Link
key={chapter.id}
to={orgHref(chapter.id, 'chapter')}
className="flex items-center gap-4 rounded-lg border p-4 transition-colors hover:bg-[#eef9fb]"
style={{ borderColor: `${accent}40` }}
className="flex items-center gap-4 rounded-lg border p-4 transition-colors hover:bg-tint"
style={{ borderColor: `${withAlpha(accent, 25)}` }}
>
<Logo file={chapter.logo} name={chapter.name} accent={accent} />
<ChapterMark file={chapter.logo} name={chapter.name} accent={accent} />
<span>
<span className="block font-semibold" style={{ color: accent }}>
<span className="block font-semibold" style={{ color: accentText(accent) }}>
{chapter.name}
</span>
{chapter.location_label && (
@ -202,17 +204,17 @@ export default function OrganizationDetail() {
title: 'Awards',
blurb: `Given by ${org.short_name || org.name}.`,
accent,
background: '#eef9fb',
background: 'var(--color-tint)',
content: (
<div className="max-w-6xl mx-auto px-6 grid gap-4 sm:grid-cols-2">
{org.awards.map((award) => (
<Link
key={award.id}
to={`/awards/${award.id}`}
className="rounded-lg border bg-white p-5 transition-colors hover:bg-[#f6fbfc]"
style={{ borderColor: `${accent}40` }}
className="rounded-lg border bg-surface p-5 transition-colors hover:bg-tint-soft"
style={{ borderColor: `${withAlpha(accent, 25)}` }}
>
<span className="block font-semibold" style={{ color: accent }}>
<span className="block font-semibold" style={{ color: accentText(accent) }}>
{award.name}
</span>
{award.description && (
@ -246,7 +248,7 @@ export default function OrganizationDetail() {
id: 'events',
title: 'Gatherings',
accent,
background: '#ffffff',
background: 'var(--color-surface)',
content: (
<EventListCards
host={org.id}
@ -304,7 +306,7 @@ function Facts({
)}
{org.is_online && <span style={{ color: BODY }}>Online</span>}
<Link to={back.to} className="ml-auto hover:underline" style={{ color: accent }}>
<Link to={back.to} className="ml-auto hover:underline" style={{ color: accentText(accent) }}>
{back.label}
</Link>
</div>
@ -347,8 +349,8 @@ function Contact({ org, accent }: { org: OrganizationRecord; accent: string }) {
href={link.url}
target="_blank"
rel="noreferrer"
className="inline-flex items-center gap-2 rounded-full border px-4 py-1.5 text-sm font-medium transition-colors hover:bg-[#eef9fb]"
style={{ borderColor: accent, color: accent }}
className="inline-flex items-center gap-2 rounded-full border px-4 py-1.5 text-sm font-medium transition-colors hover:bg-tint"
style={{ borderColor: accent, color: accentText(accent) }}
>
<PlatformIcon platform={link.platform} />
{link.label}
@ -358,28 +360,22 @@ function Contact({ org, accent }: { org: OrganizationRecord; accent: string }) {
)
}
function Logo({
file,
name,
accent,
}: {
file?: string | null
name: string
accent: string
}) {
const src = orgLogo(file)
if (!src) {
return (
<span
aria-hidden="true"
className="flex h-10 w-10 shrink-0 items-center justify-center rounded-full text-xs font-bold text-white"
style={{ background: accent }}
>
{name.slice(0, 2).toUpperCase()}
</span>
)
}
return <img src={src} alt="" loading="lazy" className="h-10 w-10 shrink-0 object-contain" />
function ChapterMark({ file, name, accent }: { file?: string | null; name: string; accent: string }) {
return (
<Logo
src={mediaUrl(file)}
className="h-10 w-10 shrink-0 object-contain"
fallback={
<span
aria-hidden="true"
className="flex h-10 w-10 shrink-0 items-center justify-center rounded-full text-xs font-bold"
style={{ background: accent, color: readableOn(accent) }}
>
{initials(name)}
</span>
}
/>
)
}
/* ── Leadership → team blocks ────────────────────────────────── */

View file

@ -31,13 +31,14 @@ import {
type PersonRole,
} from '../lib/useContent.ts'
import { awardHref, eventHref, orgHref, teamHref } from '../lib/hrefs.ts'
import { initials, personPhoto } from '../lib/media.ts'
import { mediaUrl, initials } from '../lib/media.ts'
import { eventTypeLabel } from '../lib/eventTypes.ts'
import { capitalize } from '../lib/text.ts'
import { accentText } from '../lib/color.ts'
const TEAL = '#0f7183'
const BODY = '#4a6b72'
const BACKGROUNDS = ['#ffffff', '#eef9fb']
const BODY = 'var(--color-muted)'
const BACKGROUNDS = ['var(--color-surface)', 'var(--color-tint)']
/* affiliations.role, for a row with no title of its own. */
const ROLE_LABEL: Record<string, string> = {
@ -110,7 +111,7 @@ export default function PersonDetail() {
{previous.length > 0 && (
<div>
{current.length > 0 && (
<h3 className="mb-4 text-lg font-semibold" style={{ color: accent }}>
<h3 className="mb-4 text-lg font-semibold" style={{ color: accentText(accent) }}>
Previously
</h3>
)}
@ -156,7 +157,7 @@ export default function PersonDetail() {
className="border-l-2 pl-5"
style={{ borderColor: accent }}
>
<p className="font-semibold" style={{ color: accent }}>
<p className="font-semibold" style={{ color: accentText(accent) }}>
<Link to={awardHref(entry.award.id)} className="hover:underline">
{entry.award.name}
</Link>
@ -170,7 +171,7 @@ export default function PersonDetail() {
<Link
to={eventHref(entry.event.id)}
className="hover:underline"
style={{ color: accent }}
style={{ color: accentText(accent) }}
>
{entry.event.title}
</Link>
@ -198,7 +199,7 @@ export default function PersonDetail() {
/* ── The strip of facts under the heading ────────────────────── */
function Facts({ person, accent }: { person: PersonRecord; accent: string }) {
const photo = personPhoto(person.photo)
const photo = mediaUrl(person.photo)
return (
<div className="flex flex-wrap items-center gap-x-6 gap-y-3 text-sm">
@ -226,7 +227,7 @@ function Facts({ person, accent }: { person: PersonRecord; accent: string }) {
<Link
to={orgHref(person.org.id, person.org.kind)}
className="font-medium hover:underline"
style={{ color: accent }}
style={{ color: accentText(accent) }}
>
{person.org.name}
</Link>
@ -234,7 +235,7 @@ function Facts({ person, accent }: { person: PersonRecord; accent: string }) {
{person.location_label && <span style={{ color: BODY }}>{person.location_label}</span>}
<Link to="/leadership" className="ml-auto hover:underline" style={{ color: accent }}>
<Link to="/leadership" className="ml-auto hover:underline" style={{ color: accentText(accent) }}>
Leadership
</Link>
</div>
@ -274,8 +275,8 @@ function Contact({ person, accent }: { person: PersonRecord; accent: string }) {
href={link.url}
target="_blank"
rel="noreferrer"
className="inline-flex items-center gap-2 rounded-full border px-4 py-1.5 text-sm font-medium transition-colors hover:bg-[#eef9fb]"
style={{ borderColor: accent, color: accent }}
className="inline-flex items-center gap-2 rounded-full border px-4 py-1.5 text-sm font-medium transition-colors hover:bg-tint"
style={{ borderColor: accent, color: accentText(accent) }}
>
<PlatformIcon platform={link.platform} />
{link.label}
@ -293,10 +294,10 @@ function RoleList({ roles, accent }: { roles: PersonRole[]; accent: string }) {
{roles.map((role, index) => (
<li
key={`${role.org.id}:${role.team?.id ?? ''}:${role.title ?? role.role}:${index}`}
className="rounded-xl border-l-4 bg-white px-5 py-3"
className="rounded-xl border-l-4 bg-surface px-5 py-3"
style={{ borderColor: accent }}
>
<p className="font-semibold" style={{ color: accent }}>
<p className="font-semibold" style={{ color: accentText(accent) }}>
{role.title || ROLE_LABEL[role.role] || capitalize(role.role)}
</p>
<p className="text-sm" style={{ color: BODY }}>
@ -344,7 +345,7 @@ function EventRow({ event, accent }: { event: PersonEvent; accent: string }) {
return (
<div className="border-l-2 pl-5" style={{ borderColor: accent }}>
<p className="font-semibold" style={{ color: accent }}>
<p className="font-semibold" style={{ color: accentText(accent) }}>
<Link to={eventHref(event.id)} className="hover:underline">
{event.title}
</Link>

View file

@ -1,30 +1,191 @@
import { Link } from "react-router-dom";
import LegalText, { type LegalPart } from "../components/LegalText.tsx";
import PageShell from "../components/PageShell.tsx";
import { sitePage } from "../lib/site.ts";
import { DATA_REQUEST } from "../data/feedbackTypes.ts";
import { PRIVACY_EMAIL, sitePage } from "../lib/site.ts";
import FeedbackForm from "./sections/FeedbackForm.tsx";
/* Title and intro: site.json, which also gives the search metadata. */
const PAGE = sitePage("/privacy");
/* ═══════════════════════════════════════════════════════════════
Privacy policy, cookie notice included.
What it says must stay true of the code: what the feedback form
stores (routes/feedback.js), what the browser keeps (Banner,
PrivacyNotice, the theme toggle), which embeds wait for a click
(VideoPlayer, HeroStage, ScheduleBlock), and that nothing about
a minor is shown. Change the date when the wording changes.
The contact address is Panel → Site settings → Privacy contact
email. Requests from the form below are feedback rows of type
'privacy', in Admin → Feedback.
═══════════════════════════════════════════════════════════════ */
const LAST_UPDATED = "September 28, 2026";
const ACCENT = "#0f7183";
const link = "underline underline-offset-2 text-link";
const contact = PRIVACY_EMAIL ? (
<>
email <a className={link} href={`mailto:${PRIVACY_EMAIL}`}>{PRIVACY_EMAIL}</a> or use the{" "}
<a className={link} href="#requests">request form</a> below
</>
) : (
<>
use the <a className={link} href="#requests">request form</a> below
</>
);
const PARTS: LegalPart[] = [
{
id: "summary",
heading: "In short",
body: [
"We collect some information about the people who use this site and take part in Next Generation of Unity (NGU). We use it to run our programs and this website, we don't sell it, and we don't use advertising or tracking cookies.",
<>If you want to see, correct or delete what we hold about you, {contact}.</>,
],
},
{
id: "what-we-collect",
heading: "What we collect",
body: ["Depending on how you use the site and our programs:"],
list: [
<>
<strong>Feedback and requests you send.</strong> Your message, the page it's about, and, if you
give them, your name and email. With it we keep your browser's description (its user agent) and
a scrambled form of your IP address that can't be turned back into the address; we use it only to
spot abuse.
</>,
<>
<strong>People on the site.</strong> Leaders, speakers and volunteers can appear with a name,
photo, role, short bio and public contact details. Staff may also keep private details, such as a
birth date, private email, phone number or address, which are never shown on the site and can
only be seen by our editors.
</>,
<>
<strong>Server records.</strong> Like most websites, our server keeps short-lived logs of
requests (the page asked for, the time, and the IP address that asked) to keep the site running
and secure.
</>,
<>
<strong>Staff accounts.</strong> For NGU staff and volunteers who sign in to edit the site: name,
email, role, and a record of sign-ins. Passwords are stored only in a form that can't be read back.
</>,
],
},
{
id: "minors",
heading: "Young people",
body: [
"We don't show information about anyone under 18 on this site: no names, photos or details. If you believe something about a minor appears here, tell us and we'll take it down.",
],
},
{
id: "how-we-use",
heading: "How we use it",
body: [
"To answer you, to run our retreats, chapters and other programs, to keep this site accurate and working, and to keep it secure. We don't sell or rent your information, and we don't use it for advertising.",
],
},
{
id: "ai",
heading: "Artificial intelligence",
body: [
"We used AI tools to help write this website's code and build its structure. Those tools have no access to our database. Information you give us, and information we hold about the people in our community, is not given to AI systems, and isn't used to train them.",
],
},
{
id: "third-parties",
heading: "Other services",
body: [
"We try not to rely on other companies, but a few parts of the site are provided by them. When you use those parts, what you enter or do there goes to that company and is covered by its own privacy policy:",
],
list: [
<>
<strong>Giving</strong> is handled by Church Center (Planning Center). Payment details go to them,
not to us.
</>,
<>
<strong>Videos</strong> come from YouTube, Facebook or Vimeo, and <strong>maps</strong> from Google
Maps. Nothing from them loads until you press play or choose to show the map.
</>,
<>
<strong>Links</strong> to social media, Substack and other sites take you to those sites, which
follow their own rules.
</>,
<>
<strong>Staff sign-in</strong> can use a Google account on our own domain.
</>,
],
after: [
"This site runs on a server we rent and manage ourselves; your information is stored there, not with an outside website service.",
],
},
{
id: "cookies",
heading: "Cookies and browser storage",
body: [
"This site doesn't use advertising, analytics or tracking cookies. It 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.",
"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: [
"None of these are shared with anyone. If you press play on a video or show a map, that service (YouTube, Facebook, Vimeo or Google) may set its own cookies from then on. You can clear all of this in your browser's settings at any time.",
],
},
{
id: "your-rights",
heading: "Your choices",
body: [
<>
You can ask to see the information we hold about you, to correct it, or to have it deleted. To do
that, {contact}. We may ask you to confirm it's you before we change or delete anything, and we'll
tell you when it's done. Some records we may need to keep, such as records of gifts that the law
requires; if so, we'll say which and why.
</>,
],
},
{
id: "changes",
heading: "Changes to this policy",
body: [
<>
If we change how we handle information, we'll update this page and the date at the top. See also
our <Link className={link} to="/terms">Terms of Service</Link>.
</>,
],
},
];
const SECTIONS = [
{
id: "privacy",
title: "Privacy Policy",
blurb: "Last updated: [date]",
accent: "#0f7183",
background: "#eef9fb",
blurb: `Last updated: ${LAST_UPDATED}`,
accent: ACCENT,
background: "var(--color-surface)",
content: <LegalText parts={PARTS} />,
},
{
id: "requests",
title: "Data requests",
blurb: "Ask to see, correct or delete the information we hold about you.",
accent: ACCENT,
background: "var(--color-tint)",
content: (
<div className="max-w-3xl mx-auto px-6 leading-relaxed text-[#2c4a50]">
{/* Policy text goes here */}
<div className="mx-auto max-w-3xl px-6">
<FeedbackForm fixedType={DATA_REQUEST.id} />
</div>
),
},
];
export default function PrivacyPage() {
return (
<PageShell
title={PAGE.title}
intro={PAGE.description}
sections={SECTIONS}
/>
);
return <PageShell title={PAGE.title} intro={PAGE.description} sections={SECTIONS} />;
}

View file

@ -21,7 +21,7 @@ const SECTIONS = [
blurb:
'Pick a page from the main navigation, any event, organization, team, award, person or blog post, or type any link. Site pages always point at the live site. Choose what sits in the centre and the colours; a warning shows if the code might not scan.',
accent: '#0f7183',
background: '#eef9fb',
background: 'var(--color-tint)',
content: (
<div className="mx-auto max-w-6xl px-6">
<QrCodeMaker />

View file

@ -10,7 +10,7 @@ const SECTIONS = [
title: "Unity Teachings",
blurb: "Core principles, readings, and study material from the Unity movement.",
accent: "#0f7183",
background: "#eef9fb",
background: "var(--color-tint)",
content: (
<div className="max-w-6xl mx-auto px-6">
{/* Unity teachings content */}
@ -22,7 +22,7 @@ const SECTIONS = [
title: "Branding & Marketing",
blurb: "Logos, colors, templates, and guidelines for representing NGU.",
accent: "#4a7a2f",
background: "#ffffff",
background: "var(--color-surface)",
content: (
<div className="max-w-6xl mx-auto px-6">
{/* Branding & marketing content */}
@ -34,7 +34,7 @@ const SECTIONS = [
title: "Partner Resources",
blurb: "Material for the organizations we collaborate with.",
accent: "#7a5ea8",
background: "#eef9fb",
background: "var(--color-tint)",
content: (
<div className="max-w-6xl mx-auto px-6">
{/* Partner resources content */}

View file

@ -47,7 +47,7 @@ const SECTIONS = [
title: "National Retreats",
blurb: "Our flagship gatherings, open to young adults across the country.",
accent: "#0f7183",
background: "#eef9fb",
background: "var(--color-tint)",
Component: EventListCards,
props: { scope: "national", ...RETREATS },
views: { ...CARD_VIEWS, default: "carousel" },
@ -57,7 +57,7 @@ const SECTIONS = [
title: "Regional Retreats",
blurb: "Smaller gatherings hosted by regions throughout the year.",
accent: "#4a7a2f",
background: "#ffffff",
background: "var(--color-surface)",
Component: EventListCards,
props: { scope: "regional", ...RETREATS },
views: { ...CARD_VIEWS, default: "grid" },
@ -67,7 +67,7 @@ const SECTIONS = [
title: "Partner Events",
blurb: "Retreats hosted by organizations we collaborate with.",
accent: "#7a5ea8",
background: "#eef9fb",
background: "var(--color-tint)",
Component: EventListCards,
props: { scope: "partner", ...RETREATS },
views: { ...CARD_VIEWS, default: "grid" },
@ -82,7 +82,7 @@ const SECTIONS = [
title: "Local Events",
blurb: "Hosted by individual chapters.",
accent: "#9a5b17",
background: "#ffffff",
background: "var(--color-surface)",
Component: EventListCards,
props: { scope: "local", ...RETREATS_ONLY },
views: { ...CARD_VIEWS, default: "grid" },
@ -92,7 +92,7 @@ const SECTIONS = [
title: "International Events",
blurb: "Gatherings beyond the US.",
accent: "#2f6bb5",
background: "#eef9fb",
background: "var(--color-tint)",
Component: EventListCards,
props: { scope: "international", ...RETREATS_ONLY },
views: { ...CARD_VIEWS, default: "grid" },
@ -102,7 +102,7 @@ const SECTIONS = [
title: "Other Events",
blurb: "Everything that doesn't fit the categories above.",
accent: "#5d6c70",
background: "#ffffff",
background: "var(--color-surface)",
Component: EventListCards,
props: { scope: "other", ...RETREATS_ONLY },
views: { ...CARD_VIEWS, default: "grid" },

View file

@ -20,9 +20,10 @@ import ContentBlocks from '../components/ContentBlocks.tsx'
import PeopleTiles from '../components/PeopleTiles.tsx'
import { useTeam } from '../lib/useContent.ts'
import { orgHref } from '../lib/hrefs.ts'
import { accentText } from '../lib/color.ts'
const TEAL = '#0f7183'
const BODY = '#4a6b72'
const BODY = 'var(--color-muted)'
export default function TeamDetail() {
const { id } = useParams()
@ -53,7 +54,7 @@ export default function TeamDetail() {
id: 'about',
title: 'About',
accent,
background: '#ffffff',
background: 'var(--color-surface)',
content: (
<div className="max-w-6xl mx-auto px-6 space-y-8">
<Facts orgId={team.org.id} orgKind={team.org.kind} orgName={team.org.name} accent={accent} />
@ -94,7 +95,7 @@ export default function TeamDetail() {
id: 'members',
title: hasAbout ? 'Members' : team.name,
accent,
background: hasAbout ? '#eef9fb' : '#ffffff',
background: hasAbout ? 'var(--color-tint)' : 'var(--color-surface)',
content: (
<div className="max-w-6xl mx-auto px-6 space-y-6">
{!hasAbout && (
@ -139,7 +140,7 @@ function Facts({
<Link
to={orgHref(orgId, orgKind)}
className="font-medium hover:underline"
style={{ color: accent }}
style={{ color: accentText(accent) }}
>
{orgName}
</Link>
@ -148,7 +149,7 @@ function Facts({
<Link
to={orgHref(orgId, orgKind)}
className="ml-auto hover:underline"
style={{ color: accent }}
style={{ color: accentText(accent) }}
>
Back to {orgName}
</Link>

View file

@ -1,30 +1,93 @@
import { Link } from "react-router-dom";
import LegalText, { type LegalPart } from "../components/LegalText.tsx";
import PageShell from "../components/PageShell.tsx";
import { sitePage } from "../lib/site.ts";
/* Title and intro: site.json, which also gives the search metadata. */
const PAGE = sitePage("/terms");
/* Change the date when the wording changes. */
const LAST_UPDATED = "September 28, 2026";
const link = "underline underline-offset-2 text-link";
const PARTS: LegalPart[] = [
{
id: "using-the-site",
heading: "Using this site",
body: [
"This website belongs to Next Generation of Unity (NGU). By using it you agree to these terms. If you don't agree, please don't use the site.",
"You're welcome to read, share and link to anything here. Please don't try to break or overload the site, get into parts of it you haven't been given access to, or use it to break the law.",
],
},
{
id: "our-content",
heading: "Our content",
body: [
"The words, logos, photos and videos on this site belong to NGU or to the people who made them, and are used with permission. You can share them for personal and non-commercial use with credit to NGU. For anything else, including using our name or logo, ask us first.",
],
},
{
id: "what-you-send",
heading: "What you send us",
body: [
"When you send feedback or a request, you let us use it to answer you and to improve the site and our programs. Please don't send anything unlawful, abusive, or someone else's private information.",
],
},
{
id: "programs-and-giving",
heading: "Programs, events and giving",
body: [
"Dates, places and details of retreats and other events can change. The event's organizers have the final word, and registering for an event may come with its own terms.",
"Gifts are made through Church Center (Planning Center), under its terms. Questions about a gift can come to us.",
],
},
{
id: "other-sites",
heading: "Other sites",
body: [
"We link to and show videos, maps and posts from other sites. We don't control them and aren't responsible for what they say or do; their own terms and privacy policies apply.",
],
},
{
id: "staff-accounts",
heading: "Staff accounts",
body: [
"Accounts for editing the site are for NGU staff and volunteers we've set up. Keep your password and sign-in to yourself. We can change or close an account at any time.",
],
},
{
id: "no-guarantees",
heading: "No guarantees",
body: [
"We work to keep this site accurate and running, but it's provided as it is, without guarantees that it will always be available, complete or free of mistakes. To the extent the law allows, NGU isn't liable for losses that come from using it.",
],
},
{
id: "changes",
heading: "Changes",
body: [
<>
We may update these terms; the date at the top says when they last changed. How we handle personal
information is in our <Link className={link} to="/privacy">Privacy Policy</Link>, and you can reach
us through the <Link className={link} to="/feedback">feedback form</Link>.
</>,
],
},
];
const SECTIONS = [
{
id: "terms",
title: "Terms of Service",
blurb: "Last updated: [date]",
blurb: `Last updated: ${LAST_UPDATED}`,
accent: "#0f7183",
background: "#eef9fb",
content: (
<div className="max-w-3xl mx-auto px-6 leading-relaxed text-[#2c4a50]">
{/* Terms text goes here */}
</div>
),
background: "var(--color-surface)",
content: <LegalText parts={PARTS} />,
},
];
export default function TermsPage() {
return (
<PageShell
title={PAGE.title}
intro={PAGE.description}
sections={SECTIONS}
/>
);
return <PageShell title={PAGE.title} intro={PAGE.description} sections={SECTIONS} />;
}

View file

@ -18,9 +18,10 @@ import { useCallback, useEffect, useRef, useState, type ReactNode } from "react"
import { Link } from "react-router-dom";
import { ApiError, del, get, post } from "../../lib/api.ts";
import { accentText } from '../../lib/color.ts'
const TEAL = "#0f7183";
const MUTED = "#4a6b72";
const MUTED = "var(--color-muted)";
const POLL_MS = 2000;
type Job = {
@ -81,29 +82,29 @@ function sizeOf(bytes: number | null): string {
}
const button =
"rounded-full border border-[#138ba0] px-4 py-2 text-sm font-semibold text-[#0f7183] transition-colors hover:bg-[#eef9fb] disabled:cursor-default disabled:opacity-50";
"rounded-full border border-brand px-4 py-2 text-sm font-semibold text-link transition-colors hover:bg-tint disabled:cursor-default disabled:opacity-50";
const primary =
"rounded-full bg-[#0f7183] px-5 py-2.5 font-semibold text-white transition-colors hover:bg-[#0b5c6a] disabled:bg-[#4a6b72]/25";
"rounded-full bg-action px-5 py-2.5 font-semibold text-white transition-colors hover:bg-action-hover disabled:bg-muted/25";
const input =
"rounded-lg border border-[#4a6b72]/25 bg-white px-3 py-2 text-sm text-[#26454c] outline-none focus:border-[#138ba0] focus:ring-2 focus:ring-[#138ba0]/25";
"rounded-lg border border-muted/25 bg-surface px-3 py-2 text-sm text-body outline-none focus:border-brand focus:ring-2 focus:ring-brand/25";
function Card({ title, children }: { title: string; children: ReactNode }) {
return (
<section className="mt-6 rounded-2xl border border-[#138ba0]/20 bg-white p-5">
<h2 className="text-lg font-semibold text-[#26454c]">{title}</h2>
<section className="mt-6 rounded-2xl border border-brand/20 bg-surface p-5">
<h2 className="text-lg font-semibold text-body">{title}</h2>
<div className="mt-4">{children}</div>
</section>
);
}
function Status({ job }: { job: Job }) {
if (job.status === "failed") return <p className="text-sm text-[#b3261e]">Failed: {job.error}</p>;
if (job.status === "failed") return <p className="text-sm text-danger">Failed: {job.error}</p>;
if (job.status === "done") return null;
const percent = Math.round(job.progress * 100);
return (
<div className="mt-2">
<div className="h-2 overflow-hidden rounded-full bg-[#eef9fb]">
<div className="h-full bg-[#0f7183] transition-all" style={{ width: `${job.status === "queued" ? 0 : percent}%` }} />
<div className="h-2 overflow-hidden rounded-full bg-tint">
<div className="h-full bg-action transition-all" style={{ width: `${job.status === "queued" ? 0 : percent}%` }} />
</div>
<p className="mt-1 text-xs" style={{ color: MUTED }}>
{job.status === "queued" ? "Waiting its turn…" : `${percent}%`}
@ -212,7 +213,7 @@ function Editor({ source, onMade }: { source: Job; onMade: () => void }) {
] as const
).map(([label, text, setText, setAt, value]) => (
<div key={label}>
<label className="block text-sm font-medium text-[#26454c]" htmlFor={`clip-${label}`}>
<label className="block text-sm font-medium text-body" htmlFor={`clip-${label}`}>
{label}
</label>
<input
@ -233,7 +234,7 @@ function Editor({ source, onMade }: { source: Job; onMade: () => void }) {
<button
type="button"
className="text-sm underline"
style={{ color: TEAL }}
style={{ color: accentText(TEAL) }}
onClick={() => {
if (videoRef.current) videoRef.current.currentTime = value;
}}
@ -249,7 +250,7 @@ function Editor({ source, onMade }: { source: Job; onMade: () => void }) {
</p>
<div>
<p className="text-sm font-medium text-[#26454c]">Make it</p>
<p className="text-sm font-medium text-body">Make it</p>
<div className="mt-2 flex gap-4 text-sm">
{[
["video", "Video (MP4)"],
@ -265,7 +266,7 @@ function Editor({ source, onMade }: { source: Job; onMade: () => void }) {
{format === "video" && (
<div>
<p className="text-sm font-medium text-[#26454c]">Shape</p>
<p className="text-sm font-medium text-body">Shape</p>
<div className="mt-2 grid gap-1.5 text-sm">
{SHAPES.map(([id, label]) => (
<label key={id} className="flex items-center gap-2">
@ -275,7 +276,7 @@ function Editor({ source, onMade }: { source: Job; onMade: () => void }) {
))}
</div>
{target && (
<label className="mt-3 block text-sm text-[#26454c]">
<label className="mt-3 block text-sm text-body">
Where to crop
<input
type="range"
@ -284,7 +285,7 @@ function Editor({ source, onMade }: { source: Job; onMade: () => void }) {
step={0.01}
value={focus}
onChange={(e) => setFocus(Number(e.target.value))}
className="mt-1 w-full accent-[#138ba0]"
className="mt-1 w-full accent-brand"
/>
<span className="text-xs" style={{ color: MUTED }}>
The white box on the video is what's kept.
@ -297,7 +298,7 @@ function Editor({ source, onMade }: { source: Job; onMade: () => void }) {
<button type="button" className={primary} disabled={busy || end <= start} onClick={make}>
{busy ? "Queuing…" : "Make clip"}
</button>
{error && <p className="text-sm text-[#b3261e]">{error}</p>}
{error && <p className="text-sm text-danger">{error}</p>}
</div>
</div>
);
@ -368,14 +369,14 @@ export default function AdminClips() {
return (
<div>
<div className="flex flex-wrap items-baseline gap-3">
<h1 className="text-2xl font-bold text-[#0f7183]">Video clips</h1>
<h1 className="text-2xl font-bold text-link">Video clips</h1>
<p className="text-sm" style={{ color: MUTED }}>
Cut clips from our YouTube and Facebook videos, for Reels, Shorts, the site or a podcast.
</p>
</div>
{missing.length > 0 && (
<p className="mt-4 rounded-xl bg-[#fdf3f2] px-4 py-3 text-sm text-[#b3261e]">
<p className="mt-4 rounded-xl bg-danger-tint px-4 py-3 text-sm text-danger">
{missing.join(" and ")} {missing.length > 1 ? "aren't" : "isn't"} installed on the server, so this
won't work until {missing.length > 1 ? "they are" : "it is"}. See docs/video-clips.md.
</p>
@ -397,15 +398,15 @@ export default function AdminClips() {
<p className="mt-2 text-xs" style={{ color: MUTED }}>
YouTube and Facebook links only, and only videos NGU owns or has permission to use. Up to 4 hours long.
</p>
{addError && <p className="mt-2 text-sm text-[#b3261e]">{addError}</p>}
{addError && <p className="mt-2 text-sm text-danger">{addError}</p>}
{data.sources.length > 0 && (
<ul className="mt-5 divide-y divide-[#138ba0]/10">
<ul className="mt-5 divide-y divide-brand/10">
{data.sources.map((s) => (
<li key={s.id} className="py-3">
<div className="flex flex-wrap items-center gap-3">
<div className="min-w-0 flex-1">
<p className="truncate font-medium text-[#26454c]">{s.title ?? s.source_url}</p>
<p className="truncate font-medium text-body">{s.title ?? s.source_url}</p>
<p className="text-xs" style={{ color: MUTED }}>
{[s.duration && clock(s.duration), sizeOf(s.bytes)].filter(Boolean).join(" · ")}
</p>
@ -418,7 +419,7 @@ export default function AdminClips() {
{s.status !== "running" && (
<button
type="button"
className="text-sm hover:text-[#b3261e]"
className="text-sm hover:text-danger"
style={{ color: MUTED }}
onClick={() =>
window.confirm("Delete this video and its clips from the server?") &&
@ -444,13 +445,13 @@ export default function AdminClips() {
{data.clips.length > 0 && (
<Card title="Clips">
{rowError && <p className="mb-3 text-sm text-[#b3261e]">{rowError}</p>}
<ul className="divide-y divide-[#138ba0]/10">
{rowError && <p className="mb-3 text-sm text-danger">{rowError}</p>}
<ul className="divide-y divide-brand/10">
{data.clips.map((clip) => (
<li key={clip.id} className="py-3">
<div className="flex flex-wrap items-center gap-3">
<div className="min-w-0 flex-1">
<p className="truncate font-medium text-[#26454c]">{sourceTitle(clip.source_id)}</p>
<p className="truncate font-medium text-body">{sourceTitle(clip.source_id)}</p>
<p className="text-xs" style={{ color: MUTED }}>
{clip.params &&
[
@ -480,7 +481,7 @@ export default function AdminClips() {
</>
)}
{clip.saved_url && (
<Link to="/admin/media" className="text-sm underline" style={{ color: TEAL }}>
<Link to="/admin/media" className="text-sm underline" style={{ color: accentText(TEAL) }}>
In the media library
</Link>
)}
@ -492,7 +493,7 @@ export default function AdminClips() {
{clip.status !== "running" && (
<button
type="button"
className="text-sm hover:text-[#b3261e]"
className="text-sm hover:text-danger"
style={{ color: MUTED }}
onClick={() => act(() => del(`/admin/clips/${clip.id}`))}
>

View file

@ -28,11 +28,11 @@ import { feedbackTypeLabel } from "../../data/feedbackTypes.ts";
const STATUSES = ["new", "read", "actioned", "archived", "spam"];
const STATUS_STYLE = {
new: "bg-[#0f7183] text-white",
read: "bg-[#eef9fb] text-[#0f7183]",
new: "bg-action text-white",
read: "bg-tint text-link",
actioned: "bg-[#eaf3e2] text-[#4a6b2f]",
archived: "bg-[#4a6b72]/10 text-[#4a6b72]",
spam: "bg-[#fdf3f2] text-[#b3261e]",
archived: "bg-muted/10 text-muted",
spam: "bg-danger-tint text-danger",
};
// created_at is UTC in 'YYYY-MM-DD HH:MM:SS' form, which Safari
@ -89,9 +89,9 @@ function FeedbackCard({ row, onChange, onRemove, canWrite, canRemove }) {
}
return (
<article className="rounded-2xl border border-[#138ba0]/20 bg-white p-5">
<article className="rounded-2xl border border-brand/20 bg-surface p-5">
<div className="flex flex-wrap items-center gap-x-4 gap-y-2 text-sm">
<span className="font-semibold text-[#26454c]">
<span className="font-semibold text-body">
{feedbackTypeLabel(row.feedback_type)}
</span>
<span
@ -101,15 +101,15 @@ function FeedbackCard({ row, onChange, onRemove, canWrite, canRemove }) {
>
{row.status}
</span>
<span className="text-[#4a6b72]">{locationOf(row)}</span>
<span className="ml-auto text-xs text-[#4a6b72]">
<span className="text-muted">{locationOf(row)}</span>
<span className="ml-auto text-xs text-muted">
#{row.id} · {formatDate(row.created_at)}
</span>
</div>
<p className="mt-4 whitespace-pre-wrap text-[#26454c]">{row.message}</p>
<p className="mt-4 whitespace-pre-wrap text-body">{row.message}</p>
<p className="mt-4 text-sm text-[#4a6b72]">
<p className="mt-4 text-sm text-muted">
{row.name || row.email ? (
<>
{row.name && <span>{row.name}</span>}
@ -117,7 +117,7 @@ function FeedbackCard({ row, onChange, onRemove, canWrite, canRemove }) {
{row.email && (
<a
href={`mailto:${row.email}?subject=Your%20NGU%20site%20feedback`}
className="text-[#0f7183] underline underline-offset-2"
className="text-link underline underline-offset-2"
>
{row.email}
</a>
@ -129,11 +129,11 @@ function FeedbackCard({ row, onChange, onRemove, canWrite, canRemove }) {
</p>
{canWrite && (
<div className="mt-5 border-t border-[#4a6b72]/15 pt-4">
<div className="mt-5 border-t border-muted/15 pt-4">
<div className="flex flex-wrap items-center gap-3">
<label
htmlFor={`status-${row.id}`}
className="text-sm font-medium text-[#26454c]"
className="text-sm font-medium text-body"
>
Status
</label>
@ -142,7 +142,7 @@ function FeedbackCard({ row, onChange, onRemove, canWrite, canRemove }) {
value={row.status}
disabled={busy}
onChange={(e) => save({ status: e.target.value })}
className="rounded-lg border border-[#4a6b72]/25 bg-white px-3 py-1.5 text-sm text-[#26454c] outline-none focus:border-[#138ba0] focus:ring-2 focus:ring-[#138ba0]/25"
className="rounded-lg border border-muted/25 bg-surface px-3 py-1.5 text-sm text-body outline-none focus:border-brand focus:ring-2 focus:ring-brand/25"
>
{STATUSES.map((s) => (
<option key={s} value={s}>
@ -158,14 +158,14 @@ function FeedbackCard({ row, onChange, onRemove, canWrite, canRemove }) {
disabled={busy}
placeholder="Internal note: who's handling it, what was done"
onChange={(e) => setNote(e.target.value)}
className="mt-3 w-full resize-y rounded-lg border border-[#4a6b72]/25 bg-white px-3 py-2 text-sm text-[#26454c] outline-none focus:border-[#138ba0] focus:ring-2 focus:ring-[#138ba0]/25"
className="mt-3 w-full resize-y rounded-lg border border-muted/25 bg-surface px-3 py-2 text-sm text-body outline-none focus:border-brand focus:ring-2 focus:ring-brand/25"
/>
{noteDirty && (
<button
type="button"
disabled={busy}
onClick={() => save({ admin_note: note })}
className="mt-2 rounded-full bg-[#0f7183] px-4 py-1.5 text-sm font-semibold text-white transition-colors hover:bg-[#0b5c6a] disabled:bg-[#4a6b72]/25"
className="mt-2 rounded-full bg-action px-4 py-1.5 text-sm font-semibold text-white transition-colors hover:bg-action-hover disabled:bg-muted/25"
>
{busy ? "Saving…" : "Save note"}
</button>
@ -177,17 +177,17 @@ function FeedbackCard({ row, onChange, onRemove, canWrite, canRemove }) {
spam or archived is the habit this defers to. Hence the
second click rather than a window.confirm. */}
{canRemove && (
<div className="mt-4 flex flex-wrap items-center gap-3 border-t border-[#4a6b72]/15 pt-4">
<div className="mt-4 flex flex-wrap items-center gap-3 border-t border-muted/15 pt-4">
{confirming ? (
<>
<span className="text-sm text-[#26454c]">
<span className="text-sm text-body">
Delete #{row.id} for good? Marking it spam keeps it recoverable.
</span>
<button
type="button"
disabled={busy}
onClick={remove}
className="rounded-full bg-[#b3261e] px-4 py-1.5 text-sm font-semibold text-white transition-colors hover:bg-[#8f1e18] disabled:bg-[#4a6b72]/25"
className="rounded-full bg-danger px-4 py-1.5 text-sm font-semibold text-white transition-colors hover:bg-[#8f1e18] disabled:bg-muted/25"
>
{busy ? "Deleting…" : "Delete"}
</button>
@ -195,7 +195,7 @@ function FeedbackCard({ row, onChange, onRemove, canWrite, canRemove }) {
type="button"
disabled={busy}
onClick={() => setConfirming(false)}
className="rounded-full border border-[#4a6b72]/25 px-4 py-1.5 text-sm text-[#4a6b72] transition-colors hover:border-[#4a6b72]/50"
className="rounded-full border border-muted/25 px-4 py-1.5 text-sm text-muted transition-colors hover:border-muted/50"
>
Keep it
</button>
@ -205,7 +205,7 @@ function FeedbackCard({ row, onChange, onRemove, canWrite, canRemove }) {
type="button"
disabled={busy}
onClick={() => setConfirming(true)}
className="rounded-full border border-[#b3261e]/30 px-4 py-1.5 text-sm font-medium text-[#b3261e] transition-colors hover:bg-[#fdf3f2]"
className="rounded-full border border-danger/30 px-4 py-1.5 text-sm font-medium text-danger transition-colors hover:bg-danger-tint"
>
Delete
</button>
@ -214,7 +214,7 @@ function FeedbackCard({ row, onChange, onRemove, canWrite, canRemove }) {
)}
{error && (
<p role="alert" className="mt-3 text-sm text-[#b3261e]">
<p role="alert" className="mt-3 text-sm text-danger">
{error}
</p>
)}
@ -305,8 +305,8 @@ export default function AdminFeedback() {
return (
<div>
<h1 className="text-3xl font-bold text-[#0f7183]">Feedback</h1>
<p className="mt-2 text-sm text-[#4a6b72]">
<h1 className="text-3xl font-bold text-link">Feedback</h1>
<p className="mt-2 text-sm text-muted">
{canWrite
? "Everything submitted through the site form."
: "Read-only: your account can't change statuses or notes."}
@ -322,8 +322,8 @@ export default function AdminFeedback() {
className={
"rounded-full px-4 py-1.5 text-sm transition-colors " +
(status === tab.id
? "bg-[#0f7183] font-semibold text-white"
: "border border-[#4a6b72]/25 text-[#4a6b72] hover:border-[#138ba0]/50")
? "bg-action font-semibold text-white"
: "border border-muted/25 text-muted hover:border-brand/50")
}
>
{tab.label}
@ -340,12 +340,12 @@ export default function AdminFeedback() {
onKeyDown={(e) => {
if (e.key === "Enter") setSearch(query.trim());
}}
className="rounded-full border border-[#4a6b72]/25 bg-white px-4 py-1.5 text-sm text-[#26454c] outline-none focus:border-[#138ba0] focus:ring-2 focus:ring-[#138ba0]/25"
className="rounded-full border border-muted/25 bg-surface px-4 py-1.5 text-sm text-body outline-none focus:border-brand focus:ring-2 focus:ring-brand/25"
/>
<button
type="button"
onClick={() => setSearch(query.trim())}
className="rounded-full border border-[#4a6b72]/25 px-4 py-1.5 text-sm text-[#4a6b72] transition-colors hover:border-[#138ba0]/50"
className="rounded-full border border-muted/25 px-4 py-1.5 text-sm text-muted transition-colors hover:border-brand/50"
>
Search
</button>
@ -356,14 +356,14 @@ export default function AdminFeedback() {
{error && (
<p
role="alert"
className="mt-6 rounded-xl border border-[#b3261e]/30 bg-[#fdf3f2] px-4 py-3 text-sm text-[#b3261e]"
className="mt-6 rounded-xl border border-danger/30 bg-danger-tint px-4 py-3 text-sm text-danger"
>
{error}
</p>
)}
{!loading && rows.length === 0 && !error && (
<p className="mt-10 text-[#4a6b72]">
<p className="mt-10 text-muted">
Nothing here. {status === "new" ? "The queue is clear." : "Try another filter."}
</p>
)}
@ -381,13 +381,13 @@ export default function AdminFeedback() {
))}
</div>
{loading && <p className="mt-6 text-sm text-[#4a6b72]">Loading…</p>}
{loading && <p className="mt-6 text-sm text-muted">Loading…</p>}
{cursor && !loading && (
<button
type="button"
onClick={() => load(cursor)}
className="mt-6 rounded-full border border-[#138ba0] px-5 py-2 font-semibold text-[#0f7183] transition-colors hover:bg-[#eef9fb]"
className="mt-6 rounded-full border border-brand px-5 py-2 font-semibold text-link transition-colors hover:bg-tint"
>
Load older
</button>

View file

@ -34,9 +34,9 @@ function NavCard({ item }) {
const extras = (item.children ?? []).filter((child) => child.to !== to);
return (
<div className="group relative flex flex-col rounded-2xl border border-[#138ba0]/20 bg-white p-5 transition-all hover:border-[#138ba0]/60 hover:shadow-sm">
<div className="group relative flex flex-col rounded-2xl border border-brand/20 bg-surface p-5 transition-all hover:border-brand/60 hover:shadow-sm">
<div className="flex items-baseline gap-3">
<h3 className="text-base font-semibold text-[#0f7183]">
<h3 className="text-base font-semibold text-link">
<Link
to={to}
className="after:absolute after:inset-0 after:rounded-2xl after:content-['']"
@ -46,23 +46,23 @@ function NavCard({ item }) {
</h3>
<span
aria-hidden="true"
className="ml-auto text-[#0f7183] opacity-0 transition-opacity group-hover:opacity-100"
className="ml-auto text-link opacity-0 transition-opacity group-hover:opacity-100"
>
→
</span>
</div>
{item.blurb && (
<p className="mt-1.5 text-sm leading-relaxed text-[#4a6b72]">{item.blurb}</p>
<p className="mt-1.5 text-sm leading-relaxed text-muted">{item.blurb}</p>
)}
{extras.length > 0 && (
<div className="relative z-10 mt-4 flex flex-wrap gap-x-4 gap-y-1 border-t border-[#138ba0]/10 pt-3 text-sm">
<div className="relative z-10 mt-4 flex flex-wrap gap-x-4 gap-y-1 border-t border-brand/10 pt-3 text-sm">
{extras.map((child) => (
<Link
key={child.to}
to={child.to}
className="text-[#4a6b72] underline-offset-4 transition-colors hover:text-[#0f7183] hover:underline"
className="text-muted underline-offset-4 transition-colors hover:text-link hover:underline"
>
{child.label}
</Link>
@ -77,8 +77,8 @@ function CardBlock({ title, blurb, children }) {
return (
<div className="mt-10">
<div className="flex items-baseline gap-3">
<h2 className="text-lg font-semibold text-[#0f7183]">{title}</h2>
{blurb && <p className="text-sm text-[#4a6b72]">{blurb}</p>}
<h2 className="text-lg font-semibold text-link">{title}</h2>
{blurb && <p className="text-sm text-muted">{blurb}</p>}
</div>
<div className="mt-4 grid gap-4 sm:grid-cols-2">{children}</div>
</div>
@ -87,11 +87,11 @@ function CardBlock({ title, blurb, children }) {
function PanelSection({ title, children }) {
return (
<section className="border-b border-[#138ba0]/10 px-5 py-4 last:border-b-0">
<h2 className="text-xs font-semibold uppercase tracking-wider text-[#4a6b72]/70">
<section className="border-b border-brand/10 px-5 py-4 last:border-b-0">
<h2 className="text-xs font-semibold uppercase tracking-wider text-muted/70">
{title}
</h2>
<div className="mt-2.5 text-sm text-[#4a6b72]">{children}</div>
<div className="mt-2.5 text-sm text-muted">{children}</div>
</section>
);
}
@ -114,10 +114,10 @@ export default function AdminHome() {
return (
<div className="grid gap-8 lg:grid-cols-[1fr_17rem] lg:items-start">
<div>
<h1 className="text-2xl font-bold text-[#0f7183]">
<h1 className="text-2xl font-bold text-link">
{user?.name ? `Welcome back, ${user.name.split(" ")[0]}.` : "Welcome back."}
</h1>
<p className="mt-1 text-[#4a6b72]">Pick a section to work in.</p>
<p className="mt-1 text-muted">Pick a section to work in.</p>
{GROUPS.map((group) => (
<CardBlock key={group.label} title={group.label} blurb={group.blurb}>
@ -137,14 +137,14 @@ export default function AdminHome() {
</div>
{/* Sticky so it stays put once the card column outgrows it. */}
<aside className="divide-y divide-[#138ba0]/10 rounded-2xl border border-[#138ba0]/20 bg-white lg:sticky lg:top-6">
<aside className="divide-y divide-brand/10 rounded-2xl border border-brand/20 bg-surface lg:sticky lg:top-6">
<PanelSection title="Signed in">
<p className="font-medium text-[#0f2f36]">{user?.name || user?.email}</p>
{user?.name && user?.email && (
<p className="mt-0.5 break-all text-xs text-[#4a6b72]/80">{user.email}</p>
<p className="mt-0.5 break-all text-xs text-muted/80">{user.email}</p>
)}
{role && (
<span className="mt-2 inline-block rounded-full bg-[#eef9fb] px-2.5 py-0.5 text-xs font-medium text-[#0f7183]">
<span className="mt-2 inline-block rounded-full bg-tint px-2.5 py-0.5 text-xs font-medium text-link">
{role}
</span>
)}
@ -156,7 +156,7 @@ export default function AdminHome() {
<li key={link.to}>
<Link
to={link.to}
className="underline-offset-4 transition-colors hover:text-[#0f7183] hover:underline"
className="underline-offset-4 transition-colors hover:text-link hover:underline"
>
{link.label}
</Link>
@ -166,12 +166,12 @@ export default function AdminHome() {
</PanelSection>
<PanelSection title="Site">
<p className="font-mono text-xs text-[#4a6b72]/80">{SITE_VERSION}</p>
<p className="font-mono text-xs text-muted/80">{SITE_VERSION}</p>
<a
href="/"
target="_blank"
rel="noreferrer"
className="mt-2 inline-block underline-offset-4 transition-colors hover:text-[#0f7183] hover:underline"
className="mt-2 inline-block underline-offset-4 transition-colors hover:text-link hover:underline"
>
View the public site ↗
</a>

View file

@ -28,6 +28,7 @@ import { AdminWidthContext } from "../../lib/adminWidth.tsx";
import { SITE_VERSION } from "../../lib/version.ts";
import { ROLE_LABELS, isSuper } from "../../lib/roles.ts";
import nguLogo from "../../assets/logos/NGU_Logo.svg";
import ThemeToggle from "../../components/ThemeToggle.tsx";
import {
ADMIN_HOME,
AREA_TITLES,
@ -45,8 +46,8 @@ import {
function GroupMenu({ item, lit, pathname }) {
const children = item.children ?? [];
const link = lit
? "font-semibold text-[#0f7183]"
: "text-[#4a6b72] transition-colors hover:text-[#0f7183]";
? "font-semibold text-link"
: "text-muted transition-colors hover:text-link";
return (
<div className="group relative">
@ -61,15 +62,15 @@ function GroupMenu({ item, lit, pathname }) {
{children.length > 1 && (
<div className="invisible absolute left-0 top-full z-30 pt-2 opacity-0 transition-opacity group-focus-within:visible group-focus-within:opacity-100 group-hover:visible group-hover:opacity-100">
<ul className="min-w-52 rounded-xl border border-[#138ba0]/20 bg-white p-1.5 shadow-lg">
<ul className="min-w-52 rounded-xl border border-brand/20 bg-surface p-1.5 shadow-lg">
{children.map((child) => (
<li key={child.to}>
<NavLink
to={child.to}
className={`block rounded-lg px-3 py-2 text-sm transition-colors hover:bg-[#eef9fb] ${
className={`block rounded-lg px-3 py-2 text-sm transition-colors hover:bg-tint ${
matches(pathname, child.to)
? "font-semibold text-[#0f7183]"
: "text-[#26454c]"
? "font-semibold text-link"
: "text-body"
}`}
>
{child.label}
@ -130,11 +131,11 @@ export default function AdminLayout() {
const subnav = active?.children ?? [];
const wordmark = <span className="text-lg font-bold text-[#0f7183]">{areaTitle}</span>;
const wordmark = <span className="text-lg font-bold text-link">{areaTitle}</span>;
return (
<div className="flex min-h-screen flex-col bg-[#f6fbfc]">
<header className="border-b border-[#138ba0]/20 bg-white">
<div className="flex min-h-screen flex-col bg-tint-soft">
<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">
{/* Already home, so nothing to link to. */}
{isHome ? (
@ -156,7 +157,7 @@ export default function AdminLayout() {
{item.separated && (
<span
aria-hidden="true"
className="h-4 w-px bg-[#4a6b72]/25"
className="h-4 w-px bg-muted/25"
/>
)}
<GroupMenu item={item} lit={item === active} pathname={pathname} />
@ -165,14 +166,15 @@ export default function AdminLayout() {
</nav>
)}
<div className="ml-auto flex items-center gap-4 text-sm text-[#4a6b72]">
<div className="ml-auto flex items-center gap-4 text-sm text-muted">
<ThemeToggle className="hover:bg-tint hover:text-link" />
<span>
{user?.name || user?.email}
</span>
<button
type="button"
onClick={handleLogout}
className="rounded-full border border-[#4a6b72]/30 px-4 py-1.5 font-medium transition-colors hover:bg-[#eef9fb] hover:text-[#0f7183]"
className="rounded-full border border-muted/30 px-4 py-1.5 font-medium transition-colors hover:bg-tint hover:text-link"
>
Sign out
</button>
@ -182,7 +184,7 @@ export default function AdminLayout() {
{/* Subnav. Only drawn where there is something to draw, so
Events and People don't get an empty grey strip. */}
{subnav.length > 0 && (
<div className="border-t border-[#138ba0]/10 bg-[#f6fbfc]">
<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">
{subnav.map((child) => (
<NavLink
@ -190,8 +192,8 @@ export default function AdminLayout() {
to={child.to}
className={
child === activeChild
? "font-semibold text-[#0f7183]"
: "text-[#4a6b72] transition-colors hover:text-[#0f7183]"
? "font-semibold text-link"
: "text-muted transition-colors hover:text-link"
}
>
{child.label}
@ -213,12 +215,12 @@ export default function AdminLayout() {
</AdminTitleContext.Provider>
</main>
<footer className="border-t border-[#138ba0]/15 bg-white">
<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">
<Link to={ADMIN_HOME} className="transition-opacity hover:opacity-70">
<img src={nguLogo} alt="NGU" className="h-6 w-auto" />
</Link>
<span className="ml-auto font-mono text-xs text-[#4a6b72]/70">
<span className="ml-auto font-mono text-xs text-muted/70">
{SITE_VERSION}
</span>
</div>

View file

@ -36,8 +36,8 @@ const GOOGLE_ERRORS: Record<string, string> = {
};
const fieldClass =
"w-full rounded-xl border border-[#4a6b72]/25 bg-white px-4 py-3 text-[#26454c] " +
"outline-none transition-colors focus:border-[#138ba0] focus:ring-2 focus:ring-[#138ba0]/25";
"w-full rounded-xl border border-muted/25 bg-surface px-4 py-3 text-body " +
"outline-none transition-colors focus:border-brand focus:ring-2 focus:ring-brand/25";
export default function AdminLogin() {
const { login } = useAuth();
@ -85,23 +85,23 @@ export default function AdminLogin() {
}
return (
<div className="flex min-h-screen items-center justify-center bg-[#eef9fb] px-6 py-16">
<div className="flex min-h-screen items-center justify-center bg-tint px-6 py-16">
<div className="w-full max-w-sm">
<h1 className="text-3xl font-bold text-[#0f7183]">NGU admin</h1>
<p className="mt-2 text-sm text-[#4a6b72]">
<h1 className="text-3xl font-bold text-link">NGU admin</h1>
<p className="mt-2 text-sm text-muted">
Sign in to edit the site.
</p>
<form
onSubmit={handleSubmit}
noValidate
className="mt-8 rounded-2xl border border-[#138ba0]/20 bg-white p-6"
className="mt-8 rounded-2xl border border-brand/20 bg-surface p-6"
>
{google && (
<>
<a
href={`/api/auth/google?next=${encodeURIComponent(destination)}`}
className="flex items-center justify-center gap-3 rounded-full border border-[#4a6b72]/30 px-6 py-3 font-semibold text-[#26454c] transition-colors hover:bg-[#eef9fb]"
className="flex items-center justify-center gap-3 rounded-full border border-muted/30 px-6 py-3 font-semibold text-body transition-colors hover:bg-tint"
>
<svg viewBox="0 0 48 48" className="h-5 w-5" aria-hidden="true">
<path fill="#FFC107" d="M43.6 20.5H42V20H24v8h11.3C33.7 32.7 29.2 36 24 36c-6.6 0-12-5.4-12-12s5.4-12 12-12c3.1 0 5.8 1.2 7.9 3.1l5.7-5.7C34 6.1 29.3 4 24 4 12.9 4 4 12.9 4 24s8.9 20 20 20 20-8.9 20-20c0-1.3-.1-2.4-.4-3.5z" />
@ -111,17 +111,17 @@ export default function AdminLogin() {
</svg>
Sign in with Google
</a>
<div className="my-6 flex items-center gap-3 text-xs text-[#4a6b72]">
<span className="h-px flex-1 bg-[#4a6b72]/20" />
<div className="my-6 flex items-center gap-3 text-xs text-muted">
<span className="h-px flex-1 bg-muted/20" />
or with a password
<span className="h-px flex-1 bg-[#4a6b72]/20" />
<span className="h-px flex-1 bg-muted/20" />
</div>
</>
)}
<label
htmlFor="admin-email"
className="block text-sm font-medium text-[#26454c]"
className="block text-sm font-medium text-body"
>
Email
</label>
@ -137,7 +137,7 @@ export default function AdminLogin() {
<label
htmlFor="admin-password"
className="mt-5 block text-sm font-medium text-[#26454c]"
className="mt-5 block text-sm font-medium text-body"
>
Password
</label>
@ -153,7 +153,7 @@ export default function AdminLogin() {
{error && (
<p
role="alert"
className="mt-5 rounded-xl border border-[#b3261e]/30 bg-[#fdf3f2] px-4 py-3 text-sm text-[#b3261e]"
className="mt-5 rounded-xl border border-danger/30 bg-danger-tint px-4 py-3 text-sm text-danger"
>
{error}
</p>
@ -162,14 +162,14 @@ export default function AdminLogin() {
<button
type="submit"
disabled={busy || !email || !password}
className="mt-6 w-full rounded-full bg-[#0f7183] px-6 py-3 font-semibold text-white transition-colors hover:bg-[#0b5c6a] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#138ba0]/40 disabled:cursor-not-allowed disabled:bg-[#4a6b72]/25"
className="mt-6 w-full rounded-full bg-action px-6 py-3 font-semibold text-white transition-colors hover:bg-action-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand/40 disabled:cursor-not-allowed disabled:bg-muted/25"
>
{busy ? "Signing in…" : "Sign in"}
</button>
</form>
<p className="mt-6 text-center text-xs text-[#4a6b72]">
<p className="mt-6 text-center text-xs text-muted">
Accounts are created on the server. Ask whoever runs the box.
</p>
</div>

View file

@ -64,17 +64,17 @@ function DeleteControl({ item, onDeleted }: { item: MediaItem; onDeleted: () =>
type="button"
onClick={ask}
disabled={busy}
className="text-xs text-[#4a6b72] hover:text-[#b3261e]"
className="text-xs text-muted hover:text-danger"
>
Delete
</button>
{error && <p className="mt-1 text-xs text-[#b3261e]">{error}</p>}
{error && <p className="mt-1 text-xs text-danger">{error}</p>}
</>
);
}
return (
<div className="rounded-lg bg-[#fdf3f2] p-2 text-xs text-[#26454c]">
<div className="rounded-lg bg-danger-tint p-2 text-xs text-body">
{uses.length > 0 ? (
<p>
Still used by{" "}
@ -89,15 +89,15 @@ function DeleteControl({ item, onDeleted }: { item: MediaItem; onDeleted: () =>
type="button"
onClick={remove}
disabled={busy}
className="font-medium text-[#b3261e] hover:underline"
className="font-medium text-danger hover:underline"
>
{busy ? "Deleting…" : "Delete for good"}
</button>
<button type="button" onClick={() => setUses(null)} className="text-[#4a6b72] hover:underline">
<button type="button" onClick={() => setUses(null)} className="text-muted hover:underline">
Cancel
</button>
</div>
{error && <p className="mt-1 text-[#b3261e]">{error}</p>}
{error && <p className="mt-1 text-danger">{error}</p>}
</div>
);
}
@ -113,7 +113,7 @@ function CopyPath({ url }: { url: string }) {
setTimeout(() => setCopied(false), 1500);
});
}}
className="text-xs text-[#0f7183] hover:underline"
className="text-xs text-link hover:underline"
>
{copied ? "Copied" : "Copy path"}
</button>
@ -128,8 +128,8 @@ export default function AdminMedia() {
return (
<div>
<div className="flex flex-wrap items-baseline gap-3">
<h1 className="text-2xl font-bold text-[#0f7183]">Media</h1>
<p className="text-sm text-[#4a6b72]">
<h1 className="text-2xl font-bold text-link">Media</h1>
<p className="text-sm text-muted">
Uploaded images. Image fields in every editor pick from here.
</p>
</div>
@ -142,7 +142,7 @@ export default function AdminMedia() {
label="Upload images"
onUploaded={(item) => setItems((current) => [item, ...(current ?? [])])}
/>
<p className="mt-1 text-xs text-[#4a6b72]">{UPLOAD_HELP}</p>
<p className="mt-1 text-xs text-muted">{UPLOAD_HELP}</p>
</div>
)}
<input
@ -150,15 +150,15 @@ export default function AdminMedia() {
value={query}
onChange={(e) => setQuery(e.target.value)}
placeholder="Search by file name"
className="ml-auto w-64 rounded-lg border border-[#4a6b72]/25 px-3 py-2 text-sm outline-none focus:border-[#138ba0]"
className="ml-auto w-64 rounded-lg border border-muted/25 px-3 py-2 text-sm outline-none focus:border-brand"
/>
</div>
<div className="mt-6">
{error ? (
<p className="text-sm text-[#b3261e]">{error}</p>
<p className="text-sm text-danger">{error}</p>
) : items === null ? (
<p className="text-sm text-[#4a6b72]">Loading…</p>
<p className="text-sm text-muted">Loading…</p>
) : (
<MediaGrid
items={items}
@ -169,7 +169,7 @@ export default function AdminMedia() {
href={item.url}
target="_blank"
rel="noreferrer"
className="text-xs text-[#0f7183] hover:underline"
className="text-xs text-link hover:underline"
>
Open
</a>

View file

@ -54,8 +54,8 @@ function Block({ title, note, children }: any) {
return (
<section className="mt-8 first:mt-0">
<div className="flex items-baseline gap-3">
<h2 className="text-lg font-semibold text-[#0f7183]">{title}</h2>
{note && <p className="text-sm text-[#4a6b72]">{note}</p>}
<h2 className="text-lg font-semibold text-link">{title}</h2>
{note && <p className="text-sm text-muted">{note}</p>}
</div>
<div className="mt-3">{children}</div>
</section>
@ -64,8 +64,8 @@ function Block({ title, note, children }: any) {
function Stat({ label, value }) {
return (
<div className="rounded-xl border border-[#138ba0]/20 bg-white px-4 py-3">
<div className="text-xs font-medium uppercase tracking-wider text-[#4a6b72]/70">
<div className="rounded-xl border border-brand/20 bg-surface px-4 py-3">
<div className="text-xs font-medium uppercase tracking-wider text-muted/70">
{label}
</div>
<div className="mt-1 break-words text-sm font-medium text-[#0f2f36]">{value}</div>
@ -143,7 +143,7 @@ export default function AdminPanel() {
if (loading) {
return (
<p className="py-12 text-[#4a6b72]" role="status">
<p className="py-12 text-muted" role="status">
Loading the panel…
</p>
);
@ -152,11 +152,11 @@ export default function AdminPanel() {
if (error) {
return (
<div className="py-12">
<p className="text-[#b3261e]">{error}</p>
<p className="text-danger">{error}</p>
<button
type="button"
onClick={load}
className="mt-3 rounded-full border border-[#138ba0] px-4 py-1.5 text-sm font-medium text-[#0f7183] transition-colors hover:bg-[#eef9fb]"
className="mt-3 rounded-full border border-brand px-4 py-1.5 text-sm font-medium text-link transition-colors hover:bg-tint"
>
Try again
</button>
@ -171,8 +171,8 @@ export default function AdminPanel() {
return (
<div>
<h1 className="text-2xl font-bold text-[#0f7183]">Panel</h1>
<p className="mt-1 text-[#4a6b72]">
<h1 className="text-2xl font-bold text-link">Panel</h1>
<p className="mt-1 text-muted">
Accounts and server state. Everything here is superadmin-only.
</p>
@ -186,7 +186,7 @@ export default function AdminPanel() {
<Stat label="Live sessions" value={system.sessions} />
</div>
{system.dbPath && (
<p className="mt-3 font-mono text-xs text-[#4a6b72]/70">{system.dbPath}</p>
<p className="mt-3 font-mono text-xs text-muted/70">{system.dbPath}</p>
)}
</Block>
@ -195,7 +195,7 @@ export default function AdminPanel() {
{content.map((row) => (
<span
key={row.label}
className="rounded-full border border-[#138ba0]/20 bg-white px-3 py-1 text-sm text-[#4a6b72]"
className="rounded-full border border-brand/20 bg-surface px-3 py-1 text-sm text-muted"
>
{row.label}{" "}
<strong className="font-semibold text-[#0f2f36]">
@ -210,9 +210,9 @@ export default function AdminPanel() {
title="Accounts"
note="Changing a role or disabling an account signs that person out."
>
<div className="overflow-x-auto rounded-2xl border border-[#138ba0]/20 bg-white">
<div className="overflow-x-auto rounded-2xl border border-brand/20 bg-surface">
<table className="w-full min-w-[46rem] text-left text-sm">
<thead className="border-b border-[#138ba0]/15 text-xs uppercase tracking-wider text-[#4a6b72]/70">
<thead className="border-b border-brand/15 text-xs uppercase tracking-wider text-muted/70">
<tr>
<th className="px-4 py-3 font-medium">Account</th>
<th className="px-4 py-3 font-medium">Role</th>
@ -221,7 +221,7 @@ export default function AdminPanel() {
<th className="px-4 py-3 font-medium">Access</th>
</tr>
</thead>
<tbody className="divide-y divide-[#138ba0]/10">
<tbody className="divide-y divide-brand/10">
{users.map((row) => {
const isMe = row.id === me?.id;
const lastSuper =
@ -230,21 +230,21 @@ export default function AdminPanel() {
const busy = busyId === row.id;
return (
<tr key={row.id} className={row.is_active ? "" : "bg-[#f6fbfc]"}>
<tr key={row.id} className={row.is_active ? "" : "bg-tint-soft"}>
<td className="px-4 py-3">
<div className="font-medium text-[#0f2f36]">
{row.name || row.email}
{isMe && (
<span className="ml-2 text-xs font-normal text-[#4a6b72]/70">
<span className="ml-2 text-xs font-normal text-muted/70">
you
</span>
)}
</div>
{row.name && (
<div className="text-xs text-[#4a6b72]/80">{row.email}</div>
<div className="text-xs text-muted/80">{row.email}</div>
)}
{rowError?.id === row.id && (
<div className="mt-1 text-xs text-[#b3261e]">
<div className="mt-1 text-xs text-danger">
{rowError.message}
</div>
)}
@ -255,7 +255,7 @@ export default function AdminPanel() {
value={row.role}
disabled={locked || busy}
onChange={(e) => changeRole(row, e.target.value)}
className="rounded-lg border border-[#138ba0]/30 bg-white px-2 py-1 text-sm text-[#0f2f36] disabled:cursor-not-allowed disabled:bg-[#f6fbfc] disabled:text-[#4a6b72]/60"
className="rounded-lg border border-brand/30 bg-surface px-2 py-1 text-sm text-[#0f2f36] disabled:cursor-not-allowed disabled:bg-tint-soft disabled:text-muted/60"
title={
isMe
? "You can't change your own role."
@ -272,16 +272,16 @@ export default function AdminPanel() {
</select>
</td>
<td className="px-4 py-3 text-[#4a6b72]">{when(row.last_login_at)}</td>
<td className="px-4 py-3 text-muted">{when(row.last_login_at)}</td>
<td className="px-4 py-3">
<span className="text-[#4a6b72]">{row.sessions}</span>
<span className="text-muted">{row.sessions}</span>
{row.sessions > 0 && (
<button
type="button"
disabled={busy}
onClick={() => revoke(row)}
className="ml-3 text-xs font-medium text-[#0f7183] underline-offset-4 hover:underline disabled:opacity-50"
className="ml-3 text-xs font-medium text-link underline-offset-4 hover:underline disabled:opacity-50"
>
Sign out
</button>
@ -295,8 +295,8 @@ export default function AdminPanel() {
onClick={() => setActive(row, row.is_active ? 0 : 1)}
className={`rounded-full border px-3 py-1 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${
row.is_active
? "border-[#4a6b72]/30 text-[#4a6b72] hover:border-[#b3261e]/50 hover:text-[#b3261e]"
: "border-[#138ba0]/40 text-[#0f7183] hover:bg-[#eef9fb]"
? "border-muted/30 text-muted hover:border-danger/50 hover:text-danger"
: "border-brand/40 text-link hover:bg-tint"
}`}
>
{row.is_active ? "Disable" : "Enable"}
@ -317,12 +317,12 @@ export default function AdminPanel() {
<dt className="shrink-0 font-medium text-[#0f2f36]">
{ROLE_LABELS[role]}
</dt>
<dd className="text-[#4a6b72]">{ROLE_NOTES[role]}</dd>
<dd className="text-muted">{ROLE_NOTES[role]}</dd>
</div>
))}
</dl>
<p className="mt-4 text-xs text-[#4a6b72]/80">
<p className="mt-4 text-xs text-muted/80">
New accounts are still created with <code>admin-cli.js</code> on the server.
</p>
</Block>

View file

@ -64,7 +64,7 @@ import {
/* One card per section. scroll-mt clears the sticky "Jump to" bar
below lg, and leaves a little air above the card on desktop. */
const CARD = "mt-6 scroll-mt-16 rounded-2xl border border-[#138ba0]/20 bg-white p-5 lg:scroll-mt-6";
const CARD = "mt-6 scroll-mt-16 rounded-2xl border border-brand/20 bg-surface p-5 lg:scroll-mt-6";
const sectionId = (name) => `section-${slugify(name)}`;
@ -225,8 +225,8 @@ export default function EntityEdit() {
return () => window.removeEventListener("beforeunload", warn);
}, [dirty]);
if (!manifest) return <p className="text-[#4a6b72]">No such thing to edit.</p>;
if (loading || !form) return <p className="text-[#4a6b72]">Loading…</p>;
if (!manifest) return <p className="text-muted">No such thing to edit.</p>;
if (loading || !form) return <p className="text-muted">Loading…</p>;
/* ── Heading ───────────────────────────────────────────────── */
@ -356,13 +356,13 @@ export default function EntityEdit() {
<button
type="button"
onClick={() => leave(`/admin/${manifest.key}`)}
className="text-sm text-[#4a6b72] hover:text-[#0f7183]"
className="text-sm text-muted hover:text-link"
>
← {manifest.label}
</button>
)}
<h1 className="mt-2 text-3xl font-bold text-[#0f7183]">
<h1 className="mt-2 text-3xl font-bold text-link">
{isNew ? `New ${manifest.singular}` : heading}
</h1>
@ -385,13 +385,13 @@ export default function EntityEdit() {
{singleton ? (
updatedAt && (
<div className={CARD}>
<p className="text-sm text-[#4a6b72]">Last saved {updatedAt}</p>
<p className="text-sm text-muted">Last saved {updatedAt}</p>
</div>
)
) : autoId ? (
!isNew && (
<div id="section-url-id" className={CARD}>
<p className="text-sm text-[#4a6b72]">
<p className="text-sm text-muted">
{manifest.idLabel} #{form.id}
{form.updated_at && <> · last saved {form.updated_at}</>}
</p>
@ -421,7 +421,7 @@ export default function EntityEdit() {
}}
/>
{!isNew && form.updated_at && (
<p className="mt-2 text-xs text-[#4a6b72]">
<p className="mt-2 text-xs text-muted">
Last saved {form.updated_at}
</p>
)}
@ -431,8 +431,8 @@ export default function EntityEdit() {
{/* Field groups */}
{groups.map((group) => (
<section key={group.legend} id={sectionId(group.legend)} className={CARD}>
<h2 className="text-lg font-semibold text-[#26454c]">{group.legend}</h2>
{group.note && <p className="mt-1 text-sm text-[#4a6b72]">{group.note}</p>}
<h2 className="text-lg font-semibold text-body">{group.legend}</h2>
{group.note && <p className="mt-1 text-sm text-muted">{group.note}</p>}
<div className="mt-4">
<FieldGrid>
{group.fields.map((field) => (
@ -470,7 +470,7 @@ export default function EntityEdit() {
</div>
{/* Sticky action bar */}
<div className="fixed inset-x-0 bottom-0 border-t border-[#138ba0]/20 bg-white/95 backdrop-blur">
<div className="fixed inset-x-0 bottom-0 border-t border-brand/20 bg-white/95 backdrop-blur">
<div className="mx-auto flex max-w-5xl flex-wrap items-center gap-4 px-6 py-3">
{canWrite ? (
<>
@ -478,7 +478,7 @@ export default function EntityEdit() {
type="button"
onClick={save}
disabled={saving || !dirty}
className="rounded-full bg-[#0f7183] px-6 py-2 font-semibold text-white transition-colors hover:bg-[#0b5c6a] disabled:bg-[#4a6b72]/25"
className="rounded-full bg-action px-6 py-2 font-semibold text-white transition-colors hover:bg-action-hover disabled:bg-muted/25"
>
{saving ? "Saving…" : isNew ? "Create" : "Save changes"}
</button>
@ -486,27 +486,27 @@ export default function EntityEdit() {
<button
type="button"
onClick={remove}
className="rounded-full border border-[#b3261e]/40 px-4 py-2 text-sm font-medium text-[#b3261e] transition-colors hover:bg-[#fdf3f2]"
className="rounded-full border border-danger/40 px-4 py-2 text-sm font-medium text-danger transition-colors hover:bg-danger-tint"
>
Delete
</button>
)}
</>
) : (
<span className="text-sm text-[#4a6b72]">
<span className="text-sm text-muted">
Read-only: your account can view this but not change it.
</span>
)}
{dirty && !saving && (
<span className="text-sm text-[#4a6b72]">Unsaved changes</span>
<span className="text-sm text-muted">Unsaved changes</span>
)}
{message && (
<span
role="status"
className={`flex items-center gap-2 text-sm ${
message.tone === "ok" ? "text-[#0f7183]" : "text-[#b3261e]"
message.tone === "ok" ? "text-link" : "text-danger"
}`}
>
{message.text}
@ -514,7 +514,7 @@ export default function EntityEdit() {
<button
type="button"
onClick={load}
className="rounded-full border border-[#b3261e]/40 px-3 py-1 text-xs font-medium"
className="rounded-full border border-danger/40 px-3 py-1 text-xs font-medium"
>
Reload
</button>

View file

@ -67,7 +67,7 @@ export default function EntityList() {
}, [load]);
if (!manifest) {
return <p className="text-[#4a6b72]">No such thing to edit.</p>;
return <p className="text-muted">No such thing to edit.</p>;
}
// One row, so no list: the tab opens the row.
@ -92,11 +92,11 @@ export default function EntityList() {
return (
<div>
<div className="flex flex-wrap items-center gap-4">
<h1 className="text-3xl font-bold text-[#0f7183]">{manifest.label}</h1>
<h1 className="text-3xl font-bold text-link">{manifest.label}</h1>
{canWrite && (
<Link
to={`/admin/${manifest.key}/new`}
className="ml-auto rounded-full bg-[#0f7183] px-4 py-2 text-sm font-semibold text-white transition-colors hover:bg-[#0b5c6a]"
className="ml-auto rounded-full bg-action px-4 py-2 text-sm font-semibold text-white transition-colors hover:bg-action-hover"
>
New {manifest.singular}
</Link>
@ -106,12 +106,12 @@ export default function EntityList() {
{/* Filters */}
<div className="mt-6 flex flex-wrap items-end gap-3">
{manifest.list.filters.map((filter) => (
<label key={filter.key} className="text-xs text-[#4a6b72]">
<label key={filter.key} className="text-xs text-muted">
<span className="block">{filter.label}</span>
<select
value={params.get(filter.key) ?? ""}
onChange={(e) => setParam(filter.key, e.target.value)}
className="mt-1 rounded-lg border border-[#4a6b72]/25 bg-white px-3 py-1.5 text-sm text-[#26454c] outline-none focus:border-[#138ba0]"
className="mt-1 rounded-lg border border-muted/25 bg-surface px-3 py-1.5 text-sm text-body outline-none focus:border-brand"
>
<option value="">All</option>
{labelFor(filter).map(([value, label]) => (
@ -130,12 +130,12 @@ export default function EntityList() {
placeholder="Search"
onChange={(e) => setQuery(e.target.value)}
onKeyDown={(e) => e.key === "Enter" && setParam("q", query.trim())}
className="rounded-full border border-[#4a6b72]/25 bg-white px-4 py-1.5 text-sm text-[#26454c] outline-none focus:border-[#138ba0]"
className="rounded-full border border-muted/25 bg-surface px-4 py-1.5 text-sm text-body outline-none focus:border-brand"
/>
<button
type="button"
onClick={() => setParam("q", query.trim())}
className="rounded-full border border-[#4a6b72]/25 px-4 py-1.5 text-sm text-[#4a6b72] hover:border-[#138ba0]/50"
className="rounded-full border border-muted/25 px-4 py-1.5 text-sm text-muted hover:border-brand/50"
>
Search
</button>
@ -145,16 +145,16 @@ export default function EntityList() {
{error && (
<p
role="alert"
className="mt-6 rounded-xl border border-[#b3261e]/30 bg-[#fdf3f2] px-4 py-3 text-sm text-[#b3261e]"
className="mt-6 rounded-xl border border-danger/30 bg-danger-tint px-4 py-3 text-sm text-danger"
>
{error}
</p>
)}
{/* Rows */}
<div className="mt-6 overflow-x-auto rounded-2xl border border-[#138ba0]/20 bg-white">
<div className="mt-6 overflow-x-auto rounded-2xl border border-brand/20 bg-surface">
<table className="w-full text-left text-sm">
<thead className="border-b border-[#4a6b72]/15 text-xs text-[#4a6b72]">
<thead className="border-b border-muted/15 text-xs text-muted">
<tr>
{manifest.list.columns.map((column) => (
<th key={column.key} className="px-4 py-3 font-medium">
@ -170,14 +170,14 @@ export default function EntityList() {
{rows.map((row) => (
<tr
key={row.id}
className="cursor-pointer border-b border-[#4a6b72]/10 last:border-0 hover:bg-[#f6fbfc]"
className="cursor-pointer border-b border-muted/10 last:border-0 hover:bg-tint-soft"
onClick={() => navigate(`/admin/${manifest.key}/${row.id}`)}
>
{manifest.list.columns.map((column) => (
<td
key={column.key}
className={`px-4 py-3 ${
column.primary ? "font-medium text-[#26454c]" : "text-[#4a6b72]"
column.primary ? "font-medium text-body" : "text-muted"
}`}
>
{column.key === linkKey ? (
@ -199,16 +199,16 @@ export default function EntityList() {
)}
</td>
))}
<td className="px-4 py-3 font-mono text-xs text-[#4a6b72]">{row.id}</td>
<td className="px-4 py-3 font-mono text-xs text-muted">{row.id}</td>
</tr>
))}
</tbody>
</table>
{!loading && rows.length === 0 && (
<p className="px-4 py-8 text-center text-[#4a6b72]">Nothing matches.</p>
<p className="px-4 py-8 text-center text-muted">Nothing matches.</p>
)}
{loading && <p className="px-4 py-8 text-center text-[#4a6b72]">Loading…</p>}
{loading && <p className="px-4 py-8 text-center text-muted">Loading…</p>}
</div>
</div>
);

View file

@ -20,10 +20,11 @@ import { Link } from 'react-router-dom'
import FeaturedCards from '../../components/FeaturedCards.tsx'
import PlatformIcon from '../../components/PlatformIcon.tsx'
import { blogHref } from '../../lib/hrefs.ts'
import { blogImage } from '../../lib/media.ts'
import { mediaUrl } from '../../lib/media.ts'
import { preview } from '../../lib/text.ts'
import { postDate, useCommunityBlog, type BlogPostSummary } from '../../lib/useBlog.ts'
import HomeLink from './home/HomeLink.tsx'
import { accentText } from '../../lib/color.ts'
/* Headings for a half the admin didn't title. */
const DEFAULTS = {
@ -35,24 +36,24 @@ const DEFAULTS = {
const EXCERPT_CHARS = 180
function PostCard({ post, accent }: { post: BlogPostSummary; accent: string }) {
const cover = blogImage(post.cover_image)
const cover = mediaUrl(post.cover_image)
const date = postDate(post.published_on)
const authors = post.authors.map((author) => author.name).join(', ')
return (
<li className="relative flex flex-col overflow-hidden rounded-2xl border border-[#138ba0]/15 bg-white shadow-sm transition-shadow hover:shadow-lg">
<li className="relative flex flex-col overflow-hidden rounded-2xl border border-brand/15 bg-surface shadow-sm transition-shadow hover:shadow-lg">
{cover ? (
<img src={cover} alt="" loading="lazy" className="aspect-video w-full object-cover" />
) : (
<div className="aspect-video w-full bg-gradient-to-br from-[#eef9fb] to-[#d9f0f3]" />
<div className="aspect-video w-full bg-tint" />
)}
<div className="flex flex-1 flex-col p-6">
{(date || post.tags.length > 0) && (
<p className="text-xs font-bold uppercase tracking-[0.2em]" style={{ color: accent }}>
<p className="text-xs font-bold uppercase tracking-[0.2em]" style={{ color: accentText(accent) }}>
{[date, ...post.tags].filter(Boolean).join(' · ')}
</p>
)}
<h4 className="mt-2 font-display text-xl font-extrabold leading-snug text-[#073d4a]">
<h4 className="mt-2 font-display text-xl font-extrabold leading-snug text-ink">
<Link
to={blogHref(post.id)}
className="after:absolute after:inset-0 after:rounded-2xl after:content-[''] hover:underline"
@ -61,9 +62,9 @@ function PostCard({ post, accent }: { post: BlogPostSummary; accent: string }) {
</Link>
</h4>
{post.excerpt && (
<p className="mt-2 leading-relaxed text-[#4a6b72]">{preview(post.excerpt, EXCERPT_CHARS)}</p>
<p className="mt-2 leading-relaxed text-muted">{preview(post.excerpt, EXCERPT_CHARS)}</p>
)}
{authors && <p className="mt-auto pt-4 text-sm font-medium text-[#26454c]">By {authors}</p>}
{authors && <p className="mt-auto pt-4 text-sm font-medium text-body">By {authors}</p>}
</div>
</li>
)
@ -71,7 +72,7 @@ function PostCard({ post, accent }: { post: BlogPostSummary; accent: string }) {
function Subheading({ children, accent }: { children: string; accent: string }) {
return (
<h3 className="text-2xl font-extrabold" style={{ color: accent }}>
<h3 className="text-2xl font-extrabold" style={{ color: accentText(accent) }}>
{children}
</h3>
)
@ -82,13 +83,13 @@ export default function CommunityBlog({ accent = '#0f7183' }: { accent?: string
if (!blog) {
return (
<div className="mx-auto max-w-6xl px-6 text-[#4a6b72]">
<div className="mx-auto max-w-6xl px-6 text-muted">
{loading ? (
'Loading…'
) : (
<>
Couldn’t load the blog. {error}{' '}
<button type="button" onClick={reload} className="underline" style={{ color: accent }}>
<button type="button" onClick={reload} className="underline" style={{ color: accentText(accent) }}>
Try again
</button>
</>
@ -102,7 +103,7 @@ export default function CommunityBlog({ accent = '#0f7183' }: { accent?: string
const hasExternal = external.cards.length > 0 || Boolean(external.url)
if (!hasInternal && !hasExternal) {
return <p className="mx-auto max-w-6xl px-6 text-center text-[#4a6b72]">· Posts coming soon ·</p>
return <p className="mx-auto max-w-6xl px-6 text-center text-muted">· Posts coming soon ·</p>
}
return (

View file

@ -47,6 +47,7 @@ import { EVENT_TYPES, eventTypeLabel, type EventType } from '../../lib/eventType
import { firstOccurrenceFrom, occurrencesBetween, seriesTimes } from '../../lib/eventSeries.ts'
import { eventHref } from '../../lib/hrefs.ts'
import type { EventListItem } from '../../lib/useContent.ts'
import { withAlpha, accentText, readableOn } from '../../lib/color.ts'
export type CalendarControl = 'scope' | 'type' | 'online' | 'search'
export type CalendarView = 'month' | 'list'
@ -57,8 +58,8 @@ const ALL_CONTROLS: CalendarControl[] = ['scope', 'type', 'online', 'search']
const MAX_LANES = 3
const TEAL = '#0f7183'
const INK = '#073d4a'
const BODY = '#4a6b72'
const INK = 'var(--color-ink)'
const BODY = 'var(--color-muted)'
const WEEKDAYS = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']
@ -326,8 +327,8 @@ export default function EventCalendar({
<button
type="button"
onClick={() => go(monthKey(today))}
className="rounded-full border px-3 py-1 text-sm font-semibold hover:bg-white"
style={{ borderColor: accent, color: accent }}
className="rounded-full border px-3 py-1 text-sm font-semibold hover:bg-surface"
style={{ borderColor: accent, color: accentText(accent) }}
>
Today
</button>
@ -348,8 +349,8 @@ export default function EventCalendar({
className="px-4 py-1.5 text-sm font-semibold capitalize transition-colors"
style={
view === option
? { background: accent, color: '#ffffff' }
: { color: accent }
? { background: accent, color: readableOn(accent) }
: { color: accentText(accent) }
}
>
{option}
@ -380,7 +381,7 @@ export default function EventCalendar({
/>
)}
{show('online') && (
<label className="flex cursor-pointer items-center gap-2 rounded-full border border-[#138ba0]/25 bg-white px-4 py-2 text-sm">
<label className="flex cursor-pointer items-center gap-2 rounded-full border border-brand/25 bg-surface px-4 py-2 text-sm">
<input
type="checkbox"
checked={onlineOnly}
@ -398,7 +399,7 @@ export default function EventCalendar({
onChange={(e) => setQuery(e.target.value)}
placeholder="Search events"
aria-label="Search events"
className="min-w-[12rem] flex-1 rounded-full border border-[#138ba0]/25 bg-white px-4 py-2 text-sm outline-none focus:border-[#0f7183] focus:ring-2 focus:ring-[#0f7183]/40 md:max-w-xs"
className="min-w-[12rem] flex-1 rounded-full border border-brand/25 bg-surface px-4 py-2 text-sm outline-none focus:border-link focus:ring-2 focus:ring-link/40 md:max-w-xs"
/>
)}
{filtering && (
@ -406,7 +407,7 @@ export default function EventCalendar({
type="button"
onClick={clearFilters}
className="text-sm font-semibold hover:underline"
style={{ color: accent }}
style={{ color: accentText(accent) }}
>
Clear filters
</button>
@ -417,7 +418,7 @@ export default function EventCalendar({
{/* ── Body ── */}
<div className="mt-6">
{error ? (
<p className="rounded-2xl bg-white p-6 text-[#b3261e]">
<p className="rounded-2xl bg-surface p-6 text-danger">
Couldn’t load events. {error.message}
</p>
) : loading ? (
@ -457,7 +458,7 @@ export default function EventCalendar({
type="button"
onClick={() => go(monthKey(next))}
className="font-semibold hover:underline"
style={{ color: accent }}
style={{ color: accentText(accent) }}
>
Jump to the next event, {monthTitle(monthKey(next))} →
</button>
@ -494,8 +495,8 @@ type MonthGridProps = {
function MonthGrid({ weeks, month, today, occurrences, selected, onSelect, accent }: MonthGridProps) {
return (
<div className="overflow-hidden rounded-3xl border border-[#138ba0]/15 bg-white shadow-sm">
<div className="grid grid-cols-7 border-b border-[#138ba0]/10 bg-[#f6fbfc]">
<div className="overflow-hidden rounded-3xl border border-brand/15 bg-surface shadow-sm">
<div className="grid grid-cols-7 border-b border-brand/10 bg-tint-soft">
{WEEKDAYS.map((day) => (
<div
key={day}
@ -516,7 +517,7 @@ function MonthGrid({ weeks, month, today, occurrences, selected, onSelect, accen
segments.filter((s) => s.col <= col && s.col + s.span > col).length
return (
<div key={week[0]} className="relative min-h-[8rem] border-b border-[#138ba0]/10 last:border-b-0">
<div key={week[0]} className="relative min-h-[8rem] border-b border-brand/10 last:border-b-0">
{/* Day cells: the click targets, and the numbers. */}
<div className="absolute inset-0 grid grid-cols-7">
{week.map((date, col) => {
@ -532,23 +533,23 @@ function MonthGrid({ weeks, month, today, occurrences, selected, onSelect, accen
onClick={() => onSelect(date)}
aria-pressed={isSelected}
aria-label={`${longDay(date)}${count ? `, ${count} event${count === 1 ? '' : 's'}` : ''}`}
className="relative flex flex-col items-start border-r border-[#138ba0]/10 p-2 text-left transition-colors last:border-r-0 hover:bg-[#f6fbfc]"
className="relative flex flex-col items-start border-r border-brand/10 p-2 text-left transition-colors last:border-r-0 hover:bg-tint-soft"
style={{
background: isSelected ? `${accent}14` : outside ? '#fbfdfd' : undefined,
background: isSelected ? `${withAlpha(accent, 8)}` : outside ? 'var(--color-tint-soft)' : undefined,
}}
>
<span
className="flex h-7 w-7 items-center justify-center rounded-full text-sm font-semibold"
style={
isToday
? { background: accent, color: '#ffffff' }
: { color: outside ? '#b8c6c9' : INK }
? { background: accent, color: readableOn(accent) }
: { color: outside ? withAlpha('var(--color-muted)', 60) : INK }
}
>
{Number(date.slice(8))}
</span>
{hidden > 0 && (
<span className="mt-auto text-xs font-semibold" style={{ color: accent }}>
<span className="mt-auto text-xs font-semibold" style={{ color: accentText(accent) }}>
+{hidden} more
</span>
)}
@ -620,14 +621,14 @@ function DayPanel({
onClose: () => void
}) {
return (
<div className="mt-4 rounded-3xl border bg-white p-6" style={{ borderColor: `${accent}40` }}>
<div className="mt-4 rounded-3xl border bg-surface p-6" style={{ borderColor: `${withAlpha(accent, 25)}` }}>
<div className="flex items-center gap-4">
<h4 className="font-display text-lg font-bold">{longDay(date)}</h4>
<button
type="button"
onClick={onClose}
className="ml-auto text-sm font-semibold hover:underline"
style={{ color: accent }}
style={{ color: accentText(accent) }}
>
Close
</button>
@ -664,7 +665,7 @@ function MonthList({
}) {
if (items.length === 0) {
return (
<p className="rounded-3xl bg-white p-10 text-center" style={{ color: BODY }}>
<p className="rounded-3xl bg-surface p-10 text-center" style={{ color: BODY }}>
Nothing on the calendar this month.
</p>
)
@ -683,9 +684,9 @@ function MonthList({
{[...byDay.entries()].map(([day, list]) => {
const d = parse(day)
return (
<li key={day} className="flex gap-5 rounded-3xl bg-white p-5 shadow-sm">
<li key={day} className="flex gap-5 rounded-3xl bg-surface p-5 shadow-sm">
<div className="w-14 shrink-0 text-center">
<p className="text-xs font-bold uppercase tracking-widest" style={{ color: accent }}>
<p className="text-xs font-bold uppercase tracking-widest" style={{ color: accentText(accent) }}>
{d.toLocaleDateString(undefined, { weekday: 'short' })}
</p>
<p className="font-display text-3xl font-extrabold leading-none">{d.getDate()}</p>
@ -715,13 +716,13 @@ function EventLine({ item, accent }: { item: Occurrence; accent: string }) {
return (
<Link
to={eventHref(event.id)}
className="group flex items-start gap-3 rounded-xl p-2 transition-colors hover:bg-[#f6fbfc]"
className="group flex items-start gap-3 rounded-xl p-2 transition-colors hover:bg-tint-soft"
>
<span className="mt-1.5 h-3 w-3 shrink-0 rounded-full" style={{ background: color }} aria-hidden="true" />
<span className="min-w-0">
<span className={`block font-semibold group-hover:underline ${cancelled ? 'line-through' : ''}`}>
{event.title}
{cancelled && <span className="ml-2 text-xs font-bold uppercase text-[#b3261e] no-underline">Cancelled</span>}
{cancelled && <span className="ml-2 text-xs font-bold uppercase text-danger no-underline">Cancelled</span>}
</span>
<span className="block text-sm" style={{ color: BODY }}>
{[
@ -755,8 +756,8 @@ function NavButton({
type="button"
onClick={onClick}
aria-label={label}
className="flex h-10 w-10 items-center justify-center rounded-full border text-xl transition-colors hover:bg-white"
style={{ borderColor: accent, color: accent }}
className="flex h-10 w-10 items-center justify-center rounded-full border text-xl transition-colors hover:bg-surface"
style={{ borderColor: accent, color: accentText(accent) }}
>
{children}
</button>
@ -781,7 +782,7 @@ function FilterSelect({
value={value}
onChange={(e) => onChange(e.target.value)}
aria-label={label}
className="rounded-full border border-[#138ba0]/25 bg-white px-4 py-2 text-sm outline-none focus:border-[#0f7183] focus:ring-2 focus:ring-[#0f7183]/40"
className="rounded-full border border-brand/25 bg-surface px-4 py-2 text-sm outline-none focus:border-link focus:ring-2 focus:ring-link/40"
>
<option value="">{all}</option>
{options.map(([id, name]) => (

View file

@ -5,7 +5,9 @@ import { eventHref } from "../../lib/hrefs.ts";
import { EVENT_TYPES, eventTypeLabel } from "../../lib/eventTypes.ts";
import { seriesLabel } from "../../lib/eventSeries.ts";
import PlatformIcon from "../../components/PlatformIcon.tsx";
import { eventBackground, eventLogo as eventLogoSrc, orgLogo as orgLogoSrc } from "../../lib/media.ts";
import { mediaUrl } from "../../lib/media.ts";
import Logo from "../../components/Logo.tsx";
import { accentText, withAlpha, readableOn } from '../../lib/color.ts'
/* ═══════════════════════════════════════════════════════════════
EVENT LIST: CARDS
@ -33,38 +35,21 @@ import { eventBackground, eventLogo as eventLogoSrc, orgLogo as orgLogoSrc } fro
fires only for an event with no host at all. */
const DEFAULT_ORG_LOGO = null;
/* An <img> that removes itself if the file 404s. `src` is already
resolved by media.ts: a bare filename from the uploads directory,
anything with a path or URL as it is. */
function Logo({ src, alt = "", className }) {
const [failed, setFailed] = useState(false);
if (!src || failed) return null;
return (
<img
src={src}
alt={alt}
className={className}
onError={() => setFailed(true)}
/>
);
}
const TEAL = "#0f7183"; // last-resort card color
const INK = "#073d4a"; // button text: the card colour is only a border
const CARD_BG = "#ffffff"; // sits under every card, gradient or not
const INK = "var(--color-ink)"; // button text: the card colour is only a border
const CARD_BG = "var(--color-surface)"; // sits under every card, photo or not
/* Laid over a card's background image so black text reads on any
photo. Heavier at the top, where the title and dates are, and
lighter lower down so more of the picture shows through. */
const CARD_IMAGE_VEIL =
"linear-gradient(to bottom, rgba(255,255,255,0.9), rgba(255,255,255,0.78))";
"linear-gradient(to bottom, color-mix(in srgb, var(--color-surface) 90%, transparent), color-mix(in srgb, var(--color-surface) 78%, transparent))";
/* The card's background layers, top first: its gradient if it has
one, then the veil and photo if it has one, then white. */
/* The card's background layers, top first: the veil and photo if it
has one, then the plain surface. */
function cardBackground(ev) {
const layers: string[] = [];
if (ev.gradient) layers.push(ev.gradient);
const image = eventBackground(ev.card_image);
const image = mediaUrl(ev.card_image);
if (image) {
layers.push(CARD_IMAGE_VEIL, `url(${JSON.stringify(image)}) center / cover no-repeat`);
}
@ -155,8 +140,8 @@ export function Card({
}) {
const past = ev.status === "past";
const color = ev.color || defaultColor;
const orgLogo = orgLogoSrc(ev.org_logo) || DEFAULT_ORG_LOGO;
const eventLogo = eventLogoSrc(ev.event_logo);
const orgLogo = mediaUrl(ev.org_logo) || DEFAULT_ORG_LOGO;
const eventLogo = mediaUrl(ev.event_logo);
const schedule = seriesLabel(ev.series, ev.starts_on);
const links = ev.links ?? [];
const igHandle = ev.instagram || null;
@ -192,7 +177,7 @@ export function Card({
return (
<div
className={`rounded-3xl text-black overflow-hidden shadow-2xl h-full flex flex-col ${
className={`rounded-3xl text-ink overflow-hidden shadow-2xl h-full flex flex-col ${
compact ? "ev-card" : ""
}`}
style={{
@ -278,7 +263,7 @@ export function Card({
doesn't. */}
<div className={`mt-auto ${compact ? "pt-6" : "pt-8"}`}>
{links.length === 0 && (
<p className="text-center font-semibold" style={{ color: accent }}>
<p className="text-center font-semibold" style={{ color: accentText(accent) }}>
{past
? "This event has concluded. Thank you to everyone who joined us!"
: igHandle
@ -320,7 +305,7 @@ export function Card({
className={`ig-link flex items-center justify-center rounded-xl font-bold transition-all duration-200 hover:scale-[1.02] gap-3 ${
compact ? "py-2.5 px-5" : "py-3 px-6"
}`}
style={{ border: `1px solid ${accent}`, color: accent }}
style={{ border: `1px solid ${accent}`, color: accentText(accent) }}
>
<PlatformIcon platform="instagram" className="w-6 h-6" />
{igHandle}
@ -362,7 +347,7 @@ export function TypeFilter({ types, active, setActive, accent }) {
const chip = on => ({
border: `1px solid ${accent}`,
background: on ? accent : "transparent",
color: on ? "#ffffff" : accent,
color: on ? readableOn(accent) : accentText(accent),
});
const button = (id, label) => (
@ -396,7 +381,7 @@ export function TypeFilter({ types, active, setActive, accent }) {
export function EventCardsToggle({ view, setView, accent }) {
const btn = active => ({
background: active ? accent : "transparent",
color: active ? "#ffffff" : accent,
color: active ? readableOn(accent) : accentText(accent),
});
return (
@ -522,14 +507,14 @@ export default function EventListCards({
// Arrows and dots follow the section accent, not the active card.
const arrowStyle = enabled => ({
border: `1px solid ${accent}`,
background: "rgba(255,255,255,0.85)",
color: enabled ? accent : "#b8c6c9",
background: "color-mix(in srgb, var(--color-surface) 85%, transparent)",
color: enabled ? accentText(accent) : withAlpha("var(--color-muted)", 50),
cursor: enabled ? "pointer" : "default",
opacity: enabled ? 1 : 0.4,
});
const notice = text => (
<p className="max-w-6xl mx-auto px-6 font-semibold" style={{ color: accent }}>
<p className="max-w-6xl mx-auto px-6 font-semibold" style={{ color: accentText(accent) }}>
{text}
</p>
);
@ -600,7 +585,7 @@ export default function EventListCards({
<div className="mt-12">
<h3
className="text-2xl font-extrabold mb-6"
style={{ color: accent, opacity: 0.85 }}
style={{ color: accentText(accent), opacity: 0.85 }}
>
Past Events
</h3>
@ -640,7 +625,7 @@ export default function EventListCards({
onClick={() => setShowPast(v => !v)}
aria-expanded={showPast}
className="flex items-center gap-2 py-2.5 px-6 rounded-xl font-bold transition-all duration-200 hover:scale-105"
style={{ border: `1px solid ${accent}`, color: accent }}
style={{ border: `1px solid ${accent}`, color: accentText(accent) }}
>
{showPast
? "Hide past events"
@ -737,7 +722,7 @@ export default function EventListCards({
className="h-2.5 rounded-full transition-all duration-200"
style={{
width: i === index ? "1.5rem" : "0.625rem",
background: i === index ? accent : "#b8c6c9",
background: i === index ? accent : withAlpha("var(--color-muted)", 40),
}}
/>
))}

View file

@ -9,15 +9,20 @@
The page and section options come from navConfig, so adding a
page to the nav adds it to this form too.
With fixedType the type is set and neither picker shows. The
Privacy page uses it for data requests (DATA_REQUEST), which also
need an email, since the answer has to go somewhere.
═══════════════════════════════════════════════════════════════ */
import { useState } from "react";
import { post, ApiError } from "../../lib/api.ts";
import { PAGE_LINKS, PAGE_SECTIONS } from "../../navConfig.ts";
import { FEEDBACK_TYPES } from "../../data/feedbackTypes.ts";
import { DATA_REQUEST, FEEDBACK_TYPES } from "../../data/feedbackTypes.ts";
import { accentText } from '../../lib/color.ts'
const ACCENT = "#0f7183";
const MUTED = "#4a6b72";
const MUTED = "var(--color-muted)";
const MAX_CHARS = 1500;
const MIN_MESSAGE = 10; // matches the server
@ -30,17 +35,17 @@ const WHOLE_PAGE = "";
/* ── Shared field chrome ─────────────────────────────────────── */
const fieldClass =
"w-full rounded-xl border border-[#4a6b72]/25 bg-white px-4 py-3 text-[#26454c] " +
"placeholder:text-[#4a6b72]/50 outline-none transition-colors " +
"focus:border-[#138ba0] focus:ring-2 focus:ring-[#138ba0]/25";
"w-full rounded-xl border border-muted/25 bg-surface px-4 py-3 text-body " +
"placeholder:text-muted/50 outline-none transition-colors " +
"focus:border-brand focus:ring-2 focus:ring-brand/25";
const errorFieldClass = "border-[#b3261e] focus:border-[#b3261e] focus:ring-[#b3261e]/20";
const errorFieldClass = "border-danger focus:border-danger focus:ring-danger/20";
const selectClass = `${fieldClass} appearance-none pr-10`;
function OptionalTag() {
return (
<span className="ml-2 rounded-full bg-[#eef9fb] px-2 py-0.5 text-xs font-medium text-[#0f7183]">
<span className="ml-2 rounded-full bg-tint px-2 py-0.5 text-xs font-medium text-link">
Optional
</span>
);
@ -49,7 +54,7 @@ function OptionalTag() {
function FieldError({ id, children }) {
if (!children) return null;
return (
<p id={id} className="mt-2 text-sm text-[#b3261e]">
<p id={id} className="mt-2 text-sm text-danger">
{children}
</p>
);
@ -59,7 +64,7 @@ function FieldError({ id, children }) {
function Select({ id, label, value, onChange, children }) {
return (
<div>
<label htmlFor={id} className="block text-sm font-medium text-[#26454c]">
<label htmlFor={id} className="block text-sm font-medium text-body">
{label}
</label>
<div className="relative mt-2">
@ -96,7 +101,7 @@ function Select({ id, label, value, onChange, children }) {
function TypePicker({ value, onChange }) {
return (
<fieldset>
<legend className="text-base font-semibold text-[#26454c]">
<legend className="text-base font-semibold text-body">
What kind of feedback is this?
</legend>
<p className="mt-1 text-sm" style={{ color: MUTED }}>
@ -119,21 +124,21 @@ function TypePicker({ value, onChange }) {
<span
className={
"flex h-full flex-col gap-1 rounded-xl border p-4 transition-colors " +
"peer-focus-visible:ring-2 peer-focus-visible:ring-[#138ba0]/40 " +
"peer-focus-visible:ring-2 peer-focus-visible:ring-brand/40 " +
(selected
? "border-[#138ba0] bg-[#eef9fb]"
: "border-[#4a6b72]/20 bg-white hover:border-[#138ba0]/50")
? "border-brand bg-tint"
: "border-muted/20 bg-surface hover:border-brand/50")
}
>
<span className="flex items-start justify-between gap-2">
<span className="font-semibold text-[#26454c]">{type.label}</span>
<span className="font-semibold text-body">{type.label}</span>
<span
aria-hidden="true"
className={
"mt-0.5 h-4 w-4 shrink-0 rounded-full border-2 transition-colors " +
(selected
? "border-[#138ba0] bg-[#0f7183] ring-2 ring-inset ring-white"
: "border-[#4a6b72]/30")
? "border-brand bg-action ring-2 ring-inset ring-white"
: "border-muted/30")
}
/>
</span>
@ -157,7 +162,7 @@ function LocationPicker({ page, section, onPageChange, onSectionChange }) {
return (
<div>
<div className="flex flex-wrap items-center">
<h3 className="text-base font-semibold text-[#26454c]">
<h3 className="text-base font-semibold text-body">
Where did you run into it?
</h3>
<OptionalTag />
@ -216,8 +221,9 @@ function describeLocation(page, section) {
/* ── The form ────────────────────────────────────────────────── */
export default function FeedbackForm() {
const [type, setType] = useState<any>(null);
export default function FeedbackForm({ fixedType }: { fixedType?: string } = {}) {
const request = fixedType === DATA_REQUEST.id;
const [type, setType] = useState<any>(fixedType ?? null);
const [page, setPage] = useState(SITE_WIDE);
const [section, setSection] = useState(WHOLE_PAGE);
const [message, setMessage] = useState("");
@ -233,7 +239,8 @@ export default function FeedbackForm() {
const [fieldErrors, setFieldErrors] = useState<any>({});
const sending = status === "sending";
const ready = Boolean(type) && message.trim().length >= MIN_MESSAGE;
const ready =
Boolean(type) && message.trim().length >= MIN_MESSAGE && (!request || email.trim() !== "");
async function handleSubmit(event) {
event.preventDefault();
@ -271,7 +278,7 @@ export default function FeedbackForm() {
}
function reset() {
setType(null);
setType(fixedType ?? null);
setPage(SITE_WIDE);
setSection(WHOLE_PAGE);
setMessage("");
@ -288,9 +295,9 @@ export default function FeedbackForm() {
return (
<div
aria-live="polite"
className="rounded-2xl border border-[#138ba0]/20 bg-white p-8 sm:p-10"
className="rounded-2xl border border-brand/20 bg-surface p-8 sm:p-10"
>
<h3 className="text-2xl font-bold" style={{ color: ACCENT }}>
<h3 className="text-2xl font-bold" style={{ color: accentText(ACCENT) }}>
Thanks, we've got it
</h3>
{where && (
@ -299,16 +306,18 @@ export default function FeedbackForm() {
</p>
)}
<p className="mt-3 max-w-prose" style={{ color: MUTED }}>
{email
? `We'll follow up at ${email} if we have questions.`
: "You sent this anonymously, so we won't be able to reply, but we read everything that comes in."}
{request
? `We'll reply to ${email}. We may ask you to confirm it's you before we change or delete anything.`
: email
? `We'll follow up at ${email} if we have questions.`
: "You sent this anonymously, so we won't be able to reply, but we read everything that comes in."}
</p>
<button
type="button"
onClick={reset}
className="mt-6 rounded-full border border-[#138ba0] px-5 py-2.5 font-semibold text-[#0f7183] transition-colors hover:bg-[#eef9fb] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#138ba0]/40"
className="mt-6 rounded-full border border-brand px-5 py-2.5 font-semibold text-link transition-colors hover:bg-tint focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand/40"
>
Send more feedback
{request ? "Send another request" : "Send more feedback"}
</button>
</div>
);
@ -318,30 +327,35 @@ export default function FeedbackForm() {
<form
onSubmit={handleSubmit}
noValidate
className="rounded-2xl border border-[#138ba0]/20 bg-white p-6 sm:p-8"
className="rounded-2xl border border-brand/20 bg-surface p-6 sm:p-8"
>
<TypePicker value={type} onChange={setType} />
{!fixedType && (
<>
<TypePicker value={type} onChange={setType} />
<div className="mt-10">
<LocationPicker
page={page}
section={section}
onPageChange={setPage}
onSectionChange={setSection}
/>
</div>
<div className="mt-10">
<LocationPicker
page={page}
section={section}
onPageChange={setPage}
onSectionChange={setSection}
/>
</div>
</>
)}
{/* Message */}
<div className="mt-10">
<div className={fixedType ? "" : "mt-10"}>
<label
htmlFor="feedback-message"
className="text-base font-semibold text-[#26454c]"
className="text-base font-semibold text-body"
>
Tell us more
{request ? "Your request" : "Tell us more"}
</label>
<p className="mt-1 text-sm" style={{ color: MUTED }}>
What you expected to happen, and what happened instead, is the most
useful thing you can give us.
{request
? "Say what you'd like: to see the information we hold about you, to correct it, or to have it deleted. Tell us how you've been in touch with NGU (a retreat, a chapter, this site) so we can find it."
: "What you expected to happen, and what happened instead, is the most useful thing you can give us."}
</p>
<textarea
id="feedback-message"
@ -349,7 +363,11 @@ export default function FeedbackForm() {
maxLength={MAX_CHARS}
value={message}
onChange={(e) => setMessage(e.target.value)}
placeholder="I was looking for the summer retreat dates and…"
placeholder={
request
? "Please delete the details I gave when I registered for…"
: "I was looking for the summer retreat dates and…"
}
aria-invalid={Boolean(fieldErrors.message)}
aria-describedby={fieldErrors.message ? "feedback-message-error" : undefined}
className={`mt-4 resize-y ${fieldClass} ${
@ -368,23 +386,26 @@ export default function FeedbackForm() {
</div>
{/* Optional contact details */}
<div className="mt-8 rounded-xl border border-dashed border-[#4a6b72]/30 bg-[#eef9fb]/60 p-5 sm:p-6">
<div className="mt-8 rounded-xl border border-dashed border-muted/30 bg-tint/60 p-5 sm:p-6">
<div className="flex flex-wrap items-center">
<h3 className="text-base font-semibold text-[#26454c]">Your details</h3>
<OptionalTag />
<h3 className="text-base font-semibold text-body">
{request ? "How we reach you" : "Your details"}
</h3>
{!request && <OptionalTag />}
</div>
<p className="mt-1 max-w-prose text-sm" style={{ color: MUTED }}>
Leave these blank and your feedback comes through anonymously. Fill
them in only if you'd like a reply, we won't add you to any list.
{request
? "We use these only to answer this request, and we won't add you to any list."
: "Leave these blank and your feedback comes through anonymously. Fill them in only if you'd like a reply, we won't add you to any list."}
</p>
<div className="mt-5 grid gap-4 sm:grid-cols-2">
<div>
<label
htmlFor="feedback-name"
className="block text-sm font-medium text-[#26454c]"
className="block text-sm font-medium text-body"
>
Name <span className="font-normal text-[#4a6b72]">(optional)</span>
Name <span className="font-normal text-muted">(optional)</span>
</label>
<input
id="feedback-name"
@ -398,14 +419,16 @@ export default function FeedbackForm() {
<div>
<label
htmlFor="feedback-email"
className="block text-sm font-medium text-[#26454c]"
className="block text-sm font-medium text-body"
>
Email <span className="font-normal text-[#4a6b72]">(optional)</span>
Email{" "}
<span className="font-normal text-muted">{request ? "(required)" : "(optional)"}</span>
</label>
<input
id="feedback-email"
type="email"
autoComplete="email"
required={request}
value={email}
onChange={(e) => setEmail(e.target.value)}
aria-invalid={Boolean(fieldErrors.email)}
@ -437,7 +460,7 @@ export default function FeedbackForm() {
{formError && (
<p
role="alert"
className="mt-8 rounded-xl border border-[#b3261e]/30 bg-[#fdf3f2] px-4 py-3 text-sm text-[#b3261e]"
className="mt-8 rounded-xl border border-danger/30 bg-danger-tint px-4 py-3 text-sm text-danger"
>
{formError}
</p>
@ -447,13 +470,15 @@ export default function FeedbackForm() {
<button
type="submit"
disabled={!ready || sending}
className="rounded-full bg-[#0f7183] px-7 py-3 font-semibold text-white transition-colors hover:bg-[#0b5c6a] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#138ba0]/40 disabled:cursor-not-allowed disabled:bg-[#4a6b72]/25 disabled:text-white/80"
className="rounded-full bg-action px-7 py-3 font-semibold text-white transition-colors hover:bg-action-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand/40 disabled:cursor-not-allowed disabled:bg-muted/25 disabled:text-white/80"
>
{sending ? "Sending…" : "Send feedback"}
{sending ? "Sending…" : request ? "Send request" : "Send feedback"}
</button>
{!ready && !sending && (
<p className="text-sm" style={{ color: MUTED }}>
Choose a type and write at least a sentence to send.
{request
? "Write at least a sentence and give an email address to send."
: "Choose a type and write at least a sentence to send."}
</p>
)}
</div>

View file

@ -1,12 +1,13 @@
import { useState } from "react";
import ArrowLink from "../../components/ArrowLink.tsx";
import { orgLogo } from "../../lib/media.ts";
import { mediaUrl } from "../../lib/media.ts";
import Logo from "../../components/Logo.tsx";
import {
initialsFor,
orgPath,
useOrganizations,
byName,
} from "../../lib/organizations.ts";
import { accentText } from '../../lib/color.ts'
/* ═══════════════════════════════════════════════════════════════
ORGANIZATION LIST: CARDS
@ -23,8 +24,8 @@ import {
array, only the short card description.
═══════════════════════════════════════════════════════════════ */
const MUTED = "#7a9299";
const INK = "#2c4a50";
const MUTED = "var(--color-muted)";
const INK = "var(--color-body)";
const FALLBACK_COLOR = "#4a6b72";
/* Wide enough for a logo beside two lines of text, narrow enough
@ -34,27 +35,20 @@ const CARD_MIN = "20rem";
const GRID_MAX = "88rem";
function OrgMark({ org, color }) {
const [failed, setFailed] = useState(false);
if (org.logo && !failed) {
return (
<img
src={orgLogo(org.logo) ?? undefined}
alt=""
onError={() => setFailed(true)}
className="h-14 w-14 object-contain rounded-xl shrink-0"
/>
);
}
return (
<span
className="h-14 w-14 rounded-xl shrink-0 flex items-center justify-center font-extrabold"
style={{ border: `1px solid ${color}`, color }}
aria-hidden="true"
>
{initialsFor(org.name)}
</span>
<Logo
src={mediaUrl(org.logo)}
className="h-14 w-14 object-contain rounded-xl shrink-0"
fallback={
<span
className="h-14 w-14 rounded-xl shrink-0 flex items-center justify-center font-extrabold"
style={{ border: `1px solid ${color}`, color: accentText(color) }}
aria-hidden="true"
>
{initialsFor(org.name)}
</span>
}
/>
);
}
@ -70,7 +64,7 @@ function OrgCard({ org, accent, pageLabel, siteLabel }) {
return (
<div
className="rounded-2xl p-6 h-full flex flex-col transition-transform duration-200 hover:scale-[1.01]"
style={{ border: `1px solid ${color}`, background: "#ffffff" }}
style={{ border: `1px solid ${color}`, background: "var(--color-surface)" }}
>
<div className="flex items-start gap-4">
<OrgMark org={org} color={color} />
@ -195,7 +189,7 @@ export default function OrgListCards({
if (error && organizations.length === 0) {
return shell(
<p className="font-semibold" style={{ color: accent }}>
<p className="font-semibold" style={{ color: accentText(accent) }}>
· This list couldn't be loaded just now, please try again shortly ·
</p>
);
@ -203,7 +197,7 @@ export default function OrgListCards({
if (organizations.length === 0) {
return shell(
<p className="font-semibold" style={{ color: accent }}>
<p className="font-semibold" style={{ color: accentText(accent) }}>
{empty}
</p>
);

View file

@ -2,9 +2,11 @@ import { useEffect, useRef, useState } from "react";
import { useCommunity } from "../../lib/chapters.ts";
import { Link } from "react-router-dom";
import ArrowLink from "../../components/ArrowLink.tsx";
import { orgLogo } from "../../lib/media.ts";
import { mediaUrl } from "../../lib/media.ts";
import { initialsFor, orgPath } from "../../lib/organizations.ts";
import { AREAS, AREA_NAMES } from "../../data/mapGrid.ts";
import { withAlpha, accentText, readableOn } from '../../lib/color.ts'
import { scrollBehavior } from "../../lib/motion.ts";
/* ═══════════════════════════════════════════════════════════════
ORGANIZATION LIST: MAP
@ -40,9 +42,9 @@ const ROWS = 7;
// stays at max-w-6xl, so this deliberately breaks out past it.
const CONTENT_MAX = "88rem";
const MUTED = "#7a9299";
const RULE = "#cfe3e7";
const INK = "#2c4a50";
const MUTED = "var(--color-muted)";
const RULE = "color-mix(in srgb, var(--color-muted) 25%, transparent)";
const INK = "var(--color-body)";
const FALLBACK_COLOR = "#4a6b72";
/* organizations.color is nullable; an SVG fill left undefined paints
@ -214,7 +216,7 @@ function Tile({
height={size}
rx={14}
fill="none"
stroke={active ? colorOf(primary) : "#ffffff"}
stroke={active ? colorOf(primary) : "var(--color-surface)"}
strokeOpacity={active ? 1 : 0.55}
strokeWidth={active ? 4 : 2}
className="transition-all duration-200"
@ -227,7 +229,7 @@ function Tile({
dominantBaseline="middle"
fontSize={fontSize}
fontWeight="800"
fill={count ? "#ffffff" : colorOf(primary)}
fill={count ? "var(--color-surface)" : colorOf(primary)}
style={{ pointerEvents: "none" }}
>
{label || code}
@ -292,7 +294,7 @@ function LegendButton({ region, selected, setSelected, hovered, setHovered }) {
style={{
border: `1px solid ${colorOf(region)}`,
background: on ? colorOf(region) : "transparent",
color: on ? "#ffffff" : INK,
color: on ? readableOn(colorOf(region)) : INK,
opacity: selected && selected !== region.id ? 0.45 : 1,
}}
>
@ -471,7 +473,7 @@ function OrgLogo({ org, color, size = "h-14 w-14" }) {
if (org.logo && !failed) {
return (
<img
src={orgLogo(org.logo) ?? undefined}
src={mediaUrl(org.logo) ?? undefined}
alt={org.name}
onError={() => setFailed(true)}
className={`${size} object-contain rounded-xl shrink-0`}
@ -496,7 +498,7 @@ function ChapterCard({ chapter, color, open, onOpen }) {
className="rounded-2xl p-4 flex items-start gap-4 transition-all duration-200"
style={{
border: `1px solid ${color}`,
background: open ? `${color}14` : "transparent",
background: open ? `${withAlpha(color, 8)}` : "transparent",
}}
>
<OrgLogo org={chapter} color={color} />
@ -574,7 +576,7 @@ function ChapterDetail({ chapter, region, onClose }) {
return (
<div
className="rounded-2xl p-6 mb-6"
style={{ border: `2px solid ${colorOf(region)}`, background: `${colorOf(region)}0f` }}
style={{ border: `2px solid ${colorOf(region)}`, background: `${withAlpha(colorOf(region), 6)}` }}
>
<div className="flex items-start gap-4">
<OrgLogo org={chapter} color={colorOf(region)} size="h-20 w-20" />
@ -616,7 +618,7 @@ function ChapterDetail({ chapter, region, onClose }) {
<Link
to={orgPath(chapter)!}
className="py-2 px-5 rounded-xl font-bold text-sm transition-transform duration-200 hover:scale-105"
style={{ background: colorOf(region), color: "#ffffff" }}
style={{ background: colorOf(region), color: readableOn(colorOf(region)) }}
>
Chapter page
</Link>
@ -723,7 +725,7 @@ function ChapterGrid({ regions, chapters, chaptersIn, subtextFor, openId, setOpe
export function OrgMapToggle({ view, setView, accent }) {
const btn = active => ({
background: active ? accent : "transparent",
color: active ? "#ffffff" : accent,
color: active ? readableOn(accent) : accentText(accent),
});
return (
@ -797,7 +799,7 @@ export default function OrgListMap({ view = "map", accent = FALLBACK_COLOR }) {
// that it's stacked under the map and scrolling it would fight
// the page.
if (box.scrollHeight <= box.clientHeight) return;
box.scrollTo({ top: el.offsetTop - 8, behavior: "smooth" });
box.scrollTo({ top: el.offsetTop - 8, behavior: scrollBehavior() });
};
// Hovering or selecting a region on the map or legend brings its
@ -834,7 +836,7 @@ export default function OrgListMap({ view = "map", accent = FALLBACK_COLOR }) {
if (error && regions.length === 0) {
return shell(
<p className="font-semibold" style={{ color: accent }}>
<p className="font-semibold" style={{ color: accentText(accent) }}>
· Chapters couldn't be loaded just now, please try again shortly ·
</p>
);

View file

@ -1,6 +1,7 @@
import { useId, useState } from "react";
import ArrowLink from "../../components/ArrowLink.tsx";
import { orgLogo } from "../../lib/media.ts";
import { mediaUrl } from "../../lib/media.ts";
import Logo from "../../components/Logo.tsx";
import PlatformIcon from "../../components/PlatformIcon.tsx";
import {
areasSentence,
@ -9,6 +10,7 @@ import {
useOrganizations,
byName,
} from "../../lib/organizations.ts";
import { accentText } from '../../lib/color.ts'
/* ═══════════════════════════════════════════════════════════════
ORGANIZATION LIST: VERTICAL
@ -38,9 +40,9 @@ import {
a partner row simply doesn't have them.
═══════════════════════════════════════════════════════════════ */
const MUTED = "#7a9299";
const RULE = "#cfe3e7";
const INK = "#2c4a50";
const MUTED = "var(--color-muted)";
const RULE = "color-mix(in srgb, var(--color-muted) 25%, transparent)";
const INK = "var(--color-body)";
const FALLBACK_COLOR = "#4a6b72";
/* ── Row button ───────────────────────────────────────────────
@ -61,38 +63,18 @@ function RowButton({ as: As = "button", color, children, ...rest }: any) {
}
function OrgMark({ org, color }) {
const [failed, setFailed] = useState(false);
if (org.logo && !failed) {
return (
<img
src={orgLogo(org.logo) ?? undefined}
alt=""
onError={() => setFailed(true)}
className="h-8 w-8 object-contain shrink-0"
/>
);
}
if (org.color) {
return (
<span
className="h-3 w-3 rounded-full shrink-0"
style={{ background: color }}
aria-hidden="true"
/>
);
}
return (
const fallback = org.color ? (
<span className="h-3 w-3 rounded-full shrink-0" style={{ background: color }} aria-hidden="true" />
) : (
<span
className="h-8 w-8 rounded-lg shrink-0 flex items-center justify-center text-xs font-extrabold"
style={{ border: `1px solid ${color}`, color }}
style={{ border: `1px solid ${color}`, color: accentText(color) }}
aria-hidden="true"
>
{initialsFor(org.name)}
</span>
);
return <Logo src={mediaUrl(org.logo)} className="h-8 w-8 object-contain shrink-0" fallback={fallback} />;
}
function OrgRow({ org, pageLabel, siteLabel }) {
@ -290,7 +272,7 @@ export default function OrgListVertical({
if (error && organizations.length === 0) {
return shell(
<p className="font-semibold" style={{ color: accent }}>
<p className="font-semibold" style={{ color: accentText(accent) }}>
· This list couldn't be loaded just now, please try again shortly ·
</p>
);
@ -298,7 +280,7 @@ export default function OrgListVertical({
if (organizations.length === 0) {
return shell(
<p className="font-semibold" style={{ color: accent }}>
<p className="font-semibold" style={{ color: accentText(accent) }}>
{empty}
</p>
);

View file

@ -38,9 +38,10 @@ import { NAV_ACTIONS, PAGE_LINKS, PAGE_SECTIONS } from '../../navConfig.ts'
import { awardHref, blogHref, eventHref, orgHref, personHref, teamHref } from '../../lib/hrefs.ts'
import { siteUrl } from '../../lib/site.ts'
import { useDirectory, type Directory } from '../../lib/useContent.ts'
import { accentText } from '../../lib/color.ts'
const TEAL = '#0f7183'
const MUTED = '#4a6b72'
const MUTED = 'var(--color-muted)'
/* PNG download size in pixels. Plenty for print at a few inches;
anything bigger should use the SVG. */
@ -316,7 +317,7 @@ export default function QrCodeMaker() {
{kind === 'custom' ? (
<div>
<label htmlFor="qr-custom" className="block text-sm font-medium text-[#26454c]">
<label htmlFor="qr-custom" className="block text-sm font-medium text-body">
Link
</label>
<input
@ -337,7 +338,7 @@ export default function QrCodeMaker() {
) : needsDirectory && loading && !directory ? (
<p style={{ color: MUTED }}>Loading the list…</p>
) : needsDirectory && error ? (
<p className="text-[#b3261e]">Couldn't load the list of pages. {error}</p>
<p className="text-danger">Couldn't load the list of pages. {error}</p>
) : choices.length === 0 ? (
<p style={{ color: MUTED }}>Nothing published here yet.</p>
) : (
@ -390,7 +391,7 @@ export default function QrCodeMaker() {
</Select>
<fieldset>
<legend className="text-sm font-medium text-[#26454c]">Colours</legend>
<legend className="text-sm font-medium text-body">Colours</legend>
<div className="mt-2 flex flex-wrap items-end gap-5">
<ColourInput id="qr-ink" label="Code" value={ink} onChange={setInk} />
<ColourInput id="qr-paper" label="Background" value={paper} onChange={setPaper} />
@ -406,14 +407,14 @@ export default function QrCodeMaker() {
setDoveColor(QR_DOVE)
}}
className="pb-2 text-sm underline"
style={{ color: TEAL }}
style={{ color: accentText(TEAL) }}
>
Reset colours
</button>
)}
</div>
{warning && (
<p role="status" className="mt-2 rounded-lg bg-[#fdf3f2] px-3 py-2 text-sm text-[#b3261e]">
<p role="status" className="mt-2 rounded-lg bg-danger-tint px-3 py-2 text-sm text-danger">
{warning}
</p>
)}
@ -421,16 +422,16 @@ export default function QrCodeMaker() {
{url && (
<div>
<p className="text-sm font-medium text-[#26454c]">Links to</p>
<p className="text-sm font-medium text-body">Links to</p>
<div className="mt-2 flex flex-wrap items-center gap-3">
<code className="break-all rounded-lg bg-white px-3 py-2 text-sm text-[#26454c] ring-1 ring-[#4a6b72]/20">
<code className="break-all rounded-lg bg-surface px-3 py-2 text-sm text-body ring-1 ring-muted/20">
{url}
</code>
<button
type="button"
onClick={copy}
className="rounded-full border px-4 py-2 text-sm font-semibold transition-colors hover:bg-[#138ba0]/10"
style={{ borderColor: TEAL, color: TEAL }}
className="rounded-full border px-4 py-2 text-sm font-semibold transition-colors hover:bg-brand/10"
style={{ borderColor: TEAL, color: accentText(TEAL) }}
>
{copied ? 'Copied ✓' : 'Copy link'}
</button>
@ -442,7 +443,7 @@ export default function QrCodeMaker() {
<div className="flex flex-col items-center gap-5">
{url ? (
<>
<div className="w-full max-w-sm rounded-3xl bg-white p-6 shadow-lg ring-1 ring-[#4a6b72]/10">
<div className="w-full max-w-sm rounded-3xl bg-white p-6 shadow-lg ring-1 ring-muted/10">
<QrCode
ref={svgRef}
value={url}
@ -467,7 +468,7 @@ export default function QrCodeMaker() {
</p>
</>
) : (
<div className="aspect-square w-full max-w-sm rounded-3xl bg-white/60 ring-1 ring-[#4a6b72]/10" />
<div className="aspect-square w-full max-w-sm rounded-3xl bg-white/60 ring-1 ring-muted/10" />
)}
</div>
</div>
@ -479,7 +480,7 @@ function DownloadButton({ onClick, children }: { onClick: () => void; children:
<button
type="button"
onClick={onClick}
className="rounded-full bg-[#0f7183] px-6 py-3 font-semibold text-white transition-colors hover:bg-[#0b5c6a] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#138ba0]/40"
className="rounded-full bg-action px-6 py-3 font-semibold text-white transition-colors hover:bg-action-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand/40"
>
{children}
</button>
@ -487,8 +488,8 @@ function DownloadButton({ onClick, children }: { onClick: () => void; children:
}
const inputClass =
'w-full rounded-xl border border-[#4a6b72]/25 bg-white px-4 py-3 text-[#26454c] ' +
'outline-none transition-colors focus:border-[#138ba0] focus:ring-2 focus:ring-[#138ba0]/25'
'w-full rounded-xl border border-muted/25 bg-surface px-4 py-3 text-body ' +
'outline-none transition-colors focus:border-brand focus:ring-2 focus:ring-brand/25'
/* A colour well with its hex beside it, both editable. */
function ColourInput({
@ -515,7 +516,7 @@ function ColourInput({
type="color"
value={value}
onChange={(e) => onChange(e.target.value)}
className="h-9 w-11 cursor-pointer rounded border border-[#4a6b72]/25 bg-white"
className="h-9 w-11 cursor-pointer rounded border border-muted/25 bg-white"
/>
<input
type="text"
@ -525,7 +526,7 @@ function ColourInput({
setText(e.target.value)
if (/^#[0-9a-f]{6}$/i.test(e.target.value)) onChange(e.target.value.toLowerCase())
}}
className="w-24 rounded-lg border border-[#4a6b72]/25 bg-white px-2 py-1.5 font-mono text-sm text-[#26454c] outline-none focus:border-[#138ba0]"
className="w-24 rounded-lg border border-muted/25 bg-surface px-2 py-1.5 font-mono text-sm text-body outline-none focus:border-brand"
/>
</div>
</div>
@ -533,8 +534,8 @@ function ColourInput({
}
const selectClass =
'w-full appearance-none rounded-xl border border-[#4a6b72]/25 bg-white px-4 py-3 pr-10 text-[#26454c] ' +
'outline-none transition-colors focus:border-[#138ba0] focus:ring-2 focus:ring-[#138ba0]/25'
'w-full appearance-none rounded-xl border border-muted/25 bg-surface px-4 py-3 pr-10 text-body ' +
'outline-none transition-colors focus:border-brand focus:ring-2 focus:ring-brand/25'
function Select({
id,
@ -551,7 +552,7 @@ function Select({
}) {
return (
<div>
<label htmlFor={id} className="block text-sm font-medium text-[#26454c]">
<label htmlFor={id} className="block text-sm font-medium text-body">
{label}
</label>
<div className="relative mt-2">

View file

@ -1,7 +1,7 @@
import { Link } from 'react-router-dom'
import { MONTH_LABELS, type PersonRef, type TimelineItem } from '../../../lib/timeline.ts'
import { hrefFor, logoSrc, photoSrc } from '../../../lib/timelineRefs.ts'
import { initials } from '../../../lib/media.ts'
import { hrefFor, logoSrc } from '../../../lib/timelineRefs.ts'
import { initials, mediaUrl } from '../../../lib/media.ts'
const KIND_NAMES: Record<TimelineItem['kind'], string> = {
milestone: 'Milestone',
@ -28,7 +28,7 @@ function fullMarker(item: TimelineItem): string {
}
function PersonChip({ person }: { person: PersonRef }) {
const src = photoSrc(person.photo)
const src = mediaUrl(person.photo)
return (
<li className="ngu-tl__person">
{src ? (

View file

@ -10,11 +10,11 @@
.ngu-tl {
/* Defaults match the site palette; History.tsx overrides accent and
surface per section so the rail sits on the right background. */
--tl-ink: #16343a;
--tl-muted: #4a6b72;
--tl-faint: #8aa7ad;
--tl-rail: #cfe4e8;
--tl-surface: #ffffff;
--tl-ink: var(--color-ink);
--tl-muted: var(--color-muted);
--tl-faint: color-mix(in srgb, var(--color-muted) 70%, transparent);
--tl-rail: color-mix(in srgb, var(--color-brand) 20%, transparent);
--tl-surface: var(--color-surface);
--tl-accent: #0f7183;
--tl-accent-soft: color-mix(in srgb, var(--tl-accent) 12%, transparent);
@ -94,7 +94,7 @@
line-height: 1.1;
writing-mode: vertical-rl;
text-orientation: sideways;
color: var(--tl-accent);
color: color-mix(in srgb, var(--tl-accent) var(--accent-text-mix), #fff);
}
.ngu-tl__decade--pre .ngu-tl__decadeNum {
@ -162,7 +162,7 @@
}
.ngu-tl__yearBtn:hover .ngu-tl__yearLabel {
color: var(--tl-accent);
color: color-mix(in srgb, var(--tl-accent) var(--accent-text-mix), #fff);
}
.ngu-tl__yearBtn:focus-visible {
@ -323,7 +323,7 @@ a.ngu-tl__entry:focus-visible {
}
a.ngu-tl__entry:hover .ngu-tl__entryTitle {
color: var(--tl-accent);
color: color-mix(in srgb, var(--tl-accent) var(--accent-text-mix), #fff);
}
.ngu-tl__entryMeta {
@ -441,7 +441,7 @@ a.ngu-tl__entry--featured:hover {
}
.ngu-tl__toolbarBtn:hover {
color: var(--tl-accent);
color: color-mix(in srgb, var(--tl-accent) var(--accent-text-mix), #fff);
border-color: var(--tl-accent);
}
@ -505,7 +505,7 @@ a.ngu-tl__entry--featured:hover {
}
.ngu-tl__upcomingBtn:hover {
color: var(--tl-accent);
color: color-mix(in srgb, var(--tl-accent) var(--accent-text-mix), #fff);
}
.ngu-tl__upcomingBtn:focus-visible {
@ -629,7 +629,7 @@ a.ngu-tl__entry--featured:hover {
font-size: 0.625rem;
font-weight: 600;
letter-spacing: 0.02em;
color: var(--tl-accent);
color: color-mix(in srgb, var(--tl-accent) var(--accent-text-mix), #fff);
}
.ngu-tl__personName {

View file

@ -14,12 +14,12 @@ type CalendarBandProps = { id: string; title: string; blurb?: string | null }
export default function CalendarBand({ id, title, blurb }: CalendarBandProps) {
return (
<section id={id} className="py-24" style={{ background: '#f6fbfc' }}>
<section id={id} className="py-24" style={{ background: 'var(--color-tint-soft)' }}>
<div className="mx-auto mb-10 max-w-6xl px-6">
<h2 className="font-display text-4xl font-extrabold text-[#073d4a] md:text-5xl">
<h2 className="font-display text-4xl font-extrabold text-ink md:text-5xl">
{title}
</h2>
{blurb && <p className="mt-3 max-w-xl text-lg text-[#4a6b72]">{blurb}</p>}
{blurb && <p className="mt-3 max-w-xl text-lg text-muted">{blurb}</p>}
</div>
<EventCalendar />

View file

@ -19,10 +19,10 @@ type FeaturedBandProps = {
export default function FeaturedBand({ id, title, blurb, cards }: FeaturedBandProps) {
return (
<section id={id} className="py-24" style={{ background: '#f6fbfc' }}>
<section id={id} className="py-24" style={{ background: 'var(--color-tint-soft)' }}>
<div className="mx-auto max-w-6xl px-6">
<h2 className="font-display text-4xl font-extrabold text-[#073d4a] md:text-5xl">{title}</h2>
{blurb && <p className="mt-4 max-w-2xl text-lg text-[#4a6b72]">{blurb}</p>}
<h2 className="font-display text-4xl font-extrabold 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">
<FeaturedCards cards={cards} />
</div>

View file

@ -26,6 +26,8 @@ import HomeLink from './HomeLink.tsx'
import { useHistory } from '../../../lib/useHistory.ts'
import { hrefFor, logoSrc } from '../../../lib/timelineRefs.ts'
import { MONTH_LABELS, type TimelineItem } from '../../../lib/timeline.ts'
import { accentText } from '../../../lib/color.ts'
import { scrollBehavior } from '../../../lib/motion.ts';
const TEAL = '#0f7183'
const DRAG_SLOP = 6
@ -48,7 +50,7 @@ export default function FeaturedTimelineRail({ id, title, blurb }: RailProps) {
const rail = railRef.current
const card = rail?.querySelector('li')
if (!rail || !card) return
rail.scrollBy({ left: direction * (card.clientWidth + 24), behavior: 'smooth' })
rail.scrollBy({ left: direction * (card.clientWidth + 24), behavior: scrollBehavior() })
}
const onPointerDown = (e: ReactPointerEvent<HTMLOListElement>) => {
@ -77,10 +79,10 @@ export default function FeaturedTimelineRail({ id, title, blurb }: RailProps) {
<section id={id} className="overflow-hidden py-24" style={{ background: '#f4faf7' }}>
<div className="mx-auto flex max-w-6xl flex-wrap items-end gap-6 px-6">
<div>
<h2 className="font-display text-4xl font-extrabold text-[#073d4a] md:text-5xl">
<h2 className="font-display text-4xl font-extrabold text-ink md:text-5xl">
{title}
</h2>
{blurb && <p className="mt-3 max-w-xl text-lg text-[#4a6b72]">{blurb}</p>}
{blurb && <p className="mt-3 max-w-xl text-lg text-muted">{blurb}</p>}
</div>
{featured.length > 1 && (
@ -94,8 +96,8 @@ export default function FeaturedTimelineRail({ id, title, blurb }: RailProps) {
type="button"
onClick={() => step(direction as number)}
aria-label={label as string}
className="flex h-12 w-12 items-center justify-center rounded-full border text-2xl transition-colors hover:bg-white"
style={{ borderColor: TEAL, color: TEAL }}
className="flex h-12 w-12 items-center justify-center rounded-full border text-2xl transition-colors hover:bg-surface"
style={{ borderColor: TEAL, color: accentText(TEAL) }}
>
{glyph}
</button>
@ -105,7 +107,7 @@ export default function FeaturedTimelineRail({ id, title, blurb }: RailProps) {
</div>
{error ? (
<p className="mx-auto mt-10 max-w-6xl px-6 text-[#b3261e]">
<p className="mx-auto mt-10 max-w-6xl px-6 text-danger">
Couldn’t load the timeline. {error}{' '}
<button type="button" onClick={reload} className="underline">
Try again
@ -114,7 +116,7 @@ export default function FeaturedTimelineRail({ id, title, blurb }: RailProps) {
) : loading ? (
<div className="mx-auto mt-12 flex max-w-6xl gap-6 px-6" aria-hidden="true">
{[0, 1, 2].map((i) => (
<div key={i} className="h-72 w-80 shrink-0 animate-pulse rounded-3xl bg-white" />
<div key={i} className="h-72 w-80 shrink-0 animate-pulse rounded-3xl bg-surface" />
))}
</div>
) : (
@ -154,7 +156,7 @@ export default function FeaturedTimelineRail({ id, title, blurb }: RailProps) {
to="/history"
draggable={false}
className="flex flex-1 flex-col justify-center rounded-3xl p-8 text-white transition-transform duration-300 hover:-translate-y-1"
style={{ background: `linear-gradient(150deg, ${TEAL}, #073d4a)` }}
style={{ background: TEAL }}
>
<span className="font-display text-2xl font-extrabold">The whole story</span>
<span className="mt-2 text-white/75">Every year, every milestone.</span>
@ -195,18 +197,18 @@ function RailCard({ item, showYear }: { item: TimelineItem; showYear: boolean })
className="mb-5 h-14 w-14 object-contain"
/>
)}
<p className="text-xs font-bold uppercase tracking-[0.2em]" style={{ color: TEAL }}>
<p className="text-xs font-bold uppercase tracking-[0.2em]" style={{ color: accentText(TEAL) }}>
{dateLabel(item)}
</p>
<p className="mt-2 font-display text-xl font-bold leading-snug text-[#073d4a]">
<p className="mt-2 font-display text-xl font-bold leading-snug text-ink">
{item.title}
</p>
{item.meta && <p className="mt-1 text-sm text-[#4a6b72]">{item.meta}</p>}
{item.meta && <p className="mt-1 text-sm text-muted">{item.meta}</p>}
{item.blurb && (
<p className="mt-3 line-clamp-4 text-sm leading-relaxed text-[#4a6b72]">{item.blurb}</p>
<p className="mt-3 line-clamp-4 text-sm leading-relaxed text-muted">{item.blurb}</p>
)}
{href && (
<span className="mt-auto pt-5 text-sm font-semibold" style={{ color: TEAL }}>
<span className="mt-auto pt-5 text-sm font-semibold" style={{ color: accentText(TEAL) }}>
Read more →
</span>
)}
@ -214,15 +216,15 @@ function RailCard({ item, showYear }: { item: TimelineItem; showYear: boolean })
)
const card =
'flex flex-1 flex-col rounded-3xl border border-[#138ba0]/15 bg-white p-7 shadow-sm'
'flex flex-1 flex-col rounded-3xl border border-brand/15 bg-surface p-7 shadow-sm'
return (
<div className="flex h-full flex-col">
{/* The line, its dot, and the year where it changes. */}
<div className="relative mb-4 h-8">
<div className="absolute inset-x-[-1.5rem] top-1/2 h-px bg-[#138ba0]/30" />
<div className="absolute inset-x-[-1.5rem] top-1/2 h-px bg-brand/30" />
<span
className="absolute left-0 top-1/2 h-3 w-3 -translate-y-1/2 rounded-full border-2 bg-white"
className="absolute left-0 top-1/2 h-3 w-3 -translate-y-1/2 rounded-full border-2 bg-surface"
style={{ borderColor: TEAL }}
/>
{showYear && (

View file

@ -40,18 +40,20 @@ import { useEffect, useState, type CSSProperties } from 'react'
import { Link } from 'react-router-dom'
import HomeLink from './HomeLink.tsx'
import VideoPlayer from '../../../components/VideoPlayer.tsx'
import DoveMark from '../../../components/DoveMark.tsx'
import PlatformIcon from '../../../components/PlatformIcon.tsx'
import { livestreamEmbedUrl, videoSource, type VideoSource } from '../../../lib/embeds.ts'
import { eventBackground, heroPhoto } from '../../../lib/media.ts'
import { mediaUrl } from '../../../lib/media.ts'
import { eventHref } from '../../../lib/hrefs.ts'
import { seriesLabel } from '../../../lib/eventSeries.ts'
import type { Hero, HeroBackdrop, HeroEvent, HeroFeature, HeroSlide } from '../../../lib/useFrontPage.ts'
import { withAlpha } from '../../../lib/color.ts'
const DEEP = '#04262e'
export default function HeroStage({ hero }: { hero: Hero | null }) {
const slides = (hero?.slides ?? []).filter((slide) => heroPhoto(slide.media))
const slides = (hero?.slides ?? []).filter((slide) => mediaUrl(slide.media))
const embed = livestreamEmbedUrl(hero?.livestream?.url)
const video = videoSource(hero?.video?.url)
@ -186,7 +188,7 @@ function Words({ hero, feature }: { hero: Hero; feature: HeroFeature }) {
<HomeLink
url={hero.primary.url}
className="rounded-full px-8 py-4 text-lg font-bold text-[#04262e] shadow-xl transition-transform duration-300 hover:-translate-y-0.5 hover:scale-[1.03]"
style={{ background: 'linear-gradient(120deg, #9fe7d0, #5ce7ff)' }}
style={{ background: '#9fe7d0' }}
>
{hero.primary.label}
</HomeLink>
@ -288,7 +290,7 @@ function PhotoBackdrop({ slides, seconds }: { slides: HeroSlide[]; seconds: numb
className={`hp-slide ${i === index ? 'hp-slide--on' : ''}`}
aria-hidden={i !== index}
>
<img src={heroPhoto(slide.media) ?? ''} alt={slide.alt ?? ''} loading={i === 0 ? 'eager' : 'lazy'} />
<img src={mediaUrl(slide.media) ?? ''} alt={slide.alt ?? ''} loading={i === 0 ? 'eager' : 'lazy'} />
</div>
))}
<div
@ -352,14 +354,17 @@ function PhotoBackdrop({ slides, seconds }: { slides: HeroSlide[]; seconds: numb
/* ── Livestream ──────────────────────────────────────────────── */
/* The player loads when pressed, not with the page, so YouTube or
Facebook set nothing until someone asks to watch (Privacy page). */
function LiveFrame({ src, url, title }: { src: string | null; url: string; title?: string | null }) {
const [watching, setWatching] = useState(false)
return (
<div
className="relative overflow-hidden rounded-3xl border border-white/15 bg-black shadow-2xl"
style={{ boxShadow: '0 30px 80px -20px rgba(16, 212, 138, 0.35)' }}
>
<div className="aspect-video w-full">
{src ? (
{src && watching ? (
<iframe
src={src}
title={title || 'Livestream'}
@ -367,6 +372,17 @@ function LiveFrame({ src, url, title }: { src: string | null; url: string; title
allow="autoplay; encrypted-media; picture-in-picture; fullscreen"
allowFullScreen
/>
) : src ? (
<div className="flex h-full w-full flex-col items-center justify-center gap-4 text-white">
<span className="hp-live-dot h-4 w-4 rounded-full bg-[#ff4d4d]" aria-hidden="true" />
<button
type="button"
onClick={() => setWatching(true)}
className="rounded-full bg-white px-6 py-3 font-semibold text-[#04262e] hover:scale-105"
>
Watch live
</button>
</div>
) : (
<div className="flex h-full w-full flex-col items-center justify-center gap-4 text-white">
<span className="hp-live-dot h-4 w-4 rounded-full bg-[#ff4d4d]" aria-hidden="true" />
@ -387,8 +403,9 @@ function LiveFrame({ src, url, title }: { src: string | null; url: string; title
/* A file plays in <video> with the browser's controls; preload
"metadata" fetches enough for the first frame and the length,
not the whole file. An embed waits for play. A link that is
neither still gets a button out to it. */
not the whole file. An embed is a VideoPlayer: a still until
pressed, so the video's host sets nothing before then. A link
that is neither still gets a button out to it. */
function VideoFrame({
source,
url,
@ -414,13 +431,7 @@ function VideoFrame({
preload="metadata"
/>
) : source?.kind === 'embed' ? (
<iframe
src={source.src}
title={title || 'Featured video'}
className="h-full w-full"
allow="encrypted-media; picture-in-picture; fullscreen"
allowFullScreen
/>
<VideoPlayer url={url} title={title || 'Featured video'} className="h-full" />
) : (
<div className="flex h-full w-full items-center justify-center">
<HomeLink
@ -444,14 +455,14 @@ function VideoFrame({
it's usually Register. */
function EventPanel({ event }: { event: HeroEvent }) {
const color = event.color || '#0f7183'
const photo = eventBackground(event.card_image)
const photo = mediaUrl(event.card_image)
const when = seriesLabel(event.series, event.starts_on) ?? event.date_label
const where = event.is_online && !event.location_label ? 'Online' : event.location_label
return (
<div
className="overflow-hidden rounded-3xl border border-white/15 bg-white/10 text-white shadow-2xl backdrop-blur"
style={{ boxShadow: `0 30px 80px -20px ${color}66` }}
style={{ boxShadow: `0 30px 80px -20px ${withAlpha(color, 40)}` }}
>
{photo ? (
<img src={photo} alt="" className="aspect-[16/7] w-full object-cover" />
@ -459,7 +470,7 @@ function EventPanel({ event }: { event: HeroEvent }) {
<div
aria-hidden="true"
className="aspect-[16/7] w-full"
style={{ background: `linear-gradient(135deg, ${color}, #04262e)` }}
style={{ background: `color-mix(in srgb, ${color} 35%, #04262e)` }}
/>
)}
@ -486,7 +497,7 @@ function EventPanel({ event }: { event: HeroEvent }) {
className={`inline-flex items-center gap-2 rounded-full px-6 py-3 font-semibold transition-transform hover:scale-105 ${
index === 0 ? 'text-[#04262e]' : 'border border-white/35 text-white hover:bg-white/10'
}`}
style={index === 0 ? { background: 'linear-gradient(120deg, #9fe7d0, #5ce7ff)' } : undefined}
style={index === 0 ? { background: '#9fe7d0' } : undefined}
>
<PlatformIcon platform={link.platform} />
{link.label}

View file

@ -24,6 +24,7 @@ import { Link } from 'react-router-dom'
import { eventHref } from '../../../lib/hrefs.ts'
import { upcomingOccurrences } from '../../../lib/eventSeries.ts'
import type { CountdownEvent } from '../../../lib/useFrontPage.ts'
import { withAlpha, accentText } from '../../../lib/color.ts'
const TEAL = '#0f7183'
@ -86,16 +87,16 @@ export default function NextEventCountdown({
<Link
to={eventHref(event.id)}
className="group mx-auto flex max-w-6xl flex-col gap-6 rounded-3xl border bg-white/95 p-6 shadow-2xl backdrop-blur transition-transform duration-300 hover:-translate-y-1 md:flex-row md:items-center md:p-8"
style={{ borderColor: `${accent}55` }}
style={{ borderColor: `${withAlpha(accent, 33)}` }}
>
<div className="min-w-0 flex-1">
<p className="text-xs font-bold uppercase tracking-[0.25em]" style={{ color: accent }}>
<p className="text-xs font-bold uppercase tracking-[0.25em]" style={{ color: accentText(accent) }}>
{live ? 'Happening now' : 'Next up'}
</p>
<p className="mt-1 truncate font-display text-2xl font-extrabold text-[#073d4a] md:text-3xl">
<p className="mt-1 truncate font-display text-2xl font-extrabold text-ink md:text-3xl">
{event.title}
</p>
<p className="mt-1 text-sm text-[#4a6b72]">
<p className="mt-1 text-sm text-muted">
{[event.theme && `“${event.theme}”`, event.date_label, where]
.filter(Boolean)
.join(' · ')}
@ -108,7 +109,7 @@ export default function NextEventCountdown({
<div
key={label}
className="flex w-16 flex-col items-center rounded-2xl py-3 text-white md:w-20"
style={{ background: `linear-gradient(160deg, ${accent}, #073d4a)` }}
style={{ background: `color-mix(in srgb, ${accent} 35%, #04262e)` }}
>
<span className="font-display text-2xl font-bold tabular-nums md:text-3xl">
{String(value).padStart(2, '0')}
@ -123,7 +124,7 @@ export default function NextEventCountdown({
<span
className="self-start text-sm font-semibold transition-transform group-hover:translate-x-1 md:self-center"
style={{ color: accent }}
style={{ color: accentText(accent) }}
>
Details →
</span>

View file

@ -19,6 +19,7 @@ import { useId, useRef, useState, type KeyboardEvent } from 'react'
import HomeLink, { isExternal } from './HomeLink.tsx'
import type { FrontPagePath } from '../../../lib/useFrontPage.ts'
import { withAlpha, accentText } from '../../../lib/color.ts'
type PathfinderProps = {
id: string
@ -62,17 +63,17 @@ export default function Pathfinder({ id, title, blurb, paths }: PathfinderProps)
}
return (
<section id={id} className="py-24" style={{ background: '#ffffff' }}>
<section id={id} className="py-24" style={{ background: 'var(--color-surface)' }}>
<div className="mx-auto max-w-6xl px-6">
<div className="grid gap-12 lg:grid-cols-12">
<div className="lg:col-span-5">
<p className="text-xs font-bold uppercase tracking-[0.3em] text-[#0f7183]">
<p className="text-xs font-bold uppercase tracking-[0.3em] text-link">
I’m looking to…
</p>
<h2 className="mt-3 font-display text-4xl font-extrabold text-[#073d4a] md:text-5xl">
<h2 className="mt-3 font-display text-4xl font-extrabold text-ink md:text-5xl">
{title}
</h2>
{blurb && <p className="mt-4 text-lg text-[#4a6b72]">{blurb}</p>}
{blurb && <p className="mt-4 text-lg text-muted">{blurb}</p>}
<div
role="tablist"
@ -100,18 +101,18 @@ export default function Pathfinder({ id, title, blurb, paths }: PathfinderProps)
className="group flex items-center gap-4 rounded-2xl border-2 px-5 py-4 text-left transition-all duration-300"
style={{
borderColor: on ? color : 'rgba(19,139,160,0.12)',
background: on ? `${color}12` : '#ffffff',
background: on ? `${withAlpha(color, 7)}` : 'var(--color-surface)',
transform: on ? 'translateX(8px)' : undefined,
}}
>
<span
className="flex h-12 w-12 shrink-0 items-center justify-center rounded-xl text-2xl transition-transform duration-300 group-hover:scale-110"
style={{ background: on ? color : `${color}1f` }}
style={{ background: on ? color : `${withAlpha(color, 12)}` }}
aria-hidden="true"
>
{option.icon || '•'}
</span>
<span className="font-display text-xl font-bold" style={{ color: on ? color : '#073d4a' }}>
<span className="font-display text-xl font-bold" style={{ color: on ? accentText(color) : 'var(--color-ink)' }}>
{option.label}
</span>
<span
@ -133,7 +134,7 @@ export default function Pathfinder({ id, title, blurb, paths }: PathfinderProps)
role="tabpanel"
aria-labelledby={`${base}-tab-${selected}`}
className="relative overflow-hidden rounded-[2rem] p-8 md:p-10 lg:col-span-7"
style={{ background: `linear-gradient(155deg, ${accent}14, ${accent}05 60%, #ffffff)` }}
style={{ background: withAlpha(accent, 5) }}
>
<span
className="pointer-events-none absolute -right-6 -top-10 select-none text-[10rem] leading-none opacity-10"
@ -143,7 +144,7 @@ export default function Pathfinder({ id, title, blurb, paths }: PathfinderProps)
</span>
{path.blurb && (
<p className="hp-pop relative max-w-md font-display text-2xl font-semibold leading-snug text-[#073d4a]">
<p className="hp-pop relative max-w-md font-display text-2xl font-semibold leading-snug text-ink">
{path.blurb}
</p>
)}
@ -157,20 +158,20 @@ export default function Pathfinder({ id, title, blurb, paths }: PathfinderProps)
>
<HomeLink
url={action.url}
className="group flex h-full flex-col rounded-2xl bg-white p-6 shadow-sm ring-1 ring-black/5 transition-all duration-300 hover:-translate-y-1 hover:shadow-xl"
className="group flex h-full flex-col rounded-2xl bg-surface p-6 shadow-sm ring-1 ring-black/5 transition-all duration-300 hover:-translate-y-1 hover:shadow-xl"
>
<span className="flex items-start gap-2 font-display text-lg font-bold text-[#073d4a]">
<span className="flex items-start gap-2 font-display text-lg font-bold text-ink">
{action.label}
<span
className="ml-auto transition-transform group-hover:translate-x-1"
style={{ color: accent }}
style={{ color: accentText(accent) }}
aria-hidden="true"
>
{isExternal(action.url) ? '↗' : '→'}
</span>
</span>
{action.description && (
<span className="mt-2 text-sm leading-relaxed text-[#4a6b72]">
<span className="mt-2 text-sm leading-relaxed text-muted">
{action.description}
</span>
)}

View file

@ -10,6 +10,7 @@
import { Link } from 'react-router-dom'
import EventListCards from '../EventList-Cards.tsx'
import { accentText } from '../../../lib/color.ts'
const TEAL = '#0f7183'
@ -17,18 +18,18 @@ type RetreatsBandProps = { id: string; title: string; blurb?: string | null }
export default function RetreatsBand({ id, title, blurb }: RetreatsBandProps) {
return (
<section id={id} className="overflow-hidden py-24" style={{ background: '#eef9fb' }}>
<section id={id} className="overflow-hidden py-24" style={{ background: 'var(--color-tint)' }}>
<div className="mx-auto mb-12 flex max-w-6xl flex-wrap items-end gap-6 px-6">
<div>
<h2 className="font-display text-4xl font-extrabold text-[#073d4a] md:text-5xl">
<h2 className="font-display text-4xl font-extrabold text-ink md:text-5xl">
{title}
</h2>
{blurb && <p className="mt-3 max-w-xl text-lg text-[#4a6b72]">{blurb}</p>}
{blurb && <p className="mt-3 max-w-xl text-lg text-muted">{blurb}</p>}
</div>
<Link
to="/retreats"
className="ml-auto rounded-full border px-5 py-2 text-sm font-semibold transition-colors hover:bg-white"
style={{ borderColor: TEAL, color: TEAL }}
className="ml-auto rounded-full border px-5 py-2 text-sm font-semibold transition-colors hover:bg-surface"
style={{ borderColor: TEAL, color: accentText(TEAL) }}
>
All retreats →
</Link>

View file

@ -47,7 +47,7 @@ export default function StatsBand({ id, title, blurb, stats }: StatsBandProps) {
id={id}
ref={ref}
className="relative overflow-hidden py-24"
style={{ background: 'linear-gradient(160deg, #073d4a 0%, #04262e 70%)' }}
style={{ background: '#073d4a' }}
>
<div
className="pointer-events-none absolute -left-40 -top-40 h-[32rem] w-[32rem] rounded-full opacity-25 blur-3xl"