svg-scroll-draw 2.15.3 → 2.16.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.md +19 -16
- package/dist/angular/index.cjs +2 -2
- package/dist/angular/index.d.mts +7 -240
- package/dist/angular/index.d.ts +7 -240
- package/dist/angular/index.mjs +1 -3
- package/dist/aos/index.cjs +2 -2
- package/dist/aos/index.mjs +1 -2
- package/dist/aos/react/index.cjs +2 -2
- package/dist/aos/react/index.d.mts +1 -33
- package/dist/aos/react/index.d.ts +1 -33
- package/dist/aos/react/index.mjs +1 -2
- package/dist/astro/index.cjs +2 -2
- package/dist/astro/index.d.mts +4 -148
- package/dist/astro/index.d.ts +4 -148
- package/dist/astro/index.mjs +1 -3
- package/dist/cdn/aos.global.js +2 -2
- package/dist/cdn/scrollreveal.global.js +2 -2
- package/dist/cdn/svg-scroll-draw.dev.global.js +51 -39
- package/dist/cdn/svg-scroll-draw.global.js +2 -2
- package/dist/cdn/vivus.global.js +1 -1
- package/dist/chunk-4DOJSIEQ.mjs +1 -0
- package/dist/chunk-4MH5SQTH.mjs +1 -0
- package/dist/chunk-4T5R3ZTL.mjs +2 -0
- package/dist/chunk-5PJEKEEP.mjs +1 -0
- package/dist/chunk-AJ22VSHC.mjs +1 -0
- package/dist/chunk-BCV4RAIX.mjs +1 -0
- package/dist/chunk-DM6EDKWH.mjs +1 -0
- package/dist/chunk-E4M2PB7B.mjs +1 -0
- package/dist/chunk-JC5BD4RB.mjs +1 -0
- package/dist/chunk-KBFWDHF4.mjs +1 -0
- package/dist/chunk-KGAJQP2N.mjs +2 -0
- package/dist/chunk-LFSU6LR3.mjs +1 -0
- package/dist/chunk-OJFWQ6CU.mjs +1 -0
- package/dist/chunk-OMI46IXL.mjs +2 -0
- package/dist/chunk-OWMO2S3V.mjs +1 -0
- package/dist/chunk-PEFR3ZB7.mjs +1 -0
- package/dist/chunk-QJ4H2HW3.mjs +1 -0
- package/dist/chunk-SNCRC6BA.mjs +1 -0
- package/dist/chunk-WDIHLRZZ.mjs +3 -0
- package/dist/chunk-WQZKXAXK.mjs +2 -0
- package/dist/chunk-YWKPTYSG.mjs +1 -0
- package/dist/chunk-YZV4Z3EQ.mjs +1 -0
- package/dist/cinematic/index.cjs +1 -1
- package/dist/cinematic/index.mjs +1 -2
- package/dist/devtools/index.mjs +1 -1
- package/dist/engine-6AXEX8CL.d.ts +57 -0
- package/dist/engine-Ci08nM91.d.mts +57 -0
- package/dist/group/index.cjs +2 -2
- package/dist/group/index.d.mts +4 -207
- package/dist/group/index.d.ts +4 -207
- package/dist/group/index.mjs +1 -3
- package/dist/horizontal/index.cjs +1 -1
- package/dist/horizontal/index.d.mts +1 -33
- package/dist/horizontal/index.d.ts +1 -33
- package/dist/horizontal/index.mjs +1 -1
- package/dist/index-BDGQEK6X.d.mts +15 -0
- package/dist/index-BVuNgQSd.d.ts +14 -0
- package/dist/index-CGR7pSOR.d.mts +14 -0
- package/dist/index-DxjUOIbK.d.ts +15 -0
- package/dist/index.cjs +3 -3
- package/dist/index.d.mts +8 -294
- package/dist/index.d.ts +8 -294
- package/dist/index.mjs +1 -4
- package/dist/nuxt/index.cjs +2 -2
- package/dist/nuxt/index.d.mts +7 -507
- package/dist/nuxt/index.d.ts +7 -507
- package/dist/nuxt/index.mjs +1 -3
- package/dist/pin/index.cjs +1 -1
- package/dist/pin/index.mjs +1 -1
- package/dist/progress/index.cjs +1 -1
- package/dist/progress/index.d.mts +1 -33
- package/dist/progress/index.d.ts +1 -33
- package/dist/progress/index.mjs +1 -1
- package/dist/react/index.cjs +2 -2
- package/dist/react/index.d.mts +5 -212
- package/dist/react/index.d.ts +5 -212
- package/dist/react/index.mjs +1 -3
- package/dist/reveal/index.cjs +1 -1
- package/dist/reveal/index.d.mts +1 -5
- package/dist/reveal/index.d.ts +1 -5
- package/dist/reveal/index.mjs +1 -1
- package/dist/scroll-draw-BlJfbTDv.d.ts +5 -0
- package/dist/scroll-draw-CNlq4Z_L.d.mts +5 -0
- package/dist/scrollreveal/index.cjs +2 -2
- package/dist/scrollreveal/index.mjs +1 -2
- package/dist/scrollreveal/react/index.cjs +2 -2
- package/dist/scrollreveal/react/index.d.mts +1 -36
- package/dist/scrollreveal/react/index.d.ts +1 -36
- package/dist/scrollreveal/react/index.mjs +1 -2
- package/dist/snap/index.cjs +1 -1
- package/dist/snap/index.d.mts +1 -1
- package/dist/snap/index.d.ts +1 -1
- package/dist/snap/index.mjs +1 -1
- package/dist/solid/index.cjs +2 -2
- package/dist/solid/index.d.mts +6 -240
- package/dist/solid/index.d.ts +6 -240
- package/dist/solid/index.mjs +1 -3
- package/dist/svelte/index.cjs +2 -2
- package/dist/svelte/index.d.mts +6 -240
- package/dist/svelte/index.d.ts +6 -240
- package/dist/svelte/index.mjs +1 -3
- package/dist/text/index.cjs +1 -1
- package/dist/text/index.d.mts +1 -33
- package/dist/text/index.d.ts +1 -33
- package/dist/text/index.mjs +1 -1
- package/dist/timeline/index.cjs +7 -7
- package/dist/timeline/index.d.mts +1 -29
- package/dist/timeline/index.d.ts +1 -29
- package/dist/timeline/index.mjs +11 -11
- package/dist/types-DHU1zNEw.d.mts +147 -0
- package/dist/types-DHU1zNEw.d.ts +147 -0
- package/dist/video/index.cjs +1 -1
- package/dist/video/index.d.mts +1 -33
- package/dist/video/index.d.ts +1 -33
- package/dist/video/index.mjs +1 -1
- package/dist/vivus/index.cjs +2 -2
- package/dist/vivus/index.mjs +1 -2
- package/dist/vivus/react/index.cjs +2 -1
- package/dist/vivus/react/index.d.mts +1 -99
- package/dist/vivus/react/index.d.ts +1 -99
- package/dist/vivus/react/index.mjs +1 -1
- package/dist/vue/index.cjs +2 -2
- package/dist/vue/index.d.mts +6 -213
- package/dist/vue/index.d.ts +6 -213
- package/dist/vue/index.mjs +1 -3
- package/dist/web-component/index.cjs +2 -2
- package/dist/web-component/index.mjs +1 -3
- package/package.json +1 -1
package/dist/nuxt/index.d.mts
CHANGED
|
@@ -1,510 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
export { ScrollAnimate, ScrollCounter, ScrollDraw, ScrollText, ScrollVideo, useScrollAnimate, useScrollCounter, useScrollDraw, useScrollText, useScrollVideo } from '../vue/index.mjs';
|
|
2
|
+
export { a as ScrollDrawOptions } from '../types-DHU1zNEw.mjs';
|
|
2
3
|
import { App } from 'vue';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
start?: string;
|
|
8
|
-
end?: string;
|
|
9
|
-
}
|
|
10
|
-
interface ScrollDrawOptions {
|
|
11
|
-
/**
|
|
12
|
-
* Apply a named preset as the base configuration. User-supplied options
|
|
13
|
-
* always override the preset. Available presets:
|
|
14
|
-
* - `'sketch'` — staggered ease-in draw, pencil feel
|
|
15
|
-
* - `'reveal'` — fade + ease-out, draws once on viewport entry
|
|
16
|
-
* - `'typewriter'` — fast linear draw with stagger
|
|
17
|
-
* - `'cinematic'` — slow ease-in-out with fade, dramatic entrance
|
|
18
|
-
* - `'spring'` — spring easing, bouncy organic feel
|
|
19
|
-
*/
|
|
20
|
-
preset?: PresetName;
|
|
21
|
-
selector?: string;
|
|
22
|
-
speed?: number;
|
|
23
|
-
fade?: boolean;
|
|
24
|
-
easing?: EasingName | ((t: number) => number);
|
|
25
|
-
trigger?: TriggerConfig;
|
|
26
|
-
stagger?: number;
|
|
27
|
-
direction?: 'forward' | 'reverse';
|
|
28
|
-
once?: boolean;
|
|
29
|
-
debug?: boolean;
|
|
30
|
-
/** Scroll axis to track. 'y' (default) for vertical, 'x' for horizontal. */
|
|
31
|
-
axis?: 'x' | 'y';
|
|
32
|
-
/** CSS selector or Element for a custom scroll container (default: window). */
|
|
33
|
-
scrollContainer?: string | Element;
|
|
34
|
-
/** Automatically reverse the animation when the user scrolls back up. */
|
|
35
|
-
autoReverse?: boolean;
|
|
36
|
-
/** Delay in milliseconds before the engine starts observing. */
|
|
37
|
-
delay?: number;
|
|
38
|
-
/** Animate stroke color. Single string = static override. Tuple = interpolate from → to. */
|
|
39
|
-
strokeColor?: string | [string, string];
|
|
40
|
-
/** Animate stroke width. Single number = static override. Tuple = interpolate from → to. */
|
|
41
|
-
strokeWidth?: number | [number, number];
|
|
42
|
-
/** Animate fill opacity. Single number = static override. Tuple [from, to] = interpolate as the path draws. Use [0, 1] to flood fill in sync with the stroke draw. */
|
|
43
|
-
fillOpacity?: number | [number, number];
|
|
44
|
-
/**
|
|
45
|
-
* Reveal the container using CSS clip-path instead of stroke-dashoffset.
|
|
46
|
-
* Works on any content — SVG, images, text, divs.
|
|
47
|
-
*
|
|
48
|
-
* Pass a direction string to control which edge the reveal starts from,
|
|
49
|
-
* or `true` as shorthand for `'left'`.
|
|
50
|
-
*
|
|
51
|
-
* Values: `'left' | 'right' | 'top' | 'bottom' | 'center'`
|
|
52
|
-
*/
|
|
53
|
-
clip?: boolean | 'left' | 'right' | 'top' | 'bottom' | 'center';
|
|
54
|
-
/** Fire callbacks at specific progress thresholds (0–1). Resets on replay(). */
|
|
55
|
-
waypoints?: Record<number, () => void>;
|
|
56
|
-
/** Scale animation speed by scroll velocity — faster scrolling = faster draw. Pass a number to control sensitivity (default 1). */
|
|
57
|
-
velocityScale?: boolean | number;
|
|
58
|
-
/** IntersectionObserver threshold (0–1). Default 0. */
|
|
59
|
-
threshold?: number;
|
|
60
|
-
/** IntersectionObserver rootMargin. Default "0px". */
|
|
61
|
-
rootMargin?: string;
|
|
62
|
-
/** Repeat the animation N times after completion. Use 'infinite' to loop forever. */
|
|
63
|
-
repeat?: number | 'infinite';
|
|
64
|
-
/** Milliseconds to wait between repeats. Default 0. */
|
|
65
|
-
repeatDelay?: number;
|
|
66
|
-
/**
|
|
67
|
-
* Target path `d` attribute to morph toward as the animation progresses.
|
|
68
|
-
* Paths must have compatible command structures (same number of numeric tokens).
|
|
69
|
-
*
|
|
70
|
-
* Only applies to `<path>` elements — silently no-ops on `<rect>`, `<circle>`,
|
|
71
|
-
* `<line>`, and other SVG shape elements.
|
|
72
|
-
*/
|
|
73
|
-
morphTo?: string;
|
|
74
|
-
onProgress?: (alpha: number) => void;
|
|
75
|
-
onStart?: () => void;
|
|
76
|
-
onComplete?: () => void;
|
|
77
|
-
/** Fires when scroll position enters the trigger zone (scrolling forward). */
|
|
78
|
-
onEnter?: () => void;
|
|
79
|
-
/** Fires when scroll position exits the trigger zone at the end (scrolling forward). */
|
|
80
|
-
onLeave?: () => void;
|
|
81
|
-
/** Fires when scroll position re-enters the trigger zone from the end (scrolling back). */
|
|
82
|
-
onEnterBack?: () => void;
|
|
83
|
-
/** Fires when scroll position exits the trigger zone at the start (scrolling back). */
|
|
84
|
-
onLeaveBack?: () => void;
|
|
85
|
-
/**
|
|
86
|
-
* Trigger the animation when the element enters the viewport instead of
|
|
87
|
-
* tying it to scroll position. The draw runs over `duration` milliseconds,
|
|
88
|
-
* replaying each time the element re-enters the viewport (use `once: true`
|
|
89
|
-
* to play only the first time).
|
|
90
|
-
*
|
|
91
|
-
* All visual options work in autoplay mode — `easing`, `stagger`, `fade`,
|
|
92
|
-
* `strokeColor`, `strokeWidth`, `fillOpacity`, `clip`, `morphTo`, `waypoints`,
|
|
93
|
-
* `repeat`, `repeatDelay`, `onStart`, `onComplete`, `onProgress`, etc.
|
|
94
|
-
*
|
|
95
|
-
* The full instance API (`pause`, `resume`, `seek`, `replay`, `getProgress`)
|
|
96
|
-
* also works — `seek(0.5)` pauses at 50% of the duration.
|
|
97
|
-
*/
|
|
98
|
-
autoplay?: boolean;
|
|
99
|
-
/**
|
|
100
|
-
* Duration of the autoplay animation in milliseconds. Only used when
|
|
101
|
-
* `autoplay: true`. Default `1000`.
|
|
102
|
-
*/
|
|
103
|
-
duration?: number;
|
|
104
|
-
/**
|
|
105
|
-
* Use the browser's native CSS scroll-driven animation
|
|
106
|
-
* (`animation-timeline: view()`) when the configuration is simple enough and
|
|
107
|
-
* the browser supports it. The browser drives the draw from the scroll
|
|
108
|
-
* position — zero per-frame JavaScript, zero scroll/resize listeners. (It
|
|
109
|
-
* still repaints on the main thread: browsers don't composite
|
|
110
|
-
* `stroke-dashoffset`.)
|
|
111
|
-
*
|
|
112
|
-
* Falls back to the JS engine automatically when unsupported or when the
|
|
113
|
-
* config uses a feature native CSS can't express (callbacks, stagger, morph,
|
|
114
|
-
* velocity scaling, custom triggers, `once`, custom easing functions, etc.).
|
|
115
|
-
*
|
|
116
|
-
* - `undefined` / `true` (default): use native when eligible.
|
|
117
|
-
* - `false`: always use the JS engine.
|
|
118
|
-
*/
|
|
119
|
-
native?: boolean;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
interface ScrollAnimateOptions {
|
|
123
|
-
props: Record<string, string | number | [string | number, string | number]>;
|
|
124
|
-
trigger?: TriggerConfig;
|
|
125
|
-
easing?: EasingName | ((t: number) => number);
|
|
126
|
-
speed?: number;
|
|
127
|
-
once?: boolean;
|
|
128
|
-
axis?: 'x' | 'y';
|
|
129
|
-
scrollContainer?: string | Element;
|
|
130
|
-
native?: boolean;
|
|
131
|
-
/**
|
|
132
|
-
* Scale animation speed by scroll velocity — faster scrolling = faster animation.
|
|
133
|
-
* Pass `true` for default sensitivity (1) or a number to control it.
|
|
134
|
-
* Higher values = more dramatic speed-up. Default sensitivity: 1.
|
|
135
|
-
*/
|
|
136
|
-
velocityScale?: boolean | number;
|
|
137
|
-
/**
|
|
138
|
-
* Honour `prefers-reduced-motion: reduce` by applying the final state and not
|
|
139
|
-
* animating. Default: `true`.
|
|
140
|
-
*
|
|
141
|
-
* Set to `false` only when the movement is *scroll-linked scrubbing* rather
|
|
142
|
-
* than autonomous motion — it advances solely as the user scrolls, 1:1 with
|
|
143
|
-
* their input, so it is direct manipulation rather than something that plays at
|
|
144
|
-
* them. `scrollHorizontal` sets this, because jumping to the final state there
|
|
145
|
-
* would leave every panel but the last unreachable inside the sticky
|
|
146
|
-
* `overflow: hidden` container.
|
|
147
|
-
*/
|
|
148
|
-
respectReducedMotion?: boolean;
|
|
149
|
-
/**
|
|
150
|
-
* Element whose geometry defines the trigger window, when that is not the
|
|
151
|
-
* element being animated. Defaults to the animated element.
|
|
152
|
-
*
|
|
153
|
-
* Needed whenever the animated element cannot supply the scroll length itself —
|
|
154
|
-
* the case that matters is a `position: sticky` stage, where the pinned element
|
|
155
|
-
* is exactly one viewport tall and all of the scroll room belongs to its
|
|
156
|
-
* container. Resolving `top top` → `bottom bottom` against the pinned element
|
|
157
|
-
* there yields tStart === tEnd, a zero-length window, and no movement at all.
|
|
158
|
-
*
|
|
159
|
-
* Setting this disables the native CSS fast path: `animation-timeline: view()`
|
|
160
|
-
* always measures the element the animation is attached to, so it cannot express
|
|
161
|
-
* a separate subject.
|
|
162
|
-
*/
|
|
163
|
-
triggerElement?: Element;
|
|
164
|
-
onProgress?: (alpha: number) => void;
|
|
165
|
-
onComplete?: () => void;
|
|
166
|
-
/** Fires when scroll enters the trigger zone (scrolling forward). */
|
|
167
|
-
onEnter?: () => void;
|
|
168
|
-
/** Fires when scroll exits the trigger zone at the end (scrolling forward). */
|
|
169
|
-
onLeave?: () => void;
|
|
170
|
-
/** Fires when scroll re-enters the trigger zone from the end (scrolling back). */
|
|
171
|
-
onEnterBack?: () => void;
|
|
172
|
-
/** Fires when scroll exits the trigger zone at the start (scrolling back). */
|
|
173
|
-
onLeaveBack?: () => void;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
interface ScrollCounterOptions {
|
|
177
|
-
from?: number;
|
|
178
|
-
to: number;
|
|
179
|
-
format?: (value: number) => string;
|
|
180
|
-
easing?: EasingName | ((t: number) => number);
|
|
181
|
-
trigger?: TriggerConfig;
|
|
182
|
-
once?: boolean;
|
|
183
|
-
decimals?: number;
|
|
184
|
-
onComplete?: () => void;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
interface ScrollVideoOptions {
|
|
188
|
-
trigger?: TriggerConfig;
|
|
189
|
-
from?: number;
|
|
190
|
-
to?: number;
|
|
191
|
-
easing?: EasingName | ((t: number) => number);
|
|
192
|
-
once?: boolean;
|
|
193
|
-
axis?: 'x' | 'y';
|
|
194
|
-
preload?: 'auto' | 'metadata';
|
|
195
|
-
onReady?: () => void;
|
|
196
|
-
onComplete?: () => void;
|
|
197
|
-
onProgress?: (alpha: number) => void;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
interface ScrollTextOptions {
|
|
201
|
-
split?: 'chars' | 'words' | 'lines';
|
|
202
|
-
stagger?: number;
|
|
203
|
-
easing?: EasingName | ((t: number) => number);
|
|
204
|
-
from?: {
|
|
205
|
-
opacity?: number;
|
|
206
|
-
y?: number;
|
|
207
|
-
x?: number;
|
|
208
|
-
rotate?: number;
|
|
209
|
-
scale?: number;
|
|
210
|
-
};
|
|
211
|
-
trigger?: TriggerConfig;
|
|
212
|
-
once?: boolean;
|
|
213
|
-
onComplete?: () => void;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
/** Composable — attach to any container ref. */
|
|
217
|
-
declare function useScrollDraw(options?: ScrollDrawOptions): vue.Ref<HTMLElement | null, HTMLElement | null>;
|
|
218
|
-
/** Component — wraps children in a <div> and initialises the engine. */
|
|
219
|
-
declare const ScrollDraw: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
220
|
-
selector: {
|
|
221
|
-
type: StringConstructor;
|
|
222
|
-
};
|
|
223
|
-
speed: {
|
|
224
|
-
type: NumberConstructor;
|
|
225
|
-
};
|
|
226
|
-
fade: {
|
|
227
|
-
type: BooleanConstructor;
|
|
228
|
-
};
|
|
229
|
-
stagger: {
|
|
230
|
-
type: NumberConstructor;
|
|
231
|
-
};
|
|
232
|
-
easing: {
|
|
233
|
-
type: (StringConstructor | FunctionConstructor)[];
|
|
234
|
-
};
|
|
235
|
-
direction: {
|
|
236
|
-
type: () => "forward" | "reverse";
|
|
237
|
-
};
|
|
238
|
-
trigger: {
|
|
239
|
-
type: ObjectConstructor;
|
|
240
|
-
};
|
|
241
|
-
onProgress: {
|
|
242
|
-
type: FunctionConstructor;
|
|
243
|
-
};
|
|
244
|
-
onStart: {
|
|
245
|
-
type: FunctionConstructor;
|
|
246
|
-
};
|
|
247
|
-
onComplete: {
|
|
248
|
-
type: FunctionConstructor;
|
|
249
|
-
};
|
|
250
|
-
once: {
|
|
251
|
-
type: BooleanConstructor;
|
|
252
|
-
};
|
|
253
|
-
debug: {
|
|
254
|
-
type: BooleanConstructor;
|
|
255
|
-
};
|
|
256
|
-
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
257
|
-
[key: string]: any;
|
|
258
|
-
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
259
|
-
selector: {
|
|
260
|
-
type: StringConstructor;
|
|
261
|
-
};
|
|
262
|
-
speed: {
|
|
263
|
-
type: NumberConstructor;
|
|
264
|
-
};
|
|
265
|
-
fade: {
|
|
266
|
-
type: BooleanConstructor;
|
|
267
|
-
};
|
|
268
|
-
stagger: {
|
|
269
|
-
type: NumberConstructor;
|
|
270
|
-
};
|
|
271
|
-
easing: {
|
|
272
|
-
type: (StringConstructor | FunctionConstructor)[];
|
|
273
|
-
};
|
|
274
|
-
direction: {
|
|
275
|
-
type: () => "forward" | "reverse";
|
|
276
|
-
};
|
|
277
|
-
trigger: {
|
|
278
|
-
type: ObjectConstructor;
|
|
279
|
-
};
|
|
280
|
-
onProgress: {
|
|
281
|
-
type: FunctionConstructor;
|
|
282
|
-
};
|
|
283
|
-
onStart: {
|
|
284
|
-
type: FunctionConstructor;
|
|
285
|
-
};
|
|
286
|
-
onComplete: {
|
|
287
|
-
type: FunctionConstructor;
|
|
288
|
-
};
|
|
289
|
-
once: {
|
|
290
|
-
type: BooleanConstructor;
|
|
291
|
-
};
|
|
292
|
-
debug: {
|
|
293
|
-
type: BooleanConstructor;
|
|
294
|
-
};
|
|
295
|
-
}>> & Readonly<{}>, {
|
|
296
|
-
fade: boolean;
|
|
297
|
-
once: boolean;
|
|
298
|
-
debug: boolean;
|
|
299
|
-
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
300
|
-
/**
|
|
301
|
-
* Composable — call with a full options object and bind the returned ref to
|
|
302
|
-
* whichever element you want to animate.
|
|
303
|
-
*
|
|
304
|
-
* @example
|
|
305
|
-
* <script setup>
|
|
306
|
-
* import { useScrollAnimate } from 'svg-scroll-draw/vue';
|
|
307
|
-
* const el = useScrollAnimate({ props: { opacity: [0, 1] }, easing: 'ease-out', once: true });
|
|
308
|
-
* </script>
|
|
309
|
-
* <div :ref="el">...</div>
|
|
310
|
-
*/
|
|
311
|
-
declare function useScrollAnimate(options: ScrollAnimateOptions): vue.Ref<HTMLElement | null, HTMLElement | null>;
|
|
312
|
-
/**
|
|
313
|
-
* Component — accepts a single `:options` prop and wraps children in a <div>.
|
|
314
|
-
*
|
|
315
|
-
* @example
|
|
316
|
-
* <ScrollAnimate :options="{ props: { opacity: [0, 1] }, easing: 'ease-out' }">
|
|
317
|
-
* <div>...</div>
|
|
318
|
-
* </ScrollAnimate>
|
|
319
|
-
*/
|
|
320
|
-
declare const ScrollAnimate: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
321
|
-
options: {
|
|
322
|
-
type: () => ScrollAnimateOptions;
|
|
323
|
-
required: true;
|
|
324
|
-
};
|
|
325
|
-
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
326
|
-
[key: string]: any;
|
|
327
|
-
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
328
|
-
options: {
|
|
329
|
-
type: () => ScrollAnimateOptions;
|
|
330
|
-
required: true;
|
|
331
|
-
};
|
|
332
|
-
}>> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
333
|
-
/**
|
|
334
|
-
* Composable — returns a ref to bind to a span/element that will count up on scroll.
|
|
335
|
-
*
|
|
336
|
-
* @example
|
|
337
|
-
* <script setup>
|
|
338
|
-
* import { useScrollCounter } from 'svg-scroll-draw/vue';
|
|
339
|
-
* const el = useScrollCounter({ to: 1000, easing: 'ease-out', once: true });
|
|
340
|
-
* </script>
|
|
341
|
-
* <span :ref="el" />
|
|
342
|
-
*/
|
|
343
|
-
declare function useScrollCounter(options: ScrollCounterOptions): vue.Ref<HTMLElement | null, HTMLElement | null>;
|
|
344
|
-
/**
|
|
345
|
-
* Component — renders a <span> that counts from `from` to `to` on scroll.
|
|
346
|
-
*
|
|
347
|
-
* @example
|
|
348
|
-
* <ScrollCounter :to="1250000" :format="n => '$' + Math.round(n).toLocaleString()" />
|
|
349
|
-
*/
|
|
350
|
-
declare const ScrollCounter: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
351
|
-
to: {
|
|
352
|
-
type: NumberConstructor;
|
|
353
|
-
required: true;
|
|
354
|
-
};
|
|
355
|
-
from: {
|
|
356
|
-
type: NumberConstructor;
|
|
357
|
-
};
|
|
358
|
-
format: {
|
|
359
|
-
type: () => ScrollCounterOptions["format"];
|
|
360
|
-
};
|
|
361
|
-
easing: {
|
|
362
|
-
type: (StringConstructor | FunctionConstructor)[];
|
|
363
|
-
};
|
|
364
|
-
trigger: {
|
|
365
|
-
type: ObjectConstructor;
|
|
366
|
-
};
|
|
367
|
-
once: {
|
|
368
|
-
type: BooleanConstructor;
|
|
369
|
-
};
|
|
370
|
-
decimals: {
|
|
371
|
-
type: NumberConstructor;
|
|
372
|
-
};
|
|
373
|
-
onComplete: {
|
|
374
|
-
type: FunctionConstructor;
|
|
375
|
-
};
|
|
376
|
-
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
377
|
-
[key: string]: any;
|
|
378
|
-
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
379
|
-
to: {
|
|
380
|
-
type: NumberConstructor;
|
|
381
|
-
required: true;
|
|
382
|
-
};
|
|
383
|
-
from: {
|
|
384
|
-
type: NumberConstructor;
|
|
385
|
-
};
|
|
386
|
-
format: {
|
|
387
|
-
type: () => ScrollCounterOptions["format"];
|
|
388
|
-
};
|
|
389
|
-
easing: {
|
|
390
|
-
type: (StringConstructor | FunctionConstructor)[];
|
|
391
|
-
};
|
|
392
|
-
trigger: {
|
|
393
|
-
type: ObjectConstructor;
|
|
394
|
-
};
|
|
395
|
-
once: {
|
|
396
|
-
type: BooleanConstructor;
|
|
397
|
-
};
|
|
398
|
-
decimals: {
|
|
399
|
-
type: NumberConstructor;
|
|
400
|
-
};
|
|
401
|
-
onComplete: {
|
|
402
|
-
type: FunctionConstructor;
|
|
403
|
-
};
|
|
404
|
-
}>> & Readonly<{}>, {
|
|
405
|
-
once: boolean;
|
|
406
|
-
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
407
|
-
/**
|
|
408
|
-
* Composable — returns a ref to bind to a <video> element.
|
|
409
|
-
*
|
|
410
|
-
* @example
|
|
411
|
-
* <script setup>
|
|
412
|
-
* import { useScrollVideo } from 'svg-scroll-draw/vue';
|
|
413
|
-
* const vid = useScrollVideo({ trigger: { start: 'top top', end: 'bottom top' } });
|
|
414
|
-
* </script>
|
|
415
|
-
* <video :ref="vid" src="..." muted playsinline preload="auto" />
|
|
416
|
-
*/
|
|
417
|
-
declare function useScrollVideo(options?: ScrollVideoOptions): vue.Ref<HTMLVideoElement | null, HTMLVideoElement | null>;
|
|
418
|
-
/**
|
|
419
|
-
* Component — renders a <video> scrubbed by scroll position.
|
|
420
|
-
*
|
|
421
|
-
* @example
|
|
422
|
-
* <ScrollVideo src="/hero.mp4" :options="{ trigger: { start: 'top top', end: 'bottom top' } }" />
|
|
423
|
-
*/
|
|
424
|
-
declare const ScrollVideo: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
425
|
-
src: {
|
|
426
|
-
type: StringConstructor;
|
|
427
|
-
required: true;
|
|
428
|
-
};
|
|
429
|
-
options: {
|
|
430
|
-
type: () => ScrollVideoOptions;
|
|
431
|
-
};
|
|
432
|
-
muted: {
|
|
433
|
-
type: BooleanConstructor;
|
|
434
|
-
default: boolean;
|
|
435
|
-
};
|
|
436
|
-
playsInline: {
|
|
437
|
-
type: BooleanConstructor;
|
|
438
|
-
default: boolean;
|
|
439
|
-
};
|
|
440
|
-
class: {
|
|
441
|
-
type: StringConstructor;
|
|
442
|
-
};
|
|
443
|
-
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
444
|
-
[key: string]: any;
|
|
445
|
-
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
446
|
-
src: {
|
|
447
|
-
type: StringConstructor;
|
|
448
|
-
required: true;
|
|
449
|
-
};
|
|
450
|
-
options: {
|
|
451
|
-
type: () => ScrollVideoOptions;
|
|
452
|
-
};
|
|
453
|
-
muted: {
|
|
454
|
-
type: BooleanConstructor;
|
|
455
|
-
default: boolean;
|
|
456
|
-
};
|
|
457
|
-
playsInline: {
|
|
458
|
-
type: BooleanConstructor;
|
|
459
|
-
default: boolean;
|
|
460
|
-
};
|
|
461
|
-
class: {
|
|
462
|
-
type: StringConstructor;
|
|
463
|
-
};
|
|
464
|
-
}>> & Readonly<{}>, {
|
|
465
|
-
muted: boolean;
|
|
466
|
-
playsInline: boolean;
|
|
467
|
-
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
468
|
-
/**
|
|
469
|
-
* Composable — returns a ref to bind to any text element; splits and animates on scroll.
|
|
470
|
-
*
|
|
471
|
-
* @example
|
|
472
|
-
* <script setup>
|
|
473
|
-
* import { useScrollText } from 'svg-scroll-draw/vue';
|
|
474
|
-
* const el = useScrollText({ split: 'words', stagger: 0.05, once: true });
|
|
475
|
-
* </script>
|
|
476
|
-
* <h2 :ref="el">Animate on scroll.</h2>
|
|
477
|
-
*/
|
|
478
|
-
declare function useScrollText(options?: ScrollTextOptions): vue.Ref<HTMLElement | null, HTMLElement | null>;
|
|
479
|
-
/**
|
|
480
|
-
* Component — wraps text content in a <p> (or any tag) and animates it on scroll.
|
|
481
|
-
*
|
|
482
|
-
* @example
|
|
483
|
-
* <ScrollText :options="{ split: 'words', stagger: 0.05 }" tag="h2">
|
|
484
|
-
* Animate on scroll.
|
|
485
|
-
* </ScrollText>
|
|
486
|
-
*/
|
|
487
|
-
declare const ScrollText: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
488
|
-
options: {
|
|
489
|
-
type: () => ScrollTextOptions;
|
|
490
|
-
};
|
|
491
|
-
tag: {
|
|
492
|
-
type: StringConstructor;
|
|
493
|
-
default: string;
|
|
494
|
-
};
|
|
495
|
-
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
496
|
-
[key: string]: any;
|
|
497
|
-
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
498
|
-
options: {
|
|
499
|
-
type: () => ScrollTextOptions;
|
|
500
|
-
};
|
|
501
|
-
tag: {
|
|
502
|
-
type: StringConstructor;
|
|
503
|
-
default: string;
|
|
504
|
-
};
|
|
505
|
-
}>> & Readonly<{}>, {
|
|
506
|
-
tag: string;
|
|
507
|
-
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
4
|
+
export { S as ScrollAnimateOptions } from '../engine-Ci08nM91.mjs';
|
|
5
|
+
export { S as ScrollCounterOptions } from '../index-BDGQEK6X.mjs';
|
|
6
|
+
export { ScrollTextOptions } from '../text/index.mjs';
|
|
7
|
+
export { ScrollVideoOptions } from '../video/index.mjs';
|
|
508
8
|
|
|
509
9
|
/**
|
|
510
10
|
* Nuxt 3 integration for svg-scroll-draw.
|
|
@@ -541,4 +41,4 @@ declare function createScrollDrawPlugin(): {
|
|
|
541
41
|
install(app: App): void;
|
|
542
42
|
};
|
|
543
43
|
|
|
544
|
-
export {
|
|
44
|
+
export { createScrollDrawPlugin };
|