@@ -858,36 +834,17 @@ function Chevron() {
/* ── Helpers ─────────────────────────────────────────────────── */
-/* How small a tile may get so a whole list shares one line. */
-export const ONE_ROW_SHRINK = 0.75;
-
-/* Whether every group fits side by side on one line, 10 tiles at most,
- with tiles no smaller than ONE_ROW_SHRINK of full width. Groups are
- divided by a gap, padding and a 1px rule (PeopleTiles.css). */
-export function fitsOneRow(counts: number[], width: number, tile: number, gap: number): boolean {
- const total = counts.reduce((sum, n) => sum + n, 0);
- if (total < 2 || total > 10) return false;
- const smallest = tile * ONE_ROW_SHRINK;
- const tiles = counts.reduce((sum, n) => sum + n * smallest + (n - 1) * gap, 0);
- const dividers = (counts.length - 1) * (gap * 3 + 1);
- return tiles + dividers <= width;
-}
-
/* Tiles across a row: as many as fit, at least 2 and at most 10
(never more than there are). If that would leave one tile alone on
the last row, one fewer across, so the last row has two: 7 that fit
6 across go 5 and 2. With only 2 across, a third, narrower column
- takes the odd one instead, if tiles stay at least 60% of full
- width; on a narrow phone a lone last tile beats three unreadable
- ones. */
+ takes the odd one instead (3 tiles on a phone go 3 across). */
export function balancedColumns(count: number, width: number, tile: number, gap: number): number {
if (count <= 1) return 1;
const fit = Math.floor((width + gap) / (tile + gap));
const cols = Math.min(count, 10, Math.max(2, fit));
if (count % cols !== 1) return cols;
- if (cols > 2) return cols - 1;
- const third = (width - 2 * gap) / 3;
- return count >= 3 && third >= tile * 0.6 ? 3 : 2;
+ return cols > 2 ? cols - 1 : Math.min(count, 3);
}
/* A string id is a people slug; a numeric or missing one is a
diff --git a/src/components/PrivacyNotice.tsx b/src/components/PrivacyNotice.tsx
index d95af47..5a241b9 100644
--- a/src/components/PrivacyNotice.tsx
+++ b/src/components/PrivacyNotice.tsx
@@ -5,10 +5,9 @@
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. Analytics are Plausible,
- self-hosted and cookieless, which needs no consent either. If an
- embed ever loads on its own, or anything sets a tracking cookie,
- this has to become a real consent choice.
+ 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.
@@ -43,7 +42,7 @@ export default function PrivacyNotice() {
No tracking cookies here. Videos and maps come from YouTube, Facebook or Google only when you press
diff --git a/src/components/ScheduleBlock.tsx b/src/components/ScheduleBlock.tsx
index 30d2c80..650f451 100644
--- a/src/components/ScheduleBlock.tsx
+++ b/src/components/ScheduleBlock.tsx
@@ -99,10 +99,8 @@ function Entry({ entry, accent }: { entry: ContentBlockItem; accent: string }) {
return (
- {/* On a phone the time sits on its own line above the entry,
- leaving the title the full width. */}
-
-
+
+
{entry.time}
@@ -133,7 +131,7 @@ 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-10 w-10 shrink-0 btn border text-sm transition-colors hover:bg-tint"
+ className="h-8 w-8 shrink-0 btn border text-sm transition-colors hover:bg-tint"
style={{ borderColor: `${withAlpha(accent, 33)}`, color: accentText(accent) }}
>
before the first paint (index.html) and by the
- panel. */
-
-/* Dyslexia-friendly font: every typeface, headings and buttons too. */
-:root[data-font="dyslexic"] {
- --font-display: 'OpenDyslexic', sans-serif;
- --font-body: 'OpenDyslexic', sans-serif;
-}
-:root[data-font="dyslexic"] body,
-:root[data-font="dyslexic"] h1,
-:root[data-font="dyslexic"] h2,
-:root[data-font="dyslexic"] h3,
-:root[data-font="dyslexic"] h4,
-:root[data-font="dyslexic"] h5,
-:root[data-font="dyslexic"] h6,
-:root[data-font="dyslexic"] button,
-:root[data-font="dyslexic"] input,
-:root[data-font="dyslexic"] textarea,
-:root[data-font="dyslexic"] select {
- font-family: 'OpenDyslexic', sans-serif;
-}
-
-/* Reading mode: the same content with the design stepped back. No
- background circles, motion or shadows; every layout one column,
- narrower and larger, with plain underlined links. */
-:root[data-reading="on"] {
- font-size: 112.5%;
- scroll-behavior: auto;
-}
-:root[data-reading="on"] .page-backdrop {
- display: none;
-}
-:root[data-reading="on"] *,
-:root[data-reading="on"] *::before,
-:root[data-reading="on"] *::after {
- animation: none !important;
- transition: none !important;
- box-shadow: none !important;
-}
-:root[data-reading="on"] main {
- max-width: 48rem;
- margin-inline: auto;
-}
-:root[data-reading="on"] main .grid {
- grid-template-columns: minmax(0, 1fr) !important;
-}
-:root[data-reading="on"] main p,
-:root[data-reading="on"] main li {
- line-height: 1.75;
-}
-:root[data-reading="on"] main a {
- text-decoration: underline;
- text-underline-offset: 0.2em;
-}
-
/* A notice where content would be (an empty section, a form's
note, "coming soon"): no box and no fill, just two thick brackets
at opposite corners, top left and bottom right, like a
@@ -378,10 +313,7 @@ iframe[src*="churchcenter"] {
@container (max-width: 30rem) {
.ev-grid {
grid-template-columns: 1fr;
- /* The logo gets its own row: without one, grid-area: image made
- an extra column beside the text. */
grid-template-areas:
- "image"
"org"
"info"
"desc";
diff --git a/src/lib/newsletter.ts b/src/lib/newsletter.ts
deleted file mode 100644
index 17ba14e..0000000
--- a/src/lib/newsletter.ts
+++ /dev/null
@@ -1,147 +0,0 @@
-/* ═══════════════════════════════════════════════════════════════
- NEWSLETTER: email-ready HTML and plain text from picked items
-
- The admin's Newsletter tool (AdminNewsletter.tsx) gathers events,
- blog posts and featured cards; this turns them into one email to
- paste into Mailchimp, Gmail or Church Center. Nothing is sent or
- stored here.
-
- Email clients ignore stylesheets, CSS variables and most layout,
- so the HTML is tables with inline styles at 600px, images with
- width and alt, and the palette written out as hex (the one place
- the site's colors are literals: an inbox has no theme tokens). A
- plain-text copy goes alongside for clients that show no HTML.
- ═══════════════════════════════════════════════════════════════ */
-
-export type NewsletterItem = {
- title: string
- /** A line under the title: dates and place, a byline. */
- meta?: string | null
- text?: string | null
- /** An absolute image URL. */
- image?: string | null
- /** An absolute link. */
- href: string
- cta: string
-}
-
-export type NewsletterSection = { heading: string; items: NewsletterItem[] }
-
-export type Newsletter = {
- title: string
- intro?: string | null
- sections: NewsletterSection[]
- /** The site's address, for the header link and footer. */
- origin: string
- siteName: string
- /** An absolute URL of the logo for the header. */
- logo?: string | null
-}
-
-/* The palette as an inbox needs it. */
-const COLOR = {
- ink: '#001011',
- body: '#003a45',
- muted: '#3b5456',
- teal: '#00748a',
- page: '#f5f9f8',
- card: '#ffffff',
- rule: '#d6f5fa',
-}
-
-const FONT = "'Poppins', Helvetica, Arial, sans-serif"
-const BODY_FONT = "'Montserrat', Helvetica, Arial, sans-serif"
-
-const escape = (value: string) =>
- value.replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"')
-
-/* Paragraphs from text with blank lines between them. */
-const paragraphs = (text: string, style: string) =>
- text
- .split(/\n\s*\n/)
- .map((part) => part.trim())
- .filter(Boolean)
- .map((part) => `${escape(part).replace(/\n/g, '
')}
`)
- .join('')
-
-function itemHtml(item: NewsletterItem): string {
- const image = item.image
- ? `}) |
`
- : ''
- const meta = item.meta
- ? `${escape(item.meta)}
`
- : ''
- const text = item.text
- ? paragraphs(item.text, `margin:12px 0 0;font-family:${BODY_FONT};font-size:15px;line-height:24px;color:${COLOR.body};`)
- : ''
- return `
-|
-
- |
`
-}
-
-export function newsletterHtml(n: Newsletter): string {
- const sections = n.sections
- .filter((section) => section.items.length > 0)
- .map(
- (section) => `
-
- ${escape(section.heading)}
- |
${section.items.map(itemHtml).join('')}`,
- )
- .join('')
-
- const logo = n.logo
- ? `
`
- : `${escape(n.siteName)}`
-
- return `
-
-
-
-
-${escape(n.title)}
-
-
-
-
-
- | ${logo} |
-
- ${escape(n.title)}
- ${n.intro ? paragraphs(n.intro, `margin:12px 0 0;font-family:${BODY_FONT};font-size:16px;line-height:26px;color:${COLOR.body};`) : ''}
- |
- ${sections}
-
- ${escape(n.siteName)} ${escape(n.origin.replace(/^https?:\/\//, ''))}
- |
-
- |
-
-
-`
-}
-
-export function newsletterText(n: Newsletter): string {
- const lines = [n.title, '='.repeat(Math.min(n.title.length, 60)), '']
- if (n.intro) lines.push(n.intro.trim(), '')
- for (const section of n.sections) {
- if (section.items.length === 0) continue
- lines.push(section.heading.toUpperCase(), '')
- for (const item of section.items) {
- lines.push(item.title)
- if (item.meta) lines.push(item.meta)
- if (item.text) lines.push(item.text.trim())
- lines.push(`${item.cta}: ${item.href}`, '')
- }
- }
- lines.push('--', n.siteName, n.origin)
- return lines.join('\n')
-}
diff --git a/src/lib/version.ts b/src/lib/version.ts
index d88d2d6..34e98ec 100644
--- a/src/lib/version.ts
+++ b/src/lib/version.ts
@@ -7,4 +7,4 @@
box or a build banner can read the same value later.
═══════════════════════════════════════════════════════════════ */
-export const SITE_VERSION = "NGU-Web.v1.10.4";
+export const SITE_VERSION = "NGU-Web.v1.10.3";
diff --git a/src/pages/Privacy.tsx b/src/pages/Privacy.tsx
index a37d01a..fcc7743 100644
--- a/src/pages/Privacy.tsx
+++ b/src/pages/Privacy.tsx
@@ -24,7 +24,7 @@ const PAGE = sitePage("/privacy");
'privacy', in Admin → Forms → Data requests.
═══════════════════════════════════════════════════════════════ */
-const LAST_UPDATED = "September 30, 2026";
+const LAST_UPDATED = "September 29, 2026";
const link = "underline underline-offset-2 text-link";
@@ -105,13 +105,8 @@ const PARTS: LegalPart[] = [
],
list: [
<>
- Giving is handled by Church Center (Planning Center), at{" "}
-
- ngu.churchcenteronline.com
-
- . Payment details go to them, not to us. Church Center's script loads when you open our Giving page,
- and its giving form opens when you press Give; Church Center may use Google Analytics in that form,
- under its own privacy policy.
+ Giving is handled by Church Center (Planning Center). Payment details go to them,
+ not to us.
>,
<>
Videos come from YouTube, Facebook or Vimeo, and maps from Google
@@ -137,7 +132,7 @@ const PARTS: LegalPart[] = [
id: "cookies",
heading: "Cookies and browser storage",
body: [
- "This site doesn't use advertising or tracking cookies, and doesn't use Google Analytics. To see which pages are read, we use Plausible Analytics, which we host ourselves on our own server: it sets no cookies, doesn't follow you across sites, and keeps no personal information, only counts of visits to each page; nothing from it is shared or sold. The site also keeps a few small things in your own browser so it works the way you left it:",
+ "This site doesn't use advertising, 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.",
diff --git a/src/pages/admin/AdminNewsletter.tsx b/src/pages/admin/AdminNewsletter.tsx
deleted file mode 100644
index 069f42d..0000000
--- a/src/pages/admin/AdminNewsletter.tsx
+++ /dev/null
@@ -1,292 +0,0 @@
-/* ═══════════════════════════════════════════════════════════════
- NEWSLETTER (Tools)
-
- Builds an email newsletter from what's already on the site: tick
- upcoming events, published blog posts and the front page's
- featured cards, write a title and an intro, and copy the result,
- email-ready HTML or plain text, into Mailchimp, Gmail or Church
- Center (or download it as a file). Nothing is sent or saved here;
- the builder is src/lib/newsletter.ts.
-
- Picked blog posts are read from their public pages, so only a
- post visitors can open makes it in, with its excerpt and cover.
- Links and images are the live site's (SITE_ORIGIN), since an
- email is read far from this admin.
- ═══════════════════════════════════════════════════════════════ */
-
-import { Check, Copy, DownloadSimple } from '@phosphor-icons/react'
-import { useEffect, useMemo, useState } from 'react'
-
-import { get } from '../../lib/api.ts'
-import { useEvents } from '../../lib/eventData.ts'
-import { useFrontPage, type FeaturedCard } from '../../lib/useFrontPage.ts'
-import type { BlogPostRecord } from '../../lib/useBlog.ts'
-import { blogHref, eventHref, refHref } from '../../lib/hrefs.ts'
-import { mediaUrl } from '../../lib/media.ts'
-import { SITE_NAME, SITE_ORIGIN, siteUrl } from '../../lib/site.ts'
-import { seriesLabel } from '../../lib/eventSeries.ts'
-import { useWideAdminPage } from '../../lib/adminWidth.tsx'
-import { newsletterHtml, newsletterText, type NewsletterItem } from '../../lib/newsletter.ts'
-
-const MUTED = 'var(--color-muted)'
-const input =
- 'w-full 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'
-const button =
- 'btn inline-flex items-center gap-2 border border-brand px-4 py-2 text-sm text-link transition-colors hover:bg-tint disabled:opacity-50'
-
-/* An address on the live site, whatever it started as. */
-const absolute = (path: string | null | undefined) => (path ? siteUrl(path) : null)
-const imageFor = (file: string | null | undefined) => absolute(mediaUrl(file))
-
-type PostRow = { id: string; title: string; published_on?: string | null; is_published: number; is_listed: number }
-
-function featuredHref(card: FeaturedCard): string | null {
- if (card.kind === 'record' && card.ref) return refHref(card.ref.kind, card.ref.id, card.ref.org_kind)
- return card.url
-}
-
-export default function AdminNewsletter() {
- useWideAdminPage()
- const [title, setTitle] = useState('')
- const [intro, setIntro] = useState('')
- const [pickedEvents, setPickedEvents] = useState>(new Set())
- const [pickedPosts, setPickedPosts] = useState>(new Set())
- const [pickedCards, setPickedCards] = useState>(new Set())
- const [posts, setPosts] = useState(null)
- const [postDetails, setPostDetails] = useState>({})
- const [copied, setCopied] = useState<'html' | 'text' | null>(null)
-
- const { events, loading: eventsLoading } = useEvents({ status: 'upcoming' })
- const { data: frontPage } = useFrontPage()
- const cards = frontPage?.featured ?? []
-
- useEffect(() => {
- get('/admin/blog_posts?limit=200', { ttl: 0 })
- .then((data: { rows: PostRow[] }) => setPosts(data.rows.filter((row) => row.is_published && row.is_listed)))
- .catch(() => setPosts([]))
- }, [])
-
- // A picked post's public page: its excerpt and cover, and proof it's live.
- useEffect(() => {
- for (const id of pickedPosts) {
- if (postDetails[id]) continue
- get(`/blog/${encodeURIComponent(id)}`)
- .then((data: { post: BlogPostRecord }) => setPostDetails((current) => ({ ...current, [id]: data.post })))
- .catch(() => {})
- }
- }, [pickedPosts, postDetails])
-
- const toggle = (set: Set, value: T, update: (next: Set) => void) => {
- const next = new Set(set)
- if (next.has(value)) next.delete(value)
- else next.add(value)
- update(next)
- }
-
- const newsletter = useMemo(() => {
- const eventItems: NewsletterItem[] = events
- .filter((event) => pickedEvents.has(event.id))
- .map((event) => ({
- title: event.title,
- meta: [seriesLabel(event.series, event.starts_on) ?? event.date_label, event.is_online && !event.location_label ? 'Online' : event.location_label]
- .filter(Boolean)
- .join(', '),
- text: event.tagline ?? event.description?.[0] ?? null,
- image: imageFor(event.card_image),
- href: siteUrl(eventHref(event.id)),
- cta: 'Event details',
- }))
-
- const postItems: NewsletterItem[] = (posts ?? [])
- .filter((row) => pickedPosts.has(row.id) && postDetails[row.id])
- .map((row) => {
- const post = postDetails[row.id]
- const byline = post.authors.map((a) => a.name).concat(post.guest ? [post.guest.name] : []).join(', ')
- return {
- title: post.title,
- meta: byline ? `By ${byline}` : null,
- text: post.excerpt ?? null,
- image: imageFor(post.cover_image),
- href: siteUrl(blogHref(post.id)),
- cta: 'Read the post',
- }
- })
-
- const cardItems: NewsletterItem[] = cards
- .map((card, index) => ({ card, index, href: featuredHref(card) }))
- .filter(({ index, href }) => pickedCards.has(index) && href)
- .map(({ card, href }) => ({
- title: card.title ?? 'Featured',
- meta: card.eyebrow ?? null,
- text: card.blurb ?? null,
- image: card.image ? imageFor(card.image.file) : null,
- href: absolute(href) ?? href!,
- cta: card.kind === 'video' ? 'Watch' : 'Learn more',
- }))
-
- const content = {
- title: title.trim() || `News from ${SITE_NAME}`,
- intro: intro.trim() || null,
- origin: SITE_ORIGIN,
- siteName: SITE_NAME,
- // The site's logo is an SVG, which Gmail and Outlook don't show,
- // so the header is the site name in type. A PNG logo could go here.
- logo: null,
- sections: [
- { heading: 'Coming up', items: eventItems },
- { heading: 'From the blog', items: postItems },
- { heading: 'Featured', items: cardItems },
- ],
- }
- return { html: newsletterHtml(content), text: newsletterText(content), count: eventItems.length + postItems.length + cardItems.length }
- }, [title, intro, events, pickedEvents, posts, pickedPosts, postDetails, cards, pickedCards])
-
- async function copy(kind: 'html' | 'text') {
- try {
- await navigator.clipboard.writeText(kind === 'html' ? newsletter.html : newsletter.text)
- setCopied(kind)
- window.setTimeout(() => setCopied(null), 2000)
- } catch {
- setCopied(null)
- }
- }
-
- function download() {
- const blob = new Blob([newsletter.html], { type: 'text/html' })
- const link = document.createElement('a')
- link.href = URL.createObjectURL(blob)
- link.download = `newsletter-${new Date().toISOString().slice(0, 10)}.html`
- link.click()
- URL.revokeObjectURL(link.href)
- }
-
- return (
-
-
-
Newsletter
-
- Pick what to include, then copy the email into Mailchimp, Gmail or Church Center.
-
-
-
-
-
-
-
-
({ value: event.id, label: event.title, detail: event.date_label }))}
- picked={pickedEvents}
- onToggle={(value) => toggle(pickedEvents, value, setPickedEvents)}
- />
- ({ value: post.id, label: post.title, detail: post.published_on }))}
- picked={pickedPosts}
- onToggle={(value) => toggle(pickedPosts, value, setPickedPosts)}
- />
- ({ value: index, label: card.title ?? card.url ?? 'Card', detail: card.kind }))}
- picked={pickedCards}
- onToggle={(value) => toggle(pickedCards, value, setPickedCards)}
- />
-
-
-
-
-
-
-
-
-
- {newsletter.count === 0
- ? 'Tick at least one item to build the email.'
- : `${newsletter.count} item${newsletter.count === 1 ? '' : 's'}. In Mailchimp, paste the HTML into a Code block or "Paste in code".`}
-
-
-
-
-
- )
-}
-
-function PickList({
- title,
- empty,
- options,
- picked,
- onToggle,
-}: {
- title: string
- empty: string
- options: Array<{ value: T; label: string; detail?: string | null }>
- picked: Set
- onToggle: (value: T) => void
-}) {
- return (
-
- {title}
- {options.length === 0 ? (
-
- {empty}
-
- ) : (
-
- )}
-
- )
-}
diff --git a/src/pages/admin/adminNav.ts b/src/pages/admin/adminNav.ts
index 80177bf..96688d8 100644
--- a/src/pages/admin/adminNav.ts
+++ b/src/pages/admin/adminNav.ts
@@ -148,11 +148,6 @@ export const TOOLS_NAV = {
blurb: "Cut clips from our YouTube and Facebook videos: trimmed, reshaped for Reels, or audio only.",
minRole: "admin",
},
- {
- to: "/admin/newsletter",
- label: "Newsletter",
- blurb: "An email newsletter from upcoming events, blog posts and featured cards, ready to paste into Mailchimp or Gmail.",
- },
{
to: "/qr",
label: "QR code generator",
diff --git a/src/pages/sections/EventList-Cards.tsx b/src/pages/sections/EventList-Cards.tsx
index 03695ff..acc4efc 100644
--- a/src/pages/sections/EventList-Cards.tsx
+++ b/src/pages/sections/EventList-Cards.tsx
@@ -190,25 +190,25 @@ export function Card({
// past event) keeps its links out of the tab order too.
inert={!interactive}
>
-
+
{compact ? (
/* ── GRID CARD: layout driven by .ev-grid container queries ── */
{typeBadge}
-
+
{ev.title}
{ev.theme && (
-
"{ev.theme}"
+
"{ev.theme}"
)}
- {ev.date_label &&
{ev.date_label}
}
- {schedule &&
{schedule}
}
+ {ev.date_label &&
{ev.date_label}
}
+ {schedule &&
{schedule}
}
{ev.location_label && (
-
{ev.location_label}
+
{ev.location_label}
)}
{typeBadge}
-
+
{ev.title}
{ev.theme && (
-
"{ev.theme}"
+ "{ev.theme}"
)}
- {ev.date_label && {ev.date_label}
}
- {schedule && {schedule}
}
+ {ev.date_label && {ev.date_label}
}
+ {schedule && {schedule}
}
{ev.location_label && (
- {ev.location_label}
+ {ev.location_label}
)}
@@ -496,18 +496,6 @@ export default function EventListCards({
const prev = () => setIndex(i => Math.max(0, i - 1));
const next = () => setIndex(i => Math.min(events.length - 1, i + 1));
- // A sideways swipe of 40px or more on a touch screen turns the carousel.
- const swipeFrom = useRef
(null);
- const onTouchStart = (e: React.TouchEvent) => { swipeFrom.current = e.touches[0]?.clientX ?? null; };
- const onTouchEnd = (e: React.TouchEvent) => {
- const from = swipeFrom.current;
- swipeFrom.current = null;
- const to = e.changedTouches[0]?.clientX;
- if (from == null || to == null || Math.abs(to - from) < 40) return;
- if (to < from) next();
- else prev();
- };
-
// Arrows and dots follow the section accent, not the active card.
const arrowStyle = enabled => ({
border: `1px solid ${accent}`,
@@ -628,7 +616,7 @@ export default function EventListCards({