@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,171 @@
1
+ ---
2
+ // The story cards (board 10, B), drawn by the Cards layout and under the
3
+ // Spotlight's featured story: one card per story on the band's surface, as
4
+ // the news cards are, three across on a wide screen, two on a tablet and one
5
+ // on a phone. Each card opens with its picture at 4:3 and the label laid
6
+ // over its corner as a small tag; a story with no picture but a label opens
7
+ // with the label large in the display face on a soft panel instead (wider
8
+ // than a picture on a phone, where no row lines up with it), and one with
9
+ // neither opens with its words. Then the status word as its tone sets
10
+ // it, the title (the whole card is its link when the row has one) and the
11
+ // body in the muted ink.
12
+ import Status from './Status.astro'
13
+ import type { Story } from './stories'
14
+
15
+ interface Props {
16
+ stories: Story[]
17
+ }
18
+
19
+ const { stories } = Astro.props
20
+ ---
21
+ <ul class="story-cards" role="list">
22
+ {stories.map((story) => (
23
+ <li class:list={['story-card', story.link && 'story-card-linked']}>
24
+ {story.photo ? (
25
+ <div class="story-frame">
26
+ <img class="story-photo" src={story.photo} alt="" loading="lazy" decoding="async" />
27
+ {story.label && <p class="story-tag">{story.label}</p>}
28
+ </div>
29
+ ) : story.label && (
30
+ <div class="story-frame story-frame-label">
31
+ <p class="story-big-label">{story.label}</p>
32
+ </div>
33
+ )}
34
+ <div class="story-body">
35
+ <Status status={story.status} tone={story.tone} />
36
+ <h3 class="story-title">{story.link ? <a href={story.link.href} rel={story.link.rel}>{story.title}</a> : story.title}</h3>
37
+ {story.body && <p class="story-text">{story.body}</p>}
38
+ </div>
39
+ </li>
40
+ ))}
41
+ </ul>
42
+
43
+ <style>
44
+ .story-cards {
45
+ display: grid;
46
+ grid-template-columns: minmax(0, 1fr);
47
+ gap: 1rem;
48
+ margin: 0;
49
+ padding: 0;
50
+ list-style: none;
51
+ }
52
+ .story-card {
53
+ position: relative;
54
+ display: flex;
55
+ flex-direction: column;
56
+ min-width: 0;
57
+ overflow: hidden;
58
+ border: 1px solid var(--line);
59
+ border-radius: var(--radius-card);
60
+ background: var(--surface);
61
+ }
62
+ .story-frame {
63
+ position: relative;
64
+ aspect-ratio: 4 / 3;
65
+ overflow: hidden;
66
+ }
67
+ .story-photo {
68
+ display: block;
69
+ width: 100%;
70
+ height: 100%;
71
+ object-fit: cover;
72
+ }
73
+ .story-tag {
74
+ position: absolute;
75
+ left: 0.875rem;
76
+ bottom: 0.875rem;
77
+ max-width: calc(100% - 1.75rem);
78
+ margin: 0;
79
+ padding: 0.25rem 0.625rem;
80
+ border-radius: var(--pill);
81
+ background: var(--surface);
82
+ color: var(--ink);
83
+ font-size: var(--text-xs);
84
+ font-weight: 700;
85
+ letter-spacing: 0.08em;
86
+ line-height: 1.3;
87
+ text-transform: uppercase;
88
+ }
89
+ /* One card across (a phone), the label's panel is wider than a picture: there is no row of pictures to line up with. */
90
+ .story-frame-label {
91
+ aspect-ratio: 2 / 1;
92
+ display: grid;
93
+ place-items: center;
94
+ padding: 1.25rem;
95
+ border-bottom: 1px solid var(--line);
96
+ background: color-mix(in srgb, var(--ink) 6%, transparent);
97
+ box-shadow: inset 0 -3px 0 var(--accent);
98
+ }
99
+ .story-big-label {
100
+ margin: 0;
101
+ font-family: var(--font-display);
102
+ font-size: clamp(2.75rem, 2.2rem + 2vw, 3.75rem);
103
+ font-weight: 800;
104
+ line-height: 1;
105
+ letter-spacing: -0.02em;
106
+ text-align: center;
107
+ overflow-wrap: anywhere;
108
+ }
109
+ .story-body {
110
+ display: flex;
111
+ flex-direction: column;
112
+ align-items: flex-start;
113
+ gap: 0.5rem;
114
+ padding: 1.125rem 1.25rem 1.375rem;
115
+ }
116
+ .story-body > * {
117
+ margin: 0;
118
+ }
119
+ .story-body .story-title {
120
+ font-size: calc(var(--h3) * 0.9);
121
+ font-weight: 700;
122
+ line-height: 1.2;
123
+ }
124
+ .story-title a {
125
+ color: var(--ink);
126
+ text-decoration: none;
127
+ }
128
+ .story-title a::after {
129
+ content: '';
130
+ position: absolute;
131
+ inset: 0;
132
+ }
133
+ .story-card-linked:hover .story-title a {
134
+ text-decoration: underline;
135
+ }
136
+ .story-card-linked:focus-within {
137
+ outline: 3px solid var(--ink);
138
+ outline-offset: 3px;
139
+ }
140
+ .story-title a:focus-visible {
141
+ outline: none;
142
+ }
143
+ .story-text {
144
+ color: var(--muted);
145
+ font-size: var(--text-sm);
146
+ line-height: 1.5;
147
+ }
148
+ @media (min-width: 40rem) {
149
+ .story-cards {
150
+ grid-template-columns: repeat(2, minmax(0, 1fr));
151
+ gap: 1.25rem;
152
+ }
153
+ .story-frame-label {
154
+ aspect-ratio: 4 / 3;
155
+ }
156
+ }
157
+ @media (min-width: 60rem) {
158
+ .story-cards {
159
+ grid-template-columns: repeat(3, minmax(0, 1fr));
160
+ gap: 1.5rem;
161
+ }
162
+ }
163
+ @media (prefers-reduced-motion: no-preference) {
164
+ .story-photo {
165
+ transition: transform 0.3s ease;
166
+ }
167
+ .story-card-linked:hover .story-photo {
168
+ transform: scale(1.02);
169
+ }
170
+ }
171
+ </style>
@@ -0,0 +1,42 @@
1
+ ---
2
+ // Stories · Cards (board 10, B): the kicker and heading, the line of copy,
3
+ // then every story in the list as a card on the band's surface, three across
4
+ // on a wide screen and one on a phone: the picture (or the label large on a
5
+ // soft panel), the status word as its tone sets it, the title, linked when
6
+ // the row has an address, and the body. The featured story in the copy
7
+ // belongs to the Spotlight and is not drawn here. With no story and no
8
+ // heading it draws nothing.
9
+ import type { ComponentProps } from 'astro/types'
10
+ import type Default from './index.astro'
11
+ import Band from '../Band.astro'
12
+ import SectionHead from '../SectionHead.astro'
13
+ import Prose from '../../Prose.astro'
14
+ import StoryCards from './StoryCards.astro'
15
+ import { storiesOf } from './stories'
16
+ import { text } from '../../../lib/format'
17
+
18
+ type Props = ComponentProps<typeof Default>
19
+
20
+ const { section } = Astro.props
21
+ const kicker = text(section.copy.kicker)
22
+ const heading = text(section.copy.heading)
23
+ const stories = storiesOf(section)
24
+ ---
25
+ {(heading || stories.length > 0) && (
26
+ <Band section={section} class="stories stories-cards">
27
+ <div class="stories-intro">
28
+ <SectionHead kicker={kicker} heading={heading} more={[]} />
29
+ <Prose value={section.copy.body} class="lede" />
30
+ </div>
31
+ {stories.length > 0 && <StoryCards stories={stories} />}
32
+ </Band>
33
+ )}
34
+
35
+ <style>
36
+ .stories-intro > :global(.lede) {
37
+ margin: -0.5rem 0 1.75rem;
38
+ }
39
+ .stories-intro:last-child > :global(.lede) {
40
+ margin-bottom: 0;
41
+ }
42
+ </style>
@@ -0,0 +1,238 @@
1
+ ---
2
+ // Stories · Spotlight, the default (board 10, A): the kicker and heading,
3
+ // the line of copy, then the featured story: its picture large at the left
4
+ // with rounded corners and, at the right, its label as a chip, its title in
5
+ // the display face, the summary, the status in the accent chip beside the
6
+ // outcome in the plain chip, and the read link as the section's one button.
7
+ // With a watch link the whole picture is that link, a play mark and the
8
+ // watch label laid over its corner; without a picture the watch link sits
9
+ // beside the button and the words take the full width on the band's surface.
10
+ // The title is an <h2>, or an <h3> under the section's own heading. The
11
+ // stories in the list follow as the story cards under a thin rule. With no
12
+ // story, no featured title and no heading it draws nothing.
13
+ import type { Section } from '@backgold/content'
14
+ import Band from '../Band.astro'
15
+ import SectionHead from '../SectionHead.astro'
16
+ import Prose from '../../Prose.astro'
17
+ import StoryCards from './StoryCards.astro'
18
+ import { featuredOf, storiesOf } from './stories'
19
+ import { text } from '../../../lib/format'
20
+
21
+ interface Props {
22
+ section: Section
23
+ variant?: string
24
+ }
25
+
26
+ const { section } = Astro.props
27
+ const kicker = text(section.copy.kicker)
28
+ const heading = text(section.copy.heading)
29
+ const featured = featuredOf(section)
30
+ const stories = storiesOf(section)
31
+ const Title = heading ? 'h3' : 'h2'
32
+ ---
33
+ {(heading || featured || stories.length > 0) && (
34
+ <Band section={section} class="stories stories-spotlight">
35
+ <div class="stories-intro">
36
+ <SectionHead kicker={kicker} heading={heading} more={[]} />
37
+ <Prose value={section.copy.body} class="lede" />
38
+ </div>
39
+ {featured && (
40
+ <article class:list={['spotlight', featured.picture ? 'spotlight-pictured' : 'spotlight-words-only']}>
41
+ {featured.picture && (featured.watch ? (
42
+ <a class="spotlight-media spotlight-watch" href={featured.watch.href} rel={featured.watch.rel}>
43
+ <span class="spotlight-play">
44
+ <span class="play-mark" aria-hidden="true"></span>
45
+ {featured.watch.label}
46
+ </span>
47
+ <img class="spotlight-photo" src={featured.picture.url} alt={featured.picture.alt} loading="lazy" decoding="async" />
48
+ </a>
49
+ ) : (
50
+ <div class="spotlight-media">
51
+ <img class="spotlight-photo" src={featured.picture.url} alt={featured.picture.alt} loading="lazy" decoding="async" />
52
+ </div>
53
+ ))}
54
+ <div class="spotlight-words">
55
+ {featured.label && <p class="spotlight-label"><span class="chip">{featured.label}</span></p>}
56
+ <Title class="spotlight-title">{featured.title}</Title>
57
+ {featured.summary && <p class="spotlight-summary">{featured.summary}</p>}
58
+ {(featured.status || featured.outcome) && (
59
+ <p class="spotlight-chips">
60
+ {featured.status && <span class="chip chip-accent">{featured.status}</span>}
61
+ {featured.outcome && <span class="chip">{featured.outcome}</span>}
62
+ </p>
63
+ )}
64
+ {(featured.read || (featured.watch && !featured.picture)) && (
65
+ <p class="actions spotlight-actions">
66
+ {featured.read && <a class="button" href={featured.read.href} rel={featured.read.rel}>{featured.read.label}</a>}
67
+ {featured.watch && !featured.picture && (
68
+ <a class="spotlight-watch-link" href={featured.watch.href} rel={featured.watch.rel}>
69
+ <span class="play-mark" aria-hidden="true"></span>
70
+ {featured.watch.label}
71
+ </a>
72
+ )}
73
+ </p>
74
+ )}
75
+ </div>
76
+ </article>
77
+ )}
78
+ {stories.length > 0 && (
79
+ <div class:list={['spotlight-more', featured && 'spotlight-more-ruled']}>
80
+ <StoryCards stories={stories} />
81
+ </div>
82
+ )}
83
+ </Band>
84
+ )}
85
+
86
+ <style>
87
+ .stories-intro > :global(.lede) {
88
+ margin: -0.5rem 0 1.75rem;
89
+ }
90
+ .stories-intro:last-child > :global(.lede) {
91
+ margin-bottom: 0;
92
+ }
93
+ .spotlight {
94
+ display: grid;
95
+ gap: 1.5rem;
96
+ }
97
+ .spotlight-media {
98
+ position: relative;
99
+ display: block;
100
+ overflow: hidden;
101
+ border-radius: var(--radius-card);
102
+ }
103
+ .spotlight-photo {
104
+ display: block;
105
+ width: 100%;
106
+ aspect-ratio: 4 / 3;
107
+ object-fit: cover;
108
+ }
109
+ .spotlight-watch {
110
+ color: var(--ink);
111
+ text-decoration: none;
112
+ }
113
+ .spotlight-play {
114
+ position: absolute;
115
+ z-index: 1;
116
+ left: 0.875rem;
117
+ bottom: 0.875rem;
118
+ display: inline-flex;
119
+ align-items: center;
120
+ gap: 0.625rem;
121
+ max-width: calc(100% - 1.75rem);
122
+ padding: 0.375rem 1rem 0.375rem 0.375rem;
123
+ border-radius: var(--pill);
124
+ background: var(--surface);
125
+ color: var(--ink);
126
+ font-size: var(--text-sm);
127
+ font-weight: 700;
128
+ line-height: 1.2;
129
+ box-shadow: var(--shadow);
130
+ }
131
+ .spotlight-watch:hover .spotlight-play {
132
+ text-decoration: underline;
133
+ }
134
+ .spotlight-watch:focus-visible {
135
+ outline-offset: 4px;
136
+ border-radius: var(--radius-card);
137
+ }
138
+ /* The play mark: a disc in the button colour with a triangle cut in the button's ink. */
139
+ .play-mark {
140
+ position: relative;
141
+ flex: 0 0 auto;
142
+ width: 2.25rem;
143
+ height: 2.25rem;
144
+ border-radius: 50%;
145
+ background: var(--button);
146
+ }
147
+ .play-mark::after {
148
+ content: '';
149
+ position: absolute;
150
+ top: 50%;
151
+ left: 54%;
152
+ border-style: solid;
153
+ border-width: 0.4375rem 0 0.4375rem 0.6875rem;
154
+ border-color: transparent transparent transparent var(--button-ink);
155
+ transform: translate(-50%, -50%);
156
+ }
157
+ .spotlight-words > * {
158
+ margin: 0;
159
+ }
160
+ .spotlight-words .spotlight-title {
161
+ margin-top: 0.875rem;
162
+ font-size: clamp(1.75rem, 1.25rem + 1.6vw, 2.5rem);
163
+ font-weight: 800;
164
+ line-height: 1.08;
165
+ }
166
+ .spotlight-words > .spotlight-title:first-child {
167
+ margin-top: 0;
168
+ }
169
+ .spotlight-words .spotlight-summary {
170
+ margin-top: 0.875rem;
171
+ color: var(--muted);
172
+ font-size: var(--text-lg);
173
+ max-width: var(--measure);
174
+ }
175
+ .spotlight-words .spotlight-chips {
176
+ display: flex;
177
+ flex-wrap: wrap;
178
+ gap: 0.5rem;
179
+ margin-top: 1.125rem;
180
+ }
181
+ .spotlight-chips .chip {
182
+ white-space: normal;
183
+ }
184
+ .spotlight-words .spotlight-actions {
185
+ align-items: center;
186
+ gap: 0.75rem 1.5rem;
187
+ margin-top: 1.5rem;
188
+ }
189
+ .spotlight-watch-link {
190
+ display: inline-flex;
191
+ align-items: center;
192
+ gap: 0.625rem;
193
+ color: var(--ink);
194
+ font-weight: 700;
195
+ text-decoration: none;
196
+ }
197
+ .spotlight-watch-link:hover {
198
+ text-decoration: underline;
199
+ }
200
+ .spotlight-watch-link .play-mark {
201
+ width: 2rem;
202
+ height: 2rem;
203
+ }
204
+ .spotlight-words-only .spotlight-words {
205
+ padding: 1.5rem 1.25rem 1.625rem;
206
+ border: 1px solid var(--line);
207
+ border-radius: var(--radius-card);
208
+ background: var(--surface);
209
+ }
210
+ .spotlight-more-ruled {
211
+ margin-top: clamp(2rem, 1.5rem + 1.5vw, 2.75rem);
212
+ padding-top: clamp(2rem, 1.5rem + 1.5vw, 2.75rem);
213
+ border-top: 1px solid var(--line);
214
+ }
215
+ @media (min-width: 48rem) {
216
+ .spotlight-pictured {
217
+ grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
218
+ gap: clamp(2rem, 4vw, 3rem);
219
+ align-items: center;
220
+ }
221
+ .spotlight-play {
222
+ left: 1.125rem;
223
+ bottom: 1.125rem;
224
+ max-width: calc(100% - 2.25rem);
225
+ }
226
+ .spotlight-words-only .spotlight-words {
227
+ padding: 2.25rem 2.5rem 2.5rem;
228
+ }
229
+ }
230
+ @media (prefers-reduced-motion: no-preference) {
231
+ .spotlight-photo {
232
+ transition: transform 0.3s ease;
233
+ }
234
+ .spotlight-watch:hover .spotlight-photo {
235
+ transform: scale(1.02);
236
+ }
237
+ }
238
+ </style>
@@ -0,0 +1,97 @@
1
+ // A Stories section as its layouts draw it. Two things are read:
2
+ //
3
+ // - the featured story, from the section's copy, media and links: `label`
4
+ // (the chip over it, "Featured story"), `title`, `summary`, `status` and
5
+ // `outcome`, the picture (`imageUrl`), the read link (`readLabel` →
6
+ // `readHref`) and the watch link (`watchLabel` → `watchHref`). The
7
+ // Spotlight layout draws it; there is no featured story without a title.
8
+ // - the stories in the authored list (`stories`), in row order: `label` (a
9
+ // tag, or the year on the Timeline), `title`, `body`, `status`, `tone`
10
+ // ('won' | 'progress' | 'lost' | 'none'), `imageUrl` and `href`. A row
11
+ // without a title is not a story.
12
+ //
13
+ // A tone is not a colour: it says how the status word is set (the accent
14
+ // chip for a win, a plain chip in progress, a muted outline for a loss, the
15
+ // bare word for none). A missing or unknown tone reads as 'none', and a tone
16
+ // with no status word draws nothing.
17
+
18
+ import type { Section } from '@backgold/content'
19
+ import { safeSrc } from '@backgold/astro/server'
20
+ import { links, linkOf, media, rows, type Link, type Media } from '../../../lib/section'
21
+ import { text } from '../../../lib/format'
22
+
23
+ const TONES = ['won', 'progress', 'lost', 'none'] as const
24
+ export type Tone = (typeof TONES)[number]
25
+
26
+ export interface Story {
27
+ label: string | null
28
+ title: string
29
+ /** The title's link, when the row has a safe address for it. */
30
+ link: Link | null
31
+ body: string | null
32
+ status: string | null
33
+ tone: Tone
34
+ photo: string | null
35
+ }
36
+
37
+ export interface Featured {
38
+ label: string | null
39
+ title: string
40
+ summary: string | null
41
+ status: string | null
42
+ outcome: string | null
43
+ picture: Media | null
44
+ read: Link | null
45
+ watch: Link | null
46
+ }
47
+
48
+ /** The section's stories in row order: the rows that have a title. */
49
+ export function storiesOf(section: Section): Story[] {
50
+ return rows(section).flatMap((row) => {
51
+ const title = text(row.title)?.trim()
52
+ if (!title) return []
53
+ const tone = text(row.tone)?.trim().toLowerCase()
54
+ return [
55
+ {
56
+ label: text(row.label)?.trim() ?? null,
57
+ title,
58
+ link: linkOf(title, row.href),
59
+ body: text(row.body),
60
+ status: text(row.status)?.trim() ?? null,
61
+ tone: TONES.find((t) => t === tone) ?? 'none',
62
+ photo: safeSrc(row.imageUrl),
63
+ },
64
+ ]
65
+ })
66
+ }
67
+
68
+ /**
69
+ * The featured story, or null without a title. A link the projection left
70
+ * out (no label, no address, an unsafe one) is simply absent, so the two are
71
+ * told apart by their labels, not their places: the watch link is the one
72
+ * labelled `watchLabel`, the read link any other.
73
+ */
74
+ export function featuredOf(section: Section): Featured | null {
75
+ const title = text(section.copy.title)?.trim()
76
+ if (!title) return null
77
+ const watchLabel = text(section.copy.watchLabel)
78
+ const readLabel = text(section.copy.readLabel)
79
+ const found = links(section)
80
+ const watch = found.find((l) => l.label === watchLabel && l.label !== readLabel) ?? (found.length > 1 ? found[1]! : null)
81
+ const read = found.find((l) => l !== watch) ?? null
82
+ return {
83
+ label: text(section.copy.label)?.trim() ?? null,
84
+ title,
85
+ summary: text(section.copy.summary),
86
+ status: text(section.copy.status)?.trim() ?? null,
87
+ outcome: text(section.copy.outcome)?.trim() ?? null,
88
+ picture: media(section, 'imageUrl'),
89
+ read,
90
+ watch,
91
+ }
92
+ }
93
+
94
+ /** A label that is a year ("2024"), for `<time datetime>`; null for a tag. */
95
+ export function yearOf(label: string | null): string | null {
96
+ return label && /^\d{4}$/.test(label) ? label : null
97
+ }
@@ -0,0 +1,135 @@
1
+ ---
2
+ // Stories · Timeline (board 10, C): the kicker, heading and line of copy,
3
+ // then the stories in the list in row order down a rail in the accent, in
4
+ // one reading column: a dot in the ink beside each story, the last story's
5
+ // dot in the accent to mark where things stand now. Each story has its
6
+ // label in small capitals (the year, as a <time> when it is one), its title
7
+ // in the display face, linked when the row has an address, and its body
8
+ // under it. On a phone the rail keeps to the left edge of the column. With
9
+ // no story and no heading it draws nothing.
10
+ import type { ComponentProps } from 'astro/types'
11
+ import type Default from './index.astro'
12
+ import Band from '../Band.astro'
13
+ import SectionHead from '../SectionHead.astro'
14
+ import Prose from '../../Prose.astro'
15
+ import { storiesOf, yearOf } from './stories'
16
+ import { text } from '../../../lib/format'
17
+
18
+ type Props = ComponentProps<typeof Default>
19
+
20
+ const { section } = Astro.props
21
+ const kicker = text(section.copy.kicker)
22
+ const heading = text(section.copy.heading)
23
+ const stories = storiesOf(section)
24
+ ---
25
+ {(heading || stories.length > 0) && (
26
+ <Band section={section} class="stories stories-timeline">
27
+ <div class="timeline-column">
28
+ <SectionHead kicker={kicker} heading={heading} more={[]} />
29
+ <Prose value={section.copy.body} class="lede" />
30
+ {stories.length > 0 && (
31
+ <ol class="timeline" role="list">
32
+ {stories.map((story) => {
33
+ const year = yearOf(story.label)
34
+ return (
35
+ <li class="timeline-step">
36
+ <span class="timeline-dot" aria-hidden="true"></span>
37
+ {story.label && <p class="timeline-label">{year ? <time datetime={year}>{story.label}</time> : story.label}</p>}
38
+ <h3 class="timeline-title">{story.link ? <a href={story.link.href} rel={story.link.rel}>{story.title}</a> : story.title}</h3>
39
+ {story.body && <p class="timeline-body">{story.body}</p>}
40
+ </li>
41
+ )
42
+ })}
43
+ </ol>
44
+ )}
45
+ </div>
46
+ </Band>
47
+ )}
48
+
49
+ <style>
50
+ .timeline-column {
51
+ max-width: calc(var(--measure) + 4rem);
52
+ margin-inline: auto;
53
+ }
54
+ .timeline-column > :global(.lede) {
55
+ margin: -0.5rem 0 1.75rem;
56
+ }
57
+ .timeline {
58
+ --rail: 3px;
59
+ --dot: 1.125rem;
60
+ /* The dot's centre sits on the label's line (its line box is 1.125rem tall). */
61
+ --dot-y: 0.5625rem;
62
+ margin: 0;
63
+ padding: 0;
64
+ list-style: none;
65
+ }
66
+ .timeline-step {
67
+ position: relative;
68
+ padding: 0 0 clamp(1.5rem, 1.25rem + 1vw, 2rem) calc(var(--dot) + 1.125rem);
69
+ }
70
+ .timeline-step:last-child {
71
+ padding-bottom: 0;
72
+ }
73
+ /* The rail: each step but the last draws it from its own dot's centre to the next one's. */
74
+ .timeline-step:not(:last-child)::before {
75
+ content: '';
76
+ position: absolute;
77
+ top: var(--dot-y);
78
+ bottom: calc(-1 * var(--dot-y));
79
+ left: calc(var(--dot) / 2 - var(--rail) / 2);
80
+ width: var(--rail);
81
+ background: var(--accent);
82
+ }
83
+ .timeline-dot {
84
+ position: absolute;
85
+ z-index: 1;
86
+ top: calc(var(--dot-y) - var(--dot) / 2);
87
+ left: 0;
88
+ width: var(--dot);
89
+ height: var(--dot);
90
+ border: 3px solid var(--bg-band-background);
91
+ border-radius: 50%;
92
+ background: var(--ink);
93
+ box-shadow: 0 0 0 1px var(--accent);
94
+ }
95
+ .timeline-step:last-child .timeline-dot {
96
+ background: var(--accent);
97
+ }
98
+ .timeline-step > * {
99
+ margin: 0;
100
+ }
101
+ .timeline-label {
102
+ color: var(--accent);
103
+ font-size: var(--text-xs);
104
+ font-weight: 700;
105
+ letter-spacing: 0.16em;
106
+ line-height: 1.5;
107
+ text-transform: uppercase;
108
+ }
109
+ .timeline-step .timeline-title {
110
+ margin-top: 0.25rem;
111
+ font-size: var(--h3);
112
+ font-weight: 700;
113
+ line-height: 1.2;
114
+ }
115
+ .timeline-title a {
116
+ color: var(--ink);
117
+ text-decoration: none;
118
+ }
119
+ .timeline-title a:hover {
120
+ text-decoration: underline;
121
+ }
122
+ .timeline-step .timeline-body {
123
+ margin-top: 0.375rem;
124
+ color: var(--muted);
125
+ max-width: var(--measure);
126
+ }
127
+ @media (min-width: 40rem) {
128
+ .timeline {
129
+ --dot: 1.375rem;
130
+ }
131
+ .timeline-step {
132
+ padding-left: calc(var(--dot) + 1.75rem);
133
+ }
134
+ }
135
+ </style>