diff --git a/apps/admin/src/components/photos/BatchDefaultsFields.tsx b/apps/admin/src/components/photos/BatchDefaultsFields.tsx index a1b6b9c5..e296eeff 100644 --- a/apps/admin/src/components/photos/BatchDefaultsFields.tsx +++ b/apps/admin/src/components/photos/BatchDefaultsFields.tsx @@ -80,6 +80,16 @@ export function BatchDefaultsFields({ defaults, events, speakers, onChange }: Ba onChange={(isTeamPhoto) => onChange({ ...defaults, isTeamPhoto })} /> +
+

Event's page

+ onChange({ ...defaults, onEventPage })} + /> +
); } diff --git a/apps/admin/src/components/photos/BulkBar.tsx b/apps/admin/src/components/photos/BulkBar.tsx index 95405e62..89ada42b 100644 --- a/apps/admin/src/components/photos/BulkBar.tsx +++ b/apps/admin/src/components/photos/BulkBar.tsx @@ -1,11 +1,12 @@ /** * What to do with the selected photos, all at once: a short row of actions floating over the wall, small enough - * to leave the photos in view on a phone. Event, Guest, Describe and Credits each open a sheet with their one - * field; Delete asks first; with one photo selected, Edit opens it. The bar says what changed. + * to leave the photos in view on a phone. Event, Guest, Describe, Credits and On page each open a sheet with their + * one field; Delete asks first; with one photo selected, Edit opens it. The bar says what changed. */ import { CalendarDays, Clapperboard, + Globe, PenLine, Text, Trash2, @@ -30,9 +31,10 @@ const SHEET_ACTIONS: ReadonlyArray<{ action: BulkAction; label: string; icon: Lu { action: 'guest', label: 'Guest', icon: UserPlus }, { action: 'describe', label: 'Describe', icon: Text }, { action: 'credits', label: 'Credits', icon: Clapperboard }, + { action: 'page', label: 'On page', icon: Globe }, ]; -// Each action is an icon over its name, so five fit across a phone and each is still a 44px target. +// Each action is an icon over its name, so six fit across a phone and each is still a 44px target. const ACTION = 'flex min-h-14 min-w-11 flex-1 flex-col items-center justify-center gap-1 rounded-field px-1 font-display text-xs font-bold transition-[background-color,color,scale] duration-(--dur-fast) active:scale-97 motion-reduce:transition-none sm:min-w-20'; diff --git a/apps/admin/src/components/photos/BulkSheet.tsx b/apps/admin/src/components/photos/BulkSheet.tsx index 9b7307d4..63529701 100644 --- a/apps/admin/src/components/photos/BulkSheet.tsx +++ b/apps/admin/src/components/photos/BulkSheet.tsx @@ -13,13 +13,14 @@ import { Sheet } from '../ui/Sheet'; import { SpeakersNote } from './SpeakersNote'; /** The actions on the selected photos that open a sheet. Delete asks in its own dialog instead. */ -export type BulkAction = 'event' | 'guest' | 'describe' | 'credits'; +export type BulkAction = 'event' | 'guest' | 'describe' | 'credits' | 'page'; const TITLES: Readonly> = { event: 'Set the event', guest: 'Tag a guest', describe: 'Describe them', credits: 'Team credits', + page: "Event's page", }; type BulkSheetProps = { @@ -125,6 +126,27 @@ export function BulkSheet({ action, count, events, speakers, busy, error, onChan ); + case 'page': + return ( +
+ + +
+ ); } })(); diff --git a/apps/admin/src/components/photos/PhotoForm.tsx b/apps/admin/src/components/photos/PhotoForm.tsx index e6a9a08d..a01406b2 100644 --- a/apps/admin/src/components/photos/PhotoForm.tsx +++ b/apps/admin/src/components/photos/PhotoForm.tsx @@ -39,6 +39,7 @@ export function PhotoForm({ photo, events, guests, speakersAt, saving, error, sa description: photo.description, eventId: photo.eventId, isTeamPhoto: photo.isTeamPhoto, + onEventPage: photo.onEventPage, focus: photo.focus, guestIds: guestIdsOf(photo), }); @@ -145,6 +146,16 @@ export function PhotoForm({ photo, events, guests, speakersAt, saving, error, sa onChange={(isTeamPhoto) => change({ isTeamPhoto })} /> +
+

Event's page

+ change({ onEventPage })} + /> +
+ {/* Empty until the link is copied; then a note under the Share button. */} +

+ + + diff --git a/apps/site/src/components/event-page/EventAtAGlance.astro b/apps/site/src/components/event-page/EventAtAGlance.astro index 48f26019..87d058a2 100644 --- a/apps/site/src/components/event-page/EventAtAGlance.astro +++ b/apps/site/src/components/event-page/EventAtAGlance.astro @@ -1,16 +1,19 @@ --- /** - * The event's facts in one card: how far away it is, the day and time, where it is (or how to join online), the - * dress code, and the live stream when there is one. + * The event's facts in one card: how far away it is on top, then a row each for the day, the time, where it is, + * the dress code and how many speakers there are, each with its icon and a small label. At the bottom, the live + * stream when there is one, or the meeting link for an online event. */ import { EVENT_PAGE, PLATFORM_NAMES } from '../../content/event-page'; -import { fullDate, posterTime, weekdayName, type IsoDate } from '../../lib/dates'; +import { longDate, posterTime, type IsoDate } from '../../lib/dates'; import { countdown, type EventPage } from '../../lib/event-page'; import { linkTarget } from '../../lib/links'; +import Icon from '../ui/Icon.astro'; +import { FACT_ICONS } from './event-looks'; -type Props = { event: EventPage; today: IsoDate }; +type Props = { event: EventPage; today: IsoDate; class?: string }; -const { event, today } = Astro.props; +const { event, today, class: className } = Astro.props; const left = countdown(event.date, today); const away = left.kind === 'past' ? EVENT_PAGE.past : left.kind === 'today' ? EVENT_PAGE.today : EVENT_PAGE.inDays(left.days); const time = event.startTime @@ -18,41 +21,63 @@ const time = event.startTime : EVENT_PAGE.timeTba; const where = event.place.kind === 'online' - ? PLATFORM_NAMES[event.place.platform ?? 'other'] - : event.place.building && event.place.room - ? `${event.place.building}, room ${event.place.room}` + ? `Online, on ${PLATFORM_NAMES[event.place.platform ?? 'other']}` + : event.place.building + ? [event.place.label, event.place.building].join(' · ') : (event.place.label ?? EVENT_PAGE.locationTba); -const fact = 'grid gap-0.5'; -const label = 'font-display text-xs font-bold tracking-label text-muted uppercase'; +const facts = [ + { label: EVENT_PAGE.when, icon: FACT_ICONS.when, value: longDate(event.date) }, + { label: EVENT_PAGE.time, icon: FACT_ICONS.time, value: time }, + { label: EVENT_PAGE.where, icon: event.place.kind === 'online' ? FACT_ICONS.online : FACT_ICONS.where, value: where }, + ...(event.dressCode ? [{ label: EVENT_PAGE.dressCode, icon: FACT_ICONS.dress, value: event.dressCode }] : []), + ...(event.speakers.length > 0 + ? [{ label: EVENT_PAGE.speakerCount, icon: FACT_ICONS.speakers, value: EVENT_PAGE.speakerTotal(event.speakers.length) }] + : []), +]; +const watch = + event.streamUrl !== null + ? { href: event.streamUrl, title: EVENT_PAGE.watchLive, note: EVENT_PAGE.watchLiveNote } + : event.place.kind === 'online' && event.place.meetingUrl + ? { href: event.place.meetingUrl, title: `Join on ${PLATFORM_NAMES[event.place.platform ?? 'other']}`, note: null } + : null; --- -
-
-

{EVENT_PAGE.atAGlance}

-

{away}

-
-
-
-
{EVENT_PAGE.when}
-
{weekdayName(event.date)}, {fullDate(event.date)} · {time}
-
-
-
{EVENT_PAGE.where}
-
{where}
-
+
+

{EVENT_PAGE.atAGlance}

+

+ + {away} +

+
{ - event.dressCode && ( -
-
{EVENT_PAGE.dressCode}
-
{event.dressCode}
+ facts.map((fact) => ( +
+ +
{fact.label}
+
{fact.value}
- ) + )) }
{ - event.streamUrl && ( - - {EVENT_PAGE.watchLive} + watch && ( + + ) } diff --git a/apps/site/src/components/event-page/EventDetails.astro b/apps/site/src/components/event-page/EventDetails.astro index 9aff9e82..b2d0c576 100644 --- a/apps/site/src/components/event-page/EventDetails.astro +++ b/apps/site/src/components/event-page/EventDetails.astro @@ -1,100 +1,162 @@ --- /** - * An event's own page, laid out plainly: the poster (or a card in the event's colour when it has none) and the - * facts on the left, and the kind, title, partners, description and the event's lists on the right. On a phone - * they stack: poster, title, facts, then the rest. Each part is in the page once; on a phone the two columns step - * aside (`contents`) and `order` puts the parts in that sequence. The event's two colours are set once here, as - * `--event-primary` and `--event-secondary`, for everything inside to use. + * An event's own page, "the poster up front": on a computer, the poster, the calendar and share buttons under it, + * and the facts stay in view on the left while the right column scrolls through the kind, the title, who it's + * with, the description and the event's sections. On a phone it is one column, in the order a student reads it: + * poster, title, facts, description, buttons, then the rest. Each part is in the page once: on a phone the two + * columns step aside (`contents`) and `order` sets the sequence. + * + * The event's colours are set here once, as CSS variables, for everything inside: `--event-primary` (the poster + * frame and the calendar button, with a darker `--event-primary-edge` under it), `--event-secondary` (the pills) + * and `--event-on-dark` (accents on the dark page). */ -import { CATEGORY_NAMES, EVENT_PAGE, HIGHLIGHT_NAMES } from '../../content/event-page'; -import { fullDate, type IsoDate } from '../../lib/dates'; +import { CATEGORY_NAMES, EVENT_PAGE, HIGHLIGHT_NAMES, PLATFORM_NAMES } from '../../content/event-page'; +import type { IsoDate } from '../../lib/dates'; import type { EventPage } from '../../lib/event-page'; +import Icon from '../ui/Icon.astro'; +import EventActions from './EventActions.astro'; import EventAtAGlance from './EventAtAGlance.astro'; -import EventSections from './EventSections.astro'; +import EventGettingThere from './EventGettingThere.astro'; +import EventJoin from './EventJoin.astro'; +import { FACT_ICONS, HIGHLIGHT_ICONS } from './event-looks'; +import EventPhotos from './EventPhotos.astro'; +import EventPoster from './EventPoster.astro'; +import EventResources from './EventResources.astro'; +import EventSpeakers from './EventSpeakers.astro'; +import EventTopics from './EventTopics.astro'; type Props = { event: EventPage; today: IsoDate }; const { event, today } = Astro.props; -const { primary, secondary } = event.palette; +const { primary, secondary, onDark } = event.palette; const TEXT = { dark: 'text-ink', light: 'text-white' } as const; -const pills = [CATEGORY_NAMES[event.category], ...event.highlights.map((highlight) => HIGHLIGHT_NAMES[highlight])]; +// The pills after the kind: how it's run (online, streamed) and what to expect. +const pills = [ + ...(event.place.kind === 'online' ? [{ label: `Online · ${PLATFORM_NAMES[event.place.platform ?? 'other']}`, icon: FACT_ICONS.online }] : []), + ...(event.streamUrl ? [{ label: EVENT_PAGE.streamed, icon: FACT_ICONS.stream }] : []), + ...event.highlights.map((highlight) => ({ label: HIGHLIGHT_NAMES[highlight], icon: HIGHLIGHT_ICONS[highlight] })), +]; +const chip = 'flex items-center gap-2 rounded-full border-2 border-line-quiet bg-raised py-1 pr-3.5 pl-1.5 font-display text-sm font-bold'; +const label = 'font-display text-xs font-bold tracking-label text-muted uppercase'; --- - +
+ + diff --git a/apps/site/src/components/event-page/EventGettingThere.astro b/apps/site/src/components/event-page/EventGettingThere.astro new file mode 100644 index 00000000..77d6269f --- /dev/null +++ b/apps/site/src/components/event-page/EventGettingThere.astro @@ -0,0 +1,56 @@ +--- +/** + * "Getting there" for an in-person event in a building: a Google Map of the building with its pin, the building's + * name and the room, and a link that opens it in Google Maps. The map loads only when it scrolls into view. + * Written directions per building come later, as data. Left out for an online event or one with no building yet. + */ +import { EVENT_PAGE } from '../../content/event-page'; +import type { EventPage } from '../../lib/event-page'; +import { linkTarget } from '../../lib/links'; +import { mapsEmbed, mapsSearch } from '../../lib/places'; +import Icon from '../ui/Icon.astro'; +import { FACT_ICONS } from './event-looks'; + +type Props = { event: EventPage; class?: string }; + +const { event, class: className } = Astro.props; +const place = event.place.kind === 'in_person' && event.place.building ? event.place : null; +--- + +{ + place?.building && ( +
+

{EVENT_PAGE.gettingThere}

+
+ {/* + The map's grey box shows until it loads, the same size, so nothing below jumps. Google's embed has no dark + style, so the map is inverted and its colours turned back round: dark streets, the usual hues. + */} +
+ +
+
+

{place.building}

+ {place.room &&

{EVENT_PAGE.room(place.room)}

} + + {EVENT_PAGE.openInMaps} + + +
+
+
+ ) +} diff --git a/apps/site/src/components/event-page/EventJoin.astro b/apps/site/src/components/event-page/EventJoin.astro new file mode 100644 index 00000000..36a3be80 --- /dev/null +++ b/apps/site/src/components/event-page/EventJoin.astro @@ -0,0 +1,57 @@ +--- +/** + * How to be there: an online event gets "Joining online", a card with the platform's own button (Zoom blue, Meet + * green) or a note that the link is coming; an in-person event gets the "Scan in" note, always in LCS blue, + * whatever the event's colours, since it's the same at every event. + */ +import { EVENT_PAGE, PLATFORM_NAMES } from '../../content/event-page'; +import type { EventPage } from '../../lib/event-page'; +import { linkTarget } from '../../lib/links'; +import Icon from '../ui/Icon.astro'; +import { FACT_ICONS, PLATFORM_BUTTONS } from './event-looks'; + +type Props = { event: EventPage; class?: string }; + +const { event, class: className } = Astro.props; +--- + +{ + event.place.kind === 'online' ? ( +
+

{EVENT_PAGE.joinOnline}

+
+ + + +
+

{EVENT_PAGE.joinFrom(PLATFORM_NAMES[event.place.platform ?? 'other'])}

+ {!event.place.meetingUrl &&

{EVENT_PAGE.joinLinkSoon}

} +
+ {event.place.meetingUrl && ( + + + Join on {PLATFORM_NAMES[event.place.platform ?? 'other']} + + )} +
+
+ ) : ( +
+ +
+

{EVENT_PAGE.scanIn.title}

+

{EVENT_PAGE.scanIn.body}

+
+
+ ) +} diff --git a/apps/site/src/components/event-page/EventPhotos.astro b/apps/site/src/components/event-page/EventPhotos.astro new file mode 100644 index 00000000..71a8cf93 --- /dev/null +++ b/apps/site/src/components/event-page/EventPhotos.astro @@ -0,0 +1,40 @@ +--- +/** + * Photos at the bottom of the page (`photoSection`): once the event has happened and has photos chosen for its + * page, "Photos from the night" with its own; otherwise "How the last one went", with the earlier event's and a + * link to its page; otherwise nothing. The first three preview; "See all N photos" opens the event's photos page. + * Clicking a photo opens it bigger. + */ +import { EVENT_PAGE } from '../../content/event-page'; +import { fullDate, type IsoDate } from '../../lib/dates'; +import { photoSection, type EventPage } from '../../lib/event-page'; +import PhotoGrid from './PhotoGrid.astro'; + +type Props = { event: EventPage; today: IsoDate; class?: string }; + +const { event, today, class: className } = Astro.props; +const section = photoSection(event, today); +const link = 'font-display font-bold text-pink underline underline-offset-4 hover:text-white'; +--- + +{/* One column the section's own width (`grid-cols-1`), so the photos scroll inside it on a phone. */} +{ + section && ( +
+
+

+ {section.kind === 'this' ? EVENT_PAGE.photosFromTheNight : EVENT_PAGE.lastTime} +

+ {section.kind === 'last' && ( + + {EVENT_PAGE.lastTimeLink(section.title, fullDate(section.date))} + + )} +
+ + + {EVENT_PAGE.seeAllPhotos(section.count)} + +
+ ) +} diff --git a/apps/site/src/components/event-page/EventPoster.astro b/apps/site/src/components/event-page/EventPoster.astro new file mode 100644 index 00000000..3bc78221 --- /dev/null +++ b/apps/site/src/components/event-page/EventPoster.astro @@ -0,0 +1,36 @@ +--- +/** + * The event's poster up front, pinned slightly crooked in a frame of the event's main colour, like a poster on a + * noticeboard. With no poster, a card in that colour stands in: the day, the title and the place, the way a poster + * would say them. Opening an event from its ticket, the ticket's picture grows into this (a page transition the + * browser does; see `global.css`), which is why it carries the same transition name as the ticket. + */ +import { fullDate } from '../../lib/dates'; +import type { EventPage } from '../../lib/event-page'; +import { posterTransition } from '../../lib/transitions'; + +type Props = { event: EventPage; class?: string }; + +const { event, class: className } = Astro.props; +const TEXT = { dark: 'text-ink', light: 'text-white' } as const; +--- + +
+ { + event.posterUrl ? ( + {`Poster + ) : ( +
+

{fullDate(event.date)}

+

{event.title}

+ {event.place.kind === 'in_person' && event.place.label &&

{event.place.label}

} +
+ ) + } +
diff --git a/apps/site/src/components/event-page/EventResources.astro b/apps/site/src/components/event-page/EventResources.astro new file mode 100644 index 00000000..9f4cd48e --- /dev/null +++ b/apps/site/src/components/event-page/EventResources.astro @@ -0,0 +1,41 @@ +--- +/** + * The event's resources (slides, recordings, practice exams, forms, links) as buttons with an icon for each kind, + * three across on a computer and one under the other on a phone. Each opens in a new tab. Left out when there are + * none yet. + */ +import { DOCUMENT_KIND_NAMES, EVENT_PAGE } from '../../content/event-page'; +import type { EventPage } from '../../lib/event-page'; +import { linkTarget } from '../../lib/links'; +import Icon from '../ui/Icon.astro'; +import { DOCUMENT_ICONS } from './event-looks'; + +type Props = { event: EventPage; class?: string }; + +const { event, class: className } = Astro.props; +--- + +{ + event.resources.length > 0 && ( +
+

{EVENT_PAGE.resources}

+ +
+ ) +} diff --git a/apps/site/src/components/event-page/EventSections.astro b/apps/site/src/components/event-page/EventSections.astro deleted file mode 100644 index d4cfc511..00000000 --- a/apps/site/src/components/event-page/EventSections.astro +++ /dev/null @@ -1,118 +0,0 @@ ---- -/** - * The lists under an event's description, each shown only when it has something in it: how to join online (or how - * to scan in at an in-person event), what they'll cover, the speakers, the resources and last time. - */ -import { DOCUMENT_KIND_NAMES, EVENT_PAGE, PLATFORM_NAMES } from '../../content/event-page'; -import { fullDate } from '../../lib/dates'; -import type { EventPage } from '../../lib/event-page'; -import { linkTarget } from '../../lib/links'; - -type Props = { event: EventPage }; - -const { event } = Astro.props; -const heading = 'font-display text-2xl font-extrabold'; -const card = 'rounded-(--radius-ticket) border-2 border-line bg-raised p-5'; ---- - -{ - event.place.kind === 'online' ? ( -
-

{EVENT_PAGE.joinOnline}

- {event.place.meetingUrl ? ( - - Join on {PLATFORM_NAMES[event.place.platform ?? 'other']} - - ) : ( -

{EVENT_PAGE.joinLinkSoon}

- )} -
- ) : ( - // Always LCS blue, whatever the event's own colours: it's the same for every event. -
-

{EVENT_PAGE.scanIn.title}

-

{EVENT_PAGE.scanIn.body}

-
- ) -} - -{ - event.topics.length > 0 && ( -
-

{EVENT_PAGE.topics}

- -
- ) -} - -{ - event.speakers.length > 0 && ( -
-

{EVENT_PAGE.speakers}

- {event.speakersFrom.length > 0 && ( -

- {EVENT_PAGE.speakersFrom} - {event.speakersFrom.map((company) => ( - - - {company.name} - - ))} -

- )} - -
- ) -} - -{ - event.resources.length > 0 && ( -
-

{EVENT_PAGE.resources}

- -
- ) -} - -{ - event.lastTime && ( -
-

{EVENT_PAGE.lastTime}

- - {event.lastTime.title} · {fullDate(event.lastTime.date)} - -
- ) -} diff --git a/apps/site/src/components/event-page/EventSpeakers.astro b/apps/site/src/components/event-page/EventSpeakers.astro new file mode 100644 index 00000000..cc374ca1 --- /dev/null +++ b/apps/site/src/components/event-page/EventSpeakers.astro @@ -0,0 +1,34 @@ +--- +/** + * The event's speakers as cards (`SpeakerCard`), all the same height: three across when the section has room for + * three full-size cards, two across from a phone's width, and one under the other on the narrowest screens. The + * columns follow the section's own width, not the screen's. One speaker gets a single wider card. Left out when + * the event has no guest speakers. + */ +import { EVENT_PAGE } from '../../content/event-page'; +import type { EventPage } from '../../lib/event-page'; +import SpeakerCard from './SpeakerCard.astro'; + +type Props = { event: EventPage; class?: string }; + +const { event, class: className } = Astro.props; +const solo = event.speakers.length === 1; +--- + +{ + event.speakers.length > 0 && ( +
+
+

{EVENT_PAGE.speakers}

+

{EVENT_PAGE.speakerTotal(event.speakers.length)}

+
+ +
+ ) +} diff --git a/apps/site/src/components/event-page/EventTopics.astro b/apps/site/src/components/event-page/EventTopics.astro new file mode 100644 index 00000000..95761d01 --- /dev/null +++ b/apps/site/src/components/event-page/EventTopics.astro @@ -0,0 +1,29 @@ +--- +/** + * "What they'll cover": each topic as a tile with the icon an exec picked for it in the admin, two across on a + * computer. Left out when the event has no topics. + */ +import { EVENT_PAGE } from '../../content/event-page'; +import type { EventPage } from '../../lib/event-page'; +import Icon from '../ui/Icon.astro'; + +type Props = { event: EventPage; class?: string }; + +const { event, class: className } = Astro.props; +--- + +{ + event.topics.length > 0 && ( +
+

{EVENT_PAGE.topics}

+ +
+ ) +} diff --git a/apps/site/src/components/event-page/PhotoGrid.astro b/apps/site/src/components/event-page/PhotoGrid.astro new file mode 100644 index 00000000..10b3ddec --- /dev/null +++ b/apps/site/src/components/event-page/PhotoGrid.astro @@ -0,0 +1,61 @@ +--- +/** + * An event's photos as buttons that open each one big (`ImageViewer`, via `scripts/photo-grid.ts`). Two layouts: + * - `preview`, under an event's page: a row of three on a computer, a sideways scroll on a phone, each cropped to + * the same shape; + * - `wall`, the photos page: every photo at its own shape, in columns, like prints pinned up. + * Each photo's width and height are known, so the page saves its space before it loads. + */ +import type { EventPhoto } from '../../lib/event-photos'; +import ImageViewer from '../ui/ImageViewer.astro'; + +type Props = { photos: readonly EventPhoto[]; layout: 'preview' | 'wall' }; + +const { photos, layout } = Astro.props; +const LAYOUTS = { + preview: { + list: '-mx-4 flex snap-x gap-3 overflow-x-auto px-4 pb-1 nav:mx-0 nav:grid nav:grid-cols-3 nav:overflow-visible nav:px-0', + item: 'w-64 shrink-0 snap-start nav:w-auto', + image: 'aspect-4/3 w-full object-cover', + }, + wall: { + list: 'columns-2 gap-3 nav:columns-3 nav:gap-4', + item: 'mb-3 break-inside-avoid nav:mb-4', + image: 'h-auto w-full', + }, +} as const; +const look = LAYOUTS[layout]; +--- + +{/* A block that can shrink, so a sideways row scrolls inside the page rather than widening it. */} + + + + + + diff --git a/apps/site/src/components/event-page/SpeakerCard.astro b/apps/site/src/components/event-page/SpeakerCard.astro new file mode 100644 index 00000000..e7699f0d --- /dev/null +++ b/apps/site/src/components/event-page/SpeakerCard.astro @@ -0,0 +1,78 @@ +--- +/** + * One speaker (card H, "logo on the line"), sized as in Figma: the phone sizes in a narrow card, the computer ones + * once the card is wide enough for them (`@speaker`, its own width, not the screen's). A strip across the top in + * their company's colour (45% of it, the rest black, so white reads on it), their headshot ringed in the company + * colour at the left, and the company's wide logo (the one framed for cards) on a white plate just right of it, + * both sitting across the strip's bottom edge. Below, their name with a round LinkedIn button at the end of the + * line, and their role. With no headshot their initials stand in; with no logo the plate carries the company's + * name. + */ +import { EVENT_PAGE } from '../../content/event-page'; +import type { PageSpeaker } from '../../lib/event-page'; +import { linkTarget } from '../../lib/links'; +import { SOCIAL_ICONS } from '../ui/social-icons'; + +type Props = { speaker: PageSpeaker }; + +const { speaker } = Astro.props; +const initials = speaker.name + .split(/\s+/) + .slice(0, 2) + .map((word) => word.charAt(0)) + .join(''); +const LinkedIn = SOCIAL_ICONS.linkedin; +--- + +
+
+ + + {speaker.photoUrl ? : initials} + + { + speaker.company && ( + + {speaker.company.wideLogoUrl ? ( + {speaker.company.name} + ) : ( + {speaker.company.name} + )} + + ) + } +
+ +
+
+

{speaker.name}

+ { + speaker.link && ( + + + ) + } +
+ {speaker.role &&

{speaker.role}

} +
+
diff --git a/apps/site/src/components/event-page/event-looks.ts b/apps/site/src/components/event-page/event-looks.ts new file mode 100644 index 00000000..baafb072 --- /dev/null +++ b/apps/site/src/components/event-page/event-looks.ts @@ -0,0 +1,47 @@ +/** + * How the event page draws each kind of thing: the Lucide icon beside a highlight, a resource, a fact or a + * platform, and each platform's colour. A new highlight, resource kind or platform is one more entry here; + * TypeScript points at the record until it has it. + */ +import type { DocumentKind, EventHighlight, MeetingPlatform } from '../../lib/event-page'; + +export const HIGHLIGHT_ICONS: Readonly> = { + food: 'pizza', + snacks: 'cookie', + drinks: 'cup-soda', + speaker_series: 'mic', +}; + +export const DOCUMENT_ICONS: Readonly> = { + practice_exam: 'file-text', + slides: 'presentation', + recording: 'circle-play', + navigator: 'compass', + form: 'clipboard-list', + website: 'globe', + other: 'link', +}; + +/** Each platform's Join button: its own colour, so students recognise it at a glance. */ +export const PLATFORM_BUTTONS: Readonly> = { + zoom: 'bg-zoom text-white', + meet: 'bg-meet text-white', + other: 'bg-yellow text-ink', +}; + +/** The icons the page uses for its own labels. */ +export const FACT_ICONS = { + when: 'calendar', + time: 'clock', + where: 'map-pin', + online: 'video', + dress: 'shirt', + speakers: 'users', + stream: 'radio', + scanIn: 'scan-line', + calendar: 'calendar-plus', + share: 'share-2', + back: 'arrow-left', + external: 'arrow-up-right', + photo: 'image', +} as const; diff --git a/apps/site/src/components/events/ComingUp.astro b/apps/site/src/components/events/ComingUp.astro index aaf45fcc..f5470ffa 100644 --- a/apps/site/src/components/events/ComingUp.astro +++ b/apps/site/src/components/events/ComingUp.astro @@ -5,7 +5,9 @@ * it comes into view the event days light up with their mascots' stickers, the booth prints the tickets onto the * floor, and the next one gets stamped "Next up". Pointing at a ticket lifts its day, and pointing at a day lifts * its ticket (`scripts/coming-up.ts`). With nothing coming up, the booth makes way for a note on where to hear - * about the next one. In the calendar's bottom corner, "All events" opens every ticket, past ones included. + * about the next one. Clicking another event's day (a past one, or one later than the pile reaches) has the booth + * reprint its ticket on top of the pile while the three fade back; "Back to what's next" takes it in again. In the + * calendar's bottom corner, "All events" opens every ticket, past ones included. */ import { Image } from 'astro:assets'; import { BOOTH_OWL, MASCOT_FACES } from '../../assets/brand'; @@ -26,6 +28,9 @@ type Props = { events: readonly ClubEvent[]; upcoming: readonly ClubEvent[]; tod const { events, upcoming, today } = Astro.props; const tickets = upcoming.slice(0, SHOWN_TICKETS); +const marks = dayMarks(events, tickets, today); +const reprints = [...marks.values()].flatMap((mark) => (mark.kind === 'reprint' ? [mark] : [])); +const { months, start } = calendarMonths(today, events); const instagram = socialLink('instagram'); --- @@ -52,13 +57,27 @@ const instagram = socialLink('instagram');