use-scroll-animate 3.2.0 → 3.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.
Files changed (51) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +2 -0
  3. package/README_ja.md +2 -0
  4. package/README_zh.md +2 -0
  5. package/dist/chunks/{index-tags-DCTX4F9b.cjs → index-tags-BKcHAxBK.cjs} +3 -1
  6. package/dist/chunks/index-tags-BKcHAxBK.cjs.map +1 -0
  7. package/dist/chunks/{index-tags-DZ-gjMZc.js → index-tags-qc6OWsJ8.js} +3 -1
  8. package/dist/chunks/index-tags-qc6OWsJ8.js.map +1 -0
  9. package/dist/components/jsx.d.cts +2 -0
  10. package/dist/components/jsx.d.ts +2 -0
  11. package/dist/components/lazy.cjs +3 -1
  12. package/dist/components/lazy.cjs.map +1 -1
  13. package/dist/components/lazy.d.cts +2 -0
  14. package/dist/components/lazy.d.ts +2 -0
  15. package/dist/components/lazy.js +3 -1
  16. package/dist/components/lazy.js.map +1 -1
  17. package/dist/components/react.cjs +1 -1
  18. package/dist/components/react.js +1 -1
  19. package/dist/components/svg.cjs +355 -0
  20. package/dist/components/svg.cjs.map +1 -0
  21. package/dist/components/svg.css +3 -0
  22. package/dist/components/svg.d.cts +148 -0
  23. package/dist/components/svg.d.ts +148 -0
  24. package/dist/components/svg.js +342 -0
  25. package/dist/components/svg.js.map +1 -0
  26. package/dist/components/vue.cjs +3 -1
  27. package/dist/components/vue.cjs.map +1 -1
  28. package/dist/components/vue.d.cts +91 -0
  29. package/dist/components/vue.d.ts +91 -0
  30. package/dist/components/vue.js +3 -1
  31. package/dist/components/vue.js.map +1 -1
  32. package/dist/components/webgl.cjs +277 -0
  33. package/dist/components/webgl.cjs.map +1 -0
  34. package/dist/components/webgl.css +3 -0
  35. package/dist/components/webgl.d.cts +114 -0
  36. package/dist/components/webgl.d.ts +114 -0
  37. package/dist/components/webgl.js +267 -0
  38. package/dist/components/webgl.js.map +1 -0
  39. package/dist/components.cjs +24 -1
  40. package/dist/components.cjs.map +1 -1
  41. package/dist/components.css +2 -0
  42. package/dist/components.d.cts +172 -2
  43. package/dist/components.d.ts +172 -2
  44. package/dist/components.js +8 -2
  45. package/dist/components.js.map +1 -1
  46. package/dist/components.umd.js +2 -2
  47. package/dist/components.umd.js.map +1 -1
  48. package/docs/components.md +21 -0
  49. package/package.json +24 -2
  50. package/dist/chunks/index-tags-DCTX4F9b.cjs.map +0 -1
  51. package/dist/chunks/index-tags-DZ-gjMZc.js.map +0 -1
@@ -248,6 +248,27 @@ Positions: `'>'` chain (default) · `'<'` with previous · `'-=200'` overlap ·
248
248
  | `<usa-swipeable>` | Swipe to dismiss, spring home | `axis`, `distance` (120), `preset`, `dismiss`; `usa:swipe`, `usa:dismiss`; `swipe(dir)`, `reset()` |
249
249
  | `<usa-pinch-zoom>` | Pinch / Ctrl+wheel zoom + pan | `min` (1), `max` (4), `double-tap` (2), `preset`; `zoomTo(k)`, `usa:zoom` |
250
250
 
