@spillway-cms/blocks 0.1.1 → 0.1.2
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/dist/config.d.ts +39 -1
- package/dist/config.js +84 -9
- package/dist/config.js.map +1 -1
- package/dist/css.js +6 -0
- package/dist/css.js.map +1 -1
- package/dist/examples.js +5 -0
- package/dist/examples.js.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/marketing.d.ts +17 -0
- package/dist/marketing.js +27 -3
- package/dist/marketing.js.map +1 -1
- package/dist/meta.js +16 -1
- package/dist/meta.js.map +1 -1
- package/dist/module-block.d.ts +4 -1
- package/dist/module-block.js +25 -2
- package/dist/module-block.js.map +1 -1
- package/dist/motion.d.ts +19 -0
- package/dist/motion.js +161 -0
- package/dist/motion.js.map +1 -0
- package/dist/players.d.ts +30 -0
- package/dist/players.js +95 -0
- package/dist/players.js.map +1 -0
- package/dist/story.d.ts +23 -0
- package/dist/story.js +58 -0
- package/dist/story.js.map +1 -0
- package/dist/styles.css +116 -0
- package/package.json +2 -2
package/dist/marketing.js
CHANGED
|
@@ -58,6 +58,7 @@ export const testimonialsComponent = {
|
|
|
58
58
|
defaultItemProps: { quote: 'What they said, in their words.', name: 'Their name', role: '', imageUrl: '' },
|
|
59
59
|
},
|
|
60
60
|
columns: { type: 'radio', label: 'Columns', options: [{ label: '1', value: 1 }, { label: '2', value: 2 }, { label: '3', value: 3 }] },
|
|
61
|
+
marquee: { type: 'radio', label: 'Scroll continuously (a marquee, with a pause button)', options: [{ label: 'Off', value: false }, { label: 'On', value: true }] },
|
|
61
62
|
},
|
|
62
63
|
defaultProps: {
|
|
63
64
|
title: '',
|
|
@@ -68,8 +69,24 @@ export const testimonialsComponent = {
|
|
|
68
69
|
],
|
|
69
70
|
columns: 3,
|
|
70
71
|
},
|
|
71
|
-
render: ({ title, items, columns }) => (_jsx("section", { className: cx('sw-block', 'sw-testimonials', `sw-testimonials--${columns}`), children: _jsxs("div", { className: "sw-container", children: [title ? _jsx("h2", { className: "sw-testimonials__title", children: title }) : null, _jsx("ul", { className: "sw-testimonials__grid", children: (items ?? []).filter((t) => t.quote?.trim()).map((t, i) => (_jsx("li", { className: "sw-testimonial", children: _jsxs("figure", { children: [_jsx("blockquote", { className: "sw-testimonial__quote", children: _jsx("p", { children: t.quote }) }), t.name || t.role ? (_jsxs("figcaption", { className: "sw-testimonial__by", children: [t.imageUrl ? _jsx("img", { className: "sw-testimonial__photo", src: t.imageUrl, alt: "", width: 48, height: 48, loading: "lazy" }) : null, _jsxs("span", { children: [t.name ? _jsx("span", { className: "sw-testimonial__name", children: t.name }) : null, t.role ? _jsx("span", { className: "sw-testimonial__role", children: t.role }) : null] })] })) : null] }) }, i))) })] }) })),
|
|
72
|
+
render: ({ title, items, columns, marquee }) => (_jsx("section", { className: cx('sw-block', 'sw-testimonials', `sw-testimonials--${columns}`), "data-motion-marquee": marquee ? 'slow' : undefined, children: _jsxs("div", { className: "sw-container", children: [title ? _jsx("h2", { className: "sw-testimonials__title", children: title }) : null, marquee ? (_jsx("button", { type: "button", className: "sw-marquee-toggle", "data-sw-marquee-toggle": "", "aria-pressed": "false", hidden: true, children: "Pause scrolling" })) : null, _jsx("ul", { className: "sw-testimonials__grid", children: (items ?? []).filter((t) => t.quote?.trim()).map((t, i) => (_jsx("li", { className: "sw-testimonial", children: _jsxs("figure", { children: [_jsx("blockquote", { className: "sw-testimonial__quote", children: _jsx("p", { children: t.quote }) }), t.name || t.role ? (_jsxs("figcaption", { className: "sw-testimonial__by", children: [t.imageUrl ? _jsx("img", { className: "sw-testimonial__photo", src: t.imageUrl, alt: "", width: 48, height: 48, loading: "lazy" }) : null, _jsxs("span", { children: [t.name ? _jsx("span", { className: "sw-testimonial__name", children: t.name }) : null, t.role ? _jsx("span", { className: "sw-testimonial__role", children: t.role }) : null] })] })) : null] }) }, i))) })] }) })),
|
|
72
73
|
};
|
|
74
|
+
/**
|
|
75
|
+
* A stat's value split for counting up: the prefix, the number, the suffix, its decimals and whether it groups thousands
|
|
76
|
+
* ("$2.4M" → "$", 2.4, "M"; "12,500+" → "", 12500, "+"). Null when the value is not one number ("14:1", "Top 10%" counts, "A+" does not).
|
|
77
|
+
*/
|
|
78
|
+
export function countableValue(value) {
|
|
79
|
+
const m = /^(\D*?)(\d{1,3}(?:,\d{3})+|\d+)(?:\.(\d+))?(\D*)$/.exec(value.trim());
|
|
80
|
+
if (!m)
|
|
81
|
+
return null;
|
|
82
|
+
const [, prefix, int, frac, suffix] = m;
|
|
83
|
+
if (/\d/.test(prefix + suffix))
|
|
84
|
+
return null;
|
|
85
|
+
const to = Number(int.replace(/,/g, '') + (frac ? `.${frac}` : ''));
|
|
86
|
+
if (!Number.isFinite(to))
|
|
87
|
+
return null;
|
|
88
|
+
return { prefix, to, suffix, decimals: frac?.length ?? 0, group: int.includes(',') };
|
|
89
|
+
}
|
|
73
90
|
export const statsComponent = {
|
|
74
91
|
label: 'Stats',
|
|
75
92
|
fields: {
|
|
@@ -87,6 +104,7 @@ export const statsComponent = {
|
|
|
87
104
|
defaultItemProps: { value: '100+', label: 'What it counts' },
|
|
88
105
|
},
|
|
89
106
|
align: { type: 'radio', label: 'Alignment', options: [{ label: 'Left', value: 'left' }, { label: 'Center', value: 'center' }] },
|
|
107
|
+
countUp: { type: 'radio', label: 'Count up as they come into view', options: [{ label: 'Off', value: false }, { label: 'On', value: true }] },
|
|
90
108
|
},
|
|
91
109
|
defaultProps: {
|
|
92
110
|
title: '',
|
|
@@ -97,7 +115,12 @@ export const statsComponent = {
|
|
|
97
115
|
],
|
|
98
116
|
align: 'center',
|
|
99
117
|
},
|
|
100
|
-
render: ({ title, items, align }) => (_jsx("section", { className: cx('sw-block', 'sw-stats', align === 'center' && 'sw-stats--center'), children: _jsxs("div", { className: "sw-container", children: [title ? _jsx("h2", { className: "sw-stats__title", children: title }) : null, _jsx("dl", { className: "sw-stats__grid", children: (items ?? []).filter((s) => s.value?.trim()).map((s, i) =>
|
|
118
|
+
render: ({ title, items, align, countUp }) => (_jsx("section", { className: cx('sw-block', 'sw-stats', align === 'center' && 'sw-stats--center'), "data-motion-count": countUp ? '' : undefined, children: _jsxs("div", { className: "sw-container", children: [title ? _jsx("h2", { className: "sw-stats__title", children: title }) : null, _jsx("dl", { className: "sw-stats__grid", children: (items ?? []).filter((s) => s.value?.trim()).map((s, i) => {
|
|
119
|
+
const n = countUp ? countableValue(s.value) : null;
|
|
120
|
+
return (_jsxs("div", { className: "sw-stat", children: [_jsx("dt", { className: "sw-stat__label", children: s.label }), n ? (
|
|
121
|
+
// Screen readers get the final value once; the digits that count are hidden from them.
|
|
122
|
+
_jsxs("dd", { className: "sw-stat__value", children: [_jsx("span", { "aria-hidden": "true", "data-count-to": n.to, "data-count-prefix": n.prefix, "data-count-suffix": n.suffix, "data-count-decimals": n.decimals, "data-count-group": n.group ? '' : undefined, children: s.value }), _jsx("span", { className: "sw-visually-hidden", children: s.value })] })) : (_jsx("dd", { className: "sw-stat__value", children: s.value }))] }, i));
|
|
123
|
+
}) })] }) })),
|
|
101
124
|
};
|
|
102
125
|
export const logoStripComponent = {
|
|
103
126
|
label: 'Logo strip',
|
|
@@ -117,9 +140,10 @@ export const logoStripComponent = {
|
|
|
117
140
|
defaultItemProps: { imageUrl: '', name: 'Partner name', href: '' },
|
|
118
141
|
},
|
|
119
142
|
grayscale: { type: 'radio', label: 'Logos', options: [{ label: 'In color', value: false }, { label: 'Gray until hovered', value: true }] },
|
|
143
|
+
marquee: { type: 'radio', label: 'Scroll continuously (a marquee, with a pause button)', options: [{ label: 'Off', value: false }, { label: 'On', value: true }] },
|
|
120
144
|
},
|
|
121
145
|
defaultProps: { title: 'Trusted by', logos: [], grayscale: true },
|
|
122
|
-
render: ({ title, logos, grayscale }) => (_jsx("section", { className: cx('sw-block', 'sw-logos', grayscale && 'sw-logos--gray'), children: _jsxs("div", { className: "sw-container", children: [title ? _jsx("h2", { className: "sw-logos__title", children: title }) : null, _jsx("ul", { className: "sw-logos__list", children: (logos ?? []).filter((l) => l.imageUrl || l.name).map((l, i) => {
|
|
146
|
+
render: ({ title, logos, grayscale, marquee }) => (_jsx("section", { className: cx('sw-block', 'sw-logos', grayscale && 'sw-logos--gray'), "data-motion-marquee": marquee ? 'fast' : undefined, children: _jsxs("div", { className: "sw-container", children: [title ? _jsx("h2", { className: "sw-logos__title", children: title }) : null, marquee ? (_jsx("button", { type: "button", className: "sw-marquee-toggle", "data-sw-marquee-toggle": "", "aria-pressed": "false", hidden: true, children: "Pause scrolling" })) : null, _jsx("ul", { className: "sw-logos__list", children: (logos ?? []).filter((l) => l.imageUrl || l.name).map((l, i) => {
|
|
123
147
|
const img = l.imageUrl ? _jsx("img", { className: "sw-logos__img", src: l.imageUrl, alt: l.name, loading: "lazy" }) : _jsx("span", { className: "sw-logos__name", children: l.name });
|
|
124
148
|
return _jsx("li", { children: l.href ? _jsx("a", { href: l.href, rel: "noopener", children: img }) : img }, i);
|
|
125
149
|
}) })] }) })),
|
package/dist/marketing.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"marketing.js","sourceRoot":"","sources":["../src/marketing.tsx"],"names":[],"mappings":";AAOA,MAAM,EAAE,GAAG,CAAC,GAAG,CAAwC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACxF,0EAA0E;AAC1E,MAAM,KAAK,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,qCAAqC,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AAC5L,MAAM,UAAU,G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Q,CAAC,CAAC,CAAC,cAAK,SAAS,EAAC,eAAe,EAAC,GAAG,EAAE,CAAC,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,EAAE,OAAO,EAAC,MAAM,GAAG,CAAC,CAAC,CAAC,eAAM,SAAS,EAAC,gBAAgB,YAAE,CAAC,CAAC,IAAI,GAAQ,CAAC;wBAC3J,OAAO,uBAAa,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,YAAG,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,GAAG,EAAC,UAAU,YAAE,GAAG,GAAK,CAAC,CAAC,CAAC,GAAG,IAA5D,CAAC,CAAiE,CAAC;oBACrF,CAAC,CAAC,GACC,IACD,GACE,CACX;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwD5B,CAAC"}
|
package/dist/meta.js
CHANGED
|
@@ -64,10 +64,25 @@ export const blockMeta = {
|
|
|
64
64
|
description: 'A row of logos, optionally linked and shown in gray until hovered.',
|
|
65
65
|
aiHint: 'Use for partners, clients, accreditations or press. Each logo needs the organization name as its alt text. Leave out when no real logo URLs are known.',
|
|
66
66
|
},
|
|
67
|
+
Lottie: {
|
|
68
|
+
summary: 'A vector animation file.',
|
|
69
|
+
description: 'A Lottie animation (.json) from the media library, played when it scrolls into view, in a loop with a pause button or once. Visitors who see no motion get the poster image, or the last frame without one. The player is part of Spillway and loads only on pages that use it.',
|
|
70
|
+
aiHint: 'Use for a small illustration that moves (an icon, a diagram building up), not for content people must read. Needs a real .json file in the media library; add a poster image, and alt text unless it is decoration.',
|
|
71
|
+
},
|
|
72
|
+
Model3D: {
|
|
73
|
+
summary: 'An object people can turn.',
|
|
74
|
+
description: 'A 3D model (.glb or .gltf) people can turn and zoom, with a poster image while it loads, an optional slow turn and an optional View in your space button on phones. Alt text is required. The viewer is part of Spillway and loads only when the block comes near the screen.',
|
|
75
|
+
aiHint: 'Use to show a product, an artifact or a building people would want to look at from every side. Needs a real model file in the media library and alt text naming the object; models compressed with Draco or KTX2 do not load, so export them uncompressed.',
|
|
76
|
+
},
|
|
77
|
+
Scrollytelling: {
|
|
78
|
+
summary: 'Steps with images that switch.',
|
|
79
|
+
description: 'Text steps beside a column of images that stays in place while the steps scroll past, switching to each step\'s image. Visitors who see no motion, and phones, get the steps as a list, each with its image.',
|
|
80
|
+
aiHint: 'Use for a process, a timeline or a story told in three to six steps, each with a short heading, one or two sentences and a real image with alt text. Needs the brand\'s motion on to scroll; otherwise it reads as a list.',
|
|
81
|
+
},
|
|
67
82
|
Spacer: {
|
|
68
83
|
summary: 'Space between sections.',
|
|
69
84
|
description: 'Vertical space (s, m, l, xl).',
|
|
70
|
-
aiHint: 'Use sparingly. Blocks already have padding, and every block has spaceAbove and spaceBelow (auto, none, s, m, l, xl) to adjust it.',
|
|
85
|
+
aiHint: 'Use sparingly. Blocks already have padding, and every block has spaceAbove and spaceBelow (auto, none, s, m, l, xl) to adjust it, and a motion object ({ entrance: none|fade|rise|scale|slide-left|slide-right, delay: none|short|medium, stagger, hover: none|lift|zoom|tilt, scroll: none|fade-out|pin|parallax (Hero with a background image only) }); a Hero can take backgroundVideo (.mp4 or .webm, needs backgroundImage as its poster) Stats countUp, and LogoStrip and Testimonials marquee (true scrolls the row with a pause button), all capped by the brand\'s motion level; use entrances sparingly and never on the first block of a page.',
|
|
71
86
|
},
|
|
72
87
|
Search: {
|
|
73
88
|
summary: 'A search box for this site.',
|
package/dist/meta.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../src/meta.ts"],"names":[],"mappings":"AAcA,MAAM,CAAC,MAAM,SAAS,GAA8B;IAClD,IAAI,EAAE;QACJ,OAAO,EAAE,+BAA+B;QACxC,WAAW,EAAE,6GAA6G;QAC1H,MAAM,EACJ,sNAAsN;KACzN;IACD,OAAO,EAAE;QACP,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AgB,EAAE;QAChB,OAAO,EAAE,iCAAiC;QAC1C,WAAW,EAAE,oMAAoM;QACjN,MAAM,EAAE,iKAAiK;KAC1K;IACD,UAAU,EAAE;QACV,OAAO,EAAE,gCAAgC;QACzC,WAAW,EAAE,iQAAiQ;QAC9Q,MAAM,EAAE,8JAA8J;KACvK;IACD,YAAY,EAAE;QACZ,OAAO,EAAE,0BAA0B;QACnC,WAAW,EAAE,+OAA+O;QAC5P,MAAM,EAAE,2LAA2L;KACpM;IACD,WAAW,EAAE;QACX,OAAO,EAAE,gCAAgC;QACzC,WAAW,EAAE,yRAAyR;QACtS,MAAM,EAAE,wKAAwK;KACjL;IACD,WAAW,EAAE;QACX,OAAO,EAAE,wBAAwB;QACjC,WAAW,EAAE,2LAA2L;QACxM,MAAM,EAAE,4IAA4I;KACrJ;CACF,CAAC"}
|
package/dist/module-block.d.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* breaking the page. Server-safe: no hooks, no browser APIs; the admin swaps in its own fields and a live preview.
|
|
7
7
|
*/
|
|
8
8
|
import type { ComponentConfig } from '@puckeditor/core';
|
|
9
|
+
import { type SceneRender } from '@spillway-cms/shared';
|
|
9
10
|
export interface ModuleBlockProps {
|
|
10
11
|
/** The module's name as installed (manifest `name`). */
|
|
11
12
|
module: string;
|
|
@@ -21,9 +22,11 @@ export interface ModuleBlockProps {
|
|
|
21
22
|
placeholder?: boolean | null;
|
|
22
23
|
label?: string | null;
|
|
23
24
|
reason?: string | null;
|
|
25
|
+
/** A scene block's frame and poster (resolved by the server, like `html`); the page's motion script runs the frame. */
|
|
26
|
+
scene?: SceneRender | null;
|
|
24
27
|
}
|
|
25
28
|
export declare function moduleBlockClass(module: string, key: string): string;
|
|
26
29
|
export declare const moduleBlockComponent: ComponentConfig<{
|
|
27
30
|
props: ModuleBlockProps;
|
|
28
31
|
}>;
|
|
29
|
-
export declare const moduleBlockCss = "/* ---------- Module block ---------- */\n\n/* The module's HTML sits in the page container; a trusted module that brings its own container gets no second gutter. */\n.sw-module-block__body > * + * { margin-top: 1em; }\n.sw-module-block__body .sw-container { max-width: none; padding-inline: 0; }\n.sw-module-block__body figure { margin: 0; }\n.sw-module-block__body img { display: block; max-width: 100%; height: auto; border-radius: var(--sw-radius, 8px); }\n.sw-module-block__body ul { padding-left: 1.4em; }\n.sw-module-block__body table { margin: 0; }\n.sw-module-block__body caption { padding-bottom: var(--sw-space-1); text-align: left; font-weight: 600; }\n.sw-module-block__body thead th { border-bottom: 2px solid var(--sw-color-border); }\n\n.sw-module-block--placeholder { padding-block: var(--sw-space-2); }\n.sw-module-block__placeholder {\n padding: var(--sw-space-3);\n border: 1px dashed var(--sw-color-border);\n border-radius: var(--sw-radius, 8px);\n background: var(--sw-color-surface);\n color: var(--sw-color-muted);\n font-size: 0.9rem;\n text-align: center;\n}\n";
|
|
32
|
+
export declare const moduleBlockCss = "/* ---------- Module block ---------- */\n\n/* The module's HTML sits in the page container; a trusted module that brings its own container gets no second gutter. */\n.sw-module-block__body > * + * { margin-top: 1em; }\n.sw-module-block__body .sw-container { max-width: none; padding-inline: 0; }\n.sw-module-block__body figure { margin: 0; }\n.sw-module-block__body img { display: block; max-width: 100%; height: auto; border-radius: var(--sw-radius, 8px); }\n.sw-module-block__body ul { padding-left: 1.4em; }\n.sw-module-block__body table { margin: 0; }\n.sw-module-block__body caption { padding-bottom: var(--sw-space-1); text-align: left; font-weight: 600; }\n.sw-module-block__body thead th { border-bottom: 2px solid var(--sw-color-border); }\n\n/* Scenes (docs/dev/motion.md, layer 3): the poster until the frame says it is ready, then the frame over it. */\n.sw-scene { margin: 0; }\n.sw-scene__stage { position: relative; height: var(--sw-scene-height, 420px); border-radius: var(--sw-radius, 8px); overflow: hidden; background: var(--sw-color-surface); }\n.sw-scene--s { --sw-scene-height: 280px; }\n.sw-scene--l { --sw-scene-height: 600px; }\n@media (max-width: 640px) { .sw-scene--l { --sw-scene-height: 420px; } }\n.sw-scene__poster { display: block; width: 100%; height: 100%; object-fit: cover; }\n.sw-scene__frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; opacity: 0; transition: opacity 400ms ease; }\n.sw-scene:not(.sw-scene--interactive) .sw-scene__frame { pointer-events: none; }\n.sw-scene-ready .sw-scene__frame { opacity: 1; }\n.sw-scene-ready .sw-scene__poster { visibility: hidden; }\n.sw-scene-toggle { display: block; margin: var(--sw-space-1, 0.5rem) 0 0 auto; font: inherit; font-size: 0.8125rem; color: inherit; background: none; border: 1px solid currentColor; border-radius: 999px; padding: 0.2rem 0.75rem; cursor: pointer; opacity: 0.85; }\n.sw-scene-toggle[hidden] { display: none; }\n.sw-scene__content { margin-top: var(--sw-space-3, 1.5rem); }\n\n.sw-module-block--placeholder { padding-block: var(--sw-space-2); }\n.sw-module-block__placeholder {\n padding: var(--sw-space-3);\n border: 1px dashed var(--sw-color-border);\n border-radius: var(--sw-radius, 8px);\n background: var(--sw-color-surface);\n color: var(--sw-color-muted);\n font-size: 0.9rem;\n text-align: center;\n}\n";
|
package/dist/module-block.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { BLOCK_STYLE_KEY_RE, blockStyleClass } from '@spillway-cms/shared';
|
|
3
|
+
/** A scene's stage: the poster (what visitors without motion get), a pause button, and the data the motion script needs. */
|
|
4
|
+
function SceneStage({ scene }) {
|
|
5
|
+
return (_jsxs("figure", { className: `sw-scene sw-scene--${scene.height}${scene.interactive ? ' sw-scene--interactive' : ''}`, "data-sw-scene": scene.frame, "data-scene-props": JSON.stringify(scene.props ?? {}), "data-scene-title": scene.alt, "data-scene-interactive": scene.interactive ? '' : undefined, children: [_jsx("div", { className: "sw-scene__stage", children: _jsx("img", { className: "sw-scene__poster", src: scene.poster, alt: scene.alt, loading: "lazy" }) }), _jsx("button", { type: "button", className: "sw-scene-toggle", "data-sw-scene-toggle": "", "aria-pressed": "false", hidden: true, children: "Pause animation" })] }));
|
|
6
|
+
}
|
|
3
7
|
export function moduleBlockClass(module, key) {
|
|
4
8
|
const slug = (s) => s.replace(/^@/, '').replace(/[^a-z0-9]+/gi, '-').replace(/^-+|-+$/g, '').toLowerCase();
|
|
5
9
|
return `sw-module-block--${slug(module)}-${slug(key)}`;
|
|
@@ -12,11 +16,15 @@ export const moduleBlockComponent = {
|
|
|
12
16
|
props: { type: 'object', label: 'Props', objectFields: {} },
|
|
13
17
|
},
|
|
14
18
|
defaultProps: { module: '', blockKey: '', props: {} },
|
|
15
|
-
render: ({ module, blockKey: rawKey, html, placeholder, label, reason, style, styleSet }) => {
|
|
19
|
+
render: ({ module, blockKey: rawKey, html, placeholder, label, reason, style, styleSet, scene }) => {
|
|
16
20
|
const name = String(module ?? '');
|
|
17
21
|
const blockKey = String(rawKey ?? '');
|
|
18
22
|
// A styled module block's wrapper carries its style's class (sw-style-cards-filled for a block that uses the Cards styles).
|
|
19
23
|
const styled = typeof styleSet === 'string' && styleSet && typeof style === 'string' && BLOCK_STYLE_KEY_RE.test(style) ? ` ${blockStyleClass(styleSet, style)}` : '';
|
|
24
|
+
if (scene && !placeholder) {
|
|
25
|
+
// A scene: the stage in the page container, the module's HTML (its content without motion) below it.
|
|
26
|
+
return (_jsx("section", { className: `sw-block sw-module-block sw-scene-block ${moduleBlockClass(name, blockKey)}${styled}`, "data-module": name, "data-block": blockKey, "data-style": styled ? style : undefined, children: _jsxs("div", { className: "sw-container", children: [_jsx(SceneStage, { scene: scene }), typeof html === 'string' && html ? _jsx("div", { className: "sw-prose sw-module-block__body sw-scene__content", dangerouslySetInnerHTML: { __html: html } }) : null] }) }));
|
|
27
|
+
}
|
|
20
28
|
if (typeof html === 'string' && html && !placeholder) {
|
|
21
29
|
// Like a core block: a section in the page's rhythm, the content in the container with prose styles (a sandboxed
|
|
22
30
|
// module's HTML is prose: paragraphs, lists, tables, images).
|
|
@@ -39,6 +47,21 @@ export const moduleBlockCss = `/* ---------- Module block ---------- */
|
|
|
39
47
|
.sw-module-block__body caption { padding-bottom: var(--sw-space-1); text-align: left; font-weight: 600; }
|
|
40
48
|
.sw-module-block__body thead th { border-bottom: 2px solid var(--sw-color-border); }
|
|
41
49
|
|
|
50
|
+
/* Scenes (docs/dev/motion.md, layer 3): the poster until the frame says it is ready, then the frame over it. */
|
|
51
|
+
.sw-scene { margin: 0; }
|
|
52
|
+
.sw-scene__stage { position: relative; height: var(--sw-scene-height, 420px); border-radius: var(--sw-radius, 8px); overflow: hidden; background: var(--sw-color-surface); }
|
|
53
|
+
.sw-scene--s { --sw-scene-height: 280px; }
|
|
54
|
+
.sw-scene--l { --sw-scene-height: 600px; }
|
|
55
|
+
@media (max-width: 640px) { .sw-scene--l { --sw-scene-height: 420px; } }
|
|
56
|
+
.sw-scene__poster { display: block; width: 100%; height: 100%; object-fit: cover; }
|
|
57
|
+
.sw-scene__frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; opacity: 0; transition: opacity 400ms ease; }
|
|
58
|
+
.sw-scene:not(.sw-scene--interactive) .sw-scene__frame { pointer-events: none; }
|
|
59
|
+
.sw-scene-ready .sw-scene__frame { opacity: 1; }
|
|
60
|
+
.sw-scene-ready .sw-scene__poster { visibility: hidden; }
|
|
61
|
+
.sw-scene-toggle { display: block; margin: var(--sw-space-1, 0.5rem) 0 0 auto; font: inherit; font-size: 0.8125rem; color: inherit; background: none; border: 1px solid currentColor; border-radius: 999px; padding: 0.2rem 0.75rem; cursor: pointer; opacity: 0.85; }
|
|
62
|
+
.sw-scene-toggle[hidden] { display: none; }
|
|
63
|
+
.sw-scene__content { margin-top: var(--sw-space-3, 1.5rem); }
|
|
64
|
+
|
|
42
65
|
.sw-module-block--placeholder { padding-block: var(--sw-space-2); }
|
|
43
66
|
.sw-module-block__placeholder {
|
|
44
67
|
padding: var(--sw-space-3);
|
package/dist/module-block.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-block.js","sourceRoot":"","sources":["../src/module-block.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,kBAAkB,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"module-block.js","sourceRoot":"","sources":["../src/module-block.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAoB,MAAM,sBAAsB,CAAC;AAqB7F,4HAA4H;AAC5H,SAAS,UAAU,CAAC,EAAE,KAAK,EAA0B;IACnD,OAAO,CACL,kBACE,SAAS,EAAE,sBAAsB,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC,EAAE,EAAE,mBACpF,KAAK,CAAC,KAAK,sBACR,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC,sBACjC,KAAK,CAAC,GAAG,4BACH,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,aAE1D,cAAK,SAAS,EAAC,iBAAiB,YAC9B,cAAK,SAAS,EAAC,kBAAkB,EAAC,GAAG,EAAE,KAAK,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,OAAO,EAAC,MAAM,GAAG,GAClF,EACN,iBAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,iBAAiB,0BAAsB,EAAE,kBAAc,OAAO,EAAC,MAAM,sCAE5F,IACF,CACV,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,MAAc,EAAE,GAAW;IAC1D,MAAM,IAAI,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;IACnH,OAAO,oBAAoB,IAAI,CAAC,MAAM,CAA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CAAC,CAAC,CAAC,gBAAgB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,iBAAe,IAAI,IAAI,SAAS,gBAAc,QAAQ,IAAI,SAAS,YAC/M,cAAK,SAAS,EAAC,cAAc,YAC3B,cAAK,SAAS,EAAC,8BAA8B,EAAC,IAAI,EAAC,MAAM,YACtD,IAAI,GACD,GACF,GACE,CACX,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqC7B,CAAC"}
|
package/dist/motion.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Motion (docs/dev/motion.md, phase 1): the presets behind a block's Motion settings, the page script that arms them, and the
|
|
3
|
+
* visitor's Reduce motion switch.
|
|
4
|
+
*
|
|
5
|
+
* Nothing is hidden by CSS alone: a block only starts hidden once the page script has added `sw-motion-ready` to the root element,
|
|
6
|
+
* and the script first marks every block already on screen as arrived, so the content above the fold never waits for an animation
|
|
7
|
+
* and a page without the script (an adapter, a feed reader, a failed load) shows everything. The brand's motion level sits on the
|
|
8
|
+
* root as `data-sw-motion`: `subtle` plays scale and slides as a short rise and turns tilt off. Reduced motion, from the operating
|
|
9
|
+
* system or the visitor's switch (`sw-reduce-motion` on the root), turns every rule off.
|
|
10
|
+
*/
|
|
11
|
+
export declare const MOTION_CSS = "\n/* Motion: entrances (armed by the page's motion script), stagger and hover. */\n[data-motion] { --sw-motion-from: none; --sw-motion-wait: 0ms; }\n[data-motion=\"rise\"] { --sw-motion-from: translateY(var(--sw-motion-distance, 24px)); }\n[data-motion=\"scale\"] { --sw-motion-from: scale(0.94); }\n[data-motion=\"slide-left\"] { --sw-motion-from: translateX(calc(-1 * var(--sw-motion-distance, 24px))); }\n[data-motion=\"slide-right\"] { --sw-motion-from: translateX(var(--sw-motion-distance, 24px)); }\n[data-sw-motion=\"subtle\"] :is([data-motion=\"scale\"], [data-motion=\"slide-left\"], [data-motion=\"slide-right\"]) { --sw-motion-from: translateY(calc(var(--sw-motion-distance, 24px) / 2)); }\n[data-sw-motion=\"subtle\"] [data-motion=\"rise\"] { --sw-motion-from: translateY(calc(var(--sw-motion-distance, 24px) / 2)); }\n[data-motion-delay=\"short\"] { --sw-motion-wait: 150ms; }\n[data-motion-delay=\"medium\"] { --sw-motion-wait: 300ms; }\n/* The transition runs only as a block arrives (sw-in), so hiding the blocks below the fold is instant. */\n.sw-motion-ready [data-motion].sw-in:not([data-motion-stagger]),\n.sw-motion-ready [data-motion].sw-in[data-motion-stagger] :is(.sw-cards__grid, .sw-collection__list, .sw-gallery__grid, .sw-faq__list, .sw-logos__list, .sw-stats__grid, .sw-testimonials__grid, .sw-buttons) > * {\n transition: opacity var(--sw-motion-duration, 600ms) var(--sw-motion-easing, cubic-bezier(0.2, 0.7, 0.2, 1)), transform var(--sw-motion-duration, 600ms) var(--sw-motion-easing, cubic-bezier(0.2, 0.7, 0.2, 1));\n transition-delay: calc(var(--sw-motion-wait) + var(--sw-motion-index, 0) * 80ms);\n}\n.sw-motion-ready [data-motion]:not([data-motion-stagger]):not(.sw-in),\n.sw-motion-ready [data-motion][data-motion-stagger]:not(.sw-in) :is(.sw-cards__grid, .sw-collection__list, .sw-gallery__grid, .sw-faq__list, .sw-logos__list, .sw-stats__grid, .sw-testimonials__grid, .sw-buttons) > * { opacity: 0; transform: var(--sw-motion-from); }\n[data-motion-hover] :is(.sw-cards__grid, .sw-collection__list, .sw-gallery__grid, .sw-faq__list, .sw-logos__list, .sw-stats__grid, .sw-testimonials__grid, .sw-buttons) > *, [data-motion-hover].sw-image, [data-motion-hover] img { transition: transform 200ms ease, box-shadow 200ms ease; }\n[data-sw-motion] [data-motion-hover=\"lift\"] :is(.sw-cards__grid, .sw-collection__list, .sw-gallery__grid, .sw-faq__list, .sw-logos__list, .sw-stats__grid, .sw-testimonials__grid, .sw-buttons) > *:hover, [data-sw-motion] [data-motion-hover=\"lift\"].sw-image:hover { transform: translateY(-4px); box-shadow: var(--sw-shadow, 0 8px 24px rgba(0, 0, 0, 0.12)); }\n[data-motion-hover=\"zoom\"] :is(:is(.sw-cards__grid, .sw-collection__list, .sw-gallery__grid, .sw-faq__list, .sw-logos__list, .sw-stats__grid, .sw-testimonials__grid, .sw-buttons) > *, .sw-image) { overflow: hidden; }\n[data-sw-motion] [data-motion-hover=\"zoom\"] :is(:is(.sw-cards__grid, .sw-collection__list, .sw-gallery__grid, .sw-faq__list, .sw-logos__list, .sw-stats__grid, .sw-testimonials__grid, .sw-buttons) > *, .sw-image):hover img, [data-sw-motion] [data-motion-hover=\"zoom\"].sw-image:hover img { transform: scale(1.05); }\n[data-sw-motion=\"expressive\"] [data-motion-hover=\"tilt\"] :is(.sw-cards__grid, .sw-collection__list, .sw-gallery__grid, .sw-faq__list, .sw-logos__list, .sw-stats__grid, .sw-testimonials__grid, .sw-buttons) > *:hover { transform: perspective(800px) rotateX(2deg) rotateY(-3deg) translateY(-2px); }\n/* On scroll: the page script writes --sw-scroll (0 as the block enters at the bottom, 1 as it leaves at the top); unset, every\n effect sits at rest. Parallax moves a Hero's background slower than the page (half as far at the subtle level). */\n[data-motion-scroll=\"parallax\"] { --sw-parallax: 16%; }\n[data-sw-motion=\"subtle\"] [data-motion-scroll=\"parallax\"] { --sw-parallax: 8%; }\n[data-sw-motion] [data-motion-scroll=\"parallax\"].sw-hero--image { overflow: hidden; }\n[data-sw-motion] [data-motion-scroll=\"parallax\"] .sw-hero__bg { transform: translateY(calc((var(--sw-scroll, 0.5) - 0.5) * var(--sw-parallax))) scale(1.18); will-change: transform; }\n[data-sw-motion] [data-motion-scroll=\"parallax\"].sw-hero--image:not(:has(.sw-hero__bg)) { background-position: center calc(50% + (var(--sw-scroll, 0.5) - 0.5) * var(--sw-parallax) * 4); }\n[data-sw-motion] [data-motion-scroll=\"fade-out\"] { opacity: clamp(0, calc((1 - var(--sw-scroll, 0)) / 0.35), 1); }\n[data-sw-motion] [data-motion-scroll=\"pin\"] { position: sticky; top: 0; z-index: 0; }\n[data-sw-motion] [data-motion-scroll=\"pin\"] ~ * { position: relative; z-index: 1; }\n.sw-visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }\n.sw-hero { position: relative; }\n.sw-video-toggle { position: absolute; right: var(--sw-space-3, 1rem); bottom: var(--sw-space-3, 1rem); z-index: 1; font: inherit; font-size: 0.8125rem; color: #ffffff; background: rgba(0, 0, 0, 0.55); border: 1px solid rgba(255, 255, 255, 0.6); border-radius: 999px; padding: 0.3rem 0.85rem; cursor: pointer; }\n.sw-video-toggle:focus-visible { outline: 2px solid #ffffff; outline-offset: 2px; }\n/* Marquee (Logo strip, Testimonials): the page script adds sw-marquee-on and copies the items (the copies are hidden from\n assistive technology) so the row loops; items carry their spacing as a margin so moving by half is seamless. */\n[data-motion-marquee]:not(.sw-marquee-on) [data-sw-marquee-clone] { display: none; }\n.sw-marquee-on .sw-container { overflow: hidden; }\n.sw-marquee-on :is(.sw-logos__list, .sw-testimonials__grid) { display: flex; flex-wrap: nowrap; justify-content: flex-start; gap: 0; width: max-content; animation: sw-marquee var(--sw-marquee-duration, 40s) linear infinite; }\n.sw-marquee-on :is(.sw-logos__list, .sw-testimonials__grid) > * { flex: none; margin-inline-end: var(--sw-marquee-gap, var(--sw-space-4, 2rem)); }\n.sw-testimonials.sw-marquee-on .sw-testimonials__grid > * { width: min(22rem, 80vw); --sw-marquee-gap: var(--sw-space-3, 1.5rem); }\n.sw-marquee-on :is(.sw-logos__list, .sw-testimonials__grid):hover, .sw-marquee-on :is(.sw-logos__list, .sw-testimonials__grid):focus-within, .sw-marquee-paused :is(.sw-logos__list, .sw-testimonials__grid) { animation-play-state: paused; }\n@keyframes sw-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }\n.sw-lottie-toggle { display: block; margin: var(--sw-space-1, 0.5rem) auto 0; font: inherit; font-size: 0.8125rem; color: inherit; background: none; border: 1px solid currentColor; border-radius: 999px; padding: 0.2rem 0.75rem; cursor: pointer; opacity: 0.85; }\n.sw-lottie-toggle[hidden] { display: none; }\n.sw-marquee-toggle { display: block; margin: 0 auto var(--sw-space-3, 1rem); font: inherit; font-size: 0.8125rem; color: inherit; background: none; border: 1px solid currentColor; border-radius: 999px; padding: 0.2rem 0.75rem; cursor: pointer; opacity: 0.85; }\n.sw-marquee-toggle[hidden] { display: none; }\n.sw-motion-switch { font: inherit; font-size: 0.8125rem; color: inherit; background: none; border: 1px solid currentColor; border-radius: 999px; padding: 0.2rem 0.75rem; cursor: pointer; opacity: 0.85; }\n.sw-motion-switch[aria-pressed=\"true\"] { background: var(--sw-color-text); color: var(--sw-color-bg); opacity: 1; }\n.sw-reduce-motion *, .sw-reduce-motion *::before, .sw-reduce-motion *::after { transition: none !important; animation: none !important; }\n.sw-reduce-motion [data-motion], .sw-reduce-motion [data-motion] *, .sw-reduce-motion [data-motion-scroll], .sw-reduce-motion [data-motion-scroll] * { opacity: 1 !important; transform: none !important; }\n@media (prefers-reduced-motion: reduce) {\n html:not(.sw-motion-allowed) :is([data-motion], [data-motion-scroll]), html:not(.sw-motion-allowed) :is([data-motion], [data-motion-scroll]) * { opacity: 1 !important; transform: none !important; transition: none !important; }\n html:not(.sw-motion-allowed) .sw-marquee-on :is(.sw-logos__list, .sw-testimonials__grid) { animation: none !important; }\n}\n";
|
|
12
|
+
/** The visitor's choice in local storage: "1" reduce, "0" allow; absent follows the operating system. */
|
|
13
|
+
export declare const MOTION_STORAGE_KEY = "sw-reduce-motion";
|
|
14
|
+
/**
|
|
15
|
+
* The page's motion script (inline with the page's nonce, only on pages with motion). It applies the visitor's choice, wires the
|
|
16
|
+
* Reduce motion switch, and arms the entrances: blocks already on screen arrive at once, the rest when they scroll into view.
|
|
17
|
+
* Stagger numbers a block's items so each waits a little longer than the one before.
|
|
18
|
+
*/
|
|
19
|
+
export declare const MOTION_SCRIPT: string;
|
package/dist/motion.js
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Motion (docs/dev/motion.md, phase 1): the presets behind a block's Motion settings, the page script that arms them, and the
|
|
3
|
+
* visitor's Reduce motion switch.
|
|
4
|
+
*
|
|
5
|
+
* Nothing is hidden by CSS alone: a block only starts hidden once the page script has added `sw-motion-ready` to the root element,
|
|
6
|
+
* and the script first marks every block already on screen as arrived, so the content above the fold never waits for an animation
|
|
7
|
+
* and a page without the script (an adapter, a feed reader, a failed load) shows everything. The brand's motion level sits on the
|
|
8
|
+
* root as `data-sw-motion`: `subtle` plays scale and slides as a short rise and turns tilt off. Reduced motion, from the operating
|
|
9
|
+
* system or the visitor's switch (`sw-reduce-motion` on the root), turns every rule off.
|
|
10
|
+
*/
|
|
11
|
+
/** The containers whose children are a block's items (cards, quotes, logos, figures, list items, buttons). */
|
|
12
|
+
const ITEMS = ':is(.sw-cards__grid, .sw-collection__list, .sw-gallery__grid, .sw-faq__list, .sw-logos__list, .sw-stats__grid, .sw-testimonials__grid, .sw-buttons)';
|
|
13
|
+
export const MOTION_CSS = `
|
|
14
|
+
/* Motion: entrances (armed by the page's motion script), stagger and hover. */
|
|
15
|
+
[data-motion] { --sw-motion-from: none; --sw-motion-wait: 0ms; }
|
|
16
|
+
[data-motion="rise"] { --sw-motion-from: translateY(var(--sw-motion-distance, 24px)); }
|
|
17
|
+
[data-motion="scale"] { --sw-motion-from: scale(0.94); }
|
|
18
|
+
[data-motion="slide-left"] { --sw-motion-from: translateX(calc(-1 * var(--sw-motion-distance, 24px))); }
|
|
19
|
+
[data-motion="slide-right"] { --sw-motion-from: translateX(var(--sw-motion-distance, 24px)); }
|
|
20
|
+
[data-sw-motion="subtle"] :is([data-motion="scale"], [data-motion="slide-left"], [data-motion="slide-right"]) { --sw-motion-from: translateY(calc(var(--sw-motion-distance, 24px) / 2)); }
|
|
21
|
+
[data-sw-motion="subtle"] [data-motion="rise"] { --sw-motion-from: translateY(calc(var(--sw-motion-distance, 24px) / 2)); }
|
|
22
|
+
[data-motion-delay="short"] { --sw-motion-wait: 150ms; }
|
|
23
|
+
[data-motion-delay="medium"] { --sw-motion-wait: 300ms; }
|
|
24
|
+
/* The transition runs only as a block arrives (sw-in), so hiding the blocks below the fold is instant. */
|
|
25
|
+
.sw-motion-ready [data-motion].sw-in:not([data-motion-stagger]),
|
|
26
|
+
.sw-motion-ready [data-motion].sw-in[data-motion-stagger] ${ITEMS} > * {
|
|
27
|
+
transition: opacity var(--sw-motion-duration, 600ms) var(--sw-motion-easing, cubic-bezier(0.2, 0.7, 0.2, 1)), transform var(--sw-motion-duration, 600ms) var(--sw-motion-easing, cubic-bezier(0.2, 0.7, 0.2, 1));
|
|
28
|
+
transition-delay: calc(var(--sw-motion-wait) + var(--sw-motion-index, 0) * 80ms);
|
|
29
|
+
}
|
|
30
|
+
.sw-motion-ready [data-motion]:not([data-motion-stagger]):not(.sw-in),
|
|
31
|
+
.sw-motion-ready [data-motion][data-motion-stagger]:not(.sw-in) ${ITEMS} > * { opacity: 0; transform: var(--sw-motion-from); }
|
|
32
|
+
[data-motion-hover] ${ITEMS} > *, [data-motion-hover].sw-image, [data-motion-hover] img { transition: transform 200ms ease, box-shadow 200ms ease; }
|
|
33
|
+
[data-sw-motion] [data-motion-hover="lift"] ${ITEMS} > *:hover, [data-sw-motion] [data-motion-hover="lift"].sw-image:hover { transform: translateY(-4px); box-shadow: var(--sw-shadow, 0 8px 24px rgba(0, 0, 0, 0.12)); }
|
|
34
|
+
[data-motion-hover="zoom"] :is(${ITEMS} > *, .sw-image) { overflow: hidden; }
|
|
35
|
+
[data-sw-motion] [data-motion-hover="zoom"] :is(${ITEMS} > *, .sw-image):hover img, [data-sw-motion] [data-motion-hover="zoom"].sw-image:hover img { transform: scale(1.05); }
|
|
36
|
+
[data-sw-motion="expressive"] [data-motion-hover="tilt"] ${ITEMS} > *:hover { transform: perspective(800px) rotateX(2deg) rotateY(-3deg) translateY(-2px); }
|
|
37
|
+
/* On scroll: the page script writes --sw-scroll (0 as the block enters at the bottom, 1 as it leaves at the top); unset, every
|
|
38
|
+
effect sits at rest. Parallax moves a Hero's background slower than the page (half as far at the subtle level). */
|
|
39
|
+
[data-motion-scroll="parallax"] { --sw-parallax: 16%; }
|
|
40
|
+
[data-sw-motion="subtle"] [data-motion-scroll="parallax"] { --sw-parallax: 8%; }
|
|
41
|
+
[data-sw-motion] [data-motion-scroll="parallax"].sw-hero--image { overflow: hidden; }
|
|
42
|
+
[data-sw-motion] [data-motion-scroll="parallax"] .sw-hero__bg { transform: translateY(calc((var(--sw-scroll, 0.5) - 0.5) * var(--sw-parallax))) scale(1.18); will-change: transform; }
|
|
43
|
+
[data-sw-motion] [data-motion-scroll="parallax"].sw-hero--image:not(:has(.sw-hero__bg)) { background-position: center calc(50% + (var(--sw-scroll, 0.5) - 0.5) * var(--sw-parallax) * 4); }
|
|
44
|
+
[data-sw-motion] [data-motion-scroll="fade-out"] { opacity: clamp(0, calc((1 - var(--sw-scroll, 0)) / 0.35), 1); }
|
|
45
|
+
[data-sw-motion] [data-motion-scroll="pin"] { position: sticky; top: 0; z-index: 0; }
|
|
46
|
+
[data-sw-motion] [data-motion-scroll="pin"] ~ * { position: relative; z-index: 1; }
|
|
47
|
+
.sw-visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
|
|
48
|
+
.sw-hero { position: relative; }
|
|
49
|
+
.sw-video-toggle { position: absolute; right: var(--sw-space-3, 1rem); bottom: var(--sw-space-3, 1rem); z-index: 1; font: inherit; font-size: 0.8125rem; color: #ffffff; background: rgba(0, 0, 0, 0.55); border: 1px solid rgba(255, 255, 255, 0.6); border-radius: 999px; padding: 0.3rem 0.85rem; cursor: pointer; }
|
|
50
|
+
.sw-video-toggle:focus-visible { outline: 2px solid #ffffff; outline-offset: 2px; }
|
|
51
|
+
/* Marquee (Logo strip, Testimonials): the page script adds sw-marquee-on and copies the items (the copies are hidden from
|
|
52
|
+
assistive technology) so the row loops; items carry their spacing as a margin so moving by half is seamless. */
|
|
53
|
+
[data-motion-marquee]:not(.sw-marquee-on) [data-sw-marquee-clone] { display: none; }
|
|
54
|
+
.sw-marquee-on .sw-container { overflow: hidden; }
|
|
55
|
+
.sw-marquee-on :is(.sw-logos__list, .sw-testimonials__grid) { display: flex; flex-wrap: nowrap; justify-content: flex-start; gap: 0; width: max-content; animation: sw-marquee var(--sw-marquee-duration, 40s) linear infinite; }
|
|
56
|
+
.sw-marquee-on :is(.sw-logos__list, .sw-testimonials__grid) > * { flex: none; margin-inline-end: var(--sw-marquee-gap, var(--sw-space-4, 2rem)); }
|
|
57
|
+
.sw-testimonials.sw-marquee-on .sw-testimonials__grid > * { width: min(22rem, 80vw); --sw-marquee-gap: var(--sw-space-3, 1.5rem); }
|
|
58
|
+
.sw-marquee-on :is(.sw-logos__list, .sw-testimonials__grid):hover, .sw-marquee-on :is(.sw-logos__list, .sw-testimonials__grid):focus-within, .sw-marquee-paused :is(.sw-logos__list, .sw-testimonials__grid) { animation-play-state: paused; }
|
|
59
|
+
@keyframes sw-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
|
|
60
|
+
.sw-lottie-toggle { display: block; margin: var(--sw-space-1, 0.5rem) auto 0; font: inherit; font-size: 0.8125rem; color: inherit; background: none; border: 1px solid currentColor; border-radius: 999px; padding: 0.2rem 0.75rem; cursor: pointer; opacity: 0.85; }
|
|
61
|
+
.sw-lottie-toggle[hidden] { display: none; }
|
|
62
|
+
.sw-marquee-toggle { display: block; margin: 0 auto var(--sw-space-3, 1rem); font: inherit; font-size: 0.8125rem; color: inherit; background: none; border: 1px solid currentColor; border-radius: 999px; padding: 0.2rem 0.75rem; cursor: pointer; opacity: 0.85; }
|
|
63
|
+
.sw-marquee-toggle[hidden] { display: none; }
|
|
64
|
+
.sw-motion-switch { font: inherit; font-size: 0.8125rem; color: inherit; background: none; border: 1px solid currentColor; border-radius: 999px; padding: 0.2rem 0.75rem; cursor: pointer; opacity: 0.85; }
|
|
65
|
+
.sw-motion-switch[aria-pressed="true"] { background: var(--sw-color-text); color: var(--sw-color-bg); opacity: 1; }
|
|
66
|
+
.sw-reduce-motion *, .sw-reduce-motion *::before, .sw-reduce-motion *::after { transition: none !important; animation: none !important; }
|
|
67
|
+
.sw-reduce-motion [data-motion], .sw-reduce-motion [data-motion] *, .sw-reduce-motion [data-motion-scroll], .sw-reduce-motion [data-motion-scroll] * { opacity: 1 !important; transform: none !important; }
|
|
68
|
+
@media (prefers-reduced-motion: reduce) {
|
|
69
|
+
html:not(.sw-motion-allowed) :is([data-motion], [data-motion-scroll]), html:not(.sw-motion-allowed) :is([data-motion], [data-motion-scroll]) * { opacity: 1 !important; transform: none !important; transition: none !important; }
|
|
70
|
+
html:not(.sw-motion-allowed) .sw-marquee-on :is(.sw-logos__list, .sw-testimonials__grid) { animation: none !important; }
|
|
71
|
+
}
|
|
72
|
+
`;
|
|
73
|
+
/** The visitor's choice in local storage: "1" reduce, "0" allow; absent follows the operating system. */
|
|
74
|
+
export const MOTION_STORAGE_KEY = 'sw-reduce-motion';
|
|
75
|
+
/**
|
|
76
|
+
* The page's motion script (inline with the page's nonce, only on pages with motion). It applies the visitor's choice, wires the
|
|
77
|
+
* Reduce motion switch, and arms the entrances: blocks already on screen arrive at once, the rest when they scroll into view.
|
|
78
|
+
* Stagger numbers a block's items so each waits a little longer than the one before.
|
|
79
|
+
*/
|
|
80
|
+
export const MOTION_SCRIPT = `(function(){var d=document,h=d.documentElement,K=${JSON.stringify(MOTION_STORAGE_KEY)};
|
|
81
|
+
function stored(){try{return localStorage.getItem(K)}catch(e){return null}}
|
|
82
|
+
var sys=window.matchMedia?matchMedia('(prefers-reduced-motion: reduce)'):{matches:false};
|
|
83
|
+
function reduced(){var s=stored();return s===null?sys.matches:s==='1'}
|
|
84
|
+
function sync(){var r=reduced();h.classList.toggle('sw-reduce-motion',r);h.classList.toggle('sw-motion-allowed',!r);d.querySelectorAll('[data-sw-motion-switch]').forEach(function(b){b.setAttribute('aria-pressed',r?'true':'false')});return r}
|
|
85
|
+
function arrive(el){el.classList.add('sw-in')}
|
|
86
|
+
var videos=[].slice.call(d.querySelectorAll('[data-sw-bg-video]')),vio=null;
|
|
87
|
+
var saveData=!!(navigator.connection&&navigator.connection.saveData);
|
|
88
|
+
function videoAllowed(){return !reduced()&&!saveData&&h.hasAttribute('data-sw-motion')}
|
|
89
|
+
function toggleOf(v){var t=v.parentNode&&v.parentNode.querySelector('[data-sw-video-toggle]');return t}
|
|
90
|
+
function setVideos(){videos.forEach(function(v){var t=toggleOf(v);if(!videoAllowed()){v.pause();if(t)t.hidden=true;return}if(t)t.hidden=false})
|
|
91
|
+
if(videoAllowed()&&'IntersectionObserver' in window){if(!vio)vio=new IntersectionObserver(function(es){es.forEach(function(en){var v=en.target;if(en.isIntersecting&&videoAllowed()&&v.dataset.userPaused!=='1'){var p=v.play();if(p&&p.catch)p.catch(function(){})}else v.pause()})},{threshold:0.1});videos.forEach(function(v){vio.observe(v)})}else if(vio){videos.forEach(function(v){vio.unobserve(v)})}}
|
|
92
|
+
var marquees=[].slice.call(d.querySelectorAll('[data-motion-marquee]'));
|
|
93
|
+
function listOf(m){return m.querySelector('.sw-logos__list,.sw-testimonials__grid')}
|
|
94
|
+
function buildMarquee(m){var ul=listOf(m);if(!ul||m.dataset.marqueeBuilt)return;var items=[].slice.call(ul.children);if(!items.length)return;m.dataset.marqueeBuilt='1';
|
|
95
|
+
var box=(ul.parentNode&&ul.parentNode.clientWidth)||h.clientWidth,w=ul.scrollWidth||1,reps=Math.max(1,Math.min(8,Math.ceil(box/w))),n=reps*2;
|
|
96
|
+
for(var r=1;r<n;r++)items.forEach(function(it){var c=it.cloneNode(true);c.setAttribute('aria-hidden','true');c.setAttribute('data-sw-marquee-clone','');[].slice.call(c.querySelectorAll('a,button,[tabindex]')).forEach(function(a){a.setAttribute('tabindex','-1')});ul.appendChild(c)});
|
|
97
|
+
var per=m.getAttribute('data-motion-marquee')==='slow'?8:3;m.style.setProperty('--sw-marquee-duration',(per*items.length*reps)+'s')}
|
|
98
|
+
function setMarquees(){var ok=!reduced()&&h.hasAttribute('data-sw-motion');marquees.forEach(function(m){var t=m.querySelector('[data-sw-marquee-toggle]');if(!ok){m.classList.remove('sw-marquee-on');if(t)t.hidden=true;return}m.classList.add('sw-marquee-on');buildMarquee(m);if(t)t.hidden=false})}
|
|
99
|
+
var stories=[].slice.call(d.querySelectorAll('[data-motion-story]')),sio=null;
|
|
100
|
+
function stepsOf(s){return [].slice.call(s.querySelectorAll('li[data-story-step]'))}
|
|
101
|
+
function activate(s,i){var st=stepsOf(s),pic=+(st[i]&&st[i].getAttribute('data-story-image'));st.forEach(function(x,k){x.classList.toggle('sw-story-active',k===i)});[].slice.call(s.querySelectorAll('.sw-story__media img')).forEach(function(im){im.classList.toggle('sw-story-shown',+im.getAttribute('data-story-step')===pic)})}
|
|
102
|
+
function buildStory(s){var lay=s.querySelector('.sw-story__layout');if(!lay||s.dataset.storyBuilt)return;s.dataset.storyBuilt='1';var media=d.createElement('div');media.className='sw-story__media';media.setAttribute('aria-hidden','true');var first=-1,last=-1;
|
|
103
|
+
stepsOf(s).forEach(function(st,i){var im=st.querySelector('.sw-story__figure img');if(im){var c=d.createElement('img');c.src=im.currentSrc||im.getAttribute('src');c.alt='';c.loading='lazy';c.setAttribute('data-story-step',String(i));media.appendChild(c);last=i;if(first<0)first=i}st.setAttribute('data-story-image',String(last))});
|
|
104
|
+
stepsOf(s).forEach(function(st){if(st.getAttribute('data-story-image')==='-1')st.setAttribute('data-story-image',String(first))});
|
|
105
|
+
lay.insertBefore(media,lay.firstChild);activate(s,0)}
|
|
106
|
+
function setStories(){var ok=!reduced()&&h.hasAttribute('data-sw-motion')&&'IntersectionObserver' in window;if(ok&&!sio)sio=new IntersectionObserver(function(es){es.forEach(function(en){if(!en.isIntersecting)return;var s=en.target.closest('[data-motion-story]');if(s)activate(s,stepsOf(s).indexOf(en.target))})},{rootMargin:'-45% 0px -45% 0px'});
|
|
107
|
+
stories.forEach(function(s){if(ok){s.classList.add('sw-story-on');buildStory(s);stepsOf(s).forEach(function(st){sio.observe(st)})}else{s.classList.remove('sw-story-on');if(sio)stepsOf(s).forEach(function(st){sio.unobserve(st)})}})}
|
|
108
|
+
function loadPlayer(src,mod){return new Promise(function(ok,no){var s=d.createElement('script');if(mod)s.type='module';s.src=src;s.onload=ok;s.onerror=no;d.head.appendChild(s)})}
|
|
109
|
+
var lotties=[].slice.call(d.querySelectorAll('[data-sw-lottie]')),lottieP=null;
|
|
110
|
+
function lottieAllowed(){return !reduced()&&h.hasAttribute('data-sw-motion')}
|
|
111
|
+
function posterOf(f){return f.querySelector('.sw-lottie__poster')}
|
|
112
|
+
function startLottie(f){if(f._swStarted)return;f._swStarted=1;(lottieP=lottieP||loadPlayer('/_motion/lottie.js')).then(function(){if(!window.lottie)return;var a=window.lottie.loadAnimation({container:f.querySelector('.sw-lottie__stage'),renderer:'svg',loop:f.getAttribute('data-lottie-loop')==='true',autoplay:false,path:f.getAttribute('data-sw-lottie'),rendererSettings:{preserveAspectRatio:'xMidYMid meet'}});
|
|
113
|
+
a.addEventListener('DOMLoaded',function(){f._sw=a;if(a.animationData&&a.animationData.w&&a.animationData.h)f.style.setProperty('--sw-lottie-ratio',a.animationData.w+' / '+a.animationData.h);syncLottie(f)})}).catch(function(){})}
|
|
114
|
+
function syncLottie(f){var a=f._sw,t=f.querySelector('[data-sw-lottie-toggle]'),ok=lottieAllowed();if(t)t.hidden=!ok||!a;if(!a)return;
|
|
115
|
+
if(!ok){a.pause();if(posterOf(f))f.classList.remove('sw-lottie-ready');else{a.goToAndStop(Math.max(0,a.totalFrames-1),true);f.classList.add('sw-lottie-ready')}return}
|
|
116
|
+
f.classList.add('sw-lottie-ready');if(f._vis&&f.dataset.userPaused!=='1')a.play();else a.pause()}
|
|
117
|
+
function watchLotties(){if(!lotties.length)return;if(!('IntersectionObserver' in window)){lotties.forEach(function(f){f._vis=true;if(lottieAllowed()||!posterOf(f))startLottie(f)});return}
|
|
118
|
+
var lio=new IntersectionObserver(function(es){es.forEach(function(en){var f=en.target;f._vis=en.isIntersecting;if(en.isIntersecting&&(lottieAllowed()||!posterOf(f)))startLottie(f);syncLottie(f)})},{rootMargin:'200px 0px'});lotties.forEach(function(f){lio.observe(f)})}
|
|
119
|
+
function setLotties(){lotties.forEach(function(f){if(f._vis&&(lottieAllowed()||!posterOf(f)))startLottie(f);syncLottie(f)})}
|
|
120
|
+
var models=[].slice.call(d.querySelectorAll('[data-sw-model] model-viewer')),modelP=null;
|
|
121
|
+
function setModels(){var spin=!reduced()&&h.hasAttribute('data-sw-motion');models.forEach(function(m){if(spin&&m.hasAttribute('data-auto-rotate'))m.setAttribute('auto-rotate','');else m.removeAttribute('auto-rotate')})}
|
|
122
|
+
function watchModels(){if(!models.length)return;function go(){modelP=modelP||loadPlayer('/_motion/model-viewer.js',true).catch(function(){})}if(!('IntersectionObserver' in window)){go();return}
|
|
123
|
+
var mio=new IntersectionObserver(function(es){if(es.some(function(en){return en.isIntersecting})){mio.disconnect();go()}},{rootMargin:'400px 0px'});models.forEach(function(m){mio.observe(m)})}
|
|
124
|
+
var scenes=[].slice.call(d.querySelectorAll('[data-sw-scene]'));
|
|
125
|
+
function sceneOk(){return !reduced()&&!saveData&&h.hasAttribute('data-sw-motion')&&'IntersectionObserver' in window}
|
|
126
|
+
function scenePlaying(f){return sceneOk()&&!!f._vis&&f.dataset.userPaused!=='1'}
|
|
127
|
+
function themeOf(){var cs=getComputedStyle(h),o={};['primary','accent','text','bg','surface','muted','border'].forEach(function(k){var v=cs.getPropertyValue('--sw-color-'+k).trim();if(v)o[k]=v});return o}
|
|
128
|
+
function post(f,type,value){if(f._ready&&f._frame&&f._frame.contentWindow)f._frame.contentWindow.postMessage({sw:'scene',type:type,value:value},'*')}
|
|
129
|
+
function startScene(f){if(f._frame)return;var fr=d.createElement('iframe');fr.className='sw-scene__frame';fr.setAttribute('sandbox','allow-scripts');fr.setAttribute('title',f.getAttribute('data-scene-title')||'');if(!f.hasAttribute('data-scene-interactive')){fr.setAttribute('tabindex','-1');fr.setAttribute('aria-hidden','true')}fr.src=f.getAttribute('data-sw-scene');f._frame=fr;f.querySelector('.sw-scene__stage').appendChild(fr)}
|
|
130
|
+
function stopScene(f){if(f._frame){f._frame.remove();f._frame=null}f._ready=0;f.classList.remove('sw-scene-ready');var t=f.querySelector('[data-sw-scene-toggle]');if(t)t.hidden=true}
|
|
131
|
+
function syncScene(f){var t=f.querySelector('[data-sw-scene-toggle]');if(!sceneOk()){if(f._frame)stopScene(f);return}if(t)t.hidden=!f._ready;post(f,'playing',scenePlaying(f))}
|
|
132
|
+
window.addEventListener('message',function(e){var m=e.data;if(!m||m.sw!=='scene')return;scenes.forEach(function(f){if(!f._frame||e.source!==f._frame.contentWindow)return;
|
|
133
|
+
if(m.type==='loaded'){var props={};try{props=JSON.parse(f.getAttribute('data-scene-props')||'{}')}catch(x){}f._frame.contentWindow.postMessage({sw:'scene',type:'init',title:f.getAttribute('data-scene-title')||'',props:props,theme:themeOf(),progress:f._p||0,playing:scenePlaying(f),reducedMotion:reduced(),state:f._state||null},'*')}
|
|
134
|
+
else if(m.type==='ready'){f._ready=1;f.classList.add('sw-scene-ready');syncScene(f)}else if(m.type==='error'){f._failed=1;stopScene(f)}
|
|
135
|
+
else if(m.type==='navigate'&&typeof m.href==='string'){var href=m.href,local=href.charAt(0)==='/'&&href.charAt(1)!=='/';if((local||/^https?:/.test(href))&&(f.getAttribute('data-scene-props')||'').indexOf(JSON.stringify(href))>=0)location.assign(href)}})});
|
|
136
|
+
function watchScenes(){if(!scenes.length||!('IntersectionObserver' in window))return;var scio=new IntersectionObserver(function(es){es.forEach(function(en){var f=en.target;f._vis=en.isIntersecting;if(en.isIntersecting&&sceneOk()&&!f._failed)startScene(f);syncScene(f)})},{rootMargin:'300px 0px'});scenes.forEach(function(f){scio.observe(f)})}
|
|
137
|
+
function setScenes(){scenes.forEach(function(f){if(f._vis&&sceneOk()&&!f._failed)startScene(f);syncScene(f)})}
|
|
138
|
+
function fmt(el,v){var dec=+el.getAttribute('data-count-decimals')||0;var s=v.toFixed(dec);if(el.hasAttribute('data-count-group')){var p=s.split('.');p[0]=p[0].replace(/\B(?=(\d{3})+(?!\d))/g,',');s=p.join('.')}return (el.getAttribute('data-count-prefix')||'')+s+(el.getAttribute('data-count-suffix')||'')}
|
|
139
|
+
function count(block){[].slice.call(block.querySelectorAll('[data-count-to]')).forEach(function(el){var to=+el.getAttribute('data-count-to'),final=el.textContent,t0=0,dur=1200;el.textContent=fmt(el,0);function step(t){if(!t0)t0=t;var k=Math.min(1,(t-t0)/dur),e=1-Math.pow(1-k,3);el.textContent=k<1?fmt(el,to*e):final;if(k<1&&!reduced())requestAnimationFrame(step);else el.textContent=final}requestAnimationFrame(step)})}
|
|
140
|
+
d.addEventListener('click',function(e){var tg=e.target&&e.target.closest?e.target.closest('[data-sw-video-toggle]'):null;if(tg){var v=tg.parentNode.querySelector('[data-sw-bg-video]');if(!v)return;if(v.paused){v.dataset.userPaused='0';var p=v.play();if(p&&p.catch)p.catch(function(){});tg.setAttribute('aria-pressed','false');tg.textContent='Pause background video'}else{v.dataset.userPaused='1';v.pause();tg.setAttribute('aria-pressed','true');tg.textContent='Play background video'}return}
|
|
141
|
+
var stg=e.target&&e.target.closest?e.target.closest('[data-sw-scene-toggle]'):null;if(stg){var sf=stg.closest('[data-sw-scene]');if(!sf)return;var sp=sf.dataset.userPaused!=='1';sf.dataset.userPaused=sp?'1':'0';stg.setAttribute('aria-pressed',sp?'true':'false');stg.textContent=sp?'Play animation':'Pause animation';syncScene(sf);return}
|
|
142
|
+
var lt=e.target&&e.target.closest?e.target.closest('[data-sw-lottie-toggle]'):null;if(lt){var lf=lt.closest('[data-sw-lottie]');if(!lf)return;var lp=lf.dataset.userPaused!=='1';lf.dataset.userPaused=lp?'1':'0';lt.setAttribute('aria-pressed',lp?'true':'false');lt.textContent=lp?'Play animation':'Pause animation';syncLottie(lf);return}
|
|
143
|
+
var mt=e.target&&e.target.closest?e.target.closest('[data-sw-marquee-toggle]'):null;if(mt){var mq=mt.closest('[data-motion-marquee]');if(!mq)return;var paused=mq.classList.toggle('sw-marquee-paused');mt.setAttribute('aria-pressed',paused?'true':'false');mt.textContent=paused?'Play scrolling':'Pause scrolling';return}
|
|
144
|
+
var b=e.target&&e.target.closest?e.target.closest('[data-sw-motion-switch]'):null;if(!b)return;var next=!reduced();try{localStorage.setItem(K,next?'1':'0')}catch(err){}if(sync())d.querySelectorAll('[data-motion]').forEach(arrive);if(scrollers.length)onScroll();setVideos();setMarquees();setStories();setLotties();setModels();setScenes()});
|
|
145
|
+
var blocks=[].slice.call(d.querySelectorAll('[data-motion]'));
|
|
146
|
+
var scrollers=[].slice.call(d.querySelectorAll('[data-motion-scroll="parallax"],[data-motion-scroll="fade-out"],[data-sw-scene]')),ticking=false;
|
|
147
|
+
function measure(){ticking=false;var vh=window.innerHeight||h.clientHeight;scrollers.forEach(function(el){if(reduced()){el.style.removeProperty('--sw-scroll');return}var r=el.getBoundingClientRect();var p=Math.max(0,Math.min(1,(vh-r.top)/(vh+r.height)));if(el.hasAttribute('data-sw-scene')){el._p=p;post(el,'progress',p);return}el.style.setProperty('--sw-scroll',String(p.toFixed(3)))})}
|
|
148
|
+
function onScroll(){if(!ticking){ticking=true;requestAnimationFrame(measure)}}
|
|
149
|
+
if(scrollers.length){window.addEventListener('scroll',onScroll,{passive:true});window.addEventListener('resize',onScroll);measure()}
|
|
150
|
+
blocks.forEach(function(b){if(b.hasAttribute('data-motion-stagger'))[].slice.call(b.querySelectorAll(${JSON.stringify(ITEMS + ' > *')})).forEach(function(it,i){it.style.setProperty('--sw-motion-index',String(Math.min(i,12)))})});
|
|
151
|
+
setVideos();setMarquees();setStories();setModels();watchModels();watchLotties();watchScenes();
|
|
152
|
+
if(sync()||!h.hasAttribute('data-sw-motion')||!('IntersectionObserver' in window)){blocks.forEach(arrive);return}
|
|
153
|
+
var counters=[].slice.call(d.querySelectorAll('[data-motion-count]'));
|
|
154
|
+
var cio=new IntersectionObserver(function(es){es.forEach(function(en){if(en.isIntersecting){cio.unobserve(en.target);count(en.target)}})},{threshold:0.4});
|
|
155
|
+
counters.forEach(function(c){cio.observe(c)});
|
|
156
|
+
var vh=window.innerHeight||d.documentElement.clientHeight;
|
|
157
|
+
var io=new IntersectionObserver(function(es){es.forEach(function(en){if(en.isIntersecting){arrive(en.target);io.unobserve(en.target)}})},{rootMargin:'0px 0px -8% 0px'});
|
|
158
|
+
blocks.forEach(function(b){if(b.getBoundingClientRect().top<vh)arrive(b);else io.observe(b)});
|
|
159
|
+
h.classList.add('sw-motion-ready');
|
|
160
|
+
})();`;
|
|
161
|
+
//# sourceMappingURL=motion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"motion.js","sourceRoot":"","sources":["../src/motion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,8GAA8G;AAC9G,MAAM,KAAK,GAAG,qJAAqJ,CAAC;AAEpK,MAAM,CAAC,MAAM,UAAU,GAAG;;;;;;;;;;;;;4DAakC,KAAK;;;;;kEAKC,KAAK;sBACjD,KAAK;8CACmB,KAAK;iCAClB,KAAK;kDACY,KAAK;2DACI,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoC/D,CAAC;AAEF,yGAAyG;AACzG,MAAM,CAAC,MAAM,kBAAkB,GAAG,kBAAkB,CAAC;AAErD;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,oDAAoD,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uGAsEZ,IAAI,CAAC,SAAS,CAAC,KAAK,GAAG,MAAM,CAAC;;;;;;;;;;MAU/H,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ComponentConfig } from '@puckeditor/core';
|
|
2
|
+
/** A Lottie file the player reads: JSON from the media library or another URL. */
|
|
3
|
+
export declare const isLottieFile: (src: string | undefined) => boolean;
|
|
4
|
+
/** A model file <model-viewer> reads. */
|
|
5
|
+
export declare const isModelFile: (src: string | undefined) => boolean;
|
|
6
|
+
export interface LottieProps {
|
|
7
|
+
src: string;
|
|
8
|
+
/** Shown while the player loads and to visitors who see no motion. */
|
|
9
|
+
poster: string;
|
|
10
|
+
/** What the animation shows, for screen readers; empty when it is decoration. */
|
|
11
|
+
alt: string;
|
|
12
|
+
loop: boolean;
|
|
13
|
+
size: 's' | 'm' | 'l';
|
|
14
|
+
caption: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const lottieComponent: ComponentConfig<LottieProps>;
|
|
17
|
+
export interface Model3DProps {
|
|
18
|
+
src: string;
|
|
19
|
+
/** Required: what the model is, for screen readers and search engines. */
|
|
20
|
+
alt: string;
|
|
21
|
+
/** Shown until the model loads, and without JavaScript. */
|
|
22
|
+
poster: string;
|
|
23
|
+
autoRotate: boolean;
|
|
24
|
+
/** "View in your space" on phones that support it. */
|
|
25
|
+
ar: boolean;
|
|
26
|
+
height: 's' | 'm' | 'l';
|
|
27
|
+
caption: string;
|
|
28
|
+
}
|
|
29
|
+
export declare const model3dComponent: ComponentConfig<Model3DProps>;
|
|
30
|
+
export declare const PLAYERS_CSS = "\n/* Lottie: the poster until the player has drawn the first frame (sw-lottie-ready), then the animation's own SVG. */\n.sw-lottie { margin-inline: auto; text-align: center; }\n.sw-lottie--s { max-width: 240px; }\n.sw-lottie--m { max-width: 480px; }\n.sw-lottie--l { max-width: 720px; }\n.sw-lottie__stage { position: relative; }\n.sw-lottie:not(:has(.sw-lottie__poster)) .sw-lottie__stage { aspect-ratio: var(--sw-lottie-ratio, 1); }\n.sw-lottie__poster { display: block; width: 100%; height: auto; }\n.sw-lottie__stage > svg { position: absolute; inset: 0; }\n.sw-lottie:not(.sw-lottie-ready) .sw-lottie__stage > svg, .sw-lottie-ready .sw-lottie__poster { visibility: hidden; }\n.sw-lottie__caption, .sw-model__caption { margin-top: var(--sw-space-1, 0.5rem); font-size: 0.875rem; color: var(--sw-color-muted); text-align: center; }\n/* 3D model: the viewer fills the figure; its poster shows until the model loads, and without JavaScript. */\n.sw-model { margin-inline: auto; }\n.sw-model__viewer, .sw-model > .sw-model__poster { display: block; width: 100%; height: var(--sw-model-height, 420px); background: var(--sw-color-surface, transparent); border-radius: var(--sw-radius, 8px); }\n.sw-model__poster { object-fit: contain; }\n.sw-model--s { --sw-model-height: 280px; }\n.sw-model--l { --sw-model-height: 600px; }\n@media (max-width: 640px) { .sw-model--l { --sw-model-height: 420px; } }\nmodel-viewer:not(:defined) > .sw-model__poster { display: block; width: 100%; height: 100%; object-fit: contain; }\n";
|