@backgold/template-kit 0.0.0-stage → 0.1.1
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-RJAVFRC6.js +67 -0
- package/dist/constants-BAIo_Q5U.d-lQbj1e1-.d.ts +48 -0
- package/dist/content-api-Cox1-wz5.d.ts +1096 -0
- package/dist/contract/content-api-examples.d.ts +72 -0
- package/dist/contract/content-api-examples.js +926 -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 +253 -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 +61 -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 +80 -0
- package/src/components/sections/About/index.astro +60 -0
- package/src/components/sections/About/left.astro +57 -0
- package/src/components/sections/About/letter.astro +111 -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 +126 -0
- package/src/components/sections/ContentPost/player.astro +254 -0
- package/src/components/sections/ContentPost/prose.astro +80 -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 +176 -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 +99 -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/Lookup.astro +43 -0
- package/src/components/sections/VoterTools/dates.astro +153 -0
- package/src/components/sections/VoterTools/index.astro +231 -0
- package/src/components/sections/VoterTools/polling.astro +144 -0
- package/src/components/sections/VoterTools/voter-tools.ts +71 -0
- package/src/components/sections/index.ts +373 -0
- package/src/components/sections/modules/Headed.astro +39 -0
- package/src/components/sections/modules/ModuleFrame.astro +181 -0
- package/src/components/store/CollectionPage.astro +40 -0
- package/src/components/store/ProductCard.astro +32 -0
- package/src/components/store/ProductGrid.astro +16 -0
- package/src/components/store/ProductPage.astro +146 -0
- package/src/components/store/StorePage.astro +137 -0
- package/src/components/store/StoreScript.astro +572 -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 +63 -0
- package/src/layouts/Site.astro +387 -0
- package/src/lib/academy.ts +146 -0
- package/src/lib/brand.ts +534 -0
- package/src/lib/chrome.ts +121 -0
- package/src/lib/donate-frame.ts +104 -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 +55 -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 +105 -0
- package/src/lib/shifts.ts +187 -0
- package/src/lib/store.ts +521 -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 +435 -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/styles/entries.css +784 -0
- package/src/styles/site.css +1910 -0
- package/src/styles/store.css +634 -0
- package/src/template.ts +182 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
---
|
|
2
|
+
// PdfEmbed, 'card' layout (board A12, "Download card"): one card on the
|
|
3
|
+
// band's surface, about 44rem wide and centred in the band, which keeps its
|
|
4
|
+
// own ground. At the left a page glyph, an outline with a folded corner in
|
|
5
|
+
// the accent; beside it the title as the section's heading, the caption as
|
|
6
|
+
// its line under it, and the one button, "Open the PDF", to the file. On a
|
|
7
|
+
// phone the glyph sits above the words. There is no viewer: the button is
|
|
8
|
+
// the whole document in the visitor's own reader.
|
|
9
|
+
//
|
|
10
|
+
// The contract gives a document its address and nothing else, so the card
|
|
11
|
+
// never shows the file's size or its number of pages. Nothing is drawn
|
|
12
|
+
// without a PDF.
|
|
13
|
+
import type { ComponentProps } from 'astro/types'
|
|
14
|
+
import Band from '../Band.astro'
|
|
15
|
+
import type Default from './index.astro'
|
|
16
|
+
import { media } from '../../../lib/section'
|
|
17
|
+
import { text } from '../../../lib/format'
|
|
18
|
+
|
|
19
|
+
type Props = ComponentProps<typeof Default>
|
|
20
|
+
|
|
21
|
+
const { section } = Astro.props
|
|
22
|
+
const title = text(section.copy.title)
|
|
23
|
+
const caption = text(section.copy.caption)
|
|
24
|
+
const pdf = media(section, 'pdfUrl')
|
|
25
|
+
---
|
|
26
|
+
{pdf && (
|
|
27
|
+
<Band section={section} class="document document-card">
|
|
28
|
+
<div class="pdf-card">
|
|
29
|
+
<svg class="pdf-card-glyph" viewBox="0 0 36 48" aria-hidden="true" focusable="false">
|
|
30
|
+
<path class="pdf-card-page" d="M6 2h17l11 11v29a4 4 0 0 1-4 4H6a4 4 0 0 1-4-4V6a4 4 0 0 1 4-4Z" />
|
|
31
|
+
<path class="pdf-card-fold" d="M23 2v8a3 3 0 0 0 3 3h8" />
|
|
32
|
+
<path class="pdf-card-lines" d="M9 23h18M9 30h18M9 37h11" />
|
|
33
|
+
</svg>
|
|
34
|
+
<div class="pdf-card-words">
|
|
35
|
+
{title && <h2 class="pdf-card-title">{title}</h2>}
|
|
36
|
+
{caption && <p class="pdf-card-caption">{caption}</p>}
|
|
37
|
+
<p class="actions pdf-card-actions"><a class="button" href={pdf.url} rel="noopener">Open the PDF{title && <span class="visually-hidden">: {title}</span>}</a></p>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
</Band>
|
|
41
|
+
)}
|
|
42
|
+
|
|
43
|
+
<style>
|
|
44
|
+
.pdf-card {
|
|
45
|
+
display: grid;
|
|
46
|
+
grid-template-columns: auto minmax(0, 1fr);
|
|
47
|
+
align-items: start;
|
|
48
|
+
gap: clamp(1rem, 0.75rem + 1vw, 1.5rem);
|
|
49
|
+
max-width: 44rem;
|
|
50
|
+
margin-inline: auto;
|
|
51
|
+
padding: clamp(1.375rem, 1rem + 1.5vw, 2.25rem);
|
|
52
|
+
border: 1px solid var(--line);
|
|
53
|
+
border-radius: var(--radius-card);
|
|
54
|
+
background: var(--surface);
|
|
55
|
+
box-shadow: var(--shadow);
|
|
56
|
+
}
|
|
57
|
+
.pdf-card-glyph {
|
|
58
|
+
display: block;
|
|
59
|
+
width: 2.25rem;
|
|
60
|
+
height: 3rem;
|
|
61
|
+
fill: none;
|
|
62
|
+
stroke: var(--accent);
|
|
63
|
+
stroke-width: 2;
|
|
64
|
+
stroke-linecap: round;
|
|
65
|
+
stroke-linejoin: round;
|
|
66
|
+
}
|
|
67
|
+
.pdf-card-page {
|
|
68
|
+
fill: color-mix(in srgb, var(--accent) 10%, transparent);
|
|
69
|
+
}
|
|
70
|
+
.pdf-card-lines {
|
|
71
|
+
stroke-width: 1.75;
|
|
72
|
+
opacity: 0.55;
|
|
73
|
+
}
|
|
74
|
+
.pdf-card-words {
|
|
75
|
+
min-width: 0;
|
|
76
|
+
}
|
|
77
|
+
.pdf-card-title {
|
|
78
|
+
margin: 0;
|
|
79
|
+
font-size: var(--h3);
|
|
80
|
+
font-weight: 700;
|
|
81
|
+
line-height: 1.2;
|
|
82
|
+
overflow-wrap: anywhere;
|
|
83
|
+
}
|
|
84
|
+
.pdf-card-caption {
|
|
85
|
+
margin: 0.5rem 0 0;
|
|
86
|
+
color: var(--muted);
|
|
87
|
+
line-height: 1.5;
|
|
88
|
+
}
|
|
89
|
+
.pdf-card-actions {
|
|
90
|
+
margin-top: 1.25rem;
|
|
91
|
+
margin-bottom: 0;
|
|
92
|
+
}
|
|
93
|
+
/* A phone: the glyph over the words. */
|
|
94
|
+
@media (max-width: 39.99rem) {
|
|
95
|
+
.pdf-card {
|
|
96
|
+
grid-template-columns: minmax(0, 1fr);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
</style>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
// PdfEmbed: a document, as a title, a caption and a link that opens it.
|
|
3
|
+
// Browsers on phones do not show a PDF inside a page, so a link is what
|
|
4
|
+
// every visitor can use.
|
|
5
|
+
import type { Section } from '@backgold/content'
|
|
6
|
+
import Band from '../Band.astro'
|
|
7
|
+
import { media } from '../../../lib/section'
|
|
8
|
+
import { text } from '../../../lib/format'
|
|
9
|
+
|
|
10
|
+
interface Props {
|
|
11
|
+
section: Section
|
|
12
|
+
variant?: string
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const { section } = Astro.props
|
|
16
|
+
const title = text(section.copy.title)
|
|
17
|
+
const caption = text(section.copy.caption)
|
|
18
|
+
const pdf = media(section, 'pdfUrl')
|
|
19
|
+
---
|
|
20
|
+
{pdf && (
|
|
21
|
+
<Band section={section} class="document">
|
|
22
|
+
{title && <h2>{title}</h2>}
|
|
23
|
+
{caption && <p class="lede">{caption}</p>}
|
|
24
|
+
<p class="actions"><a class="button button-quiet" href={pdf.url} rel="noopener">Open the PDF{title && <span class="visually-hidden">: {title}</span>}</a></p>
|
|
25
|
+
</Band>
|
|
26
|
+
)}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
// Petition · Coverage (board A10): BackGold's sheet under its county coverage
|
|
3
|
+
// header and legend, which carry the title, so no heading here.
|
|
4
|
+
import type { Section } from '@backgold/content'
|
|
5
|
+
import Headed from '../modules/Headed.astro'
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
section: Section
|
|
9
|
+
variant?: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const { section } = Astro.props
|
|
13
|
+
---
|
|
14
|
+
<Headed section={section} layout="coverage" height="72rem" head={false} />
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
// Petition · Image: BackGold's sheet under its own picture header, which
|
|
3
|
+
// carries the title, so no heading here.
|
|
4
|
+
import type { Section } from '@backgold/content'
|
|
5
|
+
import Headed from '../modules/Headed.astro'
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
section: Section
|
|
9
|
+
variant?: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const { section } = Astro.props
|
|
13
|
+
---
|
|
14
|
+
<Headed section={section} layout="image" height="64rem" head={false} />
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
// Petition · Plain (board A12, the default): the heading, then BackGold's
|
|
3
|
+
// sheet with its live count and the sign form.
|
|
4
|
+
import type { Section } from '@backgold/content'
|
|
5
|
+
import Headed from '../modules/Headed.astro'
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
section: Section
|
|
9
|
+
variant?: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const { section } = Astro.props
|
|
13
|
+
---
|
|
14
|
+
<Headed section={section} layout="none" height="56rem" />
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
// Petition · Map: BackGold's sheet under its own map header, which carries the
|
|
3
|
+
// title, so no heading here.
|
|
4
|
+
import type { Section } from '@backgold/content'
|
|
5
|
+
import Headed from '../modules/Headed.astro'
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
section: Section
|
|
9
|
+
variant?: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const { section } = Astro.props
|
|
13
|
+
---
|
|
14
|
+
<Headed section={section} layout="map" height="64rem" head={false} />
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// A platform's sections and planks with the anchors the longread and columns
|
|
2
|
+
// layouts write, so a link to a plank lands whichever layout the page draws.
|
|
3
|
+
// Anchors read as words ("#plank-a-levy-needs-a-ballot") so a shared link says
|
|
4
|
+
// what it points at; a repeat gets a number, and a section or plank with no
|
|
5
|
+
// words is numbered by its place ("#platform-2", "#plank-2-1"). A section is
|
|
6
|
+
// kept when it has a title or a plank with a headline; a plank when it has a
|
|
7
|
+
// headline. A section's `num` is the row's own ("01"), else its place in the
|
|
8
|
+
// list written the same way, so the jump list and the headings count the
|
|
9
|
+
// sections (boards A2 and C3) whether or not the author typed numbers.
|
|
10
|
+
|
|
11
|
+
import type { Section } from '@backgold/content'
|
|
12
|
+
import { nested, rows } from '../../../lib/section'
|
|
13
|
+
import { text } from '../../../lib/format'
|
|
14
|
+
|
|
15
|
+
export interface Plank {
|
|
16
|
+
id: string
|
|
17
|
+
headline: string
|
|
18
|
+
plain: string | null
|
|
19
|
+
/** The plank's full text as BackGold sends it, for Prose. */
|
|
20
|
+
full: unknown
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface Part {
|
|
24
|
+
id: string
|
|
25
|
+
/** "01": the row's own number, else its place in the list. */
|
|
26
|
+
num: string
|
|
27
|
+
title: string | null
|
|
28
|
+
ethos: string | null
|
|
29
|
+
planks: Plank[]
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function partsWithAnchors(section: Section): Part[] {
|
|
33
|
+
const taken = new Set<string>()
|
|
34
|
+
const anchor = (prefix: string, words: string | null, fallback: string) => {
|
|
35
|
+
const slug =
|
|
36
|
+
(words ?? '')
|
|
37
|
+
.toLowerCase()
|
|
38
|
+
.normalize('NFKD')
|
|
39
|
+
.replace(/[^a-z0-9]+/g, '-')
|
|
40
|
+
.replace(/^-+|-+$/g, '')
|
|
41
|
+
.slice(0, 60) || fallback
|
|
42
|
+
let id = `${prefix}-${slug}`
|
|
43
|
+
for (let n = 2; taken.has(id); n++) id = `${prefix}-${slug}-${n}`
|
|
44
|
+
taken.add(id)
|
|
45
|
+
return id
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return rows(section)
|
|
49
|
+
.map((row, i) => {
|
|
50
|
+
const num = text(row.num) ?? String(i + 1).padStart(2, '0')
|
|
51
|
+
const title = text(row.title)
|
|
52
|
+
return {
|
|
53
|
+
id: anchor('platform', title, String(i + 1)),
|
|
54
|
+
num,
|
|
55
|
+
title,
|
|
56
|
+
ethos: text(row.ethos),
|
|
57
|
+
planks: nested(row, 'planks')
|
|
58
|
+
.map((p, j) => {
|
|
59
|
+
const headline = text(p.headline)
|
|
60
|
+
return { id: anchor('plank', headline, `${i + 1}-${j + 1}`), headline, plain: text(p.plain), full: p.full }
|
|
61
|
+
})
|
|
62
|
+
.filter((p): p is Plank => !!p.headline),
|
|
63
|
+
}
|
|
64
|
+
})
|
|
65
|
+
.filter((part) => part.title || part.planks.length > 0)
|
|
66
|
+
}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
---
|
|
2
|
+
// PlatformPlanks · Columns (A12, "Platform planks · Columns"): the platform
|
|
3
|
+
// side by side, one column per section, three across on a wide screen, two
|
|
4
|
+
// on a tablet, one on a phone. The heading sits over them with the link to
|
|
5
|
+
// the platform as a file, when there is one, quiet beneath it. Each column
|
|
6
|
+
// has its number in the display face, its title and ethos, then its planks as
|
|
7
|
+
// a plain list: the headline in bold, the plain-language line, and the full
|
|
8
|
+
// text behind "Read the full plank". The anchors are the long read's
|
|
9
|
+
// (anchors.ts), so a link to a section or a plank lands here too and the
|
|
10
|
+
// target is ringed. With no sections it draws nothing.
|
|
11
|
+
import type { ComponentProps } from 'astro/types'
|
|
12
|
+
import type Default from './index.astro'
|
|
13
|
+
import Band from '../Band.astro'
|
|
14
|
+
import Prose from '../../Prose.astro'
|
|
15
|
+
import { links } from '../../../lib/section'
|
|
16
|
+
import { text } from '../../../lib/format'
|
|
17
|
+
import { partsWithAnchors } from './anchors'
|
|
18
|
+
|
|
19
|
+
type Props = ComponentProps<typeof Default>
|
|
20
|
+
|
|
21
|
+
const { section } = Astro.props
|
|
22
|
+
const heading = text(section.copy.heading)
|
|
23
|
+
const file = links(section)[0] ?? null
|
|
24
|
+
const parts = partsWithAnchors(section)
|
|
25
|
+
---
|
|
26
|
+
{parts.length > 0 && (
|
|
27
|
+
<Band section={section} class="platform platform-columns">
|
|
28
|
+
{heading && <h2>{heading}</h2>}
|
|
29
|
+
{file && (
|
|
30
|
+
<p class="columns-file">
|
|
31
|
+
<a href={file.href} rel={file.rel}>{file.label}</a>
|
|
32
|
+
</p>
|
|
33
|
+
)}
|
|
34
|
+
<div class="columns" data-count={Math.min(parts.length, 3)}>
|
|
35
|
+
{parts.map((part) => (
|
|
36
|
+
<article class="columns-part" id={part.id}>
|
|
37
|
+
{(part.num || part.title) && (
|
|
38
|
+
<h3 class="columns-title">
|
|
39
|
+
{part.num && <span class="columns-num">{part.num}</span>}
|
|
40
|
+
{part.title && <span>{part.title}</span>}
|
|
41
|
+
</h3>
|
|
42
|
+
)}
|
|
43
|
+
{part.ethos && <p class="lede columns-ethos">{part.ethos}</p>}
|
|
44
|
+
{part.planks.length > 0 && (
|
|
45
|
+
<ul class="columns-planks" role="list">
|
|
46
|
+
{part.planks.map((plank) => (
|
|
47
|
+
<li class="columns-plank" id={plank.id}>
|
|
48
|
+
<h4 class="columns-headline">{plank.headline}</h4>
|
|
49
|
+
{plank.plain && <p class="columns-plain">{plank.plain}</p>}
|
|
50
|
+
{text(plank.full) && (
|
|
51
|
+
<details>
|
|
52
|
+
<summary>Read the full plank</summary>
|
|
53
|
+
<Prose value={plank.full} />
|
|
54
|
+
</details>
|
|
55
|
+
)}
|
|
56
|
+
</li>
|
|
57
|
+
))}
|
|
58
|
+
</ul>
|
|
59
|
+
)}
|
|
60
|
+
</article>
|
|
61
|
+
))}
|
|
62
|
+
</div>
|
|
63
|
+
</Band>
|
|
64
|
+
)}
|
|
65
|
+
|
|
66
|
+
<style>
|
|
67
|
+
.columns-file {
|
|
68
|
+
margin: 0;
|
|
69
|
+
font-size: var(--text-sm);
|
|
70
|
+
font-weight: 700;
|
|
71
|
+
}
|
|
72
|
+
.columns-file a {
|
|
73
|
+
color: var(--link);
|
|
74
|
+
text-decoration: underline;
|
|
75
|
+
text-decoration-thickness: 1.5px;
|
|
76
|
+
text-underline-offset: 0.25em;
|
|
77
|
+
}
|
|
78
|
+
.columns {
|
|
79
|
+
display: grid;
|
|
80
|
+
grid-template-columns: minmax(0, 1fr);
|
|
81
|
+
gap: 2.25rem 2.5rem;
|
|
82
|
+
margin-top: 1.75rem;
|
|
83
|
+
}
|
|
84
|
+
/* A column and a plank carry a clear border, pulled out into the gap, so the
|
|
85
|
+
ring of a linked one never moves the text. */
|
|
86
|
+
.columns-part {
|
|
87
|
+
margin: calc(-0.875rem - 1px) calc(-1rem - 1px);
|
|
88
|
+
padding: 0.875rem 1rem;
|
|
89
|
+
border: 1px solid transparent;
|
|
90
|
+
border-radius: var(--radius);
|
|
91
|
+
scroll-margin-top: 1rem;
|
|
92
|
+
}
|
|
93
|
+
.columns-part > * {
|
|
94
|
+
margin: 0;
|
|
95
|
+
}
|
|
96
|
+
.columns[data-count='1'] .columns-part {
|
|
97
|
+
max-width: calc(var(--measure) + 2rem);
|
|
98
|
+
}
|
|
99
|
+
.columns-title {
|
|
100
|
+
display: grid;
|
|
101
|
+
gap: 0.5rem;
|
|
102
|
+
font-size: var(--h3);
|
|
103
|
+
font-weight: 800;
|
|
104
|
+
}
|
|
105
|
+
.columns-num {
|
|
106
|
+
color: var(--link);
|
|
107
|
+
font-size: clamp(2rem, 1.6rem + 1.4vw, 2.5rem);
|
|
108
|
+
line-height: 1;
|
|
109
|
+
}
|
|
110
|
+
.columns-part .columns-ethos {
|
|
111
|
+
margin-top: 0.5rem;
|
|
112
|
+
font-size: var(--text);
|
|
113
|
+
}
|
|
114
|
+
.columns-part .columns-planks {
|
|
115
|
+
display: grid;
|
|
116
|
+
gap: 0.25rem;
|
|
117
|
+
margin-top: 1rem;
|
|
118
|
+
padding: 0.625rem 0 0;
|
|
119
|
+
border-top: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
|
|
120
|
+
list-style: none;
|
|
121
|
+
}
|
|
122
|
+
.columns-plank {
|
|
123
|
+
margin: 0 calc(-0.75rem - 1px);
|
|
124
|
+
padding: 0.5rem 0.75rem;
|
|
125
|
+
border: 1px solid transparent;
|
|
126
|
+
border-radius: var(--radius);
|
|
127
|
+
scroll-margin-top: 1rem;
|
|
128
|
+
}
|
|
129
|
+
.columns-part:target,
|
|
130
|
+
.columns-plank:target {
|
|
131
|
+
border-color: var(--link);
|
|
132
|
+
box-shadow: 0 0 0 2px var(--link);
|
|
133
|
+
}
|
|
134
|
+
.columns-headline {
|
|
135
|
+
margin: 0 0 0.125rem;
|
|
136
|
+
font-family: var(--font);
|
|
137
|
+
font-size: var(--text);
|
|
138
|
+
font-weight: 700;
|
|
139
|
+
letter-spacing: 0;
|
|
140
|
+
line-height: 1.35;
|
|
141
|
+
}
|
|
142
|
+
.columns-plain {
|
|
143
|
+
margin: 0;
|
|
144
|
+
}
|
|
145
|
+
.columns-plank details {
|
|
146
|
+
margin-top: 0.375rem;
|
|
147
|
+
}
|
|
148
|
+
.columns-plank summary {
|
|
149
|
+
font-size: var(--text-sm);
|
|
150
|
+
}
|
|
151
|
+
.columns-plank :global(.prose) {
|
|
152
|
+
margin-top: 0.5rem;
|
|
153
|
+
}
|
|
154
|
+
/* Two across, an odd last section takes the whole row rather than leave a hole beside it. */
|
|
155
|
+
@media (min-width: 40rem) {
|
|
156
|
+
.columns:not([data-count='1']) {
|
|
157
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
158
|
+
}
|
|
159
|
+
.columns-part:last-child:nth-child(odd) {
|
|
160
|
+
grid-column: 1 / -1;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
@media (min-width: 60rem) {
|
|
164
|
+
.columns[data-count='3'] {
|
|
165
|
+
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
166
|
+
}
|
|
167
|
+
.columns[data-count='3'] .columns-part:last-child:nth-child(odd) {
|
|
168
|
+
grid-column: auto;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
</style>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
// PlatformPlanks: the platform, section by section. Each plank shows its
|
|
3
|
+
// headline and plain-language line; the full text opens beneath it.
|
|
4
|
+
import type { Section } from '@backgold/content'
|
|
5
|
+
import Band from '../Band.astro'
|
|
6
|
+
import Prose from '../../Prose.astro'
|
|
7
|
+
import { nested, rows } from '../../../lib/section'
|
|
8
|
+
import { text } from '../../../lib/format'
|
|
9
|
+
|
|
10
|
+
interface Props {
|
|
11
|
+
section: Section
|
|
12
|
+
variant?: string
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const { section } = Astro.props
|
|
16
|
+
const heading = text(section.copy.heading)
|
|
17
|
+
const parts = rows(section)
|
|
18
|
+
.map((row) => ({
|
|
19
|
+
num: text(row.num),
|
|
20
|
+
title: text(row.title),
|
|
21
|
+
ethos: text(row.ethos),
|
|
22
|
+
planks: nested(row, 'planks').filter((p) => text(p.headline)),
|
|
23
|
+
}))
|
|
24
|
+
.filter((part) => part.title || part.planks.length > 0)
|
|
25
|
+
---
|
|
26
|
+
{(heading || parts.length > 0) && (
|
|
27
|
+
<Band section={section} class="platform">
|
|
28
|
+
{heading && <h2>{heading}</h2>}
|
|
29
|
+
{parts.map((part) => (
|
|
30
|
+
<div class="platform-part">
|
|
31
|
+
{part.title && (
|
|
32
|
+
<h3>
|
|
33
|
+
{part.num && <span class="platform-num">{part.num}</span>} {part.title}
|
|
34
|
+
</h3>
|
|
35
|
+
)}
|
|
36
|
+
{part.ethos && <p class="lede">{part.ethos}</p>}
|
|
37
|
+
{part.planks.length > 0 && (
|
|
38
|
+
<ol class="plank-list">
|
|
39
|
+
{part.planks.map((plank) => (
|
|
40
|
+
<li class="plank">
|
|
41
|
+
<p class="plank-headline">{text(plank.headline)}</p>
|
|
42
|
+
{text(plank.plain) && <p>{text(plank.plain)}</p>}
|
|
43
|
+
{text(plank.full) && (
|
|
44
|
+
<details>
|
|
45
|
+
<summary>The full plank</summary>
|
|
46
|
+
<Prose value={plank.full} />
|
|
47
|
+
</details>
|
|
48
|
+
)}
|
|
49
|
+
</li>
|
|
50
|
+
))}
|
|
51
|
+
</ol>
|
|
52
|
+
)}
|
|
53
|
+
</div>
|
|
54
|
+
))}
|
|
55
|
+
</Band>
|
|
56
|
+
)}
|