Design overhaul (v1.10.0 to v1.10.2) #18
3 changed files with 109 additions and 93 deletions
|
|
@ -16,6 +16,13 @@
|
|||
|
||||
A photo fills the picture area; a logo sits inside it on a soft
|
||||
panel instead, since cropping a logo to 16:9 cuts it off.
|
||||
|
||||
The grid is one continuous block: no gaps and no frame, only a
|
||||
colored rule between cards (each card's right and bottom border,
|
||||
with the grid pulled past its clipping wrapper so the outer ones
|
||||
fall outside). With three or more cards the first is the large
|
||||
one, two rows tall, and the next two stack beside it, so it no
|
||||
longer stretches its neighbor.
|
||||
═══════════════════════════════════════════════════════════════ */
|
||||
|
||||
|
||||
|
|
@ -71,16 +78,18 @@ function VideoPicture({ card }: { card: FeaturedCard }) {
|
|||
return <VideoPlayer url={card.url} still={own} title={card.title} />
|
||||
}
|
||||
|
||||
function Card({ card }: { card: FeaturedCard }) {
|
||||
const RULE = 'border-brand'
|
||||
|
||||
function Card({ card, large }: { card: FeaturedCard; large: boolean }) {
|
||||
const href = hrefFor(card)
|
||||
|
||||
const text = (
|
||||
<div className="flex flex-1 flex-col p-6">
|
||||
<div className={`flex flex-1 flex-col ${large ? 'p-8 md:p-10' : 'p-7'}`}>
|
||||
{card.eyebrow && (
|
||||
<p className="text-sm font-semibold text-link">{card.eyebrow}</p>
|
||||
)}
|
||||
{card.title && (
|
||||
<h3 className="mt-2 font-display text-xl font-bold leading-snug text-ink">
|
||||
<h3 className={`mt-2 font-display font-bold leading-snug text-ink ${large ? 'text-2xl md:text-3xl' : 'text-lg'}`}>
|
||||
{href ? (
|
||||
// Stretched over the whole card, so the picture and the
|
||||
// blurb are part of the click without nesting links.
|
||||
|
|
@ -95,12 +104,18 @@ function Card({ card }: { card: FeaturedCard }) {
|
|||
)}
|
||||
</h3>
|
||||
)}
|
||||
{card.blurb && <p className="mt-2 leading-relaxed text-muted">{card.blurb}</p>}
|
||||
{card.blurb && (
|
||||
<p className={`mt-2 leading-relaxed text-muted ${large ? '' : 'line-clamp-3 text-sm'}`}>{card.blurb}</p>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
|
||||
return (
|
||||
<li className="relative flex flex-col overflow-hidden border border-brand/15 bg-surface shadow-sm transition-shadow hover:shadow-lg">
|
||||
<li
|
||||
className={`relative flex flex-col overflow-hidden border-r-2 border-b-2 ${RULE} bg-surface transition-colors hover:bg-tint-soft ${
|
||||
large ? 'lg:col-span-2 lg:row-span-2' : ''
|
||||
}`}
|
||||
>
|
||||
{card.kind === 'video' ? (
|
||||
// Above the stretched link, which a video card doesn't have
|
||||
// anyway, so the play button always gets the click.
|
||||
|
|
@ -116,11 +131,18 @@ function Card({ card }: { card: FeaturedCard }) {
|
|||
}
|
||||
|
||||
export default function FeaturedCards({ cards }: { cards: FeaturedCard[] }) {
|
||||
const leadLarge = cards.length >= 3
|
||||
return (
|
||||
<ul className="grid gap-6 sm:grid-cols-2 lg:grid-cols-3 lg:[&>li:first-child]:col-span-2">
|
||||
<div className="overflow-hidden">
|
||||
<ul className="-mr-[2px] -mb-[2px] grid sm:grid-cols-2 lg:grid-cols-3">
|
||||
{cards.map((card, index) => (
|
||||
<Card key={`${card.kind}-${card.ref?.id ?? card.url}-${index}`} card={card} />
|
||||
<Card
|
||||
key={`${card.kind}-${card.ref?.id ?? card.url}-${index}`}
|
||||
card={card}
|
||||
large={leadLarge && index === 0}
|
||||
/>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,15 +53,29 @@ const headingClass = "text-white/90 text-sm font-semibold mb-4";
|
|||
|
||||
export default function Footer() {
|
||||
return (
|
||||
<footer className="py-16 px-6" style={{ background: "rgba(0, 47, 58, 0.92)" }}>
|
||||
<footer className="py-16 px-6" style={{ background: "#001011" }}>
|
||||
<div className="max-w-6xl mx-auto">
|
||||
<div className="grid grid-cols-1 md:grid-cols-12 gap-10 md:gap-8 mb-12">
|
||||
{/* Brand and details on top, the site map across the full
|
||||
width below them. */}
|
||||
<div className="md:col-span-9 text-center md:text-left">
|
||||
{/* The logo, and Give beside it. */}
|
||||
<div className="flex flex-wrap items-center justify-center gap-6 md:justify-start">
|
||||
<Link to="/" className="inline-block">
|
||||
<img src={siteLogo} alt="Next Generation of Unity" className="h-14 w-auto" />
|
||||
</Link>
|
||||
{giveAction && (
|
||||
<a
|
||||
href={giveAction.to}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="btn inline-block whitespace-nowrap px-6 py-2.5 text-sm text-white transition-transform duration-200 hover:-translate-y-0.5"
|
||||
style={{ background: "var(--color-action)" }}
|
||||
>
|
||||
{giveAction.label}
|
||||
</a>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<address className="mt-5 not-italic text-sm leading-relaxed text-white/60">
|
||||
{Organization_Details.street}
|
||||
|
|
@ -106,17 +120,6 @@ export default function Footer() {
|
|||
</ul>
|
||||
</nav>
|
||||
|
||||
{giveAction && (
|
||||
<a
|
||||
href={giveAction.to}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="inline-block mt-8 px-6 py-2.5 btn text-sm text-white whitespace-nowrap transition-all duration-200 hover:scale-105"
|
||||
style={{ background: "var(--color-action)" }}
|
||||
>
|
||||
{giveAction.label}
|
||||
</a>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Socials + get in touch */}
|
||||
|
|
|
|||
|
|
@ -13,14 +13,20 @@
|
|||
|
||||
Re-keying the panel on the selected index is what replays the
|
||||
entrance animation for each choice.
|
||||
|
||||
Drawn like the featured cards (FeaturedCards.tsx): one continuous
|
||||
block, no gaps and no frame, a colored rule between cells. The
|
||||
paths are a strip of cells along the top, the chosen one filled
|
||||
flat in its accent; under it, the path's blurb and its actions
|
||||
are cells of the same block.
|
||||
═══════════════════════════════════════════════════════════════ */
|
||||
|
||||
import { ArrowRight, ArrowUpRight, BookOpen, CalendarBlank, ChatCircle, Compass, GraduationCap, HandHeart, Heart, House, MapPin, MusicNotes, Sparkle, Star, Tent, UsersThree, type Icon } from '@phosphor-icons/react'
|
||||
import { useId, useRef, useState, type KeyboardEvent } from 'react'
|
||||
import { useId, useRef, useState, type CSSProperties, type KeyboardEvent } from 'react'
|
||||
|
||||
import HomeLink, { isExternal } from './HomeLink.tsx'
|
||||
import type { FrontPagePath } from '../../../lib/useFrontPage.ts'
|
||||
import { ACCENTS, withAlpha, accentText, readableOn } from '../../../lib/color.ts'
|
||||
import { ACCENTS, accentText, readableOn } from '../../../lib/color.ts'
|
||||
|
||||
type PathfinderProps = {
|
||||
id: string
|
||||
|
|
@ -90,21 +96,25 @@ export default function Pathfinder({ id, title, blurb, paths }: PathfinderProps)
|
|||
focus(moves[e.key])
|
||||
}
|
||||
|
||||
// A cell's rules: right and bottom, the outer ones clipped off
|
||||
// by the wrapper (the grid runs 2px past it).
|
||||
const cell = 'border-r-2 border-b-2 border-brand'
|
||||
const panelFill = `color-mix(in srgb, ${accent} 12%, var(--color-surface))`
|
||||
|
||||
return (
|
||||
<section id={id} className="py-24">
|
||||
<div className="mx-auto max-w-6xl px-6">
|
||||
<div className="grid gap-12 lg:grid-cols-12">
|
||||
<div className="lg:col-span-5">
|
||||
<h2 className="font-display text-4xl font-bold text-ink md:text-5xl">
|
||||
{title}
|
||||
</h2>
|
||||
{blurb && <p className="mt-4 text-lg text-muted">{blurb}</p>}
|
||||
<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">
|
||||
<div className="-mr-[2px] -mb-[2px]">
|
||||
<div
|
||||
role="tablist"
|
||||
aria-label={title}
|
||||
aria-orientation="vertical"
|
||||
className="mt-10 flex flex-col gap-3"
|
||||
aria-orientation="horizontal"
|
||||
className="grid sm:grid-cols-2 lg:grid-cols-[repeat(var(--paths),minmax(0,1fr))]"
|
||||
style={{ '--paths': Math.min(paths.length, 5) } as CSSProperties}
|
||||
onKeyDown={onKeyDown}
|
||||
>
|
||||
{paths.map((option, index) => {
|
||||
|
|
@ -123,64 +133,48 @@ export default function Pathfinder({ id, title, blurb, paths }: PathfinderProps)
|
|||
aria-controls={`${base}-panel`}
|
||||
tabIndex={on ? 0 : -1}
|
||||
onClick={() => setSelected(index)}
|
||||
className="group flex items-center gap-4 border-2 px-5 py-4 text-left transition-all duration-300"
|
||||
style={{
|
||||
borderColor: on ? color : 'rgba(19,139,160,0.12)',
|
||||
background: on ? `${withAlpha(color, 7)}` : 'var(--color-surface)',
|
||||
transform: on ? 'translateX(8px)' : undefined,
|
||||
}}
|
||||
className={`${cell} flex items-center gap-4 px-6 py-6 text-left transition-colors duration-300 ${
|
||||
on ? '' : 'bg-surface hover:bg-tint-soft'
|
||||
}`}
|
||||
style={on ? { background: color, color: readableOn(color) } : undefined}
|
||||
>
|
||||
<span
|
||||
className="flex h-12 w-12 shrink-0 items-center justify-center text-2xl transition-transform duration-300 group-hover:scale-110"
|
||||
style={{
|
||||
background: on ? color : `${withAlpha(color, 12)}`,
|
||||
color: on ? readableOn(color) : accentText(color),
|
||||
}}
|
||||
className="text-2xl"
|
||||
style={{ color: on ? readableOn(color) : accentText(color) }}
|
||||
aria-hidden="true"
|
||||
>
|
||||
<PathIcon value={option.icon} />
|
||||
</span>
|
||||
<span className="font-display text-xl font-bold" style={{ color: on ? accentText(color) : 'var(--color-ink)' }}>
|
||||
<span className="font-display text-xl font-bold" style={on ? undefined : { color: 'var(--color-ink)' }}>
|
||||
{option.label}
|
||||
</span>
|
||||
<span
|
||||
className="ml-auto text-xl transition-opacity"
|
||||
style={{ color, opacity: on ? 1 : 0 }}
|
||||
aria-hidden="true"
|
||||
>
|
||||
<ArrowRight size="1em" weight="bold" className="inline align-[-0.125em]" aria-hidden="true" />
|
||||
</span>
|
||||
</button>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
key={selected}
|
||||
id={`${base}-panel`}
|
||||
role="tabpanel"
|
||||
aria-labelledby={`${base}-tab-${selected}`}
|
||||
className="relative overflow-hidden p-8 md:p-10 lg:col-span-7"
|
||||
style={{ background: withAlpha(accent, 5) }}
|
||||
className="grid sm:grid-cols-2 lg:grid-cols-3"
|
||||
>
|
||||
|
||||
{path.blurb && (
|
||||
<p className="hp-pop relative max-w-md font-display text-2xl font-semibold leading-snug text-ink">
|
||||
<p
|
||||
className={`${cell} hp-pop p-8 font-display text-2xl leading-snug text-ink md:p-10`}
|
||||
style={{ background: panelFill }}
|
||||
>
|
||||
{path.blurb}
|
||||
</p>
|
||||
)}
|
||||
|
||||
<ul className="relative mt-8 grid gap-4 sm:grid-cols-2">
|
||||
{path.actions.map((action, index) => (
|
||||
<li
|
||||
key={`${action.url}-${index}`}
|
||||
className="hp-pop"
|
||||
style={{ animationDelay: `${120 + index * 90}ms` }}
|
||||
>
|
||||
<HomeLink
|
||||
key={`${action.url}-${index}`}
|
||||
url={action.url}
|
||||
className="group flex h-full flex-col bg-surface p-6 shadow-sm ring-1 ring-black/5 transition-all duration-300 hover:-translate-y-1 hover:shadow-xl"
|
||||
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">
|
||||
{action.label}
|
||||
|
|
@ -193,14 +187,11 @@ export default function Pathfinder({ id, title, blurb, paths }: PathfinderProps)
|
|||
</span>
|
||||
</span>
|
||||
{action.description && (
|
||||
<span className="mt-2 text-sm leading-relaxed text-muted">
|
||||
{action.description}
|
||||
</span>
|
||||
<span className="mt-2 text-sm leading-relaxed text-muted">{action.description}</span>
|
||||
)}
|
||||
</HomeLink>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue