Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions apps/admin/src/types/database.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,6 @@ export type Database = {
start_time: string | null
stream_url: string | null
title: string
will_stream: boolean
}
Insert: {
building_code?: string | null
Expand All @@ -459,7 +458,6 @@ export type Database = {
start_time?: string | null
stream_url?: string | null
title: string
will_stream?: boolean
}
Update: {
building_code?: string | null
Expand All @@ -482,7 +480,6 @@ export type Database = {
start_time?: string | null
stream_url?: string | null
title?: string
will_stream?: boolean
}
Relationships: [
{
Expand Down
2 changes: 2 additions & 0 deletions apps/site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"@tailwindcss/vite": "^4.3.5",
"astro": "^7.4.13",
"gsap": "^3.15.1",
"markdown-it": "14.1.0",
"sharp": "^0.35.5",
"tailwindcss": "^4.3.5",
"zod": "^4.6.7"
Expand All @@ -29,6 +30,7 @@
"@astrojs/check": "^0.9.12",
"@testing-library/dom": "^10.4.2",
"@types/jsdom": "^30.0.0",
"@types/markdown-it": "14.1.2",
"jsdom": "^31.0.1",
"typescript": "^5.9.3",
"vitest": "^5.1.1"
Expand Down
65 changes: 65 additions & 0 deletions apps/site/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

59 changes: 59 additions & 0 deletions apps/site/src/components/event-page/EventAtAGlance.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
/**
* 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.
*/
import { EVENT_PAGE, PLATFORM_NAMES } from '../../content/event-page';
import { fullDate, posterTime, weekdayName, type IsoDate } from '../../lib/dates';
import { countdown, type EventPage } from '../../lib/event-page';
import { linkTarget } from '../../lib/links';

type Props = { event: EventPage; today: IsoDate };

const { event, today } = 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
? [event.startTime, event.endTime].filter((part) => part !== null).map(posterTime).join(' – ')
: 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}`
: (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';
---

<section aria-labelledby="at-a-glance" class="grid gap-4 rounded-(--radius-ticket) border-2 border-line bg-raised p-5">
<div class="flex items-center justify-between gap-3">
<h2 id="at-a-glance" class="font-display text-lg font-extrabold">{EVENT_PAGE.atAGlance}</h2>
<p class="font-display font-bold text-yellow">{away}</p>
</div>
<dl class="grid gap-3">
<div class={fact}>
<dt class={label}>{EVENT_PAGE.when}</dt>
<dd>{weekdayName(event.date)}, {fullDate(event.date)} · {time}</dd>
</div>
<div class={fact}>
<dt class={label}>{EVENT_PAGE.where}</dt>
<dd>{where}</dd>
</div>
{
event.dressCode && (
<div class={fact}>
<dt class={label}>{EVENT_PAGE.dressCode}</dt>
<dd>{event.dressCode}</dd>
</div>
)
}
</dl>
{
event.streamUrl && (
<a href={event.streamUrl} {...linkTarget(event.streamUrl)} class="font-display font-bold text-yellow underline underline-offset-4">
{EVENT_PAGE.watchLive}
</a>
)
}
</section>
100 changes: 100 additions & 0 deletions apps/site/src/components/event-page/EventDetails.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
---
/**
* 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.
*/
import { CATEGORY_NAMES, EVENT_PAGE, HIGHLIGHT_NAMES } from '../../content/event-page';
import { fullDate, type IsoDate } from '../../lib/dates';
import type { EventPage } from '../../lib/event-page';
import EventAtAGlance from './EventAtAGlance.astro';
import EventSections from './EventSections.astro';

type Props = { event: EventPage; today: IsoDate };

const { event, today } = Astro.props;
const { primary, secondary } = 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])];
---

<article
class="mx-auto flex max-w-(--max) flex-col gap-6 px-4 py-10 nav:grid nav:grid-cols-[minmax(0,22rem)_minmax(0,1fr)] nav:items-start nav:gap-12 nav:px-16 nav:py-16"
style={{ '--event-primary': primary.colour, '--event-secondary': secondary.colour }}
>
<div class="contents nav:sticky nav:top-24 nav:grid nav:gap-5">
{
event.posterUrl ? (
<img
src={event.posterUrl}
alt={`Poster for ${event.title}`}
class="order-1 w-full rounded-(--radius-ticket) border-4 border-(--event-primary) object-cover"
/>
) : (
<div class:list={['order-1 grid aspect-4/5 content-end gap-1 rounded-(--radius-ticket) bg-(--event-primary) p-6', TEXT[primary.text]]}>
<p class="font-display text-sm font-bold uppercase">{fullDate(event.date)}</p>
<p class="font-display text-3xl leading-tight font-extrabold">{event.title}</p>
{event.place.kind === 'in_person' && event.place.label && <p class="font-display font-bold">{event.place.label}</p>}
</div>
)
}
<div class="order-3">
<EventAtAGlance event={event} today={today} />
</div>
</div>

<div class="contents nav:grid nav:gap-6">
<header class="order-2 grid gap-3">
<ul class="flex flex-wrap gap-2" aria-label="About this event">
{
pills.map((pill, index) => (
<li
class:list={[
'rounded-md px-2.5 py-1 font-display text-xs font-extrabold tracking-label uppercase',
index % 2 === 0 ? ['bg-(--event-secondary)', TEXT[secondary.text]] : ['bg-(--event-primary)', TEXT[primary.text]],
]}
>
{pill}
</li>
))
}
</ul>
<h1 class="text-4xl font-extrabold text-balance nav:text-5xl">{event.title}</h1>
{
event.partners.length > 0 && (
<div class="flex flex-wrap items-center gap-2">
<p class="font-display text-xs font-bold tracking-label text-muted uppercase">{EVENT_PAGE.partners}</p>
<ul class="flex flex-wrap gap-2">
{event.partners.map((partner) => (
<li class="flex items-center gap-2 rounded-full bg-raised py-1 pr-3 pl-1.5 font-display text-sm font-bold">
{partner.logoUrl ? (
<img src={partner.logoUrl} alt="" class="size-6 rounded-full bg-white object-contain" />
) : (
<span class="size-3 rounded-full" style={{ backgroundColor: partner.colour }} />
)}
{partner.name}
</li>
))}
</ul>
</div>
)
}
</header>

{/* Safe to insert: markdown-it escapes any HTML typed in the admin and allows only the description's formats. */}
{
event.descriptionHtml && (
<div
class="order-4 grid max-w-prose gap-3 text-text-2 [&_a]:text-yellow [&_a]:underline [&_strong]:text-white [&_ul]:grid [&_ul]:list-disc [&_ul]:gap-1 [&_ul]:pl-5"
set:html={event.descriptionHtml}
/>
)
}

<div class="order-5 grid gap-6">
<EventSections event={event} />
</div>
</div>
</article>
Loading
Loading