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:
Zaldimmar 2026-09-30 22:42:20 -05:00
parent 2a926971f7
commit a907a47c24
8 changed files with 145 additions and 76 deletions

View file

@ -190,25 +190,25 @@ export function Card({
// past event) keeps its links out of the tab order too.
inert={!interactive}
>
<div className={`flex-1 flex flex-col ${compact ? "p-8" : "p-10"}`}>
<div className={`flex-1 flex flex-col ${compact ? "p-6 sm:p-8" : "p-6 sm:p-10"}`}>
{compact ? (
/* ── GRID CARD: layout driven by .ev-grid container queries ── */
<div className="ev-grid mb-2">
<Logo src={orgLogo} className="ev-org h-11 w-auto mb-4" />
<div className="ev-info">
{typeBadge}
<h3 className="text-3xl font-bold leading-tight">
<h3 className="text-2xl sm:text-3xl font-bold leading-tight [overflow-wrap:anywhere]">
<TitleLink ev={ev} linked={linked}>
{ev.title}
</TitleLink>
</h3>
{ev.theme && (
<p className="text-xl font-normal font-bold">"{ev.theme}"</p>
<p className="text-lg sm:text-xl font-bold">"{ev.theme}"</p>
)}
{ev.date_label && <p className="text-xl">{ev.date_label}</p>}
{schedule && <p className="text-xl">{schedule}</p>}
{ev.date_label && <p className="text-lg sm:text-xl">{ev.date_label}</p>}
{schedule && <p className="text-lg sm:text-xl">{schedule}</p>}
{ev.location_label && (
<p className="text-xl">{ev.location_label}</p>
<p className="text-lg sm:text-xl">{ev.location_label}</p>
)}
</div>
<Logo
@ -225,18 +225,18 @@ export function Card({
<div className="md:col-span-2">
<Logo src={orgLogo} className="h-15 w-auto mb-6" />
{typeBadge}
<h3 className="text-4xl font-bold">
<h3 className="text-2xl sm:text-4xl font-bold [overflow-wrap:anywhere]">
<TitleLink ev={ev} linked={linked}>
{ev.title}
</TitleLink>
</h3>
{ev.theme && (
<p className="text-2xl font-normal font-bold">"{ev.theme}"</p>
<p className="text-lg sm:text-2xl font-bold">"{ev.theme}"</p>
)}
{ev.date_label && <p className="text-2xl">{ev.date_label}</p>}
{schedule && <p className="text-2xl">{schedule}</p>}
{ev.date_label && <p className="text-lg sm:text-2xl">{ev.date_label}</p>}
{schedule && <p className="text-lg sm:text-2xl">{schedule}</p>}
{ev.location_label && (
<p className="text-2xl">{ev.location_label}</p>
<p className="text-lg sm:text-2xl">{ev.location_label}</p>
)}
</div>
<div className="md:col-span-1 flex items-center justify-end">
@ -496,6 +496,18 @@ export default function EventListCards({
const prev = () => setIndex(i => Math.max(0, i - 1));
const next = () => setIndex(i => Math.min(events.length - 1, i + 1));
// A sideways swipe of 40px or more on a touch screen turns the carousel.
const swipeFrom = useRef<number | null>(null);
const onTouchStart = (e: React.TouchEvent) => { swipeFrom.current = e.touches[0]?.clientX ?? null; };
const onTouchEnd = (e: React.TouchEvent) => {
const from = swipeFrom.current;
swipeFrom.current = null;
const to = e.changedTouches[0]?.clientX;
if (from == null || to == null || Math.abs(to - from) < 40) return;
if (to < from) next();
else prev();
};
// Arrows and dots follow the section accent, not the active card.
const arrowStyle = enabled => ({
border: `1px solid ${accent}`,
@ -616,7 +628,7 @@ export default function EventListCards({
<button
onClick={() => setShowPast(v => !v)}
aria-expanded={showPast}
className="flex items-center gap-2 py-2.5 px-6 font-bold transition-all duration-200 hover:scale-105"
className="btn flex items-center gap-2 py-2.5 px-6 transition-all duration-200 hover:scale-105"
style={{ border: `1px solid ${accent}`, color: accentText(accent) }}
>
{showPast
@ -631,7 +643,7 @@ export default function EventListCards({
) : (
/* ── CAROUSEL VIEW ── */
<>
<div className="relative mb-6">
<div className="relative mb-6" onTouchStart={onTouchStart} onTouchEnd={onTouchEnd}>
<div
className="overflow-hidden"
style={{ maskImage: EDGE_FADE, WebkitMaskImage: EDGE_FADE }}
@ -673,7 +685,7 @@ export default function EventListCards({
onClick={prev}
disabled={index === 0}
aria-label="Previous event"
className="absolute left-2 md:left-6 top-1/2 -translate-y-1/2 z-10 h-12 w-12 btn flex items-center justify-center text-2xl shadow-lg transition-all duration-200 hover:scale-110 disabled:hover:scale-100"
className="absolute left-2 md:left-6 top-1/2 -translate-y-1/2 z-10 h-12 w-12 btn hidden sm:flex items-center justify-center text-2xl shadow-lg transition-all duration-200 hover:scale-110 disabled:hover:scale-100"
style={arrowStyle(index > 0)}
>
<CaretLeft size={20} weight="bold" aria-hidden="true" />
@ -682,7 +694,7 @@ export default function EventListCards({
onClick={next}
disabled={index === events.length - 1}
aria-label="Next event"
className="absolute right-2 md:right-6 top-1/2 -translate-y-1/2 z-10 h-12 w-12 btn flex items-center justify-center text-2xl shadow-lg transition-all duration-200 hover:scale-110 disabled:hover:scale-100"
className="absolute right-2 md:right-6 top-1/2 -translate-y-1/2 z-10 h-12 w-12 btn hidden sm:flex items-center justify-center text-2xl shadow-lg transition-all duration-200 hover:scale-110 disabled:hover:scale-100"
style={arrowStyle(index < events.length - 1)}
>
<CaretRight size={20} weight="bold" aria-hidden="true" />
@ -692,20 +704,45 @@ export default function EventListCards({
</div>
{events.length > 1 && (
<div className="flex justify-center gap-2">
<div className="flex flex-wrap items-center justify-center">
{/* On a phone the side arrows would sit on the card's text,
so they move down here, beside the dots. */}
<button
onClick={prev}
disabled={index === 0}
aria-label="Previous event"
className="btn flex h-10 w-10 items-center justify-center sm:hidden"
style={arrowStyle(index > 0)}
>
<CaretLeft size={18} weight="bold" aria-hidden="true" />
</button>
{events.map((e, i) => (
<button
key={e.id}
onClick={() => setIndex(i)}
aria-label={`Go to ${e.title}`}
aria-current={i === index ? "true" : undefined}
className="h-2.5 rounded-full transition-all duration-200"
style={{
width: i === index ? "1.5rem" : "0.625rem",
background: i === index ? accent : withAlpha("var(--color-muted)", 40),
}}
/>
// A 40px tap target around the small dot it draws.
className="flex h-10 items-center px-1"
>
<span
className="block h-2.5 rounded-full transition-all duration-200"
style={{
width: i === index ? "1.5rem" : "0.625rem",
background: i === index ? accent : withAlpha("var(--color-muted)", 40),
}}
/>
</button>
))}
<button
onClick={next}
disabled={index === events.length - 1}
aria-label="Next event"
className="btn flex h-10 w-10 items-center justify-center sm:hidden"
style={arrowStyle(index < events.length - 1)}
>
<CaretRight size={18} weight="bold" aria-hidden="true" />
</button>
</div>
)}
</>

View file

@ -74,7 +74,9 @@ export default function HeroStage({ hero }: { hero: Hero | null }) {
return (
<section
id="hero"
className="relative isolate flex min-h-[92dvh] items-center overflow-hidden pt-24 pb-16"
className={`relative isolate flex min-h-[92dvh] items-center overflow-hidden pt-24 ${
backdrop === 'photos' ? 'pb-36 sm:pb-28' : 'pb-16'
}`}
style={{ background: DEEP }}
>
{backdrop === 'photos' ? (
@ -157,8 +159,8 @@ function Words({ hero, feature }: { hero: Hero; feature: HeroFeature }) {
about two lines. */}
<h1
className={`hp-rise font-display font-bold leading-[1.02] tracking-tight ${
beside ? 'text-4xl md:text-5xl' : 'text-5xl md:text-6xl lg:text-7xl'
}`}
beside ? 'text-4xl md:text-5xl' : 'text-4xl sm:text-5xl md:text-6xl lg:text-7xl'
} [overflow-wrap:anywhere]`}
style={{ animationDelay: '60ms' }}
>
{hero.headline}
@ -186,12 +188,13 @@ function Words({ hero, feature }: { hero: Hero; feature: HeroFeature }) {
Both set: one cell in two halves, the primary filled on the left
and the secondary clear on the right, split by a slash (the
filled half's slanted edge, which the clear half tucks under).
One set: that one alone, in its own style. */
On a phone the halves stack instead, filled on top, since two
labels side by side don't fit; the slash starts at sm (home.css,
.hp-split). One set: that one alone, in its own style. */
const SLANT = '1.75rem'
const PRIMARY_FILL = '#f0bd4f'
const PRIMARY_TEXT = '#001011'
const HALF = 'relative flex items-center gap-2 px-8 py-4 text-lg transition-colors duration-200 focus-visible:outline-offset-[-6px]'
const HALF = 'relative flex items-center justify-center gap-2 px-8 py-4 text-lg transition-colors duration-200 focus-visible:outline-offset-[-6px]'
type HeroLink = Hero['primary']
@ -200,24 +203,15 @@ function HeroActions({ primary, secondary }: { primary: HeroLink; secondary: Her
if (primary && secondary) {
return (
<div className="btn inline-flex max-w-full overflow-hidden border border-white/35">
<div className="hp-split btn max-w-full overflow-hidden border border-white/35">
<HomeLink
url={primary.url}
className={`${HALF} z-10 hover:brightness-95`}
style={{
background: PRIMARY_FILL,
color: PRIMARY_TEXT,
paddingRight: `calc(2rem + ${SLANT})`,
clipPath: `polygon(0 0, 100% 0, calc(100% - ${SLANT}) 100%, 0 100%)`,
}}
className={`hp-split__primary ${HALF} z-10 hover:brightness-95`}
style={{ background: PRIMARY_FILL, color: PRIMARY_TEXT }}
>
{primary.label}
</HomeLink>
<HomeLink
url={secondary.url}
className={`${HALF} text-white hover:bg-white/10`}
style={{ marginLeft: `-${SLANT}`, paddingLeft: `calc(2rem + ${SLANT})` }}
>
<HomeLink url={secondary.url} className={`hp-split__secondary ${HALF} text-white hover:bg-white/10`}>
{secondary.label} {arrow}
</HomeLink>
</div>
@ -323,8 +317,8 @@ function PhotoBackdrop({ slides, seconds }: { slides: HeroSlide[]; seconds: numb
)}
{slides.length > 1 && (
<div className="ml-auto flex items-center gap-3">
<div className="flex gap-1.5">
<div className="ml-auto flex flex-wrap items-center justify-end gap-x-1 gap-y-0">
<div className="flex flex-wrap justify-end">
{slides.map((slide, i) => (
<button
key={`${slide.media}-${i}`}
@ -332,15 +326,18 @@ function PhotoBackdrop({ slides, seconds }: { slides: HeroSlide[]; seconds: numb
onClick={() => setIndex(i)}
aria-label={`Show photo ${i + 1} of ${slides.length}`}
aria-current={i === index}
className="h-1.5 w-10 overflow-hidden bg-white/25"
// A 40px tap target around the thin bar it draws.
className="flex h-10 w-11 items-center px-0.5"
>
<span
// Re-keyed per index so the fill restarts on every change.
key={`${index}-${i}`}
className={`hp-progress block h-full bg-white ${
i < index ? 'hp-progress--done' : i === index ? 'hp-progress--run' : ''
} ${paused ? 'hp-progress--paused' : ''}`}
/>
<span className="block h-1.5 w-full overflow-hidden bg-white/25">
<span
// Re-keyed per index so the fill restarts on every change.
key={`${index}-${i}`}
className={`hp-progress block h-full bg-white ${
i < index ? 'hp-progress--done' : i === index ? 'hp-progress--run' : ''
} ${paused ? 'hp-progress--paused' : ''}`}
/>
</span>
</button>
))}
</div>
@ -348,7 +345,7 @@ function PhotoBackdrop({ slides, seconds }: { slides: HeroSlide[]; seconds: numb
type="button"
onClick={() => setPaused((p) => !p)}
aria-label={paused ? 'Play slideshow' : 'Pause slideshow'}
className="flex h-8 w-8 items-center justify-center btn border border-white/40 text-xs text-white hover:bg-white/10"
className="ml-2 flex h-10 w-10 items-center justify-center btn border border-white/40 text-xs text-white hover:bg-white/10"
>
{paused ? <Play size={14} weight="fill" aria-hidden="true" /> : <Pause size={14} weight="fill" aria-hidden="true" />}
</button>

View file

@ -19,6 +19,32 @@
to { opacity: 1; transform: none; }
}
/* ── Hero: the split button cell (HeroStage.tsx, HeroActions) ────
Stacked on a phone; from sm, side by side and cut by a slash:
the filled half's slanted right edge, the clear half tucked under
it by the slant's width. */
.hp-split {
display: flex;
flex-direction: column;
}
@media (min-width: 40rem) {
.hp-split {
display: inline-flex;
flex-direction: row;
--hp-slant: 1.75rem;
}
.hp-split__primary {
padding-right: calc(2rem + var(--hp-slant));
clip-path: polygon(0 0, 100% 0, calc(100% - var(--hp-slant)) 100%, 0 100%);
}
.hp-split__secondary {
margin-left: calc(var(--hp-slant) * -1);
padding-left: calc(2rem + var(--hp-slant));
}
}
/* ── Hero: photos ────────────────────────────────────────────── */
.hp-slide {