251
+ ### v3.3 SVG (`components/svg`)
252
+
253
+ | Element / API | What it does | Key attributes |
254
+ |---|---|---|
255
+ | `<usa-draw>` | Strokes draw themselves | `trigger` (`view` · `hover` · `click` · `scrub`), `duration` (1600), `stagger` (0.2), `fill`, `repeat`; `progress`, `play()` |
256
+ | `<usa-morph>` | Path morph through shapes | `paths="A \| B"`, `trigger` (`click` · `hover` · `view` · `auto`), `interval` (2000), `duration` (600); `next()`, `usa:change` |
257
+ | `<usa-mask-reveal>` | Mask / clip-path reveal | `shape` (`circle` · `diamond` · `star` · `iris` · `wipe` · `wipe-up`), `at`, `duration` (900), `trigger`, `repeat` |
258
+ | `<usa-anim-icon>` | Animated stroke icons | `name` (`bell` · `heart` · `check` · `arrow` · `star` · `gear` · `search` · `download`), `size`, `label`, `trigger` (`hover` · `click` · `view` · `loop`) |
259
+ | `morphTo(path, d, opts)` · `interpolatePath(a, b, t)` · `drawLines(root)` | Path helpers | `duration`, `easing`; `stagger` |
260
+
261
+ ### v3.4 Canvas & WebGL (`components/webgl`)
262
+
263
+ | Element / API | What it does | Key attributes |
264
+ |---|---|---|
265
+ | `<usa-shader>` | GPU shader background | `preset` (`gradient` · `plasma` · `waves` · `aurora`), `speed` (1); custom `<script type="x-shader/x-fragment">` |
266
+ | `<usa-distort>` | Hover distortion + RGB split on the `<img>` inside | — (fallback: CSS zoom) |
267
+ | `<usa-liquid>` | Click ripples + hover wobble on the `<img>` inside | `strength` (1) |
268
+ | `glQuad(canvas, frag)` · `supportsWebGL()` | Single-quad WebGL runner | `render({ time, mouse, hover, ripples })`, `resize()`, `texture(img)`, `dispose()` |
269
+
270
+ Fallbacks set `data-fallback` (`webgl` · `image` · `no-image`); cross-origin images need CORS headers.
271
+
251
272
  ## Frameworks
252
273
 
253
274
  Custom elements work in every framework. Register once (e.g. in your entry file), then use the tags.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "use-scroll-animate",
3
- "version": "3.2.0",
3
+ "version": "3.4.0",
4
4
  "description": "A lightweight, high-performance, dependency-free scroll animation library and animated UI components (Web Components) for the web and Windows web-view apps.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -208,6 +208,26 @@
208
208
  "default": "./dist/components/gesture.cjs"
209
209
  }
210
210
  },
