@sinnstack/ui 0.0.0-stage → 0.3.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/CHANGELOG.md +89 -0
- package/LICENSE +373 -0
- package/README.md +188 -2
- package/docs/blocks.md +373 -0
- package/docs/data.md +128 -0
- package/docs/finishes.md +165 -0
- package/docs/motion.md +166 -0
- package/docs/primitives.md +510 -0
- package/docs/seo.md +191 -0
- package/docs/tokens.md +122 -0
- package/package.json +132 -3
- package/scripts/check-contrast.mjs +180 -0
- package/src/blocks/BlockRenderer.astro +60 -0
- package/src/blocks/CTABanner.astro +121 -0
- package/src/blocks/CTAPair.astro +110 -0
- package/src/blocks/CardGrid.astro +167 -0
- package/src/blocks/ConsentEmbed.astro +125 -0
- package/src/blocks/ConsentManager.astro +147 -0
- package/src/blocks/ConsentScript.astro +47 -0
- package/src/blocks/ContactCard.astro +164 -0
- package/src/blocks/ContactForm.astro +224 -0
- package/src/blocks/ErrorPage.astro +242 -0
- package/src/blocks/FAQ.astro +135 -0
- package/src/blocks/FeatureGrid.astro +148 -0
- package/src/blocks/Hero.astro +171 -0
- package/src/blocks/HeroCarousel.astro +220 -0
- package/src/blocks/HighlightCards.astro +107 -0
- package/src/blocks/LocationHours.astro +311 -0
- package/src/blocks/LogoCloud.astro +135 -0
- package/src/blocks/MaintenancePage.astro +173 -0
- package/src/blocks/MediaText.astro +177 -0
- package/src/blocks/PageHeader.astro +126 -0
- package/src/blocks/ProseSection.astro +98 -0
- package/src/blocks/Reviews.astro +194 -0
- package/src/blocks/RichText.astro +58 -0
- package/src/blocks/StatsBand.astro +117 -0
- package/src/blocks/Steps.astro +141 -0
- package/src/blocks/Testimonials.astro +144 -0
- package/src/blocks/Topbar.astro +158 -0
- package/src/blocks/cms/card-grid.ts +48 -0
- package/src/blocks/cms/consent.ts +16 -0
- package/src/blocks/cms/contact-card.ts +46 -0
- package/src/blocks/cms/contact-form.ts +37 -0
- package/src/blocks/cms/cta-banner.ts +27 -0
- package/src/blocks/cms/cta-pair.ts +30 -0
- package/src/blocks/cms/data-base.ts +5 -0
- package/src/blocks/cms/data.ts +257 -0
- package/src/blocks/cms/faq.ts +38 -0
- package/src/blocks/cms/feature-grid.ts +47 -0
- package/src/blocks/cms/fixtures.ts +591 -0
- package/src/blocks/cms/hero-carousel.ts +36 -0
- package/src/blocks/cms/hero.ts +33 -0
- package/src/blocks/cms/highlight-cards.ts +41 -0
- package/src/blocks/cms/images.ts +37 -0
- package/src/blocks/cms/index.ts +59 -0
- package/src/blocks/cms/location-hours.ts +67 -0
- package/src/blocks/cms/logo-cloud.ts +36 -0
- package/src/blocks/cms/media-text.ts +26 -0
- package/src/blocks/cms/page-header.ts +27 -0
- package/src/blocks/cms/pages.ts +35 -0
- package/src/blocks/cms/prose-section.ts +25 -0
- package/src/blocks/cms/reviews.ts +50 -0
- package/src/blocks/cms/schema-dsl.ts +134 -0
- package/src/blocks/cms/schema.ts +794 -0
- package/src/blocks/cms/shared.ts +63 -0
- package/src/blocks/cms/stats-band.ts +35 -0
- package/src/blocks/cms/steps.ts +40 -0
- package/src/blocks/cms/testimonials.ts +46 -0
- package/src/blocks/cms/topbar.ts +27 -0
- package/src/blocks/cms/types.ts +27 -0
- package/src/blocks/consent.ts +14 -0
- package/src/blocks/icons.ts +47 -0
- package/src/blocks/index.ts +42 -0
- package/src/blocks/internal/Actions.astro +35 -0
- package/src/blocks/internal/BlockHeader.astro +45 -0
- package/src/blocks/internal/BlockShell.astro +58 -0
- package/src/blocks/internal/CarouselScript.astro +7 -0
- package/src/blocks/internal/ConsentEmbedScript.astro +7 -0
- package/src/blocks/internal/ConsentManagerScript.astro +7 -0
- package/src/blocks/internal/HoursScript.astro +7 -0
- package/src/blocks/internal/Placeholder.astro +13 -0
- package/src/blocks/internal/RichTextNode.astro +133 -0
- package/src/blocks/internal/StandaloneDocument.astro +53 -0
- package/src/blocks/internal/consent.ts +96 -0
- package/src/blocks/internal/fields.ts +18 -0
- package/src/blocks/internal/registry-contract.ts +67 -0
- package/src/blocks/internal/reviews.ts +22 -0
- package/src/blocks/internal/slug.ts +12 -0
- package/src/blocks/internal/util.ts +23 -0
- package/src/blocks/lib/contact.ts +92 -0
- package/src/blocks/lib/error-pages.ts +119 -0
- package/src/blocks/lib/faq.ts +37 -0
- package/src/blocks/lib/hours.ts +201 -0
- package/src/blocks/lib/maintenance.ts +129 -0
- package/src/blocks/lib/markdown.ts +350 -0
- package/src/blocks/lib/rich-text.ts +132 -0
- package/src/blocks/registry.ts +79 -0
- package/src/blocks/scripts/carousel.ts +218 -0
- package/src/blocks/scripts/consent-embed.ts +105 -0
- package/src/blocks/scripts/consent-manager.ts +112 -0
- package/src/blocks/scripts/consent-store.ts +86 -0
- package/src/blocks/scripts/error-page.ts +71 -0
- package/src/blocks/scripts/hours.ts +107 -0
- package/src/blocks/scripts/maintenance.ts +109 -0
- package/src/blocks/styles/blocks.css +1320 -0
- package/src/blocks/styles/consent.css +102 -0
- package/src/blocks/styles/faq.css +28 -0
- package/src/blocks/styles/location.css +92 -0
- package/src/blocks/styles/prose-section.css +13 -0
- package/src/blocks/styles/quotes.css +123 -0
- package/src/blocks/styles/rich-text.css +14 -0
- package/src/blocks/types.ts +293 -0
- package/src/data/ChartAxis.astro +19 -0
- package/src/data/ChartContainer.astro +152 -0
- package/src/data/ChartLegend.astro +25 -0
- package/src/data/ChartSeries.astro +14 -0
- package/src/data/ChartTable.astro +17 -0
- package/src/data/ChartTooltip.astro +20 -0
- package/src/data/Sparkline.astro +55 -0
- package/src/data/cms.ts +130 -0
- package/src/data/index.ts +10 -0
- package/src/data/internal/scale.ts +107 -0
- package/src/data/lib/chart.ts +459 -0
- package/src/data/lib/render.ts +219 -0
- package/src/data/lib/sparkline.ts +117 -0
- package/src/data/schema.ts +65 -0
- package/src/data/scripts/chart.ts +324 -0
- package/src/data/styles/chart.css +392 -0
- package/src/finishes/aurora.css +75 -0
- package/src/finishes/autumn.css +87 -0
- package/src/finishes/blueprint.css +69 -0
- package/src/finishes/brutalist.css +55 -0
- package/src/finishes/clay.css +48 -0
- package/src/finishes/day-cycle.css +46 -0
- package/src/finishes/fog.css +71 -0
- package/src/finishes/glass.css +149 -0
- package/src/finishes/holographic.css +91 -0
- package/src/finishes/night.css +77 -0
- package/src/finishes/paper.css +58 -0
- package/src/finishes/polished-glass.css +159 -0
- package/src/finishes/rain.css +84 -0
- package/src/finishes/scripts/day-cycle.ts +30 -0
- package/src/finishes/scripts/holographic.ts +37 -0
- package/src/finishes/scripts/spotlight.ts +30 -0
- package/src/finishes/spotlight.css +41 -0
- package/src/finishes/spring.css +80 -0
- package/src/finishes/terminal.css +49 -0
- package/src/motion/Marquee.astro +90 -0
- package/src/motion/MotionProvider.astro +50 -0
- package/src/motion/PageTransitions.astro +61 -0
- package/src/motion/Parallax.astro +44 -0
- package/src/motion/ParallaxLayer.astro +31 -0
- package/src/motion/RevealOnScroll.astro +59 -0
- package/src/motion/SceneRegistry.astro +38 -0
- package/src/motion/ScrollScene.astro +81 -0
- package/src/motion/index.ts +12 -0
- package/src/motion/integration.ts +48 -0
- package/src/motion/runtime/page-transitions.ts +68 -0
- package/src/motion/runtime/runtime.ts +180 -0
- package/src/motion/runtime/scenes.ts +248 -0
- package/src/motion/runtime/types.ts +103 -0
- package/src/motion/styles/motion.css +332 -0
- package/src/motion/transitions.ts +74 -0
- package/src/motion/virtual.d.ts +4 -0
- package/src/primitives/Accordion.astro +129 -0
- package/src/primitives/Breadcrumbs.astro +50 -0
- package/src/primitives/BulletList.astro +69 -0
- package/src/primitives/Button.astro +73 -0
- package/src/primitives/ButtonGroup.astro +54 -0
- package/src/primitives/Callout.astro +137 -0
- package/src/primitives/Caption.astro +35 -0
- package/src/primitives/Card.astro +72 -0
- package/src/primitives/CardContent.astro +24 -0
- package/src/primitives/CardFooter.astro +36 -0
- package/src/primitives/CardHeader.astro +86 -0
- package/src/primitives/Checkbox.astro +38 -0
- package/src/primitives/ChoiceGroup.astro +23 -0
- package/src/primitives/Cluster.astro +49 -0
- package/src/primitives/Container.astro +44 -0
- package/src/primitives/DescriptionList.astro +83 -0
- package/src/primitives/Dialog.astro +38 -0
- package/src/primitives/Disclosure.astro +67 -0
- package/src/primitives/Divider.astro +93 -0
- package/src/primitives/Drawer.astro +33 -0
- package/src/primitives/Fieldset.astro +80 -0
- package/src/primitives/Flex.astro +64 -0
- package/src/primitives/FocusRing.astro +63 -0
- package/src/primitives/FocusTrap.astro +64 -0
- package/src/primitives/Footer.astro +155 -0
- package/src/primitives/Form.astro +68 -0
- package/src/primitives/FormDescription.astro +26 -0
- package/src/primitives/FormError.astro +106 -0
- package/src/primitives/FormField.astro +72 -0
- package/src/primitives/Grid.astro +64 -0
- package/src/primitives/Heading.astro +45 -0
- package/src/primitives/IconButton.astro +48 -0
- package/src/primitives/Image.astro +125 -0
- package/src/primitives/Input.astro +86 -0
- package/src/primitives/Label.astro +50 -0
- package/src/primitives/Link.astro +81 -0
- package/src/primitives/LinkButton.astro +66 -0
- package/src/primitives/List.astro +39 -0
- package/src/primitives/ListItem.astro +178 -0
- package/src/primitives/MediaObject.astro +66 -0
- package/src/primitives/MetricCard.astro +278 -0
- package/src/primitives/NavLink.astro +81 -0
- package/src/primitives/NavMenu.astro +109 -0
- package/src/primitives/Navbar.astro +197 -0
- package/src/primitives/Panel.astro +153 -0
- package/src/primitives/Picture.astro +167 -0
- package/src/primitives/Popover.astro +95 -0
- package/src/primitives/Prose.astro +45 -0
- package/src/primitives/Radio.astro +21 -0
- package/src/primitives/Rating.astro +135 -0
- package/src/primitives/ReducedMotion.astro +90 -0
- package/src/primitives/SegmentedControl.astro +132 -0
- package/src/primitives/Select.astro +109 -0
- package/src/primitives/Sheet.astro +45 -0
- package/src/primitives/SkipLink.astro +31 -0
- package/src/primitives/Slider.astro +186 -0
- package/src/primitives/Spacer.astro +35 -0
- package/src/primitives/Stack.astro +51 -0
- package/src/primitives/Surface.astro +70 -0
- package/src/primitives/Switch.astro +22 -0
- package/src/primitives/Table.astro +382 -0
- package/src/primitives/Tabs.astro +126 -0
- package/src/primitives/Text.astro +56 -0
- package/src/primitives/Textarea.astro +75 -0
- package/src/primitives/Thumbnail.astro +154 -0
- package/src/primitives/Toggle.astro +99 -0
- package/src/primitives/Tooltip.astro +50 -0
- package/src/primitives/VisuallyHidden.astro +29 -0
- package/src/primitives/index.ts +103 -0
- package/src/primitives/internal/AccordionScript.astro +7 -0
- package/src/primitives/internal/ChoiceField.astro +91 -0
- package/src/primitives/internal/FocusTrapScript.astro +8 -0
- package/src/primitives/internal/FormValidationScript.astro +10 -0
- package/src/primitives/internal/IndeterminateScript.astro +13 -0
- package/src/primitives/internal/ModalPanel.astro +114 -0
- package/src/primitives/internal/OverlayScript.astro +7 -0
- package/src/primitives/internal/ReducedMotionScript.astro +7 -0
- package/src/primitives/internal/SliderScript.astro +7 -0
- package/src/primitives/internal/SparklineScript.astro +7 -0
- package/src/primitives/internal/TableSortScript.astro +7 -0
- package/src/primitives/internal/TabsScript.astro +7 -0
- package/src/primitives/internal/TooltipScript.astro +7 -0
- package/src/primitives/internal/image-plan.ts +82 -0
- package/src/primitives/internal/image.ts +129 -0
- package/src/primitives/internal/slider.ts +170 -0
- package/src/primitives/lib/deprecate.ts +47 -0
- package/src/primitives/lib/focus-trap.ts +197 -0
- package/src/primitives/lib/focus.ts +60 -0
- package/src/primitives/lib/motion.ts +68 -0
- package/src/primitives/scripts/accordion.ts +123 -0
- package/src/primitives/scripts/form-validation.ts +225 -0
- package/src/primitives/scripts/overlay.ts +71 -0
- package/src/primitives/scripts/reduced-motion.ts +59 -0
- package/src/primitives/scripts/slider.ts +150 -0
- package/src/primitives/scripts/sparkline.ts +131 -0
- package/src/primitives/scripts/table-sort.ts +68 -0
- package/src/primitives/scripts/tabs.ts +151 -0
- package/src/primitives/scripts/tooltip.ts +28 -0
- package/src/primitives/styles/a11y.css +104 -0
- package/src/primitives/styles/accordion.css +53 -0
- package/src/primitives/styles/breadcrumbs.css +59 -0
- package/src/primitives/styles/bullet-list.css +89 -0
- package/src/primitives/styles/button.css +237 -0
- package/src/primitives/styles/choice.css +164 -0
- package/src/primitives/styles/cluster.css +24 -0
- package/src/primitives/styles/container.css +19 -0
- package/src/primitives/styles/data.css +849 -0
- package/src/primitives/styles/disclosure.css +140 -0
- package/src/primitives/styles/divider.css +50 -0
- package/src/primitives/styles/flex.css +42 -0
- package/src/primitives/styles/form.css +241 -0
- package/src/primitives/styles/grid.css +36 -0
- package/src/primitives/styles/media.css +247 -0
- package/src/primitives/styles/nav.css +792 -0
- package/src/primitives/styles/overlay.css +362 -0
- package/src/primitives/styles/prose.css +146 -0
- package/src/primitives/styles/scale.css +175 -0
- package/src/primitives/styles/segmented.css +165 -0
- package/src/primitives/styles/slider.css +170 -0
- package/src/primitives/styles/spacer.css +17 -0
- package/src/primitives/styles/stack.css +25 -0
- package/src/primitives/styles/surface.css +403 -0
- package/src/primitives/styles/tabs.css +223 -0
- package/src/primitives/styles/typography.css +144 -0
- package/src/primitives/styles/utilities.css +24 -0
- package/src/primitives/types.ts +385 -0
- package/src/primitives/utils.ts +254 -0
- package/src/seo/JSONLD.astro +35 -0
- package/src/seo/SEOHead.astro +47 -0
- package/src/seo/cms.ts +59 -0
- package/src/seo/index.ts +10 -0
- package/src/seo/integration.ts +268 -0
- package/src/seo/internal/url.ts +68 -0
- package/src/seo/lib/jsonld.ts +342 -0
- package/src/seo/lib/meta.ts +205 -0
- package/src/seo/lib/redirects.ts +293 -0
- package/src/seo/lib/robots.ts +33 -0
- package/src/seo/lib/rss.ts +98 -0
- package/src/seo/lib/sitemap.ts +105 -0
- package/src/seo/schema.ts +43 -0
- package/src/tokens/base.css +71 -0
- package/src/tokens/tokens.css +210 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
@layer sinn.reset, sinn.tokens, sinn.primitives, sinn.data, sinn.motion, sinn.blocks, sinn.overrides;
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Polished glass finish: clear, thin glass panels floating over a dimmed scene (photo, video or a
|
|
5
|
+
* built-in gradient). The bold version of `glass`.
|
|
6
|
+
*
|
|
7
|
+
* import '@sinnstack/ui/finishes/polished-glass.css';
|
|
8
|
+
* <html data-finish="polished-glass">
|
|
9
|
+
*
|
|
10
|
+
* Dark only. The finish sets `color-scheme: dark` on the page, so every light-dark() token resolves to
|
|
11
|
+
* the active palette's own dark side: the palette still chooses every colour, and its dark-side contrast
|
|
12
|
+
* checks still apply. It never declares a --sinn-color-* token (test/finishes/finish-contract.unit.mjs).
|
|
13
|
+
* The site's light/dark switch has no effect while this finish is on.
|
|
14
|
+
*
|
|
15
|
+
* - Scene: the site's image (--sinn-finish-polished-glass-image) or, without one, gradients from the
|
|
16
|
+
* palette's accent and focus colours, under a scrim of the palette's sunken surface. The scrim is what
|
|
17
|
+
* keeps muted text placed directly on the scene at AA over a bright photo (82% passed every playground
|
|
18
|
+
* palette over a photo with a bright sky and sun); lower it only for darker scenes, and recheck.
|
|
19
|
+
* - Panels: cards, panels, card-style accordions and feature/step/quote cards, contact cards, callouts
|
|
20
|
+
* and form controls get a thin light tint (the palette's text colour at a few percent), a strong blur,
|
|
21
|
+
* a translucent rim, a highlight along the top edge and a soft drop shadow. Text gets a faint shadow.
|
|
22
|
+
* - Chrome: navbar, footer, dialogs, popovers and the mobile sheet carry more fill, since they sit over
|
|
23
|
+
* content rather than the scene.
|
|
24
|
+
* - Left solid: `strong` and `tinted` sections, sections forced to light (`data-scheme="light"`), buttons.
|
|
25
|
+
* - Without backdrop-filter, panels stay solid over the scene. With prefers-reduced-transparency: reduce,
|
|
26
|
+
* the scene and all translucency go away and the page is the palette's plain dark side.
|
|
27
|
+
*
|
|
28
|
+
* Tune per site (sinn.tokens or sinn.overrides):
|
|
29
|
+
* --sinn-finish-polished-glass-image url() of the scene, root-relative or absolute (default none)
|
|
30
|
+
* --sinn-finish-polished-glass-scrim how much the scene is dimmed (default 82%)
|
|
31
|
+
* --sinn-finish-polished-glass-tint light tint of panels (default 7%)
|
|
32
|
+
* --sinn-finish-polished-glass-blur blur behind panels (default 14px)
|
|
33
|
+
* --sinn-finish-polished-glass-chrome fill of navbar and footer (default 55%)
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
@layer sinn.tokens {
|
|
37
|
+
:root {
|
|
38
|
+
--sinn-finish-polished-glass-image: none;
|
|
39
|
+
--sinn-finish-polished-glass-scrim: 82%;
|
|
40
|
+
--sinn-finish-polished-glass-tint: 7%;
|
|
41
|
+
--sinn-finish-polished-glass-blur: 14px;
|
|
42
|
+
--sinn-finish-polished-glass-saturate: 1.6;
|
|
43
|
+
--sinn-finish-polished-glass-chrome: 55%;
|
|
44
|
+
--sinn-finish-polished-glass-overlay: 78%;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@layer sinn.blocks {
|
|
49
|
+
/* ---------- Dark side of the palette ---------- */
|
|
50
|
+
:root[data-finish~='polished-glass'] { color-scheme: dark; }
|
|
51
|
+
|
|
52
|
+
/* ---------- Scene ---------- */
|
|
53
|
+
:root[data-finish~='polished-glass'] {
|
|
54
|
+
background-color: var(--sinn-color-surface-sunken);
|
|
55
|
+
background-image:
|
|
56
|
+
linear-gradient(
|
|
57
|
+
color-mix(in oklch, var(--sinn-color-surface-sunken) var(--sinn-finish-polished-glass-scrim), transparent),
|
|
58
|
+
color-mix(in oklch, var(--sinn-color-surface-sunken) calc(var(--sinn-finish-polished-glass-scrim) + 12%), transparent)
|
|
59
|
+
),
|
|
60
|
+
var(--sinn-finish-polished-glass-image),
|
|
61
|
+
radial-gradient(48rem 36rem at 12% 8%, color-mix(in oklch, var(--sinn-color-accent) 70%, transparent), transparent 70%),
|
|
62
|
+
radial-gradient(44rem 34rem at 92% 30%, color-mix(in oklch, var(--sinn-color-focus) 55%, transparent), transparent 70%),
|
|
63
|
+
radial-gradient(56rem 38rem at 40% 105%, color-mix(in oklch, var(--sinn-color-accent) 50%, transparent), transparent 70%);
|
|
64
|
+
background-size: auto, cover, auto, auto, auto;
|
|
65
|
+
background-position: center;
|
|
66
|
+
background-repeat: no-repeat;
|
|
67
|
+
background-attachment: fixed;
|
|
68
|
+
}
|
|
69
|
+
[data-finish~='polished-glass'] :where(body) {
|
|
70
|
+
background-color: transparent;
|
|
71
|
+
text-shadow: 0 1px 2px color-mix(in oklch, var(--sinn-color-surface-sunken) 60%, transparent);
|
|
72
|
+
}
|
|
73
|
+
/* Text inside controls, buttons and solid fills doesn't need the shadow. */
|
|
74
|
+
[data-finish~='polished-glass'] :where(.sinn-button, .sinn-control, input, select, textarea, [data-background='strong'], [data-background='tinted'], [data-surface='strong'], [data-surface='tinted'], [data-scheme='light']) {
|
|
75
|
+
text-shadow: none;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
|
|
79
|
+
/* ---------- Panels: thin glass ---------- */
|
|
80
|
+
[data-finish~='polished-glass'] :where(
|
|
81
|
+
.sinn-card,
|
|
82
|
+
.sinn-panel:not([data-variant='plain']),
|
|
83
|
+
.sinn-disclosure[data-variant='card'],
|
|
84
|
+
.sinn-features[data-variant='card'] .sinn-feature,
|
|
85
|
+
.sinn-steps[data-variant='card'] .sinn-step,
|
|
86
|
+
[data-variant='card'] .sinn-quote,
|
|
87
|
+
.sinn-contact__card[data-variant='outline'],
|
|
88
|
+
.sinn-contact-form[data-variant='outline'],
|
|
89
|
+
.sinn-callout
|
|
90
|
+
) {
|
|
91
|
+
border-color: color-mix(in oklch, var(--sinn-color-text) 16%, transparent);
|
|
92
|
+
background-color: color-mix(in oklch, var(--sinn-color-text) var(--sinn-finish-polished-glass-tint), transparent);
|
|
93
|
+
box-shadow:
|
|
94
|
+
inset 0 1px 0 0 color-mix(in oklch, var(--sinn-color-text) 22%, transparent),
|
|
95
|
+
0 10px 30px -12px color-mix(in oklch, var(--sinn-color-surface-sunken) 80%, transparent);
|
|
96
|
+
-webkit-backdrop-filter: saturate(var(--sinn-finish-polished-glass-saturate)) blur(var(--sinn-finish-polished-glass-blur));
|
|
97
|
+
backdrop-filter: saturate(var(--sinn-finish-polished-glass-saturate)) blur(var(--sinn-finish-polished-glass-blur));
|
|
98
|
+
}
|
|
99
|
+
/* Filled cards read a shade denser than plain ones. */
|
|
100
|
+
[data-finish~='polished-glass'] :where(.sinn-card[data-variant='filled']) {
|
|
101
|
+
background-color: color-mix(in oklch, var(--sinn-color-text) calc(var(--sinn-finish-polished-glass-tint) + 4%), transparent);
|
|
102
|
+
}
|
|
103
|
+
/* Callouts keep their tone (info, success, warning, danger): tinted glass of their own soft fill. */
|
|
104
|
+
[data-finish~='polished-glass'] :where(.sinn-callout:not([data-variant='outline'])) {
|
|
105
|
+
background-color: color-mix(in oklch, var(--sinn-p-tone-soft) 70%, transparent);
|
|
106
|
+
}
|
|
107
|
+
/* Card media keeps its own fill so images still have a backdrop while loading. */
|
|
108
|
+
[data-finish~='polished-glass'] :where(.sinn-card__media) { background-color: transparent; }
|
|
109
|
+
|
|
110
|
+
/* Form controls: lighter glass, no blur of their own (they sit on a panel already). */
|
|
111
|
+
[data-finish~='polished-glass'] :where(.sinn-control) {
|
|
112
|
+
border-color: color-mix(in oklch, var(--sinn-color-text) 32%, transparent);
|
|
113
|
+
background-color: color-mix(in oklch, var(--sinn-color-text) 6%, transparent);
|
|
114
|
+
}
|
|
115
|
+
/* Native option lists don't support transparency. */
|
|
116
|
+
[data-finish~='polished-glass'] :where(select option) { background-color: var(--sinn-color-surface-raised); }
|
|
117
|
+
|
|
118
|
+
/* ---------- Chrome and overlays: more fill, they sit over content ---------- */
|
|
119
|
+
[data-finish~='polished-glass'] :where(.sinn-navbar, .sinn-footer, .sinn-consent__banner) {
|
|
120
|
+
border-color: color-mix(in oklch, var(--sinn-color-text) 12%, transparent);
|
|
121
|
+
-webkit-backdrop-filter: saturate(var(--sinn-finish-polished-glass-saturate)) blur(calc(var(--sinn-finish-polished-glass-blur) + 4px));
|
|
122
|
+
backdrop-filter: saturate(var(--sinn-finish-polished-glass-saturate)) blur(calc(var(--sinn-finish-polished-glass-blur) + 4px));
|
|
123
|
+
}
|
|
124
|
+
[data-finish~='polished-glass'] :where(.sinn-navbar) {
|
|
125
|
+
background-color: color-mix(in oklch, var(--sinn-color-surface) var(--sinn-finish-polished-glass-chrome), transparent);
|
|
126
|
+
}
|
|
127
|
+
[data-finish~='polished-glass'] :where(.sinn-footer) {
|
|
128
|
+
background-color: color-mix(in oklch, var(--sinn-color-surface-sunken) var(--sinn-finish-polished-glass-chrome), transparent);
|
|
129
|
+
}
|
|
130
|
+
[data-finish~='polished-glass'] :where(dialog.sinn-dialog, .sinn-popover, .sinn-consent__banner, .sinn-navbar__panel:popover-open) {
|
|
131
|
+
border-color: color-mix(in oklch, var(--sinn-color-text) 16%, transparent);
|
|
132
|
+
background-color: color-mix(in oklch, var(--sinn-color-surface-raised) var(--sinn-finish-polished-glass-overlay), transparent);
|
|
133
|
+
-webkit-backdrop-filter: saturate(var(--sinn-finish-polished-glass-saturate)) blur(calc(var(--sinn-finish-polished-glass-blur) * 1.5));
|
|
134
|
+
backdrop-filter: saturate(var(--sinn-finish-polished-glass-saturate)) blur(calc(var(--sinn-finish-polished-glass-blur) * 1.5));
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/* ---------- Section bands: let the scene through ---------- */
|
|
138
|
+
[data-finish~='polished-glass'] :where(.sinn-block[data-background='default'], .sinn-block[data-background='subtle'], .sinn-block[data-background='sunken']) {
|
|
139
|
+
background-color: color-mix(in oklch, var(--sinn-color-surface-sunken) 30%, transparent);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/* ---------- Reader asked for less transparency: plain dark palette ---------- */
|
|
144
|
+
@media (prefers-reduced-transparency: reduce) {
|
|
145
|
+
:root[data-finish~='polished-glass'] { background-image: none; }
|
|
146
|
+
[data-finish~='polished-glass'] :where(body) { background-color: revert-layer; text-shadow: none; }
|
|
147
|
+
[data-finish~='polished-glass'] :where(
|
|
148
|
+
.sinn-card, .sinn-card__media, .sinn-panel, .sinn-disclosure, .sinn-feature, .sinn-step, .sinn-quote,
|
|
149
|
+
.sinn-contact__card, .sinn-contact-form, .sinn-callout, .sinn-control, .sinn-navbar, .sinn-footer,
|
|
150
|
+
.sinn-consent__banner, dialog.sinn-dialog, .sinn-popover, .sinn-navbar__panel, .sinn-block
|
|
151
|
+
) {
|
|
152
|
+
border-color: revert-layer;
|
|
153
|
+
background-color: revert-layer;
|
|
154
|
+
box-shadow: revert-layer;
|
|
155
|
+
-webkit-backdrop-filter: revert-layer;
|
|
156
|
+
backdrop-filter: revert-layer;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
@layer sinn.reset, sinn.tokens, sinn.primitives, sinn.data, sinn.motion, sinn.blocks, sinn.overrides;
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Rain finish: soft slanted streaks falling behind the page, under a cool cast from above.
|
|
5
|
+
*
|
|
6
|
+
* import '@sinnstack/ui/finishes/rain.css';
|
|
7
|
+
* <html data-finish="rain">
|
|
8
|
+
*
|
|
9
|
+
* Colour: streaks and cast are their own colours at low opacity, behind the page; palette tokens are
|
|
10
|
+
* untouched. Both are --sinn-finish-rain-* tokens, so a site can retint them.
|
|
11
|
+
* Motion: one tiled layer, slanted, falling one tile per loop (transform only). Under reduced motion the
|
|
12
|
+
* streaks are hidden (still rain reads as scratches) and only the cool cast stays.
|
|
13
|
+
* Scene finishes (aurora, autumn, rain, fog) each use the root's ::before and ::after, so use one at a time.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
@layer sinn.tokens {
|
|
17
|
+
:root {
|
|
18
|
+
--sinn-finish-rain-streak: light-dark(rgb(70 100 140 / 0.32), rgb(190 214 255 / 0.24));
|
|
19
|
+
--sinn-finish-rain-cast: light-dark(rgb(90 130 190 / 0.1), rgb(110 150 215 / 0.1));
|
|
20
|
+
--sinn-finish-rain-tile: 240px;
|
|
21
|
+
--sinn-finish-rain-duration: 0.8s;
|
|
22
|
+
--sinn-finish-rain-slant: 12deg;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@layer sinn.blocks {
|
|
27
|
+
/* The page colour moves from body to the root so the scene layers (fixed, behind the body) show.
|
|
28
|
+
Zero specificity: glass and polished-glass set their own root background and win when combined. */
|
|
29
|
+
:where(:root[data-finish~='rain']) { background-color: var(--sinn-color-surface); }
|
|
30
|
+
[data-finish~='rain'] :where(body) { background-color: transparent; }
|
|
31
|
+
:root[data-finish~='rain']::before,
|
|
32
|
+
:root[data-finish~='rain']::after {
|
|
33
|
+
content: '';
|
|
34
|
+
position: fixed;
|
|
35
|
+
z-index: -1;
|
|
36
|
+
pointer-events: none;
|
|
37
|
+
will-change: transform;
|
|
38
|
+
}
|
|
39
|
+
/* Cool cast, strongest at the top. Static. */
|
|
40
|
+
:root[data-finish~='rain']::before {
|
|
41
|
+
inset: 0;
|
|
42
|
+
background-image: linear-gradient(var(--sinn-finish-rain-cast), transparent 75%);
|
|
43
|
+
will-change: auto;
|
|
44
|
+
}
|
|
45
|
+
/* Streaks: oversized so the slant never shows an edge; falls along the slant, one tile per loop. */
|
|
46
|
+
:root[data-finish~='rain']::after {
|
|
47
|
+
inset: -40% -30%;
|
|
48
|
+
background-image:
|
|
49
|
+
radial-gradient(1.2px 24px at 6% 8%, var(--sinn-finish-rain-streak), transparent),
|
|
50
|
+
radial-gradient(1.2px 24px at 19% 52%, var(--sinn-finish-rain-streak), transparent),
|
|
51
|
+
radial-gradient(1.2px 24px at 31% 23%, var(--sinn-finish-rain-streak), transparent),
|
|
52
|
+
radial-gradient(1.2px 24px at 44% 71%, var(--sinn-finish-rain-streak), transparent),
|
|
53
|
+
radial-gradient(1.2px 24px at 55% 12%, var(--sinn-finish-rain-streak), transparent),
|
|
54
|
+
radial-gradient(1.2px 24px at 67% 46%, var(--sinn-finish-rain-streak), transparent),
|
|
55
|
+
radial-gradient(1.2px 24px at 78% 84%, var(--sinn-finish-rain-streak), transparent),
|
|
56
|
+
radial-gradient(1.2px 24px at 89% 30%, var(--sinn-finish-rain-streak), transparent),
|
|
57
|
+
radial-gradient(1.2px 24px at 13% 90%, var(--sinn-finish-rain-streak), transparent),
|
|
58
|
+
radial-gradient(1.2px 24px at 38% 40%, var(--sinn-finish-rain-streak), transparent),
|
|
59
|
+
radial-gradient(1.2px 24px at 61% 63%, var(--sinn-finish-rain-streak), transparent),
|
|
60
|
+
radial-gradient(1.2px 24px at 96% 58%, var(--sinn-finish-rain-streak), transparent);
|
|
61
|
+
background-size: calc(var(--sinn-finish-rain-tile) * 0.75) var(--sinn-finish-rain-tile);
|
|
62
|
+
animation: sinn-finish-rain-fall var(--sinn-finish-rain-duration) linear infinite;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* Still when the reader prefers reduced motion (unless the site's motion switch says full), or when the
|
|
66
|
+
site's switch says reduce: the same rule the motion group follows. */
|
|
67
|
+
@media (prefers-reduced-motion: reduce) {
|
|
68
|
+
:root[data-finish~='rain']:not([data-motion='full'])::before,
|
|
69
|
+
:root[data-finish~='rain']:not([data-motion='full'])::after { animation: none; }
|
|
70
|
+
:root[data-finish~='rain']:not([data-motion='full'])::after { display: none; }
|
|
71
|
+
}
|
|
72
|
+
:root[data-finish~='rain'][data-motion='reduce']::before,
|
|
73
|
+
:root[data-finish~='rain'][data-motion='reduce']::after { animation: none; }
|
|
74
|
+
:root[data-finish~='rain'][data-motion='reduce']::after { display: none; }
|
|
75
|
+
@media print {
|
|
76
|
+
:root[data-finish~='rain']::before,
|
|
77
|
+
:root[data-finish~='rain']::after { display: none; }
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@keyframes sinn-finish-rain-fall {
|
|
82
|
+
from { transform: rotate(var(--sinn-finish-rain-slant)) translate3d(0, 0, 0); }
|
|
83
|
+
to { transform: rotate(var(--sinn-finish-rain-slant)) translate3d(0, var(--sinn-finish-rain-tile), 0); }
|
|
84
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Day cycle finish script: places the light from the visitor's local time. Only sets
|
|
3
|
+
* --sinn-finish-day-cycle-x / -y / -sun / -night on <html>; runs once on load and every five minutes.
|
|
4
|
+
* Day is 6:00 to 18:00: the sun travels from the start edge (x 0%) to the end edge (x 100%) on an arc
|
|
5
|
+
* that peaks at the top at noon, and fades in and out at its ends. At night only a faint cool glow remains.
|
|
6
|
+
*/
|
|
7
|
+
if (typeof document !== 'undefined' && !(window as Window & { __sinnDayCycle?: true }).__sinnDayCycle) {
|
|
8
|
+
(window as Window & { __sinnDayCycle?: true }).__sinnDayCycle = true;
|
|
9
|
+
const root = document.documentElement;
|
|
10
|
+
const MAX_SUN = 70; // percent of the warm fill at the sun's centre, at midday
|
|
11
|
+
const update = () => {
|
|
12
|
+
const now = new Date();
|
|
13
|
+
const hours = now.getHours() + now.getMinutes() / 60;
|
|
14
|
+
const day = (hours - 6) / 12; // 0 at sunrise, 1 at sunset
|
|
15
|
+
const up = day > 0 && day < 1;
|
|
16
|
+
const height = up ? Math.sin(day * Math.PI) : 0; // 0 at the horizon, 1 at noon
|
|
17
|
+
const rtl = getComputedStyle(root).direction === 'rtl';
|
|
18
|
+
const x = up ? (rtl ? 1 - day : day) * 100 : 50;
|
|
19
|
+
const y = up ? 70 - height * 66 : 0; // from 70% (low) up to 4% (top)
|
|
20
|
+
const set = (name: string, value: string) => root.style.setProperty(`--sinn-finish-day-cycle-${name}`, value);
|
|
21
|
+
set('x', `${x.toFixed(1)}%`);
|
|
22
|
+
set('y', `${y.toFixed(1)}%`);
|
|
23
|
+
set('sun', `${Math.round(MAX_SUN * Math.min(1, height * 1.6))}%`);
|
|
24
|
+
set('night', up ? '0%' : '45%');
|
|
25
|
+
};
|
|
26
|
+
update();
|
|
27
|
+
setInterval(update, 5 * 60 * 1000);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Holographic edges script: turns each hovered card's sheen toward the pointer. Only sets
|
|
3
|
+
* --sinn-finish-holographic-angle on the hovered element, only while <html data-finish> includes
|
|
4
|
+
* "holographic", only for fine pointers. One passive, delegated pointermove listener, one write per frame.
|
|
5
|
+
*/
|
|
6
|
+
const TARGETS = '.sinn-card, .sinn-panel, .sinn-feature, .sinn-step, .sinn-quote';
|
|
7
|
+
|
|
8
|
+
if (typeof document !== 'undefined' && !(window as Window & { __sinnHolographic?: true }).__sinnHolographic) {
|
|
9
|
+
(window as Window & { __sinnHolographic?: true }).__sinnHolographic = true;
|
|
10
|
+
const root = document.documentElement;
|
|
11
|
+
const fine = window.matchMedia('(pointer: fine)');
|
|
12
|
+
let frame = 0;
|
|
13
|
+
let target: HTMLElement | null = null;
|
|
14
|
+
let px = 0;
|
|
15
|
+
let py = 0;
|
|
16
|
+
const write = () => {
|
|
17
|
+
frame = 0;
|
|
18
|
+
if (!target) return;
|
|
19
|
+
const box = target.getBoundingClientRect();
|
|
20
|
+
const angle = (Math.atan2(py - (box.top + box.height / 2), px - (box.left + box.width / 2)) * 180) / Math.PI + 90;
|
|
21
|
+
target.style.setProperty('--sinn-finish-holographic-angle', `${Math.round(angle)}deg`);
|
|
22
|
+
};
|
|
23
|
+
document.addEventListener(
|
|
24
|
+
'pointermove',
|
|
25
|
+
(event) => {
|
|
26
|
+
if (!fine.matches || !(root.dataset.finish ?? '').split(/\s+/).includes('holographic')) return;
|
|
27
|
+
target = (event.target as Element | null)?.closest<HTMLElement>(TARGETS) ?? null;
|
|
28
|
+
if (!target) return;
|
|
29
|
+
px = event.clientX;
|
|
30
|
+
py = event.clientY;
|
|
31
|
+
if (!frame) frame = requestAnimationFrame(write);
|
|
32
|
+
},
|
|
33
|
+
{ passive: true },
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spotlight finish script: moves the light to the pointer. Only sets --sinn-finish-spotlight-x / -y on
|
|
3
|
+
* <html>, only while <html data-finish> includes "spotlight", only for fine pointers (mouse, pen).
|
|
4
|
+
* One passive pointermove listener, at most one write per animation frame.
|
|
5
|
+
*/
|
|
6
|
+
if (typeof document !== 'undefined' && !(window as Window & { __sinnSpotlight?: true }).__sinnSpotlight) {
|
|
7
|
+
(window as Window & { __sinnSpotlight?: true }).__sinnSpotlight = true;
|
|
8
|
+
const root = document.documentElement;
|
|
9
|
+
const fine = window.matchMedia('(pointer: fine)');
|
|
10
|
+
let frame = 0;
|
|
11
|
+
let x = 0;
|
|
12
|
+
let y = 0;
|
|
13
|
+
const write = () => {
|
|
14
|
+
frame = 0;
|
|
15
|
+
root.style.setProperty('--sinn-finish-spotlight-x', `${x}px`);
|
|
16
|
+
root.style.setProperty('--sinn-finish-spotlight-y', `${y}px`);
|
|
17
|
+
};
|
|
18
|
+
document.addEventListener(
|
|
19
|
+
'pointermove',
|
|
20
|
+
(event) => {
|
|
21
|
+
if (!fine.matches || !(root.dataset.finish ?? '').split(/\s+/).includes('spotlight')) return;
|
|
22
|
+
x = event.clientX;
|
|
23
|
+
y = event.clientY;
|
|
24
|
+
if (!frame) frame = requestAnimationFrame(write);
|
|
25
|
+
},
|
|
26
|
+
{ passive: true },
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
@layer sinn.reset, sinn.tokens, sinn.primitives, sinn.data, sinn.motion, sinn.blocks, sinn.overrides;
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Spotlight finish: a soft pool of the palette's accent-soft light behind the page that follows the pointer.
|
|
5
|
+
*
|
|
6
|
+
* import '@sinnstack/ui/finishes/spotlight.css';
|
|
7
|
+
* <script>import '@sinnstack/ui/finishes/scripts/spotlight';</script> (in your layout)
|
|
8
|
+
* <html data-finish="spotlight">
|
|
9
|
+
*
|
|
10
|
+
* The script only sets --sinn-finish-spotlight-x / -y on <html> (CSSOM, allowed under a strict CSP), on
|
|
11
|
+
* fine pointers only (no touch). Without the script, or on touch screens, the light rests at the top centre.
|
|
12
|
+
* Colour: accent-soft, a fill palettes guarantee text, muted text and links on, so page text keeps its contrast.
|
|
13
|
+
* Lives on body::before, so it combines with a scene (aurora, fog…) and with glass.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
@layer sinn.tokens {
|
|
17
|
+
:root {
|
|
18
|
+
--sinn-finish-spotlight-x: 50vw;
|
|
19
|
+
--sinn-finish-spotlight-y: 0px;
|
|
20
|
+
--sinn-finish-spotlight-size: 32rem;
|
|
21
|
+
--sinn-finish-spotlight-color: var(--sinn-color-accent-soft);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@layer sinn.blocks {
|
|
26
|
+
:where(:root[data-finish~='spotlight']) { background-color: var(--sinn-color-surface); }
|
|
27
|
+
[data-finish~='spotlight'] :where(body) { background-color: transparent; }
|
|
28
|
+
[data-finish~='spotlight'] :where(body)::before {
|
|
29
|
+
content: '';
|
|
30
|
+
position: fixed;
|
|
31
|
+
inset: 0;
|
|
32
|
+
z-index: -1;
|
|
33
|
+
pointer-events: none;
|
|
34
|
+
background-image: radial-gradient(
|
|
35
|
+
var(--sinn-finish-spotlight-size) circle at var(--sinn-finish-spotlight-x) var(--sinn-finish-spotlight-y),
|
|
36
|
+
var(--sinn-finish-spotlight-color),
|
|
37
|
+
transparent 70%
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
@media print { [data-finish~='spotlight'] :where(body)::before { display: none; } }
|
|
41
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
@layer sinn.reset, sinn.tokens, sinn.primitives, sinn.data, sinn.motion, sinn.blocks, sinn.overrides;
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Spring finish: petals and pollen drifting down behind the page in pale morning light.
|
|
5
|
+
*
|
|
6
|
+
* import '@sinnstack/ui/finishes/spring.css';
|
|
7
|
+
* <html data-finish="spring">
|
|
8
|
+
*
|
|
9
|
+
* Colour: petals, pollen and light are their own soft colours at low opacity, behind the page; palette
|
|
10
|
+
* tokens are untouched (all are --sinn-finish-spring-* tokens). The light is near-white in light mode and a
|
|
11
|
+
* faint warm lift in dark mode. Small muted text directly on the page can cross a petal: check in a browser.
|
|
12
|
+
* Motion: one tiled layer falling slowly with a sway (transform only); still under reduced motion.
|
|
13
|
+
* A scene finish: it uses the root's ::before and ::after, so use one scene at a time.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
@layer sinn.tokens {
|
|
17
|
+
:root {
|
|
18
|
+
--sinn-finish-spring-petal-1: light-dark(rgb(236 150 178 / 0.45), rgb(244 170 198 / 0.36));
|
|
19
|
+
--sinn-finish-spring-petal-2: light-dark(rgb(244 196 210 / 0.6), rgb(250 206 220 / 0.3));
|
|
20
|
+
--sinn-finish-spring-pollen: light-dark(rgb(214 178 60 / 0.45), rgb(236 206 100 / 0.35));
|
|
21
|
+
--sinn-finish-spring-light: light-dark(rgb(255 252 236 / 0.7), rgb(255 236 214 / 0.07));
|
|
22
|
+
--sinn-finish-spring-tile: 460px;
|
|
23
|
+
--sinn-finish-spring-duration: 34s;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@layer sinn.blocks {
|
|
28
|
+
:where(:root[data-finish~='spring']) { background-color: var(--sinn-color-surface); }
|
|
29
|
+
[data-finish~='spring'] :where(body) { background-color: transparent; }
|
|
30
|
+
:root[data-finish~='spring']::before,
|
|
31
|
+
:root[data-finish~='spring']::after {
|
|
32
|
+
content: '';
|
|
33
|
+
position: fixed;
|
|
34
|
+
z-index: -1;
|
|
35
|
+
pointer-events: none;
|
|
36
|
+
}
|
|
37
|
+
:root[data-finish~='spring']::before {
|
|
38
|
+
inset: 0;
|
|
39
|
+
background-image: radial-gradient(80rem 56rem at 0% 0%, var(--sinn-finish-spring-light), transparent 70%);
|
|
40
|
+
}
|
|
41
|
+
:root[data-finish~='spring']::after {
|
|
42
|
+
inset: calc(-1 * var(--sinn-finish-spring-tile)) -4rem 0;
|
|
43
|
+
background-image:
|
|
44
|
+
radial-gradient(7px 4px at 9% 14%, var(--sinn-finish-spring-petal-1) 92%, transparent),
|
|
45
|
+
radial-gradient(4px 7px at 28% 47%, var(--sinn-finish-spring-petal-2) 92%, transparent),
|
|
46
|
+
radial-gradient(4px 7px at 47% 9%, var(--sinn-finish-spring-petal-1) 92%, transparent),
|
|
47
|
+
radial-gradient(7px 4px at 64% 58%, var(--sinn-finish-spring-petal-2) 92%, transparent),
|
|
48
|
+
radial-gradient(7px 4px at 83% 26%, var(--sinn-finish-spring-petal-1) 92%, transparent),
|
|
49
|
+
radial-gradient(4px 7px at 18% 74%, var(--sinn-finish-spring-petal-2) 92%, transparent),
|
|
50
|
+
radial-gradient(7px 4px at 39% 90%, var(--sinn-finish-spring-petal-1) 92%, transparent),
|
|
51
|
+
radial-gradient(4px 7px at 73% 83%, var(--sinn-finish-spring-petal-2) 92%, transparent),
|
|
52
|
+
radial-gradient(circle at 16% 36%, var(--sinn-finish-spring-pollen) 1.2px, transparent 1.8px),
|
|
53
|
+
radial-gradient(circle at 55% 30%, var(--sinn-finish-spring-pollen) 1.2px, transparent 1.8px),
|
|
54
|
+
radial-gradient(circle at 92% 52%, var(--sinn-finish-spring-pollen) 1.2px, transparent 1.8px),
|
|
55
|
+
radial-gradient(circle at 33% 66%, var(--sinn-finish-spring-pollen) 1.2px, transparent 1.8px),
|
|
56
|
+
radial-gradient(circle at 78% 8%, var(--sinn-finish-spring-pollen) 1.2px, transparent 1.8px),
|
|
57
|
+
radial-gradient(circle at 60% 94%, var(--sinn-finish-spring-pollen) 1.2px, transparent 1.8px);
|
|
58
|
+
background-size: var(--sinn-finish-spring-tile) var(--sinn-finish-spring-tile);
|
|
59
|
+
will-change: transform;
|
|
60
|
+
animation: sinn-finish-spring-fall var(--sinn-finish-spring-duration) linear infinite;
|
|
61
|
+
}
|
|
62
|
+
@media (prefers-reduced-motion: reduce) {
|
|
63
|
+
:root[data-finish~='spring']:not([data-motion='full'])::before,
|
|
64
|
+
:root[data-finish~='spring']:not([data-motion='full'])::after { animation: none; }
|
|
65
|
+
}
|
|
66
|
+
:root[data-finish~='spring'][data-motion='reduce']::before,
|
|
67
|
+
:root[data-finish~='spring'][data-motion='reduce']::after { animation: none; }
|
|
68
|
+
@media print {
|
|
69
|
+
:root[data-finish~='spring']::before,
|
|
70
|
+
:root[data-finish~='spring']::after { display: none; }
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@keyframes sinn-finish-spring-fall {
|
|
75
|
+
0% { transform: translate3d(0, 0, 0); }
|
|
76
|
+
25% { transform: translate3d(-1.5rem, calc(var(--sinn-finish-spring-tile) * 0.25), 0); }
|
|
77
|
+
50% { transform: translate3d(0, calc(var(--sinn-finish-spring-tile) * 0.5), 0); }
|
|
78
|
+
75% { transform: translate3d(1.5rem, calc(var(--sinn-finish-spring-tile) * 0.75), 0); }
|
|
79
|
+
100% { transform: translate3d(0, var(--sinn-finish-spring-tile), 0); }
|
|
80
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
@layer sinn.reset, sinn.tokens, sinn.primitives, sinn.data, sinn.motion, sinn.blocks, sinn.overrides;
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Terminal / CRT finish: fine horizontal scanlines over the page and a soft phosphor glow on text.
|
|
5
|
+
* No flicker, no animation (flashing content fails WCAG 2.3.1 and tires readers).
|
|
6
|
+
*
|
|
7
|
+
* import '@sinnstack/ui/finishes/terminal.css';
|
|
8
|
+
* <html data-finish="terminal"> (reads best with a dark palette, or data-theme="dark")
|
|
9
|
+
*
|
|
10
|
+
* Glow: a text-shadow in the element's own text colour (currentColor) at low strength, so it follows the
|
|
11
|
+
* palette and every tone. Scanlines: 1px lines of the palette's shadow colour every 3px, at low opacity, on
|
|
12
|
+
* a layer above the page that ignores the pointer. They sit over text, so they're kept faint
|
|
13
|
+
* (--sinn-finish-terminal-scanlines, default 30% of the shadow colour); recheck contrast if you raise them.
|
|
14
|
+
* Uses body::before, like spotlight: use one of the two.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
@layer sinn.tokens {
|
|
18
|
+
:root {
|
|
19
|
+
--sinn-finish-terminal-glow: 0 0 0.35em color-mix(in oklch, currentColor 45%, transparent);
|
|
20
|
+
--sinn-finish-terminal-scanlines: 30%;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@layer sinn.blocks {
|
|
25
|
+
[data-finish~='terminal'] :where(body) { text-shadow: var(--sinn-finish-terminal-glow); }
|
|
26
|
+
/* Glow is for text on the page and panels; solid fills and controls stay crisp. */
|
|
27
|
+
[data-finish~='terminal'] :where(.sinn-button, .sinn-control, input, select, textarea, [data-background='strong'], [data-surface='strong']) {
|
|
28
|
+
text-shadow: none;
|
|
29
|
+
}
|
|
30
|
+
[data-finish~='terminal'] :where(body)::before {
|
|
31
|
+
content: '';
|
|
32
|
+
position: fixed;
|
|
33
|
+
inset: 0;
|
|
34
|
+
z-index: 2147483000;
|
|
35
|
+
pointer-events: none;
|
|
36
|
+
background-image: repeating-linear-gradient(
|
|
37
|
+
to bottom,
|
|
38
|
+
transparent 0 2px,
|
|
39
|
+
color-mix(in oklch, var(--sinn-shadow-color) var(--sinn-finish-terminal-scanlines), transparent) 2px 3px
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
@media (prefers-contrast: more), print {
|
|
43
|
+
[data-finish~='terminal'] :where(body)::before { display: none; }
|
|
44
|
+
[data-finish~='terminal'] :where(body) { text-shadow: none; }
|
|
45
|
+
}
|
|
46
|
+
@media (forced-colors: active) {
|
|
47
|
+
[data-finish~='terminal'] :where(body)::before { display: none; }
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
---
|
|
2
|
+
/**
|
|
3
|
+
* Marquee — a row of content (logos, announcements, testimonials) scrolling continuously.
|
|
4
|
+
* CSS animation over two copies of the content; no JavaScript.
|
|
5
|
+
*
|
|
6
|
+
* Accessibility built in:
|
|
7
|
+
* - The second copy is aria-hidden and inert: screen readers and the Tab key get the content once.
|
|
8
|
+
* - Pauses on hover (optional) and whenever anything inside has keyboard focus.
|
|
9
|
+
* - A visible "Pause scrolling" control (WCAG 2.2.2: moving content that lasts more than 5 seconds
|
|
10
|
+
* must be pausable). It's a real checkbox styled as a button, so it works without JS.
|
|
11
|
+
* - Reduced motion (OS or site override): no movement; the items wrap into a static row.
|
|
12
|
+
* - Direction follows the page (right-to-left pages scroll the other way).
|
|
13
|
+
*
|
|
14
|
+
* Don't put content people must read or act on quickly in a marquee. Avoid ids inside it
|
|
15
|
+
* (the content is rendered twice).
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* <Marquee label="Tools we use" fade>
|
|
19
|
+
* <img src={aetna.src} alt="Aetna" width="120" height="40" />
|
|
20
|
+
* <img src={bcbs.src} alt="Blue Cross Blue Shield" width="120" height="40" />
|
|
21
|
+
* </Marquee>
|
|
22
|
+
*/
|
|
23
|
+
import type { HTMLAttributes } from 'astro/types';
|
|
24
|
+
import './styles/motion.css';
|
|
25
|
+
|
|
26
|
+
type Props = HTMLAttributes<'div'> & {
|
|
27
|
+
/** Accessible name of the region ("Our partners"). Required. */
|
|
28
|
+
label: string;
|
|
29
|
+
speed?: 'slow' | 'normal' | 'fast';
|
|
30
|
+
direction?: 'forward' | 'reverse';
|
|
31
|
+
gap?: 's' | 'l' | 'xl';
|
|
32
|
+
/** Fade the edges. */
|
|
33
|
+
fade?: boolean;
|
|
34
|
+
pauseOnHover?: boolean;
|
|
35
|
+
/** Show the Pause control (default true; keep it unless the marquee stops within 5 s). */
|
|
36
|
+
controls?: boolean;
|
|
37
|
+
controlLabel?: string;
|
|
38
|
+
/** Render items as a list (<ul>); wrap each child in <li>. */
|
|
39
|
+
list?: boolean;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const {
|
|
43
|
+
label,
|
|
44
|
+
speed = 'normal',
|
|
45
|
+
direction = 'forward',
|
|
46
|
+
gap = 'l',
|
|
47
|
+
fade = false,
|
|
48
|
+
pauseOnHover = true,
|
|
49
|
+
controls = true,
|
|
50
|
+
controlLabel = 'Pause scrolling',
|
|
51
|
+
list = false,
|
|
52
|
+
class: className,
|
|
53
|
+
...rest
|
|
54
|
+
} = Astro.props;
|
|
55
|
+
|
|
56
|
+
const content = await Astro.slots.render('default');
|
|
57
|
+
const Group = list ? 'ul' : 'div';
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
<div
|
|
61
|
+
class:list={['sinn-marquee', className]}
|
|
62
|
+
role="region"
|
|
63
|
+
aria-label={label}
|
|
64
|
+
data-speed={speed === 'normal' ? undefined : speed}
|
|
65
|
+
data-direction={direction === 'reverse' ? 'reverse' : undefined}
|
|
66
|
+
data-gap={gap === 'l' ? undefined : gap}
|
|
67
|
+
data-fade={fade ? '' : undefined}
|
|
68
|
+
data-pause-on-hover={pauseOnHover ? '' : undefined}
|
|
69
|
+
{...rest}
|
|
70
|
+
>
|
|
71
|
+
<div class="sinn-marquee__viewport">
|
|
72
|
+
<Group class="sinn-marquee__group" role={list ? 'list' : undefined}><Fragment set:html={content} /></Group>
|
|
73
|
+
<Group class="sinn-marquee__group" aria-hidden="true" inert><Fragment set:html={content} /></Group>
|
|
74
|
+
</div>
|
|
75
|
+
{
|
|
76
|
+
controls && (
|
|
77
|
+
<label class="sinn-marquee__toggle">
|
|
78
|
+
<input type="checkbox" class="sinn-marquee__toggle-input" />
|
|
79
|
+
<svg class="sinn-marquee__icon-pause" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true">
|
|
80
|
+
<rect x="3.5" y="2.5" width="3" height="11" rx="1" />
|
|
81
|
+
<rect x="9.5" y="2.5" width="3" height="11" rx="1" />
|
|
82
|
+
</svg>
|
|
83
|
+
<svg class="sinn-marquee__icon-play" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true">
|
|
84
|
+
<path d="M4 2.5v11l9-5.5z" />
|
|
85
|
+
</svg>
|
|
86
|
+
<span>{controlLabel}</span>
|
|
87
|
+
</label>
|
|
88
|
+
)
|
|
89
|
+
}
|
|
90
|
+
</div>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
/**
|
|
3
|
+
* MotionProvider — loads GSAP (+ ScrollTrigger and any plugins you list) once per page
|
|
4
|
+
* lifetime, runs Lenis smooth scrolling in sync with ScrollTrigger, and keeps animations
|
|
5
|
+
* correct across Astro page transitions. Put it once in your layout.
|
|
6
|
+
*
|
|
7
|
+
* - Lazy: GSAP downloads only when the first scene nears the viewport, unless `smooth` or
|
|
8
|
+
* `eager` is on (then it loads at idle). GSAP is a peer dependency: `pnpm add gsap`.
|
|
9
|
+
* - Smooth scrolling (Lenis) is off by default and never runs with reduced motion. Native
|
|
10
|
+
* keyboard scrolling, find-in-page and anchor links keep working.
|
|
11
|
+
* - Page transitions: before Astro swaps the page, every scene is reverted (tweens and
|
|
12
|
+
* ScrollTriggers killed, inline styles removed); after the swap, Lenis and ScrollTrigger
|
|
13
|
+
* re-measure and scenes on the new page mount as they near the viewport.
|
|
14
|
+
* - Reduced motion changes at runtime (OS or site switch) stop/start Lenis and rebuild scenes.
|
|
15
|
+
*
|
|
16
|
+
* Your own scripts can use the same instance:
|
|
17
|
+
* import { getMotion, onBeforeSwap, onPageLoad } from '@sinnstack/ui/motion/runtime';
|
|
18
|
+
* const { gsap, ScrollTrigger, plugins } = await getMotion();
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* <MotionProvider smooth plugins={['SplitText']} />
|
|
22
|
+
* <SceneRegistry />
|
|
23
|
+
*/
|
|
24
|
+
import type { PluginName } from './runtime/types';
|
|
25
|
+
import './styles/motion.css';
|
|
26
|
+
|
|
27
|
+
type Props = {
|
|
28
|
+
smooth?: boolean;
|
|
29
|
+
/** Lenis smoothing, 0–1 (lower = smoother). */
|
|
30
|
+
lerp?: number;
|
|
31
|
+
plugins?: PluginName[];
|
|
32
|
+
/** Load GSAP at idle even without smooth scrolling or scenes. */
|
|
33
|
+
eager?: boolean;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const { smooth = false, lerp = 0.1, plugins = [], eager = false } = Astro.props;
|
|
37
|
+
|
|
38
|
+
const metaAttrs = {
|
|
39
|
+
'data-smooth': smooth ? 'true' : 'false',
|
|
40
|
+
'data-lerp': String(lerp),
|
|
41
|
+
'data-plugins': plugins.join(','),
|
|
42
|
+
'data-eager': eager ? 'true' : 'false',
|
|
43
|
+
};
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
<meta name="sinn-motion" content="" {...metaAttrs} />
|
|
47
|
+
<script>
|
|
48
|
+
import { startMotionRuntime } from './runtime/runtime';
|
|
49
|
+
startMotionRuntime();
|
|
50
|
+
</script>
|