use-scroll-animate 2.2.0 → 2.4.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 +23 -0
- package/README.md +3 -1
- package/README_ja.md +2 -0
- package/README_zh.md +2 -0
- package/dist/chunks/{base-BiTc85p_.cjs → base-CJ7XfidP.cjs} +2 -1
- package/dist/chunks/{base-BiTc85p_.cjs.map → base-CJ7XfidP.cjs.map} +1 -1
- package/dist/chunks/{base-CFtnmfli.js → base-CuvCgqLy.js} +2 -2
- package/dist/chunks/{base-CFtnmfli.js.map → base-CuvCgqLy.js.map} +1 -1
- package/dist/chunks/spring-BKUU7-Xm.js +219 -0
- package/dist/chunks/spring-BKUU7-Xm.js.map +1 -0
- package/dist/chunks/spring-CGO9Jd9b.cjs +232 -0
- package/dist/chunks/spring-CGO9Jd9b.cjs.map +1 -0
- package/dist/components/background.cjs +1 -1
- package/dist/components/background.js +2 -2
- package/dist/components/cards.cjs +563 -0
- package/dist/components/cards.cjs.map +1 -0
- package/dist/components/cards.css +6 -0
- package/dist/components/cards.d.cts +142 -0
- package/dist/components/cards.d.ts +142 -0
- package/dist/components/cards.js +555 -0
- package/dist/components/cards.js.map +1 -0
- package/dist/components/feedback.cjs +1 -1
- package/dist/components/feedback.js +2 -2
- package/dist/components/interaction.cjs +1 -1
- package/dist/components/interaction.js +2 -2
- package/dist/components/physics.cjs +450 -0
- package/dist/components/physics.cjs.map +1 -0
- package/dist/components/physics.css +5 -0
- package/dist/components/physics.d.cts +216 -0
- package/dist/components/physics.d.ts +216 -0
- package/dist/components/physics.js +431 -0
- package/dist/components/physics.js.map +1 -0
- package/dist/components/reveal.cjs +1 -1
- package/dist/components/reveal.js +2 -2
- package/dist/components/text.cjs +1 -1
- package/dist/components/text.js +2 -2
- package/dist/components/transitions.cjs +1 -1
- package/dist/components/transitions.js +2 -2
- package/dist/components.cjs +32 -1
- package/dist/components.cjs.map +1 -1
- package/dist/components.css +7 -0
- package/dist/components.d.cts +284 -2
- package/dist/components.d.ts +284 -2
- package/dist/components.js +11 -2
- package/dist/components.js.map +1 -1
- package/dist/components.umd.js +2 -2
- package/dist/components.umd.js.map +1 -1
- package/docs/components.md +23 -0
- package/package.json +25 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cards.cjs","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': UsaCarousel3dElement;\n }\n}\n"],"names":["defineElement","clamp","raf","caf","springEasing","EASE_OUT","css","createSpring"],"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,OAAOA,kBAAa,CAClB,GAAG,EACH,CAAC,IAAI,KACH,MAAM,OAAQ,SAAQ,IAA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,CAAC,CAAC,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;AACxC,YAAA,IAAI,KAAK,GAAG,CAAC,GAAG,CAAC;gBAAE,KAAK,IAAI,CAAC;AAC7B,YAAA,IAAI,CAAC,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;AAaH;SACgB,oBAAoB,GAAA;AAClC,IAAA,UAAU,EAAE;AACZ,IAAA,eAAe,EAAE;AACjB,IAAA,iBAAiB,EAAE;AACnB,IAAA,gBAAgB,EAAE;AACpB;;;;;;;;;;;"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/* use-scroll-animate/components/cards */
|
|
2
|
+
.usa-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0}
|
|
3
|
+
usa-card-stack{position:relative;display:grid;touch-action:pan-y;user-select:none;-webkit-user-select:none}usa-card-stack>*{grid-area:1 / 1;transform-origin:50% 100%;transition:transform 0.35s cubic-bezier(0.34,1.3,0.64,1),opacity 0.3s ease;will-change:transform}usa-card-stack>[data-top]{cursor:grab}usa-card-stack[data-dragging]>*,usa-card-stack>[data-top]{transition:none}usa-card-stack:focus-visible{outline:2px solid var(--usa-accent,#7c5cff);outline-offset:4px;border-radius:12px}@media (prefers-reduced-motion:reduce){usa-card-stack>*{transition:none}}
|
|
4
|
+
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}}
|
|
5
|
+
usa-carousel-3d{position:relative;display:grid;place-items:center;perspective:var(--usa-c3d-perspective,1200px);transform-style:preserve-3d;touch-action:pan-y;user-select:none;-webkit-user-select:none;min-height:220px}usa-carousel-3d>*{grid-area:1 / 1;backface-visibility:hidden;transition:opacity 0.3s ease;cursor:pointer}usa-carousel-3d>[aria-current]{cursor:default}usa-carousel-3d:focus-visible{outline:2px solid var(--usa-accent,#7c5cff);outline-offset:4px;border-radius:12px}@media (prefers-reduced-motion:reduce){usa-carousel-3d{perspective:none}usa-carousel-3d>:not([aria-current]){visibility:hidden}}
|
|
6
|
+
usa-sticky-stack{display:grid;gap:28vh;padding-bottom:10vh}usa-sticky-stack>*{position:sticky;transform-origin:50% 0;will-change:transform}
|
|
@@ -0,0 +1,142 @@
|
|
|
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
|
+
/** Change global component settings (call before `define*()` for `injectStyles`). */
|
|
25
|
+
declare function configureComponents(options: ComponentsConfig): void;
|
|
26
|
+
/** `true` when animations should be reduced (OS setting or `configureComponents`). */
|
|
27
|
+
declare function prefersReducedMotion(): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Members shared by every `<usa-*>` element. Attribute helpers, a cleanup
|
|
30
|
+
* bag that is emptied on disconnect, and motion helpers that degrade to the
|
|
31
|
+
* final state without WAAPI or under reduced motion.
|
|
32
|
+
*/
|
|
33
|
+
interface UsaElement extends HTMLElement {
|
|
34
|
+
/** `true` while reduced motion applies to this element. */
|
|
35
|
+
readonly reduced: boolean;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
declare const CARD_EFFECTS: readonly ["flip", "holo", "glass", "border-glow", "conic-border", "lift", "spotlight", "sheen", "parallax-layers", "expand"];
|
|
39
|
+
type CardEffect = (typeof CARD_EFFECTS)[number];
|
|
40
|
+
/**
|
|
41
|
+
* `<usa-card>` — card effects, combinable: `effect="lift sheen"`.
|
|
42
|
+
*
|
|
43
|
+
* - `flip` — front/back (`[data-front]` / `[data-back]` children) flip on
|
|
44
|
+
* hover or `trigger="click"`, `axis="y"` (default, horizontal flip) or `x`.
|
|
45
|
+
* - `holo` — holographic foil that shifts with the pointer.
|
|
46
|
+
* - `glass` — frosted glass surface (backdrop blur).
|
|
47
|
+
* - `border-glow` — a glow on the border that follows the pointer.
|
|
48
|
+
* - `conic-border` — a rotating conic-gradient border.
|
|
49
|
+
* - `lift` — rises with a deeper shadow and a slight pointer tilt.
|
|
50
|
+
* - `spotlight` — a soft light that follows the pointer.
|
|
51
|
+
* - `sheen` — a light sweep across the card on hover / focus.
|
|
52
|
+
* - `parallax-layers` — children with `data-depth="0.2…1"` move at different depths.
|
|
53
|
+
* - `expand` — click to grow into a full detail view (`[data-detail]`
|
|
54
|
+
* content is shown), FLIP + spring; Esc, `[data-close]` or the backdrop closes.
|
|
55
|
+
*
|
|
56
|
+
* Attributes: `effect`, `axis`, `trigger`, `depth` (parallax px, 16),
|
|
57
|
+
* `color` (glow / spotlight colour), `flipped`, `expanded`, `disabled`.
|
|
58
|
+
* CSS variables: `--usa-card-x/-y` (pointer %, 0–100), `--usa-card-nx/-ny` (−1…1).
|
|
59
|
+
* Methods: `flip(force?)`, `expand()`, `collapse()`. Events: `usa:flip`,
|
|
60
|
+
* `usa:expand`, `usa:collapse`. Reduced motion: no tilt / parallax / sweep;
|
|
61
|
+
* flips and expansions cross-fade.
|
|
62
|
+
*/
|
|
63
|
+
interface UsaCardElement extends UsaElement {
|
|
64
|
+
readonly effects: string[];
|
|
65
|
+
flipped: boolean;
|
|
66
|
+
readonly expanded: boolean;
|
|
67
|
+
flip(force?: boolean): void;
|
|
68
|
+
expand(): Promise<void>;
|
|
69
|
+
collapse(): Promise<void>;
|
|
70
|
+
}
|
|
71
|
+
declare function defineCard(tag?: string): CustomElementConstructor | undefined;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* `<usa-card-stack>` — a deck of cards (its element children). The top card
|
|
75
|
+
* can be swiped away left or right (pointer, touch or arrow keys); the rest
|
|
76
|
+
* fan out behind it and move up with a spring.
|
|
77
|
+
*
|
|
78
|
+
* Attributes: `threshold` (px to dismiss, 90), `visible` (cards fanned
|
|
79
|
+
* behind, 3), `offset` (px between cards, 10), `loop` (swiped cards go back
|
|
80
|
+
* to the bottom), `disabled`. Methods: `swipe(direction)`, `top`. Events:
|
|
81
|
+
* `usa:swipe` (`{ direction: 'left' | 'right', card }`), `usa:empty`.
|
|
82
|
+
* Reduced motion: cards are removed instantly, no rotation.
|
|
83
|
+
*/
|
|
84
|
+
interface UsaCardStackElement extends UsaElement {
|
|
85
|
+
readonly top: HTMLElement | null;
|
|
86
|
+
swipe(direction: 'left' | 'right'): Promise<void>;
|
|
87
|
+
}
|
|
88
|
+
declare function defineCardStack(tag?: string): CustomElementConstructor | undefined;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* `<usa-sticky-stack>` — cards (element children) stick to the top while
|
|
92
|
+
* scrolling and the ones underneath scale down and dim as the next card
|
|
93
|
+
* slides over them, like a deck building up.
|
|
94
|
+
*
|
|
95
|
+
* Attributes: `top` (px from the viewport top, 80), `gap` (px each card
|
|
96
|
+
* peeks below the previous, 16), `scale` (how much a covered card shrinks,
|
|
97
|
+
* 0.06). Reduced motion: cards still stack (sticky) but do not scale.
|
|
98
|
+
*/
|
|
99
|
+
interface UsaStickyStackElement extends UsaElement {
|
|
100
|
+
update(): void;
|
|
101
|
+
}
|
|
102
|
+
declare function defineStickyStack(tag?: string): CustomElementConstructor | undefined;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* `<usa-carousel-3d>` — its element children on a 3D ring. Rotate with the
|
|
106
|
+
* arrow keys, a drag/swipe, the wheel (shift) or `next()` / `prev()`; the
|
|
107
|
+
* front item is `aria-current`. Spring-driven rotation.
|
|
108
|
+
*
|
|
109
|
+
* Attributes: `radius` (px, auto from item width), `autoplay` (ms between
|
|
110
|
+
* steps, pauses on hover/focus), `perspective` (px, 1200), `index`.
|
|
111
|
+
* Events: `usa:change` (`{ index }`). Reduced motion: a flat, instant
|
|
112
|
+
* switch (only the current item is shown, others dimmed).
|
|
113
|
+
*/
|
|
114
|
+
interface UsaCarousel3dElement extends UsaElement {
|
|
115
|
+
index: number;
|
|
116
|
+
next(): void;
|
|
117
|
+
prev(): void;
|
|
118
|
+
goTo(i: number): void;
|
|
119
|
+
}
|
|
120
|
+
declare function defineCarousel3d(tag?: string): CustomElementConstructor | undefined;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* use-scroll-animate/components/cards — card effects (v2.4).
|
|
124
|
+
* `<usa-card effect="flip | holo | glass | border-glow | conic-border | lift |
|
|
125
|
+
* spotlight | sheen | parallax-layers | expand">` (combinable),
|
|
126
|
+
* `<usa-card-stack>` (swipeable deck), `<usa-sticky-stack>` (stacking on
|
|
127
|
+
* scroll) and `<usa-carousel-3d>`.
|
|
128
|
+
*/
|
|
129
|
+
|
|
130
|
+
/** Register every component of this category under its default tag. */
|
|
131
|
+
declare function defineCardComponents(): void;
|
|
132
|
+
declare global {
|
|
133
|
+
interface HTMLElementTagNameMap {
|
|
134
|
+
'usa-card': UsaCardElement;
|
|
135
|
+
'usa-card-stack': UsaCardStackElement;
|
|
136
|
+
'usa-sticky-stack': UsaStickyStackElement;
|
|
137
|
+
'usa-carousel-3d': UsaCarousel3dElement;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export { CARD_EFFECTS, configureComponents, defineCard, defineCardComponents, defineCardStack, defineCarousel3d, defineStickyStack, prefersReducedMotion };
|
|
142
|
+
export type { CardEffect, ComponentsConfig, UsaCardElement, UsaCardStackElement, UsaCarousel3dElement, UsaElement, UsaStickyStackElement };
|
|
@@ -0,0 +1,142 @@
|
|
|
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
|
+
/** Change global component settings (call before `define*()` for `injectStyles`). */
|
|
25
|
+
declare function configureComponents(options: ComponentsConfig): void;
|
|
26
|
+
/** `true` when animations should be reduced (OS setting or `configureComponents`). */
|
|
27
|
+
declare function prefersReducedMotion(): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Members shared by every `<usa-*>` element. Attribute helpers, a cleanup
|
|
30
|
+
* bag that is emptied on disconnect, and motion helpers that degrade to the
|
|
31
|
+
* final state without WAAPI or under reduced motion.
|
|
32
|
+
*/
|
|
33
|
+
interface UsaElement extends HTMLElement {
|
|
34
|
+
/** `true` while reduced motion applies to this element. */
|
|
35
|
+
readonly reduced: boolean;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
declare const CARD_EFFECTS: readonly ["flip", "holo", "glass", "border-glow", "conic-border", "lift", "spotlight", "sheen", "parallax-layers", "expand"];
|
|
39
|
+
type CardEffect = (typeof CARD_EFFECTS)[number];
|
|
40
|
+
/**
|
|
41
|
+
* `<usa-card>` — card effects, combinable: `effect="lift sheen"`.
|
|
42
|
+
*
|
|
43
|
+
* - `flip` — front/back (`[data-front]` / `[data-back]` children) flip on
|
|
44
|
+
* hover or `trigger="click"`, `axis="y"` (default, horizontal flip) or `x`.
|
|
45
|
+
* - `holo` — holographic foil that shifts with the pointer.
|
|
46
|
+
* - `glass` — frosted glass surface (backdrop blur).
|
|
47
|
+
* - `border-glow` — a glow on the border that follows the pointer.
|
|
48
|
+
* - `conic-border` — a rotating conic-gradient border.
|
|
49
|
+
* - `lift` — rises with a deeper shadow and a slight pointer tilt.
|
|
50
|
+
* - `spotlight` — a soft light that follows the pointer.
|
|
51
|
+
* - `sheen` — a light sweep across the card on hover / focus.
|
|
52
|
+
* - `parallax-layers` — children with `data-depth="0.2…1"` move at different depths.
|
|
53
|
+
* - `expand` — click to grow into a full detail view (`[data-detail]`
|
|
54
|
+
* content is shown), FLIP + spring; Esc, `[data-close]` or the backdrop closes.
|
|
55
|
+
*
|
|
56
|
+
* Attributes: `effect`, `axis`, `trigger`, `depth` (parallax px, 16),
|
|
57
|
+
* `color` (glow / spotlight colour), `flipped`, `expanded`, `disabled`.
|
|
58
|
+
* CSS variables: `--usa-card-x/-y` (pointer %, 0–100), `--usa-card-nx/-ny` (−1…1).
|
|
59
|
+
* Methods: `flip(force?)`, `expand()`, `collapse()`. Events: `usa:flip`,
|
|
60
|
+
* `usa:expand`, `usa:collapse`. Reduced motion: no tilt / parallax / sweep;
|
|
61
|
+
* flips and expansions cross-fade.
|
|
62
|
+
*/
|
|
63
|
+
interface UsaCardElement extends UsaElement {
|
|
64
|
+
readonly effects: string[];
|
|
65
|
+
flipped: boolean;
|
|
66
|
+
readonly expanded: boolean;
|
|
67
|
+
flip(force?: boolean): void;
|
|
68
|
+
expand(): Promise<void>;
|
|
69
|
+
collapse(): Promise<void>;
|
|
70
|
+
}
|
|
71
|
+
declare function defineCard(tag?: string): CustomElementConstructor | undefined;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* `<usa-card-stack>` — a deck of cards (its element children). The top card
|
|
75
|
+
* can be swiped away left or right (pointer, touch or arrow keys); the rest
|
|
76
|
+
* fan out behind it and move up with a spring.
|
|
77
|
+
*
|
|
78
|
+
* Attributes: `threshold` (px to dismiss, 90), `visible` (cards fanned
|
|
79
|
+
* behind, 3), `offset` (px between cards, 10), `loop` (swiped cards go back
|
|
80
|
+
* to the bottom), `disabled`. Methods: `swipe(direction)`, `top`. Events:
|
|
81
|
+
* `usa:swipe` (`{ direction: 'left' | 'right', card }`), `usa:empty`.
|
|
82
|
+
* Reduced motion: cards are removed instantly, no rotation.
|
|
83
|
+
*/
|
|
84
|
+
interface UsaCardStackElement extends UsaElement {
|
|
85
|
+
readonly top: HTMLElement | null;
|
|
86
|
+
swipe(direction: 'left' | 'right'): Promise<void>;
|
|
87
|
+
}
|
|
88
|
+
declare function defineCardStack(tag?: string): CustomElementConstructor | undefined;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* `<usa-sticky-stack>` — cards (element children) stick to the top while
|
|
92
|
+
* scrolling and the ones underneath scale down and dim as the next card
|
|
93
|
+
* slides over them, like a deck building up.
|
|
94
|
+
*
|
|
95
|
+
* Attributes: `top` (px from the viewport top, 80), `gap` (px each card
|
|
96
|
+
* peeks below the previous, 16), `scale` (how much a covered card shrinks,
|
|
97
|
+
* 0.06). Reduced motion: cards still stack (sticky) but do not scale.
|
|
98
|
+
*/
|
|
99
|
+
interface UsaStickyStackElement extends UsaElement {
|
|
100
|
+
update(): void;
|
|
101
|
+
}
|
|
102
|
+
declare function defineStickyStack(tag?: string): CustomElementConstructor | undefined;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* `<usa-carousel-3d>` — its element children on a 3D ring. Rotate with the
|
|
106
|
+
* arrow keys, a drag/swipe, the wheel (shift) or `next()` / `prev()`; the
|
|
107
|
+
* front item is `aria-current`. Spring-driven rotation.
|
|
108
|
+
*
|
|
109
|
+
* Attributes: `radius` (px, auto from item width), `autoplay` (ms between
|
|
110
|
+
* steps, pauses on hover/focus), `perspective` (px, 1200), `index`.
|
|
111
|
+
* Events: `usa:change` (`{ index }`). Reduced motion: a flat, instant
|
|
112
|
+
* switch (only the current item is shown, others dimmed).
|
|
113
|
+
*/
|
|
114
|
+
interface UsaCarousel3dElement extends UsaElement {
|
|
115
|
+
index: number;
|
|
116
|
+
next(): void;
|
|
117
|
+
prev(): void;
|
|
118
|
+
goTo(i: number): void;
|
|
119
|
+
}
|
|
120
|
+
declare function defineCarousel3d(tag?: string): CustomElementConstructor | undefined;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* use-scroll-animate/components/cards — card effects (v2.4).
|
|
124
|
+
* `<usa-card effect="flip | holo | glass | border-glow | conic-border | lift |
|
|
125
|
+
* spotlight | sheen | parallax-layers | expand">` (combinable),
|
|
126
|
+
* `<usa-card-stack>` (swipeable deck), `<usa-sticky-stack>` (stacking on
|
|
127
|
+
* scroll) and `<usa-carousel-3d>`.
|
|
128
|
+
*/
|
|
129
|
+
|
|
130
|
+
/** Register every component of this category under its default tag. */
|
|
131
|
+
declare function defineCardComponents(): void;
|
|
132
|
+
declare global {
|
|
133
|
+
interface HTMLElementTagNameMap {
|
|
134
|
+
'usa-card': UsaCardElement;
|
|
135
|
+
'usa-card-stack': UsaCardStackElement;
|
|
136
|
+
'usa-sticky-stack': UsaStickyStackElement;
|
|
137
|
+
'usa-carousel-3d': UsaCarousel3dElement;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export { CARD_EFFECTS, configureComponents, defineCard, defineCardComponents, defineCardStack, defineCarousel3d, defineStickyStack, prefersReducedMotion };
|
|
142
|
+
export type { CardEffect, ComponentsConfig, UsaCardElement, UsaCardStackElement, UsaCarousel3dElement, UsaElement, UsaStickyStackElement };
|