211
+ "./components/svg": {
212
+ "import": {
213
+ "types": "./dist/components/svg.d.ts",
214
+ "default": "./dist/components/svg.js"
215
+ },
216
+ "require": {
217
+ "types": "./dist/components/svg.d.cts",
218
+ "default": "./dist/components/svg.cjs"
219
+ }
220
+ },
221
+ "./components/webgl": {
222
+ "import": {
223
+ "types": "./dist/components/webgl.d.ts",
224
+ "default": "./dist/components/webgl.js"
225
+ },
226
+ "require": {
227
+ "types": "./dist/components/webgl.d.cts",
228
+ "default": "./dist/components/webgl.cjs"
229
+ }
230
+ },
211
231
  "./components/react": {
212
232
  "import": {
213
233
  "types": "./dist/components/react.d.ts",
@@ -262,6 +282,8 @@
262
282
  "./components/page.css": "./dist/components/page.css",
263
283
  "./components/timeline.css": "./dist/components/timeline.css",
264
284
  "./components/gesture.css": "./dist/components/gesture.css",
285
+ "./components/svg.css": "./dist/components/svg.css",
286
+ "./components/webgl.css": "./dist/components/webgl.css",
265
287
  "./package.json": "./package.json"
266
288
  },
267
289
  "files": [
@@ -282,7 +304,7 @@
282
304
  "typecheck": "tsc --noEmit -p .",
283
305
  "test": "vitest run",
284
306
  "check:exports": "node scripts/check-exports.mjs",
285
- "lint:package": "publint && attw --pack . --profile node16 --exclude-entrypoints ./components.css ./components/reveal.css ./components/text.css ./components/interaction.css ./components/feedback.css ./components/background.css ./components/transitions.css ./components/physics.css ./components/cards.css ./components/click.css ./components/ui.css ./components/page.css ./components/timeline.css ./components/gesture.css",
307
+ "lint:package": "publint && attw --pack . --profile node16 --exclude-entrypoints ./components.css ./components/reveal.css ./components/text.css ./components/interaction.css ./components/feedback.css ./components/background.css ./components/transitions.css ./components/physics.css ./components/cards.css ./components/click.css ./components/ui.css ./components/page.css ./components/timeline.css ./components/gesture.css ./components/svg.css ./components/webgl.css",
286
308
  "size": "node scripts/size.mjs",
287
309
  "prepublishOnly": "npm run typecheck && npm test && npm run build && npm run check:exports",
288
310
  "size:check": "node scripts/size.mjs --check",
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-tags-DCTX4F9b.cjs","sources":["../../src/components/index-tags.ts"],"sourcesContent":["// The component categories and their default tags (no imports: safe for lazy loaders).\n/** The component categories and their default tags. */\nexport const COMPONENT_CATEGORIES = {\n reveal: ['usa-reveal', 'usa-stagger', 'usa-scroll-progress', 'usa-scrolly'],\n text: ['usa-typewriter', 'usa-split-text', 'usa-scramble', 'usa-counter', 'usa-shimmer-text', 'usa-text-rotate', 'usa-wave-text', 'usa-glitch', 'usa-gradient-text', 'usa-handwriting', 'usa-scroll-highlight'],\n interaction: ['usa-ripple', 'usa-magnetic', 'usa-tilt', 'usa-spotlight', 'usa-press', 'usa-toggle'],\n feedback: ['usa-spinner', 'usa-skeleton', 'usa-progress', 'usa-toaster', 'usa-check'],\n background: ['usa-aurora', 'usa-particles', 'usa-grain', 'usa-marquee', 'usa-acrylic', 'usa-grid-glow', 'usa-blobs', 'usa-water-ripple', 'usa-dot-network'],\n transitions: ['usa-dialog', 'usa-accordion', 'usa-flip-list', 'usa-view-switch'],\n physics: ['usa-spring', 'usa-draggable', 'usa-overscroll'],\n cards: ['usa-card', 'usa-card-stack', 'usa-sticky-stack', 'usa-carousel-3d'],\n click: ['usa-click', 'usa-button', 'usa-icon-morph', 'usa-like', 'usa-hold', 'usa-double-tap', 'usa-checkbox'],\n ui: ['usa-tabs', 'usa-drawer', 'usa-bottom-sheet', 'usa-pull-refresh', 'usa-fab', 'usa-navbar', 'usa-slider', 'usa-rating', 'usa-tooltip', 'usa-popover', 'usa-badge', 'usa-avatar-stack'],\n page: ['usa-cursor', 'usa-fullpage', 'usa-loading-bar', 'usa-back-to-top', 'usa-ambient', 'usa-splash', 'usa-auto-skeleton', 'usa-motion-switch'],\n timeline: ['usa-timeline'],\n gesture: ['usa-swipeable', 'usa-pinch-zoom'],\n} as const;\n\nexport type ComponentCategory = keyof typeof COMPONENT_CATEGORIES;\n"],"names":[],"mappings":";;AAAA;AACA;AACO,MAAM,oBAAoB,GAAG;IAClC,MAAM,EAAE,CAAC,YAAY,EAAE,aAAa,EAAE,qBAAqB,EAAE,aAAa,CAAC;IAC3E,IAAI,EAAE,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,cAAc,EAAE,aAAa,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,eAAe,EAAE,YAAY,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,sBAAsB,CAAC;AAC/M,IAAA,WAAW,EAAE,CAAC,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,eAAe,EAAE,WAAW,EAAE,YAAY,CAAC;IACnG,QAAQ,EAAE,CAAC,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,WAAW,CAAC;AACrF,IAAA,UAAU,EAAE,CAAC,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,eAAe,EAAE,WAAW,EAAE,kBAAkB,EAAE,iBAAiB,CAAC;IAC3J,WAAW,EAAE,CAAC,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,iBAAiB,CAAC;AAChF,IAAA,OAAO,EAAE,CAAC,YAAY,EAAE,eAAe,EAAE,gBAAgB,CAAC;IAC1D,KAAK,EAAE,CAAC,UAAU,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,iBAAiB,CAAC;AAC5E,IAAA,KAAK,EAAE,CAAC,WAAW,EAAE,YAAY,EAAE,gBAAgB,EAAE,UAAU,EAAE,UAAU,EAAE,gBAAgB,EAAE,cAAc,CAAC;IAC9G,EAAE,EAAE,CAAC,UAAU,EAAE,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,kBAAkB,CAAC;AAC1L,IAAA,IAAI,EAAE,CAAC,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,aAAa,EAAE,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,CAAC;IACjJ,QAAQ,EAAE,CAAC,cAAc,CAAC;AAC1B,IAAA,OAAO,EAAE,CAAC,eAAe,EAAE,gBAAgB,CAAC;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-tags-DZ-gjMZc.js","sources":["../../src/components/index-tags.ts"],"sourcesContent":["// The component categories and their default tags (no imports: safe for lazy loaders).\n/** The component categories and their default tags. */\nexport const COMPONENT_CATEGORIES = {\n reveal: ['usa-reveal', 'usa-stagger', 'usa-scroll-progress', 'usa-scrolly'],\n text: ['usa-typewriter', 'usa-split-text', 'usa-scramble', 'usa-counter', 'usa-shimmer-text', 'usa-text-rotate', 'usa-wave-text', 'usa-glitch', 'usa-gradient-text', 'usa-handwriting', 'usa-scroll-highlight'],\n interaction: ['usa-ripple', 'usa-magnetic', 'usa-tilt', 'usa-spotlight', 'usa-press', 'usa-toggle'],\n feedback: ['usa-spinner', 'usa-skeleton', 'usa-progress', 'usa-toaster', 'usa-check'],\n background: ['usa-aurora', 'usa-particles', 'usa-grain', 'usa-marquee', 'usa-acrylic', 'usa-grid-glow', 'usa-blobs', 'usa-water-ripple', 'usa-dot-network'],\n transitions: ['usa-dialog', 'usa-accordion', 'usa-flip-list', 'usa-view-switch'],\n physics: ['usa-spring', 'usa-draggable', 'usa-overscroll'],\n cards: ['usa-card', 'usa-card-stack', 'usa-sticky-stack', 'usa-carousel-3d'],\n click: ['usa-click', 'usa-button', 'usa-icon-morph', 'usa-like', 'usa-hold', 'usa-double-tap', 'usa-checkbox'],\n ui: ['usa-tabs', 'usa-drawer', 'usa-bottom-sheet', 'usa-pull-refresh', 'usa-fab', 'usa-navbar', 'usa-slider', 'usa-rating', 'usa-tooltip', 'usa-popover', 'usa-badge', 'usa-avatar-stack'],\n page: ['usa-cursor', 'usa-fullpage', 'usa-loading-bar', 'usa-back-to-top', 'usa-ambient', 'usa-splash', 'usa-auto-skeleton', 'usa-motion-switch'],\n timeline: ['usa-timeline'],\n gesture: ['usa-swipeable', 'usa-pinch-zoom'],\n} as const;\n\nexport type ComponentCategory = keyof typeof COMPONENT_CATEGORIES;\n"],"names":[],"mappings":"AAAA;AACA;AACO,MAAM,oBAAoB,GAAG;IAClC,MAAM,EAAE,CAAC,YAAY,EAAE,aAAa,EAAE,qBAAqB,EAAE,aAAa,CAAC;IAC3E,IAAI,EAAE,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,cAAc,EAAE,aAAa,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,eAAe,EAAE,YAAY,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,sBAAsB,CAAC;AAC/M,IAAA,WAAW,EAAE,CAAC,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,eAAe,EAAE,WAA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