@ssgoi/core 2.5.6 → 3.0.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/dist/animator/animation.d.ts +57 -0
- package/dist/animator/animation.d.ts.map +1 -0
- package/dist/animator/index.d.ts +4 -3
- package/dist/animator/index.d.ts.map +1 -1
- package/dist/animator/multi-animator.d.ts +98 -0
- package/dist/animator/multi-animator.d.ts.map +1 -0
- package/dist/index.cjs +2 -2
- package/dist/index.js +565 -640
- package/dist/transition/create-transition-callback.d.ts.map +1 -1
- package/dist/transition/transition-strategy.d.ts +20 -9
- package/dist/transition/transition-strategy.d.ts.map +1 -1
- package/dist/transitions/blur.d.ts +5 -5
- package/dist/transitions/blur.d.ts.map +1 -1
- package/dist/transitions/bounce.d.ts +5 -5
- package/dist/transitions/bounce.d.ts.map +1 -1
- package/dist/transitions/fade.d.ts +5 -5
- package/dist/transitions/fade.d.ts.map +1 -1
- package/dist/transitions/fly.d.ts +5 -5
- package/dist/transitions/fly.d.ts.map +1 -1
- package/dist/transitions/index.cjs +1 -1
- package/dist/transitions/index.js +206 -207
- package/dist/transitions/mask.d.ts +5 -5
- package/dist/transitions/mask.d.ts.map +1 -1
- package/dist/transitions/none.d.ts +3 -3
- package/dist/transitions/none.d.ts.map +1 -1
- package/dist/transitions/rotate.d.ts +5 -5
- package/dist/transitions/rotate.d.ts.map +1 -1
- package/dist/transitions/scale.d.ts +5 -5
- package/dist/transitions/scale.d.ts.map +1 -1
- package/dist/transitions/slide.d.ts +5 -5
- package/dist/transitions/slide.d.ts.map +1 -1
- package/dist/types.cjs +1 -1
- package/dist/types.d.ts +78 -78
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +63 -15
- package/dist/view-transitions/blind.d.ts +0 -1
- package/dist/view-transitions/blind.d.ts.map +1 -1
- package/dist/view-transitions/fade.d.ts.map +1 -1
- package/dist/view-transitions/index.cjs +13 -13
- package/dist/view-transitions/index.js +472 -479
- package/dist/view-transitions/scroll.d.ts.map +1 -1
- package/dist/view-transitions/slide.d.ts.map +1 -1
- package/dist/view-transitions/strip.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/animator/animation-scheduler.d.ts +0 -34
- package/dist/animator/animation-scheduler.d.ts.map +0 -1
- package/dist/test-utils.d.ts +0 -46
- package/dist/test-utils.d.ts.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TransitionKey } from '../types';
|
|
1
|
+
import { StyleObject, TransitionKey } from '../types';
|
|
2
2
|
interface SlideOptions {
|
|
3
3
|
direction?: "left" | "right" | "up" | "down";
|
|
4
4
|
distance?: number | string;
|
|
@@ -13,19 +13,19 @@ interface SlideOptions {
|
|
|
13
13
|
}
|
|
14
14
|
export declare const slide: (options?: SlideOptions) => {
|
|
15
15
|
key?: TransitionKey | undefined;
|
|
16
|
-
in: (
|
|
16
|
+
in: () => {
|
|
17
17
|
spring: {
|
|
18
18
|
stiffness?: number;
|
|
19
19
|
damping?: number;
|
|
20
20
|
};
|
|
21
|
-
|
|
21
|
+
css: (progress: number) => StyleObject;
|
|
22
22
|
};
|
|
23
|
-
out: (
|
|
23
|
+
out: () => {
|
|
24
24
|
spring: {
|
|
25
25
|
stiffness?: number;
|
|
26
26
|
damping?: number;
|
|
27
27
|
};
|
|
28
|
-
|
|
28
|
+
css: (progress: number) => StyleObject;
|
|
29
29
|
};
|
|
30
30
|
};
|
|
31
31
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slide.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/slide.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"slide.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/slide.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE3D,UAAU,YAAY;IACpB,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,MAAM,CAAC;IAC7C,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,GAAG,GAAG,GAAG,CAAC;IACjB,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB;AAED,eAAO,MAAM,KAAK,GAAI,UAAS,YAAiB;;;;wBANhC,MAAM;sBACR,MAAM;;wBAuDQ,MAAM,KAAG,WAAW;;;;wBAxDhC,MAAM;sBACR,MAAM;;wBAuDQ,MAAM,KAAG,WAAW;;CAqB/C,CAAC"}
|
package/dist/types.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function c(n){return("tick"in n||"css"in n)&&!("springs"in n)}function t(n){return"springs"in n}function r(n){return"css"in n&&typeof n.css=="function"}function s(n){return"tick"in n&&typeof n.tick=="function"}function a(n){if(r(n)&&s(n))throw new Error("SingleSpringConfig cannot have both 'tick' and 'css' defined. Use one or the other.")}function l(n){if(n.tick&&n.css)throw new Error("SpringItem cannot have both 'tick' and 'css' defined. Use one or the other.")}function d(n){return t(n)?(n.springs.forEach(l),n):(a(n),{prepare:n.prepare,wait:n.wait,onStart:n.onStart,onEnd:n.onEnd,springs:[{spring:n.spring,tick:n.tick,css:n.css}],schedule:"parallel"})}function S(n){const o=n.schedule??"parallel",u=n.springs.map(i=>{let e;switch(o){case"parallel":e=0;break;case"sequential":e=1;break;case"stagger":e=Math.max(0,Math.min(1,i.offset??0));break;default:e=0}return{...i,normalizedOffset:e}}),{schedule:h,...p}=n;return{...p,springs:u}}exports.isCssAnimation=r;exports.isMultiSpring=t;exports.isSingleSpring=c;exports.isTickAnimation=s;exports.normalizeMultiSpringSchedule=S;exports.normalizeToMultiSpring=d;exports.validateAnimationMode=a;exports.validateSpringItem=l;
|
package/dist/types.d.ts
CHANGED
|
@@ -8,12 +8,12 @@ export type SpringConfig = {
|
|
|
8
8
|
*/
|
|
9
9
|
export type StyleObject = Record<string, number | string>;
|
|
10
10
|
/**
|
|
11
|
-
* Schedule strategy for multi-spring animations
|
|
12
|
-
* -
|
|
13
|
-
* -
|
|
14
|
-
* -
|
|
11
|
+
* Schedule strategy for multi-spring animations (user-facing)
|
|
12
|
+
* - parallel: All springs start immediately (offset = 0)
|
|
13
|
+
* - sequential: Each spring waits for previous to complete (offset = 1)
|
|
14
|
+
* - stagger: Springs start at custom progress offsets (0-1)
|
|
15
15
|
*/
|
|
16
|
-
export type ScheduleType = "
|
|
16
|
+
export type ScheduleType = "parallel" | "sequential" | "stagger";
|
|
17
17
|
/**
|
|
18
18
|
* Base configuration shared by both single and multi-spring transitions
|
|
19
19
|
*/
|
|
@@ -33,8 +33,6 @@ export type BaseTransitionConfig = {
|
|
|
33
33
|
*/
|
|
34
34
|
export type SingleSpringConfig = BaseTransitionConfig & {
|
|
35
35
|
spring?: SpringConfig;
|
|
36
|
-
from?: number;
|
|
37
|
-
to?: number;
|
|
38
36
|
tick?: (progress: number) => void;
|
|
39
37
|
/**
|
|
40
38
|
* Style generator for Web Animation API mode
|
|
@@ -57,48 +55,52 @@ export type SingleSpringConfig = BaseTransitionConfig & {
|
|
|
57
55
|
};
|
|
58
56
|
/**
|
|
59
57
|
* Individual spring item in a multi-spring animation
|
|
58
|
+
*
|
|
59
|
+
* Supports two animation modes (mutually exclusive):
|
|
60
|
+
* - tick: RAF-based animation with callback on each frame
|
|
61
|
+
* - css: Web Animation API with CSS string generation
|
|
60
62
|
*/
|
|
61
63
|
export type SpringItem = {
|
|
62
|
-
from?: number;
|
|
63
|
-
to?: number;
|
|
64
64
|
spring?: SpringConfig;
|
|
65
65
|
/**
|
|
66
|
-
* Frame callback - called on each animation frame with progress value
|
|
66
|
+
* Frame callback - called on each animation frame with progress value (RAF-based)
|
|
67
67
|
*
|
|
68
68
|
* **Performance Warning:** Use WRITE-ONLY operations for best performance.
|
|
69
69
|
* Avoid reading layout properties inside tick to prevent layout thrashing.
|
|
70
70
|
*
|
|
71
|
-
* Layout-triggering properties (causes forced synchronous layout):
|
|
72
|
-
* - element.offsetWidth, offsetHeight, offsetTop, offsetLeft
|
|
73
|
-
* - element.clientWidth, clientHeight
|
|
74
|
-
* - element.getBoundingClientRect()
|
|
75
|
-
* - element.scrollWidth, scrollHeight, scrollTop, scrollLeft
|
|
76
|
-
* - window.getComputedStyle(element)
|
|
77
|
-
*
|
|
78
71
|
* @example
|
|
79
|
-
* // ❌ Bad: Layout read in tick (causes thrashing)
|
|
80
72
|
* tick: (progress) => {
|
|
81
|
-
*
|
|
82
|
-
* element.style.height = height * progress
|
|
73
|
+
* element.style.opacity = String(progress)
|
|
83
74
|
* }
|
|
75
|
+
*/
|
|
76
|
+
tick?: (progress: number) => void;
|
|
77
|
+
/**
|
|
78
|
+
* Style generator for Web Animation API mode
|
|
79
|
+
*
|
|
80
|
+
* When provided, the animation uses Web Animation API instead of RAF.
|
|
81
|
+
* Spring physics are pre-computed and converted to keyframes.
|
|
82
|
+
*
|
|
83
|
+
* @param progress - Current progress value (0 to 1)
|
|
84
|
+
* @returns Style object for Web Animation API
|
|
84
85
|
*
|
|
85
86
|
* @example
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
* },
|
|
91
|
-
* tick: (progress) => {
|
|
92
|
-
* const height = parseFloat(element.dataset.height)
|
|
93
|
-
* element.style.height = height * progress // WRITE only
|
|
94
|
-
* }
|
|
87
|
+
* css: (progress) => ({
|
|
88
|
+
* opacity: progress,
|
|
89
|
+
* transform: `translateY(${(1 - progress) * 20}px)`,
|
|
90
|
+
* })
|
|
95
91
|
*/
|
|
96
|
-
|
|
92
|
+
css?: (progress: number) => StyleObject;
|
|
97
93
|
onStart?: () => void;
|
|
98
94
|
onComplete?: () => void;
|
|
99
95
|
/**
|
|
100
|
-
*
|
|
101
|
-
*
|
|
96
|
+
* Progress offset (0-1) before this spring starts
|
|
97
|
+
* - 0: Start immediately (parallel behavior)
|
|
98
|
+
* - 1: Start after previous spring completes (sequential behavior)
|
|
99
|
+
* - 0.5: Start when previous spring is 50% complete
|
|
100
|
+
*
|
|
101
|
+
* Only applies to 'stagger' schedule mode.
|
|
102
|
+
* For 'parallel' mode, all springs start at 0.
|
|
103
|
+
* For 'sequential' mode, all springs use offset 1.
|
|
102
104
|
*/
|
|
103
105
|
offset?: number;
|
|
104
106
|
};
|
|
@@ -141,6 +143,17 @@ export declare function isTickAnimation(config: SingleSpringConfig): config is S
|
|
|
141
143
|
* @throws Error if both tick and css are defined
|
|
142
144
|
*/
|
|
143
145
|
export declare function validateAnimationMode(config: SingleSpringConfig): void;
|
|
146
|
+
/**
|
|
147
|
+
* Validate SpringItem doesn't have both tick and css defined
|
|
148
|
+
* @throws Error if both tick and css are defined
|
|
149
|
+
*/
|
|
150
|
+
export declare function validateSpringItem(item: SpringItem): void;
|
|
151
|
+
/**
|
|
152
|
+
* Normalize TransitionConfig to MultiSpringConfig
|
|
153
|
+
* Converts SingleSpringConfig to MultiSpringConfig with single spring item
|
|
154
|
+
* @internal
|
|
155
|
+
*/
|
|
156
|
+
export declare function normalizeToMultiSpring(config: TransitionConfig): MultiSpringConfig;
|
|
144
157
|
export type GetTransitionConfig<TContext = undefined> = TContext extends undefined ? (node: HTMLElement) => TransitionConfig | Promise<TransitionConfig> : (node: HTMLElement, context: TContext) => TransitionConfig | Promise<TransitionConfig>;
|
|
145
158
|
export type Transition<TContext = undefined> = {
|
|
146
159
|
in?: GetTransitionConfig<TContext>;
|
|
@@ -213,69 +226,56 @@ export type SsgoiContext = (path: string) => Transition & {
|
|
|
213
226
|
key: TransitionKey;
|
|
214
227
|
};
|
|
215
228
|
/**
|
|
216
|
-
* Normalized schedule entry for internal processing
|
|
217
|
-
*
|
|
218
|
-
*
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
*
|
|
223
|
-
*
|
|
224
|
-
* - delay>0: delayed start with fixed timing (chain)
|
|
229
|
+
* Normalized schedule entry for internal processing
|
|
230
|
+
* All schedule types are normalized to progress-based offsets (0-1)
|
|
231
|
+
*
|
|
232
|
+
* Progress offset determines when each spring starts relative to previous spring:
|
|
233
|
+
* - 0: Start immediately (parallel)
|
|
234
|
+
* - 1: Start after previous completes (sequential)
|
|
235
|
+
* - 0.5: Start when previous is 50% complete
|
|
236
|
+
*
|
|
225
237
|
* @internal
|
|
226
238
|
*/
|
|
227
|
-
export type
|
|
228
|
-
type: "offset";
|
|
239
|
+
export type NormalizedScheduleEntry = {
|
|
229
240
|
id: string;
|
|
230
|
-
|
|
241
|
+
/**
|
|
242
|
+
* Progress offset (0-1) relative to previous spring
|
|
243
|
+
* - 0: Start immediately with previous spring
|
|
244
|
+
* - 1: Start after previous spring completes
|
|
245
|
+
* - 0-1: Start when previous spring reaches this progress
|
|
246
|
+
*/
|
|
247
|
+
offset: number;
|
|
231
248
|
};
|
|
232
249
|
/**
|
|
233
|
-
*
|
|
234
|
-
*
|
|
250
|
+
* Normalized multi-spring config for internal use
|
|
251
|
+
* Schedule is always normalized to progress-based offsets
|
|
235
252
|
* @internal
|
|
236
253
|
*/
|
|
237
|
-
export type
|
|
238
|
-
|
|
239
|
-
|
|
254
|
+
export type NormalizedMultiSpringConfig = Omit<MultiSpringConfig, "springs" | "schedule"> & {
|
|
255
|
+
springs: Array<SpringItem & {
|
|
256
|
+
normalizedOffset: number;
|
|
257
|
+
}>;
|
|
240
258
|
};
|
|
241
259
|
/**
|
|
242
|
-
*
|
|
243
|
-
*
|
|
260
|
+
* Normalize MultiSpringConfig schedule to progress-based offsets
|
|
261
|
+
*
|
|
262
|
+
* Converts user-facing schedule types to unified offset values:
|
|
263
|
+
* - parallel: All springs get offset 0 (start together)
|
|
264
|
+
* - sequential: All springs get offset 1 (wait for previous)
|
|
265
|
+
* - stagger: Use each spring's custom offset (0-1)
|
|
266
|
+
*
|
|
244
267
|
* @internal
|
|
245
268
|
*/
|
|
246
|
-
export
|
|
269
|
+
export declare function normalizeMultiSpringSchedule(config: MultiSpringConfig): NormalizedMultiSpringConfig;
|
|
247
270
|
/**
|
|
248
|
-
*
|
|
271
|
+
* Animation state
|
|
272
|
+
* For MultiAnimator: returns first animator's state
|
|
249
273
|
* @internal
|
|
250
274
|
*/
|
|
251
|
-
export type
|
|
252
|
-
type: "single";
|
|
275
|
+
export type AnimationState = {
|
|
253
276
|
position: number;
|
|
254
277
|
velocity: number;
|
|
255
278
|
from: number;
|
|
256
279
|
to: number;
|
|
257
280
|
};
|
|
258
|
-
/**
|
|
259
|
-
* Multi-spring animation state
|
|
260
|
-
* Always uses number for progress tracking
|
|
261
|
-
* @internal
|
|
262
|
-
*/
|
|
263
|
-
export type MultiAnimationState = {
|
|
264
|
-
type: "multi";
|
|
265
|
-
completed: number;
|
|
266
|
-
total: number;
|
|
267
|
-
direction: "forward" | "backward";
|
|
268
|
-
};
|
|
269
|
-
/**
|
|
270
|
-
* Common interface for animation controllers
|
|
271
|
-
* Implemented by both Animator (single spring) and AnimationScheduler (multi-spring)
|
|
272
|
-
* @internal
|
|
273
|
-
*/
|
|
274
|
-
export interface AnimationController {
|
|
275
|
-
forward(): void;
|
|
276
|
-
backward(): void;
|
|
277
|
-
stop(): void;
|
|
278
|
-
reverse(): void;
|
|
279
|
-
getCurrentState(): AnimationState;
|
|
280
|
-
}
|
|
281
281
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/lib/types.ts"],"names":[],"mappings":"AAAA,MAAM,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iBAAiB,GACxB,2BAA2B,CAiC7B;AAED;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC"}
|
package/dist/types.js
CHANGED
|
@@ -1,25 +1,73 @@
|
|
|
1
|
-
function
|
|
2
|
-
return ("tick" in
|
|
1
|
+
function d(e) {
|
|
2
|
+
return ("tick" in e || "css" in e) && !("springs" in e);
|
|
3
3
|
}
|
|
4
|
-
function e
|
|
5
|
-
return "springs" in
|
|
4
|
+
function a(e) {
|
|
5
|
+
return "springs" in e;
|
|
6
6
|
}
|
|
7
|
-
function
|
|
8
|
-
return "css" in
|
|
7
|
+
function o(e) {
|
|
8
|
+
return "css" in e && typeof e.css == "function";
|
|
9
9
|
}
|
|
10
|
-
function
|
|
11
|
-
return "tick" in
|
|
10
|
+
function l(e) {
|
|
11
|
+
return "tick" in e && typeof e.tick == "function";
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
if (
|
|
13
|
+
function u(e) {
|
|
14
|
+
if (o(e) && l(e))
|
|
15
15
|
throw new Error(
|
|
16
16
|
"SingleSpringConfig cannot have both 'tick' and 'css' defined. Use one or the other."
|
|
17
17
|
);
|
|
18
18
|
}
|
|
19
|
+
function p(e) {
|
|
20
|
+
if (e.tick && e.css)
|
|
21
|
+
throw new Error(
|
|
22
|
+
"SpringItem cannot have both 'tick' and 'css' defined. Use one or the other."
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
function h(e) {
|
|
26
|
+
return a(e) ? (e.springs.forEach(p), e) : (u(e), {
|
|
27
|
+
prepare: e.prepare,
|
|
28
|
+
wait: e.wait,
|
|
29
|
+
onStart: e.onStart,
|
|
30
|
+
onEnd: e.onEnd,
|
|
31
|
+
springs: [
|
|
32
|
+
{
|
|
33
|
+
spring: e.spring,
|
|
34
|
+
tick: e.tick,
|
|
35
|
+
css: e.css
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
schedule: "parallel"
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function S(e) {
|
|
42
|
+
const r = e.schedule ?? "parallel", i = e.springs.map((t) => {
|
|
43
|
+
let n;
|
|
44
|
+
switch (r) {
|
|
45
|
+
case "parallel":
|
|
46
|
+
n = 0;
|
|
47
|
+
break;
|
|
48
|
+
case "sequential":
|
|
49
|
+
n = 1;
|
|
50
|
+
break;
|
|
51
|
+
case "stagger":
|
|
52
|
+
n = Math.max(0, Math.min(1, t.offset ?? 0));
|
|
53
|
+
break;
|
|
54
|
+
default:
|
|
55
|
+
n = 0;
|
|
56
|
+
}
|
|
57
|
+
return { ...t, normalizedOffset: n };
|
|
58
|
+
}), { schedule: c, ...s } = e;
|
|
59
|
+
return {
|
|
60
|
+
...s,
|
|
61
|
+
springs: i
|
|
62
|
+
};
|
|
63
|
+
}
|
|
19
64
|
export {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
65
|
+
o as isCssAnimation,
|
|
66
|
+
a as isMultiSpring,
|
|
67
|
+
d as isSingleSpring,
|
|
68
|
+
l as isTickAnimation,
|
|
69
|
+
S as normalizeMultiSpringSchedule,
|
|
70
|
+
h as normalizeToMultiSpring,
|
|
71
|
+
u as validateAnimationMode,
|
|
72
|
+
p as validateSpringItem
|
|
25
73
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blind.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/blind.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,eAAe,EAEhB,MAAM,UAAU,CAAC;AAWlB,UAAU,YAAY;IACpB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,SAAS,CAAC,EAAE,YAAY,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACtC,
|
|
1
|
+
{"version":3,"file":"blind.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/blind.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,eAAe,EAEhB,MAAM,UAAU,CAAC;AAWlB,UAAU,YAAY;IACpB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,SAAS,CAAC,EAAE,YAAY,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,KAAK,GAAI,UAAS,YAAiB,KAAG,eA2LlD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fade.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/fade.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"fade.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/fade.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAe,MAAM,UAAU,CAAC;AAQ3E,UAAU,WAAW;IACnB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,SAAS,CAAC,EAAE,YAAY,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,eAAO,MAAM,IAAI,GAAI,UAAS,WAAgB,KAAG,eA0DhD,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("../jaemin-BG8HRXG1.cjs"),F=t=>new Promise(n=>setTimeout(n,t)),N={stiffness:80,damping:25},q={stiffness:75,damping:25},G=300,j=10,K="horizontal",Z="#000000",J=(t={})=>{const{inSpring:n=q,outSpring:r=N,transitionDelay:d=G,blindCount:s=j,direction:a=K,blindColor:c=Z}=t;let i,o=null;const l=(e,g,p="left")=>{window.getComputedStyle(e).position==="static"&&(e.style.position="relative");const y=document.createElement("div");y.className="blind-container",y.style.cssText=`
|
|
2
2
|
position: absolute;
|
|
3
3
|
top: 0;
|
|
4
4
|
left: 0;
|
|
@@ -7,29 +7,29 @@
|
|
|
7
7
|
pointer-events: none;
|
|
8
8
|
z-index: 9999;
|
|
9
9
|
overflow: hidden;
|
|
10
|
-
`;const
|
|
10
|
+
`;const h=[];for(let f=0;f<s;f++){const $=document.createElement("div");if(a==="horizontal"){const w=100/s,x=`calc(${w}% + 1px)`;$.style.cssText=`
|
|
11
11
|
position: absolute;
|
|
12
|
-
top: ${w
|
|
12
|
+
top: ${w*f}%;
|
|
13
13
|
left: 0;
|
|
14
14
|
width: 100%;
|
|
15
|
-
height: ${
|
|
16
|
-
background: ${
|
|
15
|
+
height: ${x};
|
|
16
|
+
background: ${c};
|
|
17
17
|
transform: scaleX(${g==="hidden"?0:1});
|
|
18
|
-
transform-origin: ${
|
|
18
|
+
transform-origin: ${p} center;
|
|
19
19
|
will-change: transform;
|
|
20
|
-
`}else{const w=100/
|
|
20
|
+
`}else{const w=100/s,x=`calc(${w}% + 1px)`;$.style.cssText=`
|
|
21
21
|
position: absolute;
|
|
22
22
|
top: 0;
|
|
23
|
-
left: ${w
|
|
24
|
-
width: ${
|
|
23
|
+
left: ${w*f}%;
|
|
24
|
+
width: ${x};
|
|
25
25
|
height: 100%;
|
|
26
|
-
background: ${
|
|
26
|
+
background: ${c};
|
|
27
27
|
transform: scaleY(${g==="hidden"?0:1});
|
|
28
|
-
transform-origin: ${
|
|
28
|
+
transform-origin: ${p==="left"?"top":"bottom"} center;
|
|
29
29
|
will-change: transform;
|
|
30
|
-
`}
|
|
30
|
+
`}h.push($),y.appendChild($)}return e.appendChild(y),{container:y,blinds:h}};return{out:()=>{let e=null;return i=new Promise(p=>{o=p}),{springs:Array.from({length:s},(p,u)=>({spring:r,offset:.2,tick:y=>{if(!e)return;const h=e.blinds[u];if(!h)return;const f=1-y;a==="horizontal"?h.style.transform=`scaleX(${f})`:h.style.transform=`scaleY(${f})`}})),schedule:"stagger",prepare:p=>{b.prepareOutgoing(p),p.style.zIndex="1000",e=l(p,"hidden","left")},onStart:()=>{},onEnd:()=>{o&&o()}}},in:()=>{let e=null;return{springs:Array.from({length:s},(p,u)=>({spring:n,offset:.2,tick:y=>{if(!e)return;const h=e.blinds[u];if(!h)return;const f=1-y;a==="horizontal"?h.style.transform=`scaleX(${f})`:h.style.transform=`scaleY(${f})`}})),schedule:"stagger",prepare:p=>{p.style.position="relative",p.style.zIndex="0",e=l(p,"closed","right")},onStart:()=>{},wait:async()=>{i&&await i,await F(d)},onEnd:()=>{e&&e.container&&e.container.remove()}}}}},Q={stiffness:150,damping:20},R={stiffness:100,damping:20},tt=(t={})=>{var a,c;const{opacity:n=!1,direction:r="enter"}=t,d=r==="enter"?Q:R,s={stiffness:((a=t.spring)==null?void 0:a.stiffness)??d.stiffness,damping:((c=t.spring)==null?void 0:c.damping)??d.damping};return r==="enter"?{in:i=>({spring:s,prepare:()=>{i.style.willChange=n?"transform, opacity":"transform",i.style.backfaceVisibility="hidden",i.style.contain="layout paint"},css:o=>{const l={transform:`translate3d(${(1-o)*100}%, 0, 0)`};return n&&(l.opacity=o),l},onEnd:()=>{i.style.willChange="auto",i.style.backfaceVisibility="",i.style.contain=""}}),out:(i,o)=>({spring:s,prepare:l=>{b.prepareOutgoing(l,o),l.style.zIndex="-1",l.style.willChange=n?"transform, opacity":"transform",l.style.backfaceVisibility="hidden",l.style.contain="layout paint",l.style.pointerEvents="none"},css:l=>{const e={transform:`translate3d(${-(1-l)*20}%, 0, 0)`};return n&&(e.opacity=l),e}})}:{in:i=>({spring:s,prepare:()=>{i.style.willChange=n?"transform, opacity":"transform",i.style.backfaceVisibility="hidden",i.style.contain="layout paint"},css:o=>{const l={transform:`translate3d(${-(1-o)*20}%, 0, 0)`};return n&&(l.opacity=o),l},onEnd:()=>{i.style.willChange="auto",i.style.backfaceVisibility="",i.style.contain=""}}),out:(i,o)=>({spring:s,prepare:l=>{b.prepareOutgoing(l,o),l.style.zIndex="100",l.style.willChange=n?"transform, opacity":"transform",l.style.backfaceVisibility="hidden",l.style.contain="layout paint",l.style.pointerEvents="none"},css:l=>{const e={transform:`translate3d(${(1-l)*100}%, 0, 0)`};return n&&(e.opacity=l),e}})}},nt={stiffness:65,damping:16},et={stiffness:65,damping:14},it=0,st=(t={})=>{const{inSpring:n=et,outSpring:r=nt,transitionDelay:d=it}=t;let s,a=null;return{in:c=>({spring:n,prepare:()=>{c.style.willChange="opacity"},wait:async()=>{s&&(await s,await F(d))},css:i=>({opacity:i}),onEnd:()=>{c.style.willChange="auto"}}),out:(c,i)=>(s=new Promise(o=>{a=o}),{spring:r,css:o=>({opacity:o}),prepare:()=>{b.prepareOutgoing(c,i),c.style.willChange="opacity"},onEnd:()=>{a&&a(),c.style.willChange="auto"}})}},rt={stiffness:5,damping:3.5},at=.8,lt="white",m={start:0,end:.45},E={start:.85,end:1},A={start:.2,end:.9},ot=t=>{var s;const n=(t==null?void 0:t.spring)??rt,r=(t==null?void 0:t.scale)??at,d=((s=t==null?void 0:t.border)==null?void 0:s.color)??lt;return{out:async(a,c)=>{const i=S(c),o=b.getRect(document.body,c.positionedParent),l=dt(d,{...i,top:o.top});let e=1,g=-i.top;return{spring:n,prepare:()=>{b.prepareOutgoing(a),_(a,i),P(a,i),ht(a,i);for(const p of l)c.positionedParent.appendChild(p)},onEnd:()=>{a.style.clipPath="",a.style.transformOrigin="",setTimeout(()=>{for(const p of l)c.positionedParent.removeChild(p)},1e3)},tick:p=>{const u=1-p;if(m.start<=u&&u<=m.end){const f=L(u,m.start,m.end);e=1-(1-r)*f}if(E.start<=u&&u<=E.end){const f=L(u,E.start,E.end);e=r+(1-r)*f}if(A.start<=u&&u<=A.end){const f=L(u,A.start,A.end);g=-i.top-i.height*f}a.style.transform=`translateY(${g}px) scale(${e})`;const y=(i.width-i.width*e)/2,h=(i.height-i.height*e)/2;ct(l,y,h)}}},in:async(a,c)=>{const i=S(c);let o=r,l=-i.top+i.height;return{spring:n,prepare:()=>{_(a,i),P(a,i),a.style.transform=`translateY(${-i.top+i.height}px) scale(${r})`},onEnd:()=>{a.style.clipPath="",a.style.transformOrigin="",a.style.transform=""},tick:e=>{if(m.start<=e&&e<=m.end){const g=L(e,m.start,m.end);o=1-(1-r)*g}if(E.start<=e&&e<=E.end){const g=L(e,E.start,E.end);o=r+(1-r)*g}if(A.start<=e&&e<=A.end){const g=L(e,A.start,A.end);l=-i.top+i.height*(1-g)}a.style.transform=`translateY(${l}px) scale(${o})`}}}}};function ct(t,n,r){const d=n*.7,s=r*.7;t.topLeft.style.transform=`translate(${d}px, ${s}px)`,t.topRight.style.transform=`translate(${-d}px, ${s}px)`,t.bottomLeft.style.transform=`translate(${d}px, ${-s}px)`,t.bottomRight.style.transform=`translate(${-d}px, ${-s}px)`}function dt(t="white",n){const s=document.createElement("div");s.style.position="fixed",s.style.pointerEvents="none",s.style.zIndex="9999",s.style.top=`${n.top-1}px`,s.style.left=`${n.left-1}px`,s.style.width="15px",s.style.height="15px";const a=document.createElement("div");a.style.position="absolute",a.style.width="15px",a.style.height="1px",a.style.backgroundColor=t,a.style.top="0",a.style.left="0";const c=document.createElement("div");c.style.position="absolute",c.style.width="1px",c.style.height="15px",c.style.backgroundColor=t,c.style.top="0",c.style.left="0",s.appendChild(a),s.appendChild(c);const i=document.createElement("div");i.style.position="fixed",i.style.pointerEvents="none",i.style.zIndex="9999",i.style.top=`${n.top-1}px`,i.style.left=`${n.left+n.width-15+1}px`,i.style.width="15px",i.style.height="15px";const o=document.createElement("div");o.style.position="absolute",o.style.width="15px",o.style.height="1px",o.style.backgroundColor=t,o.style.top="0",o.style.right="0";const l=document.createElement("div");l.style.position="absolute",l.style.width="1px",l.style.height="15px",l.style.backgroundColor=t,l.style.top="0",l.style.right="0",i.appendChild(o),i.appendChild(l);const e=document.createElement("div");e.style.position="fixed",e.style.pointerEvents="none",e.style.zIndex="9999",e.style.top=`${n.top+n.height-15+1}px`,e.style.left=`${n.left-1}px`,e.style.width="15px",e.style.height="15px";const g=document.createElement("div");g.style.position="absolute",g.style.width="15px",g.style.height="1px",g.style.backgroundColor=t,g.style.bottom="0",g.style.left="0";const p=document.createElement("div");p.style.position="absolute",p.style.width="1px",p.style.height="15px",p.style.backgroundColor=t,p.style.bottom="0",p.style.left="0",e.appendChild(g),e.appendChild(p);const u=document.createElement("div");u.style.position="fixed",u.style.pointerEvents="none",u.style.zIndex="9999",u.style.top=`${n.top+n.height-15+1}px`,u.style.left=`${n.left+n.width-15+1}px`,u.style.width="15px",u.style.height="15px";const y=document.createElement("div");y.style.position="absolute",y.style.width="15px",y.style.height="1px",y.style.backgroundColor=t,y.style.bottom="0",y.style.right="0";const h=document.createElement("div");return h.style.position="absolute",h.style.width="1px",h.style.height="15px",h.style.backgroundColor=t,h.style.bottom="0",h.style.right="0",u.appendChild(y),u.appendChild(h),{topLeft:s,topRight:i,bottomLeft:e,bottomRight:u,*[Symbol.iterator](){yield s,yield i,yield e,yield u}}}function S(t){const n=b.getRect(document.body,t.positionedParent);return{top:t.scroll.y,left:0,width:n.width,height:window.innerHeight-n.top}}function _(t,n){const r=n.left+n.width/2,d=n.top+n.height/2;t.style.transformOrigin=`${r}px ${d}px`}function P(t,n){t.style.clipPath=`polygon(
|
|
31
31
|
${n.left}px ${n.top}px,
|
|
32
32
|
${n.left+n.width}px ${n.top}px,
|
|
33
33
|
${n.left+n.width}px ${n.top+n.height}px,
|
|
34
34
|
${n.left}px ${n.top+n.height}px
|
|
35
|
-
)`}function pt(t,n){t.style.transform=`translateY(${-n.top}px)`}function L(t,n,i){return t<=n?0:t>=i?1:(t-n)/(i-n)}function yt(t,n){return t.querySelector(`[data-hero-key="${n}"]`)}const ut=(t={})=>{var c,e;const n={stiffness:((c=t.spring)==null?void 0:c.stiffness)??300,damping:((e=t.spring)==null?void 0:e.damping)??30},i=t.timeout??300,d=t.maxDistance??700;let l=null,r=null;return{in:async(o,s)=>{const a=o,p=Array.from(a.querySelectorAll("[data-hero-key]"));if(p.length===0)return{spring:n,tick:()=>{}};if(!await new Promise(y=>{l?y(!0):(r=y,setTimeout(()=>{r=null,y(!1)},i))})||!l)return l=null,{spring:n,tick:()=>{}};const u=p.map(y=>{const h=y.getAttribute("data-hero-key");if(!h)return null;const f=yt(l,h);if(!f)return null;const $=y,x=m.getRect(l,f),w=m.getRect(a,$),C=x.left-w.left-s.scrollOffset.x,U=x.top-w.top-s.scrollOffset.y,W=x.width/w.width,X=x.height/w.height,z=$.style.transform,B=$.style.position,M=$.style.transformOrigin,H=$.style.zIndex,N=$.style.willChange;return{toEl:$,dx:C,dy:U,dw:W,dh:X,originalTransform:z,originalPosition:B,originalTransformOrigin:M,originalZIndex:H,originalWillChange:N}}).filter(y=>y!==null&&Math.abs(y.dy)<=d);return l=null,u.length===0?{spring:n,tick:()=>{}}:{spring:n,prepare:()=>{u.forEach(({toEl:y})=>{y.style.position="relative",y.style.transformOrigin="top left",y.style.zIndex="1000",y.style.willChange="transform"})},tick:y=>{u.forEach(({toEl:h,dx:f,dy:$,dw:x,dh:w})=>{h.style.transform=`translate(${(1-y)*f}px,${(1-y)*$}px) scale(${y+(1-y)*x}, ${y+(1-y)*w})`})},onEnd:()=>{u.forEach(({toEl:y,originalTransform:h,originalPosition:f,originalTransformOrigin:$,originalZIndex:x,originalWillChange:w})=>{y.style.transform=h,y.style.position=f,y.style.transformOrigin=$,y.style.zIndex=x,y.style.willChange=w})}}},out:async o=>({onStart:()=>{l=o,r&&(r(!0),r=null)},tick:()=>{},prepare:s=>{m.prepareOutgoing(s),s.style.opacity="0"}})}};function gt({detailRect:t,galleryRect:n,pageRect:i,scrollOffset:d},l){const r=n.left-t.left+(n.width-t.width)/2-d.x,c=n.top-t.top+(n.height-t.height)/2-d.y,e=n.width/t.width,o=n.height/t.height,s=Math.max(e,o),a=t.top/i.height*100,p=(i.width-(t.left+t.width))/i.width*100,g=(i.height-(t.top+t.height))/i.height*100,u=t.left/i.width*100;return l.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`,y=>{const h=1-y,f=a*h,$=p*h,x=g*h,w=u*h;l.style.clipPath=`inset(${f}% ${$}% ${x}% ${w}%)`,l.style.transform=`translate(${r*h}px, ${c*h}px) scale(${1+(s-1)*h})`}}function ft({detailRect:t,galleryRect:n,pageRect:i,scrollOffset:d},l){const r=n.left-t.left+(n.width-t.width)/2+d.x,c=n.top-t.top+(n.height-t.height)/2+d.y,e=n.width/t.width,o=n.height/t.height,s=Math.min(e,o),a=t.top/i.height*100,p=(i.width-(t.left+t.width))/i.width*100,g=(i.height-(t.top+t.height))/i.height*100,u=t.left/i.width*100;return l.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`,y=>{const h=1-y,f=a*h,$=p*h,x=g*h,w=u*h;l.style.clipPath=`inset(${f}% ${$}% ${x}% ${w}%)`,l.style.transform=`translate(${r*h-d.x}px, ${c*h-d.y}px) scale(${1+(s-1)*h})`}}function $t(t,n,i){const d=t.querySelector("[data-instagram-detail-key]"),l=n.querySelector("[data-instagram-detail-key]");if(t.querySelectorAll("[data-instagram-detail-key]").length>1||n.querySelectorAll("[data-instagram-detail-key]").length>1)return null;let r=null,c=null,e=!1;if(!d&&l){c=l;const a=c.getAttribute("data-instagram-detail-key");if(!a)return null;r=t.querySelector(`[data-instagram-gallery-key="${a}"]`),r&&(e=!0)}else if(d&&!l){c=d;const a=c.getAttribute("data-instagram-detail-key");if(!a)return null;r=n.querySelector(`[data-instagram-gallery-key="${a}"]`),r&&(e=!1)}if(!r||!c)return null;const o=m.getRect(e?t:n,r),s=m.getRect(e?n:t,c);return e?{isEnterMode:!0,inAnimation:gt({detailRect:s,galleryRect:o,pageRect:n.getBoundingClientRect(),scrollOffset:i},n)}:{isEnterMode:!1,outAnimation:ft({detailRect:s,galleryRect:o,pageRect:t.getBoundingClientRect(),scrollOffset:i},t)}}const wt=(t={})=>{var c,e;const n={stiffness:((c=t.spring)==null?void 0:c.stiffness)??150,damping:((e=t.spring)==null?void 0:e.damping)??20},i=t.timeout??300;let d=null,l=null,r=null;return{in:async(o,{scrollOffset:s})=>{const a=o;return!await new Promise(g=>{d?g(!0):(l=g,setTimeout(()=>{l=null,g(!1)},i))})||!d?(d=null,{spring:n,tick:()=>{}}):(r=$t(d,a,s),r?(d=null,{spring:n,tick:g=>{r!=null&&r.inAnimation&&r.inAnimation(g)}}):{spring:n,tick:()=>{}})},out:async o=>({spring:n,onStart:()=>{d=o,l&&(l(!0),l=null)},prepare:s=>{m.prepareOutgoing(s),r!=null&&r.isEnterMode||(s.style.zIndex="-1")},tick:s=>{r!=null&&r.outAnimation&&r.outAnimation(s)}})}};function xt({detailRect:t,galleryRect:n,pageRect:i,scrollOffset:d},l){const r=n.left-t.left+(n.width-t.width)/2-d.x,c=n.top-t.top+(n.height-t.height)/2-d.y,e=n.width/t.width,o=n.height/t.height,s=Math.max(e,o),a=t.top/i.height*100,p=(i.width-(t.left+t.width))/i.width*100,g=(i.height-(t.top+t.height))/i.height*100,u=t.left/i.width*100;return l.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`,y=>{const h=1-y,f=a*h,$=p*h,x=g*h,w=u*h;l.style.clipPath=`inset(${f}% ${$}% ${x}% ${w}%)`,l.style.transform=`translate(${r*h}px, ${c*h}px) scale(${1+(s-1)*h})`}}function mt({galleryRect:t,detailRect:n,scrollOffset:i},d){const l=n.left-t.left+(n.width-t.width)/2+i.x,r=n.top-t.top+(n.height-t.height)/2+i.y,c=n.width/t.width,e=n.height/t.height,o=Math.max(c,e);return s=>{d.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`;const a=1-s;d.style.transform=`translate(${l*a-i.x}px, ${r*a-i.y}px) scale(${1+(o-1)*a})`,d.style.opacity=`${1-a}`}}function bt({galleryRect:t,detailRect:n,scrollOffset:i},d){const l=n.left-t.left+(n.width-t.width)/2-i.x,r=n.top-t.top+(n.height-t.height)/2-i.y,c=n.width/t.width,e=n.height/t.height,o=Math.max(c,e);return s=>{const a=1-s,p=s;d.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`,d.style.transform=`translate(${l*a}px, ${r*a}px) scale(${1+(o-1)*a})`,d.style.opacity=`${p}`}}function Et({detailRect:t,galleryRect:n,pageRect:i,scrollOffset:d},l){const r=n.left-t.left+(n.width-t.width)/2+d.x,c=n.top-t.top+(n.height-t.height)/2+d.y,e=n.width/t.width,o=n.height/t.height,s=Math.min(e,o),a=t.top/i.height*100,p=(i.width-(t.left+t.width))/i.width*100,g=(i.height-(t.top+t.height))/i.height*100,u=t.left/i.width*100;return l.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`,y=>{const h=1-y,f=a*h,$=p*h,x=g*h,w=u*h;l.style.clipPath=`inset(${f}% ${$}% ${x}% ${w}%)`,l.style.transform=`translate(${r*h-d.x}px, ${c*h-d.y}px) scale(${1+(s-1)*h})`}}function At(t,n,i){const d=t.querySelector("[data-pinterest-detail-key]"),l=n.querySelector("[data-pinterest-detail-key]");if(t.querySelectorAll("[data-pinterest-detail-key]").length>1||n.querySelectorAll("[data-pinterest-detail-key]").length>1)return null;let r=null,c=null,e=!1;if(!d&&l){c=l;const a=c.getAttribute("data-pinterest-detail-key");if(!a)return null;r=t.querySelector(`[data-pinterest-gallery-key="${a}"]`),r&&(e=!0)}else if(d&&!l){c=d;const a=c.getAttribute("data-pinterest-detail-key");if(!a)return null;r=n.querySelector(`[data-pinterest-gallery-key="${a}"]`),r&&(e=!1)}if(!r||!c)return null;const o=m.getRect(e?t:n,r),s=m.getRect(e?n:t,c);return e?{inAnimation:xt({detailRect:s,galleryRect:o,pageRect:n.getBoundingClientRect(),scrollOffset:i},n),outAnimation:mt({galleryRect:o,detailRect:s,scrollOffset:i},t)}:{inAnimation:bt({galleryRect:o,detailRect:s,scrollOffset:i},n),outAnimation:Et({detailRect:s,galleryRect:o,pageRect:t.getBoundingClientRect(),scrollOffset:i},t)}}const Lt=(t={})=>{var c,e;const n={stiffness:((c=t.spring)==null?void 0:c.stiffness)??30,damping:((e=t.spring)==null?void 0:e.damping)??10},i=t.timeout??300;let d=null,l=null,r=null;return{in:async(o,{scrollOffset:s})=>{const a=o;return!await new Promise(g=>{d?g(!0):(l=g,setTimeout(()=>{l=null,g(!1)},i))})||!d?(d=null,{spring:n,tick:()=>{}}):(r=At(d,a,s),r?(d=null,{spring:n,tick:g=>{r&&r.inAnimation(g)}}):{spring:n,tick:()=>{}})},out:async o=>({spring:n,onStart:()=>{d=o,l&&(l(!0),l=null)},prepare:s=>{m.prepareOutgoing(s),s.style.zIndex="-1"},tick:s=>{r&&r.outAnimation(s)}})}},D={stiffness:5,damping:4},Ct=(t={})=>{var o,s;const n=t.direction??"up",i={stiffness:((o=t.spring)==null?void 0:o.stiffness)??D.stiffness,damping:((s=t.spring)==null?void 0:s.damping)??D.damping},d=n==="up";let l=null,r=null,c=null;const e=()=>{if(l===null||r===null)return null;const a=Math.min(l,r),p=window.innerHeight;return Math.max(a,p)};return{in:a=>(r=a.offsetHeight,l!==null&&(c=e()),{spring:i,prepare:()=>{a.style.willChange="transform"},tick:p=>{if(c===null&&(c=e(),c===null))return;const g=d?(1-p)*c:(1-p)*-c;a.style.transform=`translateY(${g}px)`},onEnd:()=>{a.style.willChange="auto"}}),out:a=>({spring:i,onStart:()=>{l=a.offsetHeight,r!==null&&(c=e())},tick:p=>{if(c===null&&(c=e(),c===null))return;const g=d?(1-p)*-c:(1-p)*c;a.style.transform=`translateY(${g}px)`},prepare:p=>{m.prepareOutgoing(p),p.style.zIndex=d?"-1":"1",p.style.willChange="transform"}})}},v={stiffness:15,damping:7},Tt=(t={})=>{var l,r;const n=t.direction??"left",i={stiffness:((l=t.spring)==null?void 0:l.stiffness)??v.stiffness,damping:((r=t.spring)==null?void 0:r.damping)??v.damping},d=n==="left";return{in:c=>({spring:i,prepare:()=>{c.style.willChange="transform"},tick:e=>{const o=d?(1-e)*100:(1-e)*-100;c.style.transform=`translateX(${o}%)`},onEnd:()=>{c.style.willChange="auto"}}),out:(c,e)=>({spring:i,tick:o=>{const s=d?(1-o)*-100:(1-o)*100;c.style.transform=`translateX(${s}%)`},prepare:o=>{m.prepareOutgoing(o,e),o.style.zIndex=d?"-1":"1",o.style.willChange="transform"}})}},O={stiffness:17,damping:6},S=20,k=800,St=()=>{let t,n=null;return{in:i=>({spring:O,prepare:d=>{d.style.willChange="transform",d.style.transform=`perspective(${k}px) rotateY(${S}deg) translateX(-100%)`},wait:async()=>{t&&await t},tick:d=>{const l=(1-d)*S,r=-(1-d)*100;i.style.transform=`perspective(${k}px) rotateY(${l}deg) translateX(${r}%)`},onEnd:()=>{i.style.transform="",i.style.willChange="auto"}}),out:(i,d)=>(t=new Promise(l=>{n=l}),{spring:O,prepare:l=>{m.prepareOutgoing(l,d),l.style.willChange="transform"},tick:l=>{const r=1-l,c=r*S,e=r*100;i.style.transform=`perspective(${k}px) rotateY(${-c}deg) translateX(${e}%)`},onEnd:()=>{n&&n(),i.style.transform=""}})}},kt={stiffness:1,damping:1},_t={stiffness:20,damping:25},Pt="#000000",It="circle",F="CURTAIN_REVEAL_OVERLAY_ID",Dt={position:"fixed",inset:"0",width:"100vw",height:"100%",zIndex:"9999",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"},vt={position:"relative",display:"inline-block",height:"5.5rem",overflow:"hidden"},Ot={display:"flex",height:"100%",willChange:"transform",transition:"transform 0.3s ease"},Ft={display:"inline-flex",alignItems:"center",justifyContent:"center",whiteSpace:"nowrap",fontSize:"5.5rem",fontWeight:"900",letterSpacing:"0.02em",color:"#FFFFFF"},Yt=.4,T=.5,Ut=.2;function Wt(t,n){switch(t){case"circle":return`circle(${n*100}% at 50% 50%)`;case"square":return`inset(${(1-n)*50}% round ${10*n}%)`;case"triangle":{const i=n*100;return`polygon(50% ${50-i}%, ${50-i}% ${50+i}%, ${50+i}% ${50+i}%)`}}}const Xt=t=>t.reduce((n,i)=>n+i,0),zt=(t={})=>{const{background:n=Pt,texts:i=[],shape:d=It,inSpring:l=_t,outSpring:r=kt,textStyle:c={}}=t;return{out:(e,o)=>{const s=e.style.opacity;return{spring:r,from:1,to:0,prepare:a=>{m.prepareOutgoing(a,o),a.style.opacity="1"},tick:a=>{const p=Math.max(0,a-Yt);e.style.opacity=String(p)},onEnd:()=>{e.style.opacity=s}}},in:e=>{let o=null,s=null,a=null;const p=document.body.style.overflow,g=document.getElementById(F);let u=[];const y=()=>{o=document.createElement("div"),o.id=F,Object.assign(o.style,Dt,{background:n}),document.body.appendChild(o),s=document.createElement("div"),Object.assign(s.style,vt),o.appendChild(s),a=document.createElement("div"),Object.assign(a.style,Ot),s.appendChild(a),i.forEach(h=>{const f=document.createElement("div");f.textContent=h,Object.assign(f.style,Ft,c),a.appendChild(f)}),u=Array.from(a.children).map(h=>h.getBoundingClientRect().width)};return{spring:l,from:0,to:1,prepare:()=>{document.body.style.overflow="hidden",e.style.opacity="1",g==null||g.remove(),y(),o&&s&&(o.style.clipPath="none",s.style.transform="scale(1)")},tick:h=>{if(!(!o||!s||!a)){if(h<=T&&i.length>0){const f=h/T,$=Math.min(Math.floor(f*i.length),i.length-1),x=u[$]??0,w=Xt(u.slice(0,$));s.style.width=`${x}px`,a.style.transform=`translateX(-${w}px)`}if(h>T){const $=1-Math.max(0,Math.min(1,(h-T)/Ut));o.style.clipPath=Wt(d,$),s.style.transform=`scale(${$})`}}},onEnd:()=>{o==null||o.remove(),o=s=a=null,document.body.style.overflow=p}}}}};exports.jaemin=m.jaemin;exports.blind=Q;exports.curtainReveal=zt;exports.drill=nt;exports.fade=rt;exports.film=ct;exports.hero=ut;exports.instagram=wt;exports.pinterest=Lt;exports.scroll=Ct;exports.slide=Tt;exports.strip=St;
|
|
35
|
+
)`}function ht(t,n){t.style.transform=`translateY(${-n.top}px)`}function L(t,n,r){return t<=n?0:t>=r?1:(t-n)/(r-n)}function pt(t,n){return t.querySelector(`[data-hero-key="${n}"]`)}const yt=(t={})=>{var c,i;const n={stiffness:((c=t.spring)==null?void 0:c.stiffness)??300,damping:((i=t.spring)==null?void 0:i.damping)??30},r=t.timeout??300,d=t.maxDistance??700;let s=null,a=null;return{in:async(o,l)=>{const e=o,g=Array.from(e.querySelectorAll("[data-hero-key]"));if(g.length===0)return{spring:n,tick:()=>{}};if(!await new Promise(y=>{s?y(!0):(a=y,setTimeout(()=>{a=null,y(!1)},r))})||!s)return s=null,{spring:n,tick:()=>{}};const u=g.map(y=>{const h=y.getAttribute("data-hero-key");if(!h)return null;const f=pt(s,h);if(!f)return null;const $=y,w=b.getRect(s,f),x=b.getRect(e,$),Y=w.left-x.left-l.scrollOffset.x,U=w.top-x.top-l.scrollOffset.y,V=w.width/x.width,W=w.height/x.height,H=$.style.transform,B=$.style.position,z=$.style.transformOrigin,X=$.style.zIndex,M=$.style.willChange;return{toEl:$,dx:Y,dy:U,dw:V,dh:W,originalTransform:H,originalPosition:B,originalTransformOrigin:z,originalZIndex:X,originalWillChange:M}}).filter(y=>y!==null&&Math.abs(y.dy)<=d);return s=null,u.length===0?{spring:n,tick:()=>{}}:{spring:n,prepare:()=>{u.forEach(({toEl:y})=>{y.style.position="relative",y.style.transformOrigin="top left",y.style.zIndex="1000",y.style.willChange="transform"})},tick:y=>{u.forEach(({toEl:h,dx:f,dy:$,dw:w,dh:x})=>{h.style.transform=`translate(${(1-y)*f}px,${(1-y)*$}px) scale(${y+(1-y)*w}, ${y+(1-y)*x})`})},onEnd:()=>{u.forEach(({toEl:y,originalTransform:h,originalPosition:f,originalTransformOrigin:$,originalZIndex:w,originalWillChange:x})=>{y.style.transform=h,y.style.position=f,y.style.transformOrigin=$,y.style.zIndex=w,y.style.willChange=x})}}},out:async o=>({onStart:()=>{s=o,a&&(a(!0),a=null)},tick:()=>{},prepare:l=>{b.prepareOutgoing(l),l.style.opacity="0"}})}};function ut({detailRect:t,galleryRect:n,pageRect:r,scrollOffset:d},s){const a=n.left-t.left+(n.width-t.width)/2-d.x,c=n.top-t.top+(n.height-t.height)/2-d.y,i=n.width/t.width,o=n.height/t.height,l=Math.max(i,o),e=t.top/r.height*100,g=(r.width-(t.left+t.width))/r.width*100,p=(r.height-(t.top+t.height))/r.height*100,u=t.left/r.width*100;return s.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`,y=>{const h=1-y,f=e*h,$=g*h,w=p*h,x=u*h;s.style.clipPath=`inset(${f}% ${$}% ${w}% ${x}%)`,s.style.transform=`translate(${a*h}px, ${c*h}px) scale(${1+(l-1)*h})`}}function gt({detailRect:t,galleryRect:n,pageRect:r,scrollOffset:d},s){const a=n.left-t.left+(n.width-t.width)/2+d.x,c=n.top-t.top+(n.height-t.height)/2+d.y,i=n.width/t.width,o=n.height/t.height,l=Math.min(i,o),e=t.top/r.height*100,g=(r.width-(t.left+t.width))/r.width*100,p=(r.height-(t.top+t.height))/r.height*100,u=t.left/r.width*100;return s.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`,y=>{const h=1-y,f=e*h,$=g*h,w=p*h,x=u*h;s.style.clipPath=`inset(${f}% ${$}% ${w}% ${x}%)`,s.style.transform=`translate(${a*h-d.x}px, ${c*h-d.y}px) scale(${1+(l-1)*h})`}}function ft(t,n,r){const d=t.querySelector("[data-instagram-detail-key]"),s=n.querySelector("[data-instagram-detail-key]");if(t.querySelectorAll("[data-instagram-detail-key]").length>1||n.querySelectorAll("[data-instagram-detail-key]").length>1)return null;let a=null,c=null,i=!1;if(!d&&s){c=s;const e=c.getAttribute("data-instagram-detail-key");if(!e)return null;a=t.querySelector(`[data-instagram-gallery-key="${e}"]`),a&&(i=!0)}else if(d&&!s){c=d;const e=c.getAttribute("data-instagram-detail-key");if(!e)return null;a=n.querySelector(`[data-instagram-gallery-key="${e}"]`),a&&(i=!1)}if(!a||!c)return null;const o=b.getRect(i?t:n,a),l=b.getRect(i?n:t,c);return i?{isEnterMode:!0,inAnimation:ut({detailRect:l,galleryRect:o,pageRect:n.getBoundingClientRect(),scrollOffset:r},n)}:{isEnterMode:!1,outAnimation:gt({detailRect:l,galleryRect:o,pageRect:t.getBoundingClientRect(),scrollOffset:r},t)}}const $t=(t={})=>{var c,i;const n={stiffness:((c=t.spring)==null?void 0:c.stiffness)??150,damping:((i=t.spring)==null?void 0:i.damping)??20},r=t.timeout??300;let d=null,s=null,a=null;return{in:async(o,{scrollOffset:l})=>{const e=o;return!await new Promise(p=>{d?p(!0):(s=p,setTimeout(()=>{s=null,p(!1)},r))})||!d?(d=null,{spring:n,tick:()=>{}}):(a=ft(d,e,l),a?(d=null,{spring:n,tick:p=>{a!=null&&a.inAnimation&&a.inAnimation(p)}}):{spring:n,tick:()=>{}})},out:async o=>({spring:n,onStart:()=>{d=o,s&&(s(!0),s=null)},prepare:l=>{b.prepareOutgoing(l),a!=null&&a.isEnterMode||(l.style.zIndex="-1")},tick:l=>{a!=null&&a.outAnimation&&a.outAnimation(l)}})}};function wt({detailRect:t,galleryRect:n,pageRect:r,scrollOffset:d},s){const a=n.left-t.left+(n.width-t.width)/2-d.x,c=n.top-t.top+(n.height-t.height)/2-d.y,i=n.width/t.width,o=n.height/t.height,l=Math.max(i,o),e=t.top/r.height*100,g=(r.width-(t.left+t.width))/r.width*100,p=(r.height-(t.top+t.height))/r.height*100,u=t.left/r.width*100;return s.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`,y=>{const h=1-y,f=e*h,$=g*h,w=p*h,x=u*h;s.style.clipPath=`inset(${f}% ${$}% ${w}% ${x}%)`,s.style.transform=`translate(${a*h}px, ${c*h}px) scale(${1+(l-1)*h})`}}function xt({galleryRect:t,detailRect:n,scrollOffset:r},d){const s=n.left-t.left+(n.width-t.width)/2+r.x,a=n.top-t.top+(n.height-t.height)/2+r.y,c=n.width/t.width,i=n.height/t.height,o=Math.max(c,i);return l=>{d.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`;const e=1-l;d.style.transform=`translate(${s*e-r.x}px, ${a*e-r.y}px) scale(${1+(o-1)*e})`,d.style.opacity=`${1-e}`}}function bt({galleryRect:t,detailRect:n,scrollOffset:r},d){const s=n.left-t.left+(n.width-t.width)/2-r.x,a=n.top-t.top+(n.height-t.height)/2-r.y,c=n.width/t.width,i=n.height/t.height,o=Math.max(c,i);return l=>{const e=1-l,g=l;d.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`,d.style.transform=`translate(${s*e}px, ${a*e}px) scale(${1+(o-1)*e})`,d.style.opacity=`${g}`}}function mt({detailRect:t,galleryRect:n,pageRect:r,scrollOffset:d},s){const a=n.left-t.left+(n.width-t.width)/2+d.x,c=n.top-t.top+(n.height-t.height)/2+d.y,i=n.width/t.width,o=n.height/t.height,l=Math.min(i,o),e=t.top/r.height*100,g=(r.width-(t.left+t.width))/r.width*100,p=(r.height-(t.top+t.height))/r.height*100,u=t.left/r.width*100;return s.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`,y=>{const h=1-y,f=e*h,$=g*h,w=p*h,x=u*h;s.style.clipPath=`inset(${f}% ${$}% ${w}% ${x}%)`,s.style.transform=`translate(${a*h-d.x}px, ${c*h-d.y}px) scale(${1+(l-1)*h})`}}function Et(t,n,r){const d=t.querySelector("[data-pinterest-detail-key]"),s=n.querySelector("[data-pinterest-detail-key]");if(t.querySelectorAll("[data-pinterest-detail-key]").length>1||n.querySelectorAll("[data-pinterest-detail-key]").length>1)return null;let a=null,c=null,i=!1;if(!d&&s){c=s;const e=c.getAttribute("data-pinterest-detail-key");if(!e)return null;a=t.querySelector(`[data-pinterest-gallery-key="${e}"]`),a&&(i=!0)}else if(d&&!s){c=d;const e=c.getAttribute("data-pinterest-detail-key");if(!e)return null;a=n.querySelector(`[data-pinterest-gallery-key="${e}"]`),a&&(i=!1)}if(!a||!c)return null;const o=b.getRect(i?t:n,a),l=b.getRect(i?n:t,c);return i?{inAnimation:wt({detailRect:l,galleryRect:o,pageRect:n.getBoundingClientRect(),scrollOffset:r},n),outAnimation:xt({galleryRect:o,detailRect:l,scrollOffset:r},t)}:{inAnimation:bt({galleryRect:o,detailRect:l,scrollOffset:r},n),outAnimation:mt({detailRect:l,galleryRect:o,pageRect:t.getBoundingClientRect(),scrollOffset:r},t)}}const At=(t={})=>{var c,i;const n={stiffness:((c=t.spring)==null?void 0:c.stiffness)??30,damping:((i=t.spring)==null?void 0:i.damping)??10},r=t.timeout??300;let d=null,s=null,a=null;return{in:async(o,{scrollOffset:l})=>{const e=o;return!await new Promise(p=>{d?p(!0):(s=p,setTimeout(()=>{s=null,p(!1)},r))})||!d?(d=null,{spring:n,tick:()=>{}}):(a=Et(d,e,l),a?(d=null,{spring:n,tick:p=>{a&&a.inAnimation(p)}}):{spring:n,tick:()=>{}})},out:async o=>({spring:n,onStart:()=>{d=o,s&&(s(!0),s=null)},prepare:l=>{b.prepareOutgoing(l),l.style.zIndex="-1"},tick:l=>{a&&a.outAnimation(l)}})}},I={stiffness:5,damping:4},Lt=(t={})=>{var o,l;const n=t.direction??"up",r={stiffness:((o=t.spring)==null?void 0:o.stiffness)??I.stiffness,damping:((l=t.spring)==null?void 0:l.damping)??I.damping},d=n==="up";let s=null,a=null,c=null;const i=()=>{if(s===null||a===null)return null;const e=Math.min(s,a),g=window.innerHeight;return Math.max(e,g)};return{in:e=>(a=e.offsetHeight,s!==null&&(c=i()),{spring:r,prepare:()=>{e.style.willChange="transform",e.style.backfaceVisibility="hidden",e.style.contain="layout paint"},tick:g=>{c===null&&(c=i());const p=c??window.innerHeight,u=d?(1-g)*p:(1-g)*-p;e.style.transform=`translate3d(0, ${u}px, 0)`},onEnd:()=>{e.style.willChange="auto",e.style.backfaceVisibility="",e.style.contain=""}}),out:(e,g)=>({spring:r,onStart:()=>{s=e.offsetHeight,a!==null&&(c=i())},tick:p=>{c===null&&(c=i());const u=c??window.innerHeight,y=d?(1-p)*-u:(1-p)*u;e.style.transform=`translate3d(0, ${y}px, 0)`},prepare:p=>{b.prepareOutgoing(p,g),p.style.zIndex=d?"-1":"1",p.style.willChange="transform",p.style.backfaceVisibility="hidden",p.style.contain="layout paint",p.style.pointerEvents="none"}})}},v={stiffness:15,damping:7},Ct=(t={})=>{var s,a;const n=t.direction??"left",r={stiffness:((s=t.spring)==null?void 0:s.stiffness)??v.stiffness,damping:((a=t.spring)==null?void 0:a.damping)??v.damping},d=n==="left";return{in:c=>({spring:r,prepare:()=>{c.style.willChange="transform",c.style.backfaceVisibility="hidden",c.style.contain="layout paint"},css:i=>({transform:`translate3d(${d?(1-i)*100:(1-i)*-100}%, 0, 0)`}),onEnd:()=>{c.style.willChange="auto",c.style.backfaceVisibility="",c.style.contain=""}}),out:(c,i)=>({spring:r,css:o=>({transform:`translate3d(${d?(1-o)*-100:(1-o)*100}%, 0, 0)`}),prepare:o=>{b.prepareOutgoing(o,i),o.style.willChange="transform",o.style.backfaceVisibility="hidden",o.style.contain="layout paint",o.style.pointerEvents="none"}})}},D={stiffness:17,damping:6},k=20,C=800,Tt=()=>{let t,n=null;return{in:r=>({spring:D,prepare:()=>{r.style.willChange="transform",r.style.backfaceVisibility="hidden",r.style.contain="layout paint",r.style.transform=`perspective(${C}px) rotateY(${k}deg) translate3d(-100%, 0, 0)`},wait:async()=>{t&&await t},css:d=>{const s=(1-d)*k,a=-(1-d)*100;return{transform:`perspective(${C}px) rotateY(${s}deg) translate3d(${a}%, 0, 0)`}},onEnd:()=>{r.style.transform="",r.style.willChange="auto",r.style.backfaceVisibility="",r.style.contain=""}}),out:(r,d)=>(t=new Promise(s=>{n=s}),{spring:D,prepare:s=>{b.prepareOutgoing(s,d),s.style.willChange="transform",s.style.backfaceVisibility="hidden",s.style.contain="layout paint",s.style.pointerEvents="none",s.style.transform=`perspective(${C}px) rotateY(0deg) translate3d(0%, 0, 0)`},css:s=>{const a=1-s,c=a*k,i=a*100;return{transform:`perspective(${C}px) rotateY(${-c}deg) translate3d(${i}%, 0, 0)`}},onEnd:()=>{n&&n(),r.style.transform=""}})}},kt={stiffness:1,damping:1},St={stiffness:20,damping:25},_t="#000000",Pt="circle",O="CURTAIN_REVEAL_OVERLAY_ID",It={position:"fixed",inset:"0",width:"100vw",height:"100%",zIndex:"9999",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"},vt={position:"relative",display:"inline-block",height:"5.5rem",overflow:"hidden"},Dt={display:"flex",height:"100%",willChange:"transform",transition:"transform 0.3s ease"},Ot={display:"inline-flex",alignItems:"center",justifyContent:"center",whiteSpace:"nowrap",fontSize:"5.5rem",fontWeight:"900",letterSpacing:"0.02em",color:"#FFFFFF"},Ft=.4,T=.5,Yt=.2;function Ut(t,n){switch(t){case"circle":return`circle(${n*100}% at 50% 50%)`;case"square":return`inset(${(1-n)*50}% round ${10*n}%)`;case"triangle":{const r=n*100;return`polygon(50% ${50-r}%, ${50-r}% ${50+r}%, ${50+r}% ${50+r}%)`}}}const Vt=t=>t.reduce((n,r)=>n+r,0),Wt=(t={})=>{const{background:n=_t,texts:r=[],shape:d=Pt,inSpring:s=St,outSpring:a=kt,textStyle:c={}}=t;return{out:(i,o)=>{const l=i.style.opacity;return{spring:a,from:1,to:0,prepare:e=>{b.prepareOutgoing(e,o),e.style.opacity="1"},tick:e=>{const g=Math.max(0,e-Ft);i.style.opacity=String(g)},onEnd:()=>{i.style.opacity=l}}},in:i=>{let o=null,l=null,e=null;const g=document.body.style.overflow,p=document.getElementById(O);let u=[];const y=()=>{o=document.createElement("div"),o.id=O,Object.assign(o.style,It,{background:n}),document.body.appendChild(o),l=document.createElement("div"),Object.assign(l.style,vt),o.appendChild(l),e=document.createElement("div"),Object.assign(e.style,Dt),l.appendChild(e),r.forEach(h=>{const f=document.createElement("div");f.textContent=h,Object.assign(f.style,Ot,c),e.appendChild(f)}),u=Array.from(e.children).map(h=>h.getBoundingClientRect().width)};return{spring:s,from:0,to:1,prepare:()=>{document.body.style.overflow="hidden",i.style.opacity="1",p==null||p.remove(),y(),o&&l&&(o.style.clipPath="none",l.style.transform="scale(1)")},tick:h=>{if(!(!o||!l||!e)){if(h<=T&&r.length>0){const f=h/T,$=Math.min(Math.floor(f*r.length),r.length-1),w=u[$]??0,x=Vt(u.slice(0,$));l.style.width=`${w}px`,e.style.transform=`translateX(-${x}px)`}if(h>T){const $=1-Math.max(0,Math.min(1,(h-T)/Yt));o.style.clipPath=Ut(d,$),l.style.transform=`scale(${$})`}}},onEnd:()=>{o==null||o.remove(),o=l=e=null,document.body.style.overflow=g}}}}};exports.jaemin=b.jaemin;exports.blind=J;exports.curtainReveal=Wt;exports.drill=tt;exports.fade=st;exports.film=ot;exports.hero=yt;exports.instagram=$t;exports.pinterest=At;exports.scroll=Lt;exports.slide=Ct;exports.strip=Tt;
|