use-scroll-animate 1.2.0 → 1.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/README_zh.md CHANGED
@@ -1,69 +1,106 @@
1
- <div align="center">
2
-
3
- # use-scroll-animate 🚀
4
-
5
- **一个轻量级(~2.9KB gzipped)、零依赖的现代 Web 滚动动画库。**
6
-
7
- [![GitHub release (latest by date)](https://img.shields.io/github/v/release/HarrisonCN/use-scroll-animate?style=flat-square)](https://github.com/HarrisonCN/use-scroll-animate/releases)
8
- [![GitHub repo size](https://img.shields.io/github/repo-size/HarrisonCN/use-scroll-animate?style=flat-square)](https://github.com/HarrisonCN/use-scroll-animate)
9
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](https://opensource.org/licenses/MIT)
10
-
11
- [English](./README.md) | [日本語](./README_ja.md)
12
-
13
- </div>
14
-
15
- ## 为什么选择 `use-scroll-animate`?
16
-
17
- 在 2025 年,性能至关重要。传统的滚动动画库通常捆绑了沉重的依赖,依赖过时的滚动事件监听器,或者强制你使用特定的框架。
18
-
19
- `use-scroll-animate` 的设计初衷截然不同:
20
- - ⚡ **零依赖**:纯原生 JS/TypeScript 编写。
21
- - 🚀 **高性能**:由 `IntersectionObserver` 和原生 `Web Animations API` 驱动。无滚动事件监听,无布局抖动。
22
- - 🪶 **极轻量**:Gzip 后仅约 2.9KB。
23
- - 🧩 **框架无关**:完美支持原生 JS、React、Vue、Svelte 等。内置一流的 React Hooks 和 Vue Composables。
24
- - ♿ **无障碍**:原生支持 `prefers-reduced-motion`。
25
-
26
- ## 安装
27
-
28
- ```bash
29
- npm install use-scroll-animate
30
- ```
31
-
32
- ## 快速上手 (原生 JS / HTML)
33
-
34
- 最简单的方法是通过 HTML 的 `data-sa` 属性。
35
-
36
- ```html
37
- <!-- 1. 为元素添加 data-sa 属性 -->
38
- <div data-sa data-sa-animation="fade-in-up" data-sa-duration="800">
39
- 当滚动到我时,我会动起来!
40
- </div>
41
-
42
- <script type="module">
43
- // 2. 导入并初始化
44
- import ScrollAnimate from 'use-scroll-animate';
45
- ScrollAnimate.init();
46
- </script>
47
- ```
48
-
49
- ## v1.2.0 新特性
50
-
51
- - **单次触发 (Once)**:动画触发后自动停止观察,节省资源。
52
- - **视口偏移 (Offset)**:支持设置元素进入视口多少像素后才触发动画。
53
- - **新预设**:新增 `shimmer`(流光)、`pulse`(脉冲)、`swing`(摇摆)。
54
- - **多语言支持**:新增中文和日文文档。
55
-
56
- ## 核心配置
57
-
58
- | 选项 | 类型 | 默认值 | 描述 |
59
- |--------|------|---------|-------------|
60
- | `animation` | `string` \| `string[]` | `'fade-in-up'` | 预设名称或预设数组 |
61
- | `duration` | `number` | `600` | 动画持续时间 (ms) |
62
- | `delay` | `number` | `0` | 动画延迟 (ms) |
63
- | `once` | `boolean` | `true` | 是否只触发一次 |
64
- | `offset` | `number` | `0` | 触发动画的视口偏移量 (px) |
65
- | `parallax` | `object` | `{}` | 视差效果配置 |
66
-
67
- ## 许可证
68
-
69
- 本项目采用 MIT 许可证 - 详情请参阅 [LICENSE](LICENSE) 文件。
1
+ <div align="center">
2
+
3
+ # use-scroll-animate 🚀
4
+
5
+ **一个轻量级(~5KB gzipped)、零依赖的现代 Web 滚动动画库。**
6
+
7
+ [![GitHub release (latest by date)](https://img.shields.io/github/v/release/HarrisonCN/use-scroll-animate?style=flat-square)](https://github.com/HarrisonCN/use-scroll-animate/releases)
8
+ [![GitHub repo size](https://img.shields.io/github/repo-size/HarrisonCN/use-scroll-animate?style=flat-square)](https://github.com/HarrisonCN/use-scroll-animate)
9
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](https://opensource.org/licenses/MIT)
10
+
11
+ [English](./README.md) | [简体中文](./README_zh.md) | [日本語](./README_ja.md)
12
+
13
+ </div>
14
+
15
+ ## 为什么选择 `use-scroll-animate`?
16
+
17
+ 在 2025 年,性能至关重要。传统的滚动动画库通常捆绑了沉重的依赖,依赖过时的滚动事件监听器,或者强制你使用特定的框架。
18
+
19
+ `use-scroll-animate` 的设计初衷截然不同:
20
+ - ⚡ **零依赖**:纯原生 JS/TypeScript 编写。
21
+ - 🚀 **高性能**:由 `IntersectionObserver` 和原生 `Web Animations API` 驱动。默认不监听滚动事件(可选的滚动进度模式仅在被追踪元素可见时使用一个 passive、rAF 节流的监听器),无布局抖动。
22
+ - 🪶 **极轻量**:Gzip 后核心约 4.8KB(含 `sequence`、`staggerChildren` 与 React/Vue 辅助在内全部约 6.1KB)。
23
+ - 🧩 **框架无关**:完美支持原生 JS、React、Vue、Svelte 等。内置一流的 React Hooks 和 Vue Composables。
24
+ - ♿ **无障碍**:原生支持 `prefers-reduced-motion`。
25
+
26
+ ## 安装
27
+
28
+ ```bash
29
+ npm install use-scroll-animate
30
+ ```
31
+
32
+ ## 快速上手 (原生 JS / HTML)
33
+
34
+ 最简单的方法是通过 HTML 的 `data-sa` 属性。
35
+
36
+ ```html
37
+ <!-- 1. 为元素添加 data-sa 属性 -->
38
+ <div data-sa data-sa-animation="fade-in-up" data-sa-duration="800">
39
+ 当滚动到我时,我会动起来!
40
+ </div>
41
+
42
+ <script type="module">
43
+ // 2. 导入并初始化
44
+ import ScrollAnimate from 'use-scroll-animate';
45
+ ScrollAnimate.init();
46
+ </script>
47
+ ```
48
+
49
+ ## v1.4.0 新特性 ✨
50
+
51
+ - **真实滚动进度 `progressMode: 'scroll'`**(可选):`onProgress` 默认返回元素的可见比例,对高于屏幕的元素永远到不了 1。开启后进度为:元素顶部到达视口底部时为 `0`,底部离开视口顶部时为 `1`。视差同样使用该进度。HTML 写法:`data-sa-progress="scroll"`;另导出辅助函数 `getScrollProgress(el, root?)`。
52
+
53
+ ```js
54
+ ScrollAnimate.observe('.chapter', {
55
+ progressMode: 'scroll',
56
+ onProgress: (el, p) => el.style.setProperty('--progress', p),
57
+ });
58
+ ```
59
+
60
+ - **动态子元素交错动画**:`staggerChildren()`(原生)与 `useScrollStagger()`(React,**现已支持 Vue**)新增 `observeChildren: true`。通过 `MutationObserver` 监听后续新增的子元素(无限列表、“加载更多”):显现前新增的会加入交错序列,显现后新增的在滚入视口时按批次交错播放。
61
+
62
+ ```js
63
+ import { staggerChildren } from 'use-scroll-animate';
64
+ const stop = staggerChildren(document.querySelector('#feed'), { stagger: 60, observeChildren: true });
65
+ ```
66
+
67
+ - **时间线 `sequence()`**:串联多个元素的动画。每一步在上一步结束后开始;`gap` 设置间隔(负值表示重叠),`at` 设置绝对开始时间;`trigger` 可在元素进入视口时自动播放一次。
68
+
69
+ ```js
70
+ import { sequence } from 'use-scroll-animate';
71
+ const tl = sequence([
72
+ { target: '.hero h1', animation: 'fade-in-up', duration: 700 },
73
+ { target: '.hero p', animation: 'blur-in', gap: -300 },
74
+ { target: '.hero .btn', animation: 'scale-up', stagger: 80 },
75
+ ], { trigger: '.hero' });
76
+ await tl.play(); // 全部完成后 resolve;tl.cancel() 停止并保持元素可见
77
+ ```
78
+
79
+ - **新预设**:`scale-up`、`blur-in-up`、`flip-up`、`flip-down`、`rotate-left`、`rotate-right`,以及 clip-path 揭示 `clip-up`、`clip-down`、`clip-left`、`clip-right`、`clip-circle`。
80
+ - **更省内存**:`once` 元素动画触发后自动从注册表移除(仍需视差/`onProgress` 的除外),并记录在 `WeakSet` 中,`init()`/`observe()` 不会重复播放。如需旧行为可设置 `createScrollAnimate({ autoUnregister: false })`。
81
+ - **规范的 `exports` 字段**:Node ESM 解析到 `dist/index.mjs`,CommonJS 解析到 `dist/index.js`,均带对应类型声明;原有 `main`/`module`/`unpkg` 与 `dist/*` 深层导入保持可用。
82
+
83
+ ## v1.2.0 新特性
84
+
85
+ - **单次触发 (Once)**:动画触发后自动停止观察,节省资源。
86
+ - **视口偏移 (Offset)**:支持设置元素进入视口多少像素后才触发动画。
87
+ - **新预设**:新增 `shimmer`(流光)、`pulse`(脉冲)、`swing`(摇摆)。
88
+ - **多语言支持**:新增中文和日文文档。
89
+
90
+ ## 核心配置
91
+
92
+ | 选项 | 类型 | 默认值 | 描述 |
93
+ |--------|------|---------|-------------|
94
+ | `animation` | `string` \| `string[]` | `'fade-in-up'` | 预设名称或预设数组 |
95
+ | `duration` | `number` | `600` | 动画持续时间 (ms) |
96
+ | `delay` | `number` | `0` | 动画延迟 (ms) |
97
+ | `once` | `boolean` | `true` | 是否只触发一次 |
98
+ | `offset` | `number` | `0` | 触发动画的视口偏移量 (px) |
99
+ | `parallax` | `object` | `{}` | 视差效果配置 |
100
+ | `stagger` | `number` | `0` | 同批次显现的兄弟元素之间的额外延迟 (ms) |
101
+ | `onProgress` | `(el, progress) => void` | – | 滚动进度回调 (0–1) |
102
+ | `progressMode` | `'ratio'` \| `'scroll'` | `'ratio'` | 进度计算方式:可见比例或真实滚动进度 |
103
+
104
+ ## 许可证
105
+
106
+ 本项目采用 MIT 许可证 - 详情请参阅 [LICENSE](LICENSE) 文件。
@@ -0,0 +1,302 @@
1
+ /**
2
+ * use-scroll-animate - Core Type Definitions
3
+ * A lightweight, high-performance scroll animation library
4
+ */
5
+ /** Built-in animation presets */
6
+ type AnimationPreset = 'fade-in' | 'fade-in-up' | 'fade-in-down' | 'fade-in-left' | 'fade-in-right' | 'zoom-in' | 'zoom-out' | 'flip-x' | 'flip-y' | 'slide-up' | 'slide-down' | 'slide-left' | 'slide-right' | 'bounce' | 'rotate-in' | 'blur-in' | 'skew-in' | 'scale-x' | 'scale-y' | 'shimmer' | 'pulse' | 'swing' | 'scale-up' | 'blur-in-up' | 'flip-up' | 'flip-down' | 'rotate-left' | 'rotate-right' | 'clip-up' | 'clip-down' | 'clip-left' | 'clip-right' | 'clip-circle';
7
+ /**
8
+ * How `onProgress` (and parallax) progress is measured.
9
+ * - `'ratio'` (default): the element's visible ratio (IntersectionObserver `intersectionRatio`).
10
+ * - `'scroll'`: true scroll progress, 0 when the element's top touches the bottom of the
11
+ * viewport and 1 when its bottom leaves the top. Works for elements taller than the screen.
12
+ */
13
+ type ProgressMode = 'ratio' | 'scroll';
14
+ /** Easing function types */
15
+ type EasingType = 'linear' | 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'spring' | 'soft-spring' | 'heavy-bounce' | [number, number, number, number] | ((t: number) => number) | string;
16
+ /** Keyframe definition for custom animations */
17
+ interface AnimationKeyframe {
18
+ [property: string]: string | number;
19
+ }
20
+ /** Custom animation definition */
21
+ interface CustomAnimation {
22
+ from: AnimationKeyframe;
23
+ to: AnimationKeyframe;
24
+ }
25
+ /** Parallax configuration */
26
+ interface ParallaxOptions {
27
+ /** Movement on X axis (e.g., '100px', '20%') */
28
+ x?: string | number;
29
+ /** Movement on Y axis (e.g., '100px', '20%') */
30
+ y?: string | number;
31
+ /** Rotation in degrees */
32
+ rotate?: number;
33
+ /** Scale factor */
34
+ scale?: number;
35
+ /** Speed multiplier (default: 1) */
36
+ speed?: number;
37
+ }
38
+ /** Per-element animation options */
39
+ interface AnimateOptions {
40
+ /** Animation preset name, array of presets, or custom animation object */
41
+ animation?: AnimationPreset | AnimationPreset[] | CustomAnimation;
42
+ /** Duration in milliseconds (default: 600) */
43
+ duration?: number;
44
+ /** Delay in milliseconds (default: 0) */
45
+ delay?: number;
46
+ /** Easing function (default: 'ease') */
47
+ easing?: EasingType;
48
+ /** Intersection threshold 0-1 (default: 0.1) */
49
+ threshold?: number | number[];
50
+ /** Root margin for IntersectionObserver (default: '0px') */
51
+ rootMargin?: string;
52
+ /** Whether to replay animation each time element enters viewport (default: false) */
53
+ repeat?: boolean;
54
+ /** Whether to trigger animation only once (default: true if repeat is false) */
55
+ once?: boolean;
56
+ /** Offset in pixels from the viewport edge to trigger animation (default: 0) */
57
+ offset?: number;
58
+ /** Stagger delay for child elements in ms (default: 0) */
59
+ stagger?: number;
60
+ /** Parallax effect configuration */
61
+ parallax?: ParallaxOptions;
62
+ /** Callback fired when animation starts */
63
+ onStart?: (element: Element) => void;
64
+ /** Callback fired when animation completes */
65
+ onComplete?: (element: Element) => void;
66
+ /** Callback fired when element enters viewport */
67
+ onEnter?: (element: Element) => void;
68
+ /** Callback fired when element leaves viewport */
69
+ onLeave?: (element: Element) => void;
70
+ /** Callback fired with scroll progress (0 to 1) */
71
+ onProgress?: (element: Element, progress: number) => void;
72
+ /** How progress for `onProgress`/parallax is measured (default: 'ratio') */
73
+ progressMode?: ProgressMode;
74
+ }
75
+ /** Global configuration for ScrollAnimate instance */
76
+ interface ScrollAnimateConfig {
77
+ /** Default animation preset (default: 'fade-in-up') */
78
+ defaultAnimation?: AnimationPreset | AnimationPreset[] | CustomAnimation;
79
+ /** Default duration in ms (default: 600) */
80
+ defaultDuration?: number;
81
+ /** Default delay in ms (default: 0) */
82
+ defaultDelay?: number;
83
+ /** Default easing (default: 'ease') */
84
+ defaultEasing?: EasingType;
85
+ /** Default threshold (default: 0.1) */
86
+ defaultThreshold?: number | number[];
87
+ /** Default root margin (default: '0px') */
88
+ defaultRootMargin?: string;
89
+ /** Whether animations replay by default (default: false) */
90
+ defaultRepeat?: boolean;
91
+ /** Default once setting (default: true) */
92
+ defaultOnce?: boolean;
93
+ /** Default offset in pixels (default: 0) */
94
+ defaultOffset?: number;
95
+ /** CSS class added before animation (default: 'sa-hidden') */
96
+ hiddenClass?: string;
97
+ /** CSS class added when element is visible (default: 'sa-visible') */
98
+ visibleClass?: string;
99
+ /** Whether to use CSS class-based animation instead of Web Animations API */
100
+ useClassNames?: boolean;
101
+ /** Disable all animations (useful for reduced-motion preference) */
102
+ disabled?: boolean;
103
+ /** Custom IntersectionObserver root element */
104
+ root?: Element | null;
105
+ /**
106
+ * Drop `once` elements from the registry as soon as their entrance animation
107
+ * has been triggered (unless they still need parallax/onProgress), so they can
108
+ * be garbage-collected. They are remembered in a WeakSet, so `init()`/`observe()`
109
+ * never re-hide or replay them. (default: true)
110
+ */
111
+ autoUnregister?: boolean;
112
+ }
113
+ /** Registered element entry */
114
+ interface AnimatedElement {
115
+ element: Element;
116
+ options: Required<AnimateOptions>;
117
+ observer: IntersectionObserver;
118
+ animated: boolean;
119
+ progressObserver?: IntersectionObserver;
120
+ }
121
+ /** ScrollAnimate public API */
122
+ interface ScrollAnimateInstance {
123
+ /** Observe a single element or CSS selector */
124
+ observe(target: string | Element | NodeList | Element[], options?: AnimateOptions): void;
125
+ /** Stop observing a single element or CSS selector */
126
+ unobserve(target: string | Element | NodeList | Element[]): void;
127
+ /** Observe all elements matching the data-sa attribute */
128
+ init(rootElement?: Element | Document): void;
129
+ /** Destroy the instance and clean up all observers */
130
+ destroy(): void;
131
+ /** Refresh all observers (useful after DOM changes) */
132
+ refresh(): void;
133
+ /** Manually trigger animation on an element */
134
+ animate(target: string | Element, options?: AnimateOptions): void;
135
+ /** Get all currently observed elements */
136
+ getObservedElements(): AnimatedElement[];
137
+ /** Update global configuration */
138
+ configure(config: Partial<ScrollAnimateConfig>): void;
139
+ }
140
+
141
+ /**
142
+ * use-scroll-animate - Core Implementation
143
+ * Uses IntersectionObserver + Web Animations API for zero-dependency,
144
+ * high-performance scroll-triggered animations.
145
+ */
146
+
147
+ /**
148
+ * True scroll progress of `el` through the viewport (or `root`): 0 when its top
149
+ * edge reaches the bottom of the viewport, 1 when its bottom edge passes the top.
150
+ * Works for elements taller than the viewport. Returns 0 without a DOM.
151
+ */
152
+ declare function getScrollProgress(el: Element, root?: Element | null): number;
153
+ declare function createScrollAnimate(userConfig?: ScrollAnimateConfig): ScrollAnimateInstance;
154
+
155
+ /**
156
+ * use-scroll-animate - Staggered children
157
+ * Reveal a container's children one after another when the container scrolls
158
+ * into view, optionally also animating children that are added later.
159
+ */
160
+
161
+ interface StaggerOptions extends AnimateOptions {
162
+ /** Delay between consecutive children in ms (default: 80) */
163
+ stagger?: number;
164
+ /**
165
+ * Watch the container with a MutationObserver and animate children added
166
+ * later (e.g. infinite lists). Children added after the container was
167
+ * revealed animate when they scroll into view, staggered per batch.
168
+ * (default: false)
169
+ */
170
+ observeChildren?: boolean;
171
+ }
172
+ /**
173
+ * Animate the children of `container` with a stagger once it enters the
174
+ * viewport. Returns a cleanup function. SSR-safe (no-op without a DOM).
175
+ *
176
+ * @example
177
+ * const stop = staggerChildren(document.querySelector('ul'), { stagger: 60, observeChildren: true });
178
+ */
179
+ declare function staggerChildren(container: Element | null | undefined, options?: StaggerOptions, instance?: ScrollAnimateInstance): () => void;
180
+
181
+ /**
182
+ * use-scroll-animate - Sequence / timeline helper
183
+ * Chain animations on several targets, one after another (or overlapping).
184
+ */
185
+
186
+ interface SequenceStep extends AnimateOptions {
187
+ /** Selector, Element, NodeList or Element[] to animate in this step */
188
+ target: string | Element | NodeList | Element[];
189
+ /** Pause (ms) after the previous step ends before this one starts. Negative values overlap. (default: 0) */
190
+ gap?: number;
191
+ /** Absolute start time (ms) on the timeline; overrides `gap` */
192
+ at?: number;
193
+ }
194
+ interface SequenceOptions extends AnimateOptions {
195
+ /** Play automatically (once) when this element/selector enters the viewport */
196
+ trigger?: string | Element;
197
+ /** Instance whose global config (easing, classes, `disabled`) is used */
198
+ instance?: ScrollAnimateInstance;
199
+ }
200
+ interface SequenceController {
201
+ /** Play (or replay) the timeline. Resolves when every step has completed, or on `cancel()`. */
202
+ play(): Promise<void>;
203
+ /** Stop the trigger and running animations; elements are left visible. */
204
+ cancel(): void;
205
+ /** Total duration of the timeline in ms (computed for the current DOM). */
206
+ duration(): number;
207
+ }
208
+ /**
209
+ * Build a timeline of animations.
210
+ *
211
+ * @example
212
+ * sequence([
213
+ * { target: '.title', animation: 'fade-in-up' },
214
+ * { target: '.subtitle', animation: 'blur-in', gap: -300 }, // overlap by 300ms
215
+ * { target: '.card', animation: 'scale-up', stagger: 80 },
216
+ * ], { trigger: '.hero' });
217
+ */
218
+ declare function sequence(steps: SequenceStep[], options?: SequenceOptions): SequenceController;
219
+
220
+ /**
221
+ * use-scroll-animate - Animation Presets
222
+ * Defines keyframes for all built-in animation presets
223
+ */
224
+
225
+ type KeyframeMap = {
226
+ from: Record<string, string | number>;
227
+ to: Record<string, string | number>;
228
+ };
229
+ declare const PRESETS: Record<AnimationPreset, KeyframeMap>;
230
+ declare function resolvePreset(animation: AnimationPreset | AnimationPreset[] | CustomAnimation): KeyframeMap;
231
+ /** Easing to CSS cubic-bezier mapping */
232
+ declare const EASING_MAP: Record<string, string>;
233
+ declare function resolveEasing(easing: EasingType): string;
234
+
235
+ /**
236
+ * use-scroll-animate - React Integration
237
+ * Provides useScrollAnimate and useScrollStagger hooks for React applications.
238
+ * `useScrollStagger({ observeChildren: true })` also animates children added later.
239
+ *
240
+ * Both hooks are thin wrappers around the core engine, so they share its
241
+ * behaviour: `once`, `offset`, custom easing functions, parallax,
242
+ * `prefers-reduced-motion` support, and proper cleanup on unmount.
243
+ */
244
+
245
+ type ReactRef<T> = {
246
+ current: T | null;
247
+ };
248
+ declare function createReactHooks(React: {
249
+ useRef: <T>(initial: T | null) => ReactRef<T>;
250
+ useEffect: (effect: () => (() => void) | void, deps?: unknown[]) => void;
251
+ }): {
252
+ useScrollAnimate: (options?: AnimateOptions) => ReactRef<Element>;
253
+ useScrollStagger: (options?: StaggerOptions) => ReactRef<Element>;
254
+ };
255
+
256
+ /**
257
+ * use-scroll-animate - Vue 3 Integration
258
+ * Provides useScrollAnimate and useScrollStagger composables for Vue 3 applications.
259
+ *
260
+ * A thin wrapper around the core engine, so it shares its behaviour: `once`,
261
+ * `offset`, custom easing functions, parallax, `prefers-reduced-motion`
262
+ * support, and cleanup on unmount.
263
+ */
264
+
265
+ declare function createVueComposables(Vue: {
266
+ ref: <T>(value: T | null) => {
267
+ value: T | null;
268
+ };
269
+ onMounted: (fn: () => void) => void;
270
+ onUnmounted: (fn: () => void) => void;
271
+ }): {
272
+ useScrollAnimate: (options?: AnimateOptions) => {
273
+ animateRef: {
274
+ value: Element | null;
275
+ };
276
+ };
277
+ useScrollStagger: (options?: StaggerOptions) => {
278
+ staggerRef: {
279
+ value: Element | null;
280
+ };
281
+ };
282
+ };
283
+
284
+ /**
285
+ * Default singleton instance of ScrollAnimate.
286
+ * Ready to use out of the box with sensible defaults.
287
+ *
288
+ * @example
289
+ * ```js
290
+ * import ScrollAnimate from 'use-scroll-animate';
291
+ *
292
+ * // Auto-initialize all elements with data-sa attribute
293
+ * ScrollAnimate.init();
294
+ *
295
+ * // Or manually observe elements
296
+ * ScrollAnimate.observe('.my-element', { animation: 'fade-in-up' });
297
+ * ```
298
+ */
299
+ declare const ScrollAnimate: ScrollAnimateInstance;
300
+
301
+ export { EASING_MAP, PRESETS, createReactHooks, createScrollAnimate, createVueComposables, ScrollAnimate as default, getScrollProgress, resolveEasing, resolvePreset, sequence, staggerChildren };
302
+ export type { AnimateOptions, AnimatedElement, AnimationKeyframe, AnimationPreset, CustomAnimation, EasingType, ParallaxOptions, ProgressMode, ScrollAnimateConfig, ScrollAnimateInstance, SequenceController, SequenceOptions, SequenceStep, StaggerOptions };