svg-scroll-draw 2.15.2 → 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 -238
- package/dist/angular/index.d.ts +7 -238
- 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 -146
- package/dist/astro/index.d.ts +4 -146
- 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 -205
- package/dist/group/index.d.ts +4 -205
- 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 -292
- package/dist/index.d.ts +8 -292
- package/dist/index.mjs +1 -4
- package/dist/nuxt/index.cjs +2 -2
- package/dist/nuxt/index.d.mts +7 -505
- package/dist/nuxt/index.d.ts +7 -505
- 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 -210
- package/dist/react/index.d.ts +5 -210
- package/dist/react/index.mjs +1 -3
- package/dist/reveal/index.cjs +1 -1
- package/dist/reveal/index.d.mts +10 -8
- package/dist/reveal/index.d.ts +10 -8
- 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 -238
- package/dist/solid/index.d.ts +6 -238
- package/dist/solid/index.mjs +1 -3
- package/dist/svelte/index.cjs +2 -2
- package/dist/svelte/index.d.mts +6 -238
- package/dist/svelte/index.d.ts +6 -238
- 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 -211
- package/dist/vue/index.d.ts +6 -211
- 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/solid/index.d.mts
CHANGED
|
@@ -1,240 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
interface ScrollDrawOptions {
|
|
8
|
-
/**
|
|
9
|
-
* Apply a named preset as the base configuration. User-supplied options
|
|
10
|
-
* always override the preset. Available presets:
|
|
11
|
-
* - `'sketch'` — staggered ease-in draw, pencil feel
|
|
12
|
-
* - `'reveal'` — fade + ease-out, draws once on viewport entry
|
|
13
|
-
* - `'typewriter'` — fast linear draw with stagger
|
|
14
|
-
* - `'cinematic'` — slow ease-in-out with fade, dramatic entrance
|
|
15
|
-
* - `'spring'` — spring easing, bouncy organic feel
|
|
16
|
-
*/
|
|
17
|
-
preset?: PresetName;
|
|
18
|
-
selector?: string;
|
|
19
|
-
speed?: number;
|
|
20
|
-
fade?: boolean;
|
|
21
|
-
easing?: EasingName | ((t: number) => number);
|
|
22
|
-
trigger?: TriggerConfig;
|
|
23
|
-
stagger?: number;
|
|
24
|
-
direction?: 'forward' | 'reverse';
|
|
25
|
-
once?: boolean;
|
|
26
|
-
debug?: boolean;
|
|
27
|
-
/** Scroll axis to track. 'y' (default) for vertical, 'x' for horizontal. */
|
|
28
|
-
axis?: 'x' | 'y';
|
|
29
|
-
/** CSS selector or Element for a custom scroll container (default: window). */
|
|
30
|
-
scrollContainer?: string | Element;
|
|
31
|
-
/** Automatically reverse the animation when the user scrolls back up. */
|
|
32
|
-
autoReverse?: boolean;
|
|
33
|
-
/** Delay in milliseconds before the engine starts observing. */
|
|
34
|
-
delay?: number;
|
|
35
|
-
/** Animate stroke color. Single string = static override. Tuple = interpolate from → to. */
|
|
36
|
-
strokeColor?: string | [string, string];
|
|
37
|
-
/** Animate stroke width. Single number = static override. Tuple = interpolate from → to. */
|
|
38
|
-
strokeWidth?: number | [number, number];
|
|
39
|
-
/** 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. */
|
|
40
|
-
fillOpacity?: number | [number, number];
|
|
41
|
-
/**
|
|
42
|
-
* Reveal the container using CSS clip-path instead of stroke-dashoffset.
|
|
43
|
-
* Works on any content — SVG, images, text, divs.
|
|
44
|
-
*
|
|
45
|
-
* Pass a direction string to control which edge the reveal starts from,
|
|
46
|
-
* or `true` as shorthand for `'left'`.
|
|
47
|
-
*
|
|
48
|
-
* Values: `'left' | 'right' | 'top' | 'bottom' | 'center'`
|
|
49
|
-
*/
|
|
50
|
-
clip?: boolean | 'left' | 'right' | 'top' | 'bottom' | 'center';
|
|
51
|
-
/** Fire callbacks at specific progress thresholds (0–1). Resets on replay(). */
|
|
52
|
-
waypoints?: Record<number, () => void>;
|
|
53
|
-
/** Scale animation speed by scroll velocity — faster scrolling = faster draw. Pass a number to control sensitivity (default 1). */
|
|
54
|
-
velocityScale?: boolean | number;
|
|
55
|
-
/** IntersectionObserver threshold (0–1). Default 0. */
|
|
56
|
-
threshold?: number;
|
|
57
|
-
/** IntersectionObserver rootMargin. Default "0px". */
|
|
58
|
-
rootMargin?: string;
|
|
59
|
-
/** Repeat the animation N times after completion. Use 'infinite' to loop forever. */
|
|
60
|
-
repeat?: number | 'infinite';
|
|
61
|
-
/** Milliseconds to wait between repeats. Default 0. */
|
|
62
|
-
repeatDelay?: number;
|
|
63
|
-
/**
|
|
64
|
-
* Target path `d` attribute to morph toward as the animation progresses.
|
|
65
|
-
* Paths must have compatible command structures (same number of numeric tokens).
|
|
66
|
-
*
|
|
67
|
-
* Only applies to `<path>` elements — silently no-ops on `<rect>`, `<circle>`,
|
|
68
|
-
* `<line>`, and other SVG shape elements.
|
|
69
|
-
*/
|
|
70
|
-
morphTo?: string;
|
|
71
|
-
onProgress?: (alpha: number) => void;
|
|
72
|
-
onStart?: () => void;
|
|
73
|
-
onComplete?: () => void;
|
|
74
|
-
/** Fires when scroll position enters the trigger zone (scrolling forward). */
|
|
75
|
-
onEnter?: () => void;
|
|
76
|
-
/** Fires when scroll position exits the trigger zone at the end (scrolling forward). */
|
|
77
|
-
onLeave?: () => void;
|
|
78
|
-
/** Fires when scroll position re-enters the trigger zone from the end (scrolling back). */
|
|
79
|
-
onEnterBack?: () => void;
|
|
80
|
-
/** Fires when scroll position exits the trigger zone at the start (scrolling back). */
|
|
81
|
-
onLeaveBack?: () => void;
|
|
82
|
-
/**
|
|
83
|
-
* Trigger the animation when the element enters the viewport instead of
|
|
84
|
-
* tying it to scroll position. The draw runs over `duration` milliseconds,
|
|
85
|
-
* replaying each time the element re-enters the viewport (use `once: true`
|
|
86
|
-
* to play only the first time).
|
|
87
|
-
*
|
|
88
|
-
* All visual options work in autoplay mode — `easing`, `stagger`, `fade`,
|
|
89
|
-
* `strokeColor`, `strokeWidth`, `fillOpacity`, `clip`, `morphTo`, `waypoints`,
|
|
90
|
-
* `repeat`, `repeatDelay`, `onStart`, `onComplete`, `onProgress`, etc.
|
|
91
|
-
*
|
|
92
|
-
* The full instance API (`pause`, `resume`, `seek`, `replay`, `getProgress`)
|
|
93
|
-
* also works — `seek(0.5)` pauses at 50% of the duration.
|
|
94
|
-
*/
|
|
95
|
-
autoplay?: boolean;
|
|
96
|
-
/**
|
|
97
|
-
* Duration of the autoplay animation in milliseconds. Only used when
|
|
98
|
-
* `autoplay: true`. Default `1000`.
|
|
99
|
-
*/
|
|
100
|
-
duration?: number;
|
|
101
|
-
/**
|
|
102
|
-
* Use the browser's native CSS scroll-driven animation
|
|
103
|
-
* (`animation-timeline: view()`) when the configuration is simple enough and
|
|
104
|
-
* the browser supports it. This runs the draw entirely on the compositor —
|
|
105
|
-
* zero per-frame JavaScript, zero scroll/resize listeners.
|
|
106
|
-
*
|
|
107
|
-
* Falls back to the JS engine automatically when unsupported or when the
|
|
108
|
-
* config uses a feature native CSS can't express (callbacks, stagger, morph,
|
|
109
|
-
* velocity scaling, custom triggers, `once`, custom easing functions, etc.).
|
|
110
|
-
*
|
|
111
|
-
* - `undefined` / `true` (default): use native when eligible.
|
|
112
|
-
* - `false`: always use the JS engine.
|
|
113
|
-
*/
|
|
114
|
-
native?: boolean;
|
|
115
|
-
}
|
|
116
|
-
interface ScrollDrawInstance {
|
|
117
|
-
destroy: () => void;
|
|
118
|
-
/** Reset and replay the animation from the beginning. */
|
|
119
|
-
replay: () => void;
|
|
120
|
-
/** Pause the animation at the current progress. */
|
|
121
|
-
pause: () => void;
|
|
122
|
-
/** Resume a paused animation. */
|
|
123
|
-
resume: () => void;
|
|
124
|
-
/** Jump to a specific progress value (0–1) and pause. */
|
|
125
|
-
seek: (progress: number) => void;
|
|
126
|
-
/** Returns current draw progress (0–1). */
|
|
127
|
-
getProgress: () => number;
|
|
128
|
-
/**
|
|
129
|
-
* Re-measure after a layout change: path lengths, and the scroll trigger window.
|
|
130
|
-
*
|
|
131
|
-
* The engine already re-measures on `resize`, on `orientationchange`, and via a
|
|
132
|
-
* `ResizeObserver` on the document element — but none of those fire for a layout
|
|
133
|
-
* change that leaves the document height alone, such as a tab switching, a
|
|
134
|
-
* sibling collapsing, or a font swapping inside a fixed-height box. Call this
|
|
135
|
-
* after one of those.
|
|
136
|
-
*
|
|
137
|
-
* Optional on this shared type because several instances here are fan-outs over
|
|
138
|
-
* other instances or SSR no-op stubs. `scrollDraw`, `scrollPin`,
|
|
139
|
-
* `scrollHorizontal`, `scrollDrawTimeline` and the group APIs all provide it;
|
|
140
|
-
* use `instance.refresh?.()` if you hold an instance of unknown origin.
|
|
141
|
-
*/
|
|
142
|
-
refresh?: () => void;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
interface ScrollAnimateOptions {
|
|
146
|
-
props: Record<string, string | number | [string | number, string | number]>;
|
|
147
|
-
trigger?: TriggerConfig;
|
|
148
|
-
easing?: EasingName | ((t: number) => number);
|
|
149
|
-
speed?: number;
|
|
150
|
-
once?: boolean;
|
|
151
|
-
axis?: 'x' | 'y';
|
|
152
|
-
scrollContainer?: string | Element;
|
|
153
|
-
native?: boolean;
|
|
154
|
-
/**
|
|
155
|
-
* Scale animation speed by scroll velocity — faster scrolling = faster animation.
|
|
156
|
-
* Pass `true` for default sensitivity (1) or a number to control it.
|
|
157
|
-
* Higher values = more dramatic speed-up. Default sensitivity: 1.
|
|
158
|
-
*/
|
|
159
|
-
velocityScale?: boolean | number;
|
|
160
|
-
/**
|
|
161
|
-
* Honour `prefers-reduced-motion: reduce` by applying the final state and not
|
|
162
|
-
* animating. Default: `true`.
|
|
163
|
-
*
|
|
164
|
-
* Set to `false` only when the movement is *scroll-linked scrubbing* rather
|
|
165
|
-
* than autonomous motion — it advances solely as the user scrolls, 1:1 with
|
|
166
|
-
* their input, so it is direct manipulation rather than something that plays at
|
|
167
|
-
* them. `scrollHorizontal` sets this, because jumping to the final state there
|
|
168
|
-
* would leave every panel but the last unreachable inside the sticky
|
|
169
|
-
* `overflow: hidden` container.
|
|
170
|
-
*/
|
|
171
|
-
respectReducedMotion?: boolean;
|
|
172
|
-
/**
|
|
173
|
-
* Element whose geometry defines the trigger window, when that is not the
|
|
174
|
-
* element being animated. Defaults to the animated element.
|
|
175
|
-
*
|
|
176
|
-
* Needed whenever the animated element cannot supply the scroll length itself —
|
|
177
|
-
* the case that matters is a `position: sticky` stage, where the pinned element
|
|
178
|
-
* is exactly one viewport tall and all of the scroll room belongs to its
|
|
179
|
-
* container. Resolving `top top` → `bottom bottom` against the pinned element
|
|
180
|
-
* there yields tStart === tEnd, a zero-length window, and no movement at all.
|
|
181
|
-
*
|
|
182
|
-
* Setting this disables the native CSS fast path: `animation-timeline: view()`
|
|
183
|
-
* always measures the element the animation is attached to, so it cannot express
|
|
184
|
-
* a separate subject.
|
|
185
|
-
*/
|
|
186
|
-
triggerElement?: Element;
|
|
187
|
-
onProgress?: (alpha: number) => void;
|
|
188
|
-
onComplete?: () => void;
|
|
189
|
-
/** Fires when scroll enters the trigger zone (scrolling forward). */
|
|
190
|
-
onEnter?: () => void;
|
|
191
|
-
/** Fires when scroll exits the trigger zone at the end (scrolling forward). */
|
|
192
|
-
onLeave?: () => void;
|
|
193
|
-
/** Fires when scroll re-enters the trigger zone from the end (scrolling back). */
|
|
194
|
-
onEnterBack?: () => void;
|
|
195
|
-
/** Fires when scroll exits the trigger zone at the start (scrolling back). */
|
|
196
|
-
onLeaveBack?: () => void;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
interface ScrollCounterOptions {
|
|
200
|
-
from?: number;
|
|
201
|
-
to: number;
|
|
202
|
-
format?: (value: number) => string;
|
|
203
|
-
easing?: EasingName | ((t: number) => number);
|
|
204
|
-
trigger?: TriggerConfig;
|
|
205
|
-
once?: boolean;
|
|
206
|
-
decimals?: number;
|
|
207
|
-
onComplete?: () => void;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
interface ScrollVideoOptions {
|
|
211
|
-
trigger?: TriggerConfig;
|
|
212
|
-
from?: number;
|
|
213
|
-
to?: number;
|
|
214
|
-
easing?: EasingName | ((t: number) => number);
|
|
215
|
-
once?: boolean;
|
|
216
|
-
axis?: 'x' | 'y';
|
|
217
|
-
preload?: 'auto' | 'metadata';
|
|
218
|
-
onReady?: () => void;
|
|
219
|
-
onComplete?: () => void;
|
|
220
|
-
onProgress?: (alpha: number) => void;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
interface ScrollTextOptions {
|
|
224
|
-
split?: 'chars' | 'words' | 'lines';
|
|
225
|
-
stagger?: number;
|
|
226
|
-
easing?: EasingName | ((t: number) => number);
|
|
227
|
-
from?: {
|
|
228
|
-
opacity?: number;
|
|
229
|
-
y?: number;
|
|
230
|
-
x?: number;
|
|
231
|
-
rotate?: number;
|
|
232
|
-
scale?: number;
|
|
233
|
-
};
|
|
234
|
-
trigger?: TriggerConfig;
|
|
235
|
-
once?: boolean;
|
|
236
|
-
onComplete?: () => void;
|
|
237
|
-
}
|
|
1
|
+
import { S as ScrollDrawInstance, a as ScrollDrawOptions } from '../types-DHU1zNEw.mjs';
|
|
2
|
+
import { S as ScrollAnimateOptions } from '../engine-Ci08nM91.mjs';
|
|
3
|
+
import { S as ScrollCounterOptions } from '../index-BDGQEK6X.mjs';
|
|
4
|
+
import { ScrollVideoOptions } from '../video/index.mjs';
|
|
5
|
+
import { ScrollTextOptions } from '../text/index.mjs';
|
|
238
6
|
|
|
239
7
|
/**
|
|
240
8
|
* SolidJS hook — returns a ref setter to attach to any container element.
|
|
@@ -363,4 +131,4 @@ declare function createScrollText(options?: ScrollTextOptions): {
|
|
|
363
131
|
getInstance: () => ScrollDrawInstance | undefined;
|
|
364
132
|
};
|
|
365
133
|
|
|
366
|
-
export {
|
|
134
|
+
export { ScrollAnimateOptions, ScrollCounterOptions, ScrollDrawOptions, ScrollTextOptions, ScrollVideoOptions, createScrollAnimate, createScrollCounter, createScrollDraw, createScrollText, createScrollVideo, useScrollAnimate, useScrollCounter, useScrollDraw, useScrollText, useScrollVideo };
|
package/dist/solid/index.d.ts
CHANGED
|
@@ -1,240 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
interface ScrollDrawOptions {
|
|
8
|
-
/**
|
|
9
|
-
* Apply a named preset as the base configuration. User-supplied options
|
|
10
|
-
* always override the preset. Available presets:
|
|
11
|
-
* - `'sketch'` — staggered ease-in draw, pencil feel
|
|
12
|
-
* - `'reveal'` — fade + ease-out, draws once on viewport entry
|
|
13
|
-
* - `'typewriter'` — fast linear draw with stagger
|
|
14
|
-
* - `'cinematic'` — slow ease-in-out with fade, dramatic entrance
|
|
15
|
-
* - `'spring'` — spring easing, bouncy organic feel
|
|
16
|
-
*/
|
|
17
|
-
preset?: PresetName;
|
|
18
|
-
selector?: string;
|
|
19
|
-
speed?: number;
|
|
20
|
-
fade?: boolean;
|
|
21
|
-
easing?: EasingName | ((t: number) => number);
|
|
22
|
-
trigger?: TriggerConfig;
|
|
23
|
-
stagger?: number;
|
|
24
|
-
direction?: 'forward' | 'reverse';
|
|
25
|
-
once?: boolean;
|
|
26
|
-
debug?: boolean;
|
|
27
|
-
/** Scroll axis to track. 'y' (default) for vertical, 'x' for horizontal. */
|
|
28
|
-
axis?: 'x' | 'y';
|
|
29
|
-
/** CSS selector or Element for a custom scroll container (default: window). */
|
|
30
|
-
scrollContainer?: string | Element;
|
|
31
|
-
/** Automatically reverse the animation when the user scrolls back up. */
|
|
32
|
-
autoReverse?: boolean;
|
|
33
|
-
/** Delay in milliseconds before the engine starts observing. */
|
|
34
|
-
delay?: number;
|
|
35
|
-
/** Animate stroke color. Single string = static override. Tuple = interpolate from → to. */
|
|
36
|
-
strokeColor?: string | [string, string];
|
|
37
|
-
/** Animate stroke width. Single number = static override. Tuple = interpolate from → to. */
|
|
38
|
-
strokeWidth?: number | [number, number];
|
|
39
|
-
/** 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. */
|
|
40
|
-
fillOpacity?: number | [number, number];
|
|
41
|
-
/**
|
|
42
|
-
* Reveal the container using CSS clip-path instead of stroke-dashoffset.
|
|
43
|
-
* Works on any content — SVG, images, text, divs.
|
|
44
|
-
*
|
|
45
|
-
* Pass a direction string to control which edge the reveal starts from,
|
|
46
|
-
* or `true` as shorthand for `'left'`.
|
|
47
|
-
*
|
|
48
|
-
* Values: `'left' | 'right' | 'top' | 'bottom' | 'center'`
|
|
49
|
-
*/
|
|
50
|
-
clip?: boolean | 'left' | 'right' | 'top' | 'bottom' | 'center';
|
|
51
|
-
/** Fire callbacks at specific progress thresholds (0–1). Resets on replay(). */
|
|
52
|
-
waypoints?: Record<number, () => void>;
|
|
53
|
-
/** Scale animation speed by scroll velocity — faster scrolling = faster draw. Pass a number to control sensitivity (default 1). */
|
|
54
|
-
velocityScale?: boolean | number;
|
|
55
|
-
/** IntersectionObserver threshold (0–1). Default 0. */
|
|
56
|
-
threshold?: number;
|
|
57
|
-
/** IntersectionObserver rootMargin. Default "0px". */
|
|
58
|
-
rootMargin?: string;
|
|
59
|
-
/** Repeat the animation N times after completion. Use 'infinite' to loop forever. */
|
|
60
|
-
repeat?: number | 'infinite';
|
|
61
|
-
/** Milliseconds to wait between repeats. Default 0. */
|
|
62
|
-
repeatDelay?: number;
|
|
63
|
-
/**
|
|
64
|
-
* Target path `d` attribute to morph toward as the animation progresses.
|
|
65
|
-
* Paths must have compatible command structures (same number of numeric tokens).
|
|
66
|
-
*
|
|
67
|
-
* Only applies to `<path>` elements — silently no-ops on `<rect>`, `<circle>`,
|
|
68
|
-
* `<line>`, and other SVG shape elements.
|
|
69
|
-
*/
|
|
70
|
-
morphTo?: string;
|
|
71
|
-
onProgress?: (alpha: number) => void;
|
|
72
|
-
onStart?: () => void;
|
|
73
|
-
onComplete?: () => void;
|
|
74
|
-
/** Fires when scroll position enters the trigger zone (scrolling forward). */
|
|
75
|
-
onEnter?: () => void;
|
|
76
|
-
/** Fires when scroll position exits the trigger zone at the end (scrolling forward). */
|
|
77
|
-
onLeave?: () => void;
|
|
78
|
-
/** Fires when scroll position re-enters the trigger zone from the end (scrolling back). */
|
|
79
|
-
onEnterBack?: () => void;
|
|
80
|
-
/** Fires when scroll position exits the trigger zone at the start (scrolling back). */
|
|
81
|
-
onLeaveBack?: () => void;
|
|
82
|
-
/**
|
|
83
|
-
* Trigger the animation when the element enters the viewport instead of
|
|
84
|
-
* tying it to scroll position. The draw runs over `duration` milliseconds,
|
|
85
|
-
* replaying each time the element re-enters the viewport (use `once: true`
|
|
86
|
-
* to play only the first time).
|
|
87
|
-
*
|
|
88
|
-
* All visual options work in autoplay mode — `easing`, `stagger`, `fade`,
|
|
89
|
-
* `strokeColor`, `strokeWidth`, `fillOpacity`, `clip`, `morphTo`, `waypoints`,
|
|
90
|
-
* `repeat`, `repeatDelay`, `onStart`, `onComplete`, `onProgress`, etc.
|
|
91
|
-
*
|
|
92
|
-
* The full instance API (`pause`, `resume`, `seek`, `replay`, `getProgress`)
|
|
93
|
-
* also works — `seek(0.5)` pauses at 50% of the duration.
|
|
94
|
-
*/
|
|
95
|
-
autoplay?: boolean;
|
|
96
|
-
/**
|
|
97
|
-
* Duration of the autoplay animation in milliseconds. Only used when
|
|
98
|
-
* `autoplay: true`. Default `1000`.
|
|
99
|
-
*/
|
|
100
|
-
duration?: number;
|
|
101
|
-
/**
|
|
102
|
-
* Use the browser's native CSS scroll-driven animation
|
|
103
|
-
* (`animation-timeline: view()`) when the configuration is simple enough and
|
|
104
|
-
* the browser supports it. This runs the draw entirely on the compositor —
|
|
105
|
-
* zero per-frame JavaScript, zero scroll/resize listeners.
|
|
106
|
-
*
|
|
107
|
-
* Falls back to the JS engine automatically when unsupported or when the
|
|
108
|
-
* config uses a feature native CSS can't express (callbacks, stagger, morph,
|
|
109
|
-
* velocity scaling, custom triggers, `once`, custom easing functions, etc.).
|
|
110
|
-
*
|
|
111
|
-
* - `undefined` / `true` (default): use native when eligible.
|
|
112
|
-
* - `false`: always use the JS engine.
|
|
113
|
-
*/
|
|
114
|
-
native?: boolean;
|
|
115
|
-
}
|
|
116
|
-
interface ScrollDrawInstance {
|
|
117
|
-
destroy: () => void;
|
|
118
|
-
/** Reset and replay the animation from the beginning. */
|
|
119
|
-
replay: () => void;
|
|
120
|
-
/** Pause the animation at the current progress. */
|
|
121
|
-
pause: () => void;
|
|
122
|
-
/** Resume a paused animation. */
|
|
123
|
-
resume: () => void;
|
|
124
|
-
/** Jump to a specific progress value (0–1) and pause. */
|
|
125
|
-
seek: (progress: number) => void;
|
|
126
|
-
/** Returns current draw progress (0–1). */
|
|
127
|
-
getProgress: () => number;
|
|
128
|
-
/**
|
|
129
|
-
* Re-measure after a layout change: path lengths, and the scroll trigger window.
|
|
130
|
-
*
|
|
131
|
-
* The engine already re-measures on `resize`, on `orientationchange`, and via a
|
|
132
|
-
* `ResizeObserver` on the document element — but none of those fire for a layout
|
|
133
|
-
* change that leaves the document height alone, such as a tab switching, a
|
|
134
|
-
* sibling collapsing, or a font swapping inside a fixed-height box. Call this
|
|
135
|
-
* after one of those.
|
|
136
|
-
*
|
|
137
|
-
* Optional on this shared type because several instances here are fan-outs over
|
|
138
|
-
* other instances or SSR no-op stubs. `scrollDraw`, `scrollPin`,
|
|
139
|
-
* `scrollHorizontal`, `scrollDrawTimeline` and the group APIs all provide it;
|
|
140
|
-
* use `instance.refresh?.()` if you hold an instance of unknown origin.
|
|
141
|
-
*/
|
|
142
|
-
refresh?: () => void;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
interface ScrollAnimateOptions {
|
|
146
|
-
props: Record<string, string | number | [string | number, string | number]>;
|
|
147
|
-
trigger?: TriggerConfig;
|
|
148
|
-
easing?: EasingName | ((t: number) => number);
|
|
149
|
-
speed?: number;
|
|
150
|
-
once?: boolean;
|
|
151
|
-
axis?: 'x' | 'y';
|
|
152
|
-
scrollContainer?: string | Element;
|
|
153
|
-
native?: boolean;
|
|
154
|
-
/**
|
|
155
|
-
* Scale animation speed by scroll velocity — faster scrolling = faster animation.
|
|
156
|
-
* Pass `true` for default sensitivity (1) or a number to control it.
|
|
157
|
-
* Higher values = more dramatic speed-up. Default sensitivity: 1.
|
|
158
|
-
*/
|
|
159
|
-
velocityScale?: boolean | number;
|
|
160
|
-
/**
|
|
161
|
-
* Honour `prefers-reduced-motion: reduce` by applying the final state and not
|
|
162
|
-
* animating. Default: `true`.
|
|
163
|
-
*
|
|
164
|
-
* Set to `false` only when the movement is *scroll-linked scrubbing* rather
|
|
165
|
-
* than autonomous motion — it advances solely as the user scrolls, 1:1 with
|
|
166
|
-
* their input, so it is direct manipulation rather than something that plays at
|
|
167
|
-
* them. `scrollHorizontal` sets this, because jumping to the final state there
|
|
168
|
-
* would leave every panel but the last unreachable inside the sticky
|
|
169
|
-
* `overflow: hidden` container.
|
|
170
|
-
*/
|
|
171
|
-
respectReducedMotion?: boolean;
|
|
172
|
-
/**
|
|
173
|
-
* Element whose geometry defines the trigger window, when that is not the
|
|
174
|
-
* element being animated. Defaults to the animated element.
|
|
175
|
-
*
|
|
176
|
-
* Needed whenever the animated element cannot supply the scroll length itself —
|
|
177
|
-
* the case that matters is a `position: sticky` stage, where the pinned element
|
|
178
|
-
* is exactly one viewport tall and all of the scroll room belongs to its
|
|
179
|
-
* container. Resolving `top top` → `bottom bottom` against the pinned element
|
|
180
|
-
* there yields tStart === tEnd, a zero-length window, and no movement at all.
|
|
181
|
-
*
|
|
182
|
-
* Setting this disables the native CSS fast path: `animation-timeline: view()`
|
|
183
|
-
* always measures the element the animation is attached to, so it cannot express
|
|
184
|
-
* a separate subject.
|
|
185
|
-
*/
|
|
186
|
-
triggerElement?: Element;
|
|
187
|
-
onProgress?: (alpha: number) => void;
|
|
188
|
-
onComplete?: () => void;
|
|
189
|
-
/** Fires when scroll enters the trigger zone (scrolling forward). */
|
|
190
|
-
onEnter?: () => void;
|
|
191
|
-
/** Fires when scroll exits the trigger zone at the end (scrolling forward). */
|
|
192
|
-
onLeave?: () => void;
|
|
193
|
-
/** Fires when scroll re-enters the trigger zone from the end (scrolling back). */
|
|
194
|
-
onEnterBack?: () => void;
|
|
195
|
-
/** Fires when scroll exits the trigger zone at the start (scrolling back). */
|
|
196
|
-
onLeaveBack?: () => void;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
interface ScrollCounterOptions {
|
|
200
|
-
from?: number;
|
|
201
|
-
to: number;
|
|
202
|
-
format?: (value: number) => string;
|
|
203
|
-
easing?: EasingName | ((t: number) => number);
|
|
204
|
-
trigger?: TriggerConfig;
|
|
205
|
-
once?: boolean;
|
|
206
|
-
decimals?: number;
|
|
207
|
-
onComplete?: () => void;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
interface ScrollVideoOptions {
|
|
211
|
-
trigger?: TriggerConfig;
|
|
212
|
-
from?: number;
|
|
213
|
-
to?: number;
|
|
214
|
-
easing?: EasingName | ((t: number) => number);
|
|
215
|
-
once?: boolean;
|
|
216
|
-
axis?: 'x' | 'y';
|
|
217
|
-
preload?: 'auto' | 'metadata';
|
|
218
|
-
onReady?: () => void;
|
|
219
|
-
onComplete?: () => void;
|
|
220
|
-
onProgress?: (alpha: number) => void;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
interface ScrollTextOptions {
|
|
224
|
-
split?: 'chars' | 'words' | 'lines';
|
|
225
|
-
stagger?: number;
|
|
226
|
-
easing?: EasingName | ((t: number) => number);
|
|
227
|
-
from?: {
|
|
228
|
-
opacity?: number;
|
|
229
|
-
y?: number;
|
|
230
|
-
x?: number;
|
|
231
|
-
rotate?: number;
|
|
232
|
-
scale?: number;
|
|
233
|
-
};
|
|
234
|
-
trigger?: TriggerConfig;
|
|
235
|
-
once?: boolean;
|
|
236
|
-
onComplete?: () => void;
|
|
237
|
-
}
|
|
1
|
+
import { S as ScrollDrawInstance, a as ScrollDrawOptions } from '../types-DHU1zNEw.js';
|
|
2
|
+
import { S as ScrollAnimateOptions } from '../engine-6AXEX8CL.js';
|
|
3
|
+
import { S as ScrollCounterOptions } from '../index-DxjUOIbK.js';
|
|
4
|
+
import { ScrollVideoOptions } from '../video/index.js';
|
|
5
|
+
import { ScrollTextOptions } from '../text/index.js';
|
|
238
6
|
|
|
239
7
|
/**
|
|
240
8
|
* SolidJS hook — returns a ref setter to attach to any container element.
|
|
@@ -363,4 +131,4 @@ declare function createScrollText(options?: ScrollTextOptions): {
|
|
|
363
131
|
getInstance: () => ScrollDrawInstance | undefined;
|
|
364
132
|
};
|
|
365
133
|
|
|
366
|
-
export {
|
|
134
|
+
export { ScrollAnimateOptions, ScrollCounterOptions, ScrollDrawOptions, ScrollTextOptions, ScrollVideoOptions, createScrollAnimate, createScrollCounter, createScrollDraw, createScrollText, createScrollVideo, useScrollAnimate, useScrollCounter, useScrollDraw, useScrollText, useScrollVideo };
|
package/dist/solid/index.mjs
CHANGED
|
@@ -1,3 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
<div style="position:absolute;${m?`left:${c}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${c}px;left:0;right:0;border-top:2px dashed #22c55e;`}padding:2px 6px;color:#22c55e;background:rgba(0,0,0,.6)">\u25B6 start</div>
|
|
3
|
-
<div style="position:absolute;${m?`left:${u}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${u}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(t),window.addEventListener("scroll",l,{passive:true}),l(),{el:t,destroy(){window.removeEventListener("scroll",l),t.remove();}}}var Ct=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,It=/[MmLlHhVvCcSsQqTtAaZz]/g;function er(e,n,r){if(!je)return;let t=(e.match(It)??[]).join("").toUpperCase(),l=(n.match(It)??[]).join("").toUpperCase(),s=(e.match(Ct)??[]).length,c=(n.match(Ct)??[]).length;if(t!==l){we(`morphTo: command sequence differs (${t||"\u2205"} \u2192 ${l||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,r);return}s!==c&&we(`morphTo: coordinate count differs (${s} \u2192 ${c}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,r);}function it(e,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),l=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,s=>{let c=parseFloat(s),u=t[l++]??c;return String(+(c+(u-c)*r).toFixed(4))})}function at(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,l=r?{...xt[r],...t}:t,s=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:c="path, polyline, line, polygon, rect, circle",speed:u=1,fade:m=false,easing:p="linear",trigger:T={},stagger:V=0,direction:M="forward",once:ne=false,debug:Pe=false,axis:B="y",scrollContainer:J,autoReverse:X=false,delay:G=0,strokeColor:A,strokeWidth:P,fillOpacity:L,waypoints:w,velocityScale:k=false,threshold:O=0,rootMargin:C="0px",repeat:E=0,repeatDelay:oe=0,morphTo:D,clip:se,autoplay:ie=false,duration:ee=1e3,native:ae=true,onProgress:d,onStart:x,onComplete:g,onEnter:$,onLeave:S,onEnterBack:F,onLeaveBack:fe}=l,Q=se===true?"left":typeof se=="string"?se:false,Se=typeof p=="function"?p:re[p]??re.linear,Ce=de(T.start??"top bottom"),ze=de(T.end??"bottom top"),ve=typeof J=="string"?document.querySelector(J):J??null,Ee=Array.isArray(A)?A[0]:null,le=Array.isArray(A)?A[1]:typeof A=="string"?A:null,ce=Array.isArray(P)?P[0]:null,j=Array.isArray(P)?P[1]:typeof P=="number"?P:null,pe=Array.isArray(L)?L[0]:null,Z=Array.isArray(L)?L[1]:typeof L=="number"?L:null;function Ie(o){let a=o*100;switch(Q){case "right":return `inset(0 0 0 ${100-a}%)`;case "top":return `inset(0 0 ${100-a}% 0)`;case "bottom":return `inset(${100-a}% 0 0 0)`;case "center":return `circle(${o*150}% at 50% 50%)`;default:return `inset(0 ${100-a}% 0 0)`}}let z=Q?[]:Array.from(e.querySelectorAll(c)),I=[],i=[],f=0,ge=0,R=false,_=false,q=0,Me=false,ye=-1,te=-1,Y=false,he=0,He=0,Re,tt=null;function pt(){tt?.destroy(),tt=null;}let Ne=new Set,dt=NaN,Ve=true,Ye=-1,gt=performance.now(),_e=NaN;function rt(){return ve?B==="x"?ve.scrollLeft:ve.scrollTop:B==="x"?window.scrollX:window.scrollY}function yt(){return ve?B==="x"?ve.clientWidth:ve.clientHeight:B==="x"?window.innerWidth:window.innerHeight}function ht(){let o=Je(e,ve,B);return xe(o,o.scroll,yt(),Ce,ze)}function bt(){(({tStart:f,tEnd:ge}=ht())),Pe&&je&&(pt(),tt=Jt(f,ge,B));}function nt(o,a=ht){Le(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:a});let b=o.destroy;return o.destroy=()=>{b.call(o),$e(e);},o}function Vt(o,a){if(e.style.setProperty("--scroll-draw-progress",String(o)),Q){let b=a==="reverse"?1-o:o;e.style.clipPath=Ie(b);return}z.forEach((b,ue)=>{b.style.strokeDashoffset=a==="reverse"?`${I[ue]*o}`:`${I[ue]*(1-o)}`,m&&(b.style.opacity=a==="reverse"?`${1-o}`:`${o}`),Ee&&le?b.style.stroke=We(Ee,le,o):le&&(b.style.stroke=le),ce!==null&&j!==null?b.style.strokeWidth=`${ce+(j-ce)*o}`:j!==null&&(b.style.strokeWidth=`${j}`),pe!==null&&Z!==null?b.style.fillOpacity=`${pe+(Z-pe)*o}`:Z!==null&&(b.style.fillOpacity=`${Z}`),D&&b.tagName.toLowerCase()==="path"&&i[ue]&&b.setAttribute("d",it(i[ue],D,o));});}function Ue(){if(e.style.setProperty("--scroll-draw-progress","0"),Q){e.style.clipPath=Ie(0);return}z.forEach((o,a)=>{o.style.strokeDasharray=`${I[a]}`,o.style.strokeDashoffset=M==="reverse"?"0":`${I[a]}`,m?o.style.opacity=M==="reverse"?"1":"0":o.style.opacity="",Ee&&(o.style.stroke=Ee),ce!==null&&(o.style.strokeWidth=`${ce}`),pe!==null&&(o.style.fillOpacity=`${pe}`),D&&o.tagName.toLowerCase()==="path"&&i[a]&&o.setAttribute("d",i[a]);});}if(z.forEach(o=>{Kt(o);let a=qe(o);I.push(a);let b=o.tagName.toLowerCase()==="path";b?i.push(o.getAttribute("d")??""):i.push(""),D&&(b?er(i[i.length-1],D,o):we(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),s?(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=M==="reverse"?`${a}`:"0",m&&(o.style.opacity="1"),le&&(o.style.stroke=le),j!==null&&(o.style.strokeWidth=`${j}`),Z!==null&&(o.style.fillOpacity=`${Z}`),D&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",D)):(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=M==="reverse"?"0":`${a}`,m?o.style.opacity=M==="reverse"?"1":"0":o.style.opacity="",Ee&&(o.style.stroke=Ee),ce!==null&&(o.style.strokeWidth=`${ce}`),pe!==null&&(o.style.fillOpacity=`${pe}`));}),Q){if(s)return e.style.clipPath=Ie(1),g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=Ie(0);}else if(s)return g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let wt=typeof p=="string"?et(p):null;function zt(){return !(ae===false||!Zt()||!z.length||!wt||Q||B!=="y"||ve||u!==1||V!==0||ne||X||k!==false||D||w||E||G>0||d||x||g||$||S||F||fe||A!=null||P!=null||L!=null||(T.start??"top bottom").trim()!=="top bottom"||(T.end??"bottom top").trim()!=="bottom top")}function _t(){let o=++Qt,a=`svg-scroll-draw-${o}`,b=`svg-scroll-draw-host-${o}`,ue=`--svg-scroll-draw-${o}`,Fe=M==="reverse"?"0":"var(--ssd-len)",ke=M==="reverse"?"var(--ssd-len)":"0",Ae=`stroke-dashoffset:${Fe};`,v=`stroke-dashoffset:${ke};`;m&&(Ae+=`opacity:${M==="reverse"?1:0};`,v+=`opacity:${M==="reverse"?0:1};`);let H=document.createElement("style");H.setAttribute("data-svg-scroll-draw",""),H.textContent=`@keyframes ${a}{from{${Ae}}to{${v}}}.${b}{view-timeline-name:${ue};view-timeline-axis:block;}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${wt};animation-fill-mode:both;animation-timeline:${ue};animation-range:cover 0% cover 100%;}`,document.head.appendChild(H),e.classList.add(b);function me(y,U){y.style.setProperty("--ssd-len",String(I[U])),y.style.strokeDasharray=`${I[U]}`,y.style.strokeDashoffset="",y.style.opacity="",y.style.animationPlayState="",y.classList.add(a);}z.forEach(me);let h=false,N=-1;function W(){if(N>=0)return N;let y=e.getBoundingClientRect(),{tStart:U,tEnd:Te}=xe({top:y.top,height:y.height},rt(),yt(),Ce,ze);return Se(K(rt(),U,Te,u))}return {destroy(){e.classList.remove(b),z.forEach(y=>{y.classList.remove(a),y.style.removeProperty("--ssd-len"),y.style.animationPlayState="";}),H.remove();},replay(){h=false,N=-1,z.forEach(me);},pause(){h=true,z.forEach(y=>{y.style.animationPlayState="paused";});},resume(){h&&(h=false,z.forEach(y=>{y.style.animationPlayState="running";}));},seek(y){let U=Math.min(1,Math.max(0,y));N=U,h=true,z.forEach((Te,be)=>{Te.classList.remove(a),Te.style.strokeDashoffset=M==="reverse"?`${I[be]*U}`:`${I[be]*(1-U)}`,m&&(Te.style.opacity=M==="reverse"?`${1-U}`:`${U}`);});},getProgress(){return W()},refresh(){z.forEach((y,U)=>{I[U]=qe(y),y.style.setProperty("--ssd-len",String(I[U])),y.style.strokeDasharray=`${I[U]}`;});}}}if(zt())return nt(_t());function qt(){let o=Math.max(1,ee),a=0,b=0,ue=false;function Fe(h){let N=true;if(Q){let W=Math.min(1,Math.max(0,h/o)),y=Se(W);he=y,e.style.setProperty("--scroll-draw-progress",String(y)),e.style.clipPath=Ie(M==="reverse"?1-y:y),d?.(y),W<1&&(N=false);}else z.forEach((W,y)=>{let U=y*V*o,Te=Math.min(1,Math.max(0,(h-U)/o)),be=Se(Te);W.style.strokeDashoffset=M==="reverse"?`${I[y]*be}`:`${I[y]*(1-be)}`,m&&(W.style.opacity=M==="reverse"?`${1-be}`:`${be}`),Ee&&le?W.style.stroke=We(Ee,le,be):le&&(W.style.stroke=le),ce!==null&&j!==null?W.style.strokeWidth=`${ce+(j-ce)*be}`:j!==null&&(W.style.strokeWidth=`${j}`),pe!==null&&Z!==null?W.style.fillOpacity=`${pe+(Z-pe)*be}`:Z!==null&&(W.style.fillOpacity=`${Z}`),D&&W.tagName.toLowerCase()==="path"&&i[y]&&W.setAttribute("d",it(i[y],D,be)),y===0&&(he=be,d?.(be),e.style.setProperty("--scroll-draw-progress",String(be))),Te<1&&(N=false);});if(w){let W=Math.min(1,Math.max(0,h/o)),y=Se(W);for(let U in w){let Te=parseFloat(U);y>=Te&&!Ne.has(Te)&&(Ne.add(Te),w[U]?.());}}return N}function ke(h){if(Y)return;let N=h-a;_||(_=true,x?.());let W=Fe(N);if(W&&!R){R=true,Fe(o*(1+Math.max(0,z.length-1)*V)),g?.(),He<(E==="infinite"?1/0:E??0)&&(He++,Re=setTimeout(()=>{a=performance.now(),_=false,R=false,Ne.clear(),Ue(),q=requestAnimationFrame(ke);},oe));return}W||(q=requestAnimationFrame(ke));}function Ae(){cancelAnimationFrame(q),clearTimeout(Re),a=performance.now(),b=0,Y=false,_=false,R=false,He=0,ue=true,he=0,Ne.clear(),Ue(),q=requestAnimationFrame(ke);}let v=new IntersectionObserver(h=>{h.forEach(N=>{N.isIntersecting&&!(ne&&R)?Ae():!N.isIntersecting&&!ne&&!R&&(cancelAnimationFrame(q),clearTimeout(Re),ue=false);});},{root:ve??null,threshold:O,rootMargin:C}),H;function me(){clearTimeout(H),H=setTimeout(()=>{z.forEach((h,N)=>{I[N]=qe(h),h.style.strokeDasharray=`${I[N]}`;});},150);}return window.addEventListener("resize",me),window.addEventListener("orientationchange",me),G>0?setTimeout(()=>v.observe(e),G):v.observe(e),{destroy(){cancelAnimationFrame(q),clearTimeout(Re),v.disconnect(),window.removeEventListener("resize",me),window.removeEventListener("orientationchange",me),clearTimeout(H);},replay(){He=0,Ae();},pause(){Y||!ue||(Y=true,b=performance.now()-a,cancelAnimationFrame(q));},resume(){Y&&(Y=false,ue=true,a=performance.now()-b,q=requestAnimationFrame(ke));},seek(h){let N=Math.min(1,Math.max(0,h));he=N,Y=true,b=N*o,a=performance.now()-b,cancelAnimationFrame(q),Fe(b);},getProgress(){return he},refresh(){clearTimeout(H),z.forEach((h,N)=>{I[N]=qe(h),h.style.strokeDasharray=`${I[N]}`;});}}}if(ie)return nt(qt());bt();function Xe(){if(!Me||Y)return;let o=performance.now(),a=rt();if(!Ve&&k===false&&a===dt){q=requestAnimationFrame(Xe);return}Ve=false,dt=a;let b=u;if(k!==false){let v=o-gt,H=v>0?Math.abs(a-(Ye<0?a:Ye))/v:0;b=u*Math.max(.2,1+H*(typeof k=="number"?k:1)*.04);}Ye=a,gt=o;let ue=X?te===-1||a>=te?"forward":"reverse":M;te=a;let Fe=ge-f,ke=true,Ae=Fe===0?0:(a-f)/Fe;if(isNaN(_e)||(_e<=0&&Ae>0?$?.():_e>0&&Ae<=0&&fe?.(),_e<1&&Ae>=1?S?.():_e>=1&&Ae<1&&F?.()),_e=Ae,Q){let v=Se(K(a,f,ge,b));ne&&!X&&(ye=Math.max(ye,v),v=ye),he=v,e.style.setProperty("--scroll-draw-progress",String(v));let H=ue==="reverse"?1-v:v;e.style.clipPath=Ie(H),d?.(v),!_&&K(a,f,ge,b)>0&&(_=true,x?.()),v>=1&&!R?(R=true,g?.(),He<(E==="infinite"?1/0:E??0)&&(He++,Re=setTimeout(()=>{ye=-1,_=false,R=false,e.style.clipPath=Ie(0);},oe))):v<1&&!ne&&(R=false),q=requestAnimationFrame(Xe);return}if(z.forEach((v,H)=>{let me=H*V*Fe,h=Se(K(a,f+me,ge+me,b));ne&&!X&&(ye=Math.max(ye,h),h=ye),he=h,v.style.strokeDashoffset=ue==="reverse"?`${I[H]*h}`:`${I[H]*(1-h)}`,m&&(v.style.opacity=ue==="reverse"?`${1-h}`:`${h}`),Ee&&le?v.style.stroke=We(Ee,le,h):le&&(v.style.stroke=le),ce!==null&&j!==null?v.style.strokeWidth=`${ce+(j-ce)*h}`:j!==null&&(v.style.strokeWidth=`${j}`),pe!==null&&Z!==null?v.style.fillOpacity=`${pe+(Z-pe)*h}`:Z!==null&&(v.style.fillOpacity=`${Z}`),D&&v.tagName.toLowerCase()==="path"&&i[H]&&v.setAttribute("d",it(i[H],D,h)),H===0&&(d?.(h),e.style.setProperty("--scroll-draw-progress",String(h))),h<1&&(ke=false);}),w){let v=Se(K(a,f,ge,b));for(let H in w){let me=parseFloat(H);v>=me&&!Ne.has(me)&&(Ne.add(me),w[H]?.());}}!_&&K(a,f,ge,b)>0&&(_=true,x?.()),ke&&!R?(R=true,g?.(),He<(E==="infinite"?1/0:E??0)&&(He++,Re=setTimeout(()=>{ye=-1,_=false,R=false,Ne.clear(),Ue(),Ve=true;},oe))):!ke&&!ne&&(R=false),q=requestAnimationFrame(Xe);}let ot=false;function Qe(){ot||(ot=true,q=requestAnimationFrame(function(){Xe();}));}function Ze(){ot=false,cancelAnimationFrame(q);}let st=new IntersectionObserver(o=>{o.forEach(a=>{Me=a.isIntersecting,Me&&!Y?(Ve=true,Qe()):Ze();});},{root:ve??null,threshold:O,rootMargin:C});function vt(){z.forEach((o,a)=>{I[a]=qe(o),o.style.strokeDasharray=`${I[a]}`;}),bt(),Ve=true;}let Ke;function Be(){clearTimeout(Ke),Ke=setTimeout(vt,150);}window.addEventListener("resize",Be),window.addEventListener("orientationchange",Be);let Ge;return typeof ResizeObserver<"u"&&(Ge=new ResizeObserver(()=>Be()),Ge.observe(document.body),Ge.observe(document.documentElement),Ge.observe(e)),G>0?setTimeout(()=>st.observe(e),G):st.observe(e),nt({destroy(){cancelAnimationFrame(q),clearTimeout(Re),Ze(),st.disconnect(),Ge?.disconnect(),window.removeEventListener("resize",Be),window.removeEventListener("orientationchange",Be),clearTimeout(Ke),pt();},replay(){ye=-1,te=-1,Ye=-1,_=false,R=false,He=0,Y=false,he=0,Ne.clear(),clearTimeout(Re),Ue(),Ve=true,Me&&Qe();},pause(){Y=true,Ze();},resume(){Y&&(Y=false,Ve=true,Me&&Qe());},seek(o){let a=Math.min(1,Math.max(0,o));he=a,ye=a,Y=true,Ze(),Vt(a,M),Ve=true;},getProgress(){return he},refresh(){clearTimeout(Ke),vt(),Me&&!Y&&Qe();}},()=>({tStart:f,tEnd:ge}))}function tr(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function kt(e){let n=[],r=/([\w]+)\(([^)]*)\)/g,t;for(;(t=r.exec(e))!==null;){let l=[],s=[],c=t[2].trim();if(c)for(let u of c.split(/[\s,]+/)){let m=u.match(/^([-+]?[\d.eE]+)(.*)$/);l.push(m?parseFloat(m[1]):0),s.push(m?m[2]:"");}n.push({fn:t[1],nums:l,units:s});}return n}function rr(e,n,r){let t=kt(e),l=kt(n);return t.length===0||t.length!==l.length?r<1?e:n:t.map((s,c)=>{let u=l[c];return s.fn!==u.fn||s.nums.length!==u.nums.length?r<1?`${s.fn}(${s.nums.map((m,p)=>`${m}${s.units[p]}`).join(", ")})`:`${u.fn}(${u.nums.map((m,p)=>`${m}${u.units[p]}`).join(", ")})`:`${s.fn}(${s.nums.map((m,p)=>`${m+(u.nums[p]-m)*r}${s.units[p]}`).join(", ")})`}).join(" ")}function Ot(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),l=String(n);if(tr(t))return We(t,l,r);if(t.includes("("))return rr(t,l,r);let s=t.match(/^([-+]?[\d.]+)(.*)$/),c=l.match(/^([-+]?[\d.]+)(.*)$/);if(s&&c){let u=parseFloat(s[1]),m=parseFloat(c[1]);return `${u+(m-u)*r}${s[2]||c[2]}`}return r<1?t:l}function nr(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var or=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),sr=0,Dt="--scroll-draw-progress";function ir(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function lt(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:t,trigger:l={},easing:s="ease-out",speed:c=1,once:u=false,axis:m="y",scrollContainer:p,native:T=true,velocityScale:V=false,respectReducedMotion:M=true,triggerElement:ne,onProgress:Pe,onComplete:B,onEnter:J,onLeave:X,onEnterBack:G,onLeaveBack:A}=n,P=M&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,L=typeof s=="function"?s:re[s]??re["ease-out"],w=de(l.start??"top bottom"),k=de(l.end??"bottom top"),O=ne??e,C=typeof p=="string"?document.querySelector(p):p??null,E=Object.entries(t).map(([i,f])=>({prop:nr(i),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function oe(){let i=window.getComputedStyle(e);for(let f of E)f.from===""&&(f.from=i.getPropertyValue(f.prop).trim()||"0");}function D(){for(let i of E)e.style.setProperty(i.prop,String(i.to));}let se=new Map;for(let i of [...E.map(f=>f.prop),Dt])se.set(i,e.style.getPropertyValue(i));function ie(){for(let[i,f]of se)f?e.style.setProperty(i,f):e.style.removeProperty(i);}if(P)return D(),B?.(),{...r,destroy:ie,getProgress:()=>1};oe();let ee=typeof s=="string"?et(s):null;function ae(){if(!T||!ir()||!ee||m!=="y"||C||O!==e||u||c!==1||Pe||B||J||X||G||A||V!==false||(l.start??"top bottom").trim()!=="top bottom"||(l.end??"bottom top").trim()!=="bottom top")return false;for(let i of E)if(!or.has(i.prop))return false;return true}function d(){let i=`ssd-a-${++sr}`,f=E.map(te=>`${te.prop}:${te.from}`).join(";"),ge=E.map(te=>`${te.prop}:${te.to}`).join(";"),R=document.createElement("style");R.setAttribute("data-ssd-animate",""),R.textContent=`@keyframes ${i}{from{${f}}to{${ge}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${ee};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(R),e.classList.add(i);let _=()=>m==="x"?window.scrollX:window.scrollY,q=()=>m==="x"?window.innerWidth:window.innerHeight,Me=()=>{let te=e.getBoundingClientRect();return xe({top:te.top,height:te.height},_(),q(),w,k)};Le(e,{type:"animate",getProgress:()=>ye.getProgress(),getTrigger:Me});let ye={destroy(){e.classList.remove(i),R.remove(),e.style.animationPlayState="",ie(),$e(e);},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(te){let Y=Math.min(1,Math.max(0,te));e.classList.remove(i);for(let he of E)e.style.setProperty(he.prop,Ot(he.from,he.to,Y));},getProgress(){let{tStart:te,tEnd:Y}=Me();return L(K(_(),te,Y,c))}};return ye}if(ae())return d();let x=0,g=0,$=0,S=false,F=false,fe=-1,Q=0,Se=false,Ce=NaN,ze=-1,ve=0,Ee=()=>C?m==="x"?C.scrollLeft:C.scrollTop:m==="x"?window.scrollX:window.scrollY,le=()=>C?m==="x"?C.clientWidth:C.clientHeight:m==="x"?window.innerWidth:window.innerHeight;function ce(){let i=Je(O,C,m),f=xe(i,i.scroll,le(),w,k);x=f.tStart,g=f.tEnd;}function j(i){e.style.setProperty(Dt,String(i));for(let f of E)e.style.setProperty(f.prop,Ot(f.from,f.to,i));Pe?.(i);}function pe(i){if(isNaN(Ce)){Ce=i;return}Ce<=0&&i>0?J?.():Ce>0&&i<=0&&A?.(),Ce<1&&i>=1?X?.():Ce>=1&&i<1&&G?.(),Ce=i;}function Z(){if(!S||F)return;let i=performance.now(),f=Ee(),ge=c;if(V!==false){let q=i-ve,Me=q>0?Math.abs(f-(ze<0?f:ze))/q:0;ge=c*Math.max(.2,1+Me*(typeof V=="number"?V:1)*.04);}ze=f,ve=i;let R=g===x?0:(f-x)/(g-x);pe(R);let _=L(K(f,x,g,ge));u&&(fe=Math.max(fe,_),_=fe),Q=_,j(_),_>=1&&!Se?(Se=true,B?.()):_<1&&!u&&(Se=false),$=requestAnimationFrame(Z);}ce(),g===x&&we("scrollAnimate: the trigger window has zero length (start and end resolve to the same scroll position), so this element will never animate. If the target is inside a position:sticky stage, measure the trigger from the container that holds the scroll room via `triggerElement`.",e);{let i=L(K(Ee(),x,g,c));u&&i>0&&(fe=i),Q=i,j(i);}let Ie=new IntersectionObserver(i=>{i.forEach(f=>{S=f.isIntersecting,S&&!F?$=requestAnimationFrame(Z):cancelAnimationFrame($);});},{root:C??null}),z;function I(){clearTimeout(z),z=setTimeout(ce,150);}return window.addEventListener("resize",I),window.addEventListener("orientationchange",I),Ie.observe(e),Le(e,{type:"animate",getProgress:()=>Q,getTrigger:()=>({tStart:x,tEnd:g})}),{destroy(){cancelAnimationFrame($),Ie.disconnect(),window.removeEventListener("resize",I),window.removeEventListener("orientationchange",I),clearTimeout(z),ie(),$e(e);},replay(){fe=-1,Se=false,Q=0,F=false,j(0);},pause(){F=true,cancelAnimationFrame($);},resume(){F&&(F=false,S&&($=requestAnimationFrame(Z)));},seek(i){let f=Math.min(1,Math.max(0,i));Q=f,fe=f,F=true,cancelAnimationFrame($),j(f);},getProgress(){return Q}}}var ct={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function ut(e,n){if(typeof window>"u")return ct;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return we("scrollCounter: element not found:",e),ct;let t=r,{from:l=0,to:s,format:c,easing:u="ease-out",trigger:m={},once:p=true,decimals:T,onComplete:V}=n,M=T!==void 0?d=>d.toFixed(T):c??(d=>String(Math.round(d))),ne=typeof u=="function"?u:re[u]??re["ease-out"],Pe=de(m.start??"top 80%"),B=de(m.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=M(s),V?.(),ct;let X=0,G=0,A=0,P=false,L=false,w=-1,k=0,O=false,C=()=>window.scrollY,E=()=>window.innerHeight;function oe(){let d=t.getBoundingClientRect(),x=xe({top:d.top,height:d.height},C(),E(),Pe,B);X=x.tStart,G=x.tEnd;}function D(d){t.textContent=M(l+(s-l)*d),t.style.setProperty("--scroll-draw-progress",String(d));}function se(){if(!P||L)return;let d=ne(K(C(),X,G,1));p&&(w=Math.max(w,d),d=w),k=d,D(d),d>=1&&!O?(O=true,V?.()):d<1&&!p&&(O=false),A=requestAnimationFrame(se);}oe();{let d=ne(K(C(),X,G,1));p&&d>0&&(w=d),k=d,D(d);}let ie=new IntersectionObserver(d=>{d.forEach(x=>{P=x.isIntersecting,P&&!L?A=requestAnimationFrame(se):cancelAnimationFrame(A);});}),ee;function ae(){clearTimeout(ee),ee=setTimeout(oe,150);}return window.addEventListener("resize",ae),window.addEventListener("orientationchange",ae),ie.observe(t),Le(t,{type:"counter",getProgress:()=>k,getTrigger:()=>({tStart:X,tEnd:G})}),{destroy(){cancelAnimationFrame(A),ie.disconnect(),window.removeEventListener("resize",ae),window.removeEventListener("orientationchange",ae),clearTimeout(ee),$e(t);},replay(){w=-1,O=false,k=0,L=false,D(0);},pause(){L=true,cancelAnimationFrame(A);},resume(){L&&(L=false,P&&(A=requestAnimationFrame(se)));},seek(d){let x=Math.min(1,Math.max(0,d));k=x,w=x,L=true,cancelAnimationFrame(A),D(x);},getProgress(){return k}}}var Ht={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function mt(e,n={}){if(typeof window>"u")return Ht;let r=typeof e=="string"?document.querySelector(e):e;if(!r||r.tagName.toLowerCase()!=="video")return we("scrollVideo: <video> element not found:",e),Ht;let t=r,{trigger:l={},easing:s="linear",once:c=false,axis:u="y",preload:m="auto",onReady:p,onComplete:T,onProgress:V}=n,M=window.matchMedia("(prefers-reduced-motion: reduce)").matches,ne=typeof s=="function"?s:re[s]??re.linear,Pe=de(l.start??"top top"),B=de(l.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=m);let J=n.from??0,X=n.to,G=0,A=0,P=0,L=false,w=false,k=-1,O=0,C=false,E=false,oe=()=>u==="x"?window.scrollX:window.scrollY,D=()=>u==="x"?window.innerWidth:window.innerHeight;function se(){let S=t.getBoundingClientRect(),F=u==="x"?S.left:S.top,fe=u==="x"?S.width:S.height,Q=xe({top:F,height:fe},oe(),D(),Pe,B);G=Q.tStart,A=Q.tEnd;}let ie=NaN;function ee(S){if(!E)return;let F=X??t.duration??0,fe=J+(F-J)*S;fe!==ie&&(ie=fe,t.currentTime=fe),t.style.setProperty("--scroll-draw-progress",String(S)),V?.(S);}function ae(){if(!L||w||!E||M)return;let S=ne(K(oe(),G,A,1));c&&(k=Math.max(k,S),S=k),O=S,ee(S),S>=1&&!C?(C=true,T?.()):S<1&&!c&&(C=false),P=requestAnimationFrame(ae);}function d(){if(E=true,X===void 0&&(X=t.duration),M){ee(1),p?.();return}se(),p?.(),L&&!w&&(P=requestAnimationFrame(ae));}t.readyState>=1?d():t.addEventListener("loadedmetadata",d,{once:true}),E||se();let x=new IntersectionObserver(S=>{S.forEach(F=>{L=F.isIntersecting,L&&!w&&E?P=requestAnimationFrame(ae):cancelAnimationFrame(P);});}),g;function $(){clearTimeout(g),g=setTimeout(se,150);}return window.addEventListener("resize",$),window.addEventListener("orientationchange",$),x.observe(t),Le(t,{type:"video",getProgress:()=>O,getTrigger:()=>({tStart:G,tEnd:A})}),{destroy(){cancelAnimationFrame(P),x.disconnect(),t.removeEventListener("loadedmetadata",d),window.removeEventListener("resize",$),window.removeEventListener("orientationchange",$),clearTimeout(g),$e(t);},replay(){k=-1,C=false,O=0,w=false,ie=NaN,ee(0);},pause(){w=true,cancelAnimationFrame(P);},resume(){w&&(w=false,L&&E&&(P=requestAnimationFrame(ae)));},seek(S){let F=Math.min(1,Math.max(0,S));O=F,k=F,w=true,cancelAnimationFrame(P),ie=NaN,ee(F);},getProgress(){return O}}}function Nt(e){let n=e.textContent??"";return e.textContent="",n.split(/(\s+)/).filter(Boolean).map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),/^\s+$/.test(r)?(t.textContent=r,t.style.whiteSpace="pre"):(t.textContent=r,t.style.display="inline-block"),e.appendChild(t),/^\s+$/.test(r)?null:t}).filter(r=>r!==null)}function ar(e){let n=e.textContent??"";return e.textContent="",n.split("").map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=r,r===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),r===" "?null:t}).filter(r=>r!==null)}function Ft(e){let n=Nt(e),r=new Map;for(let s of n){let c=s.offsetTop;r.has(c)||r.set(c,[]),r.get(c).push(s);}let t=[],l=Array.from(r.keys()).sort((s,c)=>s-c);for(let s of l){let c=r.get(s),u=document.createElement("span");u.setAttribute("aria-hidden","true"),u.style.display="inline-block",c.forEach((m,p)=>{let T=m.nextElementSibling;u.appendChild(m),p<c.length-1&&T&&T.style.whiteSpace==="pre"&&u.appendChild(T);}),t.push(u);}return e.textContent="",t.forEach((s,c)=>{e.appendChild(s),c<t.length-1&&e.appendChild(document.createTextNode(" "));}),t}function lr(e,n,r,t){if(r<=1||t===0)return e;let l=(r-1)*t,s=n*t,c=s+(1-l);return c<=s?e>=s?1:0:Math.min(1,Math.max(0,(e-s)/(c-s)))}function cr(e,n){let r=[];if(n?.y!==void 0&&r.push(`translateY(${n.y*(1-e)}px)`),n?.x!==void 0&&r.push(`translateX(${n.x*(1-e)}px)`),n?.rotate!==void 0&&r.push(`rotate(${n.rotate*(1-e)}deg)`),n?.scale!==void 0){let t=n.scale+(1-n.scale)*e;r.push(`scale(${t})`);}return r.join(" ")||""}var Rt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function ft(e,n={}){if(typeof window>"u")return Rt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return we("scrollText: element not found:",e),Rt;let t=r,{split:l="words",stagger:s=.04,easing:c="ease-out",from:u={opacity:0,y:24},trigger:m={},once:p=true,onComplete:T}=n,V=window.matchMedia("(prefers-reduced-motion: reduce)").matches,M=typeof c=="function"?c:re[c]??re["ease-out"],ne=de(m.start??"top 85%"),Pe=de(m.end??"top 40%"),B=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let J;l==="chars"?J=ar(t):l==="lines"?J=Ft(t):J=Nt(t);let X=J.length;function G(g,$){u?.opacity!==void 0&&(g.style.opacity=String(u.opacity+(1-u.opacity)*$));let S=cr($,u);S&&(g.style.transform=S);}function A(g){t.style.setProperty("--scroll-draw-progress",String(g)),J.forEach(($,S)=>{let F=M(lr(g,S,X,s));G($,F);});}if(V)return A(1),T?.(),{destroy(){t.innerHTML=B,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};A(0);let P=0,L=0,w=0,k=false,O=false,C=-1,E=0,oe=false,D=()=>window.scrollY,se=()=>window.innerHeight;function ie(){let g=t.getBoundingClientRect(),$=xe({top:g.top,height:g.height},D(),se(),ne,Pe);P=$.tStart,L=$.tEnd;}function ee(){if(!k||O)return;let g=K(D(),P,L,1);p&&(C=Math.max(C,g),g=C),E=g,A(g),g>=1&&!oe?(oe=true,T?.()):g<1&&!p&&(oe=false),w=requestAnimationFrame(ee);}ie();let ae=new IntersectionObserver(g=>{g.forEach($=>{k=$.isIntersecting,k&&!O?w=requestAnimationFrame(ee):cancelAnimationFrame(w);});}),d;function x(){clearTimeout(d),d=setTimeout(()=>{if(l==="lines"){let g=E;t.innerHTML=B,t.setAttribute("aria-label",t.textContent??""),J=Ft(t),A(g);}ie();},150);}return window.addEventListener("resize",x),window.addEventListener("orientationchange",x),ae.observe(t),Le(t,{type:"text",getProgress:()=>E,getTrigger:()=>({tStart:P,tEnd:L})}),{destroy(){cancelAnimationFrame(w),ae.disconnect(),window.removeEventListener("resize",x),window.removeEventListener("orientationchange",x),clearTimeout(d),t.innerHTML=B,t.removeAttribute("aria-label"),$e(t);},replay(){C=-1,oe=false,E=0,O=false,A(0);},pause(){O=true,cancelAnimationFrame(w);},resume(){O&&(O=false,k&&(w=requestAnimationFrame(ee)));},seek(g){let $=Math.min(1,Math.max(0,g));E=$,C=$,O=true,cancelAnimationFrame(w),A($);},getProgress(){return E}}}function Gr(e={}){let n,r;return onMount(()=>{n&&(r=at(n,e));}),onCleanup(()=>{r?.destroy();}),t=>{n=t;}}function jr(e={}){let n,r;return onMount(()=>{n&&(r=at(n,e));}),onCleanup(()=>{r?.destroy(),r=void 0;}),{ref:t=>{n=t;},getInstance:()=>r}}function Yr(e){let n,r;return onMount(()=>{n&&(r=lt(n,e));}),onCleanup(()=>{r?.destroy();}),t=>{n=t;}}function Ur(e){let n,r;return onMount(()=>{n&&(r=lt(n,e));}),onCleanup(()=>{r?.destroy(),r=void 0;}),{ref:t=>{n=t;},getInstance:()=>r}}function Xr(e){let n,r;return onMount(()=>{n&&(r=ut(n,e));}),onCleanup(()=>{r?.destroy();}),t=>{n=t;}}function Qr(e){let n,r;return onMount(()=>{n&&(r=ut(n,e));}),onCleanup(()=>{r?.destroy(),r=void 0;}),{ref:t=>{n=t;},getInstance:()=>r}}function Zr(e={}){let n,r;return onMount(()=>{n&&(r=mt(n,e));}),onCleanup(()=>{r?.destroy();}),t=>{n=t;}}function Kr(e={}){let n,r;return onMount(()=>{n&&(r=mt(n,e));}),onCleanup(()=>{r?.destroy(),r=void 0;}),{ref:t=>{n=t;},getInstance:()=>r}}function Jr(e={}){let n,r;return onMount(()=>{n&&(r=ft(n,e));}),onCleanup(()=>{r?.destroy();}),t=>{n=t;}}function en(e={}){let n,r;return onMount(()=>{n&&(r=ft(n,e));}),onCleanup(()=>{r?.destroy(),r=void 0;}),{ref:t=>{n=t;},getInstance:()=>r}}export{Ur as createScrollAnimate,Qr as createScrollCounter,jr as createScrollDraw,en as createScrollText,Kr as createScrollVideo,Yr as useScrollAnimate,Xr as useScrollCounter,Gr as useScrollDraw,Jr as useScrollText,Zr as useScrollVideo};
|
|
1
|
+
import {a as a$3}from'../chunk-JC5BD4RB.mjs';import {a as a$2}from'../chunk-SNCRC6BA.mjs';import {a as a$1}from'../chunk-4MH5SQTH.mjs';import {a}from'../chunk-QJ4H2HW3.mjs';import {b}from'../chunk-WDIHLRZZ.mjs';import'../chunk-OJFWQ6CU.mjs';import'../chunk-YWKPTYSG.mjs';import'../chunk-YZV4Z3EQ.mjs';import'../chunk-PEFR3ZB7.mjs';import'../chunk-DM6EDKWH.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-BCV4RAIX.mjs';import'../chunk-LFSU6LR3.mjs';import {onMount,onCleanup}from'solid-js';function E(t={}){let e,n;return onMount(()=>{e&&(n=b(e,t));}),onCleanup(()=>{n?.destroy();}),r=>{e=r;}}function M(t={}){let e,n;return onMount(()=>{e&&(n=b(e,t));}),onCleanup(()=>{n?.destroy(),n=void 0;}),{ref:r=>{e=r;},getInstance:()=>n}}function H(t){let e,n;return onMount(()=>{e&&(n=a(e,t));}),onCleanup(()=>{n?.destroy();}),r=>{e=r;}}function L(t){let e,n;return onMount(()=>{e&&(n=a(e,t));}),onCleanup(()=>{n?.destroy(),n=void 0;}),{ref:r=>{e=r;},getInstance:()=>n}}function O(t){let e,n;return onMount(()=>{e&&(n=a$1(e,t));}),onCleanup(()=>{n?.destroy();}),r=>{e=r;}}function x(t){let e,n;return onMount(()=>{e&&(n=a$1(e,t));}),onCleanup(()=>{n?.destroy(),n=void 0;}),{ref:r=>{e=r;},getInstance:()=>n}}function w(t={}){let e,n;return onMount(()=>{e&&(n=a$3(e,t));}),onCleanup(()=>{n?.destroy();}),r=>{e=r;}}function y(t={}){let e,n;return onMount(()=>{e&&(n=a$3(e,t));}),onCleanup(()=>{n?.destroy(),n=void 0;}),{ref:r=>{e=r;},getInstance:()=>n}}function D(t={}){let e,n;return onMount(()=>{e&&(n=a$2(e,t));}),onCleanup(()=>{n?.destroy();}),r=>{e=r;}}function I(t={}){let e,n;return onMount(()=>{e&&(n=a$2(e,t));}),onCleanup(()=>{n?.destroy(),n=void 0;}),{ref:r=>{e=r;},getInstance:()=>n}}export{L as createScrollAnimate,x as createScrollCounter,M as createScrollDraw,I as createScrollText,y as createScrollVideo,H as useScrollAnimate,O as useScrollCounter,E as useScrollDraw,D as useScrollText,w as useScrollVideo};
|