@backgold/template-kit 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +12 -2
- package/dist/chunk-KOB36GSF.js +62 -0
- package/dist/constants-DvTNj4JI.d-Batjcj3Z.d.ts +38 -0
- package/dist/content-api-CYeY0vU8.d.ts +849 -0
- package/dist/contract/content-api-examples.d.ts +58 -0
- package/dist/contract/content-api-examples.js +783 -0
- package/dist/contract/content-api.d.ts +2 -0
- package/dist/contract/content-api.js +1 -0
- package/dist/contract/site-templates.d.ts +252 -0
- package/dist/contract/site-templates.js +185 -0
- package/package.json +70 -3
- package/src/components/EntryCard.astro +35 -0
- package/src/components/EventMap.astro +118 -0
- package/src/components/EventPage.astro +194 -0
- package/src/components/FieldValue.astro +41 -0
- package/src/components/LeadingHero.astro +21 -0
- package/src/components/NotFound.astro +20 -0
- package/src/components/PageSections.astro +47 -0
- package/src/components/Prose.astro +18 -0
- package/src/components/chrome/Brand.astro +54 -0
- package/src/components/chrome/ClosingCall.astro +94 -0
- package/src/components/chrome/DonateStrip.astro +61 -0
- package/src/components/chrome/FooterColumns.astro +32 -0
- package/src/components/chrome/FooterContact.astro +28 -0
- package/src/components/chrome/MenuList.astro +45 -0
- package/src/components/chrome/ModeToggle.astro +125 -0
- package/src/components/chrome/SignedInNotice.astro +53 -0
- package/src/components/chrome/SignupBand.astro +12 -0
- package/src/components/chrome/TakeoverBanner.astro +56 -0
- package/src/components/chrome/VisitorAccount.astro +82 -0
- package/src/components/entries/AuthorBox.astro +47 -0
- package/src/components/entries/EntryFields.astro +29 -0
- package/src/components/entries/EntryHeader.astro +77 -0
- package/src/components/entries/ListFrame.astro +126 -0
- package/src/components/entries/ListSearch.astro +24 -0
- package/src/components/entries/Share.astro +24 -0
- package/src/components/entries/course/classroom.astro +26 -0
- package/src/components/entries/course/lesson.astro +18 -0
- package/src/components/entries/course/section.ts +20 -0
- package/src/components/entries/course/syllabus.astro +15 -0
- package/src/components/entries/index.ts +77 -0
- package/src/components/entries/newsletter/issue.astro +41 -0
- package/src/components/entries/newsletter/list.astro +26 -0
- package/src/components/entries/podcast/episode.astro +42 -0
- package/src/components/entries/podcast/list.astro +36 -0
- package/src/components/entries/post/article.astro +31 -0
- package/src/components/entries/post/list.astro +85 -0
- package/src/components/entries/props.ts +61 -0
- package/src/components/entries/video/cards.astro +39 -0
- package/src/components/entries/video/grid.astro +15 -0
- package/src/components/entries/video/watch.astro +41 -0
- package/src/components/live/LivePage.astro +215 -0
- package/src/components/live/LocalTime.astro +29 -0
- package/src/components/sections/About/books.astro +188 -0
- package/src/components/sections/About/credentials.ts +90 -0
- package/src/components/sections/About/index.astro +57 -0
- package/src/components/sections/About/left.astro +54 -0
- package/src/components/sections/About/letter.astro +108 -0
- package/src/components/sections/About/portrait.astro +308 -0
- package/src/components/sections/Advocacy/compact.astro +14 -0
- package/src/components/sections/Advocacy/index.astro +14 -0
- package/src/components/sections/Band.astro +39 -0
- package/src/components/sections/Blog/feature.astro +176 -0
- package/src/components/sections/Blog/index.astro +37 -0
- package/src/components/sections/Blog/latest.ts +80 -0
- package/src/components/sections/Blog/list.astro +186 -0
- package/src/components/sections/Booking/index.astro +139 -0
- package/src/components/sections/Booking/list.astro +144 -0
- package/src/components/sections/Booking/types.ts +60 -0
- package/src/components/sections/Calendar/agenda.astro +14 -0
- package/src/components/sections/Calendar/index.astro +14 -0
- package/src/components/sections/CandidateRoster/ballot.astro +394 -0
- package/src/components/sections/CandidateRoster/candidates.ts +69 -0
- package/src/components/sections/CandidateRoster/compact.astro +115 -0
- package/src/components/sections/CandidateRoster/index.astro +57 -0
- package/src/components/sections/CaseStudies/beforeafter.astro +222 -0
- package/src/components/sections/CaseStudies/cases.ts +111 -0
- package/src/components/sections/CaseStudies/grid.astro +261 -0
- package/src/components/sections/CaseStudies/index.astro +333 -0
- package/src/components/sections/Classroom/CourseCard.astro +181 -0
- package/src/components/sections/Classroom/Courses.astro +88 -0
- package/src/components/sections/Classroom/classroom.ts +141 -0
- package/src/components/sections/Classroom/index.astro +20 -0
- package/src/components/sections/Classroom/list.astro +15 -0
- package/src/components/sections/Collection/compact.astro +7 -0
- package/src/components/sections/Collection/entries.ts +62 -0
- package/src/components/sections/Collection/feature.astro +180 -0
- package/src/components/sections/Collection/index.astro +46 -0
- package/src/components/sections/Collection/library.astro +271 -0
- package/src/components/sections/Collection/list.astro +7 -0
- package/src/components/sections/Collection/outline.astro +134 -0
- package/src/components/sections/Collection/shelves.astro +191 -0
- package/src/components/sections/Comparison/Unlisted.astro +6 -0
- package/src/components/sections/Comparison/cards.astro +171 -0
- package/src/components/sections/Comparison/index.astro +191 -0
- package/src/components/sections/Comparison/sides.ts +98 -0
- package/src/components/sections/Comparison/spectrum.astro +261 -0
- package/src/components/sections/ContentPost/banner.astro +152 -0
- package/src/components/sections/ContentPost/index.astro +35 -0
- package/src/components/sections/ContentPost/lesson.ts +119 -0
- package/src/components/sections/ContentPost/player.astro +254 -0
- package/src/components/sections/ContentPost/theater.astro +329 -0
- package/src/components/sections/Countdown/index.astro +53 -0
- package/src/components/sections/Course/Bar.astro +46 -0
- package/src/components/sections/Course/CourseHead.astro +123 -0
- package/src/components/sections/Course/Crumbs.astro +44 -0
- package/src/components/sections/Course/Icon.astro +29 -0
- package/src/components/sections/Course/Ring.astro +62 -0
- package/src/components/sections/Course/Syllabus.astro +146 -0
- package/src/components/sections/Course/course.ts +146 -0
- package/src/components/sections/Course/index.astro +143 -0
- package/src/components/sections/Course/outline.astro +39 -0
- package/src/components/sections/Cta/banner.astro +64 -0
- package/src/components/sections/Cta/card.astro +88 -0
- package/src/components/sections/Cta/index.astro +31 -0
- package/src/components/sections/Cta/photo.astro +114 -0
- package/src/components/sections/Cta/strip.astro +91 -0
- package/src/components/sections/Donate/index.astro +136 -0
- package/src/components/sections/Donate/story.astro +7 -0
- package/src/components/sections/Event/card.astro +14 -0
- package/src/components/sections/Event/index.astro +14 -0
- package/src/components/sections/EventsList/AgendaMonths.astro +105 -0
- package/src/components/sections/EventsList/CalendarLine.astro +23 -0
- package/src/components/sections/EventsList/EventRows.astro +196 -0
- package/src/components/sections/EventsList/LiveCounts.astro +75 -0
- package/src/components/sections/EventsList/TypeTabs.astro +53 -0
- package/src/components/sections/EventsList/agenda.astro +55 -0
- package/src/components/sections/EventsList/calendar.astro +392 -0
- package/src/components/sections/EventsList/cards.astro +186 -0
- package/src/components/sections/EventsList/cohorts.astro +205 -0
- package/src/components/sections/EventsList/compact.astro +163 -0
- package/src/components/sections/EventsList/events.ts +168 -0
- package/src/components/sections/EventsList/index.astro +46 -0
- package/src/components/sections/EventsList/map.astro +436 -0
- package/src/components/sections/EventsList/shifts.astro +355 -0
- package/src/components/sections/EventsList/week.astro +361 -0
- package/src/components/sections/Faq/Contact.astro +63 -0
- package/src/components/sections/Faq/Questions.astro +98 -0
- package/src/components/sections/Faq/cards.astro +74 -0
- package/src/components/sections/Faq/faq.ts +101 -0
- package/src/components/sections/Faq/index.astro +49 -0
- package/src/components/sections/Faq/topics.astro +178 -0
- package/src/components/sections/Financials/Foot.astro +38 -0
- package/src/components/sections/Financials/Head.astro +47 -0
- package/src/components/sections/Financials/donut.astro +197 -0
- package/src/components/sections/Financials/financials.ts +52 -0
- package/src/components/sections/Financials/index.astro +148 -0
- package/src/components/sections/Financials/table.astro +157 -0
- package/src/components/sections/FormBlock/index.astro +33 -0
- package/src/components/sections/FormBlock/wide.astro +7 -0
- package/src/components/sections/Hero/cover.astro +170 -0
- package/src/components/sections/Hero/donate.astro +209 -0
- package/src/components/sections/Hero/field.astro +390 -0
- package/src/components/sections/Hero/index.astro +52 -0
- package/src/components/sections/Hero/overlap.astro +151 -0
- package/src/components/sections/Hero/rotating.astro +30 -0
- package/src/components/sections/Hero/split.astro +96 -0
- package/src/components/sections/Hero/statement.astro +55 -0
- package/src/components/sections/Hero/video.astro +399 -0
- package/src/components/sections/Issues/checklist.astro +204 -0
- package/src/components/sections/Issues/drawer.astro +237 -0
- package/src/components/sections/Issues/index.astro +115 -0
- package/src/components/sections/Issues/issues.ts +37 -0
- package/src/components/sections/Issues/numbered.astro +79 -0
- package/src/components/sections/Issues/rows.astro +137 -0
- package/src/components/sections/Issues/steps.astro +81 -0
- package/src/components/sections/Issues/tabs.astro +322 -0
- package/src/components/sections/Leaderboard/index.astro +29 -0
- package/src/components/sections/Lesson/Door.astro +121 -0
- package/src/components/sections/Lesson/LessonBody.astro +416 -0
- package/src/components/sections/Lesson/Rail.astro +182 -0
- package/src/components/sections/Lesson/Tracker.astro +137 -0
- package/src/components/sections/Lesson/index.astro +27 -0
- package/src/components/sections/Lesson/lesson.ts +233 -0
- package/src/components/sections/Lesson/reading.astro +21 -0
- package/src/components/sections/Map/CoverageLine.astro +19 -0
- package/src/components/sections/Map/RegionMap.astro +109 -0
- package/src/components/sections/Map/bar.astro +160 -0
- package/src/components/sections/Map/index.astro +192 -0
- package/src/components/sections/Map/map.astro +275 -0
- package/src/components/sections/MediaKit/BioCard.astro +108 -0
- package/src/components/sections/MediaKit/Downloads.astro +88 -0
- package/src/components/sections/MediaKit/index.astro +183 -0
- package/src/components/sections/MediaKit/kit.ts +140 -0
- package/src/components/sections/MediaKit/press.astro +189 -0
- package/src/components/sections/MediaKit/speaker.astro +205 -0
- package/src/components/sections/Membership/Benefits.astro +42 -0
- package/src/components/sections/Membership/Check.astro +12 -0
- package/src/components/sections/Membership/Price.astro +61 -0
- package/src/components/sections/Membership/compare.astro +312 -0
- package/src/components/sections/Membership/index.astro +281 -0
- package/src/components/sections/Membership/offers.ts +169 -0
- package/src/components/sections/Membership/tiers.astro +217 -0
- package/src/components/sections/MovementMap/index.astro +50 -0
- package/src/components/sections/MovementTicker/index.astro +43 -0
- package/src/components/sections/Pathways/Doors.astro +147 -0
- package/src/components/sections/Pathways/Head.astro +37 -0
- package/src/components/sections/Pathways/index.astro +27 -0
- package/src/components/sections/Pathways/pathways.ts +100 -0
- package/src/components/sections/Pathways/quiz.astro +286 -0
- package/src/components/sections/Pathways/tabs.astro +271 -0
- package/src/components/sections/PdfEmbed/card.astro +99 -0
- package/src/components/sections/PdfEmbed/index.astro +26 -0
- package/src/components/sections/PdfEmbed/medium.astro +7 -0
- package/src/components/sections/PdfEmbed/tall.astro +7 -0
- package/src/components/sections/Petition/coverage.astro +14 -0
- package/src/components/sections/Petition/image.astro +14 -0
- package/src/components/sections/Petition/index.astro +14 -0
- package/src/components/sections/Petition/map.astro +14 -0
- package/src/components/sections/PlatformPlanks/anchors.ts +66 -0
- package/src/components/sections/PlatformPlanks/columns.astro +171 -0
- package/src/components/sections/PlatformPlanks/index.astro +56 -0
- package/src/components/sections/PlatformPlanks/longread.astro +250 -0
- package/src/components/sections/PollBlock/index.astro +30 -0
- package/src/components/sections/Portfolio/featured.astro +343 -0
- package/src/components/sections/Portfolio/index.astro +571 -0
- package/src/components/sections/Portfolio/strip.astro +173 -0
- package/src/components/sections/Portfolio/work.ts +100 -0
- package/src/components/sections/Progress/MatchClock.astro +166 -0
- package/src/components/sections/Progress/compact.astro +150 -0
- package/src/components/sections/Progress/index.astro +32 -0
- package/src/components/sections/Progress/match.astro +126 -0
- package/src/components/sections/Progress/ring.astro +179 -0
- package/src/components/sections/QuickDonate/DonateCard.astro +149 -0
- package/src/components/sections/QuickDonate/Picker.astro +95 -0
- package/src/components/sections/QuickDonate/band.astro +164 -0
- package/src/components/sections/QuickDonate/bar.astro +208 -0
- package/src/components/sections/QuickDonate/donate.ts +126 -0
- package/src/components/sections/QuickDonate/hero.astro +143 -0
- package/src/components/sections/QuickDonate/index.astro +73 -0
- package/src/components/sections/QuickDonate/jar.astro +225 -0
- package/src/components/sections/QuickDonate/ladder.astro +248 -0
- package/src/components/sections/QuoteStrip/carousel.astro +340 -0
- package/src/components/sections/QuoteStrip/index.astro +58 -0
- package/src/components/sections/QuoteStrip/logos.astro +226 -0
- package/src/components/sections/QuoteStrip/quotes.ts +61 -0
- package/src/components/sections/QuoteStrip/single.astro +92 -0
- package/src/components/sections/QuoteStrip/ticker.astro +319 -0
- package/src/components/sections/QuoteStrip/wall.astro +113 -0
- package/src/components/sections/Resources/band.astro +93 -0
- package/src/components/sections/Resources/featured.astro +239 -0
- package/src/components/sections/Resources/index.astro +225 -0
- package/src/components/sections/Resources/resources.ts +92 -0
- package/src/components/sections/SampleBallot/Position.astro +39 -0
- package/src/components/sections/SampleBallot/ballot.ts +92 -0
- package/src/components/sections/SampleBallot/cards.astro +299 -0
- package/src/components/sections/SampleBallot/index.astro +326 -0
- package/src/components/sections/SampleBallot/measures.astro +172 -0
- package/src/components/sections/Scorecard/grades.astro +141 -0
- package/src/components/sections/Scorecard/index.astro +294 -0
- package/src/components/sections/Scorecard/promise.astro +167 -0
- package/src/components/sections/Scorecard/votes.ts +83 -0
- package/src/components/sections/SectionHead.astro +31 -0
- package/src/components/sections/Services/Button.astro +24 -0
- package/src/components/sections/Services/Check.astro +12 -0
- package/src/components/sections/Services/Includes.astro +42 -0
- package/src/components/sections/Services/compare.astro +328 -0
- package/src/components/sections/Services/index.astro +187 -0
- package/src/components/sections/Services/list.astro +181 -0
- package/src/components/sections/Services/services.ts +80 -0
- package/src/components/sections/ShareKit/Actions.astro +71 -0
- package/src/components/sections/ShareKit/Buttons.astro +62 -0
- package/src/components/sections/ShareKit/compact.astro +123 -0
- package/src/components/sections/ShareKit/index.astro +160 -0
- package/src/components/sections/ShareKit/share.ts +60 -0
- package/src/components/sections/ShareKit/strip.astro +173 -0
- package/src/components/sections/SignupCapture/band.astro +7 -0
- package/src/components/sections/SignupCapture/index.astro +103 -0
- package/src/components/sections/SignupCapture/inline.astro +7 -0
- package/src/components/sections/SocialFeed/index.astro +34 -0
- package/src/components/sections/StatCards/feature.astro +143 -0
- package/src/components/sections/StatCards/index.astro +51 -0
- package/src/components/sections/StatCards/ribbon.astro +113 -0
- package/src/components/sections/StatCards/wall.astro +177 -0
- package/src/components/sections/Store/featured.astro +14 -0
- package/src/components/sections/Store/index.astro +14 -0
- package/src/components/sections/Stories/Status.astro +42 -0
- package/src/components/sections/Stories/StoryCards.astro +171 -0
- package/src/components/sections/Stories/cards.astro +42 -0
- package/src/components/sections/Stories/index.astro +238 -0
- package/src/components/sections/Stories/stories.ts +97 -0
- package/src/components/sections/Stories/timeline.astro +135 -0
- package/src/components/sections/TeamGrid/board.astro +280 -0
- package/src/components/sections/TeamGrid/index.astro +71 -0
- package/src/components/sections/TeamGrid/list.astro +306 -0
- package/src/components/sections/TeamGrid/people.ts +178 -0
- package/src/components/sections/VideoEmbed/index.astro +52 -0
- package/src/components/sections/VideoEmbed/landscape.astro +7 -0
- package/src/components/sections/VideoEmbed/portrait.astro +7 -0
- package/src/components/sections/VideoEmbed/square.astro +7 -0
- package/src/components/sections/VoterTools/DaysLeft.astro +33 -0
- package/src/components/sections/VoterTools/dates.astro +149 -0
- package/src/components/sections/VoterTools/index.astro +228 -0
- package/src/components/sections/VoterTools/polling.astro +141 -0
- package/src/components/sections/VoterTools/voter-tools.ts +70 -0
- package/src/components/sections/index.ts +370 -0
- package/src/components/sections/modules/Headed.astro +39 -0
- package/src/components/sections/modules/ModuleFrame.astro +179 -0
- package/src/components/volunteer/ShiftLive.astro +90 -0
- package/src/components/volunteer/detail.astro +247 -0
- package/src/components/volunteer/list.astro +298 -0
- package/src/components/volunteer/props.ts +21 -0
- package/src/env.d.ts +22 -0
- package/src/index.d.ts +10 -0
- package/src/index.js +64 -0
- package/src/layouts/Site.astro +371 -0
- package/src/lib/academy.ts +146 -0
- package/src/lib/brand.ts +534 -0
- package/src/lib/chrome.ts +119 -0
- package/src/lib/donate-frame.ts +64 -0
- package/src/lib/entries.ts +190 -0
- package/src/lib/env.ts +34 -0
- package/src/lib/event-map-draw.ts +91 -0
- package/src/lib/events.ts +476 -0
- package/src/lib/fonts.ts +116 -0
- package/src/lib/footer.ts +24 -0
- package/src/lib/format.ts +160 -0
- package/src/lib/geo.ts +131 -0
- package/src/lib/live.ts +54 -0
- package/src/lib/menu.ts +48 -0
- package/src/lib/petition-text.ts +29 -0
- package/src/lib/reading.ts +17 -0
- package/src/lib/regions.ts +215 -0
- package/src/lib/section.ts +94 -0
- package/src/lib/shifts.ts +186 -0
- package/src/lib/stream-time.ts +20 -0
- package/src/lib/stream.ts +141 -0
- package/src/lib/visitor.ts +54 -0
- package/src/routes/catch-all.astro +286 -0
- package/src/routes/form.astro +30 -0
- package/src/routes/live.astro +49 -0
- package/src/routes/not-found.astro +18 -0
- package/src/routes/preview.astro +60 -0
- package/src/routes/setup.astro +62 -0
- package/src/routes/volunteer-shift.astro +61 -0
- package/src/routes/volunteer.astro +37 -0
- package/src/styles/entries.css +784 -0
- package/src/styles/site.css +1839 -0
- package/src/template.ts +182 -0
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
---
|
|
2
|
+
// EventsList · Shifts (board 06, A, "Shift list with filters"): the section
|
|
3
|
+
// head (the kicker, the heading and the "All events" link), then a row per
|
|
4
|
+
// event on the band's surface: a date tile at the left (the month in small
|
|
5
|
+
// capitals over the day in the display face, the weekday under it, all in the
|
|
6
|
+
// event's own time zone), the title linking to the event's page on this site
|
|
7
|
+
// with the time and the place under it and a quiet "Add to calendar" link to
|
|
8
|
+
// the event's calendar file beside them, the type as a chip, the live counts
|
|
9
|
+
// ("8 going · 4 seats left", filled in by LiveCounts after the page loads;
|
|
10
|
+
// empty without scripts) and whether it still takes registrations, then the
|
|
11
|
+
// row's one button to the same page, which frames BackGold's RSVP and
|
|
12
|
+
// tickets: "RSVP", "Get tickets" when the event sells tickets, "Details" in
|
|
13
|
+
// the outline once registration has closed. Every row has its button,
|
|
14
|
+
// whatever `options.actions` says.
|
|
15
|
+
//
|
|
16
|
+
// Over the rows, chips narrow the list: All, one per event type the rows
|
|
17
|
+
// carry (when they carry more than one), and This weekend. The chips are
|
|
18
|
+
// drawn hidden and shown by the section's script, so with scripts off every
|
|
19
|
+
// row shows and nothing is offered that cannot work. The page is cached, so
|
|
20
|
+
// the weekend is worked out by the script in the visitor's own time: the
|
|
21
|
+
// coming Saturday and Sunday (on a Sunday, that day), matched against each
|
|
22
|
+
// event's own day; its chip shows only when it would narrow the list.
|
|
23
|
+
//
|
|
24
|
+
// On a phone the tile and the title come first, the chip and counts under
|
|
25
|
+
// the title, the button full width under them. With no events the head
|
|
26
|
+
// stands over the section's empty-events line ("No upcoming events right
|
|
27
|
+
// now." when it has none); with neither events nor a heading nothing is drawn.
|
|
28
|
+
import type { ComponentProps } from 'astro/types'
|
|
29
|
+
import type Default from './index.astro'
|
|
30
|
+
import Band from '../Band.astro'
|
|
31
|
+
import LiveCounts from './LiveCounts.astro'
|
|
32
|
+
import SectionHead from '../SectionHead.astro'
|
|
33
|
+
import { eventsOf, type EventRow } from './events'
|
|
34
|
+
import { links } from '../../../lib/section'
|
|
35
|
+
import { text } from '../../../lib/format'
|
|
36
|
+
|
|
37
|
+
type Props = ComponentProps<typeof Default>
|
|
38
|
+
|
|
39
|
+
const { section } = Astro.props
|
|
40
|
+
const heading = text(section.copy.heading)
|
|
41
|
+
const invitation = text(section.copy.eventsEmptyCta)
|
|
42
|
+
const events = eventsOf(section)
|
|
43
|
+
const types = [...new Set(events.map((e) => e.type).filter((t): t is string => t !== null))]
|
|
44
|
+
const listId = `${section.id}-shifts`.replace(/[^A-Za-z0-9_-]/g, '-')
|
|
45
|
+
const pad = (n: number) => String(n).padStart(2, '0')
|
|
46
|
+
// The event's own calendar day, "2026-10-17", which the weekend chip matches.
|
|
47
|
+
const dayOf = (e: EventRow) => (e.when ? `${e.when.year}-${pad(e.when.monthIndex + 1)}-${pad(Number(e.when.day))}` : '')
|
|
48
|
+
---
|
|
49
|
+
{(heading || events.length > 0) && (
|
|
50
|
+
<Band section={section} class="events events-shifts">
|
|
51
|
+
<SectionHead kicker={text(section.copy.kicker)} heading={heading} more={links(section)} />
|
|
52
|
+
{events.length > 0 ? (
|
|
53
|
+
<div class="shifts" data-shifts>
|
|
54
|
+
<div class="sh-filters" role="group" aria-label="Filter events" data-shifts-filters hidden>
|
|
55
|
+
<button type="button" aria-pressed="true" aria-controls={listId} data-shifts-filter="">All</button>
|
|
56
|
+
{types.length > 1 && types.map((type) => (
|
|
57
|
+
<button type="button" aria-pressed="false" aria-controls={listId} data-shifts-filter={`type:${type}`}>{type}</button>
|
|
58
|
+
))}
|
|
59
|
+
<button type="button" aria-pressed="false" aria-controls={listId} data-shifts-filter="weekend" hidden>This weekend</button>
|
|
60
|
+
</div>
|
|
61
|
+
<ul class="sh-list" id={listId} role="list">
|
|
62
|
+
{events.map((event) => (
|
|
63
|
+
<li class="sh-row" data-shift data-type={event.type ?? ''} data-day={dayOf(event)}>
|
|
64
|
+
{event.when && event.startsAt ? (
|
|
65
|
+
<time class="sh-tile" datetime={event.startsAt}>
|
|
66
|
+
<span class="sh-month" aria-hidden="true">{event.when.monthShort}</span>
|
|
67
|
+
<b aria-hidden="true">{event.when.day}</b>
|
|
68
|
+
{event.when.weekday && <span class="sh-weekday" aria-hidden="true">{event.when.weekday}</span>}
|
|
69
|
+
<span class="visually-hidden">{event.when.full}</span>
|
|
70
|
+
</time>
|
|
71
|
+
) : (
|
|
72
|
+
<span class="sh-tile" aria-hidden="true"><b>–</b></span>
|
|
73
|
+
)}
|
|
74
|
+
<div class="sh-body">
|
|
75
|
+
<h3 class="sh-title">{event.link ? <a href={event.link.href} rel={event.link.rel}>{event.title}</a> : event.title}</h3>
|
|
76
|
+
{(event.when?.time || event.place || event.calendar) && (
|
|
77
|
+
<p class="sh-meta">
|
|
78
|
+
{[event.when?.time, event.place].filter(Boolean).join(' · ')}
|
|
79
|
+
{event.calendar && (
|
|
80
|
+
<>
|
|
81
|
+
{(event.when?.time || event.place) && ' · '}
|
|
82
|
+
<a href={event.calendar.href} rel={event.calendar.rel}>{event.calendar.label}<span class="visually-hidden">: {event.title}</span></a>
|
|
83
|
+
</>
|
|
84
|
+
)}
|
|
85
|
+
</p>
|
|
86
|
+
)}
|
|
87
|
+
</div>
|
|
88
|
+
{(event.type || event.id || event.closed) && (
|
|
89
|
+
<p class="sh-facts">
|
|
90
|
+
{event.type && <span class="chip chip-wash">{event.type}</span>}
|
|
91
|
+
{event.id && <span class="sh-live" data-bg-live={event.id}></span>}
|
|
92
|
+
{event.closed && <span class="sh-closed">Registration closed</span>}
|
|
93
|
+
</p>
|
|
94
|
+
)}
|
|
95
|
+
{event.action && (
|
|
96
|
+
<p class="sh-action">
|
|
97
|
+
<a class:list={['button', 'button-small', event.closed ? 'button-quiet' : 'button-2']} href={event.action.href} rel={event.action.rel}>
|
|
98
|
+
{event.action.label}<span class="visually-hidden">: {event.title}</span>
|
|
99
|
+
</a>
|
|
100
|
+
</p>
|
|
101
|
+
)}
|
|
102
|
+
</li>
|
|
103
|
+
))}
|
|
104
|
+
</ul>
|
|
105
|
+
<p class="visually-hidden" role="status" data-shifts-showing></p>
|
|
106
|
+
<script is:inline>
|
|
107
|
+
(function (root) {
|
|
108
|
+
if (!root) return
|
|
109
|
+
var group = root.querySelector('[data-shifts-filters]')
|
|
110
|
+
var chips = group.querySelectorAll('[data-shifts-filter]')
|
|
111
|
+
var rows = root.querySelectorAll('[data-shift]')
|
|
112
|
+
var showing = root.querySelector('[data-shifts-showing]')
|
|
113
|
+
var pad = function (n) {
|
|
114
|
+
return (n < 10 ? '0' : '') + n
|
|
115
|
+
}
|
|
116
|
+
var key = function (d) {
|
|
117
|
+
return d.getFullYear() + '-' + pad(d.getMonth() + 1) + '-' + pad(d.getDate())
|
|
118
|
+
}
|
|
119
|
+
// The coming Saturday and Sunday in the visitor's own time; on a Sunday, that day.
|
|
120
|
+
var now = new Date()
|
|
121
|
+
var weekday = now.getDay()
|
|
122
|
+
var weekend = []
|
|
123
|
+
if (weekday === 0) weekend.push(key(now))
|
|
124
|
+
else for (var d = 6 - weekday; d <= 7 - weekday; d++) weekend.push(key(new Date(now.getFullYear(), now.getMonth(), now.getDate() + d)))
|
|
125
|
+
var matches = function (row, filter) {
|
|
126
|
+
if (!filter) return true
|
|
127
|
+
if (filter === 'weekend') return weekend.indexOf(row.getAttribute('data-day')) >= 0
|
|
128
|
+
return 'type:' + row.getAttribute('data-type') === filter
|
|
129
|
+
}
|
|
130
|
+
var count = function (n) {
|
|
131
|
+
return n + (n === 1 ? ' event' : ' events')
|
|
132
|
+
}
|
|
133
|
+
var choose = function (chip) {
|
|
134
|
+
var filter = chip.getAttribute('data-shifts-filter')
|
|
135
|
+
var shown = 0
|
|
136
|
+
for (var c = 0; c < chips.length; c++) chips[c].setAttribute('aria-pressed', chips[c] === chip ? 'true' : 'false')
|
|
137
|
+
for (var r = 0; r < rows.length; r++) {
|
|
138
|
+
var match = matches(rows[r], filter)
|
|
139
|
+
rows[r].hidden = !match
|
|
140
|
+
if (match) shown++
|
|
141
|
+
}
|
|
142
|
+
showing.textContent = filter
|
|
143
|
+
? 'Showing ' + shown + ' of ' + count(rows.length) + ': ' + (filter === 'weekend' ? 'this weekend' : chip.textContent) + '.'
|
|
144
|
+
: 'Showing all ' + count(rows.length) + '.'
|
|
145
|
+
}
|
|
146
|
+
// This weekend is offered only when it would narrow the list.
|
|
147
|
+
var weekendChip = group.querySelector('[data-shifts-filter="weekend"]')
|
|
148
|
+
var onWeekend = 0
|
|
149
|
+
for (var r = 0; r < rows.length; r++) if (matches(rows[r], 'weekend')) onWeekend++
|
|
150
|
+
weekendChip.hidden = onWeekend === 0 || onWeekend === rows.length
|
|
151
|
+
var offered = 0
|
|
152
|
+
for (var c = 0; c < chips.length; c++) {
|
|
153
|
+
if (chips[c].getAttribute('data-shifts-filter') && !chips[c].hidden) offered++
|
|
154
|
+
chips[c].addEventListener('click', function (event) {
|
|
155
|
+
choose(event.currentTarget)
|
|
156
|
+
})
|
|
157
|
+
}
|
|
158
|
+
group.hidden = offered === 0
|
|
159
|
+
})(document.currentScript.closest('[data-shifts]'))
|
|
160
|
+
</script>
|
|
161
|
+
</div>
|
|
162
|
+
) : (
|
|
163
|
+
<p class="sh-empty">{invitation ?? 'No upcoming events right now.'}</p>
|
|
164
|
+
)}
|
|
165
|
+
<LiveCounts />
|
|
166
|
+
</Band>
|
|
167
|
+
)}
|
|
168
|
+
|
|
169
|
+
<style>
|
|
170
|
+
.sh-filters {
|
|
171
|
+
display: flex;
|
|
172
|
+
flex-wrap: wrap;
|
|
173
|
+
gap: 0.5rem;
|
|
174
|
+
margin: 0 0 1rem;
|
|
175
|
+
}
|
|
176
|
+
.sh-filters[hidden],
|
|
177
|
+
.sh-filters button[hidden] {
|
|
178
|
+
display: none;
|
|
179
|
+
}
|
|
180
|
+
.sh-filters button {
|
|
181
|
+
min-height: 2.75rem;
|
|
182
|
+
padding: 0.375rem 1rem;
|
|
183
|
+
border: 1.5px solid color-mix(in srgb, var(--ink) 25%, transparent);
|
|
184
|
+
border-radius: var(--pill);
|
|
185
|
+
background: transparent;
|
|
186
|
+
color: var(--ink);
|
|
187
|
+
font: inherit;
|
|
188
|
+
font-size: var(--text-sm);
|
|
189
|
+
font-weight: 600;
|
|
190
|
+
cursor: pointer;
|
|
191
|
+
}
|
|
192
|
+
.sh-filters button:hover {
|
|
193
|
+
border-color: var(--ink);
|
|
194
|
+
}
|
|
195
|
+
.sh-filters button[aria-pressed='true'] {
|
|
196
|
+
border-color: var(--button);
|
|
197
|
+
background: var(--button);
|
|
198
|
+
color: var(--button-ink);
|
|
199
|
+
}
|
|
200
|
+
.sh-list {
|
|
201
|
+
display: grid;
|
|
202
|
+
gap: 0.75rem;
|
|
203
|
+
margin: 0;
|
|
204
|
+
padding: 0;
|
|
205
|
+
list-style: none;
|
|
206
|
+
}
|
|
207
|
+
/* A phone: the tile beside the title, the chip and counts under the title, the button across the bottom. */
|
|
208
|
+
.sh-row {
|
|
209
|
+
display: grid;
|
|
210
|
+
grid-template-columns: 3.75rem minmax(0, 1fr);
|
|
211
|
+
grid-template-areas:
|
|
212
|
+
'tile body'
|
|
213
|
+
'tile facts'
|
|
214
|
+
'action action';
|
|
215
|
+
gap: 0.5rem 1rem;
|
|
216
|
+
align-items: center;
|
|
217
|
+
min-width: 0;
|
|
218
|
+
padding: 1rem;
|
|
219
|
+
border: 1px solid var(--line);
|
|
220
|
+
border-radius: var(--radius-card);
|
|
221
|
+
background: var(--surface);
|
|
222
|
+
}
|
|
223
|
+
.sh-row[hidden] {
|
|
224
|
+
display: none;
|
|
225
|
+
}
|
|
226
|
+
.sh-row > * {
|
|
227
|
+
margin: 0;
|
|
228
|
+
}
|
|
229
|
+
.sh-tile {
|
|
230
|
+
grid-area: tile;
|
|
231
|
+
align-self: start;
|
|
232
|
+
display: grid;
|
|
233
|
+
justify-items: center;
|
|
234
|
+
padding: 0.5rem 0 0.5625rem;
|
|
235
|
+
border-radius: var(--radius);
|
|
236
|
+
background: color-mix(in srgb, var(--ink) 5%, transparent);
|
|
237
|
+
line-height: 1;
|
|
238
|
+
text-align: center;
|
|
239
|
+
}
|
|
240
|
+
.sh-tile b {
|
|
241
|
+
font-family: var(--font-display);
|
|
242
|
+
font-size: 1.75rem;
|
|
243
|
+
font-weight: 800;
|
|
244
|
+
letter-spacing: -0.02em;
|
|
245
|
+
}
|
|
246
|
+
.sh-month {
|
|
247
|
+
margin-bottom: 0.3125rem;
|
|
248
|
+
color: var(--accent);
|
|
249
|
+
font-size: var(--text-xs);
|
|
250
|
+
font-weight: 700;
|
|
251
|
+
letter-spacing: 0.14em;
|
|
252
|
+
text-transform: uppercase;
|
|
253
|
+
}
|
|
254
|
+
.sh-weekday {
|
|
255
|
+
margin-top: 0.3125rem;
|
|
256
|
+
color: var(--muted);
|
|
257
|
+
font-size: 0.6875rem;
|
|
258
|
+
font-weight: 700;
|
|
259
|
+
letter-spacing: 0.08em;
|
|
260
|
+
text-transform: uppercase;
|
|
261
|
+
}
|
|
262
|
+
.sh-body {
|
|
263
|
+
grid-area: body;
|
|
264
|
+
min-width: 0;
|
|
265
|
+
}
|
|
266
|
+
.sh-body > * {
|
|
267
|
+
margin: 0;
|
|
268
|
+
}
|
|
269
|
+
.sh-title {
|
|
270
|
+
font-family: var(--font-display);
|
|
271
|
+
font-size: var(--text-lg);
|
|
272
|
+
font-weight: 700;
|
|
273
|
+
line-height: 1.25;
|
|
274
|
+
letter-spacing: -0.01em;
|
|
275
|
+
}
|
|
276
|
+
.sh-title a {
|
|
277
|
+
color: var(--ink);
|
|
278
|
+
text-decoration: none;
|
|
279
|
+
}
|
|
280
|
+
.sh-title a:hover {
|
|
281
|
+
text-decoration: underline;
|
|
282
|
+
}
|
|
283
|
+
.sh-meta {
|
|
284
|
+
margin-top: 0.25rem;
|
|
285
|
+
color: var(--muted);
|
|
286
|
+
font-size: var(--text-sm);
|
|
287
|
+
}
|
|
288
|
+
.sh-meta a {
|
|
289
|
+
white-space: nowrap;
|
|
290
|
+
}
|
|
291
|
+
.sh-facts {
|
|
292
|
+
grid-area: facts;
|
|
293
|
+
display: flex;
|
|
294
|
+
flex-wrap: wrap;
|
|
295
|
+
align-items: center;
|
|
296
|
+
gap: 0.375rem 0.75rem;
|
|
297
|
+
font-size: var(--text-sm);
|
|
298
|
+
}
|
|
299
|
+
.sh-live {
|
|
300
|
+
color: var(--ink);
|
|
301
|
+
font-weight: 700;
|
|
302
|
+
}
|
|
303
|
+
.sh-live:empty {
|
|
304
|
+
display: none;
|
|
305
|
+
}
|
|
306
|
+
.sh-closed {
|
|
307
|
+
color: var(--muted);
|
|
308
|
+
font-weight: 700;
|
|
309
|
+
}
|
|
310
|
+
.sh-action {
|
|
311
|
+
grid-area: action;
|
|
312
|
+
}
|
|
313
|
+
.sh-action .button {
|
|
314
|
+
width: 100%;
|
|
315
|
+
}
|
|
316
|
+
.sh-empty {
|
|
317
|
+
margin: 0;
|
|
318
|
+
padding: 1.125rem 1.25rem;
|
|
319
|
+
border: 2px dashed color-mix(in srgb, var(--ink) 22%, transparent);
|
|
320
|
+
border-radius: var(--radius);
|
|
321
|
+
color: var(--muted);
|
|
322
|
+
}
|
|
323
|
+
/* Wider: one line per event, the chip and counts and the button at the right. */
|
|
324
|
+
@media (min-width: 48rem) {
|
|
325
|
+
.sh-row {
|
|
326
|
+
grid-template-columns: 4.25rem minmax(0, 1fr) auto auto;
|
|
327
|
+
grid-template-areas: 'tile body facts action';
|
|
328
|
+
gap: 0 1.5rem;
|
|
329
|
+
padding: 1rem 1.25rem;
|
|
330
|
+
}
|
|
331
|
+
.sh-tile {
|
|
332
|
+
align-self: center;
|
|
333
|
+
}
|
|
334
|
+
.sh-tile b {
|
|
335
|
+
font-size: 2rem;
|
|
336
|
+
}
|
|
337
|
+
.sh-facts {
|
|
338
|
+
justify-content: flex-end;
|
|
339
|
+
max-width: 16rem;
|
|
340
|
+
text-align: right;
|
|
341
|
+
}
|
|
342
|
+
.sh-action .button {
|
|
343
|
+
width: auto;
|
|
344
|
+
min-width: 7.5rem;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
348
|
+
.sh-filters button {
|
|
349
|
+
transition:
|
|
350
|
+
background-color 0.15s ease,
|
|
351
|
+
border-color 0.15s ease,
|
|
352
|
+
color 0.15s ease;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
</style>
|