@backgold/template-kit 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +12 -2
- package/dist/chunk-KOB36GSF.js +62 -0
- package/dist/constants-DvTNj4JI.d-Batjcj3Z.d.ts +38 -0
- package/dist/content-api-CYeY0vU8.d.ts +849 -0
- package/dist/contract/content-api-examples.d.ts +58 -0
- package/dist/contract/content-api-examples.js +783 -0
- package/dist/contract/content-api.d.ts +2 -0
- package/dist/contract/content-api.js +1 -0
- package/dist/contract/site-templates.d.ts +252 -0
- package/dist/contract/site-templates.js +185 -0
- package/package.json +70 -3
- package/src/components/EntryCard.astro +35 -0
- package/src/components/EventMap.astro +118 -0
- package/src/components/EventPage.astro +194 -0
- package/src/components/FieldValue.astro +41 -0
- package/src/components/LeadingHero.astro +21 -0
- package/src/components/NotFound.astro +20 -0
- package/src/components/PageSections.astro +47 -0
- package/src/components/Prose.astro +18 -0
- package/src/components/chrome/Brand.astro +54 -0
- package/src/components/chrome/ClosingCall.astro +94 -0
- package/src/components/chrome/DonateStrip.astro +61 -0
- package/src/components/chrome/FooterColumns.astro +32 -0
- package/src/components/chrome/FooterContact.astro +28 -0
- package/src/components/chrome/MenuList.astro +45 -0
- package/src/components/chrome/ModeToggle.astro +125 -0
- package/src/components/chrome/SignedInNotice.astro +53 -0
- package/src/components/chrome/SignupBand.astro +12 -0
- package/src/components/chrome/TakeoverBanner.astro +56 -0
- package/src/components/chrome/VisitorAccount.astro +82 -0
- package/src/components/entries/AuthorBox.astro +47 -0
- package/src/components/entries/EntryFields.astro +29 -0
- package/src/components/entries/EntryHeader.astro +77 -0
- package/src/components/entries/ListFrame.astro +126 -0
- package/src/components/entries/ListSearch.astro +24 -0
- package/src/components/entries/Share.astro +24 -0
- package/src/components/entries/course/classroom.astro +26 -0
- package/src/components/entries/course/lesson.astro +18 -0
- package/src/components/entries/course/section.ts +20 -0
- package/src/components/entries/course/syllabus.astro +15 -0
- package/src/components/entries/index.ts +77 -0
- package/src/components/entries/newsletter/issue.astro +41 -0
- package/src/components/entries/newsletter/list.astro +26 -0
- package/src/components/entries/podcast/episode.astro +42 -0
- package/src/components/entries/podcast/list.astro +36 -0
- package/src/components/entries/post/article.astro +31 -0
- package/src/components/entries/post/list.astro +85 -0
- package/src/components/entries/props.ts +61 -0
- package/src/components/entries/video/cards.astro +39 -0
- package/src/components/entries/video/grid.astro +15 -0
- package/src/components/entries/video/watch.astro +41 -0
- package/src/components/live/LivePage.astro +215 -0
- package/src/components/live/LocalTime.astro +29 -0
- package/src/components/sections/About/books.astro +188 -0
- package/src/components/sections/About/credentials.ts +90 -0
- package/src/components/sections/About/index.astro +57 -0
- package/src/components/sections/About/left.astro +54 -0
- package/src/components/sections/About/letter.astro +108 -0
- package/src/components/sections/About/portrait.astro +308 -0
- package/src/components/sections/Advocacy/compact.astro +14 -0
- package/src/components/sections/Advocacy/index.astro +14 -0
- package/src/components/sections/Band.astro +39 -0
- package/src/components/sections/Blog/feature.astro +176 -0
- package/src/components/sections/Blog/index.astro +37 -0
- package/src/components/sections/Blog/latest.ts +80 -0
- package/src/components/sections/Blog/list.astro +186 -0
- package/src/components/sections/Booking/index.astro +139 -0
- package/src/components/sections/Booking/list.astro +144 -0
- package/src/components/sections/Booking/types.ts +60 -0
- package/src/components/sections/Calendar/agenda.astro +14 -0
- package/src/components/sections/Calendar/index.astro +14 -0
- package/src/components/sections/CandidateRoster/ballot.astro +394 -0
- package/src/components/sections/CandidateRoster/candidates.ts +69 -0
- package/src/components/sections/CandidateRoster/compact.astro +115 -0
- package/src/components/sections/CandidateRoster/index.astro +57 -0
- package/src/components/sections/CaseStudies/beforeafter.astro +222 -0
- package/src/components/sections/CaseStudies/cases.ts +111 -0
- package/src/components/sections/CaseStudies/grid.astro +261 -0
- package/src/components/sections/CaseStudies/index.astro +333 -0
- package/src/components/sections/Classroom/CourseCard.astro +181 -0
- package/src/components/sections/Classroom/Courses.astro +88 -0
- package/src/components/sections/Classroom/classroom.ts +141 -0
- package/src/components/sections/Classroom/index.astro +20 -0
- package/src/components/sections/Classroom/list.astro +15 -0
- package/src/components/sections/Collection/compact.astro +7 -0
- package/src/components/sections/Collection/entries.ts +62 -0
- package/src/components/sections/Collection/feature.astro +180 -0
- package/src/components/sections/Collection/index.astro +46 -0
- package/src/components/sections/Collection/library.astro +271 -0
- package/src/components/sections/Collection/list.astro +7 -0
- package/src/components/sections/Collection/outline.astro +134 -0
- package/src/components/sections/Collection/shelves.astro +191 -0
- package/src/components/sections/Comparison/Unlisted.astro +6 -0
- package/src/components/sections/Comparison/cards.astro +171 -0
- package/src/components/sections/Comparison/index.astro +191 -0
- package/src/components/sections/Comparison/sides.ts +98 -0
- package/src/components/sections/Comparison/spectrum.astro +261 -0
- package/src/components/sections/ContentPost/banner.astro +152 -0
- package/src/components/sections/ContentPost/index.astro +35 -0
- package/src/components/sections/ContentPost/lesson.ts +119 -0
- package/src/components/sections/ContentPost/player.astro +254 -0
- package/src/components/sections/ContentPost/theater.astro +329 -0
- package/src/components/sections/Countdown/index.astro +53 -0
- package/src/components/sections/Course/Bar.astro +46 -0
- package/src/components/sections/Course/CourseHead.astro +123 -0
- package/src/components/sections/Course/Crumbs.astro +44 -0
- package/src/components/sections/Course/Icon.astro +29 -0
- package/src/components/sections/Course/Ring.astro +62 -0
- package/src/components/sections/Course/Syllabus.astro +146 -0
- package/src/components/sections/Course/course.ts +146 -0
- package/src/components/sections/Course/index.astro +143 -0
- package/src/components/sections/Course/outline.astro +39 -0
- package/src/components/sections/Cta/banner.astro +64 -0
- package/src/components/sections/Cta/card.astro +88 -0
- package/src/components/sections/Cta/index.astro +31 -0
- package/src/components/sections/Cta/photo.astro +114 -0
- package/src/components/sections/Cta/strip.astro +91 -0
- package/src/components/sections/Donate/index.astro +136 -0
- package/src/components/sections/Donate/story.astro +7 -0
- package/src/components/sections/Event/card.astro +14 -0
- package/src/components/sections/Event/index.astro +14 -0
- package/src/components/sections/EventsList/AgendaMonths.astro +105 -0
- package/src/components/sections/EventsList/CalendarLine.astro +23 -0
- package/src/components/sections/EventsList/EventRows.astro +196 -0
- package/src/components/sections/EventsList/LiveCounts.astro +75 -0
- package/src/components/sections/EventsList/TypeTabs.astro +53 -0
- package/src/components/sections/EventsList/agenda.astro +55 -0
- package/src/components/sections/EventsList/calendar.astro +392 -0
- package/src/components/sections/EventsList/cards.astro +186 -0
- package/src/components/sections/EventsList/cohorts.astro +205 -0
- package/src/components/sections/EventsList/compact.astro +163 -0
- package/src/components/sections/EventsList/events.ts +168 -0
- package/src/components/sections/EventsList/index.astro +46 -0
- package/src/components/sections/EventsList/map.astro +436 -0
- package/src/components/sections/EventsList/shifts.astro +355 -0
- package/src/components/sections/EventsList/week.astro +361 -0
- package/src/components/sections/Faq/Contact.astro +63 -0
- package/src/components/sections/Faq/Questions.astro +98 -0
- package/src/components/sections/Faq/cards.astro +74 -0
- package/src/components/sections/Faq/faq.ts +101 -0
- package/src/components/sections/Faq/index.astro +49 -0
- package/src/components/sections/Faq/topics.astro +178 -0
- package/src/components/sections/Financials/Foot.astro +38 -0
- package/src/components/sections/Financials/Head.astro +47 -0
- package/src/components/sections/Financials/donut.astro +197 -0
- package/src/components/sections/Financials/financials.ts +52 -0
- package/src/components/sections/Financials/index.astro +148 -0
- package/src/components/sections/Financials/table.astro +157 -0
- package/src/components/sections/FormBlock/index.astro +33 -0
- package/src/components/sections/FormBlock/wide.astro +7 -0
- package/src/components/sections/Hero/cover.astro +170 -0
- package/src/components/sections/Hero/donate.astro +209 -0
- package/src/components/sections/Hero/field.astro +390 -0
- package/src/components/sections/Hero/index.astro +52 -0
- package/src/components/sections/Hero/overlap.astro +151 -0
- package/src/components/sections/Hero/rotating.astro +30 -0
- package/src/components/sections/Hero/split.astro +96 -0
- package/src/components/sections/Hero/statement.astro +55 -0
- package/src/components/sections/Hero/video.astro +399 -0
- package/src/components/sections/Issues/checklist.astro +204 -0
- package/src/components/sections/Issues/drawer.astro +237 -0
- package/src/components/sections/Issues/index.astro +115 -0
- package/src/components/sections/Issues/issues.ts +37 -0
- package/src/components/sections/Issues/numbered.astro +79 -0
- package/src/components/sections/Issues/rows.astro +137 -0
- package/src/components/sections/Issues/steps.astro +81 -0
- package/src/components/sections/Issues/tabs.astro +322 -0
- package/src/components/sections/Leaderboard/index.astro +29 -0
- package/src/components/sections/Lesson/Door.astro +121 -0
- package/src/components/sections/Lesson/LessonBody.astro +416 -0
- package/src/components/sections/Lesson/Rail.astro +182 -0
- package/src/components/sections/Lesson/Tracker.astro +137 -0
- package/src/components/sections/Lesson/index.astro +27 -0
- package/src/components/sections/Lesson/lesson.ts +233 -0
- package/src/components/sections/Lesson/reading.astro +21 -0
- package/src/components/sections/Map/CoverageLine.astro +19 -0
- package/src/components/sections/Map/RegionMap.astro +109 -0
- package/src/components/sections/Map/bar.astro +160 -0
- package/src/components/sections/Map/index.astro +192 -0
- package/src/components/sections/Map/map.astro +275 -0
- package/src/components/sections/MediaKit/BioCard.astro +108 -0
- package/src/components/sections/MediaKit/Downloads.astro +88 -0
- package/src/components/sections/MediaKit/index.astro +183 -0
- package/src/components/sections/MediaKit/kit.ts +140 -0
- package/src/components/sections/MediaKit/press.astro +189 -0
- package/src/components/sections/MediaKit/speaker.astro +205 -0
- package/src/components/sections/Membership/Benefits.astro +42 -0
- package/src/components/sections/Membership/Check.astro +12 -0
- package/src/components/sections/Membership/Price.astro +61 -0
- package/src/components/sections/Membership/compare.astro +312 -0
- package/src/components/sections/Membership/index.astro +281 -0
- package/src/components/sections/Membership/offers.ts +169 -0
- package/src/components/sections/Membership/tiers.astro +217 -0
- package/src/components/sections/MovementMap/index.astro +50 -0
- package/src/components/sections/MovementTicker/index.astro +43 -0
- package/src/components/sections/Pathways/Doors.astro +147 -0
- package/src/components/sections/Pathways/Head.astro +37 -0
- package/src/components/sections/Pathways/index.astro +27 -0
- package/src/components/sections/Pathways/pathways.ts +100 -0
- package/src/components/sections/Pathways/quiz.astro +286 -0
- package/src/components/sections/Pathways/tabs.astro +271 -0
- package/src/components/sections/PdfEmbed/card.astro +99 -0
- package/src/components/sections/PdfEmbed/index.astro +26 -0
- package/src/components/sections/PdfEmbed/medium.astro +7 -0
- package/src/components/sections/PdfEmbed/tall.astro +7 -0
- package/src/components/sections/Petition/coverage.astro +14 -0
- package/src/components/sections/Petition/image.astro +14 -0
- package/src/components/sections/Petition/index.astro +14 -0
- package/src/components/sections/Petition/map.astro +14 -0
- package/src/components/sections/PlatformPlanks/anchors.ts +66 -0
- package/src/components/sections/PlatformPlanks/columns.astro +171 -0
- package/src/components/sections/PlatformPlanks/index.astro +56 -0
- package/src/components/sections/PlatformPlanks/longread.astro +250 -0
- package/src/components/sections/PollBlock/index.astro +30 -0
- package/src/components/sections/Portfolio/featured.astro +343 -0
- package/src/components/sections/Portfolio/index.astro +571 -0
- package/src/components/sections/Portfolio/strip.astro +173 -0
- package/src/components/sections/Portfolio/work.ts +100 -0
- package/src/components/sections/Progress/MatchClock.astro +166 -0
- package/src/components/sections/Progress/compact.astro +150 -0
- package/src/components/sections/Progress/index.astro +32 -0
- package/src/components/sections/Progress/match.astro +126 -0
- package/src/components/sections/Progress/ring.astro +179 -0
- package/src/components/sections/QuickDonate/DonateCard.astro +149 -0
- package/src/components/sections/QuickDonate/Picker.astro +95 -0
- package/src/components/sections/QuickDonate/band.astro +164 -0
- package/src/components/sections/QuickDonate/bar.astro +208 -0
- package/src/components/sections/QuickDonate/donate.ts +126 -0
- package/src/components/sections/QuickDonate/hero.astro +143 -0
- package/src/components/sections/QuickDonate/index.astro +73 -0
- package/src/components/sections/QuickDonate/jar.astro +225 -0
- package/src/components/sections/QuickDonate/ladder.astro +248 -0
- package/src/components/sections/QuoteStrip/carousel.astro +340 -0
- package/src/components/sections/QuoteStrip/index.astro +58 -0
- package/src/components/sections/QuoteStrip/logos.astro +226 -0
- package/src/components/sections/QuoteStrip/quotes.ts +61 -0
- package/src/components/sections/QuoteStrip/single.astro +92 -0
- package/src/components/sections/QuoteStrip/ticker.astro +319 -0
- package/src/components/sections/QuoteStrip/wall.astro +113 -0
- package/src/components/sections/Resources/band.astro +93 -0
- package/src/components/sections/Resources/featured.astro +239 -0
- package/src/components/sections/Resources/index.astro +225 -0
- package/src/components/sections/Resources/resources.ts +92 -0
- package/src/components/sections/SampleBallot/Position.astro +39 -0
- package/src/components/sections/SampleBallot/ballot.ts +92 -0
- package/src/components/sections/SampleBallot/cards.astro +299 -0
- package/src/components/sections/SampleBallot/index.astro +326 -0
- package/src/components/sections/SampleBallot/measures.astro +172 -0
- package/src/components/sections/Scorecard/grades.astro +141 -0
- package/src/components/sections/Scorecard/index.astro +294 -0
- package/src/components/sections/Scorecard/promise.astro +167 -0
- package/src/components/sections/Scorecard/votes.ts +83 -0
- package/src/components/sections/SectionHead.astro +31 -0
- package/src/components/sections/Services/Button.astro +24 -0
- package/src/components/sections/Services/Check.astro +12 -0
- package/src/components/sections/Services/Includes.astro +42 -0
- package/src/components/sections/Services/compare.astro +328 -0
- package/src/components/sections/Services/index.astro +187 -0
- package/src/components/sections/Services/list.astro +181 -0
- package/src/components/sections/Services/services.ts +80 -0
- package/src/components/sections/ShareKit/Actions.astro +71 -0
- package/src/components/sections/ShareKit/Buttons.astro +62 -0
- package/src/components/sections/ShareKit/compact.astro +123 -0
- package/src/components/sections/ShareKit/index.astro +160 -0
- package/src/components/sections/ShareKit/share.ts +60 -0
- package/src/components/sections/ShareKit/strip.astro +173 -0
- package/src/components/sections/SignupCapture/band.astro +7 -0
- package/src/components/sections/SignupCapture/index.astro +103 -0
- package/src/components/sections/SignupCapture/inline.astro +7 -0
- package/src/components/sections/SocialFeed/index.astro +34 -0
- package/src/components/sections/StatCards/feature.astro +143 -0
- package/src/components/sections/StatCards/index.astro +51 -0
- package/src/components/sections/StatCards/ribbon.astro +113 -0
- package/src/components/sections/StatCards/wall.astro +177 -0
- package/src/components/sections/Store/featured.astro +14 -0
- package/src/components/sections/Store/index.astro +14 -0
- package/src/components/sections/Stories/Status.astro +42 -0
- package/src/components/sections/Stories/StoryCards.astro +171 -0
- package/src/components/sections/Stories/cards.astro +42 -0
- package/src/components/sections/Stories/index.astro +238 -0
- package/src/components/sections/Stories/stories.ts +97 -0
- package/src/components/sections/Stories/timeline.astro +135 -0
- package/src/components/sections/TeamGrid/board.astro +280 -0
- package/src/components/sections/TeamGrid/index.astro +71 -0
- package/src/components/sections/TeamGrid/list.astro +306 -0
- package/src/components/sections/TeamGrid/people.ts +178 -0
- package/src/components/sections/VideoEmbed/index.astro +52 -0
- package/src/components/sections/VideoEmbed/landscape.astro +7 -0
- package/src/components/sections/VideoEmbed/portrait.astro +7 -0
- package/src/components/sections/VideoEmbed/square.astro +7 -0
- package/src/components/sections/VoterTools/DaysLeft.astro +33 -0
- package/src/components/sections/VoterTools/dates.astro +149 -0
- package/src/components/sections/VoterTools/index.astro +228 -0
- package/src/components/sections/VoterTools/polling.astro +141 -0
- package/src/components/sections/VoterTools/voter-tools.ts +70 -0
- package/src/components/sections/index.ts +370 -0
- package/src/components/sections/modules/Headed.astro +39 -0
- package/src/components/sections/modules/ModuleFrame.astro +179 -0
- package/src/components/volunteer/ShiftLive.astro +90 -0
- package/src/components/volunteer/detail.astro +247 -0
- package/src/components/volunteer/list.astro +298 -0
- package/src/components/volunteer/props.ts +21 -0
- package/src/env.d.ts +22 -0
- package/src/index.d.ts +10 -0
- package/src/index.js +64 -0
- package/src/layouts/Site.astro +371 -0
- package/src/lib/academy.ts +146 -0
- package/src/lib/brand.ts +534 -0
- package/src/lib/chrome.ts +119 -0
- package/src/lib/donate-frame.ts +64 -0
- package/src/lib/entries.ts +190 -0
- package/src/lib/env.ts +34 -0
- package/src/lib/event-map-draw.ts +91 -0
- package/src/lib/events.ts +476 -0
- package/src/lib/fonts.ts +116 -0
- package/src/lib/footer.ts +24 -0
- package/src/lib/format.ts +160 -0
- package/src/lib/geo.ts +131 -0
- package/src/lib/live.ts +54 -0
- package/src/lib/menu.ts +48 -0
- package/src/lib/petition-text.ts +29 -0
- package/src/lib/reading.ts +17 -0
- package/src/lib/regions.ts +215 -0
- package/src/lib/section.ts +94 -0
- package/src/lib/shifts.ts +186 -0
- package/src/lib/stream-time.ts +20 -0
- package/src/lib/stream.ts +141 -0
- package/src/lib/visitor.ts +54 -0
- package/src/routes/catch-all.astro +286 -0
- package/src/routes/form.astro +30 -0
- package/src/routes/live.astro +49 -0
- package/src/routes/not-found.astro +18 -0
- package/src/routes/preview.astro +60 -0
- package/src/routes/setup.astro +62 -0
- package/src/routes/volunteer-shift.astro +61 -0
- package/src/routes/volunteer.astro +37 -0
- package/src/styles/entries.css +784 -0
- package/src/styles/site.css +1839 -0
- package/src/template.ts +182 -0
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
---
|
|
2
|
+
// QuoteStrip, 'carousel' layout (board 10, B): the heading small in capitals
|
|
3
|
+
// and centred, then one quote at a time, large, on a panel filled with the
|
|
4
|
+
// contrast band (outlined instead when the section already sits on that
|
|
5
|
+
// band). Each quote opens under a large quotation mark in the accent, sets
|
|
6
|
+
// the words in the display face, and closes with who said it and their role
|
|
7
|
+
// ("attribution · role") beside the row's mark, small. Under the quote: the
|
|
8
|
+
// previous arrow, a dot per quote ("Quote 2 of 4"; the shown one is a long
|
|
9
|
+
// dot in the accent and the only one in the tab order) and the next arrow.
|
|
10
|
+
// It moves only when asked, by click or by the arrow keys (Home and End for
|
|
11
|
+
// the first and last), and wraps round at either end; the panel keeps the
|
|
12
|
+
// height of its longest quote so the controls never move under a pointer,
|
|
13
|
+
// and a screen reader hears each quote as it changes. A new quote slides in
|
|
14
|
+
// a little, or simply replaces the last one when reduced motion is asked
|
|
15
|
+
// for. The controls are drawn hidden and shown by the section's script, so
|
|
16
|
+
// without it every quote stacks in the panel, ruled apart. One quote is
|
|
17
|
+
// drawn alone, with no controls. Nothing is drawn with no heading and no
|
|
18
|
+
// quote.
|
|
19
|
+
import type { ComponentProps } from 'astro/types'
|
|
20
|
+
import Band from '../Band.astro'
|
|
21
|
+
import type Default from './index.astro'
|
|
22
|
+
import { quotesOf } from './quotes'
|
|
23
|
+
import { text } from '../../../lib/format'
|
|
24
|
+
|
|
25
|
+
type Props = ComponentProps<typeof Default>
|
|
26
|
+
|
|
27
|
+
const { section } = Astro.props
|
|
28
|
+
const heading = text(section.copy.heading)
|
|
29
|
+
const quotes = quotesOf(section)
|
|
30
|
+
const many = quotes.length > 1
|
|
31
|
+
const id = `${section.id}-quotes`.replace(/[^A-Za-z0-9_-]/g, '-')
|
|
32
|
+
---
|
|
33
|
+
{(heading || quotes.length > 0) && (
|
|
34
|
+
<Band section={section} class="quotes quotes-carousel">
|
|
35
|
+
{heading && <h2 class="qc-heading">{heading}</h2>}
|
|
36
|
+
{quotes.length > 0 && (
|
|
37
|
+
<div class="qc" data-qc>
|
|
38
|
+
<div class="qc-panel bg-band-contrast">
|
|
39
|
+
<ul class="qc-slides" id={id} role="list" aria-live="polite">
|
|
40
|
+
{quotes.map((q, i) => (
|
|
41
|
+
<li class="qc-slide" id={`${id}-${i + 1}`} data-qc-slide data-qc-current={i === 0 ? '' : undefined}>
|
|
42
|
+
<figure>
|
|
43
|
+
<span class="qc-mark" aria-hidden="true">“</span>
|
|
44
|
+
<blockquote><p class="qc-quote">{q.quote}</p></blockquote>
|
|
45
|
+
{(q.attribution || q.role || q.logo) && (
|
|
46
|
+
<figcaption class="qc-by">
|
|
47
|
+
{q.logo && <img class="qc-by-mark" src={q.logo} alt="" loading="lazy" decoding="async" />}
|
|
48
|
+
{(q.attribution || q.role) && (
|
|
49
|
+
<span>
|
|
50
|
+
{q.attribution && <span class="qc-by-name">{q.attribution}</span>}
|
|
51
|
+
{q.attribution && q.role && <span class="qc-by-dot" aria-hidden="true"> · </span>}
|
|
52
|
+
{q.attribution && q.role && <span class="visually-hidden">, </span>}
|
|
53
|
+
{q.role && <span class="qc-by-role">{q.role}</span>}
|
|
54
|
+
</span>
|
|
55
|
+
)}
|
|
56
|
+
</figcaption>
|
|
57
|
+
)}
|
|
58
|
+
</figure>
|
|
59
|
+
</li>
|
|
60
|
+
))}
|
|
61
|
+
</ul>
|
|
62
|
+
{many && (
|
|
63
|
+
<div class="qc-controls" data-qc-controls hidden>
|
|
64
|
+
<button type="button" class="qc-arrow qc-prev" aria-controls={id} data-qc-step="-1">
|
|
65
|
+
<span class="visually-hidden">Previous quote</span>
|
|
66
|
+
</button>
|
|
67
|
+
<div class="qc-dots" role="group" aria-label={heading ? `${heading}: quotes` : 'Quotes'}>
|
|
68
|
+
{quotes.map((_, i) => (
|
|
69
|
+
<button
|
|
70
|
+
type="button"
|
|
71
|
+
class="qc-dot"
|
|
72
|
+
aria-label={`Quote ${i + 1} of ${quotes.length}`}
|
|
73
|
+
aria-controls={`${id}-${i + 1}`}
|
|
74
|
+
aria-current={i === 0 ? 'true' : undefined}
|
|
75
|
+
tabindex={i === 0 ? 0 : -1}
|
|
76
|
+
data-qc-dot
|
|
77
|
+
></button>
|
|
78
|
+
))}
|
|
79
|
+
</div>
|
|
80
|
+
<button type="button" class="qc-arrow qc-next" aria-controls={id} data-qc-step="1">
|
|
81
|
+
<span class="visually-hidden">Next quote</span>
|
|
82
|
+
</button>
|
|
83
|
+
</div>
|
|
84
|
+
)}
|
|
85
|
+
</div>
|
|
86
|
+
{many && (
|
|
87
|
+
<script is:inline>
|
|
88
|
+
(function (root) {
|
|
89
|
+
if (!root) return
|
|
90
|
+
var slides = root.querySelectorAll('[data-qc-slide]')
|
|
91
|
+
var dots = root.querySelectorAll('[data-qc-dot]')
|
|
92
|
+
var controls = root.querySelector('[data-qc-controls]')
|
|
93
|
+
if (!controls || slides.length < 2 || dots.length !== slides.length) return
|
|
94
|
+
var current = 0
|
|
95
|
+
var show = function (next, step, focusDot) {
|
|
96
|
+
current = (next + slides.length) % slides.length
|
|
97
|
+
root.style.setProperty('--qc-from', step < 0 ? '-1' : '1')
|
|
98
|
+
root.setAttribute('data-qc-moved', '')
|
|
99
|
+
for (var i = 0; i < slides.length; i++) {
|
|
100
|
+
var on = i === current
|
|
101
|
+
if (on) {
|
|
102
|
+
slides[i].setAttribute('data-qc-current', '')
|
|
103
|
+
dots[i].setAttribute('aria-current', 'true')
|
|
104
|
+
} else {
|
|
105
|
+
slides[i].removeAttribute('data-qc-current')
|
|
106
|
+
dots[i].removeAttribute('aria-current')
|
|
107
|
+
}
|
|
108
|
+
dots[i].tabIndex = on ? 0 : -1
|
|
109
|
+
}
|
|
110
|
+
if (focusDot) dots[current].focus()
|
|
111
|
+
}
|
|
112
|
+
controls.addEventListener('click', function (event) {
|
|
113
|
+
var button = event.target.closest('button')
|
|
114
|
+
if (!button) return
|
|
115
|
+
var step = Number(button.getAttribute('data-qc-step'))
|
|
116
|
+
if (step) return show(current + step, step, false)
|
|
117
|
+
for (var i = 0; i < dots.length; i++) if (dots[i] === button && i !== current) show(i, i < current ? -1 : 1, false)
|
|
118
|
+
})
|
|
119
|
+
controls.addEventListener('keydown', function (event) {
|
|
120
|
+
var onDot = event.target.hasAttribute('data-qc-dot')
|
|
121
|
+
var to = { ArrowLeft: current - 1, ArrowRight: current + 1, Home: 0, End: slides.length - 1 }[event.key]
|
|
122
|
+
if (to === undefined) return
|
|
123
|
+
event.preventDefault()
|
|
124
|
+
if (to !== current) show(to, to < current ? -1 : 1, onDot)
|
|
125
|
+
})
|
|
126
|
+
controls.hidden = false
|
|
127
|
+
root.setAttribute('data-qc-live', '')
|
|
128
|
+
})(document.currentScript.closest('[data-qc]'))
|
|
129
|
+
</script>
|
|
130
|
+
)}
|
|
131
|
+
</div>
|
|
132
|
+
)}
|
|
133
|
+
</Band>
|
|
134
|
+
)}
|
|
135
|
+
|
|
136
|
+
<style>
|
|
137
|
+
.qc-heading {
|
|
138
|
+
max-width: none;
|
|
139
|
+
margin: 0 0 1.5rem;
|
|
140
|
+
color: var(--muted);
|
|
141
|
+
font-family: var(--font);
|
|
142
|
+
font-size: var(--text-sm);
|
|
143
|
+
font-weight: 700;
|
|
144
|
+
letter-spacing: 0.08em;
|
|
145
|
+
line-height: 1.4;
|
|
146
|
+
text-align: center;
|
|
147
|
+
text-transform: uppercase;
|
|
148
|
+
}
|
|
149
|
+
.qc-panel {
|
|
150
|
+
padding: clamp(2rem, 1.25rem + 3vw, 3.5rem) clamp(1.25rem, 0.5rem + 4vw, 4rem);
|
|
151
|
+
border: 1px solid var(--bg-band-background);
|
|
152
|
+
border-radius: var(--radius-card);
|
|
153
|
+
background: var(--bg-band-background);
|
|
154
|
+
color: var(--bg-band-color);
|
|
155
|
+
text-align: center;
|
|
156
|
+
}
|
|
157
|
+
:global(.bg-band-contrast) .qc-panel {
|
|
158
|
+
border-color: var(--line);
|
|
159
|
+
background: color-mix(in srgb, var(--ink) 7%, transparent);
|
|
160
|
+
}
|
|
161
|
+
.qc-slides {
|
|
162
|
+
display: grid;
|
|
163
|
+
margin: 0;
|
|
164
|
+
padding: 0;
|
|
165
|
+
list-style: none;
|
|
166
|
+
}
|
|
167
|
+
.qc-slide {
|
|
168
|
+
min-width: 0;
|
|
169
|
+
}
|
|
170
|
+
/* Without script: every quote, ruled apart. */
|
|
171
|
+
.qc-slide + .qc-slide {
|
|
172
|
+
margin-top: 2rem;
|
|
173
|
+
padding-top: 2rem;
|
|
174
|
+
border-top: 1px solid var(--line);
|
|
175
|
+
}
|
|
176
|
+
/* With it: the quotes share one cell, so the panel keeps the longest one's height; only the current one shows. */
|
|
177
|
+
[data-qc-live] .qc-slide {
|
|
178
|
+
grid-area: 1 / 1;
|
|
179
|
+
align-self: center;
|
|
180
|
+
}
|
|
181
|
+
[data-qc-live] .qc-slide + .qc-slide {
|
|
182
|
+
margin: 0;
|
|
183
|
+
padding: 0;
|
|
184
|
+
border: 0;
|
|
185
|
+
}
|
|
186
|
+
[data-qc-live] .qc-slide:not([data-qc-current]) {
|
|
187
|
+
visibility: hidden;
|
|
188
|
+
}
|
|
189
|
+
.qc-slide figure {
|
|
190
|
+
max-width: 48rem;
|
|
191
|
+
margin: 0 auto;
|
|
192
|
+
}
|
|
193
|
+
.qc-mark {
|
|
194
|
+
display: block;
|
|
195
|
+
height: 0.5em;
|
|
196
|
+
color: var(--accent);
|
|
197
|
+
font-family: var(--font-display);
|
|
198
|
+
font-size: 4.5rem;
|
|
199
|
+
font-weight: 700;
|
|
200
|
+
line-height: 1;
|
|
201
|
+
}
|
|
202
|
+
.qc-slide blockquote {
|
|
203
|
+
margin: 1rem 0 0;
|
|
204
|
+
}
|
|
205
|
+
.qc-quote {
|
|
206
|
+
margin: 0;
|
|
207
|
+
font-family: var(--font-display);
|
|
208
|
+
font-size: clamp(1.5rem, 1rem + 1.9vw, 2.25rem);
|
|
209
|
+
font-style: italic;
|
|
210
|
+
font-weight: 500;
|
|
211
|
+
line-height: 1.28;
|
|
212
|
+
letter-spacing: -0.01em;
|
|
213
|
+
text-wrap: balance;
|
|
214
|
+
}
|
|
215
|
+
.qc-by {
|
|
216
|
+
display: flex;
|
|
217
|
+
flex-wrap: wrap;
|
|
218
|
+
align-items: center;
|
|
219
|
+
justify-content: center;
|
|
220
|
+
gap: 0.5rem 0.75rem;
|
|
221
|
+
margin-top: 1.25rem;
|
|
222
|
+
font-size: var(--text-sm);
|
|
223
|
+
line-height: 1.4;
|
|
224
|
+
}
|
|
225
|
+
/* A client's mark is drawn for a light ground: it sits on the panel's surface lifted to a pale tint of its own hue. */
|
|
226
|
+
.qc-by-mark {
|
|
227
|
+
box-sizing: content-box;
|
|
228
|
+
display: block;
|
|
229
|
+
width: auto;
|
|
230
|
+
height: 1.75rem;
|
|
231
|
+
max-width: 7rem;
|
|
232
|
+
padding: 0.25rem 0.375rem;
|
|
233
|
+
border-radius: 0.375rem;
|
|
234
|
+
background: var(--surface);
|
|
235
|
+
object-fit: contain;
|
|
236
|
+
}
|
|
237
|
+
@supports (color: oklch(from red l c h)) {
|
|
238
|
+
.qc-by-mark {
|
|
239
|
+
background: oklch(from var(--surface) max(l, 0.95) min(c, 0.012) h);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
.qc-by-name {
|
|
243
|
+
font-weight: 700;
|
|
244
|
+
}
|
|
245
|
+
.qc-by-dot,
|
|
246
|
+
.qc-by-role {
|
|
247
|
+
color: var(--muted);
|
|
248
|
+
}
|
|
249
|
+
.qc-controls {
|
|
250
|
+
display: flex;
|
|
251
|
+
align-items: center;
|
|
252
|
+
justify-content: center;
|
|
253
|
+
gap: 0.5rem;
|
|
254
|
+
margin-top: clamp(1.5rem, 1rem + 1.5vw, 2.25rem);
|
|
255
|
+
}
|
|
256
|
+
.qc-controls[hidden] {
|
|
257
|
+
display: none;
|
|
258
|
+
}
|
|
259
|
+
.qc-dots {
|
|
260
|
+
display: flex;
|
|
261
|
+
flex-wrap: wrap;
|
|
262
|
+
justify-content: center;
|
|
263
|
+
min-width: 0;
|
|
264
|
+
}
|
|
265
|
+
.qc-controls button {
|
|
266
|
+
margin: 0;
|
|
267
|
+
padding: 0;
|
|
268
|
+
border: 0;
|
|
269
|
+
background: transparent;
|
|
270
|
+
color: var(--ink);
|
|
271
|
+
font: inherit;
|
|
272
|
+
cursor: pointer;
|
|
273
|
+
}
|
|
274
|
+
.qc-dot {
|
|
275
|
+
display: grid;
|
|
276
|
+
place-items: center;
|
|
277
|
+
width: 1.75rem;
|
|
278
|
+
height: 2.75rem;
|
|
279
|
+
}
|
|
280
|
+
.qc-dot::before {
|
|
281
|
+
content: '';
|
|
282
|
+
width: 0.5rem;
|
|
283
|
+
height: 0.5rem;
|
|
284
|
+
border-radius: var(--pill);
|
|
285
|
+
background: var(--muted);
|
|
286
|
+
}
|
|
287
|
+
.qc-dot:hover::before {
|
|
288
|
+
background: var(--ink);
|
|
289
|
+
}
|
|
290
|
+
.qc-dot[aria-current='true'] {
|
|
291
|
+
width: 2.75rem;
|
|
292
|
+
}
|
|
293
|
+
.qc-dot[aria-current='true']::before {
|
|
294
|
+
width: 1.75rem;
|
|
295
|
+
background: var(--accent);
|
|
296
|
+
}
|
|
297
|
+
.qc-controls .qc-arrow {
|
|
298
|
+
flex: 0 0 auto;
|
|
299
|
+
display: grid;
|
|
300
|
+
place-items: center;
|
|
301
|
+
width: 2.75rem;
|
|
302
|
+
height: 2.75rem;
|
|
303
|
+
border: 1.5px solid var(--line-strong);
|
|
304
|
+
border-radius: 50%;
|
|
305
|
+
}
|
|
306
|
+
.qc-controls .qc-arrow:hover {
|
|
307
|
+
border-color: var(--ink);
|
|
308
|
+
}
|
|
309
|
+
.qc-arrow::before {
|
|
310
|
+
content: '';
|
|
311
|
+
width: 0.5rem;
|
|
312
|
+
height: 0.5rem;
|
|
313
|
+
border-right: 2px solid currentColor;
|
|
314
|
+
border-bottom: 2px solid currentColor;
|
|
315
|
+
}
|
|
316
|
+
.qc-prev::before {
|
|
317
|
+
margin-left: 0.2rem;
|
|
318
|
+
transform: rotate(135deg);
|
|
319
|
+
}
|
|
320
|
+
.qc-next::before {
|
|
321
|
+
margin-right: 0.2rem;
|
|
322
|
+
transform: rotate(-45deg);
|
|
323
|
+
}
|
|
324
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
325
|
+
[data-qc-moved] .qc-slide[data-qc-current] {
|
|
326
|
+
animation: qc-in 0.3s ease-out;
|
|
327
|
+
}
|
|
328
|
+
.qc-dot::before {
|
|
329
|
+
transition:
|
|
330
|
+
width 0.2s ease,
|
|
331
|
+
background-color 0.2s ease;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
@keyframes qc-in {
|
|
335
|
+
from {
|
|
336
|
+
opacity: 0;
|
|
337
|
+
transform: translateX(calc(var(--qc-from, 1) * 1.5rem));
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
</style>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
// QuoteStrip (Row, the default; board C2, section 5): the section head (the
|
|
3
|
+
// kicker when one is set, the heading, and the section's links at the right:
|
|
4
|
+
// "All endorsements"), then a row of quote cards on the band's surface, three
|
|
5
|
+
// across on a wide screen and one on a phone. Each card sets the quote, curly
|
|
6
|
+
// quotes added unless the operator typed their own, over who said it: their
|
|
7
|
+
// mark (the logo from a safe address, else the initials of the name in a
|
|
8
|
+
// disc in the primary colour), the name and, muted, the role. Nothing is
|
|
9
|
+
// drawn with no heading and no quote.
|
|
10
|
+
import type { Section } from '@backgold/content'
|
|
11
|
+
import Band from '../Band.astro'
|
|
12
|
+
import SectionHead from '../SectionHead.astro'
|
|
13
|
+
import { initials } from '../CandidateRoster/candidates'
|
|
14
|
+
import { quotesOf } from './quotes'
|
|
15
|
+
import { links } from '../../../lib/section'
|
|
16
|
+
import { text } from '../../../lib/format'
|
|
17
|
+
|
|
18
|
+
interface Props {
|
|
19
|
+
section: Section
|
|
20
|
+
variant?: string
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const { section } = Astro.props
|
|
24
|
+
const heading = text(section.copy.heading)
|
|
25
|
+
const quotes = quotesOf(section)
|
|
26
|
+
---
|
|
27
|
+
{(heading || quotes.length > 0) && (
|
|
28
|
+
<Band section={section} class="quotes">
|
|
29
|
+
<SectionHead kicker={text(section.copy.kicker)} heading={heading} more={links(section)} />
|
|
30
|
+
{quotes.length > 0 && (
|
|
31
|
+
<ul class="grid grid-3" role="list">
|
|
32
|
+
{quotes.map((q) => {
|
|
33
|
+
const mark = q.attribution ? initials(q.attribution) : ''
|
|
34
|
+
return (
|
|
35
|
+
<li>
|
|
36
|
+
<figure class="quote">
|
|
37
|
+
<blockquote><p class:list={['quote-words', q.quoted && 'quote-quoted']}>{q.quote}</p></blockquote>
|
|
38
|
+
{(q.attribution || q.role) && (
|
|
39
|
+
<figcaption class="quote-by">
|
|
40
|
+
{q.logo ? (
|
|
41
|
+
<img class="quote-mark" src={q.logo} alt="" loading="lazy" decoding="async" />
|
|
42
|
+
) : (
|
|
43
|
+
mark && <span class="quote-mark quote-initials" aria-hidden="true">{mark}</span>
|
|
44
|
+
)}
|
|
45
|
+
<span class="quote-who">
|
|
46
|
+
{q.attribution && <span class="quote-name">{q.attribution}</span>}
|
|
47
|
+
{q.role && <span class="quote-role">{q.role}</span>}
|
|
48
|
+
</span>
|
|
49
|
+
</figcaption>
|
|
50
|
+
)}
|
|
51
|
+
</figure>
|
|
52
|
+
</li>
|
|
53
|
+
)
|
|
54
|
+
})}
|
|
55
|
+
</ul>
|
|
56
|
+
)}
|
|
57
|
+
</Band>
|
|
58
|
+
)}
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
---
|
|
2
|
+
// QuoteStrip, 'logos' layout (board 10, A, "Trusted by"): the heading small
|
|
3
|
+
// in capitals and centred, then a wall of the clients' marks, then the first
|
|
4
|
+
// three quotes as cards. Each row with a mark gives one tile on the band's
|
|
5
|
+
// surface (a mark two rows share, one tile), the mark named by the row's
|
|
6
|
+
// attribution or role, in grey and a little faded until the tile is hovered
|
|
7
|
+
// or holds focus; five tiles to a row, three on a phone, a short last row
|
|
8
|
+
// centred. Each card sets the quote in the display face, curly quotes added
|
|
9
|
+
// (hanging into the margin) unless the operator typed their own, then who
|
|
10
|
+
// said it in bold over their role, muted, with the row's mark small beside
|
|
11
|
+
// them when it has one. With no marks the quotes stand alone; with no quotes
|
|
12
|
+
// the wall does. Nothing is drawn with no heading, no quote and no mark.
|
|
13
|
+
import type { ComponentProps } from 'astro/types'
|
|
14
|
+
import Band from '../Band.astro'
|
|
15
|
+
import type Default from './index.astro'
|
|
16
|
+
import { marksOf, quotesOf } from './quotes'
|
|
17
|
+
import { text } from '../../../lib/format'
|
|
18
|
+
|
|
19
|
+
type Props = ComponentProps<typeof Default>
|
|
20
|
+
|
|
21
|
+
const { section } = Astro.props
|
|
22
|
+
const heading = text(section.copy.heading)
|
|
23
|
+
const marks = marksOf(section)
|
|
24
|
+
const quotes = quotesOf(section).slice(0, 3)
|
|
25
|
+
---
|
|
26
|
+
{(heading || marks.length > 0 || quotes.length > 0) && (
|
|
27
|
+
<Band section={section} class="quotes quotes-logos">
|
|
28
|
+
{heading && <h2 class="ql-heading">{heading}</h2>}
|
|
29
|
+
{marks.length > 0 && (
|
|
30
|
+
<ul class="ql-marks" role="list">
|
|
31
|
+
{marks.map((mark) => (
|
|
32
|
+
<li class="ql-mark">
|
|
33
|
+
<img src={mark.logo} alt={mark.name} loading="lazy" decoding="async" />
|
|
34
|
+
</li>
|
|
35
|
+
))}
|
|
36
|
+
</ul>
|
|
37
|
+
)}
|
|
38
|
+
{quotes.length > 0 && (
|
|
39
|
+
<ul class="ql-cards" role="list">
|
|
40
|
+
{quotes.map((q) => (
|
|
41
|
+
<li class="ql-card">
|
|
42
|
+
<figure>
|
|
43
|
+
<blockquote>
|
|
44
|
+
<p class:list={['ql-quote', q.quoted && 'ql-quoted']}>{q.quote}</p>
|
|
45
|
+
</blockquote>
|
|
46
|
+
{(q.attribution || q.role || q.logo) && (
|
|
47
|
+
<figcaption class="ql-by">
|
|
48
|
+
{q.logo && <img class="ql-by-mark" src={q.logo} alt="" loading="lazy" decoding="async" />}
|
|
49
|
+
{(q.attribution || q.role) && (
|
|
50
|
+
<span class="ql-by-words">
|
|
51
|
+
{q.attribution && <span class="ql-by-name">{q.attribution}</span>}
|
|
52
|
+
{q.role && <span class="ql-by-role">{q.role}</span>}
|
|
53
|
+
</span>
|
|
54
|
+
)}
|
|
55
|
+
</figcaption>
|
|
56
|
+
)}
|
|
57
|
+
</figure>
|
|
58
|
+
</li>
|
|
59
|
+
))}
|
|
60
|
+
</ul>
|
|
61
|
+
)}
|
|
62
|
+
</Band>
|
|
63
|
+
)}
|
|
64
|
+
|
|
65
|
+
<style>
|
|
66
|
+
.ql-heading {
|
|
67
|
+
max-width: none;
|
|
68
|
+
margin: 0 0 1.5rem;
|
|
69
|
+
color: var(--muted);
|
|
70
|
+
font-family: var(--font);
|
|
71
|
+
font-size: var(--text-sm);
|
|
72
|
+
font-weight: 700;
|
|
73
|
+
letter-spacing: 0.08em;
|
|
74
|
+
line-height: 1.4;
|
|
75
|
+
text-align: center;
|
|
76
|
+
text-transform: uppercase;
|
|
77
|
+
}
|
|
78
|
+
/*
|
|
79
|
+
A client's mark is drawn for a light ground: on a dark band (or in dark
|
|
80
|
+
mode) its tile, and the plate under a card's small mark, are the band's
|
|
81
|
+
surface lifted to a pale tint of its own hue; on a light band they are the
|
|
82
|
+
surface itself (where a browser cannot lift a colour, the surface).
|
|
83
|
+
*/
|
|
84
|
+
.ql-marks,
|
|
85
|
+
.ql-cards {
|
|
86
|
+
--ql-plate: var(--surface);
|
|
87
|
+
}
|
|
88
|
+
@supports (color: oklch(from red l c h)) {
|
|
89
|
+
.ql-marks,
|
|
90
|
+
.ql-cards {
|
|
91
|
+
--ql-plate: oklch(from var(--surface) max(l, 0.95) min(c, 0.012) h);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
.ql-marks {
|
|
95
|
+
--ql-gap: 0.75rem;
|
|
96
|
+
--ql-across: 3;
|
|
97
|
+
display: flex;
|
|
98
|
+
flex-wrap: wrap;
|
|
99
|
+
justify-content: center;
|
|
100
|
+
gap: var(--ql-gap);
|
|
101
|
+
margin: 0;
|
|
102
|
+
padding: 0;
|
|
103
|
+
list-style: none;
|
|
104
|
+
}
|
|
105
|
+
.ql-mark {
|
|
106
|
+
flex: 0 0 calc((100% - (var(--ql-across) - 1) * var(--ql-gap)) / var(--ql-across));
|
|
107
|
+
display: grid;
|
|
108
|
+
place-items: center;
|
|
109
|
+
min-width: 0;
|
|
110
|
+
min-height: 5rem;
|
|
111
|
+
padding: 1rem 0.875rem;
|
|
112
|
+
border: 1px solid var(--line);
|
|
113
|
+
border-radius: var(--radius);
|
|
114
|
+
background: var(--ql-plate);
|
|
115
|
+
}
|
|
116
|
+
.ql-mark img {
|
|
117
|
+
display: block;
|
|
118
|
+
max-width: 100%;
|
|
119
|
+
max-height: 2.5rem;
|
|
120
|
+
width: auto;
|
|
121
|
+
object-fit: contain;
|
|
122
|
+
filter: grayscale(1);
|
|
123
|
+
opacity: 0.72;
|
|
124
|
+
}
|
|
125
|
+
.ql-mark:hover img,
|
|
126
|
+
.ql-mark:focus-within img {
|
|
127
|
+
filter: none;
|
|
128
|
+
opacity: 1;
|
|
129
|
+
}
|
|
130
|
+
.ql-cards {
|
|
131
|
+
display: grid;
|
|
132
|
+
grid-template-columns: minmax(0, 1fr);
|
|
133
|
+
gap: 1rem;
|
|
134
|
+
margin: 0;
|
|
135
|
+
padding: 0;
|
|
136
|
+
list-style: none;
|
|
137
|
+
}
|
|
138
|
+
.ql-marks + .ql-cards {
|
|
139
|
+
margin-top: clamp(1rem, 0.75rem + 1vw, 1.5rem);
|
|
140
|
+
}
|
|
141
|
+
.ql-card {
|
|
142
|
+
min-width: 0;
|
|
143
|
+
border: 1px solid var(--line);
|
|
144
|
+
border-radius: var(--radius-card);
|
|
145
|
+
background: var(--surface);
|
|
146
|
+
}
|
|
147
|
+
.ql-card figure {
|
|
148
|
+
display: flex;
|
|
149
|
+
flex-direction: column;
|
|
150
|
+
justify-content: space-between;
|
|
151
|
+
gap: 1.25rem;
|
|
152
|
+
height: 100%;
|
|
153
|
+
margin: 0;
|
|
154
|
+
padding: 1.375rem 1.5rem 1.5rem;
|
|
155
|
+
}
|
|
156
|
+
.ql-card blockquote {
|
|
157
|
+
margin: 0;
|
|
158
|
+
}
|
|
159
|
+
.ql-quote {
|
|
160
|
+
margin: 0;
|
|
161
|
+
font-family: var(--font-display);
|
|
162
|
+
font-size: clamp(1.125rem, 1.05rem + 0.3vw, 1.3125rem);
|
|
163
|
+
font-weight: 500;
|
|
164
|
+
line-height: 1.4;
|
|
165
|
+
letter-spacing: -0.005em;
|
|
166
|
+
text-indent: -0.4em;
|
|
167
|
+
}
|
|
168
|
+
.ql-quote:not(.ql-quoted)::before {
|
|
169
|
+
content: open-quote;
|
|
170
|
+
}
|
|
171
|
+
.ql-quote:not(.ql-quoted)::after {
|
|
172
|
+
content: close-quote;
|
|
173
|
+
}
|
|
174
|
+
.ql-by {
|
|
175
|
+
display: flex;
|
|
176
|
+
align-items: center;
|
|
177
|
+
gap: 0.75rem;
|
|
178
|
+
font-size: var(--text-sm);
|
|
179
|
+
line-height: 1.35;
|
|
180
|
+
}
|
|
181
|
+
.ql-by-mark {
|
|
182
|
+
box-sizing: content-box;
|
|
183
|
+
flex: 0 0 auto;
|
|
184
|
+
display: block;
|
|
185
|
+
width: auto;
|
|
186
|
+
height: 1.75rem;
|
|
187
|
+
max-width: 6.5rem;
|
|
188
|
+
padding: 0.25rem 0.375rem;
|
|
189
|
+
border-radius: 0.375rem;
|
|
190
|
+
background: var(--ql-plate);
|
|
191
|
+
object-fit: contain;
|
|
192
|
+
}
|
|
193
|
+
.ql-by-words {
|
|
194
|
+
display: grid;
|
|
195
|
+
gap: 0.125rem;
|
|
196
|
+
min-width: 0;
|
|
197
|
+
}
|
|
198
|
+
.ql-by-name {
|
|
199
|
+
font-weight: 700;
|
|
200
|
+
}
|
|
201
|
+
.ql-by-role {
|
|
202
|
+
color: var(--muted);
|
|
203
|
+
}
|
|
204
|
+
@media (min-width: 40rem) {
|
|
205
|
+
.ql-marks {
|
|
206
|
+
--ql-across: 5;
|
|
207
|
+
--ql-gap: 1rem;
|
|
208
|
+
}
|
|
209
|
+
.ql-mark {
|
|
210
|
+
min-height: 5.75rem;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
@media (min-width: 48rem) {
|
|
214
|
+
.ql-cards {
|
|
215
|
+
grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
|
|
216
|
+
gap: 1.25rem;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
220
|
+
.ql-mark img {
|
|
221
|
+
transition:
|
|
222
|
+
filter 0.2s ease,
|
|
223
|
+
opacity 0.2s ease;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
</style>
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// A QuoteStrip's rows as its logos, carousel and wall layouts draw them:
|
|
2
|
+
// `quote` (the operator's words, verbatim), `attribution` (who said it),
|
|
3
|
+
// `role` (their title or organization) and `logoUrl` (the client's mark,
|
|
4
|
+
// shown only from a safe address). A row is a quote when it has words; a row
|
|
5
|
+
// with a mark is a client on the logos wall whether or not it has words.
|
|
6
|
+
//
|
|
7
|
+
// `quoted` says the words already open and close with a quotation mark the
|
|
8
|
+
// operator typed, so a layout that sets curly quotes around them leaves them
|
|
9
|
+
// as typed instead of doubling them.
|
|
10
|
+
|
|
11
|
+
import type { Section } from '@backgold/content'
|
|
12
|
+
import { safeSrc } from '@backgold/astro/server'
|
|
13
|
+
import { rows, type Row } from '../../../lib/section'
|
|
14
|
+
import { text } from '../../../lib/format'
|
|
15
|
+
|
|
16
|
+
export interface Quote {
|
|
17
|
+
quote: string
|
|
18
|
+
quoted: boolean
|
|
19
|
+
attribution: string | null
|
|
20
|
+
role: string | null
|
|
21
|
+
logo: string | null
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface Mark {
|
|
25
|
+
logo: string
|
|
26
|
+
/** The client's name for the mark's alt text: the attribution, else the role, else empty. */
|
|
27
|
+
name: string
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const OPENS = /^["'“”‘’„«»]/
|
|
31
|
+
const CLOSES = /["'“”‘’»«]$/
|
|
32
|
+
|
|
33
|
+
function read(row: Row) {
|
|
34
|
+
const quote = text(row.quote)?.trim() ?? null
|
|
35
|
+
return {
|
|
36
|
+
quote,
|
|
37
|
+
quoted: quote !== null && quote.length > 1 && OPENS.test(quote) && CLOSES.test(quote),
|
|
38
|
+
attribution: text(row.attribution)?.trim() ?? null,
|
|
39
|
+
role: text(row.role)?.trim() ?? null,
|
|
40
|
+
logo: safeSrc(row.logoUrl),
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** The section's quotes in row order: the rows with words. */
|
|
45
|
+
export function quotesOf(section: Section): Quote[] {
|
|
46
|
+
return rows(section)
|
|
47
|
+
.map(read)
|
|
48
|
+
.filter((q): q is Quote => q.quote !== null)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** The logos wall: each row's mark in row order, a mark two rows share once. */
|
|
52
|
+
export function marksOf(section: Section): Mark[] {
|
|
53
|
+
const seen = new Set<string>()
|
|
54
|
+
const marks: Mark[] = []
|
|
55
|
+
for (const row of rows(section).map(read)) {
|
|
56
|
+
if (!row.logo || seen.has(row.logo)) continue
|
|
57
|
+
seen.add(row.logo)
|
|
58
|
+
marks.push({ logo: row.logo, name: row.attribution ?? row.role ?? '' })
|
|
59
|
+
}
|
|
60
|
+
return marks
|
|
61
|
+
}
|