Page updates: v1.10.3 to v1.10.6 #20
8 changed files with 145 additions and 76 deletions
|
|
@ -296,7 +296,7 @@ export default function Layout() {
|
||||||
{/* Mobile menu */}
|
{/* Mobile menu */}
|
||||||
{mobileMenuOpen && (
|
{mobileMenuOpen && (
|
||||||
<div
|
<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)" }}
|
style={{ background: "rgba(0, 58, 69, 0.97)" }}
|
||||||
role="dialog"
|
role="dialog"
|
||||||
aria-modal="true"
|
aria-modal="true"
|
||||||
|
|
@ -304,7 +304,7 @@ export default function Layout() {
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
ref={closeMenuRef}
|
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"
|
aria-label="Close menu"
|
||||||
onClick={() => setMobileMenuOpen(false)}
|
onClick={() => setMobileMenuOpen(false)}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -102,7 +102,7 @@ export default function PageShell({ title, intro, sections }: PageShellProps) {
|
||||||
{/* Page header */}
|
{/* Page header */}
|
||||||
<div className="pt-24 pb-12 px-6">
|
<div className="pt-24 pb-12 px-6">
|
||||||
<div className="max-w-6xl mx-auto">
|
<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}
|
{title}
|
||||||
</h1>
|
</h1>
|
||||||
{intro && <p className="mt-3 text-lg text-muted max-w-2xl">{intro}</p>}
|
{intro && <p className="mt-3 text-lg text-muted max-w-2xl">{intro}</p>}
|
||||||
|
|
|
||||||
|
|
@ -314,27 +314,17 @@
|
||||||
box-shadow: var(--shadow-lg);
|
box-shadow: var(--shadow-lg);
|
||||||
}
|
}
|
||||||
|
|
||||||
.pl__bio--anchored[data-align="end"] {
|
|
||||||
left: auto;
|
|
||||||
right: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.pl__bio--anchored::before {
|
.pl__bio--anchored::before {
|
||||||
content: '';
|
content: '';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: -11px;
|
top: -11px;
|
||||||
left: calc(var(--pl-w) / 2 - 8px);
|
left: var(--pl-notch, calc(var(--pl-w) / 2 - 8px));
|
||||||
width: 16px;
|
width: 16px;
|
||||||
height: 8px;
|
height: 8px;
|
||||||
background: var(--pl-accent);
|
background: var(--pl-accent);
|
||||||
clip-path: polygon(50% 0, 100% 100%, 0 100%);
|
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 {
|
.pl__bio {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
@ -366,8 +356,8 @@
|
||||||
|
|
||||||
.pl__close {
|
.pl__close {
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
width: 1.75rem;
|
width: 2.5rem;
|
||||||
height: 1.75rem;
|
height: 2.5rem;
|
||||||
border: 1px solid var(--pl-frame-edge);
|
border: 1px solid var(--pl-frame-edge);
|
||||||
border-radius: var(--btn-radius);
|
border-radius: var(--btn-radius);
|
||||||
background: var(--color-surface);
|
background: var(--color-surface);
|
||||||
|
|
|
||||||
|
|
@ -748,15 +748,23 @@ function DetailPanel({
|
||||||
onClose: () => void;
|
onClose: () => void;
|
||||||
}) {
|
}) {
|
||||||
const panelRef = useRef<HTMLDivElement>(null);
|
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
|
// Under the tile, starting at its left edge, slid left just enough
|
||||||
// off the right of the screen; then ending at its right edge.
|
// to stay 8px inside the screen on either side (a narrow phone
|
||||||
|
// included), with the notch kept under the tile's middle.
|
||||||
useLayoutEffect(() => {
|
useLayoutEffect(() => {
|
||||||
if (!anchored || !panelRef.current) return;
|
if (!anchored || !panelRef.current) return;
|
||||||
const tile = panelRef.current.parentElement?.getBoundingClientRect();
|
const tile = panelRef.current.parentElement?.getBoundingClientRect();
|
||||||
|
if (!tile) return;
|
||||||
const width = panelRef.current.offsetWidth;
|
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]);
|
}, [anchored]);
|
||||||
|
|
||||||
const org = resolveOrg(person.org);
|
const org = resolveOrg(person.org);
|
||||||
|
|
@ -770,10 +778,14 @@ function DetailPanel({
|
||||||
ref={panelRef}
|
ref={panelRef}
|
||||||
id={id}
|
id={id}
|
||||||
className={anchored ? "pl__bio pl__bio--anchored" : "pl__bio"}
|
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"
|
role="region"
|
||||||
aria-label={`About ${person.name}`}
|
aria-label={`About ${person.name}`}
|
||||||
style={tint ? ({ "--pl-accent": tint } as CSSProperties) : undefined}
|
|
||||||
>
|
>
|
||||||
<div className="pl__bio-head">
|
<div className="pl__bio-head">
|
||||||
<div>
|
<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
|
(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
|
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
|
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 {
|
export function balancedColumns(count: number, width: number, tile: number, gap: number): number {
|
||||||
if (count <= 1) return 1;
|
if (count <= 1) return 1;
|
||||||
const fit = Math.floor((width + gap) / (tile + gap));
|
const fit = Math.floor((width + gap) / (tile + gap));
|
||||||
const cols = Math.min(count, 10, Math.max(2, fit));
|
const cols = Math.min(count, 10, Math.max(2, fit));
|
||||||
if (count % cols !== 1) return cols;
|
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
|
/* A string id is a people slug; a numeric or missing one is a
|
||||||
|
|
|
||||||
|
|
@ -371,7 +371,10 @@ iframe[src*="churchcenter"] {
|
||||||
@container (max-width: 30rem) {
|
@container (max-width: 30rem) {
|
||||||
.ev-grid {
|
.ev-grid {
|
||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
|
/* The logo gets its own row: without one, grid-area: image made
|
||||||
|
an extra column beside the text. */
|
||||||
grid-template-areas:
|
grid-template-areas:
|
||||||
|
"image"
|
||||||
"org"
|
"org"
|
||||||
"info"
|
"info"
|
||||||
"desc";
|
"desc";
|
||||||
|
|
|
||||||
|
|
@ -190,25 +190,25 @@ export function Card({
|
||||||
// past event) keeps its links out of the tab order too.
|
// past event) keeps its links out of the tab order too.
|
||||||
inert={!interactive}
|
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 ? (
|
{compact ? (
|
||||||
/* ── GRID CARD: layout driven by .ev-grid container queries ── */
|
/* ── GRID CARD: layout driven by .ev-grid container queries ── */
|
||||||
<div className="ev-grid mb-2">
|
<div className="ev-grid mb-2">
|
||||||
<Logo src={orgLogo} className="ev-org h-11 w-auto mb-4" />
|
<Logo src={orgLogo} className="ev-org h-11 w-auto mb-4" />
|
||||||
<div className="ev-info">
|
<div className="ev-info">
|
||||||
{typeBadge}
|
{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}>
|
<TitleLink ev={ev} linked={linked}>
|
||||||
{ev.title}
|
{ev.title}
|
||||||
</TitleLink>
|
</TitleLink>
|
||||||
</h3>
|
</h3>
|
||||||
{ev.theme && (
|
{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>}
|
{ev.date_label && <p className="text-lg sm:text-xl">{ev.date_label}</p>}
|
||||||
{schedule && <p className="text-xl">{schedule}</p>}
|
{schedule && <p className="text-lg sm:text-xl">{schedule}</p>}
|
||||||
{ev.location_label && (
|
{ev.location_label && (
|
||||||
<p className="text-xl">{ev.location_label}</p>
|
<p className="text-lg sm:text-xl">{ev.location_label}</p>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<Logo
|
<Logo
|
||||||
|
|
@ -225,18 +225,18 @@ export function Card({
|
||||||
<div className="md:col-span-2">
|
<div className="md:col-span-2">
|
||||||
<Logo src={orgLogo} className="h-15 w-auto mb-6" />
|
<Logo src={orgLogo} className="h-15 w-auto mb-6" />
|
||||||
{typeBadge}
|
{typeBadge}
|
||||||
<h3 className="text-4xl font-bold">
|
<h3 className="text-2xl sm:text-4xl font-bold [overflow-wrap:anywhere]">
|
||||||
<TitleLink ev={ev} linked={linked}>
|
<TitleLink ev={ev} linked={linked}>
|
||||||
{ev.title}
|
{ev.title}
|
||||||
</TitleLink>
|
</TitleLink>
|
||||||
</h3>
|
</h3>
|
||||||
{ev.theme && (
|
{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>}
|
{ev.date_label && <p className="text-lg sm:text-2xl">{ev.date_label}</p>}
|
||||||
{schedule && <p className="text-2xl">{schedule}</p>}
|
{schedule && <p className="text-lg sm:text-2xl">{schedule}</p>}
|
||||||
{ev.location_label && (
|
{ev.location_label && (
|
||||||
<p className="text-2xl">{ev.location_label}</p>
|
<p className="text-lg sm:text-2xl">{ev.location_label}</p>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="md:col-span-1 flex items-center justify-end">
|
<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 prev = () => setIndex(i => Math.max(0, i - 1));
|
||||||
const next = () => setIndex(i => Math.min(events.length - 1, 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.
|
// Arrows and dots follow the section accent, not the active card.
|
||||||
const arrowStyle = enabled => ({
|
const arrowStyle = enabled => ({
|
||||||
border: `1px solid ${accent}`,
|
border: `1px solid ${accent}`,
|
||||||
|
|
@ -616,7 +628,7 @@ export default function EventListCards({
|
||||||
<button
|
<button
|
||||||
onClick={() => setShowPast(v => !v)}
|
onClick={() => setShowPast(v => !v)}
|
||||||
aria-expanded={showPast}
|
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) }}
|
style={{ border: `1px solid ${accent}`, color: accentText(accent) }}
|
||||||
>
|
>
|
||||||
{showPast
|
{showPast
|
||||||
|
|
@ -631,7 +643,7 @@ export default function EventListCards({
|
||||||
) : (
|
) : (
|
||||||
/* ── CAROUSEL VIEW ── */
|
/* ── CAROUSEL VIEW ── */
|
||||||
<>
|
<>
|
||||||
<div className="relative mb-6">
|
<div className="relative mb-6" onTouchStart={onTouchStart} onTouchEnd={onTouchEnd}>
|
||||||
<div
|
<div
|
||||||
className="overflow-hidden"
|
className="overflow-hidden"
|
||||||
style={{ maskImage: EDGE_FADE, WebkitMaskImage: EDGE_FADE }}
|
style={{ maskImage: EDGE_FADE, WebkitMaskImage: EDGE_FADE }}
|
||||||
|
|
@ -673,7 +685,7 @@ export default function EventListCards({
|
||||||
onClick={prev}
|
onClick={prev}
|
||||||
disabled={index === 0}
|
disabled={index === 0}
|
||||||
aria-label="Previous event"
|
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)}
|
style={arrowStyle(index > 0)}
|
||||||
>
|
>
|
||||||
<CaretLeft size={20} weight="bold" aria-hidden="true" />
|
<CaretLeft size={20} weight="bold" aria-hidden="true" />
|
||||||
|
|
@ -682,7 +694,7 @@ export default function EventListCards({
|
||||||
onClick={next}
|
onClick={next}
|
||||||
disabled={index === events.length - 1}
|
disabled={index === events.length - 1}
|
||||||
aria-label="Next event"
|
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)}
|
style={arrowStyle(index < events.length - 1)}
|
||||||
>
|
>
|
||||||
<CaretRight size={20} weight="bold" aria-hidden="true" />
|
<CaretRight size={20} weight="bold" aria-hidden="true" />
|
||||||
|
|
@ -692,20 +704,45 @@ export default function EventListCards({
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{events.length > 1 && (
|
{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) => (
|
{events.map((e, i) => (
|
||||||
<button
|
<button
|
||||||
key={e.id}
|
key={e.id}
|
||||||
onClick={() => setIndex(i)}
|
onClick={() => setIndex(i)}
|
||||||
aria-label={`Go to ${e.title}`}
|
aria-label={`Go to ${e.title}`}
|
||||||
aria-current={i === index ? "true" : undefined}
|
aria-current={i === index ? "true" : undefined}
|
||||||
className="h-2.5 rounded-full transition-all duration-200"
|
// 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={{
|
style={{
|
||||||
width: i === index ? "1.5rem" : "0.625rem",
|
width: i === index ? "1.5rem" : "0.625rem",
|
||||||
background: i === index ? accent : withAlpha("var(--color-muted)", 40),
|
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>
|
</div>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,9 @@ export default function HeroStage({ hero }: { hero: Hero | null }) {
|
||||||
return (
|
return (
|
||||||
<section
|
<section
|
||||||
id="hero"
|
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 }}
|
style={{ background: DEEP }}
|
||||||
>
|
>
|
||||||
{backdrop === 'photos' ? (
|
{backdrop === 'photos' ? (
|
||||||
|
|
@ -157,8 +159,8 @@ function Words({ hero, feature }: { hero: Hero; feature: HeroFeature }) {
|
||||||
about two lines. */}
|
about two lines. */}
|
||||||
<h1
|
<h1
|
||||||
className={`hp-rise font-display font-bold leading-[1.02] tracking-tight ${
|
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' }}
|
style={{ animationDelay: '60ms' }}
|
||||||
>
|
>
|
||||||
{hero.headline}
|
{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
|
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
|
and the secondary clear on the right, split by a slash (the
|
||||||
filled half's slanted edge, which the clear half tucks under).
|
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_FILL = '#f0bd4f'
|
||||||
const PRIMARY_TEXT = '#001011'
|
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']
|
type HeroLink = Hero['primary']
|
||||||
|
|
||||||
|
|
@ -200,24 +203,15 @@ function HeroActions({ primary, secondary }: { primary: HeroLink; secondary: Her
|
||||||
|
|
||||||
if (primary && secondary) {
|
if (primary && secondary) {
|
||||||
return (
|
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
|
<HomeLink
|
||||||
url={primary.url}
|
url={primary.url}
|
||||||
className={`${HALF} z-10 hover:brightness-95`}
|
className={`hp-split__primary ${HALF} z-10 hover:brightness-95`}
|
||||||
style={{
|
style={{ background: PRIMARY_FILL, color: PRIMARY_TEXT }}
|
||||||
background: PRIMARY_FILL,
|
|
||||||
color: PRIMARY_TEXT,
|
|
||||||
paddingRight: `calc(2rem + ${SLANT})`,
|
|
||||||
clipPath: `polygon(0 0, 100% 0, calc(100% - ${SLANT}) 100%, 0 100%)`,
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
{primary.label}
|
{primary.label}
|
||||||
</HomeLink>
|
</HomeLink>
|
||||||
<HomeLink
|
<HomeLink url={secondary.url} className={`hp-split__secondary ${HALF} text-white hover:bg-white/10`}>
|
||||||
url={secondary.url}
|
|
||||||
className={`${HALF} text-white hover:bg-white/10`}
|
|
||||||
style={{ marginLeft: `-${SLANT}`, paddingLeft: `calc(2rem + ${SLANT})` }}
|
|
||||||
>
|
|
||||||
{secondary.label} {arrow}
|
{secondary.label} {arrow}
|
||||||
</HomeLink>
|
</HomeLink>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -323,8 +317,8 @@ function PhotoBackdrop({ slides, seconds }: { slides: HeroSlide[]; seconds: numb
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{slides.length > 1 && (
|
{slides.length > 1 && (
|
||||||
<div className="ml-auto flex items-center gap-3">
|
<div className="ml-auto flex flex-wrap items-center justify-end gap-x-1 gap-y-0">
|
||||||
<div className="flex gap-1.5">
|
<div className="flex flex-wrap justify-end">
|
||||||
{slides.map((slide, i) => (
|
{slides.map((slide, i) => (
|
||||||
<button
|
<button
|
||||||
key={`${slide.media}-${i}`}
|
key={`${slide.media}-${i}`}
|
||||||
|
|
@ -332,8 +326,10 @@ function PhotoBackdrop({ slides, seconds }: { slides: HeroSlide[]; seconds: numb
|
||||||
onClick={() => setIndex(i)}
|
onClick={() => setIndex(i)}
|
||||||
aria-label={`Show photo ${i + 1} of ${slides.length}`}
|
aria-label={`Show photo ${i + 1} of ${slides.length}`}
|
||||||
aria-current={i === index}
|
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 className="block h-1.5 w-full overflow-hidden bg-white/25">
|
||||||
<span
|
<span
|
||||||
// Re-keyed per index so the fill restarts on every change.
|
// Re-keyed per index so the fill restarts on every change.
|
||||||
key={`${index}-${i}`}
|
key={`${index}-${i}`}
|
||||||
|
|
@ -341,6 +337,7 @@ function PhotoBackdrop({ slides, seconds }: { slides: HeroSlide[]; seconds: numb
|
||||||
i < index ? 'hp-progress--done' : i === index ? 'hp-progress--run' : ''
|
i < index ? 'hp-progress--done' : i === index ? 'hp-progress--run' : ''
|
||||||
} ${paused ? 'hp-progress--paused' : ''}`}
|
} ${paused ? 'hp-progress--paused' : ''}`}
|
||||||
/>
|
/>
|
||||||
|
</span>
|
||||||
</button>
|
</button>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -348,7 +345,7 @@ function PhotoBackdrop({ slides, seconds }: { slides: HeroSlide[]; seconds: numb
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => setPaused((p) => !p)}
|
onClick={() => setPaused((p) => !p)}
|
||||||
aria-label={paused ? 'Play slideshow' : 'Pause slideshow'}
|
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" />}
|
{paused ? <Play size={14} weight="fill" aria-hidden="true" /> : <Pause size={14} weight="fill" aria-hidden="true" />}
|
||||||
</button>
|
</button>
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,32 @@
|
||||||
to { opacity: 1; transform: none; }
|
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 ────────────────────────────────────────────── */
|
/* ── Hero: photos ────────────────────────────────────────────── */
|
||||||
|
|
||||||
.hp-slide {
|
.hp-slide {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue