@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.
Files changed (340) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +12 -2
  3. package/dist/chunk-KOB36GSF.js +62 -0
  4. package/dist/constants-DvTNj4JI.d-Batjcj3Z.d.ts +38 -0
  5. package/dist/content-api-CYeY0vU8.d.ts +849 -0
  6. package/dist/contract/content-api-examples.d.ts +58 -0
  7. package/dist/contract/content-api-examples.js +783 -0
  8. package/dist/contract/content-api.d.ts +2 -0
  9. package/dist/contract/content-api.js +1 -0
  10. package/dist/contract/site-templates.d.ts +252 -0
  11. package/dist/contract/site-templates.js +185 -0
  12. package/package.json +70 -3
  13. package/src/components/EntryCard.astro +35 -0
  14. package/src/components/EventMap.astro +118 -0
  15. package/src/components/EventPage.astro +194 -0
  16. package/src/components/FieldValue.astro +41 -0
  17. package/src/components/LeadingHero.astro +21 -0
  18. package/src/components/NotFound.astro +20 -0
  19. package/src/components/PageSections.astro +47 -0
  20. package/src/components/Prose.astro +18 -0
  21. package/src/components/chrome/Brand.astro +54 -0
  22. package/src/components/chrome/ClosingCall.astro +94 -0
  23. package/src/components/chrome/DonateStrip.astro +61 -0
  24. package/src/components/chrome/FooterColumns.astro +32 -0
  25. package/src/components/chrome/FooterContact.astro +28 -0
  26. package/src/components/chrome/MenuList.astro +45 -0
  27. package/src/components/chrome/ModeToggle.astro +125 -0
  28. package/src/components/chrome/SignedInNotice.astro +53 -0
  29. package/src/components/chrome/SignupBand.astro +12 -0
  30. package/src/components/chrome/TakeoverBanner.astro +56 -0
  31. package/src/components/chrome/VisitorAccount.astro +82 -0
  32. package/src/components/entries/AuthorBox.astro +47 -0
  33. package/src/components/entries/EntryFields.astro +29 -0
  34. package/src/components/entries/EntryHeader.astro +77 -0
  35. package/src/components/entries/ListFrame.astro +126 -0
  36. package/src/components/entries/ListSearch.astro +24 -0
  37. package/src/components/entries/Share.astro +24 -0
  38. package/src/components/entries/course/classroom.astro +26 -0
  39. package/src/components/entries/course/lesson.astro +18 -0
  40. package/src/components/entries/course/section.ts +20 -0
  41. package/src/components/entries/course/syllabus.astro +15 -0
  42. package/src/components/entries/index.ts +77 -0
  43. package/src/components/entries/newsletter/issue.astro +41 -0
  44. package/src/components/entries/newsletter/list.astro +26 -0
  45. package/src/components/entries/podcast/episode.astro +42 -0
  46. package/src/components/entries/podcast/list.astro +36 -0
  47. package/src/components/entries/post/article.astro +31 -0
  48. package/src/components/entries/post/list.astro +85 -0
  49. package/src/components/entries/props.ts +61 -0
  50. package/src/components/entries/video/cards.astro +39 -0
  51. package/src/components/entries/video/grid.astro +15 -0
  52. package/src/components/entries/video/watch.astro +41 -0
  53. package/src/components/live/LivePage.astro +215 -0
  54. package/src/components/live/LocalTime.astro +29 -0
  55. package/src/components/sections/About/books.astro +188 -0
  56. package/src/components/sections/About/credentials.ts +90 -0
  57. package/src/components/sections/About/index.astro +57 -0
  58. package/src/components/sections/About/left.astro +54 -0
  59. package/src/components/sections/About/letter.astro +108 -0
  60. package/src/components/sections/About/portrait.astro +308 -0
  61. package/src/components/sections/Advocacy/compact.astro +14 -0
  62. package/src/components/sections/Advocacy/index.astro +14 -0
  63. package/src/components/sections/Band.astro +39 -0
  64. package/src/components/sections/Blog/feature.astro +176 -0
  65. package/src/components/sections/Blog/index.astro +37 -0
  66. package/src/components/sections/Blog/latest.ts +80 -0
  67. package/src/components/sections/Blog/list.astro +186 -0
  68. package/src/components/sections/Booking/index.astro +139 -0
  69. package/src/components/sections/Booking/list.astro +144 -0
  70. package/src/components/sections/Booking/types.ts +60 -0
  71. package/src/components/sections/Calendar/agenda.astro +14 -0
  72. package/src/components/sections/Calendar/index.astro +14 -0
  73. package/src/components/sections/CandidateRoster/ballot.astro +394 -0
  74. package/src/components/sections/CandidateRoster/candidates.ts +69 -0
  75. package/src/components/sections/CandidateRoster/compact.astro +115 -0
  76. package/src/components/sections/CandidateRoster/index.astro +57 -0
  77. package/src/components/sections/CaseStudies/beforeafter.astro +222 -0
  78. package/src/components/sections/CaseStudies/cases.ts +111 -0
  79. package/src/components/sections/CaseStudies/grid.astro +261 -0
  80. package/src/components/sections/CaseStudies/index.astro +333 -0
  81. package/src/components/sections/Classroom/CourseCard.astro +181 -0
  82. package/src/components/sections/Classroom/Courses.astro +88 -0
  83. package/src/components/sections/Classroom/classroom.ts +141 -0
  84. package/src/components/sections/Classroom/index.astro +20 -0
  85. package/src/components/sections/Classroom/list.astro +15 -0
  86. package/src/components/sections/Collection/compact.astro +7 -0
  87. package/src/components/sections/Collection/entries.ts +62 -0
  88. package/src/components/sections/Collection/feature.astro +180 -0
  89. package/src/components/sections/Collection/index.astro +46 -0
  90. package/src/components/sections/Collection/library.astro +271 -0
  91. package/src/components/sections/Collection/list.astro +7 -0
  92. package/src/components/sections/Collection/outline.astro +134 -0
  93. package/src/components/sections/Collection/shelves.astro +191 -0
  94. package/src/components/sections/Comparison/Unlisted.astro +6 -0
  95. package/src/components/sections/Comparison/cards.astro +171 -0
  96. package/src/components/sections/Comparison/index.astro +191 -0
  97. package/src/components/sections/Comparison/sides.ts +98 -0
  98. package/src/components/sections/Comparison/spectrum.astro +261 -0
  99. package/src/components/sections/ContentPost/banner.astro +152 -0
  100. package/src/components/sections/ContentPost/index.astro +35 -0
  101. package/src/components/sections/ContentPost/lesson.ts +119 -0
  102. package/src/components/sections/ContentPost/player.astro +254 -0
  103. package/src/components/sections/ContentPost/theater.astro +329 -0
  104. package/src/components/sections/Countdown/index.astro +53 -0
  105. package/src/components/sections/Course/Bar.astro +46 -0
  106. package/src/components/sections/Course/CourseHead.astro +123 -0
  107. package/src/components/sections/Course/Crumbs.astro +44 -0
  108. package/src/components/sections/Course/Icon.astro +29 -0
  109. package/src/components/sections/Course/Ring.astro +62 -0
  110. package/src/components/sections/Course/Syllabus.astro +146 -0
  111. package/src/components/sections/Course/course.ts +146 -0
  112. package/src/components/sections/Course/index.astro +143 -0
  113. package/src/components/sections/Course/outline.astro +39 -0
  114. package/src/components/sections/Cta/banner.astro +64 -0
  115. package/src/components/sections/Cta/card.astro +88 -0
  116. package/src/components/sections/Cta/index.astro +31 -0
  117. package/src/components/sections/Cta/photo.astro +114 -0
  118. package/src/components/sections/Cta/strip.astro +91 -0
  119. package/src/components/sections/Donate/index.astro +136 -0
  120. package/src/components/sections/Donate/story.astro +7 -0
  121. package/src/components/sections/Event/card.astro +14 -0
  122. package/src/components/sections/Event/index.astro +14 -0
  123. package/src/components/sections/EventsList/AgendaMonths.astro +105 -0
  124. package/src/components/sections/EventsList/CalendarLine.astro +23 -0
  125. package/src/components/sections/EventsList/EventRows.astro +196 -0
  126. package/src/components/sections/EventsList/LiveCounts.astro +75 -0
  127. package/src/components/sections/EventsList/TypeTabs.astro +53 -0
  128. package/src/components/sections/EventsList/agenda.astro +55 -0
  129. package/src/components/sections/EventsList/calendar.astro +392 -0
  130. package/src/components/sections/EventsList/cards.astro +186 -0
  131. package/src/components/sections/EventsList/cohorts.astro +205 -0
  132. package/src/components/sections/EventsList/compact.astro +163 -0
  133. package/src/components/sections/EventsList/events.ts +168 -0
  134. package/src/components/sections/EventsList/index.astro +46 -0
  135. package/src/components/sections/EventsList/map.astro +436 -0
  136. package/src/components/sections/EventsList/shifts.astro +355 -0
  137. package/src/components/sections/EventsList/week.astro +361 -0
  138. package/src/components/sections/Faq/Contact.astro +63 -0
  139. package/src/components/sections/Faq/Questions.astro +98 -0
  140. package/src/components/sections/Faq/cards.astro +74 -0
  141. package/src/components/sections/Faq/faq.ts +101 -0
  142. package/src/components/sections/Faq/index.astro +49 -0
  143. package/src/components/sections/Faq/topics.astro +178 -0
  144. package/src/components/sections/Financials/Foot.astro +38 -0
  145. package/src/components/sections/Financials/Head.astro +47 -0
  146. package/src/components/sections/Financials/donut.astro +197 -0
  147. package/src/components/sections/Financials/financials.ts +52 -0
  148. package/src/components/sections/Financials/index.astro +148 -0
  149. package/src/components/sections/Financials/table.astro +157 -0
  150. package/src/components/sections/FormBlock/index.astro +33 -0
  151. package/src/components/sections/FormBlock/wide.astro +7 -0
  152. package/src/components/sections/Hero/cover.astro +170 -0
  153. package/src/components/sections/Hero/donate.astro +209 -0
  154. package/src/components/sections/Hero/field.astro +390 -0
  155. package/src/components/sections/Hero/index.astro +52 -0
  156. package/src/components/sections/Hero/overlap.astro +151 -0
  157. package/src/components/sections/Hero/rotating.astro +30 -0
  158. package/src/components/sections/Hero/split.astro +96 -0
  159. package/src/components/sections/Hero/statement.astro +55 -0
  160. package/src/components/sections/Hero/video.astro +399 -0
  161. package/src/components/sections/Issues/checklist.astro +204 -0
  162. package/src/components/sections/Issues/drawer.astro +237 -0
  163. package/src/components/sections/Issues/index.astro +115 -0
  164. package/src/components/sections/Issues/issues.ts +37 -0
  165. package/src/components/sections/Issues/numbered.astro +79 -0
  166. package/src/components/sections/Issues/rows.astro +137 -0
  167. package/src/components/sections/Issues/steps.astro +81 -0
  168. package/src/components/sections/Issues/tabs.astro +322 -0
  169. package/src/components/sections/Leaderboard/index.astro +29 -0
  170. package/src/components/sections/Lesson/Door.astro +121 -0
  171. package/src/components/sections/Lesson/LessonBody.astro +416 -0
  172. package/src/components/sections/Lesson/Rail.astro +182 -0
  173. package/src/components/sections/Lesson/Tracker.astro +137 -0
  174. package/src/components/sections/Lesson/index.astro +27 -0
  175. package/src/components/sections/Lesson/lesson.ts +233 -0
  176. package/src/components/sections/Lesson/reading.astro +21 -0
  177. package/src/components/sections/Map/CoverageLine.astro +19 -0
  178. package/src/components/sections/Map/RegionMap.astro +109 -0
  179. package/src/components/sections/Map/bar.astro +160 -0
  180. package/src/components/sections/Map/index.astro +192 -0
  181. package/src/components/sections/Map/map.astro +275 -0
  182. package/src/components/sections/MediaKit/BioCard.astro +108 -0
  183. package/src/components/sections/MediaKit/Downloads.astro +88 -0
  184. package/src/components/sections/MediaKit/index.astro +183 -0
  185. package/src/components/sections/MediaKit/kit.ts +140 -0
  186. package/src/components/sections/MediaKit/press.astro +189 -0
  187. package/src/components/sections/MediaKit/speaker.astro +205 -0
  188. package/src/components/sections/Membership/Benefits.astro +42 -0
  189. package/src/components/sections/Membership/Check.astro +12 -0
  190. package/src/components/sections/Membership/Price.astro +61 -0
  191. package/src/components/sections/Membership/compare.astro +312 -0
  192. package/src/components/sections/Membership/index.astro +281 -0
  193. package/src/components/sections/Membership/offers.ts +169 -0
  194. package/src/components/sections/Membership/tiers.astro +217 -0
  195. package/src/components/sections/MovementMap/index.astro +50 -0
  196. package/src/components/sections/MovementTicker/index.astro +43 -0
  197. package/src/components/sections/Pathways/Doors.astro +147 -0
  198. package/src/components/sections/Pathways/Head.astro +37 -0
  199. package/src/components/sections/Pathways/index.astro +27 -0
  200. package/src/components/sections/Pathways/pathways.ts +100 -0
  201. package/src/components/sections/Pathways/quiz.astro +286 -0
  202. package/src/components/sections/Pathways/tabs.astro +271 -0
  203. package/src/components/sections/PdfEmbed/card.astro +99 -0
  204. package/src/components/sections/PdfEmbed/index.astro +26 -0
  205. package/src/components/sections/PdfEmbed/medium.astro +7 -0
  206. package/src/components/sections/PdfEmbed/tall.astro +7 -0
  207. package/src/components/sections/Petition/coverage.astro +14 -0
  208. package/src/components/sections/Petition/image.astro +14 -0
  209. package/src/components/sections/Petition/index.astro +14 -0
  210. package/src/components/sections/Petition/map.astro +14 -0
  211. package/src/components/sections/PlatformPlanks/anchors.ts +66 -0
  212. package/src/components/sections/PlatformPlanks/columns.astro +171 -0
  213. package/src/components/sections/PlatformPlanks/index.astro +56 -0
  214. package/src/components/sections/PlatformPlanks/longread.astro +250 -0
  215. package/src/components/sections/PollBlock/index.astro +30 -0
  216. package/src/components/sections/Portfolio/featured.astro +343 -0
  217. package/src/components/sections/Portfolio/index.astro +571 -0
  218. package/src/components/sections/Portfolio/strip.astro +173 -0
  219. package/src/components/sections/Portfolio/work.ts +100 -0
  220. package/src/components/sections/Progress/MatchClock.astro +166 -0
  221. package/src/components/sections/Progress/compact.astro +150 -0
  222. package/src/components/sections/Progress/index.astro +32 -0
  223. package/src/components/sections/Progress/match.astro +126 -0
  224. package/src/components/sections/Progress/ring.astro +179 -0
  225. package/src/components/sections/QuickDonate/DonateCard.astro +149 -0
  226. package/src/components/sections/QuickDonate/Picker.astro +95 -0
  227. package/src/components/sections/QuickDonate/band.astro +164 -0
  228. package/src/components/sections/QuickDonate/bar.astro +208 -0
  229. package/src/components/sections/QuickDonate/donate.ts +126 -0
  230. package/src/components/sections/QuickDonate/hero.astro +143 -0
  231. package/src/components/sections/QuickDonate/index.astro +73 -0
  232. package/src/components/sections/QuickDonate/jar.astro +225 -0
  233. package/src/components/sections/QuickDonate/ladder.astro +248 -0
  234. package/src/components/sections/QuoteStrip/carousel.astro +340 -0
  235. package/src/components/sections/QuoteStrip/index.astro +58 -0
  236. package/src/components/sections/QuoteStrip/logos.astro +226 -0
  237. package/src/components/sections/QuoteStrip/quotes.ts +61 -0
  238. package/src/components/sections/QuoteStrip/single.astro +92 -0
  239. package/src/components/sections/QuoteStrip/ticker.astro +319 -0
  240. package/src/components/sections/QuoteStrip/wall.astro +113 -0
  241. package/src/components/sections/Resources/band.astro +93 -0
  242. package/src/components/sections/Resources/featured.astro +239 -0
  243. package/src/components/sections/Resources/index.astro +225 -0
  244. package/src/components/sections/Resources/resources.ts +92 -0
  245. package/src/components/sections/SampleBallot/Position.astro +39 -0
  246. package/src/components/sections/SampleBallot/ballot.ts +92 -0
  247. package/src/components/sections/SampleBallot/cards.astro +299 -0
  248. package/src/components/sections/SampleBallot/index.astro +326 -0
  249. package/src/components/sections/SampleBallot/measures.astro +172 -0
  250. package/src/components/sections/Scorecard/grades.astro +141 -0
  251. package/src/components/sections/Scorecard/index.astro +294 -0
  252. package/src/components/sections/Scorecard/promise.astro +167 -0
  253. package/src/components/sections/Scorecard/votes.ts +83 -0
  254. package/src/components/sections/SectionHead.astro +31 -0
  255. package/src/components/sections/Services/Button.astro +24 -0
  256. package/src/components/sections/Services/Check.astro +12 -0
  257. package/src/components/sections/Services/Includes.astro +42 -0
  258. package/src/components/sections/Services/compare.astro +328 -0
  259. package/src/components/sections/Services/index.astro +187 -0
  260. package/src/components/sections/Services/list.astro +181 -0
  261. package/src/components/sections/Services/services.ts +80 -0
  262. package/src/components/sections/ShareKit/Actions.astro +71 -0
  263. package/src/components/sections/ShareKit/Buttons.astro +62 -0
  264. package/src/components/sections/ShareKit/compact.astro +123 -0
  265. package/src/components/sections/ShareKit/index.astro +160 -0
  266. package/src/components/sections/ShareKit/share.ts +60 -0
  267. package/src/components/sections/ShareKit/strip.astro +173 -0
  268. package/src/components/sections/SignupCapture/band.astro +7 -0
  269. package/src/components/sections/SignupCapture/index.astro +103 -0
  270. package/src/components/sections/SignupCapture/inline.astro +7 -0
  271. package/src/components/sections/SocialFeed/index.astro +34 -0
  272. package/src/components/sections/StatCards/feature.astro +143 -0
  273. package/src/components/sections/StatCards/index.astro +51 -0
  274. package/src/components/sections/StatCards/ribbon.astro +113 -0
  275. package/src/components/sections/StatCards/wall.astro +177 -0
  276. package/src/components/sections/Store/featured.astro +14 -0
  277. package/src/components/sections/Store/index.astro +14 -0
  278. package/src/components/sections/Stories/Status.astro +42 -0
  279. package/src/components/sections/Stories/StoryCards.astro +171 -0
  280. package/src/components/sections/Stories/cards.astro +42 -0
  281. package/src/components/sections/Stories/index.astro +238 -0
  282. package/src/components/sections/Stories/stories.ts +97 -0
  283. package/src/components/sections/Stories/timeline.astro +135 -0
  284. package/src/components/sections/TeamGrid/board.astro +280 -0
  285. package/src/components/sections/TeamGrid/index.astro +71 -0
  286. package/src/components/sections/TeamGrid/list.astro +306 -0
  287. package/src/components/sections/TeamGrid/people.ts +178 -0
  288. package/src/components/sections/VideoEmbed/index.astro +52 -0
  289. package/src/components/sections/VideoEmbed/landscape.astro +7 -0
  290. package/src/components/sections/VideoEmbed/portrait.astro +7 -0
  291. package/src/components/sections/VideoEmbed/square.astro +7 -0
  292. package/src/components/sections/VoterTools/DaysLeft.astro +33 -0
  293. package/src/components/sections/VoterTools/dates.astro +149 -0
  294. package/src/components/sections/VoterTools/index.astro +228 -0
  295. package/src/components/sections/VoterTools/polling.astro +141 -0
  296. package/src/components/sections/VoterTools/voter-tools.ts +70 -0
  297. package/src/components/sections/index.ts +370 -0
  298. package/src/components/sections/modules/Headed.astro +39 -0
  299. package/src/components/sections/modules/ModuleFrame.astro +179 -0
  300. package/src/components/volunteer/ShiftLive.astro +90 -0
  301. package/src/components/volunteer/detail.astro +247 -0
  302. package/src/components/volunteer/list.astro +298 -0
  303. package/src/components/volunteer/props.ts +21 -0
  304. package/src/env.d.ts +22 -0
  305. package/src/index.d.ts +10 -0
  306. package/src/index.js +64 -0
  307. package/src/layouts/Site.astro +371 -0
  308. package/src/lib/academy.ts +146 -0
  309. package/src/lib/brand.ts +534 -0
  310. package/src/lib/chrome.ts +119 -0
  311. package/src/lib/donate-frame.ts +64 -0
  312. package/src/lib/entries.ts +190 -0
  313. package/src/lib/env.ts +34 -0
  314. package/src/lib/event-map-draw.ts +91 -0
  315. package/src/lib/events.ts +476 -0
  316. package/src/lib/fonts.ts +116 -0
  317. package/src/lib/footer.ts +24 -0
  318. package/src/lib/format.ts +160 -0
  319. package/src/lib/geo.ts +131 -0
  320. package/src/lib/live.ts +54 -0
  321. package/src/lib/menu.ts +48 -0
  322. package/src/lib/petition-text.ts +29 -0
  323. package/src/lib/reading.ts +17 -0
  324. package/src/lib/regions.ts +215 -0
  325. package/src/lib/section.ts +94 -0
  326. package/src/lib/shifts.ts +186 -0
  327. package/src/lib/stream-time.ts +20 -0
  328. package/src/lib/stream.ts +141 -0
  329. package/src/lib/visitor.ts +54 -0
  330. package/src/routes/catch-all.astro +286 -0
  331. package/src/routes/form.astro +30 -0
  332. package/src/routes/live.astro +49 -0
  333. package/src/routes/not-found.astro +18 -0
  334. package/src/routes/preview.astro +60 -0
  335. package/src/routes/setup.astro +62 -0
  336. package/src/routes/volunteer-shift.astro +61 -0
  337. package/src/routes/volunteer.astro +37 -0
  338. package/src/styles/entries.css +784 -0
  339. package/src/styles/site.css +1839 -0
  340. package/src/template.ts +182 -0
@@ -0,0 +1,571 @@
1
+ ---
2
+ // Portfolio · Grid, the default (mock 13, A, with C as its open state): the
3
+ // kicker and heading, the body, then the work as picture cards, three
4
+ // across on a wide screen, two on a tablet and one on a phone. Each card
5
+ // opens with its picture at 16:10 (or, with none, the title large on a
6
+ // panel of the band's surface) with the kind laid over its corner as a
7
+ // small tag, then the title and "Client: … · 2024" in the muted ink.
8
+ //
9
+ // When the work names more than one kind, a chip per kind ("All" first,
10
+ // then each kind in row order) narrows the cards to that kind, with
11
+ // "Showing N of M." for a screen reader. Clicking a card opens the
12
+ // section's one lightbox, a native <dialog> filled with that piece: its
13
+ // pictures as a gallery (Prev, Next and a dot per picture, the arrow keys
14
+ // too), the kind and year in small capitals, the title, the summary, the
15
+ // "Role:" and "Result:" lines and, when the piece has a page, a button to
16
+ // it. Escape, the close button and a click outside close it, and focus
17
+ // returns to the card. The chips and the lightbox are the section's
18
+ // script: without it the chips stay hidden and each card is a plain link
19
+ // to the piece's page, or to its picture when it has none. Nothing is
20
+ // drawn with no work and no heading.
21
+ import type { Section } from '@backgold/content'
22
+ import Band from '../Band.astro'
23
+ import SectionHead from '../SectionHead.astro'
24
+ import Prose from '../../Prose.astro'
25
+ import { text } from '../../../lib/format'
26
+ import { creditOf, idFor, kindAndYear, kindsOf, targetOf, workOf } from './work'
27
+
28
+ interface Props {
29
+ section: Section
30
+ variant?: string
31
+ }
32
+
33
+ const { section } = Astro.props
34
+ const kicker = text(section.copy.kicker)
35
+ const heading = text(section.copy.heading)
36
+ const clientLabel = text(section.copy.clientLabel)?.trim() ?? null
37
+ const work = workOf(section)
38
+ const kinds = kindsOf(work)
39
+ const filter = kinds.length > 1
40
+ const gridId = idFor(section, 'work')
41
+ const boxId = idFor(section, 'lightbox')
42
+ ---
43
+ {(heading || work.length > 0) && (
44
+ <Band section={section} class="portfolio portfolio-grid">
45
+ <SectionHead kicker={kicker} heading={heading} more={[]} />
46
+ <Prose value={section.copy.body} class="lede" />
47
+ {work.length > 0 && (
48
+ <div class="work" data-portfolio>
49
+ {filter && (
50
+ <div class="work-kinds" role="group" aria-label="Filter by kind" data-work-kinds hidden>
51
+ <button type="button" aria-pressed="true" aria-controls={gridId} data-work-kind="">All</button>
52
+ {kinds.map((kind) => (
53
+ <button type="button" aria-pressed="false" aria-controls={gridId} data-work-kind={kind}>{kind}</button>
54
+ ))}
55
+ </div>
56
+ )}
57
+ <ul class="work-grid" id={gridId} role="list">
58
+ {work.map((piece) => {
59
+ const target = targetOf(piece)
60
+ const credit = creditOf(piece, clientLabel)
61
+ return (
62
+ <li class="work-card" data-work-card data-kind={piece.kind ?? ''}>
63
+ <div class:list={['work-frame', !piece.pictures[0] && 'work-frame-words']}>
64
+ {piece.pictures[0] ? (
65
+ <img class="work-photo" src={piece.pictures[0]} alt="" loading="lazy" decoding="async" />
66
+ ) : (
67
+ <p class="work-frame-title" aria-hidden="true">{piece.title}</p>
68
+ )}
69
+ {piece.kind && <p class="work-tag">{piece.kind}</p>}
70
+ </div>
71
+ <h3 class="work-title">
72
+ {target ? <a href={target.href} rel={target.rel} data-work-open>{piece.title}</a> : <span data-work-open>{piece.title}</span>}
73
+ </h3>
74
+ {credit && <p class="work-credit">{credit}</p>}
75
+ </li>
76
+ )
77
+ })}
78
+ </ul>
79
+ {filter && <p class="visually-hidden" role="status" data-work-showing></p>}
80
+ <dialog class="work-box bg-band-contrast" id={boxId} data-work-box>
81
+ <div class="work-box-inner">
82
+ <button type="button" class="work-box-close" data-work-close>
83
+ <svg viewBox="0 0 16 16" width="18" height="18" aria-hidden="true" focusable="false"><path d="M3.5 3.5l9 9M12.5 3.5l-9 9" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" /></svg>
84
+ <span class="visually-hidden">Close</span>
85
+ </button>
86
+ {work.map((piece, i) => {
87
+ const titleId = `${boxId}-title-${i}`
88
+ const line = kindAndYear(piece)
89
+ const count = piece.pictures.length
90
+ return (
91
+ <div class:list={['work-panel', count > 0 && 'work-panel-pictured']} data-work-panel data-title-id={titleId} hidden>
92
+ {count > 0 && (
93
+ <div class="work-gallery" data-work-gallery>
94
+ <div class="work-gallery-frame">
95
+ {piece.pictures.map((src, p) => (
96
+ <img
97
+ class="work-gallery-photo"
98
+ src={src}
99
+ alt={count > 1 ? `${piece.title}, picture ${p + 1} of ${count}` : piece.title}
100
+ loading="lazy"
101
+ decoding="async"
102
+ data-work-picture
103
+ hidden={p > 0}
104
+ />
105
+ ))}
106
+ </div>
107
+ {count > 1 && (
108
+ <div class="work-gallery-nav">
109
+ <button type="button" class="work-step" data-work-step="-1" aria-label="Previous picture">
110
+ <span aria-hidden="true">&larr;</span> Prev
111
+ </button>
112
+ <div class="work-dots" role="group" aria-label="Pictures">
113
+ {piece.pictures.map((_, p) => (
114
+ <button type="button" class="work-dot" data-work-dot={p} aria-label={`Picture ${p + 1} of ${count}`} aria-current={p === 0 ? 'true' : undefined}></button>
115
+ ))}
116
+ </div>
117
+ <button type="button" class="work-step" data-work-step="1" aria-label="Next picture">
118
+ Next <span aria-hidden="true">&rarr;</span>
119
+ </button>
120
+ </div>
121
+ )}
122
+ </div>
123
+ )}
124
+ <div class="work-panel-words">
125
+ {line && <p class="work-panel-kind">{line}</p>}
126
+ <h2 class="work-panel-title" id={titleId}>{piece.title}</h2>
127
+ {piece.summary && <p class="work-panel-summary">{piece.summary}</p>}
128
+ {piece.role && <p class="work-panel-fact"><strong>Role:</strong> {piece.role}</p>}
129
+ {piece.result && <p class="work-panel-fact"><strong>Result:</strong> {piece.result}</p>}
130
+ {piece.link && (
131
+ <p class="actions work-panel-actions">
132
+ <a class="button" href={piece.link.href} rel={piece.link.rel}>See the project</a>
133
+ </p>
134
+ )}
135
+ </div>
136
+ </div>
137
+ )
138
+ })}
139
+ </div>
140
+ </dialog>
141
+ <script is:inline>
142
+ ;(function (root) {
143
+ if (!root || typeof HTMLDialogElement !== 'function') return
144
+ var box = root.querySelector('[data-work-box]')
145
+ var panels = box.querySelectorAll('[data-work-panel]')
146
+ var cards = root.querySelectorAll('[data-work-card]')
147
+ var current = null
148
+ var opener = null
149
+
150
+ // The kind chips: narrow the cards, say how many show.
151
+ var group = root.querySelector('[data-work-kinds]')
152
+ if (group) {
153
+ var chips = group.querySelectorAll('[data-work-kind]')
154
+ var showing = root.querySelector('[data-work-showing]')
155
+ var choose = function (chip) {
156
+ var kind = chip.getAttribute('data-work-kind')
157
+ var shown = 0
158
+ for (var c = 0; c < chips.length; c++) chips[c].setAttribute('aria-pressed', chips[c] === chip ? 'true' : 'false')
159
+ for (var i = 0; i < cards.length; i++) {
160
+ var match = !kind || cards[i].getAttribute('data-kind') === kind
161
+ cards[i].hidden = !match
162
+ if (match) shown++
163
+ }
164
+ showing.textContent = kind ? 'Showing ' + shown + ' of ' + cards.length + ': ' + kind + '.' : 'Showing all ' + cards.length + '.'
165
+ }
166
+ for (var c = 0; c < chips.length; c++) {
167
+ chips[c].addEventListener('click', function (event) {
168
+ choose(event.currentTarget)
169
+ })
170
+ }
171
+ group.hidden = false
172
+ }
173
+
174
+ // The gallery: one picture at a time, its dot marked.
175
+ var pick = function (panel, at) {
176
+ var pictures = panel.querySelectorAll('[data-work-picture]')
177
+ if (pictures.length === 0) return
178
+ var n = pictures.length
179
+ var index = ((at % n) + n) % n
180
+ var dots = panel.querySelectorAll('[data-work-dot]')
181
+ for (var p = 0; p < n; p++) pictures[p].hidden = p !== index
182
+ for (var d = 0; d < dots.length; d++) {
183
+ if (d === index) dots[d].setAttribute('aria-current', 'true')
184
+ else dots[d].removeAttribute('aria-current')
185
+ }
186
+ panel.setAttribute('data-at', String(index))
187
+ }
188
+ var step = function (by) {
189
+ if (current) pick(current, Number(current.getAttribute('data-at') || 0) + by)
190
+ }
191
+
192
+ var open = function (index, from) {
193
+ opener = from
194
+ for (var i = 0; i < panels.length; i++) panels[i].hidden = i !== index
195
+ current = panels[index]
196
+ box.setAttribute('aria-labelledby', current.getAttribute('data-title-id'))
197
+ pick(current, 0)
198
+ box.showModal()
199
+ }
200
+
201
+ // Each card's title opens the lightbox; a card with nowhere to go gets a button for it.
202
+ for (var i = 0; i < cards.length; i++) {
203
+ ;(function (index) {
204
+ var el = cards[index].querySelector('[data-work-open]')
205
+ if (el.tagName === 'SPAN') {
206
+ var button = document.createElement('button')
207
+ button.type = 'button'
208
+ button.className = 'work-open'
209
+ button.textContent = el.textContent
210
+ el.replaceWith(button)
211
+ el = button
212
+ } else {
213
+ el.setAttribute('role', 'button')
214
+ el.addEventListener('keydown', function (event) {
215
+ if (event.key === ' ') {
216
+ event.preventDefault()
217
+ open(index, el)
218
+ }
219
+ })
220
+ }
221
+ el.setAttribute('aria-haspopup', 'dialog')
222
+ el.setAttribute('aria-controls', box.id)
223
+ el.addEventListener('click', function (event) {
224
+ if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return
225
+ event.preventDefault()
226
+ open(index, el)
227
+ })
228
+ })(i)
229
+ }
230
+
231
+ box.addEventListener('click', function (event) {
232
+ var t = event.target
233
+ if (t === box || t.closest('[data-work-close]')) box.close()
234
+ var by = t.closest('[data-work-step]')
235
+ if (by) step(Number(by.getAttribute('data-work-step')))
236
+ var dot = t.closest('[data-work-dot]')
237
+ if (dot && current) pick(current, Number(dot.getAttribute('data-work-dot')))
238
+ })
239
+ box.addEventListener('keydown', function (event) {
240
+ if (event.key === 'ArrowLeft') step(-1)
241
+ if (event.key === 'ArrowRight') step(1)
242
+ })
243
+ box.addEventListener('close', function () {
244
+ if (opener) opener.focus()
245
+ })
246
+ })(document.currentScript.closest('[data-portfolio]'))
247
+ </script>
248
+ </div>
249
+ )}
250
+ </Band>
251
+ )}
252
+
253
+ <style>
254
+ .work-kinds {
255
+ display: flex;
256
+ flex-wrap: wrap;
257
+ gap: 0.5rem;
258
+ margin: 0 0 1.25rem;
259
+ }
260
+ .work-kinds[hidden],
261
+ .work-card[hidden] {
262
+ display: none;
263
+ }
264
+ .work-kinds button {
265
+ min-height: 2.75rem;
266
+ padding: 0.375rem 1rem;
267
+ border: 1.5px solid color-mix(in srgb, var(--ink) 25%, transparent);
268
+ border-radius: var(--pill);
269
+ background: transparent;
270
+ color: var(--ink);
271
+ font: inherit;
272
+ font-size: var(--text-sm);
273
+ font-weight: 600;
274
+ cursor: pointer;
275
+ }
276
+ .work-kinds button:hover {
277
+ border-color: var(--ink);
278
+ }
279
+ .work-kinds button[aria-pressed='true'] {
280
+ border-color: var(--button);
281
+ background: var(--button);
282
+ color: var(--button-ink);
283
+ }
284
+
285
+ .work-grid {
286
+ display: grid;
287
+ grid-template-columns: minmax(0, 1fr);
288
+ gap: 1.75rem 1.25rem;
289
+ margin: 0;
290
+ padding: 0;
291
+ list-style: none;
292
+ }
293
+ .work-card {
294
+ position: relative;
295
+ display: flex;
296
+ flex-direction: column;
297
+ min-width: 0;
298
+ border-radius: var(--radius-card);
299
+ }
300
+ .work-card > p,
301
+ .work-card > h3 {
302
+ margin: 0;
303
+ }
304
+ .work-frame {
305
+ position: relative;
306
+ aspect-ratio: 16 / 10;
307
+ overflow: hidden;
308
+ border-radius: var(--radius-card);
309
+ background: color-mix(in srgb, var(--ink) 6%, transparent);
310
+ }
311
+ .work-photo {
312
+ display: block;
313
+ width: 100%;
314
+ height: 100%;
315
+ object-fit: cover;
316
+ }
317
+ /* No picture: the title large on the band's surface. */
318
+ .work-frame-words {
319
+ display: grid;
320
+ place-items: center;
321
+ padding: 1.5rem 1.5rem 3rem;
322
+ border: 1px solid var(--line);
323
+ background: var(--surface);
324
+ box-shadow: inset 0 -3px 0 var(--accent);
325
+ }
326
+ .work-frame-title {
327
+ margin: 0;
328
+ font-family: var(--font-display);
329
+ font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
330
+ font-weight: 800;
331
+ line-height: 1.08;
332
+ letter-spacing: -0.02em;
333
+ text-align: center;
334
+ text-wrap: balance;
335
+ overflow-wrap: anywhere;
336
+ }
337
+ .work-tag {
338
+ position: absolute;
339
+ left: 0.875rem;
340
+ bottom: 0.875rem;
341
+ max-width: calc(100% - 1.75rem);
342
+ margin: 0;
343
+ padding: 0.25rem 0.625rem;
344
+ border-radius: var(--pill);
345
+ background: var(--surface);
346
+ color: var(--ink);
347
+ font-size: var(--text-xs);
348
+ font-weight: 700;
349
+ letter-spacing: 0.08em;
350
+ line-height: 1.3;
351
+ text-transform: uppercase;
352
+ }
353
+ .work-frame-words .work-tag {
354
+ background: color-mix(in srgb, var(--ink) 9%, transparent);
355
+ }
356
+ .work-card .work-title {
357
+ margin-top: 0.875rem;
358
+ font-size: calc(var(--h3) * 0.9);
359
+ font-weight: 700;
360
+ line-height: 1.2;
361
+ }
362
+ .work-title a,
363
+ .work-title :global(.work-open) {
364
+ color: var(--ink);
365
+ text-decoration: none;
366
+ }
367
+ /* With script a card with nowhere to go opens the lightbox from a button that reads as its title. */
368
+ .work-title :global(.work-open) {
369
+ padding: 0;
370
+ border: 0;
371
+ background: none;
372
+ font: inherit;
373
+ text-align: left;
374
+ cursor: pointer;
375
+ }
376
+ /* The title's link (or button) covers the card. */
377
+ .work-title a::after,
378
+ .work-title :global(.work-open)::after {
379
+ content: '';
380
+ position: absolute;
381
+ inset: 0;
382
+ border-radius: var(--radius-card);
383
+ }
384
+ .work-card:hover .work-title a,
385
+ .work-card:hover .work-title :global(.work-open) {
386
+ text-decoration: underline;
387
+ }
388
+ .work-card:focus-within {
389
+ outline: 3px solid var(--ink);
390
+ outline-offset: 4px;
391
+ }
392
+ .work-title a:focus-visible,
393
+ .work-title :global(.work-open:focus-visible) {
394
+ outline: none;
395
+ }
396
+ .work-card .work-credit {
397
+ margin-top: 0.3125rem;
398
+ color: var(--muted);
399
+ font-size: var(--text-sm);
400
+ }
401
+
402
+ /* The lightbox (mock C): the contrast band's ground, the pictures at the left, the words at the right. */
403
+ .work-box {
404
+ width: min(100% - 2rem, 66rem);
405
+ max-width: none;
406
+ max-height: calc(100% - 2rem);
407
+ padding: 0;
408
+ border: 0;
409
+ border-radius: var(--radius-card);
410
+ background: var(--bg-band-background);
411
+ color: var(--bg-band-color);
412
+ box-shadow: var(--shadow);
413
+ }
414
+ .work-box::backdrop {
415
+ background: color-mix(in srgb, var(--band-photo, CanvasText) 72%, transparent);
416
+ }
417
+ .work-box-inner {
418
+ position: relative;
419
+ padding: 3.25rem 1.25rem 1.5rem;
420
+ }
421
+ .work-box-close {
422
+ position: absolute;
423
+ top: 0.625rem;
424
+ right: 0.625rem;
425
+ display: grid;
426
+ place-items: center;
427
+ width: 2.75rem;
428
+ height: 2.75rem;
429
+ padding: 0;
430
+ border: 0;
431
+ border-radius: 50%;
432
+ background: transparent;
433
+ color: var(--ink);
434
+ cursor: pointer;
435
+ }
436
+ .work-box-close:hover {
437
+ background: color-mix(in srgb, var(--ink) 12%, transparent);
438
+ }
439
+ .work-panel[hidden] {
440
+ display: none;
441
+ }
442
+ .work-panel {
443
+ display: grid;
444
+ gap: 1.5rem;
445
+ }
446
+ .work-gallery-frame {
447
+ display: grid;
448
+ aspect-ratio: 16 / 10;
449
+ overflow: hidden;
450
+ border-radius: var(--radius);
451
+ background: color-mix(in srgb, var(--ink) 8%, transparent);
452
+ }
453
+ .work-gallery-photo {
454
+ display: block;
455
+ width: 100%;
456
+ height: 100%;
457
+ object-fit: contain;
458
+ }
459
+ .work-gallery-photo[hidden] {
460
+ display: none;
461
+ }
462
+ /* Prev at the left, Next at the right, the dots between them (wrapping there, past a dozen pictures). */
463
+ .work-gallery-nav {
464
+ display: grid;
465
+ grid-template-columns: auto minmax(0, 1fr) auto;
466
+ align-items: center;
467
+ gap: 0.25rem;
468
+ margin-top: 0.5rem;
469
+ }
470
+ .work-step {
471
+ min-height: 2.75rem;
472
+ padding: 0 0.5rem;
473
+ border: 0;
474
+ border-radius: var(--pill);
475
+ background: transparent;
476
+ color: var(--ink);
477
+ font: inherit;
478
+ font-weight: 600;
479
+ white-space: nowrap;
480
+ cursor: pointer;
481
+ }
482
+ .work-step:hover {
483
+ text-decoration: underline;
484
+ }
485
+ .work-dots {
486
+ display: flex;
487
+ flex-wrap: wrap;
488
+ justify-content: center;
489
+ min-width: 0;
490
+ }
491
+ /* A dot: a 24px-wide, 44px-tall target around a 10px ring, filled for the picture showing. */
492
+ .work-dot {
493
+ display: grid;
494
+ place-items: center;
495
+ width: 1.5rem;
496
+ height: 2.75rem;
497
+ padding: 0;
498
+ border: 0;
499
+ background: transparent;
500
+ cursor: pointer;
501
+ }
502
+ .work-dot::before {
503
+ content: '';
504
+ width: 0.625rem;
505
+ height: 0.625rem;
506
+ border: 1.5px solid var(--ink);
507
+ border-radius: 50%;
508
+ }
509
+ .work-dot[aria-current='true']::before {
510
+ background: var(--ink);
511
+ }
512
+ .work-panel-words > * {
513
+ margin: 0;
514
+ }
515
+ .work-panel-kind {
516
+ color: var(--accent);
517
+ font-size: var(--text-xs);
518
+ font-weight: 700;
519
+ letter-spacing: 0.16em;
520
+ text-transform: uppercase;
521
+ }
522
+ .work-panel-words .work-panel-title {
523
+ margin-top: 0.5rem;
524
+ padding-right: 2rem;
525
+ font-size: clamp(1.625rem, 1.25rem + 1.2vw, 2.25rem);
526
+ font-weight: 800;
527
+ line-height: 1.08;
528
+ }
529
+ .work-panel-words .work-panel-summary {
530
+ margin-top: 0.875rem;
531
+ color: var(--muted);
532
+ }
533
+ .work-panel-words .work-panel-fact {
534
+ margin-top: 0.625rem;
535
+ font-size: 0.9375rem;
536
+ }
537
+ .work-panel-words .work-panel-actions {
538
+ margin-top: 1.5rem;
539
+ }
540
+
541
+ @media (min-width: 40rem) {
542
+ .work-grid {
543
+ grid-template-columns: repeat(2, minmax(0, 1fr));
544
+ }
545
+ }
546
+ @media (min-width: 56rem) {
547
+ .work-grid {
548
+ grid-template-columns: repeat(3, minmax(0, 1fr));
549
+ gap: 2rem 1.5rem;
550
+ }
551
+ .work-box-inner {
552
+ padding: 1.75rem;
553
+ }
554
+ .work-panel-pictured {
555
+ grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
556
+ gap: 1.75rem;
557
+ align-items: start;
558
+ }
559
+ .work-panel-pictured .work-panel-words {
560
+ padding-top: 0.5rem;
561
+ }
562
+ }
563
+ @media (prefers-reduced-motion: no-preference) {
564
+ .work-photo {
565
+ transition: transform 0.3s ease;
566
+ }
567
+ .work-card:hover .work-photo {
568
+ transform: scale(1.03);
569
+ }
570
+ }
571
+ </style>