Overhaul fixes: raised cards, balanced people rows, solid map, small button radius
- Cards sit on a raised surface (white, or a touch of tint in dark mode) with a shadow: featured cards, the connect block, people tiles. tint-soft is a faint teal again, not green. - Buttons: a small plain radius everywhere; no superellipse. - Video stills use YouTube's 16:9 frame (the 4:3 one cropped as a fallback), have small rounded corners, and show a round, centered play button on hover or focus (always on touch screens). - People tiles: rows balanced between 2 and 10 across, never ending on a lone tile where it can be helped. - Map tiles and region tags are solid, dimmed by color, not opacity. - Admin: white (surface) background, header and footer as wide as the content. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
582c65077d
commit
a397f3eac0
12 changed files with 165 additions and 61 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`.
|
- **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.
|
- **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.
|
- **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.
|
||||||
- **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.
|
- **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.
|
||||||
- **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.
|
- **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 `-`.
|
- **No em-dashes** (U+2014) anywhere: UI text, help text, comments, docs, commit messages. Use a colon, comma or parentheses. An empty table cell shows `-`.
|
||||||
- **Admin editor text:** blank select options read `Default: …` (what blank means), examples in help text start with `eg.`, and record ids are called "URL ID". Cut-off preview text uses `preview()` from `src/lib/text.ts`, which ends it with an ellipsis. See `docs/updating-data-in-code.md`.
|
- **Admin 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`.
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ export const THEME_DEFAULTS = {
|
||||||
"action-hover": ["#001011", "#004552"],
|
"action-hover": ["#001011", "#004552"],
|
||||||
surface: ["#fcfffd", "#001011"],
|
surface: ["#fcfffd", "#001011"],
|
||||||
tint: ["#c2f6ff", "#004552"],
|
tint: ["#c2f6ff", "#004552"],
|
||||||
"tint-soft": ["#dfebd6", "#27371b"],
|
"tint-soft": ["#e8fcfe", "#00252b"],
|
||||||
danger: ["#b3261e", "#ff8a80"],
|
danger: ["#b3261e", "#ff8a80"],
|
||||||
"danger-tint": ["#fdf3f2", "#3b1714"],
|
"danger-tint": ["#fdf3f2", "#3b1714"],
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@ function Card({ card, large }: { card: FeaturedCard; large: boolean }) {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<li
|
<li
|
||||||
className={`relative flex flex-col overflow-hidden border-r-4 border-b-4 ${RULE} bg-surface transition-colors hover:bg-tint-soft ${
|
className={`relative flex flex-col overflow-hidden border-r-4 border-b-4 ${RULE} bg-raised transition-colors hover:bg-tint-soft ${
|
||||||
large ? 'lg:col-span-2 lg:row-span-2' : ''
|
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[] }) {
|
export default function FeaturedCards({ cards }: { cards: FeaturedCard[] }) {
|
||||||
const leadLarge = cards.length >= 3
|
const leadLarge = cards.length >= 3
|
||||||
return (
|
return (
|
||||||
<div className="overflow-hidden">
|
<div className="overflow-hidden shadow-md">
|
||||||
<ul className="-mr-[4px] -mb-[4px] grid sm:grid-cols-2 lg:grid-cols-3">
|
<ul className="-mr-[4px] -mb-[4px] grid sm:grid-cols-2 lg:grid-cols-3">
|
||||||
{cards.map((card, index) => (
|
{cards.map((card, index) => (
|
||||||
<Card
|
<Card
|
||||||
|
|
|
||||||
|
|
@ -13,13 +13,14 @@
|
||||||
|
|
||||||
/* color */
|
/* color */
|
||||||
--pl-accent: var(--color-link);
|
--pl-accent: var(--color-link);
|
||||||
--pl-frame-bg: var(--color-surface);
|
--pl-frame-bg: var(--color-raised);
|
||||||
--pl-frame-edge: color-mix(in srgb, var(--color-brand) 45%, transparent);
|
--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-photo-bg: color-mix(in srgb, var(--color-muted) 15%, var(--color-surface));
|
||||||
--pl-ink: var(--color-ink);
|
--pl-ink: var(--color-ink);
|
||||||
--pl-muted: var(--color-muted);
|
--pl-muted: var(--color-muted);
|
||||||
--pl-rule: color-mix(in srgb, var(--color-brand) 35%, transparent);
|
--pl-rule: color-mix(in srgb, var(--color-brand) 35%, transparent);
|
||||||
|
|
||||||
|
position: relative;
|
||||||
container-type: inline-size;
|
container-type: inline-size;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
@ -93,6 +94,32 @@
|
||||||
list-style: none;
|
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 {
|
.pl[data-overflow="scroll"] .pl__row {
|
||||||
flex-wrap: nowrap;
|
flex-wrap: nowrap;
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
|
|
@ -142,6 +169,7 @@
|
||||||
padding: var(--pl-pad);
|
padding: var(--pl-pad);
|
||||||
padding-bottom: calc(var(--pl-pad) * 1.6);
|
padding-bottom: calc(var(--pl-pad) * 1.6);
|
||||||
background: var(--pl-frame-bg);
|
background: var(--pl-frame-bg);
|
||||||
|
box-shadow: var(--shadow-sm);
|
||||||
transition: transform 160ms ease, background-color 160ms ease;
|
transition: transform 160ms ease, background-color 160ms ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -332,7 +360,6 @@
|
||||||
height: 1.75rem;
|
height: 1.75rem;
|
||||||
border: 1px solid var(--pl-frame-edge);
|
border: 1px solid var(--pl-frame-edge);
|
||||||
border-radius: var(--btn-radius);
|
border-radius: var(--btn-radius);
|
||||||
corner-shape: squircle;
|
|
||||||
background: var(--color-surface);
|
background: var(--color-surface);
|
||||||
color: var(--pl-muted);
|
color: var(--pl-muted);
|
||||||
font-size: 1.1rem;
|
font-size: 1.1rem;
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,10 @@ import "./PeopleTiles.css";
|
||||||
* lines of name (and two of title), so a row's cards are one
|
* 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.
|
* 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
|
* 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
|
* (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
|
* the screen), and close on Escape, the tile again, or a click
|
||||||
|
|
@ -413,6 +417,7 @@ export function PeopleTilesView({
|
||||||
// the down arrow, and the details panel shows it whole.
|
// the down arrow, and the details panel shows it whole.
|
||||||
const [clipped, setClipped] = useState<ReadonlySet<string>>(() => new Set());
|
const [clipped, setClipped] = useState<ReadonlySet<string>>(() => new Set());
|
||||||
const rootRef = useRef<HTMLDivElement>(null);
|
const rootRef = useRef<HTMLDivElement>(null);
|
||||||
|
const probeRef = useRef<HTMLSpanElement>(null);
|
||||||
|
|
||||||
const resolvedSize: PeopleTilesSize = SIZE_FEATURES[size] ? size : "md";
|
const resolvedSize: PeopleTilesSize = SIZE_FEATURES[size] ? size : "md";
|
||||||
const features = SIZE_FEATURES[resolvedSize];
|
const features = SIZE_FEATURES[resolvedSize];
|
||||||
|
|
@ -433,6 +438,27 @@ export function PeopleTilesView({
|
||||||
.filter((group) => group.people.length > 0);
|
.filter((group) => group.people.length > 0);
|
||||||
}, [groups, people]);
|
}, [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.
|
// A click anywhere outside the list closes the panel.
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!openKey) return undefined;
|
if (!openKey) return undefined;
|
||||||
|
|
@ -509,6 +535,7 @@ export function PeopleTilesView({
|
||||||
onKeyDown={handleKeyDown}
|
onKeyDown={handleKeyDown}
|
||||||
{...rest}
|
{...rest}
|
||||||
>
|
>
|
||||||
|
<span ref={probeRef} className="pl__probe" aria-hidden="true" />
|
||||||
<div className="pl__groups">
|
<div className="pl__groups">
|
||||||
{resolvedGroups.map((group) => (
|
{resolvedGroups.map((group) => (
|
||||||
<section
|
<section
|
||||||
|
|
@ -526,7 +553,16 @@ export function PeopleTilesView({
|
||||||
</header>
|
</header>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<ul className="pl__row">
|
<ul
|
||||||
|
className="pl__row"
|
||||||
|
style={
|
||||||
|
room
|
||||||
|
? ({
|
||||||
|
"--pl-cols": balancedColumns(group.people.length, room.width, room.tile, room.gap),
|
||||||
|
} as CSSProperties)
|
||||||
|
: undefined
|
||||||
|
}
|
||||||
|
>
|
||||||
{group.people.map((person, index) => {
|
{group.people.map((person, index) => {
|
||||||
const key = keyFor(group, person, index);
|
const key = keyFor(group, person, index);
|
||||||
const expandable = (features.details && hasDetails(person)) || clipped.has(key);
|
const expandable = (features.details && hasDetails(person)) || clipped.has(key);
|
||||||
|
|
@ -797,6 +833,19 @@ function Chevron() {
|
||||||
|
|
||||||
/* ── Helpers ─────────────────────────────────────────────────── */
|
/* ── 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
|
/* A string id is a people slug; a numeric or missing one is a
|
||||||
hand-written entry with no page behind it. */
|
hand-written entry with no page behind it. */
|
||||||
function profileHref(person: Person): string | null {
|
function profileHref(person: Person): string | null {
|
||||||
|
|
|
||||||
|
|
@ -5,14 +5,17 @@
|
||||||
page loads no iframes until someone asks for one. Used by the
|
page loads no iframes until someone asks for one. Used by the
|
||||||
featured cards and the video content block.
|
featured cards and the video content block.
|
||||||
|
|
||||||
The still is the caller's image, else YouTube's own thumbnail,
|
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
|
(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
|
||||||
player (not https, or not a host it knows how to frame) still
|
player (not https, or not a host it knows how to frame) still
|
||||||
goes somewhere: the still becomes a link to it.
|
goes somewhere: the still becomes a link to it.
|
||||||
═══════════════════════════════════════════════════════════════ */
|
═══════════════════════════════════════════════════════════════ */
|
||||||
|
|
||||||
import { Play } from '@phosphor-icons/react'
|
import { Play } from '@phosphor-icons/react'
|
||||||
import { useState } from 'react'
|
import { useState, type SyntheticEvent } from 'react'
|
||||||
|
|
||||||
import HomeLink from '../pages/sections/home/HomeLink.tsx'
|
import HomeLink from '../pages/sections/home/HomeLink.tsx'
|
||||||
import { playingSource, videoSource, videoThumbnail } from '../lib/embeds.ts'
|
import { playingSource, videoSource, videoThumbnail } from '../lib/embeds.ts'
|
||||||
|
|
@ -37,36 +40,42 @@ export default function VideoPlayer({
|
||||||
if (playing && source) {
|
if (playing && source) {
|
||||||
const live = playingSource(source)
|
const live = playingSource(source)
|
||||||
return live.kind === 'file' ? (
|
return live.kind === 'file' ? (
|
||||||
<video src={live.src} controls autoPlay playsInline className={`aspect-video w-full bg-black ${className}`} />
|
<video src={live.src} controls autoPlay playsInline className={`aspect-video w-full rounded-md bg-black ${className}`} />
|
||||||
) : (
|
) : (
|
||||||
<iframe
|
<iframe
|
||||||
src={live.src}
|
src={live.src}
|
||||||
title={title || 'Video'}
|
title={title || 'Video'}
|
||||||
allow="autoplay; encrypted-media; picture-in-picture; fullscreen"
|
allow="autoplay; encrypted-media; picture-in-picture; fullscreen"
|
||||||
allowFullScreen
|
allowFullScreen
|
||||||
className={`aspect-video w-full border-0 bg-black ${className}`}
|
className={`aspect-video w-full rounded-md border-0 bg-black ${className}`}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const image = still ?? videoThumbnail(url)
|
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 = (
|
const face = (
|
||||||
<>
|
<span className={`relative block overflow-hidden rounded-md ${className}`}>
|
||||||
{image ? (
|
{image ? (
|
||||||
<img src={image} alt="" loading="lazy" className={`aspect-video w-full object-cover ${className}`} />
|
<img src={image} alt="" loading="lazy" onError={fallBack} className="block aspect-video w-full object-cover" />
|
||||||
) : (
|
) : (
|
||||||
<div className={`aspect-video w-full bg-[#004552] ${className}`} />
|
<span className="block aspect-video w-full bg-[#004552]" />
|
||||||
)}
|
)}
|
||||||
<span
|
<span
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
className="absolute inset-0 flex items-center justify-center bg-black/10 transition-colors group-hover:bg-black/25"
|
className="video-play absolute inset-0 flex items-center justify-center transition-colors group-hover:bg-black/20 group-focus-visible:bg-black/20"
|
||||||
>
|
>
|
||||||
<span className="flex h-16 w-16 items-center justify-center btn bg-white/90 shadow-lg transition-transform group-hover:scale-110">
|
<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="ml-1 h-7 w-7" weight="fill" style={{ color: BRAND }} aria-hidden="true" />
|
<Play className="h-7 w-7" weight="fill" style={{ color: BRAND }} aria-hidden="true" />
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</>
|
</span>
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!source) {
|
if (!source) {
|
||||||
|
|
|
||||||
|
|
@ -32,10 +32,15 @@
|
||||||
--color-action-hover: #001011;
|
--color-action-hover: #001011;
|
||||||
--color-surface: #fcfffd; /* page and cards */
|
--color-surface: #fcfffd; /* page and cards */
|
||||||
--color-tint: #c2f6ff; /* tinted sections and panels */
|
--color-tint: #c2f6ff; /* tinted sections and panels */
|
||||||
--color-tint-soft: #dfebd6; /* hover rows, faint panels */
|
--color-tint-soft: #e8fcfe; /* hover rows, faint panels */
|
||||||
--color-danger: #b3261e;
|
--color-danger: #b3261e;
|
||||||
--color-danger-tint: #fdf3f2;
|
--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
|
/* Tailwind's shadows, tinted with the site's deep ink instead of
|
||||||
black, so a card's shadow belongs to the page. */
|
black, so a card's shadow belongs to the page. */
|
||||||
--shadow-2xs: 0 1px rgb(0 16 17 / 0.05);
|
--shadow-2xs: 0 1px rgb(0 16 17 / 0.05);
|
||||||
|
|
@ -69,9 +74,10 @@
|
||||||
--color-action-hover: #004552;
|
--color-action-hover: #004552;
|
||||||
--color-surface: #001011;
|
--color-surface: #001011;
|
||||||
--color-tint: #004552;
|
--color-tint: #004552;
|
||||||
--color-tint-soft: #27371b;
|
--color-tint-soft: #00252b;
|
||||||
--color-danger: #ff8a80;
|
--color-danger: #ff8a80;
|
||||||
--color-danger-tint: #3b1714;
|
--color-danger-tint: #3b1714;
|
||||||
|
--color-raised: color-mix(in srgb, var(--color-tint) 35%, var(--color-surface));
|
||||||
--accent-text-mix: 50%;
|
--accent-text-mix: 50%;
|
||||||
color-scheme: dark;
|
color-scheme: dark;
|
||||||
}
|
}
|
||||||
|
|
@ -86,9 +92,10 @@
|
||||||
--color-action-hover: #004552;
|
--color-action-hover: #004552;
|
||||||
--color-surface: #001011;
|
--color-surface: #001011;
|
||||||
--color-tint: #004552;
|
--color-tint: #004552;
|
||||||
--color-tint-soft: #27371b;
|
--color-tint-soft: #00252b;
|
||||||
--color-danger: #ff8a80;
|
--color-danger: #ff8a80;
|
||||||
--color-danger-tint: #3b1714;
|
--color-danger-tint: #3b1714;
|
||||||
|
--color-raised: color-mix(in srgb, var(--color-tint) 35%, var(--color-surface));
|
||||||
--accent-text-mix: 50%;
|
--accent-text-mix: 50%;
|
||||||
color-scheme: dark;
|
color-scheme: dark;
|
||||||
}
|
}
|
||||||
|
|
@ -168,7 +175,7 @@ h1, h2, h3, h4, h5, h6 {
|
||||||
--color-brand: #008fa8;
|
--color-brand: #008fa8;
|
||||||
--color-surface: #fcfffd;
|
--color-surface: #fcfffd;
|
||||||
--color-tint: #c2f6ff;
|
--color-tint: #c2f6ff;
|
||||||
--color-tint-soft: #dfebd6;
|
--color-tint-soft: #e8fcfe;
|
||||||
--color-danger: #b3261e;
|
--color-danger: #b3261e;
|
||||||
--color-danger-tint: #fdf3f2;
|
--color-danger-tint: #fdf3f2;
|
||||||
--accent-text-mix: 100%;
|
--accent-text-mix: 100%;
|
||||||
|
|
@ -195,18 +202,12 @@ iframe[src*="churchcenter"] {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Corners, one rule for the site: none. Everything is square except
|
/* Corners, one rule for the site: none. Everything is square except
|
||||||
buttons, which get a superellipse (the btn utility below, or
|
buttons (the btn utility below, or var(--btn-radius) in plain CSS)
|
||||||
var(--btn-radius) with corner-shape in plain CSS), and things that
|
and video players, which get a small radius, and things that are
|
||||||
are round by nature: dots and radio marks. Browsers without
|
round by nature: dots, radio marks, the play button. */
|
||||||
corner-shape draw the button corner as a small plain radius. */
|
|
||||||
:root {
|
:root {
|
||||||
--btn-radius: 0.5rem;
|
--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
|
/* A notice where content would be (an empty section, a form's
|
||||||
note, "coming soon"): no box and no fill, just two thick brackets
|
note, "coming soon"): no box and no fill, just two thick brackets
|
||||||
|
|
@ -238,13 +239,26 @@ iframe[src*="churchcenter"] {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Buttons, and links drawn as buttons: Poppins Bold, superellipse
|
/* 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
|
||||||
corners. Color, size and border stay with each button. */
|
corners. Color, size and border stay with each button. */
|
||||||
@utility btn {
|
@utility btn {
|
||||||
font-family: var(--font-display);
|
font-family: var(--font-display);
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
border-radius: var(--btn-radius);
|
border-radius: var(--btn-radius);
|
||||||
corner-shape: squircle;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Scrollbar hide */
|
/* Scrollbar hide */
|
||||||
|
|
|
||||||
|
|
@ -131,7 +131,10 @@ export function videoThumbnail(raw?: string | null): string | null {
|
||||||
if (!raw) return null
|
if (!raw) return null
|
||||||
try {
|
try {
|
||||||
const id = youtubeId(new URL(raw.trim()))
|
const id = youtubeId(new URL(raw.trim()))
|
||||||
return id ? `https://i.ytimg.com/vi/${encodeURIComponent(id)}/hqdefault.jpg` : null
|
// 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
|
||||||
} catch {
|
} catch {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -114,6 +114,9 @@ export default function AdminLayout() {
|
||||||
// Whether the page below asked for extra room (the record editor,
|
// Whether the page below asked for extra room (the record editor,
|
||||||
// for its section nav). setWide is a state setter, so it's stable.
|
// for its section nav). setWide is a state setter, so it's stable.
|
||||||
const [wide, setWide] = useState(false);
|
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(() => {
|
useEffect(() => {
|
||||||
// Sections only exist in the CMS. Home and Panel already say
|
// Sections only exist in the CMS. Home and Panel already say
|
||||||
|
|
@ -133,9 +136,9 @@ export default function AdminLayout() {
|
||||||
const wordmark = <span className="text-lg font-bold text-link">{areaTitle}</span>;
|
const wordmark = <span className="text-lg font-bold text-link">{areaTitle}</span>;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex min-h-screen flex-col bg-tint-soft">
|
<div className="flex min-h-screen flex-col bg-surface">
|
||||||
<header className="border-b border-brand/20 bg-surface">
|
<header className="border-b border-brand/20 bg-surface">
|
||||||
<div className="mx-auto flex max-w-5xl flex-wrap items-center gap-x-8 gap-y-3 px-6 py-4">
|
<div className={`mx-auto flex ${column} flex-wrap items-center gap-x-8 gap-y-3 px-6 py-4`}>
|
||||||
{/* Already home, so nothing to link to. */}
|
{/* Already home, so nothing to link to. */}
|
||||||
{isHome ? (
|
{isHome ? (
|
||||||
wordmark
|
wordmark
|
||||||
|
|
@ -183,8 +186,8 @@ export default function AdminLayout() {
|
||||||
{/* Subnav. Only drawn where there is something to draw, so
|
{/* Subnav. Only drawn where there is something to draw, so
|
||||||
Events and People don't get an empty gray strip. */}
|
Events and People don't get an empty gray strip. */}
|
||||||
{subnav.length > 0 && (
|
{subnav.length > 0 && (
|
||||||
<div className="border-t border-brand/10 bg-tint-soft">
|
<div className="border-t border-brand/10 bg-surface">
|
||||||
<div className="mx-auto flex max-w-5xl flex-wrap gap-6 px-6 py-2.5 text-sm">
|
<div className={`mx-auto flex ${column} flex-wrap gap-6 px-6 py-2.5 text-sm`}>
|
||||||
{subnav.map((child) => (
|
{subnav.map((child) => (
|
||||||
<NavLink
|
<NavLink
|
||||||
key={child.to}
|
key={child.to}
|
||||||
|
|
@ -206,7 +209,7 @@ export default function AdminLayout() {
|
||||||
{/* flex-1 rather than a fixed height: the footer sits at the
|
{/* 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,
|
bottom of a short page and below the content of a long one,
|
||||||
without ever floating over it. */}
|
without ever floating over it. */}
|
||||||
<main className={`mx-auto w-full flex-1 px-6 py-10 ${wide ? "max-w-[82rem]" : "max-w-5xl"}`}>
|
<main className={`mx-auto w-full flex-1 px-6 py-10 ${column}`}>
|
||||||
<AdminTitleContext.Provider value={titleContext}>
|
<AdminTitleContext.Provider value={titleContext}>
|
||||||
<AdminWidthContext.Provider value={setWide}>
|
<AdminWidthContext.Provider value={setWide}>
|
||||||
<Suspense fallback={null}>
|
<Suspense fallback={null}>
|
||||||
|
|
@ -217,7 +220,7 @@ export default function AdminLayout() {
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<footer className="border-t border-brand/15 bg-surface">
|
<footer className="border-t border-brand/15 bg-surface">
|
||||||
<div className="mx-auto flex max-w-5xl items-center gap-4 px-6 py-3">
|
<div className={`mx-auto flex ${column} items-center gap-4 px-6 py-3`}>
|
||||||
<Link to={ADMIN_HOME} className="transition-opacity hover:opacity-70">
|
<Link to={ADMIN_HOME} className="transition-opacity hover:opacity-70">
|
||||||
<img src={siteLogo} alt="NGU" className="h-6 w-auto" />
|
<img src={siteLogo} alt="NGU" className="h-6 w-auto" />
|
||||||
</Link>
|
</Link>
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import ArrowLink from "../../components/ArrowLink.tsx";
|
||||||
import OrgLogo from "../../components/OrgLogo.tsx";
|
import OrgLogo from "../../components/OrgLogo.tsx";
|
||||||
import { orgPath } from "../../lib/organizations.ts";
|
import { orgPath } from "../../lib/organizations.ts";
|
||||||
import { AREAS, AREA_NAMES } from "../../data/mapGrid.ts";
|
import { AREAS, AREA_NAMES } from "../../data/mapGrid.ts";
|
||||||
import { withAlpha, accentText, readableOn } from '../../lib/color.ts'
|
import { accentText, readableOn } from '../../lib/color.ts'
|
||||||
import { scrollBehavior } from "../../lib/motion.ts";
|
import { scrollBehavior } from "../../lib/motion.ts";
|
||||||
|
|
||||||
/* ═══════════════════════════════════════════════════════════════
|
/* ═══════════════════════════════════════════════════════════════
|
||||||
|
|
@ -163,7 +163,11 @@ function Tile({
|
||||||
const active = ids.includes(selected) || ids.includes(hovered);
|
const active = ids.includes(selected) || ids.includes(hovered);
|
||||||
const dimmed = selected && !ids.includes(selected);
|
const dimmed = selected && !ids.includes(selected);
|
||||||
const clipId = `clip-${code}`;
|
const clipId = `clip-${code}`;
|
||||||
const opacity = count ? 1 : active ? 0.5 : 0.28;
|
// 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))`;
|
||||||
|
|
||||||
// Clicking a shared tile cycles through its regions and then
|
// Clicking a shared tile cycles through its regions and then
|
||||||
// clears, so every slice is reachable without a second control.
|
// clears, so every slice is reachable without a second control.
|
||||||
|
|
@ -179,8 +183,6 @@ function Tile({
|
||||||
onMouseEnter={() => setHovered(primary.regionId)}
|
onMouseEnter={() => setHovered(primary.regionId)}
|
||||||
onMouseLeave={() => setHovered(null)}
|
onMouseLeave={() => setHovered(null)}
|
||||||
style={{ cursor: "pointer" }}
|
style={{ cursor: "pointer" }}
|
||||||
opacity={dimmed ? 0.25 : 1}
|
|
||||||
className="transition-opacity duration-200"
|
|
||||||
>
|
>
|
||||||
<title>
|
<title>
|
||||||
{AREA_NAMES[code] || code}: {slices.map(s => s.name).join(" / ")}
|
{AREA_NAMES[code] || code}: {slices.map(s => s.name).join(" / ")}
|
||||||
|
|
@ -188,7 +190,7 @@ function Tile({
|
||||||
</title>
|
</title>
|
||||||
|
|
||||||
<clipPath id={clipId}>
|
<clipPath id={clipId}>
|
||||||
<rect x={x} y={y} width={width} height={size} rx={14} />
|
<rect x={x} y={y} width={width} height={size} />
|
||||||
</clipPath>
|
</clipPath>
|
||||||
|
|
||||||
<g clipPath={`url(#${clipId})`}>
|
<g clipPath={`url(#${clipId})`}>
|
||||||
|
|
@ -202,8 +204,7 @@ function Tile({
|
||||||
y={top}
|
y={top}
|
||||||
width={width}
|
width={width}
|
||||||
height={h}
|
height={h}
|
||||||
fill={colorOf(slice)}
|
style={{ fill: tileFill(colorOf(slice)) }}
|
||||||
fillOpacity={opacity}
|
|
||||||
className="transition-all duration-200"
|
className="transition-all duration-200"
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
@ -215,7 +216,6 @@ function Tile({
|
||||||
y={y}
|
y={y}
|
||||||
width={width}
|
width={width}
|
||||||
height={size}
|
height={size}
|
||||||
rx={14}
|
|
||||||
fill="none"
|
fill="none"
|
||||||
stroke={active ? colorOf(primary) : "var(--color-surface)"}
|
stroke={active ? colorOf(primary) : "var(--color-surface)"}
|
||||||
strokeOpacity={active ? 1 : 0.55}
|
strokeOpacity={active ? 1 : 0.55}
|
||||||
|
|
@ -230,7 +230,7 @@ function Tile({
|
||||||
dominantBaseline="middle"
|
dominantBaseline="middle"
|
||||||
fontSize={fontSize}
|
fontSize={fontSize}
|
||||||
fontWeight="800"
|
fontWeight="800"
|
||||||
fill={count ? "var(--color-surface)" : colorOf(primary)}
|
fill={count && !dimmed ? "var(--color-surface)" : colorOf(primary)}
|
||||||
style={{ pointerEvents: "none" }}
|
style={{ pointerEvents: "none" }}
|
||||||
>
|
>
|
||||||
{label || code}
|
{label || code}
|
||||||
|
|
@ -242,7 +242,6 @@ function Tile({
|
||||||
cy={y + 14}
|
cy={y + 14}
|
||||||
r={7}
|
r={7}
|
||||||
fill="#ffffff"
|
fill="#ffffff"
|
||||||
fillOpacity={0.9}
|
|
||||||
style={{ pointerEvents: "none" }}
|
style={{ pointerEvents: "none" }}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
@ -293,10 +292,11 @@ function LegendButton({ region, selected, setSelected, hovered, setHovered }) {
|
||||||
aria-pressed={selected === region.id}
|
aria-pressed={selected === region.id}
|
||||||
className="flex items-center gap-2 py-1.5 px-3 text-sm font-bold transition-all duration-200"
|
className="flex items-center gap-2 py-1.5 px-3 text-sm font-bold transition-all duration-200"
|
||||||
style={{
|
style={{
|
||||||
border: `1px solid ${colorOf(region)}`,
|
// Solid like the tiles: another region picked dims this one
|
||||||
background: on ? colorOf(region) : "transparent",
|
// by color, not by letting the page show through.
|
||||||
color: on ? readableOn(colorOf(region)) : INK,
|
border: `1px solid ${selected && !on ? `color-mix(in srgb, ${colorOf(region)} 40%, var(--color-raised))` : colorOf(region)}`,
|
||||||
opacity: selected && selected !== region.id ? 0.45 : 1,
|
background: on ? colorOf(region) : "var(--color-raised)",
|
||||||
|
color: on ? readableOn(colorOf(region)) : selected ? "var(--color-muted)" : INK,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
|
|
@ -473,7 +473,7 @@ function GroupCard({ group, color, open, onOpen }) {
|
||||||
className="p-4 flex items-start gap-4 transition-all duration-200"
|
className="p-4 flex items-start gap-4 transition-all duration-200"
|
||||||
style={{
|
style={{
|
||||||
border: `1px solid ${color}`,
|
border: `1px solid ${color}`,
|
||||||
background: open ? `${withAlpha(color, 8)}` : "transparent",
|
background: open ? `color-mix(in srgb, ${color} 8%, var(--color-raised))` : "var(--color-raised)",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<OrgLogo org={group} color={color} />
|
<OrgLogo org={group} color={color} />
|
||||||
|
|
@ -541,7 +541,7 @@ function GroupDetail({ group, region, onClose }) {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className="p-6 mb-6"
|
className="p-6 mb-6"
|
||||||
style={{ border: `2px solid ${colorOf(region)}`, background: `${withAlpha(colorOf(region), 6)}` }}
|
style={{ border: `2px solid ${colorOf(region)}`, background: `color-mix(in srgb, ${colorOf(region)} 6%, var(--color-raised))` }}
|
||||||
>
|
>
|
||||||
<div className="flex items-start gap-4">
|
<div className="flex items-start gap-4">
|
||||||
<OrgLogo org={group} color={colorOf(region)} size="h-20 w-20" />
|
<OrgLogo org={group} color={colorOf(region)} size="h-20 w-20" />
|
||||||
|
|
|
||||||
|
|
@ -429,7 +429,6 @@ a.site-tl__entry--featured:hover {
|
||||||
padding: 0.375rem 0.75rem;
|
padding: 0.375rem 0.75rem;
|
||||||
border: 1px solid var(--tl-rail);
|
border: 1px solid var(--tl-rail);
|
||||||
border-radius: var(--btn-radius);
|
border-radius: var(--btn-radius);
|
||||||
corner-shape: squircle;
|
|
||||||
background: none;
|
background: none;
|
||||||
color: var(--tl-muted);
|
color: var(--tl-muted);
|
||||||
font: inherit;
|
font: inherit;
|
||||||
|
|
|
||||||
|
|
@ -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>
|
<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>}
|
{blurb && <p className="mt-4 max-w-2xl text-lg text-muted">{blurb}</p>}
|
||||||
|
|
||||||
<div className="mt-12 overflow-hidden">
|
<div className="mt-12 overflow-hidden shadow-md">
|
||||||
<div className="-mr-[4px] -mb-[4px]">
|
<div className="-mr-[4px] -mb-[4px]">
|
||||||
<div
|
<div
|
||||||
role="tablist"
|
role="tablist"
|
||||||
|
|
@ -134,7 +134,7 @@ export default function Pathfinder({ id, title, blurb, paths }: PathfinderProps)
|
||||||
tabIndex={on ? 0 : -1}
|
tabIndex={on ? 0 : -1}
|
||||||
onClick={() => setSelected(index)}
|
onClick={() => setSelected(index)}
|
||||||
className={`${cell} flex items-center gap-4 px-6 py-6 text-left transition-colors duration-300 ${
|
className={`${cell} flex items-center gap-4 px-6 py-6 text-left transition-colors duration-300 ${
|
||||||
on ? '' : 'bg-surface hover:bg-tint-soft'
|
on ? '' : 'bg-raised hover:bg-tint-soft'
|
||||||
}`}
|
}`}
|
||||||
style={on ? { background: color, color: readableOn(color) } : undefined}
|
style={on ? { background: color, color: readableOn(color) } : undefined}
|
||||||
>
|
>
|
||||||
|
|
@ -173,7 +173,7 @@ export default function Pathfinder({ id, title, blurb, paths }: PathfinderProps)
|
||||||
<HomeLink
|
<HomeLink
|
||||||
key={`${action.url}-${index}`}
|
key={`${action.url}-${index}`}
|
||||||
url={action.url}
|
url={action.url}
|
||||||
className={`${cell} hp-pop group flex flex-col bg-surface p-8 transition-colors duration-200 hover:bg-tint-soft`}
|
className={`${cell} hp-pop group flex flex-col bg-raised p-8 transition-colors duration-200 hover:bg-tint-soft`}
|
||||||
style={{ animationDelay: `${120 + index * 90}ms` }}
|
style={{ animationDelay: `${120 + index * 90}ms` }}
|
||||||
>
|
>
|
||||||
<span className="flex items-start gap-2 font-display text-lg font-bold text-ink">
|
<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