diff --git a/server/src/admin-schema/columns.js b/server/src/admin-schema/columns.js index 4673345..bb96ef9 100644 --- a/server/src/admin-schema/columns.js +++ b/server/src/admin-schema/columns.js @@ -183,7 +183,6 @@ export const blocksChild = (ownerKind) => ({ text("media"), text("media_alt"), text("map"), - text("map_image"), ], }, ], diff --git a/server/src/migrations/069_schedule_map_image.sql b/server/src/migrations/069_schedule_map_image.sql deleted file mode 100644 index 25c5e36..0000000 --- a/server/src/migrations/069_schedule_map_image.sql +++ /dev/null @@ -1,10 +0,0 @@ --- ═══════════════════════════════════════════════════════════════ --- 069 SCHEDULE MAP IMAGE --- --- A schedule entry's own map picture (an upload), eg. a drawn map of --- the camp with the room marked. Shown in the entry's fold-out in --- place of the Google map, and as a slide in the schedule --- presentation (/events//present). --- ═══════════════════════════════════════════════════════════════ - -ALTER TABLE content_block_items ADD COLUMN map_image TEXT; diff --git a/server/src/pageMeta.js b/server/src/pageMeta.js index 2d9bc72..3fbe257 100644 --- a/server/src/pageMeta.js +++ b/server/src/pageMeta.js @@ -400,21 +400,6 @@ export function metaFor(db, rawPath) { return { ...meta, title: titled(site, page.title), description: plainText(page.description) ?? meta.description }; } - // An event's schedule presentation (SchedulePresent.tsx): the - // event's own title and preview, kept out of search, pointing - // search engines at the event page. - const present = pathname.match(/^\/events\/([^/]+)\/present$/); - if (present) { - let id; - try { - id = decodeURIComponent(present[1]); - } catch { - return notFound(meta); - } - const event = eventMeta(site, db, id, { ...meta, canonical: `${origin(site)}/events/${present[1]}` }); - return event.status === 200 ? { ...event, noindex: true, jsonLd: null } : event; - } - const match = pathname.match(/^\/(events|regions|groups|partners|organizations|teams|awards|people|blog|directory)\/([^/]+)$/); if (!match) return notFound(meta); diff --git a/server/src/seed-showcase.js b/server/src/seed-showcase.js index 26ee185..6b66af4 100644 --- a/server/src/seed-showcase.js +++ b/server/src/seed-showcase.js @@ -91,7 +91,7 @@ const SCHEDULE = [ { text: "The weekend at a glance. Tap an entry for more." }, [ { day: "Friday", time: "4:00pm", text: "Arrivals and check-in", location: "Front desk" }, - { day: "Friday", time: "7:00 to 8:30pm", text: "Opening session", location: "Main Hall", person_id: "showcase-person", detail: "Welcome and worship", description: "The **opening session** sets the theme for the weekend.\n\nBring a notebook.", media: "/uploads/showcase.jpg", map: "Camp Hebron, Halifax PA", map_image: "/uploads/showcase.jpg" }, + { day: "Friday", time: "7:00 to 8:30pm", text: "Opening session", location: "Main Hall", person_id: "showcase-person", detail: "Welcome and worship", description: "The **opening session** sets the theme for the weekend.\n\nBring a notebook.", media: "/uploads/showcase.jpg", map: "Camp Hebron, Halifax PA" }, { day: "Saturday", time: "9:00am", text: "Workshops", location: "Classrooms", person_id: "showcase-member-2", detail: "Pick one of three", url: "/blog/content-block-showcase" }, { day: "Saturday", time: "7:00pm", text: "Talent night", location: "Main Hall", person_id: "showcase-member-3", description: "Sign up at the front desk by noon." }, { day: "Sunday", time: "10:00am", text: "Closing service", location: "Chapel", map: "Main Street, Halifax PA" }, diff --git a/server/src/shape.js b/server/src/shape.js index 4548776..51acb01 100644 --- a/server/src/shape.js +++ b/server/src/shape.js @@ -101,7 +101,7 @@ export function loadBlocks(db, ownerKind, ids, slot = "body") { const itemRows = db .prepare( `SELECT i.block_id, i.text, i.detail, i.url, - i.day, i.time, i.location, i.description, i.media, i.media_alt, i.map, i.map_image, + i.day, i.time, i.location, i.description, i.media, i.media_alt, i.map, p.id AS person_id, p.display_name AS person_name, p.photo AS person_photo, p.tagline AS person_tagline FROM content_block_items i @@ -126,7 +126,6 @@ export function loadBlocks(db, ownerKind, ids, slot = "body") { media: row.media, media_alt: row.media_alt, map: row.map, - map_image: row.map_image, person: row.person_id ? { id: row.person_id, diff --git a/src/App.tsx b/src/App.tsx index 5f3fc56..af3fa83 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -70,7 +70,6 @@ const AwardDetail = lazyPage(() => import("./pages/AwardDetail.tsx")) const PersonDetail = lazyPage(() => import("./pages/PersonDetail.tsx")) const BlogPost = lazyPage(() => import("./pages/BlogPost.tsx")) const DirectoryPage = lazyPage(() => import("./pages/DirectoryPage.tsx")) -const SchedulePresent = lazyPage(() => import("./pages/SchedulePresent.tsx")) /*Admin Pages*/ const AdminLayout = lazyPage(() => import("./pages/admin/AdminLayout.tsx")) @@ -114,15 +113,6 @@ export default function App() { } /> } /> - {/* A schedule as a slideshow for a screen: full screen, no Layout. */} - - - - } - /> diff --git a/src/components/ContentBlocks.tsx b/src/components/ContentBlocks.tsx index e432181..d0f6cbf 100644 --- a/src/components/ContentBlocks.tsx +++ b/src/components/ContentBlocks.tsx @@ -62,14 +62,10 @@ export default function ContentBlocks({ blocks, accent = BRAND, className = '', - presentAt, }: { blocks?: ContentBlock[] | null accent?: string className?: string - /** An event page's presentation route: each schedule gets a Present - * button to it, `?block=` naming which schedule (from 0). */ - presentAt?: string }) { if (!blocks?.length) return null // Headings get ids so a post's contents (PostContents) and a shared @@ -85,22 +81,10 @@ export default function ContentBlocks({ return level }) - let schedules = 0 - const presentHrefs = blocks.map((block) => - presentAt && block.type === 'schedule' ? `${presentAt}?block=${schedules++}` : undefined, - ) - return (
{blocks.map((block, index) => ( - + ))}
) @@ -170,13 +154,11 @@ function Block({ accent, anchor, level, - presentHref, }: { block: ContentBlock accent: string anchor?: string level: 3 | 4 | 5 - presentHref?: string }) { const text = block.text ?? '' const reading = useReadingMode() @@ -377,7 +359,7 @@ function Block({ case 'schedule': if (!block.items?.length) return null - return + return case 'people': { const picked = (block.items ?? []) diff --git a/src/components/PageShell.tsx b/src/components/PageShell.tsx index 65f4676..096f007 100644 --- a/src/components/PageShell.tsx +++ b/src/components/PageShell.tsx @@ -107,17 +107,16 @@ export function Section({ section }: { section: ShellSection }) { const circleSize = (box: { width: number; height: number }) => Math.min(Math.max(box.width * 1.5, box.height * 1.1), 22 * 16); -/* The height a pill `width` wide (rounded-full: straight sides, round - ends of radius r = width / 2) needs to take in a box reaching +/* The height an ellipse `width` wide needs to take in a box reaching `across` and `down` from its center (or a corner it's centered on): - the corner must sit inside an end's circle, so the straight part - reaches down - sqrt(r^2 - across^2). Equal to the width when a - circle that wide would do; taller when the list is too tall for - one. A box as wide as the pill can't be taken in, so it stops at 95%. */ + (across / a)^2 + (down / b)^2 <= 1. Equal to the width when a circle + that wide would do; taller when the list is too tall for one. A + box as wide as the ellipse can't be taken in, so it stops at 95% + (about three times the box's height). */ const coverHeight = (width: number, across: number, down: number) => { - const r = width / 2; - const ratio = Math.min(across / r, 0.95); - return Math.max(width, 2 * (down - r * Math.sqrt(1 - ratio * ratio) + r)); + const a = width / 2; + const ratio = Math.min(across / a, 0.95); + return Math.max(width, (2 * down) / Math.sqrt(1 - ratio * ratio)); }; /* How far the list sits in from the column's top and left: the @@ -185,7 +184,7 @@ export default function PageShell({ title, intro, sections, sideNav = false }: P // The shape at rest: a circle centered on the list (a little left, // never left of the heading's center), CIRCLE_EDGE clear of the - // section's edge, made a pill as tall as it takes when the list + // section's edge, made an ellipse as tall as it takes when the list // is too tall for the circle (10 sections of two-line titles). // The shape at a given width: its center as near the list's as the // section's edge allows (it may run off the screen's left edge), and @@ -245,7 +244,7 @@ export default function PageShell({ title, intro, sections, sideNav = false }: P // far corner. Never wider than the column (it'd show a cut edge at // the content): held narrower by the window, it stays centered on // the header's edge (so below it, it only ever curves inward) and - // becomes a pill, as tall as it takes to take the list in. + // becomes an ellipse, as tall as it takes to take the list in. const circleBox = (() => { if (!listBox || !rest) return null; if (stuck) { diff --git a/src/components/ScheduleBlock.tsx b/src/components/ScheduleBlock.tsx index 733a11d..5458b7c 100644 --- a/src/components/ScheduleBlock.tsx +++ b/src/components/ScheduleBlock.tsx @@ -15,11 +15,7 @@ A row folds out when it has anything more to show: a description, a graphic, a map, or a person (their photo, tagline and a link to their page). The map is Google's key-free embed of - the place typed in, with a link out to the full map; an entry's - own map image (069) shows instead, the link out kept. - - On an event page a Present button opens the schedule as a - slideshow for a screen (SchedulePresent.tsx). + the place typed in, with a link out to the full map. Tabs follow the ARIA tab pattern: arrow keys move between them. @@ -28,7 +24,7 @@ it, no map frame (ReadingSchedule). ═══════════════════════════════════════════════════════════════ */ -import { CaretDown, Presentation } from '@phosphor-icons/react' +import { CaretDown } from '@phosphor-icons/react' import { Fragment, useId, useState, type KeyboardEvent, type ReactNode } from 'react' import { Link } from 'react-router-dom' @@ -44,9 +40,9 @@ import { useReadingMode } from '../lib/readingMode.ts' const BODY = 'var(--color-muted)' const WEEKDAYS = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'] -export type Day = { name: string; entries: ContentBlockItem[] } +type Day = { name: string; entries: ContentBlockItem[] } -export function groupByDay(items: ContentBlockItem[]): Day[] { +function groupByDay(items: ContentBlockItem[]): Day[] { const days: Day[] = [] for (const item of items) { const name = item.day?.trim() ?? '' @@ -71,15 +67,12 @@ function todayIndex(days: Day[]): number { return found >= 0 ? found : 0 } -/* An entry's own map image says what it maps. */ -export const mapAlt = (entry: ContentBlockItem) => `Map: ${entry.map?.trim() || entry.location || entry.text}` - const mapEmbed = (place: string) => `https://maps.google.com/maps?q=${encodeURIComponent(place)}&output=embed&maptype=satellite` const mapLink = (place: string) => `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(place)}` -export function Avatar({ person, size }: { person: NonNullable; size: string }) { +function Avatar({ person, size }: { person: NonNullable; size: string }) { const img = useSmallImage(mediaUrl(person.photo)) return !img.failed ? ( @@ -100,8 +93,7 @@ function Entry({ entry, accent }: { entry: ContentBlockItem; accent: string }) { const panelId = useId() const graphic = mediaUrl(entry.media) const place = entry.map?.trim() - const mapImage = mediaUrl(entry.map_image) - const more = Boolean(entry.description || graphic || place || mapImage || entry.person) + const more = Boolean(entry.description || graphic || place || entry.person) const title = entry.url ? ( @@ -189,11 +181,9 @@ function Entry({ entry, accent }: { entry: ContentBlockItem; accent: string }) { {graphic && {entry.media_alt} - {(place || mapImage) && ( + {place && (
- {mapImage ? ( - {mapAlt(entry)} - ) : showMap && place ? ( + {showMap ? (