Mobile: menu, page titles, hero, retreat carousel, people tiles
- The mobile menu centers when it fits and starts at the top when it's taller than the screen (safe center), so its top is reachable; its close button is a 44px target. - Page titles and the hero headline start a size smaller on phones and break long words instead of being cut off. - Hero: the split buttons stack on a phone (the slash from sm); the slide dots and pause button are 40px targets and wrap; photo heroes leave room for the caption above the buttons. - Retreat carousel: phone-sized padding and type; on a phone the arrows sit beside the dots instead of over the text, dots are 40px targets, and a swipe turns it. The narrow event card layout gives the logo its own row (it had made a stray column). - People tiles: the details panel slides to stay on screen with its notch under the tile; a third column only when tiles keep 60% of their width; a 40px close button. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
2a926971f7
commit
a907a47c24
8 changed files with 145 additions and 76 deletions
|
|
@ -296,7 +296,7 @@ export default function Layout() {
|
|||
{/* Mobile menu */}
|
||||
{mobileMenuOpen && (
|
||||
<div
|
||||
className="fixed inset-0 z-[60] flex flex-col items-center justify-center overflow-y-auto py-16"
|
||||
className="fixed inset-0 z-[60] flex flex-col items-center [justify-content:safe_center] overflow-y-auto py-16"
|
||||
style={{ background: "rgba(0, 58, 69, 0.97)" }}
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
|
|
@ -304,7 +304,7 @@ export default function Layout() {
|
|||
>
|
||||
<button
|
||||
ref={closeMenuRef}
|
||||
className="absolute top-5 right-6 text-white text-3xl"
|
||||
className="absolute top-3 right-4 p-2 text-white text-3xl"
|
||||
aria-label="Close menu"
|
||||
onClick={() => setMobileMenuOpen(false)}
|
||||
>
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ export default function PageShell({ title, intro, sections }: PageShellProps) {
|
|||
{/* Page header */}
|
||||
<div className="pt-24 pb-12 px-6">
|
||||
<div className="max-w-6xl mx-auto">
|
||||
<h1 className="text-5xl md:text-6xl font-bold" style={{ color: accentText(BRAND) }}>
|
||||
<h1 className="text-4xl sm:text-5xl md:text-6xl font-bold [overflow-wrap:anywhere] hyphens-auto" style={{ color: accentText(BRAND) }}>
|
||||
{title}
|
||||
</h1>
|
||||
{intro && <p className="mt-3 text-lg text-muted max-w-2xl">{intro}</p>}
|
||||
|
|
|
|||
|
|
@ -314,27 +314,17 @@
|
|||
box-shadow: var(--shadow-lg);
|
||||
}
|
||||
|
||||
.pl__bio--anchored[data-align="end"] {
|
||||
left: auto;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.pl__bio--anchored::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: -11px;
|
||||
left: calc(var(--pl-w) / 2 - 8px);
|
||||
left: var(--pl-notch, calc(var(--pl-w) / 2 - 8px));
|
||||
width: 16px;
|
||||
height: 8px;
|
||||
background: var(--pl-accent);
|
||||
clip-path: polygon(50% 0, 100% 100%, 0 100%);
|
||||
}
|
||||
|
||||
.pl__bio--anchored[data-align="end"]::before {
|
||||
left: auto;
|
||||
right: calc(var(--pl-w) / 2 - 8px);
|
||||
}
|
||||
|
||||
.pl__bio {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
|
@ -366,8 +356,8 @@
|
|||
|
||||
.pl__close {
|
||||
flex: 0 0 auto;
|
||||
width: 1.75rem;
|
||||
height: 1.75rem;
|
||||
width: 2.5rem;
|
||||
height: 2.5rem;
|
||||
border: 1px solid var(--pl-frame-edge);
|
||||
border-radius: var(--btn-radius);
|
||||
background: var(--color-surface);
|
||||
|
|
|
|||
|
|
@ -748,15 +748,23 @@ function DetailPanel({
|
|||
onClose: () => void;
|
||||
}) {
|
||||
const panelRef = useRef<HTMLDivElement>(null);
|
||||
const [alignEnd, setAlignEnd] = useState(false);
|
||||
// How far the panel shifts from the tile's left edge, and where the
|
||||
// notch sits on it, in px.
|
||||
const [place, setPlace] = useState<{ shift: number; notch: number } | null>(null);
|
||||
|
||||
// Under the tile, starting at its left edge unless that would run
|
||||
// off the right of the screen; then ending at its right edge.
|
||||
// Under the tile, starting at its left edge, slid left just enough
|
||||
// to stay 8px inside the screen on either side (a narrow phone
|
||||
// included), with the notch kept under the tile's middle.
|
||||
useLayoutEffect(() => {
|
||||
if (!anchored || !panelRef.current) return;
|
||||
const tile = panelRef.current.parentElement?.getBoundingClientRect();
|
||||
if (!tile) return;
|
||||
const width = panelRef.current.offsetWidth;
|
||||
if (tile) setAlignEnd(tile.left + width > document.documentElement.clientWidth - 16);
|
||||
const screen = document.documentElement.clientWidth;
|
||||
let shift = Math.min(0, screen - 8 - (tile.left + width));
|
||||
shift = Math.max(shift, 8 - tile.left);
|
||||
const notch = Math.min(Math.max(tile.width / 2 - shift - 8, 8), width - 24);
|
||||
setPlace({ shift, notch });
|
||||
}, [anchored]);
|
||||
|
||||
const org = resolveOrg(person.org);
|
||||
|
|
@ -770,10 +778,14 @@ function DetailPanel({
|
|||
ref={panelRef}
|
||||
id={id}
|
||||
className={anchored ? "pl__bio pl__bio--anchored" : "pl__bio"}
|
||||
data-align={alignEnd ? "end" : "start"}
|
||||
style={
|
||||
{
|
||||
...(tint ? { "--pl-accent": tint } : null),
|
||||
...(place ? { left: `${place.shift}px`, "--pl-notch": `${place.notch}px` } : null),
|
||||
} as CSSProperties
|
||||
}
|
||||
role="region"
|
||||
aria-label={`About ${person.name}`}
|
||||
style={tint ? ({ "--pl-accent": tint } as CSSProperties) : undefined}
|
||||
>
|
||||
<div className="pl__bio-head">
|
||||
<div>
|
||||
|
|
@ -865,13 +877,17 @@ export function fitsOneRow(counts: number[], width: number, tile: number, gap: n
|
|||
(never more than there are). If that would leave one tile alone on
|
||||
the last row, one fewer across, so the last row has two: 7 that fit
|
||||
6 across go 5 and 2. With only 2 across, a third, narrower column
|
||||
takes the odd one instead (3 tiles on a phone go 3 across). */
|
||||
takes the odd one instead, if tiles stay at least 60% of full
|
||||
width; on a narrow phone a lone last tile beats three unreadable
|
||||
ones. */
|
||||
export function balancedColumns(count: number, width: number, tile: number, gap: number): number {
|
||||
if (count <= 1) return 1;
|
||||
const fit = Math.floor((width + gap) / (tile + gap));
|
||||
const cols = Math.min(count, 10, Math.max(2, fit));
|
||||
if (count % cols !== 1) return cols;
|
||||
return cols > 2 ? cols - 1 : Math.min(count, 3);
|
||||
if (cols > 2) return cols - 1;
|
||||
const third = (width - 2 * gap) / 3;
|
||||
return count >= 3 && third >= tile * 0.6 ? 3 : 2;
|
||||
}
|
||||
|
||||
/* A string id is a people slug; a numeric or missing one is a
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue