Compare commits
No commits in common. "2df908f7c4c4c065ba3205670b6aa8c31cf2ed7b" and "582c65077dc4f32a6925f59b86ffef388fd9251a" have entirely different histories.
2df908f7c4
...
582c65077d
19 changed files with 200 additions and 399 deletions
|
|
@ -72,7 +72,7 @@ In dev, Vite proxies `/api` to the target set in `vite.config.ts`, so the API mu
|
|||
- **Colors are tokens, not hex.** Admins can override any token (Panel → Site settings → Colors). The defaults are `server/src/themeDefaults.js` plus the same values as CSS in `src/index.css`; the build fails if they differ (`themeDefaultsCheck` in `vite.config.ts`), and migration 041's CHECK lists the token names. 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 color). Data colors (accents, event and region colors) go through `withAlpha`, `accentText` and `readableOn` in `src/lib/color.ts`, never `${color}55`.
|
||||
- **Icons are Phosphor** (`@phosphor-icons/react`), weight `bold` (or `fill` for play/star). No hand-drawn `<svg>` icons and no Unicode glyphs as icons (× › ▶ →). Brand marks are the exception: `DoveMark`, `PlatformIcon`, the Google logo, the group map.
|
||||
- **Accents come from `src/lib/color.ts`:** `BRAND` (the teal, via the button token so the admin palette reaches it) and `ACCENTS` (deep, green, olive), all from `PALETTE` (the site's 16-color grid). Not a new hex in a page.
|
||||
- **Corners: square.** Everything is square except buttons, which use the `btn` utility (Poppins Bold, a small `var(--btn-radius)` corner, also for plain CSS), video players (small rounded) and things round by nature (dots, radio marks, the play button). A note in place of content (empty section, "coming soon") uses the `notice` utility (corner brackets), not a dashed border. Cards sit on `bg-raised` with a shadow so they stand off the page. Nothing glows: no blur blobs, no glow shadows.
|
||||
- **No rounded corners.** Everything is square except buttons, which use the `btn` utility (Poppins Bold, a superellipse via `corner-shape`; `var(--btn-radius)` in plain CSS), and things round by nature (dots, radio marks). A note in place of content (empty section, "coming soon") uses the `notice` utility, not a dashed border. Nothing glows: no blur blobs, no glow shadows.
|
||||
- **Sections paint no background.** `PageBackdrop` (in Layout) draws the page's palette circles behind every public page; a band that needs its own color (the hero, the stats band, the footer) is a deliberate exception.
|
||||
- **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`.
|
||||
|
|
|
|||
|
|
@ -277,7 +277,7 @@ The numbers band's "Number Source" dropdown works the same way:
|
|||
| The site's colors, light and dark | the database over `src/index.css` | Admin → Panel → Site settings → Colors (superadmins): pick a color, set its light and/or dark value; saving refuses anything that makes text hard to read. The defaults are `THEME_DEFAULTS` in `server/src/themeDefaults.js` (the admin and the contrast check read it) and the same values as CSS in `src/index.css`; the build stops if the two differ. The admin's labels for them are `THEME_LABELS` in `src/lib/adminSchema/siteSettings.ts`. 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 color that arrives as data (a page accent, an event's or region's color) goes through `src/lib/color.ts`: `withAlpha` for tints, `accentText` for text in it, `readableOn` for text on it. |
|
||||
| The icons a Front page "Find your way in" path can pick | `src/data/pathIcons.ts` (keys and labels) **and** `ICONS` in `src/pages/sections/home/Pathfinder.tsx` (the Phosphor icon for each key) | Add a line to both. A path saved with an emoji from before the list shows it as it is. |
|
||||
| A page section's accent color | `BRAND` and `ACCENTS` in `src/lib/color.ts` | Pages pick from these (`accent: ACCENTS.green`); add a color there, not a hex in a page. Each is readable as text on white and the tints. |
|
||||
| The palette (the 16-color grid the theme is drawn from) | `PALETTE` in `src/lib/color.ts` | Four families, a column each. `PALETTE_LIGHT` / `PALETTE_DARK` are the fills things colored by data use (a person's initials tile, `paletteFill`); the page background's layers (how many circles, their sizes and parallax speeds) are `LAYERS` in `src/components/PageBackdrop.tsx` and its shades are in `PageBackdrop.css`; the admin home's two alternating group colors are `BLOCK_COLORS` in `src/pages/admin/AdminHome.tsx`. |
|
||||
| The palette (the 16-color grid the theme is drawn from) | `PALETTE` in `src/lib/color.ts` | Four families, a column each. `PALETTE_LIGHT` / `PALETTE_DARK` are the fills things colored by data use (a person's initials tile, `paletteFill`); the page background's circles and tones are in `src/components/PageBackdrop.css`; the admin home's group colors are `GROUPS` in `src/pages/admin/AdminHome.tsx`. |
|
||||
| Timeline leaf colors (green now, autumn going back) | `leafColor` in `src/lib/color.ts` | The green, gold and autumn stops, and `LEAF_TURNED_BY` (2000), the year before which every leaf is fully turned. |
|
||||
| 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. |
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ export const THEME_DEFAULTS = {
|
|||
"action-hover": ["#001011", "#004552"],
|
||||
surface: ["#fcfffd", "#001011"],
|
||||
tint: ["#c2f6ff", "#004552"],
|
||||
"tint-soft": ["#e8fcfe", "#00252b"],
|
||||
"tint-soft": ["#dfebd6", "#27371b"],
|
||||
danger: ["#b3261e", "#ff8a80"],
|
||||
"danger-tint": ["#fdf3f2", "#3b1714"],
|
||||
};
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ function Card({ card, large }: { card: FeaturedCard; large: boolean }) {
|
|||
|
||||
return (
|
||||
<li
|
||||
className={`relative flex flex-col overflow-hidden border-r-4 border-b-4 ${RULE} bg-raised transition-colors hover:bg-tint-soft ${
|
||||
className={`relative flex flex-col overflow-hidden border-r-4 border-b-4 ${RULE} bg-surface transition-colors hover:bg-tint-soft ${
|
||||
large ? 'lg:col-span-2 lg:row-span-2' : ''
|
||||
}`}
|
||||
>
|
||||
|
|
@ -134,7 +134,7 @@ function Card({ card, large }: { card: FeaturedCard; large: boolean }) {
|
|||
export default function FeaturedCards({ cards }: { cards: FeaturedCard[] }) {
|
||||
const leadLarge = cards.length >= 3
|
||||
return (
|
||||
<div className="overflow-hidden shadow-md">
|
||||
<div className="overflow-hidden">
|
||||
<ul className="-mr-[4px] -mb-[4px] grid sm:grid-cols-2 lg:grid-cols-3">
|
||||
{cards.map((card, index) => (
|
||||
<Card
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ export default function Layout() {
|
|||
// container, and then nothing inside it can be position: sticky
|
||||
// (a blog post's contents column scrolled away with the page).
|
||||
<div
|
||||
className="min-h-screen overflow-x-clip"
|
||||
className="relative min-h-screen overflow-x-clip"
|
||||
style={{ "--header-h": `${headerHeight}px` } as React.CSSProperties}
|
||||
>
|
||||
<a
|
||||
|
|
|
|||
|
|
@ -1,84 +1,93 @@
|
|||
/* ═══════════════════════════════════════════════════════════════
|
||||
PAGE BACKDROP: the circles, their layers and shades
|
||||
(PageBackdrop.tsx places them)
|
||||
PAGE BACKDROP: the circles and their tones (PageBackdrop.tsx)
|
||||
|
||||
Flat fills only: no blur, no gradient, no glow. Light mode uses
|
||||
the palette's four palest shades at 60%, dark mode its dark
|
||||
shades (two deepened a step) at 30% over the ink background.
|
||||
Every text token reads at 4.5:1 or better on each shade even at
|
||||
full strength, so however many circles overlap, text stays
|
||||
readable (the lowest, 4.66:1, is the danger red on #004552).
|
||||
the palette's four palest shades, dark mode its dark shades at
|
||||
45% opacity over the ink background. Every text token reads at
|
||||
4.5:1 or better on any of them, even where three overlap (the
|
||||
lowest, 4.8:1, is the danger red in dark mode).
|
||||
═══════════════════════════════════════════════════════════════ */
|
||||
|
||||
/* Spans the whole page (Layout's root is its containing block), so
|
||||
the section circles sit at points down the document; the window
|
||||
layer inside it is fixed. */
|
||||
.page-backdrop {
|
||||
position: fixed;
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
z-index: -1;
|
||||
overflow: hidden;
|
||||
overflow: hidden; /* the section circles, never the fixed layer */
|
||||
pointer-events: none;
|
||||
|
||||
--pb-opacity: 0.6;
|
||||
--pb-0: #c2f6ff;
|
||||
--pb-1: #dfebd6;
|
||||
--pb-2: #c2ffd6;
|
||||
--pb-3: #c2fbff;
|
||||
--pb-opacity: 0.7;
|
||||
--pb-a: #c2f6ff;
|
||||
--pb-b: #dfebd6;
|
||||
--pb-c: #c2ffd6;
|
||||
--pb-d: #c2fbff;
|
||||
--pb-e: #dfebd6;
|
||||
}
|
||||
|
||||
.page-backdrop__window {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* A circle's place: across by its left, down its layer's whole
|
||||
travel (the window plus how far the layer rises), centered on
|
||||
that point. */
|
||||
.page-backdrop__circle {
|
||||
position: absolute;
|
||||
width: var(--pb-size);
|
||||
height: var(--pb-size);
|
||||
top: calc(var(--pb-top) * (100vh + var(--pb-scroll, 0px) * var(--pb-speed)) - var(--pb-size) / 2);
|
||||
border-radius: 50%;
|
||||
opacity: var(--pb-opacity);
|
||||
transition: background-color 2.4s ease-in-out;
|
||||
transition: background-color 1.4s cubic-bezier(0.16, 1, 0.3, 1);
|
||||
}
|
||||
|
||||
/* Each layer rises by its share of the page's scroll as the page
|
||||
scrolls: the back slowest, none as fast as the page. */
|
||||
/* Slow: fixed to the window. */
|
||||
.page-backdrop__circle--a { width: 70vmax; height: 70vmax; left: -24vmax; top: -16vmax; background: var(--pb-a); --pb-drift: -22vh; }
|
||||
.page-backdrop__circle--b { width: 50vmax; height: 50vmax; right: -18vmax; top: 34vh; background: var(--pb-b); --pb-drift: -40vh; }
|
||||
|
||||
/* Section: placed down the page, moving with it. */
|
||||
.page-backdrop__circle--c { width: 42vmax; height: 42vmax; left: 34vw; top: 18%; background: var(--pb-c); }
|
||||
.page-backdrop__circle--d { width: 32vmax; height: 32vmax; left: -8vmax; top: 48%; background: var(--pb-d); }
|
||||
.page-backdrop__circle--e { width: 36vmax; height: 36vmax; right: -6vmax; top: 74%; background: var(--pb-e); }
|
||||
|
||||
/* The slow circles drift up across the whole scroll of the page. */
|
||||
@supports (animation-timeline: scroll()) {
|
||||
.page-backdrop__circle {
|
||||
animation: page-backdrop-rise linear both;
|
||||
.page-backdrop__circle--a,
|
||||
.page-backdrop__circle--b {
|
||||
animation: page-backdrop-drift linear both;
|
||||
animation-timeline: scroll(root block);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes page-backdrop-rise {
|
||||
@keyframes page-backdrop-drift {
|
||||
to {
|
||||
transform: translateY(calc(var(--pb-scroll, 0px) * var(--pb-speed) * -1));
|
||||
transform: translateY(var(--pb-drift));
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.page-backdrop__circle {
|
||||
.page-backdrop__circle--a,
|
||||
.page-backdrop__circle--b {
|
||||
animation: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* Dark mode: the dark shades. Two blocks as in index.css: the
|
||||
toggle's choice, or the system's when there is none. */
|
||||
:root[data-theme="dark"] .page-backdrop {
|
||||
--pb-opacity: 0.3;
|
||||
--pb-0: #004552;
|
||||
--pb-1: #27371b;
|
||||
--pb-2: #003f45; /* #004c52 deepened */
|
||||
--pb-3: #00441a; /* #00521b deepened */
|
||||
}
|
||||
/* Tones, one per section in turn: the same shades, swapped around. */
|
||||
.page-backdrop[data-tone="1"] { --pb-a: #dfebd6; --pb-b: #c2ffd6; --pb-c: #c2f6ff; --pb-d: #dfebd6; --pb-e: #c2fbff; }
|
||||
.page-backdrop[data-tone="2"] { --pb-a: #c2ffd6; --pb-b: #c2fbff; --pb-c: #dfebd6; --pb-d: #c2f6ff; --pb-e: #c2ffd6; }
|
||||
.page-backdrop[data-tone="3"] { --pb-a: #c2fbff; --pb-b: #c2f6ff; --pb-c: #c2ffd6; --pb-d: #dfebd6; --pb-e: #c2f6ff; }
|
||||
|
||||
/* Dark mode: the dark shades, the same turns. Two blocks as in
|
||||
index.css: the toggle's choice, or the system's when there is none. */
|
||||
:root[data-theme="dark"] .page-backdrop { --pb-opacity: 0.45; --pb-a: #004552; --pb-b: #27371b; --pb-c: #004c52; --pb-d: #00521b; --pb-e: #27371b; }
|
||||
:root[data-theme="dark"] .page-backdrop[data-tone="1"] { --pb-a: #27371b; --pb-b: #004c52; --pb-c: #004552; --pb-d: #27371b; --pb-e: #00521b; }
|
||||
:root[data-theme="dark"] .page-backdrop[data-tone="2"] { --pb-a: #004c52; --pb-b: #00521b; --pb-c: #27371b; --pb-d: #004552; --pb-e: #004c52; }
|
||||
:root[data-theme="dark"] .page-backdrop[data-tone="3"] { --pb-a: #00521b; --pb-b: #004552; --pb-c: #004c52; --pb-d: #27371b; --pb-e: #004552; }
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root:not([data-theme="light"]) .page-backdrop {
|
||||
--pb-opacity: 0.3;
|
||||
--pb-0: #004552;
|
||||
--pb-1: #27371b;
|
||||
--pb-2: #003f45; /* #004c52 deepened */
|
||||
--pb-3: #00441a; /* #00521b deepened */
|
||||
}
|
||||
:root:not([data-theme="light"]) .page-backdrop { --pb-opacity: 0.45; --pb-a: #004552; --pb-b: #27371b; --pb-c: #004c52; --pb-d: #00521b; --pb-e: #27371b; }
|
||||
:root:not([data-theme="light"]) .page-backdrop[data-tone="1"] { --pb-a: #27371b; --pb-b: #004c52; --pb-c: #004552; --pb-d: #27371b; --pb-e: #00521b; }
|
||||
:root:not([data-theme="light"]) .page-backdrop[data-tone="2"] { --pb-a: #004c52; --pb-b: #00521b; --pb-c: #27371b; --pb-d: #004552; --pb-e: #004c52; }
|
||||
:root:not([data-theme="light"]) .page-backdrop[data-tone="3"] { --pb-a: #00521b; --pb-b: #004552; --pb-c: #004c52; --pb-d: #27371b; --pb-e: #004552; }
|
||||
}
|
||||
|
||||
@media print {
|
||||
.page-backdrop {
|
||||
display: none;
|
||||
}
|
||||
.page-backdrop { display: none; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,127 +1,69 @@
|
|||
/* ═══════════════════════════════════════════════════════════════
|
||||
PAGE BACKDROP
|
||||
|
||||
One background behind every public page: flat circles in the
|
||||
palette's light shades (its dark ones in dark mode), overlapping.
|
||||
Sections paint nothing of their own, so it runs behind all of
|
||||
them; cards keep their own raised surface.
|
||||
One background behind every public page: large flat circles in
|
||||
the palette's light shades (its dark ones in dark mode),
|
||||
overlapping. Sections paint nothing of their own, so it runs
|
||||
behind all of them; cards keep their solid surface.
|
||||
|
||||
Depth: the circles sit in LAYERS, back to front, each rising at
|
||||
its own fraction of the page's scroll: big and slow at the back,
|
||||
small and quicker at the front, none as fast as the page itself.
|
||||
The rise is a CSS scroll-driven animation (PageBackdrop.css) over
|
||||
--pb-scroll, the page's scrollable height, which is measured here
|
||||
whenever the page changes size (no scroll listener). Without
|
||||
scroll-driven animations, or under reduced motion, they stay put.
|
||||
Two kinds of circle, for depth as the page scrolls:
|
||||
slow fixed to the window, drifting up slower than the page
|
||||
(a CSS scroll-driven animation, PageBackdrop.css)
|
||||
section placed down the page itself, so they travel with the
|
||||
sections they sit behind
|
||||
Without scroll-driven animations, or under reduced motion, the
|
||||
slow circles simply stay put.
|
||||
|
||||
Each page gets its own arrangement: sizes and places come from a
|
||||
generator seeded with the path, so a page looks the same every
|
||||
visit and different from its neighbors.
|
||||
As the visitor moves through a page the circles change tone: the
|
||||
section crossing the middle of the window picks one of TONES (its
|
||||
place on the page, in turn), and the circles ease to that tone's
|
||||
colors. Watched with an IntersectionObserver, so nothing runs
|
||||
while the page sits still. Under reduced motion the change is
|
||||
instant (index.css stops every transition).
|
||||
|
||||
As the visitor reaches a new section (a top-level one, not one
|
||||
nested inside another) the circles change tone: each moves to the
|
||||
next shade in turn, easing slowly. Watched with an
|
||||
IntersectionObserver; under reduced motion the change is instant
|
||||
(index.css stops every transition).
|
||||
|
||||
Every text color passes 4.5:1 on every shade here, however many
|
||||
circles overlap (see PageBackdrop.css for the opacities).
|
||||
Every text color passes 4.5:1 on every shade used here, overlaps
|
||||
included, in both modes: the light shades are the palette's
|
||||
palest, and the dark ones sit at partial opacity.
|
||||
═══════════════════════════════════════════════════════════════ */
|
||||
|
||||
import { useEffect, useMemo, useRef, useState, type CSSProperties } from 'react'
|
||||
import { useEffect, useRef } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import './PageBackdrop.css'
|
||||
|
||||
/** How many shades PageBackdrop.css defines (--pb-0 to --pb-3). */
|
||||
const SHADES = 4
|
||||
|
||||
/* Back to front: how many circles, how big (vmax), and how much of
|
||||
the page's scroll the layer rises by. */
|
||||
const LAYERS = [
|
||||
{ count: 3, size: [46, 70], speed: 0.14 },
|
||||
{ count: 4, size: [26, 42], speed: 0.28 },
|
||||
{ count: 4, size: [16, 26], speed: 0.45 },
|
||||
{ count: 5, size: [8, 15], speed: 0.65 },
|
||||
]
|
||||
|
||||
type Circle = { layer: number; size: number; left: number; top: number; shade: number; speed: number }
|
||||
|
||||
/* A small seeded generator (mulberry32), so a path always draws the
|
||||
same circles. */
|
||||
function seeded(text: string) {
|
||||
let seed = 0
|
||||
for (const char of text) seed = (Math.imul(seed, 31) + char.charCodeAt(0)) | 0
|
||||
return () => {
|
||||
seed = (seed + 0x6d2b79f5) | 0
|
||||
let t = Math.imul(seed ^ (seed >>> 15), 1 | seed)
|
||||
t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t
|
||||
return ((t ^ (t >>> 14)) >>> 0) / 4294967296
|
||||
}
|
||||
}
|
||||
|
||||
function arrange(path: string): Circle[] {
|
||||
const random = seeded(path)
|
||||
return LAYERS.flatMap((layer, index) =>
|
||||
Array.from({ length: layer.count }, (_, i) => ({
|
||||
layer: index,
|
||||
size: layer.size[0] + random() * (layer.size[1] - layer.size[0]),
|
||||
// Spread across the width, and down the layer's full travel:
|
||||
// one slice of it per circle, placed somewhere in its slice.
|
||||
left: -15 + random() * 100,
|
||||
top: (i + random()) / layer.count,
|
||||
shade: Math.floor(random() * SHADES),
|
||||
speed: layer.speed,
|
||||
})),
|
||||
)
|
||||
}
|
||||
/** How many tones PageBackdrop.css defines (data-tone 0 to 3). */
|
||||
const TONES = 4
|
||||
const SLOW = ['a', 'b']
|
||||
const SECTION = ['c', 'd', 'e']
|
||||
|
||||
export default function PageBackdrop() {
|
||||
const ref = useRef<HTMLDivElement>(null)
|
||||
const { pathname } = useLocation()
|
||||
const [tone, setTone] = useState(0)
|
||||
const circles = useMemo(() => arrange(pathname), [pathname])
|
||||
|
||||
// The page's scrollable height, for how far each layer travels.
|
||||
useEffect(() => {
|
||||
const backdrop = ref.current
|
||||
if (!backdrop) return undefined
|
||||
const measure = () => {
|
||||
const scroll = Math.max(0, document.documentElement.scrollHeight - window.innerHeight)
|
||||
backdrop.style.setProperty('--pb-scroll', `${scroll}px`)
|
||||
}
|
||||
measure()
|
||||
const observer = new ResizeObserver(measure)
|
||||
observer.observe(document.body)
|
||||
return () => observer.disconnect()
|
||||
}, [])
|
||||
|
||||
// A new top-level section reaching the window's middle moves the tone on.
|
||||
useEffect(() => {
|
||||
const main = document.getElementById('main')
|
||||
if (!main) return undefined
|
||||
const backdrop = ref.current
|
||||
if (!main || !backdrop) return undefined
|
||||
|
||||
setTone(0)
|
||||
backdrop.dataset.tone = '0'
|
||||
let watched: Element[] = []
|
||||
|
||||
// The band crossing the window's middle line sets the tone.
|
||||
const observer = new IntersectionObserver(
|
||||
(entries) => {
|
||||
for (const entry of entries) {
|
||||
if (!entry.isIntersecting) continue
|
||||
const index = watched.indexOf(entry.target)
|
||||
if (index >= 0) setTone(index % SHADES)
|
||||
if (index >= 0) backdrop.dataset.tone = String(index % TONES)
|
||||
}
|
||||
},
|
||||
{ rootMargin: '-50% 0px -50% 0px', threshold: 0 },
|
||||
)
|
||||
|
||||
// Pages draw their sections as their data arrives, so the list
|
||||
// is gathered again whenever main's content changes. Only the
|
||||
// outermost: a timeline's decades are sections inside one.
|
||||
// is gathered again whenever main's content changes.
|
||||
const collect = () => {
|
||||
observer.disconnect()
|
||||
watched = Array.from(main.querySelectorAll('section')).filter(
|
||||
(section) => !section.parentElement?.closest('section'),
|
||||
)
|
||||
watched = Array.from(main.querySelectorAll('section'))
|
||||
watched.forEach((section) => observer.observe(section))
|
||||
}
|
||||
collect()
|
||||
|
|
@ -141,20 +83,13 @@ export default function PageBackdrop() {
|
|||
|
||||
return (
|
||||
<div ref={ref} className="page-backdrop" aria-hidden="true">
|
||||
{circles.map((circle, i) => (
|
||||
<span
|
||||
key={i}
|
||||
className={`page-backdrop__circle page-backdrop__circle--${circle.layer}`}
|
||||
style={
|
||||
{
|
||||
'--pb-size': `${circle.size.toFixed(1)}vmax`,
|
||||
left: `${circle.left.toFixed(1)}vw`,
|
||||
'--pb-top': circle.top,
|
||||
'--pb-speed': circle.speed,
|
||||
background: `var(--pb-${(circle.shade + tone) % SHADES})`,
|
||||
} as CSSProperties
|
||||
}
|
||||
/>
|
||||
<div className="page-backdrop__window">
|
||||
{SLOW.map((name) => (
|
||||
<span key={name} className={`page-backdrop__circle page-backdrop__circle--${name}`} />
|
||||
))}
|
||||
</div>
|
||||
{SECTION.map((name) => (
|
||||
<span key={name} className={`page-backdrop__circle page-backdrop__circle--${name}`} />
|
||||
))}
|
||||
</div>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -13,14 +13,13 @@
|
|||
|
||||
/* color */
|
||||
--pl-accent: var(--color-link);
|
||||
--pl-frame-bg: var(--color-raised);
|
||||
--pl-frame-bg: var(--color-surface);
|
||||
--pl-frame-edge: color-mix(in srgb, var(--color-brand) 45%, transparent);
|
||||
--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: color-mix(in srgb, var(--color-brand) 35%, transparent);
|
||||
|
||||
position: relative;
|
||||
container-type: inline-size;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
|
@ -94,32 +93,6 @@
|
|||
list-style: none;
|
||||
}
|
||||
|
||||
/* Balanced rows (PeopleTiles.tsx sets --pl-cols once it has measured):
|
||||
a grid of equal columns, each at most a tile wide, shrinking only
|
||||
when two won't fit. */
|
||||
.pl__row[style*="--pl-cols"] {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(var(--pl-cols), minmax(0, var(--pl-w)));
|
||||
}
|
||||
|
||||
.pl[data-align="center"] .pl__row[style*="--pl-cols"] {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.pl__row[style*="--pl-cols"] .pl__tile {
|
||||
width: 100%;
|
||||
max-width: var(--pl-w);
|
||||
}
|
||||
|
||||
/* Measures one tile's width and the gap for the balancing. */
|
||||
.pl__probe {
|
||||
position: absolute;
|
||||
visibility: hidden;
|
||||
width: var(--pl-w);
|
||||
height: var(--pl-gap);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.pl[data-overflow="scroll"] .pl__row {
|
||||
flex-wrap: nowrap;
|
||||
overflow-x: auto;
|
||||
|
|
@ -169,7 +142,6 @@
|
|||
padding: var(--pl-pad);
|
||||
padding-bottom: calc(var(--pl-pad) * 1.6);
|
||||
background: var(--pl-frame-bg);
|
||||
box-shadow: var(--shadow-sm);
|
||||
transition: transform 160ms ease, background-color 160ms ease;
|
||||
}
|
||||
|
||||
|
|
@ -360,6 +332,7 @@
|
|||
height: 1.75rem;
|
||||
border: 1px solid var(--pl-frame-edge);
|
||||
border-radius: var(--btn-radius);
|
||||
corner-shape: squircle;
|
||||
background: var(--color-surface);
|
||||
color: var(--pl-muted);
|
||||
font-size: 1.1rem;
|
||||
|
|
|
|||
|
|
@ -53,10 +53,6 @@ import "./PeopleTiles.css";
|
|||
* lines of name (and two of title), so a row's cards are one
|
||||
* height. The list as a whole has the frame, not each tile.
|
||||
*
|
||||
* Rows are balanced (balancedColumns): as many tiles across as fit,
|
||||
* but never fewer than 2 or more than 10, and spread so the last
|
||||
* row isn't a lone tile. When 2 don't fit at full size they shrink.
|
||||
*
|
||||
* Details open in a panel right under the tile, over what follows
|
||||
* (flipped to end at the tile's right edge when it would run off
|
||||
* the screen), and close on Escape, the tile again, or a click
|
||||
|
|
@ -417,7 +413,6 @@ export function PeopleTilesView({
|
|||
// the down arrow, and the details panel shows it whole.
|
||||
const [clipped, setClipped] = useState<ReadonlySet<string>>(() => new Set());
|
||||
const rootRef = useRef<HTMLDivElement>(null);
|
||||
const probeRef = useRef<HTMLSpanElement>(null);
|
||||
|
||||
const resolvedSize: PeopleTilesSize = SIZE_FEATURES[size] ? size : "md";
|
||||
const features = SIZE_FEATURES[resolvedSize];
|
||||
|
|
@ -438,27 +433,6 @@ export function PeopleTilesView({
|
|||
.filter((group) => group.people.length > 0);
|
||||
}, [groups, people]);
|
||||
|
||||
const hasPeople = resolvedGroups.length > 0;
|
||||
|
||||
// How much room a row has, and one tile's width and gap there, in
|
||||
// px: the probe carries --pl-w and --pl-gap, so the CSS stays the
|
||||
// one place that sizes tiles.
|
||||
const [room, setRoom] = useState<{ width: number; tile: number; gap: number } | null>(null);
|
||||
|
||||
useLayoutEffect(() => {
|
||||
const root = rootRef.current;
|
||||
const probe = probeRef.current;
|
||||
if (!root || !probe || overflow === "scroll") return undefined;
|
||||
const measure = () => {
|
||||
const padding = parseFloat(getComputedStyle(root).paddingLeft) * 2;
|
||||
setRoom({ width: root.clientWidth - padding, tile: probe.offsetWidth, gap: probe.offsetHeight });
|
||||
};
|
||||
measure();
|
||||
const observer = new ResizeObserver(measure);
|
||||
observer.observe(root);
|
||||
return () => observer.disconnect();
|
||||
}, [overflow, hasPeople]);
|
||||
|
||||
// A click anywhere outside the list closes the panel.
|
||||
useEffect(() => {
|
||||
if (!openKey) return undefined;
|
||||
|
|
@ -535,7 +509,6 @@ export function PeopleTilesView({
|
|||
onKeyDown={handleKeyDown}
|
||||
{...rest}
|
||||
>
|
||||
<span ref={probeRef} className="pl__probe" aria-hidden="true" />
|
||||
<div className="pl__groups">
|
||||
{resolvedGroups.map((group) => (
|
||||
<section
|
||||
|
|
@ -553,16 +526,7 @@ export function PeopleTilesView({
|
|||
</header>
|
||||
)}
|
||||
|
||||
<ul
|
||||
className="pl__row"
|
||||
style={
|
||||
room
|
||||
? ({
|
||||
"--pl-cols": balancedColumns(group.people.length, room.width, room.tile, room.gap),
|
||||
} as CSSProperties)
|
||||
: undefined
|
||||
}
|
||||
>
|
||||
<ul className="pl__row">
|
||||
{group.people.map((person, index) => {
|
||||
const key = keyFor(group, person, index);
|
||||
const expandable = (features.details && hasDetails(person)) || clipped.has(key);
|
||||
|
|
@ -833,19 +797,6 @@ function Chevron() {
|
|||
|
||||
/* ── Helpers ─────────────────────────────────────────────────── */
|
||||
|
||||
/* Tiles across a row: as many as fit, at least 2 and at most 10
|
||||
(never more than there are), then evened out so the rows come
|
||||
out as close to equal as they can: 5 tiles that fit 4 across go
|
||||
3 and 2, not 4 and 1. If one tile would still be left alone (3
|
||||
where only 2 fit), one more, narrower, column takes it. */
|
||||
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 most = Math.min(count, 10, Math.max(2, fit));
|
||||
const cols = Math.ceil(count / Math.ceil(count / most));
|
||||
return count % cols === 1 && cols < Math.min(count, 10) ? cols + 1 : cols;
|
||||
}
|
||||
|
||||
/* A string id is a people slug; a numeric or missing one is a
|
||||
hand-written entry with no page behind it. */
|
||||
function profileHref(person: Person): string | null {
|
||||
|
|
|
|||
|
|
@ -5,17 +5,14 @@
|
|||
page loads no iframes until someone asks for one. Used by the
|
||||
featured cards and the video content block.
|
||||
|
||||
The still is the caller's image, else YouTube's own thumbnail
|
||||
(its 16:9 one, falling back to the 4:3 one cropped), else a plain
|
||||
dark panel. The play button shows on hover or keyboard focus, and
|
||||
always on a touch screen, which can't hover. Small rounded
|
||||
corners, as the only rounded thing besides buttons and dots. A link that embeds.ts can't turn into a
|
||||
The still is the caller's image, else YouTube's own thumbnail,
|
||||
else a plain dark panel. A link that embeds.ts can't turn into a
|
||||
player (not https, or not a host it knows how to frame) still
|
||||
goes somewhere: the still becomes a link to it.
|
||||
═══════════════════════════════════════════════════════════════ */
|
||||
|
||||
import { Play } from '@phosphor-icons/react'
|
||||
import { useState, type SyntheticEvent } from 'react'
|
||||
import { useState } from 'react'
|
||||
|
||||
import HomeLink from '../pages/sections/home/HomeLink.tsx'
|
||||
import { playingSource, videoSource, videoThumbnail } from '../lib/embeds.ts'
|
||||
|
|
@ -40,42 +37,36 @@ export default function VideoPlayer({
|
|||
if (playing && source) {
|
||||
const live = playingSource(source)
|
||||
return live.kind === 'file' ? (
|
||||
<video src={live.src} controls autoPlay playsInline className={`aspect-video w-full rounded-md bg-black ${className}`} />
|
||||
<video src={live.src} controls autoPlay playsInline className={`aspect-video w-full bg-black ${className}`} />
|
||||
) : (
|
||||
<iframe
|
||||
src={live.src}
|
||||
title={title || 'Video'}
|
||||
allow="autoplay; encrypted-media; picture-in-picture; fullscreen"
|
||||
allowFullScreen
|
||||
className={`aspect-video w-full rounded-md border-0 bg-black ${className}`}
|
||||
className={`aspect-video w-full border-0 bg-black ${className}`}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
const image = still ?? videoThumbnail(url)
|
||||
|
||||
// YouTube's 16:9 still is missing for some videos; its 4:3 one never is.
|
||||
const fallBack = (event: SyntheticEvent<HTMLImageElement>) => {
|
||||
const img = event.currentTarget
|
||||
if (img.src.endsWith('/hq720.jpg')) img.src = img.src.replace(/hq720\.jpg$/, 'hqdefault.jpg')
|
||||
}
|
||||
|
||||
const face = (
|
||||
<span className={`relative block overflow-hidden rounded-md ${className}`}>
|
||||
<>
|
||||
{image ? (
|
||||
<img src={image} alt="" loading="lazy" onError={fallBack} className="block aspect-video w-full object-cover" />
|
||||
<img src={image} alt="" loading="lazy" className={`aspect-video w-full object-cover ${className}`} />
|
||||
) : (
|
||||
<span className="block aspect-video w-full bg-[#004552]" />
|
||||
<div className={`aspect-video w-full bg-[#004552] ${className}`} />
|
||||
)}
|
||||
<span
|
||||
aria-hidden="true"
|
||||
className="video-play absolute inset-0 flex items-center justify-center transition-colors group-hover:bg-black/20 group-focus-visible:bg-black/20"
|
||||
className="absolute inset-0 flex items-center justify-center bg-black/10 transition-colors group-hover:bg-black/25"
|
||||
>
|
||||
<span className="flex h-16 w-16 items-center justify-center rounded-full bg-white/95 shadow-lg transition-transform group-hover:scale-105">
|
||||
<Play className="h-7 w-7" weight="fill" style={{ color: BRAND }} aria-hidden="true" />
|
||||
<span className="flex h-16 w-16 items-center justify-center btn bg-white/90 shadow-lg transition-transform group-hover:scale-110">
|
||||
<Play className="ml-1 h-7 w-7" weight="fill" style={{ color: BRAND }} aria-hidden="true" />
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
</>
|
||||
)
|
||||
|
||||
if (!source) {
|
||||
|
|
|
|||
|
|
@ -32,15 +32,10 @@
|
|||
--color-action-hover: #001011;
|
||||
--color-surface: #fcfffd; /* page and cards */
|
||||
--color-tint: #c2f6ff; /* tinted sections and panels */
|
||||
--color-tint-soft: #e8fcfe; /* hover rows, faint panels */
|
||||
--color-tint-soft: #dfebd6; /* hover rows, faint panels */
|
||||
--color-danger: #b3261e;
|
||||
--color-danger-tint: #fdf3f2;
|
||||
|
||||
/* Cards: a step off the page so they read as sitting on it (white
|
||||
here; a touch of tint in dark mode, below). Derived rather than
|
||||
an admin token, so it follows the palette. With a shadow. */
|
||||
--color-raised: #ffffff;
|
||||
|
||||
/* Tailwind's shadows, tinted with the site's deep ink instead of
|
||||
black, so a card's shadow belongs to the page. */
|
||||
--shadow-2xs: 0 1px rgb(0 16 17 / 0.05);
|
||||
|
|
@ -74,10 +69,9 @@
|
|||
--color-action-hover: #004552;
|
||||
--color-surface: #001011;
|
||||
--color-tint: #004552;
|
||||
--color-tint-soft: #00252b;
|
||||
--color-tint-soft: #27371b;
|
||||
--color-danger: #ff8a80;
|
||||
--color-danger-tint: #3b1714;
|
||||
--color-raised: color-mix(in srgb, var(--color-tint) 35%, var(--color-surface));
|
||||
--accent-text-mix: 50%;
|
||||
color-scheme: dark;
|
||||
}
|
||||
|
|
@ -92,10 +86,9 @@
|
|||
--color-action-hover: #004552;
|
||||
--color-surface: #001011;
|
||||
--color-tint: #004552;
|
||||
--color-tint-soft: #00252b;
|
||||
--color-tint-soft: #27371b;
|
||||
--color-danger: #ff8a80;
|
||||
--color-danger-tint: #3b1714;
|
||||
--color-raised: color-mix(in srgb, var(--color-tint) 35%, var(--color-surface));
|
||||
--accent-text-mix: 50%;
|
||||
color-scheme: dark;
|
||||
}
|
||||
|
|
@ -175,7 +168,7 @@ h1, h2, h3, h4, h5, h6 {
|
|||
--color-brand: #008fa8;
|
||||
--color-surface: #fcfffd;
|
||||
--color-tint: #c2f6ff;
|
||||
--color-tint-soft: #e8fcfe;
|
||||
--color-tint-soft: #dfebd6;
|
||||
--color-danger: #b3261e;
|
||||
--color-danger-tint: #fdf3f2;
|
||||
--accent-text-mix: 100%;
|
||||
|
|
@ -202,12 +195,18 @@ iframe[src*="churchcenter"] {
|
|||
}
|
||||
|
||||
/* Corners, one rule for the site: none. Everything is square except
|
||||
buttons (the btn utility below, or var(--btn-radius) in plain CSS)
|
||||
and video players, which get a small radius, and things that are
|
||||
round by nature: dots, radio marks, the play button. */
|
||||
buttons, which get a superellipse (the btn utility below, or
|
||||
var(--btn-radius) with corner-shape in plain CSS), and things that
|
||||
are round by nature: dots and radio marks. Browsers without
|
||||
corner-shape draw the button corner as a small plain radius. */
|
||||
:root {
|
||||
--btn-radius: 0.5rem;
|
||||
}
|
||||
@supports (corner-shape: squircle) {
|
||||
:root {
|
||||
--btn-radius: 1.25rem;
|
||||
}
|
||||
}
|
||||
|
||||
/* A notice where content would be (an empty section, a form's
|
||||
note, "coming soon"): no box and no fill, just two thick brackets
|
||||
|
|
@ -239,26 +238,13 @@ iframe[src*="churchcenter"] {
|
|||
}
|
||||
}
|
||||
|
||||
/* A video's play button (VideoPlayer.tsx) waits for a hover or
|
||||
keyboard focus where the device can hover; on a touch screen it
|
||||
always shows, since there is nothing to hover with. */
|
||||
@media (hover: hover) {
|
||||
.video-play > span {
|
||||
opacity: 0;
|
||||
transition: opacity 160ms ease, transform 160ms ease;
|
||||
}
|
||||
.group:hover .video-play > span,
|
||||
.group:focus-visible .video-play > span {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Buttons, and links drawn as buttons: Poppins Bold, small rounded
|
||||
/* Buttons, and links drawn as buttons: Poppins Bold, superellipse
|
||||
corners. Color, size and border stay with each button. */
|
||||
@utility btn {
|
||||
font-family: var(--font-display);
|
||||
font-weight: 700;
|
||||
border-radius: var(--btn-radius);
|
||||
corner-shape: squircle;
|
||||
}
|
||||
|
||||
/* Scrollbar hide */
|
||||
|
|
|
|||
|
|
@ -95,30 +95,18 @@ export function paletteFill(name: string): { background: string; color: string }
|
|||
full autumn at 2000; every year before 2000 is fully turned. The
|
||||
green is the palette's, deepened so a leaf stands out on the
|
||||
page; the autumn shades are the one set of colors outside the
|
||||
palette, since the palette has none. A hex, so readableOn can
|
||||
pick text for something filled with it (a decade's tag). */
|
||||
const LEAF_GREEN = '#008f2f' // #00b83d deepened toward #00521b
|
||||
palette, since the palette has none. */
|
||||
const LEAF_GREEN = 'color-mix(in oklch, #00b83d 60%, #00521b)'
|
||||
const LEAF_GOLD = '#c98a0b'
|
||||
const LEAF_AUTUMN = '#b8461b'
|
||||
const LEAF_TURNED_BY = 2000
|
||||
|
||||
function mixHex(from: string, to: string, amount: number): string {
|
||||
const channel = (hex: string, i: number) => parseInt(hex.slice(i, i + 2), 16)
|
||||
return (
|
||||
'#' +
|
||||
[1, 3, 5]
|
||||
.map((i) => Math.round(channel(from, i) + (channel(to, i) - channel(from, i)) * amount))
|
||||
.map((value) => value.toString(16).padStart(2, '0'))
|
||||
.join('')
|
||||
)
|
||||
}
|
||||
|
||||
export function leafColor(year: number, thisYear = new Date().getFullYear()): string {
|
||||
if (year < LEAF_TURNED_BY) return LEAF_AUTUMN
|
||||
const span = Math.max(1, thisYear - LEAF_TURNED_BY)
|
||||
const turned = Math.min(1, Math.max(0, (thisYear - year) / span))
|
||||
// Green to gold over the first half of the span, gold to autumn over the second.
|
||||
return turned <= 0.5
|
||||
? mixHex(LEAF_GREEN, LEAF_GOLD, turned * 2)
|
||||
: mixHex(LEAF_GOLD, LEAF_AUTUMN, (turned - 0.5) * 2)
|
||||
? `color-mix(in oklch, ${LEAF_GOLD} ${Math.round(turned * 200)}%, ${LEAF_GREEN})`
|
||||
: `color-mix(in oklch, ${LEAF_AUTUMN} ${Math.round((turned - 0.5) * 200)}%, ${LEAF_GOLD})`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -131,10 +131,7 @@ export function videoThumbnail(raw?: string | null): string | null {
|
|||
if (!raw) return null
|
||||
try {
|
||||
const id = youtubeId(new URL(raw.trim()))
|
||||
// hq720 is a 16:9 frame; hqdefault (every video has one) is 4:3
|
||||
// with black bars baked in, so it's only the fallback (VideoPlayer
|
||||
// swaps to it if hq720 is missing, and crops it to 16:9).
|
||||
return id ? `https://i.ytimg.com/vi/${encodeURIComponent(id)}/hq720.jpg` : null
|
||||
return id ? `https://i.ytimg.com/vi/${encodeURIComponent(id)}/hqdefault.jpg` : null
|
||||
} catch {
|
||||
return null
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,10 +11,9 @@
|
|||
Forms, Tools, and Panel, which only exists for superadmins.
|
||||
|
||||
It asks for the wide admin column (adminWidth.tsx), like the
|
||||
editor, so the cards run three across on a wide screen. The
|
||||
blocks alternate between two palette colors (BLOCK_COLORS),
|
||||
tinting their cards and drawing their bars, so neighboring groups
|
||||
read apart at a glance.
|
||||
editor, so the cards run three across on a wide screen. Each
|
||||
block takes a color from the palette (GROUPS), tinting its
|
||||
cards and drawing its bar, so the groups read apart at a glance.
|
||||
|
||||
The right-hand panel is deliberately inert. Nothing here
|
||||
fetches, so the landing page can't be slow or half-broken on
|
||||
|
|
@ -47,7 +46,7 @@ function NavCard({ item, color }) {
|
|||
|
||||
return (
|
||||
<div
|
||||
className="group relative flex flex-col border-l-4 p-5 shadow-sm transition-shadow hover:shadow-md"
|
||||
className="group relative flex flex-col border-l-4 p-5 transition-colors hover:brightness-[0.97]"
|
||||
style={{ borderColor: color, background: tintOf(color) }}
|
||||
>
|
||||
<div className="flex items-baseline gap-3">
|
||||
|
|
@ -113,12 +112,13 @@ function PanelSection({ title, children }) {
|
|||
|
||||
/* The header's groups, in its order, each with its palette color.
|
||||
Panel is drawn separately below, since only superadmins get it. */
|
||||
const BLOCK_COLORS = [PALETTE.teal[0], PALETTE.green[0]];
|
||||
const GROUPS = [DATA_NAV, PAGES_NAV, FORMS_NAV, TOOLS_NAV].map((nav, index) => ({
|
||||
nav,
|
||||
color: BLOCK_COLORS[index % BLOCK_COLORS.length],
|
||||
}));
|
||||
const PANEL_COLOR = BLOCK_COLORS[GROUPS.length % BLOCK_COLORS.length];
|
||||
const GROUPS = [
|
||||
{ nav: DATA_NAV, color: PALETTE.teal[0] },
|
||||
{ nav: PAGES_NAV, color: PALETTE.green[0] },
|
||||
{ nav: FORMS_NAV, color: PALETTE.mint[2] },
|
||||
{ nav: TOOLS_NAV, color: PALETTE.ink[2] },
|
||||
];
|
||||
const PANEL_COLOR = PALETTE.ink[1];
|
||||
|
||||
const QUICK_ADD = [
|
||||
{ to: "/admin/events/new", label: "New event" },
|
||||
|
|
|
|||
|
|
@ -114,9 +114,6 @@ export default function AdminLayout() {
|
|||
// Whether the page below asked for extra room (the record editor,
|
||||
// for its section nav). setWide is a state setter, so it's stable.
|
||||
const [wide, setWide] = useState(false);
|
||||
// The header, its strip and the footer line up with the content,
|
||||
// however wide the page asked for.
|
||||
const column = wide ? "max-w-[82rem]" : "max-w-5xl";
|
||||
|
||||
useEffect(() => {
|
||||
// Sections only exist in the CMS. Home and Panel already say
|
||||
|
|
@ -136,9 +133,9 @@ export default function AdminLayout() {
|
|||
const wordmark = <span className="text-lg font-bold text-link">{areaTitle}</span>;
|
||||
|
||||
return (
|
||||
<div className="flex min-h-screen flex-col bg-surface">
|
||||
<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 ${column} flex-wrap items-center gap-x-8 gap-y-3 px-6 py-4`}>
|
||||
<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 ? (
|
||||
wordmark
|
||||
|
|
@ -186,8 +183,8 @@ export default function AdminLayout() {
|
|||
{/* Subnav. Only drawn where there is something to draw, so
|
||||
Events and People don't get an empty gray strip. */}
|
||||
{subnav.length > 0 && (
|
||||
<div className="border-t border-brand/10 bg-surface">
|
||||
<div className={`mx-auto flex ${column} flex-wrap gap-6 px-6 py-2.5 text-sm`}>
|
||||
<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
|
||||
key={child.to}
|
||||
|
|
@ -209,7 +206,7 @@ export default function AdminLayout() {
|
|||
{/* flex-1 rather than a fixed height: the footer sits at the
|
||||
bottom of a short page and below the content of a long one,
|
||||
without ever floating over it. */}
|
||||
<main className={`mx-auto w-full flex-1 px-6 py-10 ${column}`}>
|
||||
<main className={`mx-auto w-full flex-1 px-6 py-10 ${wide ? "max-w-[82rem]" : "max-w-5xl"}`}>
|
||||
<AdminTitleContext.Provider value={titleContext}>
|
||||
<AdminWidthContext.Provider value={setWide}>
|
||||
<Suspense fallback={null}>
|
||||
|
|
@ -220,7 +217,7 @@ export default function AdminLayout() {
|
|||
</main>
|
||||
|
||||
<footer className="border-t border-brand/15 bg-surface">
|
||||
<div className={`mx-auto flex ${column} items-center gap-4 px-6 py-3`}>
|
||||
<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={siteLogo} alt="NGU" className="h-6 w-auto" />
|
||||
</Link>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import ArrowLink from "../../components/ArrowLink.tsx";
|
|||
import OrgLogo from "../../components/OrgLogo.tsx";
|
||||
import { orgPath } from "../../lib/organizations.ts";
|
||||
import { AREAS, AREA_NAMES } from "../../data/mapGrid.ts";
|
||||
import { accentText, readableOn } from '../../lib/color.ts'
|
||||
import { withAlpha, accentText, readableOn } from '../../lib/color.ts'
|
||||
import { scrollBehavior } from "../../lib/motion.ts";
|
||||
|
||||
/* ═══════════════════════════════════════════════════════════════
|
||||
|
|
@ -163,11 +163,7 @@ function Tile({
|
|||
const active = ids.includes(selected) || ids.includes(hovered);
|
||||
const dimmed = selected && !ids.includes(selected);
|
||||
const clipId = `clip-${code}`;
|
||||
// Solid, never see-through: a tile with no groups, or one dimmed
|
||||
// while another region is picked, is its color mixed toward the
|
||||
// page's rather than faded, so the backdrop doesn't show through.
|
||||
const strength = dimmed ? (count ? 35 : 15) : count ? 100 : active ? 50 : 28;
|
||||
const tileFill = (color: string) => `color-mix(in srgb, ${color} ${strength}%, var(--color-surface))`;
|
||||
const opacity = count ? 1 : active ? 0.5 : 0.28;
|
||||
|
||||
// Clicking a shared tile cycles through its regions and then
|
||||
// clears, so every slice is reachable without a second control.
|
||||
|
|
@ -183,6 +179,8 @@ function Tile({
|
|||
onMouseEnter={() => setHovered(primary.regionId)}
|
||||
onMouseLeave={() => setHovered(null)}
|
||||
style={{ cursor: "pointer" }}
|
||||
opacity={dimmed ? 0.25 : 1}
|
||||
className="transition-opacity duration-200"
|
||||
>
|
||||
<title>
|
||||
{AREA_NAMES[code] || code}: {slices.map(s => s.name).join(" / ")}
|
||||
|
|
@ -190,7 +188,7 @@ function Tile({
|
|||
</title>
|
||||
|
||||
<clipPath id={clipId}>
|
||||
<rect x={x} y={y} width={width} height={size} />
|
||||
<rect x={x} y={y} width={width} height={size} rx={14} />
|
||||
</clipPath>
|
||||
|
||||
<g clipPath={`url(#${clipId})`}>
|
||||
|
|
@ -204,7 +202,8 @@ function Tile({
|
|||
y={top}
|
||||
width={width}
|
||||
height={h}
|
||||
style={{ fill: tileFill(colorOf(slice)) }}
|
||||
fill={colorOf(slice)}
|
||||
fillOpacity={opacity}
|
||||
className="transition-all duration-200"
|
||||
/>
|
||||
);
|
||||
|
|
@ -216,6 +215,7 @@ function Tile({
|
|||
y={y}
|
||||
width={width}
|
||||
height={size}
|
||||
rx={14}
|
||||
fill="none"
|
||||
stroke={active ? colorOf(primary) : "var(--color-surface)"}
|
||||
strokeOpacity={active ? 1 : 0.55}
|
||||
|
|
@ -230,7 +230,7 @@ function Tile({
|
|||
dominantBaseline="middle"
|
||||
fontSize={fontSize}
|
||||
fontWeight="800"
|
||||
fill={count && !dimmed ? "var(--color-surface)" : colorOf(primary)}
|
||||
fill={count ? "var(--color-surface)" : colorOf(primary)}
|
||||
style={{ pointerEvents: "none" }}
|
||||
>
|
||||
{label || code}
|
||||
|
|
@ -242,6 +242,7 @@ function Tile({
|
|||
cy={y + 14}
|
||||
r={7}
|
||||
fill="#ffffff"
|
||||
fillOpacity={0.9}
|
||||
style={{ pointerEvents: "none" }}
|
||||
/>
|
||||
)}
|
||||
|
|
@ -292,11 +293,10 @@ function LegendButton({ region, selected, setSelected, hovered, setHovered }) {
|
|||
aria-pressed={selected === region.id}
|
||||
className="flex items-center gap-2 py-1.5 px-3 text-sm font-bold transition-all duration-200"
|
||||
style={{
|
||||
// Solid like the tiles: another region picked dims this one
|
||||
// by color, not by letting the page show through.
|
||||
border: `1px solid ${selected && !on ? `color-mix(in srgb, ${colorOf(region)} 40%, var(--color-raised))` : colorOf(region)}`,
|
||||
background: on ? colorOf(region) : "var(--color-raised)",
|
||||
color: on ? readableOn(colorOf(region)) : selected ? "var(--color-muted)" : INK,
|
||||
border: `1px solid ${colorOf(region)}`,
|
||||
background: on ? colorOf(region) : "transparent",
|
||||
color: on ? readableOn(colorOf(region)) : INK,
|
||||
opacity: selected && selected !== region.id ? 0.45 : 1,
|
||||
}}
|
||||
>
|
||||
<span
|
||||
|
|
@ -473,7 +473,7 @@ function GroupCard({ group, color, open, onOpen }) {
|
|||
className="p-4 flex items-start gap-4 transition-all duration-200"
|
||||
style={{
|
||||
border: `1px solid ${color}`,
|
||||
background: open ? `color-mix(in srgb, ${color} 8%, var(--color-raised))` : "var(--color-raised)",
|
||||
background: open ? `${withAlpha(color, 8)}` : "transparent",
|
||||
}}
|
||||
>
|
||||
<OrgLogo org={group} color={color} />
|
||||
|
|
@ -541,7 +541,7 @@ function GroupDetail({ group, region, onClose }) {
|
|||
return (
|
||||
<div
|
||||
className="p-6 mb-6"
|
||||
style={{ border: `2px solid ${colorOf(region)}`, background: `color-mix(in srgb, ${colorOf(region)} 6%, var(--color-raised))` }}
|
||||
style={{ border: `2px solid ${colorOf(region)}`, background: `${withAlpha(colorOf(region), 6)}` }}
|
||||
>
|
||||
<div className="flex items-start gap-4">
|
||||
<OrgLogo org={group} color={colorOf(region)} size="h-20 w-20" />
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import {
|
|||
type SortDirection,
|
||||
} from '../../../lib/timeline.ts'
|
||||
import TimelineYear from './TimelineYear.tsx'
|
||||
import { leafColor, readableOn } from '../../../lib/color.ts'
|
||||
|
||||
type Props = {
|
||||
decade: GroupedDecade
|
||||
|
|
@ -32,7 +31,7 @@ export default function TimelineDecade({
|
|||
aria-labelledby={`site-tl-decade-${decade.decade}`}
|
||||
>
|
||||
<header className="site-tl__decadeHead">
|
||||
<span className="site-tl__decadeNum" style={decadeColors(decade.decade)} aria-hidden="true">
|
||||
<span className="site-tl__decadeNum" aria-hidden="true">
|
||||
{decadeLabel(decade.decade)}
|
||||
</span>
|
||||
<div>
|
||||
|
|
@ -64,11 +63,3 @@ export default function TimelineDecade({
|
|||
</section>
|
||||
)
|
||||
}
|
||||
|
||||
/* A decade's tag takes its leaves' color, the middle of the decade
|
||||
(or this year, for the one still running), with text that reads
|
||||
on it. */
|
||||
function decadeColors(decade: number) {
|
||||
const background = leafColor(Math.min(decade + 5, new Date().getFullYear()))
|
||||
return { background, color: readableOn(background) }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,33 +18,17 @@
|
|||
--tl-accent: var(--color-link);
|
||||
--tl-accent-soft: color-mix(in srgb, var(--tl-accent) 12%, transparent);
|
||||
|
||||
/* The rail is a branch: wood brown, the leaves on it. The one other
|
||||
color outside the palette, with the autumn leaves. */
|
||||
--tl-wood: #7a5236;
|
||||
|
||||
--tl-gutter: 5rem;
|
||||
--tl-rail-x: 1.75rem;
|
||||
--tl-rail-w: 3px;
|
||||
--tl-branch: 0.75rem;
|
||||
--tl-rail-w: 2px;
|
||||
|
||||
color: var(--tl-ink);
|
||||
}
|
||||
|
||||
/* Lighter wood on a dark page. */
|
||||
:root[data-theme="dark"] .site-tl {
|
||||
--tl-wood: #a8805a;
|
||||
}
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root:not([data-theme="light"]) .site-tl {
|
||||
--tl-wood: #a8805a;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
.site-tl {
|
||||
--tl-gutter: 3rem;
|
||||
--tl-rail-x: 1rem;
|
||||
--tl-branch: 0.4rem;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -63,13 +47,13 @@
|
|||
bottom: 0;
|
||||
left: var(--tl-rail-x);
|
||||
width: var(--tl-rail-w);
|
||||
background: var(--tl-wood);
|
||||
background: var(--tl-rail);
|
||||
}
|
||||
|
||||
.site-tl__decade--pre::before {
|
||||
background: none;
|
||||
border-left: var(--tl-rail-w) solid var(--tl-wood);
|
||||
opacity: 0.45;
|
||||
border-left: var(--tl-rail-w) solid var(--tl-rail);
|
||||
opacity: 0.35;
|
||||
}
|
||||
|
||||
/* Last decade fades out rather than stopping dead. */
|
||||
|
|
@ -96,16 +80,20 @@
|
|||
padding-block-start: 0.5rem;
|
||||
}
|
||||
|
||||
/* The numeral is a tag off the rail, like a branch: a short slanted
|
||||
stroke of the rail's wood runs up from the line to it, and the line
|
||||
carries on past. Its color is the decade's leaves', set inline
|
||||
(TimelineDecade.tsx). */
|
||||
/* The numeral is a tag on the rail: a dark block with white type,
|
||||
centered on the line, so the rail runs into it and out again.
|
||||
(It used to paint the page's color to hide the rail behind it,
|
||||
which showed as a white box once sections went transparent.) */
|
||||
.site-tl__decadeNum {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
justify-self: start;
|
||||
width: fit-content;
|
||||
margin-left: calc(var(--tl-rail-x) + var(--tl-rail-w) + var(--tl-branch));
|
||||
margin-left: calc(var(--tl-rail-x) + (var(--tl-rail-w) / 2));
|
||||
transform: translateX(-50%);
|
||||
padding: 0.5rem 0.3rem;
|
||||
background: var(--color-action);
|
||||
color: #ffffff;
|
||||
font-family: var(--font-display);
|
||||
font-size: 0.9375rem;
|
||||
font-weight: 700;
|
||||
|
|
@ -116,16 +104,9 @@
|
|||
text-orientation: sideways;
|
||||
}
|
||||
|
||||
.site-tl__decadeNum::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 55%;
|
||||
right: 100%;
|
||||
width: calc(var(--tl-branch) + 0.2rem);
|
||||
height: 3px;
|
||||
background: var(--tl-wood);
|
||||
transform-origin: right center;
|
||||
transform: rotate(28deg);
|
||||
.site-tl__decade--pre .site-tl__decadeNum {
|
||||
background: var(--color-tint);
|
||||
color: var(--color-muted);
|
||||
}
|
||||
|
||||
.site-tl__decadeTitle {
|
||||
|
|
@ -375,6 +356,9 @@ a.site-tl__entry:hover .site-tl__entryTitle {
|
|||
background: var(--tl-accent);
|
||||
}
|
||||
|
||||
.site-tl__kind--event {
|
||||
}
|
||||
|
||||
.site-tl__kind--award {
|
||||
clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
|
||||
}
|
||||
|
|
@ -394,14 +378,11 @@ a.site-tl__entry:hover .site-tl__entryTitle {
|
|||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
/* Solid, not a see-through tint: dark text on a tint on the
|
||||
page's colored backdrop was hard to read. */
|
||||
.site-tl__entry--featured {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
padding: 1rem 1.125rem;
|
||||
border-left: 2px solid var(--tl-accent);
|
||||
background: color-mix(in srgb, var(--tl-accent) 8%, var(--color-raised));
|
||||
box-shadow: var(--shadow-sm);
|
||||
background: var(--tl-accent-soft);
|
||||
}
|
||||
|
||||
.site-tl__entry--featured .site-tl__entryTitle {
|
||||
|
|
@ -416,7 +397,7 @@ a.site-tl__entry:hover .site-tl__entryTitle {
|
|||
}
|
||||
|
||||
a.site-tl__entry--featured:hover {
|
||||
background: color-mix(in srgb, var(--tl-accent) 16%, var(--color-raised));
|
||||
background: color-mix(in srgb, var(--tl-accent) 18%, transparent);
|
||||
}
|
||||
|
||||
/* --- Empty state ----------------------------------------------- */
|
||||
|
|
@ -448,6 +429,7 @@ a.site-tl__entry--featured:hover {
|
|||
padding: 0.375rem 0.75rem;
|
||||
border: 1px solid var(--tl-rail);
|
||||
border-radius: var(--btn-radius);
|
||||
corner-shape: squircle;
|
||||
background: none;
|
||||
color: var(--tl-muted);
|
||||
font: inherit;
|
||||
|
|
@ -503,8 +485,8 @@ a.site-tl__entry--featured:hover {
|
|||
top: 1.25rem;
|
||||
bottom: 0;
|
||||
left: var(--tl-rail-x);
|
||||
border-left: var(--tl-rail-w) solid var(--tl-wood);
|
||||
opacity: 0.45;
|
||||
border-left: var(--tl-rail-w) solid var(--tl-rail);
|
||||
opacity: 0.35;
|
||||
}
|
||||
|
||||
.site-tl__upcomingBtn {
|
||||
|
|
@ -538,7 +520,7 @@ a.site-tl__entry--featured:hover {
|
|||
place-items: center;
|
||||
margin-left: calc(var(--tl-rail-x) - 7px + (var(--tl-rail-w) / 2));
|
||||
font-size: 14px;
|
||||
color: #008f2f; /* the leaves' green (leafColor) */
|
||||
color: color-mix(in oklch, #00b83d 60%, #00521b);
|
||||
}
|
||||
|
||||
.site-tl__upcomingLabel {
|
||||
|
|
@ -604,7 +586,7 @@ a.site-tl__entry--featured:hover {
|
|||
.site-tl__roster--featured {
|
||||
padding: 0.5rem 1.125rem 1rem;
|
||||
border-left: 2px solid var(--tl-accent);
|
||||
background: color-mix(in srgb, var(--tl-accent) 8%, var(--color-raised));
|
||||
background: var(--tl-accent-soft);
|
||||
margin-top: -0.5rem;
|
||||
}
|
||||
|
||||
|
|
@ -633,6 +615,7 @@ a.site-tl__entry--featured:hover {
|
|||
.site-tl__personPhoto {
|
||||
width: 1.75rem;
|
||||
height: 1.75rem;
|
||||
border-radius: 50%;
|
||||
object-fit: cover;
|
||||
background: var(--tl-accent-soft);
|
||||
flex: none;
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ export default function Pathfinder({ id, title, blurb, paths }: PathfinderProps)
|
|||
<h2 className="font-display text-4xl font-bold 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 overflow-hidden shadow-md">
|
||||
<div className="mt-12 overflow-hidden">
|
||||
<div className="-mr-[4px] -mb-[4px]">
|
||||
<div
|
||||
role="tablist"
|
||||
|
|
@ -134,7 +134,7 @@ export default function Pathfinder({ id, title, blurb, paths }: PathfinderProps)
|
|||
tabIndex={on ? 0 : -1}
|
||||
onClick={() => setSelected(index)}
|
||||
className={`${cell} flex items-center gap-4 px-6 py-6 text-left transition-colors duration-300 ${
|
||||
on ? '' : 'bg-raised hover:bg-tint-soft'
|
||||
on ? '' : 'bg-surface hover:bg-tint-soft'
|
||||
}`}
|
||||
style={on ? { background: color, color: readableOn(color) } : undefined}
|
||||
>
|
||||
|
|
@ -173,7 +173,7 @@ export default function Pathfinder({ id, title, blurb, paths }: PathfinderProps)
|
|||
<HomeLink
|
||||
key={`${action.url}-${index}`}
|
||||
url={action.url}
|
||||
className={`${cell} hp-pop group flex flex-col bg-raised p-8 transition-colors duration-200 hover:bg-tint-soft`}
|
||||
className={`${cell} hp-pop group flex flex-col bg-surface p-8 transition-colors duration-200 hover:bg-tint-soft`}
|
||||
style={{ animationDelay: `${120 + index * 90}ms` }}
|
||||
>
|
||||
<span className="flex items-start gap-2 font-display text-lg font-bold text-ink">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue