use-scroll-animate 4.9.0 → 5.0.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 +19 -0
- package/README.md +2 -1
- package/README_ja.md +1 -0
- package/README_zh.md +2 -1
- package/dist/chunks/{base-BvpQ4Ggj.cjs → base-B5i8qQPR.cjs} +46 -40
- package/dist/chunks/base-B5i8qQPR.cjs.map +1 -0
- package/dist/chunks/{base-DbbRUxaa.js → base-C3Sw9sAO.js} +46 -41
- package/dist/chunks/base-C3Sw9sAO.js.map +1 -0
- package/dist/chunks/{core-BWO7JKJ5.cjs → core-BDcszY4L.cjs} +2 -2
- package/dist/chunks/{core-BWO7JKJ5.cjs.map → core-BDcszY4L.cjs.map} +1 -1
- package/dist/chunks/{core-CcaSsbV8.js → core-BTf__I-8.js} +2 -2
- package/dist/chunks/{core-CcaSsbV8.js.map → core-BTf__I-8.js.map} +1 -1
- package/dist/chunks/{core-CCAM3nKw.cjs → core-BjOYKSrV.cjs} +2 -2
- package/dist/chunks/{core-CCAM3nKw.cjs.map → core-BjOYKSrV.cjs.map} +1 -1
- package/dist/chunks/{core-BVTuet9o.js → core-DN3hHbHh.js} +2 -2
- package/dist/chunks/{core-BVTuet9o.js.map → core-DN3hHbHh.js.map} +1 -1
- package/dist/chunks/fx-B8hk1Fby.cjs +114 -0
- package/dist/chunks/fx-B8hk1Fby.cjs.map +1 -0
- package/dist/chunks/fx-ChjxrMBo.js +109 -0
- package/dist/chunks/fx-ChjxrMBo.js.map +1 -0
- package/dist/chunks/{index-tags-Dh8nwXqw.js → index-tags-DucKMQr_.js} +2 -1
- package/dist/chunks/{index-tags-Dh8nwXqw.js.map → index-tags-DucKMQr_.js.map} +1 -1
- package/dist/chunks/{index-tags-CIRY2KnU.cjs → index-tags-wv0R_vkO.cjs} +2 -1
- package/dist/chunks/{index-tags-CIRY2KnU.cjs.map → index-tags-wv0R_vkO.cjs.map} +1 -1
- package/dist/chunks/{spring-fFkqE9J0.cjs → spring--oZh55tB.cjs} +2 -2
- package/dist/chunks/{spring-fFkqE9J0.cjs.map → spring--oZh55tB.cjs.map} +1 -1
- package/dist/chunks/{spring-B6w7mVCU.js → spring-CckMe3x0.js} +2 -2
- package/dist/chunks/{spring-B6w7mVCU.js.map → spring-CckMe3x0.js.map} +1 -1
- package/dist/chunks/{variants-Cal4DB0E.js → variants-Bsevy6Xm.js} +2 -2
- package/dist/chunks/{variants-Cal4DB0E.js.map → variants-Bsevy6Xm.js.map} +1 -1
- package/dist/chunks/{variants-C8xj8gfd.cjs → variants-DxPmgrNX.cjs} +2 -2
- package/dist/chunks/{variants-C8xj8gfd.cjs.map → variants-DxPmgrNX.cjs.map} +1 -1
- package/dist/components/a11y.cjs +3 -2
- package/dist/components/a11y.cjs.map +1 -1
- package/dist/components/a11y.d.cts +1 -0
- package/dist/components/a11y.d.ts +1 -0
- package/dist/components/a11y.js +4 -3
- package/dist/components/a11y.js.map +1 -1
- package/dist/components/angular.cjs +8 -6
- package/dist/components/angular.cjs.map +1 -1
- package/dist/components/angular.d.cts +33 -4
- package/dist/components/angular.d.ts +33 -4
- package/dist/components/angular.js +8 -6
- package/dist/components/angular.js.map +1 -1
- package/dist/components/background.cjs +2 -4
- package/dist/components/background.cjs.map +1 -1
- package/dist/components/background.d.cts +2 -47
- package/dist/components/background.d.ts +2 -47
- package/dist/components/background.js +3 -4
- package/dist/components/background.js.map +1 -1
- package/dist/components/bridge.cjs +1 -1
- package/dist/components/bridge.js +1 -1
- package/dist/components/cards.cjs +2 -4
- package/dist/components/cards.cjs.map +1 -1
- package/dist/components/cards.d.cts +2 -47
- package/dist/components/cards.d.ts +2 -47
- package/dist/components/cards.js +2 -3
- package/dist/components/cards.js.map +1 -1
- package/dist/components/click.cjs +24 -130
- package/dist/components/click.cjs.map +1 -1
- package/dist/components/click.d.cts +2 -47
- package/dist/components/click.d.ts +2 -47
- package/dist/components/click.js +4 -109
- package/dist/components/click.js.map +1 -1
- package/dist/components/depth.cjs +3 -5
- package/dist/components/depth.cjs.map +1 -1
- package/dist/components/depth.d.cts +2 -47
- package/dist/components/depth.d.ts +2 -47
- package/dist/components/depth.js +3 -4
- package/dist/components/depth.js.map +1 -1
- package/dist/components/feedback.cjs +1 -3
- package/dist/components/feedback.cjs.map +1 -1
- package/dist/components/feedback.d.cts +2 -47
- package/dist/components/feedback.d.ts +2 -47
- package/dist/components/feedback.js +1 -2
- package/dist/components/feedback.js.map +1 -1
- package/dist/components/fx.cjs +285 -0
- package/dist/components/fx.cjs.map +1 -0
- package/dist/components/fx.css +3 -0
- package/dist/components/fx.d.cts +114 -0
- package/dist/components/fx.d.ts +114 -0
- package/dist/components/fx.js +271 -0
- package/dist/components/fx.js.map +1 -0
- package/dist/components/gesture.cjs +3 -5
- package/dist/components/gesture.cjs.map +1 -1
- package/dist/components/gesture.d.cts +2 -47
- package/dist/components/gesture.d.ts +2 -47
- package/dist/components/gesture.js +4 -5
- package/dist/components/gesture.js.map +1 -1
- package/dist/components/interaction.cjs +1 -3
- package/dist/components/interaction.cjs.map +1 -1
- package/dist/components/interaction.d.cts +2 -47
- package/dist/components/interaction.d.ts +2 -47
- package/dist/components/interaction.js +1 -2
- package/dist/components/interaction.js.map +1 -1
- package/dist/components/jsx.d.cts +1 -0
- package/dist/components/jsx.d.ts +1 -0
- package/dist/components/layout.cjs +1 -3
- package/dist/components/layout.cjs.map +1 -1
- package/dist/components/layout.d.cts +2 -47
- package/dist/components/layout.d.ts +2 -47
- package/dist/components/layout.js +2 -3
- package/dist/components/layout.js.map +1 -1
- package/dist/components/lazy.cjs +2 -1
- package/dist/components/lazy.cjs.map +1 -1
- package/dist/components/lazy.d.cts +1 -0
- package/dist/components/lazy.d.ts +1 -0
- package/dist/components/lazy.js +2 -1
- package/dist/components/lazy.js.map +1 -1
- package/dist/components/lite.cjs +362 -64
- package/dist/components/lite.cjs.map +1 -1
- package/dist/components/lite.js +345 -65
- package/dist/components/lite.js.map +1 -1
- package/dist/components/packs.cjs +1 -3
- package/dist/components/packs.cjs.map +1 -1
- package/dist/components/packs.d.cts +2 -47
- package/dist/components/packs.d.ts +2 -47
- package/dist/components/packs.js +2 -3
- package/dist/components/packs.js.map +1 -1
- package/dist/components/page.cjs +33 -22
- package/dist/components/page.cjs.map +1 -1
- package/dist/components/page.d.cts +15 -52
- package/dist/components/page.d.ts +15 -52
- package/dist/components/page.js +33 -22
- package/dist/components/page.js.map +1 -1
- package/dist/components/perf.cjs +3 -4
- package/dist/components/perf.cjs.map +1 -1
- package/dist/components/perf.d.cts +1 -0
- package/dist/components/perf.d.ts +1 -0
- package/dist/components/perf.js +4 -5
- package/dist/components/perf.js.map +1 -1
- package/dist/components/physics.cjs +2 -4
- package/dist/components/physics.cjs.map +1 -1
- package/dist/components/physics.d.cts +2 -47
- package/dist/components/physics.d.ts +2 -47
- package/dist/components/physics.js +3 -4
- package/dist/components/physics.js.map +1 -1
- package/dist/components/react.cjs +1 -1
- package/dist/components/react.js +1 -1
- package/dist/components/reveal.cjs +1 -3
- package/dist/components/reveal.cjs.map +1 -1
- package/dist/components/reveal.d.cts +2 -47
- package/dist/components/reveal.d.ts +2 -47
- package/dist/components/reveal.js +1 -2
- package/dist/components/reveal.js.map +1 -1
- package/dist/components/solid.cjs +8 -6
- package/dist/components/solid.cjs.map +1 -1
- package/dist/components/solid.d.cts +33 -4
- package/dist/components/solid.d.ts +33 -4
- package/dist/components/solid.js +8 -6
- package/dist/components/solid.js.map +1 -1
- package/dist/components/svelte.cjs +8 -6
- package/dist/components/svelte.cjs.map +1 -1
- package/dist/components/svelte.d.cts +33 -4
- package/dist/components/svelte.d.ts +33 -4
- package/dist/components/svelte.js +8 -6
- package/dist/components/svelte.js.map +1 -1
- package/dist/components/svg.cjs +1 -3
- package/dist/components/svg.cjs.map +1 -1
- package/dist/components/svg.d.cts +2 -47
- package/dist/components/svg.d.ts +2 -47
- package/dist/components/svg.js +2 -3
- package/dist/components/svg.js.map +1 -1
- package/dist/components/text.cjs +2 -4
- package/dist/components/text.cjs.map +1 -1
- package/dist/components/text.d.cts +2 -47
- package/dist/components/text.d.ts +2 -47
- package/dist/components/text.js +2 -3
- package/dist/components/text.js.map +1 -1
- package/dist/components/timeline.cjs +3 -7
- package/dist/components/timeline.cjs.map +1 -1
- package/dist/components/timeline.d.cts +4 -49
- package/dist/components/timeline.d.ts +4 -49
- package/dist/components/timeline.js +4 -7
- package/dist/components/timeline.js.map +1 -1
- package/dist/components/transitions.cjs +1 -3
- package/dist/components/transitions.cjs.map +1 -1
- package/dist/components/transitions.d.cts +2 -47
- package/dist/components/transitions.d.ts +2 -47
- package/dist/components/transitions.js +2 -3
- package/dist/components/transitions.js.map +1 -1
- package/dist/components/ui.cjs +3 -5
- package/dist/components/ui.cjs.map +1 -1
- package/dist/components/ui.d.cts +2 -47
- package/dist/components/ui.d.ts +2 -47
- package/dist/components/ui.js +4 -5
- package/dist/components/ui.js.map +1 -1
- package/dist/components/vue.cjs +8 -6
- package/dist/components/vue.cjs.map +1 -1
- package/dist/components/vue.d.cts +33 -4
- package/dist/components/vue.d.ts +33 -4
- package/dist/components/vue.js +8 -6
- package/dist/components/vue.js.map +1 -1
- package/dist/components/webgl.cjs +3 -5
- package/dist/components/webgl.cjs.map +1 -1
- package/dist/components/webgl.d.cts +2 -47
- package/dist/components/webgl.d.ts +2 -47
- package/dist/components/webgl.js +3 -4
- package/dist/components/webgl.js.map +1 -1
- package/dist/components.cjs +31 -10
- package/dist/components.cjs.map +1 -1
- package/dist/components.css +1 -0
- package/dist/components.d.cts +137 -17
- package/dist/components.d.ts +137 -17
- package/dist/components.js +15 -11
- package/dist/components.js.map +1 -1
- package/dist/components.umd.js +2 -2
- package/dist/components.umd.js.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +2 -2
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/docs/API.md +1 -1
- package/docs/ROADMAP.md +12 -12
- package/docs/components.md +14 -1
- package/docs/performance.md +1 -1
- package/docs/upgrading-5.md +2 -2
- package/package.json +14 -3
- package/dist/chunks/base-BvpQ4Ggj.cjs.map +0 -1
- package/dist/chunks/base-DbbRUxaa.js.map +0 -1
|
@@ -1,48 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* use-scroll-animate/components — shared base for the `<usa-*>` custom elements.
|
|
3
|
-
*
|
|
4
|
-
* Everything here is lazy: nothing touches `window`, `document`,
|
|
5
|
-
* `HTMLElement` or `matchMedia` at import time, so the components can be
|
|
6
|
-
* imported during SSR (Next, Nuxt, Astro…) and in Electron/Tauri preload
|
|
7
|
-
* scripts. Classes are created the first time a `define*()` function runs.
|
|
8
|
-
*/
|
|
9
|
-
interface ComponentsConfig {
|
|
10
|
-
/**
|
|
11
|
-
* Inject each component's CSS when it is defined (default `true`). Uses a
|
|
12
|
-
* constructable stylesheet (`document.adoptedStyleSheets`, which a strict
|
|
13
|
-
* `style-src` CSP does not block) and falls back to a `<style>` tag. Set
|
|
14
|
-
* to `false` when you load `use-scroll-animate/components.css` yourself.
|
|
15
|
-
*/
|
|
16
|
-
injectStyles?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* `'user'` (default) follows `prefers-reduced-motion`; `'reduce'` always
|
|
19
|
-
* uses the reduced variants (e.g. a kiosk / battery-saver mode);
|
|
20
|
-
* `'no-preference'` ignores the OS setting (only for demos — respect your users).
|
|
21
|
-
*/
|
|
22
|
-
reducedMotion?: 'user' | 'reduce' | 'no-preference';
|
|
23
|
-
/**
|
|
24
|
-
* Global motion intensity (v2.7): `'off'` (same as reduced motion),
|
|
25
|
-
* `'low'` (shorter, calmer), `'normal'` (default) or `'high'`. Scales every
|
|
26
|
-
* component animation's duration and sets `--usa-motion` (0 / 0.6 / 1 /
|
|
27
|
-
* 1.25) on `<html>` for your own CSS. See `setMotionIntensity()`.
|
|
28
|
-
*/
|
|
29
|
-
motionIntensity?: MotionIntensity;
|
|
30
|
-
/**
|
|
31
|
-
* Motion-sensitivity level (v4.4), finer than reduced motion:
|
|
32
|
-
* `'full'` (default) · `'gentle'` (no spins, zooms, skews or parallax —
|
|
33
|
-
* translations and fades only, safe for vestibular disorders) ·
|
|
34
|
-
* `'minimal'` (fades only; components use their reduced-motion variants) ·
|
|
35
|
-
* `'static'` (no animation: every component shows its static alternative).
|
|
36
|
-
* See `setMotionSensitivity()` in `use-scroll-animate/components/a11y`.
|
|
37
|
-
*/
|
|
38
|
-
motionSensitivity?: MotionSensitivity;
|
|
39
|
-
}
|
|
40
|
-
type MotionSensitivity = 'full' | 'gentle' | 'minimal' | 'static';
|
|
41
|
-
type MotionIntensity = 'off' | 'low' | 'normal' | 'high';
|
|
42
|
-
/** Change global component settings (call before `define*()` for `injectStyles`). */
|
|
43
|
-
declare function configureComponents(options: ComponentsConfig): void;
|
|
44
|
-
/** `true` when animations should be reduced (OS setting or `configureComponents`). */
|
|
45
|
-
declare function prefersReducedMotion(): boolean;
|
|
46
1
|
/**
|
|
47
2
|
* Members shared by every `<usa-*>` element. Attribute helpers, a cleanup
|
|
48
3
|
* bag that is emptied on disconnect, and motion helpers that degrade to the
|
|
@@ -156,5 +111,5 @@ declare global {
|
|
|
156
111
|
}
|
|
157
112
|
}
|
|
158
113
|
|
|
159
|
-
export { CARD_EFFECTS,
|
|
160
|
-
export type { CardEffect,
|
|
114
|
+
export { CARD_EFFECTS, defineCard, defineCardComponents, defineCardStack, defineCarousel3d, defineStickyStack };
|
|
115
|
+
export type { CardEffect, UsaCardElement, UsaCardStackElement, UsaCarousel3dElement, UsaStickyStackElement };
|
|
@@ -1,48 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* use-scroll-animate/components — shared base for the `<usa-*>` custom elements.
|
|
3
|
-
*
|
|
4
|
-
* Everything here is lazy: nothing touches `window`, `document`,
|
|
5
|
-
* `HTMLElement` or `matchMedia` at import time, so the components can be
|
|
6
|
-
* imported during SSR (Next, Nuxt, Astro…) and in Electron/Tauri preload
|
|
7
|
-
* scripts. Classes are created the first time a `define*()` function runs.
|
|
8
|
-
*/
|
|
9
|
-
interface ComponentsConfig {
|
|
10
|
-
/**
|
|
11
|
-
* Inject each component's CSS when it is defined (default `true`). Uses a
|
|
12
|
-
* constructable stylesheet (`document.adoptedStyleSheets`, which a strict
|
|
13
|
-
* `style-src` CSP does not block) and falls back to a `<style>` tag. Set
|
|
14
|
-
* to `false` when you load `use-scroll-animate/components.css` yourself.
|
|
15
|
-
*/
|
|
16
|
-
injectStyles?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* `'user'` (default) follows `prefers-reduced-motion`; `'reduce'` always
|
|
19
|
-
* uses the reduced variants (e.g. a kiosk / battery-saver mode);
|
|
20
|
-
* `'no-preference'` ignores the OS setting (only for demos — respect your users).
|
|
21
|
-
*/
|
|
22
|
-
reducedMotion?: 'user' | 'reduce' | 'no-preference';
|
|
23
|
-
/**
|
|
24
|
-
* Global motion intensity (v2.7): `'off'` (same as reduced motion),
|
|
25
|
-
* `'low'` (shorter, calmer), `'normal'` (default) or `'high'`. Scales every
|
|
26
|
-
* component animation's duration and sets `--usa-motion` (0 / 0.6 / 1 /
|
|
27
|
-
* 1.25) on `<html>` for your own CSS. See `setMotionIntensity()`.
|
|
28
|
-
*/
|
|
29
|
-
motionIntensity?: MotionIntensity;
|
|
30
|
-
/**
|
|
31
|
-
* Motion-sensitivity level (v4.4), finer than reduced motion:
|
|
32
|
-
* `'full'` (default) · `'gentle'` (no spins, zooms, skews or parallax —
|
|
33
|
-
* translations and fades only, safe for vestibular disorders) ·
|
|
34
|
-
* `'minimal'` (fades only; components use their reduced-motion variants) ·
|
|
35
|
-
* `'static'` (no animation: every component shows its static alternative).
|
|
36
|
-
* See `setMotionSensitivity()` in `use-scroll-animate/components/a11y`.
|
|
37
|
-
*/
|
|
38
|
-
motionSensitivity?: MotionSensitivity;
|
|
39
|
-
}
|
|
40
|
-
type MotionSensitivity = 'full' | 'gentle' | 'minimal' | 'static';
|
|
41
|
-
type MotionIntensity = 'off' | 'low' | 'normal' | 'high';
|
|
42
|
-
/** Change global component settings (call before `define*()` for `injectStyles`). */
|
|
43
|
-
declare function configureComponents(options: ComponentsConfig): void;
|
|
44
|
-
/** `true` when animations should be reduced (OS setting or `configureComponents`). */
|
|
45
|
-
declare function prefersReducedMotion(): boolean;
|
|
46
1
|
/**
|
|
47
2
|
* Members shared by every `<usa-*>` element. Attribute helpers, a cleanup
|
|
48
3
|
* bag that is emptied on disconnect, and motion helpers that degrade to the
|
|
@@ -156,5 +111,5 @@ declare global {
|
|
|
156
111
|
}
|
|
157
112
|
}
|
|
158
113
|
|
|
159
|
-
export { CARD_EFFECTS,
|
|
160
|
-
export type { CardEffect,
|
|
114
|
+
export { CARD_EFFECTS, defineCard, defineCardComponents, defineCardStack, defineCarousel3d, defineStickyStack };
|
|
115
|
+
export type { CardEffect, UsaCardElement, UsaCardStackElement, UsaCarousel3dElement, UsaStickyStackElement };
|
package/dist/components/cards.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { d as springEasing, c as createSpring } from '../chunks/spring-B6w7mVCU.js';
|
|
1
|
+
import { x as defineElement, r as raf, q as caf, y as EASE_OUT, k as clamp } from '../chunks/base-C3Sw9sAO.js';
|
|
2
|
+
import { d as springEasing, c as createSpring } from '../chunks/spring-CckMe3x0.js';
|
|
4
3
|
|
|
5
4
|
var css$3 = "usa-card{--usa-card-radius:18px;--usa-card-bg:var(--usa-surface,#1b1e27);--usa-card-glow:var(--usa-accent,#7c5cff);--usa-card-x:50%;--usa-card-y:50%;--usa-card-nx:0;--usa-card-ny:0;position:relative;display:block;border-radius:var(--usa-card-radius);isolation:isolate;-webkit-tap-highlight-color:transparent}usa-card:focus-visible{outline:2px solid var(--usa-card-glow);outline-offset:3px}usa-card[effect~=\"lift\"]{transition:transform 0.45s cubic-bezier(0.34,1.56,0.64,1),box-shadow 0.45s ease}usa-card[effect~=\"lift\"][data-hover],usa-card[effect~=\"lift\"]:focus-visible{transform:translateY(-6px) perspective(900px) rotateX(calc(var(--usa-card-ny) * -4deg)) rotateY(calc(var(--usa-card-nx) * 4deg));box-shadow:0 22px 44px -18px rgb(0 0 0 / 0.55)}usa-card[effect~=\"glass\"]{background:color-mix(in srgb,var(--usa-card-bg) 45%,transparent);border:1px solid rgb(255 255 255 / 0.16);-webkit-backdrop-filter:blur(18px) saturate(1.5);backdrop-filter:blur(18px) saturate(1.5)}usa-card[effect~=\"spotlight\"]::before,usa-card[effect~=\"border-glow\"]::after{content:\"\";position:absolute;inset:0;border-radius:inherit;pointer-events:none;opacity:0;transition:opacity 0.3s ease}usa-card[effect~=\"spotlight\"]::before{z-index:-1;background:radial-gradient(260px circle at var(--usa-card-x) var(--usa-card-y),color-mix(in srgb,var(--usa-card-glow) 28%,transparent),transparent 70%)}usa-card[effect~=\"border-glow\"]::after{padding:1.5px;background:radial-gradient(180px circle at var(--usa-card-x) var(--usa-card-y),var(--usa-card-glow),transparent 70%);-webkit-mask:linear-gradient(#000 0 0) content-box exclude,linear-gradient(#000 0 0);mask:linear-gradient(#000 0 0) content-box exclude,linear-gradient(#000 0 0)}usa-card[data-hover]::before,usa-card[data-hover]::after{opacity:1}@property --usa-card-angle{syntax:\"<angle>\";inherits:false;initial-value:0deg}usa-card[effect~=\"conic-border\"]{border:2px solid transparent;background:linear-gradient(var(--usa-card-bg),var(--usa-card-bg)) padding-box,conic-gradient(from var(--usa-card-angle),var(--usa-card-glow),#22d3ee,#f472b6,var(--usa-card-glow)) border-box;animation:usa-card-spin 4s linear infinite}@keyframes usa-card-spin{to{--usa-card-angle:360deg}}usa-card .usa-card-sheen{position:absolute;inset:0;border-radius:inherit;overflow:hidden;pointer-events:none}usa-card .usa-card-sheen::before{content:\"\";position:absolute;top:0;bottom:0;width:45%;left:-60%;transform:skewX(-20deg);background:linear-gradient(90deg,transparent,rgb(255 255 255 / 0.35),transparent)}usa-card[effect~=\"sheen\"]:hover .usa-card-sheen::before,usa-card[effect~=\"sheen\"]:focus-visible .usa-card-sheen::before{left:130%;transition:left 0.8s cubic-bezier(0.22,1,0.36,1)}usa-card .usa-card-holo{position:absolute;inset:0;border-radius:inherit;pointer-events:none;mix-blend-mode:color-dodge;opacity:0.35;background:linear-gradient(115deg,transparent 20%,#ff7ad9 35%,#7af0ff 45%,#ffe27a 55%,transparent 70%) calc(var(--usa-card-x) * 1.4 - 20%) calc(var(--usa-card-y) * 1.4 - 20%) / 220% 220%;transition:opacity 0.3s ease}usa-card[data-hover] .usa-card-holo{opacity:0.7}usa-card[effect~=\"parallax-layers\"] [data-depth]{transition:transform 0.25s ease-out;will-change:transform}usa-card[effect~=\"flip\"]{perspective:1000px;display:grid}usa-card[effect~=\"flip\"]>[data-front],usa-card[effect~=\"flip\"]>[data-back]{grid-area:1 / 1;backface-visibility:hidden;-webkit-backface-visibility:hidden;border-radius:inherit;transition:transform 0.7s cubic-bezier(0.34,1.3,0.64,1),opacity 0.3s ease}usa-card[effect~=\"flip\"]>[data-back]{transform:rotateY(180deg)}usa-card[effect~=\"flip\"][axis=\"x\"]>[data-back]{transform:rotateX(180deg)}usa-card[effect~=\"flip\"][flipped]>[data-front],usa-card[effect~=\"flip\"]:not([trigger=\"click\"]):hover>[data-front]{transform:rotateY(-180deg)}usa-card[effect~=\"flip\"][flipped]>[data-back],usa-card[effect~=\"flip\"]:not([trigger=\"click\"]):hover>[data-back]{transform:rotateY(0deg)}usa-card[effect~=\"flip\"][axis=\"x\"][flipped]>[data-front],usa-card[effect~=\"flip\"][axis=\"x\"]:not([trigger=\"click\"]):hover>[data-front]{transform:rotateX(180deg)}usa-card[effect~=\"flip\"][axis=\"x\"][flipped]>[data-back],usa-card[effect~=\"flip\"][axis=\"x\"]:not([trigger=\"click\"]):hover>[data-back]{transform:rotateX(0deg)}usa-card[effect~=\"flip\"][trigger=\"click\"]{cursor:pointer}usa-card[effect~=\"expand\"]{cursor:zoom-in}usa-card[effect~=\"expand\"]:not([expanded]) [data-detail]{display:none}usa-card[expanded]{position:fixed;inset:6vh max(4vw,calc(50vw - 420px));z-index:1000;overflow:auto;cursor:default;background:var(--usa-card-bg);box-shadow:0 30px 80px -20px rgb(0 0 0 / 0.6)}.usa-card-backdrop{position:fixed;inset:0;z-index:999;background:rgb(0 0 0 / 0.45)}@media (prefers-reduced-motion:reduce){usa-card,usa-card *,usa-card .usa-card-sheen::before{transition-duration:0.01ms !important;animation:none !important}usa-card[effect~=\"lift\"][data-hover]{transform:none}usa-card[effect~=\"flip\"]>[data-front],usa-card[effect~=\"flip\"]>[data-back]{transform:none !important}usa-card[effect~=\"flip\"][flipped]>[data-front],usa-card[effect~=\"flip\"]:not([flipped])>[data-back]{opacity:0;visibility:hidden}usa-card[effect~=\"flip\"]:not([trigger=\"click\"]):hover>[data-front]{opacity:0;visibility:hidden}usa-card[effect~=\"flip\"]:not([trigger=\"click\"]):hover>[data-back]{opacity:1;visibility:visible}}@media (prefers-reduced-transparency:reduce),(forced-colors:active){usa-card[effect~=\"glass\"]{background:var(--usa-card-bg);-webkit-backdrop-filter:none;backdrop-filter:none}}";
|
|
6
5
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cards.js","sources":["../../src/components/cards/card.ts","../../src/components/cards/card-stack.ts","../../src/components/cards/sticky-stack.ts","../../src/components/cards/carousel-3d.ts","../../src/components/cards/index.ts"],"sourcesContent":["import { defineElement, raf, caf, clamp, EASE_OUT, type UsaElement } from '../base';\nimport { springEasing } from '../physics/spring';\nimport css from './card.css?raw';\n\nexport const CARD_EFFECTS = ['flip', 'holo', 'glass', 'border-glow', 'conic-border', 'lift', 'spotlight', 'sheen', 'parallax-layers', 'expand'] as const;\nexport type CardEffect = (typeof CARD_EFFECTS)[number];\n\n/** Effects that follow the pointer (they share one rAF-throttled tracker). */\nconst TRACKING = new Set(['holo', 'border-glow', 'spotlight', 'parallax-layers', 'lift']);\n\n/**\n * `<usa-card>` — card effects, combinable: `effect=\"lift sheen\"`.\n *\n * - `flip` — front/back (`[data-front]` / `[data-back]` children) flip on\n * hover or `trigger=\"click\"`, `axis=\"y\"` (default, horizontal flip) or `x`.\n * - `holo` — holographic foil that shifts with the pointer.\n * - `glass` — frosted glass surface (backdrop blur).\n * - `border-glow` — a glow on the border that follows the pointer.\n * - `conic-border` — a rotating conic-gradient border.\n * - `lift` — rises with a deeper shadow and a slight pointer tilt.\n * - `spotlight` — a soft light that follows the pointer.\n * - `sheen` — a light sweep across the card on hover / focus.\n * - `parallax-layers` — children with `data-depth=\"0.2…1\"` move at different depths.\n * - `expand` — click to grow into a full detail view (`[data-detail]`\n * content is shown), FLIP + spring; Esc, `[data-close]` or the backdrop closes.\n *\n * Attributes: `effect`, `axis`, `trigger`, `depth` (parallax px, 16),\n * `color` (glow / spotlight colour), `flipped`, `expanded`, `disabled`.\n * CSS variables: `--usa-card-x/-y` (pointer %, 0–100), `--usa-card-nx/-ny` (−1…1).\n * Methods: `flip(force?)`, `expand()`, `collapse()`. Events: `usa:flip`,\n * `usa:expand`, `usa:collapse`. Reduced motion: no tilt / parallax / sweep;\n * flips and expansions cross-fade.\n */\nexport interface UsaCardElement extends UsaElement {\n readonly effects: string[];\n flipped: boolean;\n readonly expanded: boolean;\n flip(force?: boolean): void;\n expand(): Promise<void>;\n collapse(): Promise<void>;\n}\n\nexport function defineCard(tag = 'usa-card'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaCard extends Base {\n static get observedAttributes(): string[] {\n return ['effect', 'trigger', 'disabled'];\n }\n\n private _frame = 0;\n private _spacer: HTMLElement | null = null;\n private _backdrop: HTMLElement | null = null;\n private _busy = false;\n\n get effects(): string[] {\n return this.str('effect', 'lift').split(/[\\s,]+/).filter(Boolean);\n }\n private has(e: string): boolean {\n return this.effects.includes(e);\n }\n get flipped(): boolean {\n return this.flag('flipped');\n }\n set flipped(v: boolean) {\n this.setFlag('flipped', v);\n }\n get expanded(): boolean {\n return this.flag('expanded');\n }\n\n mount(): void {\n if (this.flag('disabled')) return;\n const color = this.str('color');\n if (color) this.style.setProperty('--usa-card-glow', color);\n if (this.has('sheen') && !this.querySelector(':scope > .usa-card-sheen')) this.append(deco('usa-card-sheen'));\n if (this.has('holo') && !this.querySelector(':scope > .usa-card-holo')) this.append(deco('usa-card-holo'));\n if (this.has('flip')) {\n const click = this.str('trigger', 'hover') === 'click';\n if (click) {\n if (!this.hasAttribute('tabindex')) this.tabIndex = 0;\n this.setAttribute('role', this.getAttribute('role') || 'button');\n this.setAttribute('aria-pressed', String(this.flipped));\n this.listen(this, 'click', (e: MouseEvent) => !interactive(e.target, this) && this.flip());\n this.listen(this, 'keydown', (e: KeyboardEvent) => {\n if ((e.key === 'Enter' || e.key === ' ') && e.target === this) {\n e.preventDefault();\n this.flip();\n }\n });\n }\n this.setBackHidden();\n }\n if (this.has('expand')) {\n if (!this.hasAttribute('tabindex')) this.tabIndex = 0;\n this.setAttribute('aria-expanded', String(this.expanded));\n this.listen(this, 'click', (e: MouseEvent) => {\n const t = e.target as Element;\n if (t.closest?.('[data-close]')) {\n e.stopPropagation();\n this.collapse();\n } else if (!this.expanded && !interactive(t, this)) this.expand();\n });\n this.listen(this, 'keydown', (e: KeyboardEvent) => {\n if (e.key === 'Escape' && this.expanded) this.collapse();\n else if ((e.key === 'Enter' || e.key === ' ') && e.target === this && !this.expanded) {\n e.preventDefault();\n this.expand();\n }\n });\n }\n if (!this.effects.some((e) => TRACKING.has(e)) || this.reduced) return;\n let rect: DOMRect | null = null;\n let px = 0.5;\n let py = 0.5;\n const apply = () => {\n this._frame = 0;\n const nx = clamp(px * 2 - 1, -1, 1);\n const ny = clamp(py * 2 - 1, -1, 1);\n this.style.setProperty('--usa-card-x', `${(px * 100).toFixed(1)}%`);\n this.style.setProperty('--usa-card-y', `${(py * 100).toFixed(1)}%`);\n this.style.setProperty('--usa-card-nx', nx.toFixed(3));\n this.style.setProperty('--usa-card-ny', ny.toFixed(3));\n if (this.has('parallax-layers')) {\n const depth = this.num('depth', 16);\n this.querySelectorAll<HTMLElement>('[data-depth]').forEach((l) => {\n const d = Number(l.dataset.depth) || 0.5;\n l.style.transform = `translate3d(${(nx * depth * d).toFixed(1)}px, ${(ny * depth * d).toFixed(1)}px, 0)`;\n });\n }\n };\n this.listen(this, 'pointerenter', () => {\n rect = this.getBoundingClientRect();\n this.setAttribute('data-hover', '');\n });\n this.listen(this, 'pointermove', (e: PointerEvent) => {\n if (this.expanded) return;\n rect = rect || this.getBoundingClientRect();\n px = (e.clientX - rect.left) / (rect.width || 1);\n py = (e.clientY - rect.top) / (rect.height || 1);\n if (!this._frame) this._frame = raf(apply);\n });\n this.listen(this, 'pointerleave', () => {\n rect = null;\n px = py = 0.5;\n this.removeAttribute('data-hover');\n if (!this._frame) this._frame = raf(apply);\n });\n }\n\n unmount(): void {\n caf(this._frame);\n this._frame = 0;\n if (this.expanded) this.finishCollapse();\n }\n\n private setBackHidden(): void {\n const front = this.querySelector<HTMLElement>(':scope > [data-front]');\n const back = this.querySelector<HTMLElement>(':scope > [data-back]');\n front?.setAttribute('aria-hidden', String(this.flipped));\n back?.setAttribute('aria-hidden', String(!this.flipped));\n }\n\n flip(force?: boolean): void {\n const next = force === undefined ? !this.flipped : force;\n if (next === this.flipped) return;\n this.flipped = next;\n if (this.hasAttribute('aria-pressed')) this.setAttribute('aria-pressed', String(next));\n this.setBackHidden();\n this.emit('flip', { flipped: next });\n }\n\n async expand(): Promise<void> {\n if (this.expanded || this._busy) return;\n this._busy = true;\n const first = this.getBoundingClientRect();\n const spacer = document.createElement('div');\n spacer.className = 'usa-card-spacer';\n spacer.style.cssText = `width:${first.width}px;height:${first.height}px`;\n spacer.setAttribute('aria-hidden', 'true');\n this.before(spacer);\n this._spacer = spacer;\n const backdrop = document.createElement('div');\n backdrop.className = 'usa-card-backdrop';\n backdrop.addEventListener('click', () => this.collapse());\n this.before(backdrop);\n this._backdrop = backdrop;\n this.setFlag('expanded', true);\n this.setAttribute('aria-expanded', 'true');\n this.emit('expand');\n const last = this.getBoundingClientRect();\n await this.flipFrom(first, last);\n this.motion(backdrop, [{ opacity: 0 }, { opacity: 1 }], { duration: 250, easing: 'ease-out' });\n this.focus({ preventScroll: true });\n this._busy = false;\n }\n\n async collapse(): Promise<void> {\n if (!this.expanded || this._busy) return;\n this._busy = true;\n const first = this.getBoundingClientRect();\n const b = this._backdrop;\n if (b) this.motion(b, [{ opacity: 1 }, { opacity: 0 }], { duration: 200, easing: 'ease-in', fill: 'forwards' });\n this.finishCollapse();\n this.emit('collapse');\n const last = this.getBoundingClientRect();\n await this.flipFrom(first, last);\n this._busy = false;\n }\n\n private finishCollapse(): void {\n this.setFlag('expanded', false);\n this.setAttribute('aria-expanded', 'false');\n this._spacer?.remove();\n this._backdrop?.remove();\n this._spacer = this._backdrop = null;\n }\n\n private async flipFrom(first: DOMRect, last: DOMRect): Promise<void> {\n if (this.reduced) {\n const a = this.motion(this, [{ opacity: 0.4 }, { opacity: 1 }], { duration: 200 });\n await a?.finished.catch(() => undefined);\n return;\n }\n const sx = first.width / (last.width || 1);\n const sy = first.height / (last.height || 1);\n const dx = first.left - last.left;\n const dy = first.top - last.top;\n const { easing, duration } = springEasing('stiff');\n const a = this.motion(\n this,\n [{ transformOrigin: '0 0', transform: `translate(${dx}px, ${dy}px) scale(${sx}, ${sy})` }, { transformOrigin: '0 0', transform: 'none' }],\n { duration: Math.min(duration, 900), easing: easing || EASE_OUT }\n );\n await a?.finished.catch(() => undefined);\n }\n },\n { id: 'card', text: css }\n );\n}\n\nfunction deco(cls: string): HTMLSpanElement {\n const s = document.createElement('span');\n s.className = cls;\n s.setAttribute('aria-hidden', 'true');\n return s;\n}\n\n/** Clicks on links, buttons and form fields inside the card keep their own behaviour. */\nfunction interactive(t: EventTarget | null, host: Element): boolean {\n const el = (t as Element)?.closest?.('a, button, input, select, textarea, label, [contenteditable]');\n return !!el && el !== host && host.contains(el);\n}\n","import { defineElement, type UsaElement } from '../base';\nimport { createSpring, type SpringValue } from '../physics/spring';\nimport css from './card-stack.css?raw';\n\n/**\n * `<usa-card-stack>` — a deck of cards (its element children). The top card\n * can be swiped away left or right (pointer, touch or arrow keys); the rest\n * fan out behind it and move up with a spring.\n *\n * Attributes: `threshold` (px to dismiss, 90), `visible` (cards fanned\n * behind, 3), `offset` (px between cards, 10), `loop` (swiped cards go back\n * to the bottom), `disabled`. Methods: `swipe(direction)`, `top`. Events:\n * `usa:swipe` (`{ direction: 'left' | 'right', card }`), `usa:empty`.\n * Reduced motion: cards are removed instantly, no rotation.\n */\nexport interface UsaCardStackElement extends UsaElement {\n readonly top: HTMLElement | null;\n swipe(direction: 'left' | 'right'): Promise<void>;\n}\n\nexport function defineCardStack(tag = 'usa-card-stack'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaCardStack extends Base {\n static get observedAttributes(): string[] {\n return ['visible', 'offset', 'disabled'];\n }\n\n private _x!: SpringValue;\n private _drag: { id: number; x0: number; t0: number } | null = null;\n private _busy = false;\n\n get top(): HTMLElement | null {\n return this.cards()[0] || null;\n }\n\n private cards(): HTMLElement[] {\n return Array.from(this.children).filter((c) => !(c as HTMLElement).hasAttribute('data-gone')) as HTMLElement[];\n }\n\n private layout(dragX = 0): void {\n const visible = this.num('visible', 3);\n const off = this.num('offset', 10);\n const reduced = this.reduced;\n this.cards().forEach((c, i) => {\n c.style.zIndex = String(100 - i);\n c.toggleAttribute('data-top', i === 0);\n c.setAttribute('aria-hidden', String(i !== 0));\n if (i === 0) {\n const rot = reduced ? 0 : dragX / 18;\n c.style.transform = `translate3d(${dragX}px, 0, 0) rotate(${rot.toFixed(2)}deg)`;\n c.style.opacity = '1';\n } else {\n const k = Math.min(i, visible);\n const pull = Math.min(1, Math.abs(dragX) / this.num('threshold', 90));\n const kk = Math.max(0, k - pull);\n c.style.transform = `translate3d(0, ${(kk * off).toFixed(1)}px, 0) scale(${(1 - kk * 0.05).toFixed(3)})`;\n c.style.opacity = i > visible ? '0' : '1';\n }\n });\n }\n\n mount(): void {\n if (!this.hasAttribute('tabindex')) this.tabIndex = 0;\n if (!this.hasAttribute('role')) this.setAttribute('role', 'group');\n this.setAttribute('aria-roledescription', 'card stack');\n this._x = createSpring({ spring: 'wobbly', onUpdate: (v) => this.layout(v) });\n this.layout();\n this.listen(this, 'pointerdown', (e: PointerEvent) => {\n if (this.flag('disabled') || this._busy || !this.top || !this.top.contains(e.target as Node)) return;\n this._x.stop();\n this._drag = { id: e.pointerId, x0: e.clientX - this._x.value, t0: e.timeStamp };\n try {\n this.setPointerCapture?.(e.pointerId);\n } catch {\n /* synthetic */\n }\n this.setAttribute('data-dragging', '');\n });\n this.listen(this, 'pointermove', (e: PointerEvent) => {\n if (!this._drag || e.pointerId !== this._drag.id) return;\n this._x.jump(e.clientX - this._drag.x0);\n });\n const up = (e: PointerEvent) => {\n if (!this._drag || e.pointerId !== this._drag.id) return;\n this._drag = null;\n this.removeAttribute('data-dragging');\n const x = this._x.value;\n if (Math.abs(x) >= this.num('threshold', 90)) this.swipe(x > 0 ? 'right' : 'left');\n else this._x.set(0);\n };\n this.listen(this, 'pointerup', up);\n this.listen(this, 'pointercancel', up);\n this.listen(this, 'keydown', (e: KeyboardEvent) => {\n if (e.key === 'ArrowLeft' || e.key === 'ArrowRight') {\n e.preventDefault();\n this.swipe(e.key === 'ArrowLeft' ? 'left' : 'right');\n }\n });\n const mo = typeof MutationObserver !== 'undefined' ? new MutationObserver(() => this.layout(this._x.value)) : null;\n mo?.observe(this, { childList: true });\n this.onCleanup(() => mo?.disconnect());\n }\n\n unmount(): void {\n this._x?.stop();\n }\n\n async swipe(direction: 'left' | 'right'): Promise<void> {\n const card = this.top;\n if (!card || this._busy || this.flag('disabled')) return;\n this._busy = true;\n this._x.stop();\n const from = this._x.value;\n const to = (direction === 'left' ? -1 : 1) * Math.max(320, (this.getBoundingClientRect().width || 300) * 1.4);\n card.setAttribute('data-gone', '');\n this._x.jump(0);\n this.layout(0);\n const a = this.reduced\n ? null\n : this.motion(card, [{ transform: `translate3d(${from}px,0,0) rotate(${from / 18}deg)`, opacity: 1 }, { transform: `translate3d(${to}px,0,0) rotate(${to / 14}deg)`, opacity: 0 }], {\n duration: 380,\n easing: 'cubic-bezier(0.3, 0.7, 0.4, 1)',\n fill: 'forwards',\n });\n await a?.finished.catch(() => undefined);\n a?.cancel();\n card.removeAttribute('data-gone');\n if (this.flag('loop')) this.append(card);\n else card.remove();\n this.layout(0);\n this._busy = false;\n this.emit('swipe', { direction, card });\n if (!this.top) this.emit('empty');\n }\n },\n { id: 'card-stack', text: css }\n );\n}\n","import { defineElement, raf, caf, clamp, type UsaElement } from '../base';\nimport css from './sticky-stack.css?raw';\n\n/**\n * `<usa-sticky-stack>` — cards (element children) stick to the top while\n * scrolling and the ones underneath scale down and dim as the next card\n * slides over them, like a deck building up.\n *\n * Attributes: `top` (px from the viewport top, 80), `gap` (px each card\n * peeks below the previous, 16), `scale` (how much a covered card shrinks,\n * 0.06). Reduced motion: cards still stack (sticky) but do not scale.\n */\nexport interface UsaStickyStackElement extends UsaElement {\n update(): void;\n}\n\nexport function defineStickyStack(tag = 'usa-sticky-stack'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaStickyStack extends Base {\n static get observedAttributes(): string[] {\n return ['top', 'gap', 'scale'];\n }\n\n private _frame = 0;\n\n mount(): void {\n const top = this.num('top', 80);\n const gap = this.num('gap', 16);\n const cards = Array.from(this.children) as HTMLElement[];\n cards.forEach((c, i) => {\n c.style.top = `${top + i * gap}px`;\n c.style.zIndex = String(i + 1);\n });\n if (this.reduced) return;\n const schedule = () => {\n if (!this._frame) this._frame = raf(() => this.update());\n };\n let active = false;\n this.inView((v) => {\n if (v && !active) {\n active = true;\n window.addEventListener('scroll', schedule, { passive: true });\n window.addEventListener('resize', schedule, { passive: true });\n schedule();\n } else if (!v && active) {\n active = false;\n window.removeEventListener('scroll', schedule);\n window.removeEventListener('resize', schedule);\n }\n });\n this.onCleanup(() => {\n window.removeEventListener('scroll', schedule);\n window.removeEventListener('resize', schedule);\n });\n }\n\n unmount(): void {\n caf(this._frame);\n this._frame = 0;\n }\n\n update(): void {\n this._frame = 0;\n const cards = Array.from(this.children) as HTMLElement[];\n const rects = cards.map((c) => c.getBoundingClientRect());\n const shrink = this.num('scale', 0.06);\n cards.forEach((c, i) => {\n let covered = 0;\n for (let j = i + 1; j < cards.length; j++) {\n const h = rects[i].height || 1;\n covered += clamp((rects[i].bottom - rects[j].top) / h, 0, 1);\n }\n const s = 1 - Math.min(3, covered) * shrink;\n c.style.transform = covered > 0.001 ? `scale(${s.toFixed(4)})` : '';\n c.style.filter = covered > 0.001 ? `brightness(${(1 - Math.min(0.35, covered * 0.12)).toFixed(3)})` : '';\n });\n }\n },\n { id: 'sticky-stack', text: css }\n );\n}\n","import { defineElement, type UsaElement } from '../base';\nimport { createSpring, type SpringValue } from '../physics/spring';\nimport css from './carousel-3d.css?raw';\n\n/**\n * `<usa-carousel-3d>` — its element children on a 3D ring. Rotate with the\n * arrow keys, a drag/swipe, the wheel (shift) or `next()` / `prev()`; the\n * front item is `aria-current`. Spring-driven rotation.\n *\n * Attributes: `radius` (px, auto from item width), `autoplay` (ms between\n * steps, pauses on hover/focus), `perspective` (px, 1200), `index`.\n * Events: `usa:change` (`{ index }`). Reduced motion: a flat, instant\n * switch (only the current item is shown, others dimmed).\n */\nexport interface UsaCarousel3dElement extends UsaElement {\n index: number;\n next(): void;\n prev(): void;\n goTo(i: number): void;\n}\n\nexport function defineCarousel3d(tag = 'usa-carousel-3d'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaCarousel3d extends Base {\n static get observedAttributes(): string[] {\n return ['radius', 'perspective', 'autoplay'];\n }\n\n private _angle!: SpringValue;\n private _i = 0;\n\n get index(): number {\n return this._i;\n }\n set index(v: number) {\n this.goTo(v);\n }\n\n private items(): HTMLElement[] {\n return Array.from(this.children) as HTMLElement[];\n }\n\n private render(angle: number): void {\n const items = this.items();\n const n = items.length || 1;\n const step = 360 / n;\n const w = items[0]?.offsetWidth || 200;\n const r = this.num('radius', Math.round(w / 2 / Math.tan(Math.PI / n)) + 24);\n const reduced = this.reduced;\n items.forEach((it, i) => {\n const norm = ((((i * step - angle) % 360) + 540) % 360) - 180;\n it.style.transform = reduced ? '' : `rotateY(${norm.toFixed(2)}deg) translateZ(${r}px)`;\n it.style.opacity = reduced ? (i === this._i ? '1' : '0') : String(Math.max(0.25, 1 - Math.abs(norm) / 200));\n });\n }\n\n mount(): void {\n this.style.setProperty('--usa-c3d-perspective', `${this.num('perspective', 1200)}px`);\n if (!this.hasAttribute('tabindex')) this.tabIndex = 0;\n this.setAttribute('role', 'region');\n this.setAttribute('aria-roledescription', 'carousel');\n this._i = Math.max(0, Math.min(this.items().length - 1, this.num('index', 0)));\n const step = () => 360 / (this.items().length || 1);\n this._angle = createSpring({ value: this._i * step(), spring: 'gentle', onUpdate: (v) => this.render(v) });\n this.render(this._angle.value);\n this.mark();\n this.listen(this, 'keydown', (e: KeyboardEvent) => {\n if (e.key === 'ArrowRight') this.next();\n else if (e.key === 'ArrowLeft') this.prev();\n else return;\n e.preventDefault();\n });\n let x0: number | null = null;\n this.listen(this, 'pointerdown', (e: PointerEvent) => (x0 = e.clientX));\n this.listen(this, 'pointerup', (e: PointerEvent) => {\n if (x0 === null) return;\n const dx = e.clientX - x0;\n x0 = null;\n if (Math.abs(dx) > 40) dx < 0 ? this.next() : this.prev();\n });\n this.listen(this, 'click', (e: MouseEvent) => {\n const it = this.items().find((c) => c.contains(e.target as Node));\n if (it) {\n const i = this.items().indexOf(it);\n if (i !== this._i) this.goTo(i);\n }\n });\n const every = this.num('autoplay', 0);\n if (every > 0 && !this.reduced) {\n let paused = false;\n const pause = () => (paused = true);\n const resume = () => (paused = false);\n this.listen(this, 'pointerenter', pause);\n this.listen(this, 'pointerleave', resume);\n this.listen(this, 'focusin', pause);\n this.listen(this, 'focusout', resume);\n const t = setInterval(() => !paused && !document.hidden && this.next(), every);\n this.onCleanup(() => clearInterval(t));\n }\n }\n\n unmount(): void {\n this._angle?.stop();\n }\n\n private mark(): void {\n this.items().forEach((it, i) => {\n if (i === this._i) it.setAttribute('aria-current', 'true');\n else it.removeAttribute('aria-current');\n });\n }\n\n goTo(i: number): void {\n const n = this.items().length;\n if (!n || !this._angle) return;\n const step = 360 / n;\n // shortest rotation from the current target\n const cur = this._angle.target;\n const curIdx = Math.round(cur / step);\n let delta = (((i - curIdx) % n) + n) % n;\n if (delta > n / 2) delta -= n;\n this._i = ((i % n) + n) % n;\n this._angle.set((curIdx + delta) * step);\n if (this.reduced) this.render(this._angle.value);\n this.mark();\n this.emit('change', { index: this._i });\n }\n\n next(): void {\n this.goTo(this._i + 1);\n }\n\n prev(): void {\n this.goTo(this._i - 1);\n }\n },\n { id: 'carousel-3d', text: css }\n );\n}\n","/**\n * use-scroll-animate/components/cards — card effects (v2.4).\n * `<usa-card effect=\"flip | holo | glass | border-glow | conic-border | lift |\n * spotlight | sheen | parallax-layers | expand\">` (combinable),\n * `<usa-card-stack>` (swipeable deck), `<usa-sticky-stack>` (stacking on\n * scroll) and `<usa-carousel-3d>`.\n */\nimport { defineCard, type UsaCardElement } from './card';\nimport { defineCardStack, type UsaCardStackElement } from './card-stack';\nimport { defineStickyStack, type UsaStickyStackElement } from './sticky-stack';\nimport { defineCarousel3d, type UsaCarousel3dElement } from './carousel-3d';\n\nexport { defineCard, defineCardStack, defineStickyStack, defineCarousel3d };\nexport { CARD_EFFECTS } from './card';\nexport type { CardEffect } from './card';\nexport type { UsaCardElement, UsaCardStackElement, UsaStickyStackElement, UsaCarousel3dElement };\nexport { configureComponents, prefersReducedMotion } from '../base';\nexport type { ComponentsConfig, UsaElement } from '../base';\n\n/** Register every component of this category under its default tag. */\nexport function defineCardComponents(): void {\n defineCard();\n defineCardStack();\n defineStickyStack();\n defineCarousel3d();\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'usa-card': UsaCardElement;\n 'usa-card-stack': UsaCardStackElement;\n 'usa-sticky-stack': UsaStickyStackElement;\n 'usa-carousel-3d': UsaC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IA;;;;;;AAMG;AAaH;SACgB,oBAAoB,GAAA;AAClC,IAAA,UAAU,EAAE;AACZ,IAAA,eAAe,EAAE;AACjB,IAAA,iBAAiB,EAAE;AACnB,IAAA,gBAAgB,EAAE;AACpB;;;;"}
|
|
1
|
+
{"version":3,"file":"cards.js","sources":["../../src/components/cards/card.ts","../../src/components/cards/card-stack.ts","../../src/components/cards/sticky-stack.ts","../../src/components/cards/carousel-3d.ts","../../src/components/cards/index.ts"],"sourcesContent":["import { defineElement, raf, caf, clamp, EASE_OUT, type UsaElement } from '../base';\nimport { springEasing } from '../physics/spring';\nimport css from './card.css?raw';\n\nexport const CARD_EFFECTS = ['flip', 'holo', 'glass', 'border-glow', 'conic-border', 'lift', 'spotlight', 'sheen', 'parallax-layers', 'expand'] as const;\nexport type CardEffect = (typeof CARD_EFFECTS)[number];\n\n/** Effects that follow the pointer (they share one rAF-throttled tracker). */\nconst TRACKING = new Set(['holo', 'border-glow', 'spotlight', 'parallax-layers', 'lift']);\n\n/**\n * `<usa-card>` — card effects, combinable: `effect=\"lift sheen\"`.\n *\n * - `flip` — front/back (`[data-front]` / `[data-back]` children) flip on\n * hover or `trigger=\"click\"`, `axis=\"y\"` (default, horizontal flip) or `x`.\n * - `holo` — holographic foil that shifts with the pointer.\n * - `glass` — frosted glass surface (backdrop blur).\n * - `border-glow` — a glow on the border that follows the pointer.\n * - `conic-border` — a rotating conic-gradient border.\n * - `lift` — rises with a deeper shadow and a slight pointer tilt.\n * - `spotlight` — a soft light that follows the pointer.\n * - `sheen` — a light sweep across the card on hover / focus.\n * - `parallax-layers` — children with `data-depth=\"0.2…1\"` move at different depths.\n * - `expand` — click to grow into a full detail view (`[data-detail]`\n * content is shown), FLIP + spring; Esc, `[data-close]` or the backdrop closes.\n *\n * Attributes: `effect`, `axis`, `trigger`, `depth` (parallax px, 16),\n * `color` (glow / spotlight colour), `flipped`, `expanded`, `disabled`.\n * CSS variables: `--usa-card-x/-y` (pointer %, 0–100), `--usa-card-nx/-ny` (−1…1).\n * Methods: `flip(force?)`, `expand()`, `collapse()`. Events: `usa:flip`,\n * `usa:expand`, `usa:collapse`. Reduced motion: no tilt / parallax / sweep;\n * flips and expansions cross-fade.\n */\nexport interface UsaCardElement extends UsaElement {\n readonly effects: string[];\n flipped: boolean;\n readonly expanded: boolean;\n flip(force?: boolean): void;\n expand(): Promise<void>;\n collapse(): Promise<void>;\n}\n\nexport function defineCard(tag = 'usa-card'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaCard extends Base {\n static get observedAttributes(): string[] {\n return ['effect', 'trigger', 'disabled'];\n }\n\n private _frame = 0;\n private _spacer: HTMLElement | null = null;\n private _backdrop: HTMLElement | null = null;\n private _busy = false;\n\n get effects(): string[] {\n return this.str('effect', 'lift').split(/[\\s,]+/).filter(Boolean);\n }\n private has(e: string): boolean {\n return this.effects.includes(e);\n }\n get flipped(): boolean {\n return this.flag('flipped');\n }\n set flipped(v: boolean) {\n this.setFlag('flipped', v);\n }\n get expanded(): boolean {\n return this.flag('expanded');\n }\n\n mount(): void {\n if (this.flag('disabled')) return;\n const color = this.str('color');\n if (color) this.style.setProperty('--usa-card-glow', color);\n if (this.has('sheen') && !this.querySelector(':scope > .usa-card-sheen')) this.append(deco('usa-card-sheen'));\n if (this.has('holo') && !this.querySelector(':scope > .usa-card-holo')) this.append(deco('usa-card-holo'));\n if (this.has('flip')) {\n const click = this.str('trigger', 'hover') === 'click';\n if (click) {\n if (!this.hasAttribute('tabindex')) this.tabIndex = 0;\n this.setAttribute('role', this.getAttribute('role') || 'button');\n this.setAttribute('aria-pressed', String(this.flipped));\n this.listen(this, 'click', (e: MouseEvent) => !interactive(e.target, this) && this.flip());\n this.listen(this, 'keydown', (e: KeyboardEvent) => {\n if ((e.key === 'Enter' || e.key === ' ') && e.target === this) {\n e.preventDefault();\n this.flip();\n }\n });\n }\n this.setBackHidden();\n }\n if (this.has('expand')) {\n if (!this.hasAttribute('tabindex')) this.tabIndex = 0;\n this.setAttribute('aria-expanded', String(this.expanded));\n this.listen(this, 'click', (e: MouseEvent) => {\n const t = e.target as Element;\n if (t.closest?.('[data-close]')) {\n e.stopPropagation();\n this.collapse();\n } else if (!this.expanded && !interactive(t, this)) this.expand();\n });\n this.listen(this, 'keydown', (e: KeyboardEvent) => {\n if (e.key === 'Escape' && this.expanded) this.collapse();\n else if ((e.key === 'Enter' || e.key === ' ') && e.target === this && !this.expanded) {\n e.preventDefault();\n this.expand();\n }\n });\n }\n if (!this.effects.some((e) => TRACKING.has(e)) || this.reduced) return;\n let rect: DOMRect | null = null;\n let px = 0.5;\n let py = 0.5;\n const apply = () => {\n this._frame = 0;\n const nx = clamp(px * 2 - 1, -1, 1);\n const ny = clamp(py * 2 - 1, -1, 1);\n this.style.setProperty('--usa-card-x', `${(px * 100).toFixed(1)}%`);\n this.style.setProperty('--usa-card-y', `${(py * 100).toFixed(1)}%`);\n this.style.setProperty('--usa-card-nx', nx.toFixed(3));\n this.style.setProperty('--usa-card-ny', ny.toFixed(3));\n if (this.has('parallax-layers')) {\n const depth = this.num('depth', 16);\n this.querySelectorAll<HTMLElement>('[data-depth]').forEach((l) => {\n const d = Number(l.dataset.depth) || 0.5;\n l.style.transform = `translate3d(${(nx * depth * d).toFixed(1)}px, ${(ny * depth * d).toFixed(1)}px, 0)`;\n });\n }\n };\n this.listen(this, 'pointerenter', () => {\n rect = this.getBoundingClientRect();\n this.setAttribute('data-hover', '');\n });\n this.listen(this, 'pointermove', (e: PointerEvent) => {\n if (this.expanded) return;\n rect = rect || this.getBoundingClientRect();\n px = (e.clientX - rect.left) / (rect.width || 1);\n py = (e.clientY - rect.top) / (rect.height || 1);\n if (!this._frame) this._frame = raf(apply);\n });\n this.listen(this, 'pointerleave', () => {\n rect = null;\n px = py = 0.5;\n this.removeAttribute('data-hover');\n if (!this._frame) this._frame = raf(apply);\n });\n }\n\n unmount(): void {\n caf(this._frame);\n this._frame = 0;\n if (this.expanded) this.finishCollapse();\n }\n\n private setBackHidden(): void {\n const front = this.querySelector<HTMLElement>(':scope > [data-front]');\n const back = this.querySelector<HTMLElement>(':scope > [data-back]');\n front?.setAttribute('aria-hidden', String(this.flipped));\n back?.setAttribute('aria-hidden', String(!this.flipped));\n }\n\n flip(force?: boolean): void {\n const next = force === undefined ? !this.flipped : force;\n if (next === this.flipped) return;\n this.flipped = next;\n if (this.hasAttribute('aria-pressed')) this.setAttribute('aria-pressed', String(next));\n this.setBackHidden();\n this.emit('flip', { flipped: next });\n }\n\n async expand(): Promise<void> {\n if (this.expanded || this._busy) return;\n this._busy = true;\n const first = this.getBoundingClientRect();\n const spacer = document.createElement('div');\n spacer.className = 'usa-card-spacer';\n spacer.style.cssText = `width:${first.width}px;height:${first.height}px`;\n spacer.setAttribute('aria-hidden', 'true');\n this.before(spacer);\n this._spacer = spacer;\n const backdrop = document.createElement('div');\n backdrop.className = 'usa-card-backdrop';\n backdrop.addEventListener('click', () => this.collapse());\n this.before(backdrop);\n this._backdrop = backdrop;\n this.setFlag('expanded', true);\n this.setAttribute('aria-expanded', 'true');\n this.emit('expand');\n const last = this.getBoundingClientRect();\n await this.flipFrom(first, last);\n this.motion(backdrop, [{ opacity: 0 }, { opacity: 1 }], { duration: 250, easing: 'ease-out' });\n this.focus({ preventScroll: true });\n this._busy = false;\n }\n\n async collapse(): Promise<void> {\n if (!this.expanded || this._busy) return;\n this._busy = true;\n const first = this.getBoundingClientRect();\n const b = this._backdrop;\n if (b) this.motion(b, [{ opacity: 1 }, { opacity: 0 }], { duration: 200, easing: 'ease-in', fill: 'forwards' });\n this.finishCollapse();\n this.emit('collapse');\n const last = this.getBoundingClientRect();\n await this.flipFrom(first, last);\n this._busy = false;\n }\n\n private finishCollapse(): void {\n this.setFlag('expanded', false);\n this.setAttribute('aria-expanded', 'false');\n this._spacer?.remove();\n this._backdrop?.remove();\n this._spacer = this._backdrop = null;\n }\n\n private async flipFrom(first: DOMRect, last: DOMRect): Promise<void> {\n if (this.reduced) {\n const a = this.motion(this, [{ opacity: 0.4 }, { opacity: 1 }], { duration: 200 });\n await a?.finished.catch(() => undefined);\n return;\n }\n const sx = first.width / (last.width || 1);\n const sy = first.height / (last.height || 1);\n const dx = first.left - last.left;\n const dy = first.top - last.top;\n const { easing, duration } = springEasing('stiff');\n const a = this.motion(\n this,\n [{ transformOrigin: '0 0', transform: `translate(${dx}px, ${dy}px) scale(${sx}, ${sy})` }, { transformOrigin: '0 0', transform: 'none' }],\n { duration: Math.min(duration, 900), easing: easing || EASE_OUT }\n );\n await a?.finished.catch(() => undefined);\n }\n },\n { id: 'card', text: css }\n );\n}\n\nfunction deco(cls: string): HTMLSpanElement {\n const s = document.createElement('span');\n s.className = cls;\n s.setAttribute('aria-hidden', 'true');\n return s;\n}\n\n/** Clicks on links, buttons and form fields inside the card keep their own behaviour. */\nfunction interactive(t: EventTarget | null, host: Element): boolean {\n const el = (t as Element)?.closest?.('a, button, input, select, textarea, label, [contenteditable]');\n return !!el && el !== host && host.contains(el);\n}\n","import { defineElement, type UsaElement } from '../base';\nimport { createSpring, type SpringValue } from '../physics/spring';\nimport css from './card-stack.css?raw';\n\n/**\n * `<usa-card-stack>` — a deck of cards (its element children). The top card\n * can be swiped away left or right (pointer, touch or arrow keys); the rest\n * fan out behind it and move up with a spring.\n *\n * Attributes: `threshold` (px to dismiss, 90), `visible` (cards fanned\n * behind, 3), `offset` (px between cards, 10), `loop` (swiped cards go back\n * to the bottom), `disabled`. Methods: `swipe(direction)`, `top`. Events:\n * `usa:swipe` (`{ direction: 'left' | 'right', card }`), `usa:empty`.\n * Reduced motion: cards are removed instantly, no rotation.\n */\nexport interface UsaCardStackElement extends UsaElement {\n readonly top: HTMLElement | null;\n swipe(direction: 'left' | 'right'): Promise<void>;\n}\n\nexport function defineCardStack(tag = 'usa-card-stack'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaCardStack extends Base {\n static get observedAttributes(): string[] {\n return ['visible', 'offset', 'disabled'];\n }\n\n private _x!: SpringValue;\n private _drag: { id: number; x0: number; t0: number } | null = null;\n private _busy = false;\n\n get top(): HTMLElement | null {\n return this.cards()[0] || null;\n }\n\n private cards(): HTMLElement[] {\n return Array.from(this.children).filter((c) => !(c as HTMLElement).hasAttribute('data-gone')) as HTMLElement[];\n }\n\n private layout(dragX = 0): void {\n const visible = this.num('visible', 3);\n const off = this.num('offset', 10);\n const reduced = this.reduced;\n this.cards().forEach((c, i) => {\n c.style.zIndex = String(100 - i);\n c.toggleAttribute('data-top', i === 0);\n c.setAttribute('aria-hidden', String(i !== 0));\n if (i === 0) {\n const rot = reduced ? 0 : dragX / 18;\n c.style.transform = `translate3d(${dragX}px, 0, 0) rotate(${rot.toFixed(2)}deg)`;\n c.style.opacity = '1';\n } else {\n const k = Math.min(i, visible);\n const pull = Math.min(1, Math.abs(dragX) / this.num('threshold', 90));\n const kk = Math.max(0, k - pull);\n c.style.transform = `translate3d(0, ${(kk * off).toFixed(1)}px, 0) scale(${(1 - kk * 0.05).toFixed(3)})`;\n c.style.opacity = i > visible ? '0' : '1';\n }\n });\n }\n\n mount(): void {\n if (!this.hasAttribute('tabindex')) this.tabIndex = 0;\n if (!this.hasAttribute('role')) this.setAttribute('role', 'group');\n this.setAttribute('aria-roledescription', 'card stack');\n this._x = createSpring({ spring: 'wobbly', onUpdate: (v) => this.layout(v) });\n this.layout();\n this.listen(this, 'pointerdown', (e: PointerEvent) => {\n if (this.flag('disabled') || this._busy || !this.top || !this.top.contains(e.target as Node)) return;\n this._x.stop();\n this._drag = { id: e.pointerId, x0: e.clientX - this._x.value, t0: e.timeStamp };\n try {\n this.setPointerCapture?.(e.pointerId);\n } catch {\n /* synthetic */\n }\n this.setAttribute('data-dragging', '');\n });\n this.listen(this, 'pointermove', (e: PointerEvent) => {\n if (!this._drag || e.pointerId !== this._drag.id) return;\n this._x.jump(e.clientX - this._drag.x0);\n });\n const up = (e: PointerEvent) => {\n if (!this._drag || e.pointerId !== this._drag.id) return;\n this._drag = null;\n this.removeAttribute('data-dragging');\n const x = this._x.value;\n if (Math.abs(x) >= this.num('threshold', 90)) this.swipe(x > 0 ? 'right' : 'left');\n else this._x.set(0);\n };\n this.listen(this, 'pointerup', up);\n this.listen(this, 'pointercancel', up);\n this.listen(this, 'keydown', (e: KeyboardEvent) => {\n if (e.key === 'ArrowLeft' || e.key === 'ArrowRight') {\n e.preventDefault();\n this.swipe(e.key === 'ArrowLeft' ? 'left' : 'right');\n }\n });\n const mo = typeof MutationObserver !== 'undefined' ? new MutationObserver(() => this.layout(this._x.value)) : null;\n mo?.observe(this, { childList: true });\n this.onCleanup(() => mo?.disconnect());\n }\n\n unmount(): void {\n this._x?.stop();\n }\n\n async swipe(direction: 'left' | 'right'): Promise<void> {\n const card = this.top;\n if (!card || this._busy || this.flag('disabled')) return;\n this._busy = true;\n this._x.stop();\n const from = this._x.value;\n const to = (direction === 'left' ? -1 : 1) * Math.max(320, (this.getBoundingClientRect().width || 300) * 1.4);\n card.setAttribute('data-gone', '');\n this._x.jump(0);\n this.layout(0);\n const a = this.reduced\n ? null\n : this.motion(card, [{ transform: `translate3d(${from}px,0,0) rotate(${from / 18}deg)`, opacity: 1 }, { transform: `translate3d(${to}px,0,0) rotate(${to / 14}deg)`, opacity: 0 }], {\n duration: 380,\n easing: 'cubic-bezier(0.3, 0.7, 0.4, 1)',\n fill: 'forwards',\n });\n await a?.finished.catch(() => undefined);\n a?.cancel();\n card.removeAttribute('data-gone');\n if (this.flag('loop')) this.append(card);\n else card.remove();\n this.layout(0);\n this._busy = false;\n this.emit('swipe', { direction, card });\n if (!this.top) this.emit('empty');\n }\n },\n { id: 'card-stack', text: css }\n );\n}\n","import { defineElement, raf, caf, clamp, type UsaElement } from '../base';\nimport css from './sticky-stack.css?raw';\n\n/**\n * `<usa-sticky-stack>` — cards (element children) stick to the top while\n * scrolling and the ones underneath scale down and dim as the next card\n * slides over them, like a deck building up.\n *\n * Attributes: `top` (px from the viewport top, 80), `gap` (px each card\n * peeks below the previous, 16), `scale` (how much a covered card shrinks,\n * 0.06). Reduced motion: cards still stack (sticky) but do not scale.\n */\nexport interface UsaStickyStackElement extends UsaElement {\n update(): void;\n}\n\nexport function defineStickyStack(tag = 'usa-sticky-stack'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaStickyStack extends Base {\n static get observedAttributes(): string[] {\n return ['top', 'gap', 'scale'];\n }\n\n private _frame = 0;\n\n mount(): void {\n const top = this.num('top', 80);\n const gap = this.num('gap', 16);\n const cards = Array.from(this.children) as HTMLElement[];\n cards.forEach((c, i) => {\n c.style.top = `${top + i * gap}px`;\n c.style.zIndex = String(i + 1);\n });\n if (this.reduced) return;\n const schedule = () => {\n if (!this._frame) this._frame = raf(() => this.update());\n };\n let active = false;\n this.inView((v) => {\n if (v && !active) {\n active = true;\n window.addEventListener('scroll', schedule, { passive: true });\n window.addEventListener('resize', schedule, { passive: true });\n schedule();\n } else if (!v && active) {\n active = false;\n window.removeEventListener('scroll', schedule);\n window.removeEventListener('resize', schedule);\n }\n });\n this.onCleanup(() => {\n window.removeEventListener('scroll', schedule);\n window.removeEventListener('resize', schedule);\n });\n }\n\n unmount(): void {\n caf(this._frame);\n this._frame = 0;\n }\n\n update(): void {\n this._frame = 0;\n const cards = Array.from(this.children) as HTMLElement[];\n const rects = cards.map((c) => c.getBoundingClientRect());\n const shrink = this.num('scale', 0.06);\n cards.forEach((c, i) => {\n let covered = 0;\n for (let j = i + 1; j < cards.length; j++) {\n const h = rects[i].height || 1;\n covered += clamp((rects[i].bottom - rects[j].top) / h, 0, 1);\n }\n const s = 1 - Math.min(3, covered) * shrink;\n c.style.transform = covered > 0.001 ? `scale(${s.toFixed(4)})` : '';\n c.style.filter = covered > 0.001 ? `brightness(${(1 - Math.min(0.35, covered * 0.12)).toFixed(3)})` : '';\n });\n }\n },\n { id: 'sticky-stack', text: css }\n );\n}\n","import { defineElement, type UsaElement } from '../base';\nimport { createSpring, type SpringValue } from '../physics/spring';\nimport css from './carousel-3d.css?raw';\n\n/**\n * `<usa-carousel-3d>` — its element children on a 3D ring. Rotate with the\n * arrow keys, a drag/swipe, the wheel (shift) or `next()` / `prev()`; the\n * front item is `aria-current`. Spring-driven rotation.\n *\n * Attributes: `radius` (px, auto from item width), `autoplay` (ms between\n * steps, pauses on hover/focus), `perspective` (px, 1200), `index`.\n * Events: `usa:change` (`{ index }`). Reduced motion: a flat, instant\n * switch (only the current item is shown, others dimmed).\n */\nexport interface UsaCarousel3dElement extends UsaElement {\n index: number;\n next(): void;\n prev(): void;\n goTo(i: number): void;\n}\n\nexport function defineCarousel3d(tag = 'usa-carousel-3d'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaCarousel3d extends Base {\n static get observedAttributes(): string[] {\n return ['radius', 'perspective', 'autoplay'];\n }\n\n private _angle!: SpringValue;\n private _i = 0;\n\n get index(): number {\n return this._i;\n }\n set index(v: number) {\n this.goTo(v);\n }\n\n private items(): HTMLElement[] {\n return Array.from(this.children) as HTMLElement[];\n }\n\n private render(angle: number): void {\n const items = this.items();\n const n = items.length || 1;\n const step = 360 / n;\n const w = items[0]?.offsetWidth || 200;\n const r = this.num('radius', Math.round(w / 2 / Math.tan(Math.PI / n)) + 24);\n const reduced = this.reduced;\n items.forEach((it, i) => {\n const norm = ((((i * step - angle) % 360) + 540) % 360) - 180;\n it.style.transform = reduced ? '' : `rotateY(${norm.toFixed(2)}deg) translateZ(${r}px)`;\n it.style.opacity = reduced ? (i === this._i ? '1' : '0') : String(Math.max(0.25, 1 - Math.abs(norm) / 200));\n });\n }\n\n mount(): void {\n this.style.setProperty('--usa-c3d-perspective', `${this.num('perspective', 1200)}px`);\n if (!this.hasAttribute('tabindex')) this.tabIndex = 0;\n this.setAttribute('role', 'region');\n this.setAttribute('aria-roledescription', 'carousel');\n this._i = Math.max(0, Math.min(this.items().length - 1, this.num('index', 0)));\n const step = () => 360 / (this.items().length || 1);\n this._angle = createSpring({ value: this._i * step(), spring: 'gentle', onUpdate: (v) => this.render(v) });\n this.render(this._angle.value);\n this.mark();\n this.listen(this, 'keydown', (e: KeyboardEvent) => {\n if (e.key === 'ArrowRight') this.next();\n else if (e.key === 'ArrowLeft') this.prev();\n else return;\n e.preventDefault();\n });\n let x0: number | null = null;\n this.listen(this, 'pointerdown', (e: PointerEvent) => (x0 = e.clientX));\n this.listen(this, 'pointerup', (e: PointerEvent) => {\n if (x0 === null) return;\n const dx = e.clientX - x0;\n x0 = null;\n if (Math.abs(dx) > 40) dx < 0 ? this.next() : this.prev();\n });\n this.listen(this, 'click', (e: MouseEvent) => {\n const it = this.items().find((c) => c.contains(e.target as Node));\n if (it) {\n const i = this.items().indexOf(it);\n if (i !== this._i) this.goTo(i);\n }\n });\n const every = this.num('autoplay', 0);\n if (every > 0 && !this.reduced) {\n let paused = false;\n const pause = () => (paused = true);\n const resume = () => (paused = false);\n this.listen(this, 'pointerenter', pause);\n this.listen(this, 'pointerleave', resume);\n this.listen(this, 'focusin', pause);\n this.listen(this, 'focusout', resume);\n const t = setInterval(() => !paused && !document.hidden && this.next(), every);\n this.onCleanup(() => clearInterval(t));\n }\n }\n\n unmount(): void {\n this._angle?.stop();\n }\n\n private mark(): void {\n this.items().forEach((it, i) => {\n if (i === this._i) it.setAttribute('aria-current', 'true');\n else it.removeAttribute('aria-current');\n });\n }\n\n goTo(i: number): void {\n const n = this.items().length;\n if (!n || !this._angle) return;\n const step = 360 / n;\n // shortest rotation from the current target\n const cur = this._angle.target;\n const curIdx = Math.round(cur / step);\n let delta = (((i - curIdx) % n) + n) % n;\n if (delta > n / 2) delta -= n;\n this._i = ((i % n) + n) % n;\n this._angle.set((curIdx + delta) * step);\n if (this.reduced) this.render(this._angle.value);\n this.mark();\n this.emit('change', { index: this._i });\n }\n\n next(): void {\n this.goTo(this._i + 1);\n }\n\n prev(): void {\n this.goTo(this._i - 1);\n }\n },\n { id: 'carousel-3d', text: css }\n );\n}\n","/**\n * use-scroll-animate/components/cards — card effects (v2.4).\n * `<usa-card effect=\"flip | holo | glass | border-glow | conic-border | lift |\n * spotlight | sheen | parallax-layers | expand\">` (combinable),\n * `<usa-card-stack>` (swipeable deck), `<usa-sticky-stack>` (stacking on\n * scroll) and `<usa-carousel-3d>`.\n */\nimport { defineCard, type UsaCardElement } from './card';\nimport { defineCardStack, type UsaCardStackElement } from './card-stack';\nimport { defineStickyStack, type UsaStickyStackElement } from './sticky-stack';\nimport { defineCarousel3d, type UsaCarousel3dElement } from './carousel-3d';\n\nexport { defineCard, defineCardStack, defineStickyStack, defineCarousel3d };\nexport { CARD_EFFECTS } from './card';\nexport type { CardEffect } from './card';\nexport type { UsaCardElement, UsaCardStackElement, UsaStickyStackElement, UsaCarousel3dElement };\n\n/** Register every component of this category under its default tag. */\nexport function defineCardComponents(): void {\n defineCard();\n defineCardStack();\n defineStickyStack();\n defineCarousel3d();\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'usa-card': UsaCardElement;\n 'usa-card-stack': UsaCardStackElement;\n 'usa-sticky-stack': UsaStickyStackElement;\n 'usa-carousel-3d': UsaCarousel3dElement;\n }\n}\n"],"names":["css"],"mappings":";;;;;AAIO,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,iBAAiB,EAAE,QAAQ;AAG9I;AACA,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,CAAC,CAAC;AAkCnF,SAAU,UAAU,CAAC,GAAG,GAAG,UAAU,EAAA;AACzC,IAAA,OAAO,aAAa,CAClB,GAAG,EACH,CAAC,IAAI,KACH,MAAM,OAAQ,SAAQ,IAAI,CAAA;AAA1B,QAAA,WAAA,GAAA;;YAKU,IAAA,CAAA,MAAM,GAAG,CAAC;YACV,IAAA,CAAA,OAAO,GAAuB,IAAI;YAClC,IAAA,CAAA,SAAS,GAAuB,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,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;AAC3B,YAAA,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,GAAG,KAAK,IAAI,IAAI,CAAC;YACxC,IAAI,IAAI,CAAC,OAAO;gBAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;YAChD,IAAI,CAAC,IAAI,EAAE;AACX,YAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC;QACzC;QAEA,IAAI,GAAA;YACF,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QACxB;QAEA,IAAI,GAAA;YACF,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QACxB;KACD,EACH,EAAE,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,GAAG,EAAE,CACjC;AACH;;AC5IA;;;;;;AAMG;AAWH;SACgB,oBAAoB,GAAA;AAClC,IAAA,UAAU,EAAE;AACZ,IAAA,eAAe,EAAE;AACjB,IAAA,iBAAiB,EAAE;AACnB,IAAA,gBAAgB,EAAE;AACpB;;;;"}
|
|
@@ -1,112 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var base = require('../chunks/base-
|
|
4
|
-
var spring = require('../chunks/spring
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Click-effect helpers (v2.5): `burst()`, `confetti()`, `shake()`, `haptic()`.
|
|
8
|
-
* Particles live in one fixed, pointer-transparent layer and are removed when
|
|
9
|
-
* their animation ends. Under reduced motion particles are skipped and
|
|
10
|
-
* `shake()` only flashes an outline.
|
|
11
|
-
*/
|
|
12
|
-
let layer = null;
|
|
13
|
-
function fxLayer() {
|
|
14
|
-
if (layer && layer.isConnected)
|
|
15
|
-
return layer;
|
|
16
|
-
layer = document.createElement('div');
|
|
17
|
-
layer.className = 'usa-fx-layer';
|
|
18
|
-
layer.setAttribute('aria-hidden', 'true');
|
|
19
|
-
layer.style.cssText = 'position:fixed;inset:0;pointer-events:none;z-index:2147483000;overflow:hidden;contain:strict';
|
|
20
|
-
document.body.appendChild(layer);
|
|
21
|
-
return layer;
|
|
22
|
-
}
|
|
23
|
-
const PALETTE = ['#7c5cff', '#22d3ee', '#f472b6', '#facc15', '#34d399', '#fb923c'];
|
|
24
|
-
const GLYPH = { star: '★', heart: '♥' };
|
|
25
|
-
function particle(x, y, size, color, shape) {
|
|
26
|
-
const p = document.createElement('span');
|
|
27
|
-
const glyph = GLYPH[shape] || (shape !== 'circle' && shape !== 'square' ? shape : '');
|
|
28
|
-
p.style.cssText = `position:absolute;left:${x}px;top:${y}px;width:${size}px;height:${size}px;margin:${-size / 2}px 0 0 ${-size / 2}px;will-change:transform,opacity;` +
|
|
29
|
-
(glyph ? `font-size:${size * 2}px;line-height:${size}px;text-align:center;color:${color}` : `background:${color};border-radius:${shape === 'square' ? '2px' : '50%'}`);
|
|
30
|
-
if (glyph)
|
|
31
|
-
p.textContent = glyph;
|
|
32
|
-
fxLayer().appendChild(p);
|
|
33
|
-
return p;
|
|
34
|
-
}
|
|
35
|
-
const done = (a, el) => {
|
|
36
|
-
if (a)
|
|
37
|
-
a.onfinish = () => el.remove();
|
|
38
|
-
else
|
|
39
|
-
el.remove();
|
|
40
|
-
};
|
|
41
|
-
/** Particles radiating from client point (x, y). Returns the number spawned. */
|
|
42
|
-
function burst(x, y, options = {}) {
|
|
43
|
-
if (typeof document === 'undefined' || base.prefersReducedMotion())
|
|
44
|
-
return 0;
|
|
45
|
-
const { count = 12, colors = PALETTE, distance = 48, size = 6, shape = 'circle', duration = 600 } = options;
|
|
46
|
-
for (let i = 0; i < count; i++) {
|
|
47
|
-
const angle = (i / count) * Math.PI * 2 + Math.random() * 0.4;
|
|
48
|
-
const d = distance * (0.7 + Math.random() * 0.5);
|
|
49
|
-
const p = particle(x, y, size, colors[i % colors.length], shape);
|
|
50
|
-
const a = typeof p.animate === 'function'
|
|
51
|
-
? p.animate([
|
|
52
|
-
{ transform: 'translate(0,0) scale(1)', opacity: 1 },
|
|
53
|
-
{ transform: `translate(${Math.cos(angle) * d}px, ${Math.sin(angle) * d}px) scale(0.2)`, opacity: 0 },
|
|
54
|
-
], { duration: duration * (0.8 + Math.random() * 0.4), easing: 'cubic-bezier(0.22, 1, 0.36, 1)', fill: 'forwards' })
|
|
55
|
-
: null;
|
|
56
|
-
done(a, p);
|
|
57
|
-
}
|
|
58
|
-
return count;
|
|
59
|
-
}
|
|
60
|
-
/** A confetti cannon (paper pieces with gravity, drift and spin). */
|
|
61
|
-
function confetti(options = {}) {
|
|
62
|
-
if (typeof document === 'undefined' || base.prefersReducedMotion())
|
|
63
|
-
return 0;
|
|
64
|
-
const W = window.innerWidth || 800;
|
|
65
|
-
const H = window.innerHeight || 600;
|
|
66
|
-
const { x = W / 2, y = H * 0.66, count = 80, spread = 70, velocity = 1, colors = PALETTE, duration = 1600 } = options;
|
|
67
|
-
for (let i = 0; i < count; i++) {
|
|
68
|
-
const angle = ((-90 + (Math.random() - 0.5) * spread) * Math.PI) / 180;
|
|
69
|
-
const speed = (260 + Math.random() * 320) * velocity;
|
|
70
|
-
const vx = Math.cos(angle) * speed;
|
|
71
|
-
const vy = Math.sin(angle) * speed;
|
|
72
|
-
const p = particle(x, y, 6 + Math.random() * 5, colors[i % colors.length], Math.random() > 0.5 ? 'square' : 'circle');
|
|
73
|
-
p.style.height = `${4 + Math.random() * 3}px`;
|
|
74
|
-
const frames = [];
|
|
75
|
-
const steps = 8;
|
|
76
|
-
const T = duration / 1000;
|
|
77
|
-
const spin = (Math.random() - 0.5) * 1440;
|
|
78
|
-
for (let s = 0; s <= steps; s++) {
|
|
79
|
-
const t = (s / steps) * T;
|
|
80
|
-
const g = 900;
|
|
81
|
-
frames.push({
|
|
82
|
-
transform: `translate(${(vx * t * 0.8).toFixed(1)}px, ${(vy * t + 0.5 * g * t * t).toFixed(1)}px) rotate(${((spin * s) / steps).toFixed(0)}deg) rotateX(${s * 120}deg)`,
|
|
83
|
-
opacity: s === steps ? 0 : 1,
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
const a = typeof p.animate === 'function' ? p.animate(frames, { duration: duration * (0.85 + Math.random() * 0.3), easing: 'linear', fill: 'forwards' }) : null;
|
|
87
|
-
done(a, p);
|
|
88
|
-
}
|
|
89
|
-
return count;
|
|
90
|
-
}
|
|
91
|
-
/** Horizontal error shake (`intensity` px, default 8). Reduced motion: a red outline flash. */
|
|
92
|
-
function shake(el, intensity = 8, duration = 480) {
|
|
93
|
-
const t = el;
|
|
94
|
-
if (typeof t.animate !== 'function')
|
|
95
|
-
return null;
|
|
96
|
-
if (base.prefersReducedMotion())
|
|
97
|
-
return t.animate([{ outline: '2px solid #e5484d' }, { outline: '2px solid transparent' }], { duration: 600 });
|
|
98
|
-
const k = intensity;
|
|
99
|
-
return t.animate([0, -k, k, -k * 0.75, k * 0.75, -k * 0.4, k * 0.4, 0].map((v) => ({ transform: `translateX(${v}px)` })), { duration, easing: 'ease-in-out' });
|
|
100
|
-
}
|
|
101
|
-
/** `navigator.vibrate()` where supported (Android Chrome, some WebViews). Returns whether it ran. */
|
|
102
|
-
function haptic(pattern = 10) {
|
|
103
|
-
try {
|
|
104
|
-
return typeof navigator !== 'undefined' && typeof navigator.vibrate === 'function' ? navigator.vibrate(pattern) : false;
|
|
105
|
-
}
|
|
106
|
-
catch {
|
|
107
|
-
return false;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
3
|
+
var base = require('../chunks/base-B5i8qQPR.cjs');
|
|
4
|
+
var spring = require('../chunks/spring--oZh55tB.cjs');
|
|
5
|
+
var fx = require('../chunks/fx-B8hk1Fby.cjs');
|
|
110
6
|
|
|
111
7
|
var css$6 = "usa-click{position:relative;display:inline-block;overflow:hidden;isolation:isolate;border-radius:inherit;-webkit-tap-highlight-color:transparent;touch-action:manipulation}usa-click[block]{display:block}usa-click .usa-click-wave{position:absolute;border-radius:50%;pointer-events:none;z-index:-1;transform:scale(0);background:radial-gradient(circle,var(--usa-wave) 0 55%,color-mix(in srgb,var(--usa-wave) 40%,transparent) 70%,transparent 72%)}";
|
|
112
8
|
|
|
@@ -163,20 +59,20 @@ function defineClick(tag = 'usa-click') {
|
|
|
163
59
|
x = r.left + r.width / 2;
|
|
164
60
|
y = r.top + r.height / 2;
|
|
165
61
|
}
|
|
166
|
-
const fx = this.effects;
|
|
62
|
+
const fx$1 = this.effects;
|
|
167
63
|
const colors = this.str('color') ? this.str('color').split(',') : undefined;
|
|
168
|
-
if (fx.includes('burst'))
|
|
169
|
-
burst(x, y, { count: this.num('count', 12), shape: this.str('shape', 'circle'), colors });
|
|
170
|
-
if (fx.includes('confetti'))
|
|
171
|
-
confetti({ x, y, count: this.num('count', 60), colors, spread: 90, velocity: 0.8 });
|
|
64
|
+
if (fx$1.includes('burst'))
|
|
65
|
+
fx.burst(x, y, { count: this.num('count', 12), shape: this.str('shape', 'circle'), colors });
|
|
66
|
+
if (fx$1.includes('confetti'))
|
|
67
|
+
fx.confetti({ x, y, count: this.num('count', 60), colors, spread: 90, velocity: 0.8 });
|
|
172
68
|
if (this.hasAttribute('haptic'))
|
|
173
|
-
haptic(this.num('haptic', 10));
|
|
174
|
-
this.emit('click-effect', { x, y, effects: fx });
|
|
69
|
+
fx.haptic(this.num('haptic', 10));
|
|
70
|
+
this.emit('click-effect', { x, y, effects: fx$1 });
|
|
175
71
|
}
|
|
176
72
|
shake() {
|
|
177
|
-
shake(this);
|
|
73
|
+
fx.shake(this);
|
|
178
74
|
if (this.hasAttribute('haptic'))
|
|
179
|
-
haptic([30, 40, 30]);
|
|
75
|
+
fx.haptic([30, 40, 30]);
|
|
180
76
|
}
|
|
181
77
|
ripple(x, y) {
|
|
182
78
|
if (this.reduced)
|
|
@@ -324,7 +220,7 @@ function defineButton(tag = 'usa-button') {
|
|
|
324
220
|
if (this.deforms().includes('wobble'))
|
|
325
221
|
this.wobble();
|
|
326
222
|
if (this.hasAttribute('haptic'))
|
|
327
|
-
haptic(this.num('haptic', 10));
|
|
223
|
+
fx.haptic(this.num('haptic', 10));
|
|
328
224
|
if (this.str('morph') === 'submit' && this.state === 'idle')
|
|
329
225
|
this.submit();
|
|
330
226
|
});
|
|
@@ -479,9 +375,9 @@ function defineButton(tag = 'usa-button') {
|
|
|
479
375
|
t.removeAttribute('aria-busy');
|
|
480
376
|
}
|
|
481
377
|
if (s === 'error') {
|
|
482
|
-
shake(t);
|
|
378
|
+
fx.shake(t);
|
|
483
379
|
if (this.hasAttribute('haptic'))
|
|
484
|
-
haptic([30, 40, 30]);
|
|
380
|
+
fx.haptic([30, 40, 30]);
|
|
485
381
|
}
|
|
486
382
|
if (s === 'success' && !this.reduced) {
|
|
487
383
|
const ok = t.querySelector('.usa-button-ok');
|
|
@@ -685,10 +581,10 @@ function defineLike(tag = 'usa-like') {
|
|
|
685
581
|
if (next && heart && !this.reduced) {
|
|
686
582
|
this.motion(heart, [{ transform: 'scale(0.4)' }, { transform: 'scale(1)' }], spring.springEasing('bouncy'));
|
|
687
583
|
const r = heart.getBoundingClientRect();
|
|
688
|
-
burst(r.left + r.width / 2, r.top + r.height / 2, { count: 10, distance: 28, size: 5, colors: [getComputedStyle(this).getPropertyValue('--usa-like-color').trim() || '#f43f5e', '#fb923c', '#facc15'] });
|
|
584
|
+
fx.burst(r.left + r.width / 2, r.top + r.height / 2, { count: 10, distance: 28, size: 5, colors: [getComputedStyle(this).getPropertyValue('--usa-like-color').trim() || '#f43f5e', '#fb923c', '#facc15'] });
|
|
689
585
|
}
|
|
690
586
|
if (this.hasAttribute('haptic'))
|
|
691
|
-
haptic(this.num('haptic', 12));
|
|
587
|
+
fx.haptic(this.num('haptic', 12));
|
|
692
588
|
this.dispatchEvent(new Event('change', { bubbles: true }));
|
|
693
589
|
this.emit('change', { liked: next, count: this.count });
|
|
694
590
|
}
|
|
@@ -766,7 +662,7 @@ function defineHold(tag = 'usa-hold') {
|
|
|
766
662
|
this.removeAttribute('data-holding');
|
|
767
663
|
this.setAttribute('data-done', '');
|
|
768
664
|
if (this.hasAttribute('haptic'))
|
|
769
|
-
haptic(20);
|
|
665
|
+
fx.haptic(20);
|
|
770
666
|
this.emit('confirm');
|
|
771
667
|
setTimeout(() => {
|
|
772
668
|
this.removeAttribute('data-done');
|
|
@@ -862,9 +758,9 @@ function defineDoubleTap(tag = 'usa-double-tap') {
|
|
|
862
758
|
a.onfinish = () => icon.remove();
|
|
863
759
|
else
|
|
864
760
|
icon.remove();
|
|
865
|
-
burst(x, y, { count: 8, distance: 40, size: 5, colors: [this.str('color', '#f43f5e'), '#fb923c', '#facc15'] });
|
|
761
|
+
fx.burst(x, y, { count: 8, distance: 40, size: 5, colors: [this.str('color', '#f43f5e'), '#fb923c', '#facc15'] });
|
|
866
762
|
if (this.hasAttribute('haptic'))
|
|
867
|
-
haptic(15);
|
|
763
|
+
fx.haptic(15);
|
|
868
764
|
this.emit('double-tap', { x: x - r.left, y: y - r.top });
|
|
869
765
|
}
|
|
870
766
|
}, { id: 'double-tap', text: css$1 });
|
|
@@ -964,13 +860,13 @@ function defineClickComponents() {
|
|
|
964
860
|
defineCheckbox();
|
|
965
861
|
}
|
|
966
862
|
|
|
967
|
-
exports.
|
|
968
|
-
exports.
|
|
863
|
+
exports.burst = fx.burst;
|
|
864
|
+
exports.confetti = fx.confetti;
|
|
865
|
+
exports.haptic = fx.haptic;
|
|
866
|
+
exports.shake = fx.shake;
|
|
969
867
|
exports.BUTTON_DEFORMS = BUTTON_DEFORMS;
|
|
970
868
|
exports.CLICK_EFFECTS = CLICK_EFFECTS;
|
|
971
869
|
exports.MORPH_ICONS = MORPH_ICONS;
|
|
972
|
-
exports.burst = burst;
|
|
973
|
-
exports.confetti = confetti;
|
|
974
870
|
exports.defineButton = defineButton;
|
|
975
871
|
exports.defineCheckbox = defineCheckbox;
|
|
976
872
|
exports.defineClick = defineClick;
|
|
@@ -979,7 +875,5 @@ exports.defineDoubleTap = defineDoubleTap;
|
|
|
979
875
|
exports.defineHold = defineHold;
|
|
980
876
|
exports.defineIconMorph = defineIconMorph;
|
|
981
877
|
exports.defineLike = defineLike;
|
|
982
|
-
exports.haptic = haptic;
|
|
983
878
|
exports.morphPath = morphPath;
|
|
984
|
-
exports.shake = shake;
|
|
985
879
|
//# sourceMappingURL=click.cjs.map
|