@ssgoi/core 2.5.0 → 2.5.2

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.
@@ -0,0 +1,46 @@
1
+ import { SpringConfig, SpringItem } from './types';
2
+ import { Animator } from './animator';
3
+ /**
4
+ * Mock timer utilities for testing animations
5
+ */
6
+ export declare const mockTimers: {
7
+ setup: () => void;
8
+ cleanup: () => void;
9
+ advance: (ms: number) => void;
10
+ runAll: () => void;
11
+ };
12
+ /**
13
+ * Create a mock spring item for testing
14
+ */
15
+ export declare function createMockSpringItem(overrides?: Partial<SpringItem>): SpringItem;
16
+ /**
17
+ * Create a mock spring config
18
+ */
19
+ export declare function createMockSpringConfig(overrides?: Partial<SpringConfig>): SpringConfig;
20
+ /**
21
+ * Wait for all animators to complete
22
+ * Uses real timers and RAF polling
23
+ */
24
+ export declare function waitForAnimation(timeout?: number): Promise<void>;
25
+ /**
26
+ * Spy on console methods
27
+ */
28
+ export declare const consoleSpy: {
29
+ warn: () => import('vitest').MockInstance<{
30
+ (...data: any[]): void;
31
+ (message?: any, ...optionalParams: any[]): void;
32
+ }>;
33
+ error: () => import('vitest').MockInstance<{
34
+ (...data: any[]): void;
35
+ (message?: any, ...optionalParams: any[]): void;
36
+ }>;
37
+ log: () => import('vitest').MockInstance<{
38
+ (...data: any[]): void;
39
+ (message?: any, ...optionalParams: any[]): void;
40
+ }>;
41
+ };
42
+ /**
43
+ * Mock Animator for testing without real animation
44
+ */
45
+ export declare function createMockAnimator(): Animator;
46
+ //# sourceMappingURL=test-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-utils.d.ts","sourceRoot":"","sources":["../src/lib/test-utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC;;GAEG;AACH,eAAO,MAAM,UAAU;;;kBAQP,MAAM;;CAMrB,CAAC;AAEF;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,GAAE,OAAO,CAAC,UAAU,CAAM,GAClC,UAAU,CAWZ;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,GAAE,OAAO,CAAC,YAAY,CAAM,GACpC,YAAY,CAMd;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,SAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAcpE;AAED;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;CAItB,CAAC;AAEF;;GAEG;AACH,wBAAgB,kBAAkB,IAaF,QAAQ,CACvC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Ticker - Singleton requestAnimationFrame manager
3
+ * Prevents multiple RAF calls by batching all animation updates into a single loop
4
+ * Inspired by GSAP's ticker with mobile optimizations
5
+ */
6
+ type TickerCallback = (deltaTime: number, elapsed: number) => void;
7
+ declare class Ticker {
8
+ private listeners;
9
+ private rafId;
10
+ private isRunning;
11
+ private startTime;
12
+ private lastUpdate;
13
+ private elapsed;
14
+ private lagThreshold;
15
+ private adjustedLag;
16
+ private gap;
17
+ private nextTime;
18
+ private tick;
19
+ subscribe(callback: TickerCallback): () => void;
20
+ unsubscribe(callback: TickerCallback): void;
21
+ /**
22
+ * Configure lag smoothing behavior
23
+ * @param threshold - Time threshold to detect lag (default: 500ms)
24
+ * @param adjustedLag - Max time jump when lag detected (default: 33ms)
25
+ */
26
+ lagSmoothing(threshold: number, adjustedLag: number): void;
27
+ /**
28
+ * Set maximum FPS
29
+ * @param fps - Target FPS (default: 240)
30
+ */
31
+ fps(fps: number): void;
32
+ getListenerCount(): number;
33
+ getElapsed(): number;
34
+ }
35
+ export declare const ticker: Ticker;
36
+ export {};
37
+ //# sourceMappingURL=ticker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ticker.d.ts","sourceRoot":"","sources":["../src/lib/ticker.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,KAAK,cAAc,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;AAEnE,cAAM,MAAM;IACV,OAAO,CAAC,SAAS,CAA6B;IAC9C,OAAO,CAAC,KAAK,CAAuB;IACpC,OAAO,CAAC,SAAS,CAAS;IAG1B,OAAO,CAAC,SAAS,CAAc;IAC/B,OAAO,CAAC,UAAU,CAAkB;IACpC,OAAO,CAAC,OAAO,CAAK;IAGpB,OAAO,CAAC,YAAY,CAAO;IAC3B,OAAO,CAAC,WAAW,CAAM;IAGzB,OAAO,CAAC,GAAG,CAAc;IACzB,OAAO,CAAC,QAAQ,CAAY;IAE5B,OAAO,CAAC,IAAI,CAmCV;IAEF,SAAS,CAAC,QAAQ,EAAE,cAAc,GAAG,MAAM,IAAI;IAe/C,WAAW,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI;IAW3C;;;;OAIG;IACH,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI;IAK1D;;;OAGG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAKtB,gBAAgB,IAAI,MAAM;IAI1B,UAAU,IAAI,MAAM;CAGrB;AAGD,eAAO,MAAM,MAAM,QAAe,CAAC"}
@@ -1,9 +1,8 @@
1
- import { TransitionConfig } from './types';
2
- import { Animator } from './animator';
1
+ import { TransitionConfig, AnimationController } from './types';
3
2
  export declare const TRANSITION_STRATEGY: unique symbol;
4
3
  export interface StrategyContext<TAnimationValue = number> {
5
4
  currentAnimation: {
6
- animator: Animator<TAnimationValue>;
5
+ controller: AnimationController<TAnimationValue>;
7
6
  direction: "in" | "out";
8
7
  } | null;
9
8
  }
@@ -1 +1 @@
1
- {"version":3,"file":"transition-strategy.d.ts","sourceRoot":"","sources":["../src/lib/transition-strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM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D,KAAK,EAAE,CACL,OAAO,EAAE,iBAAiB,CAAC,eAAe,CAAC,KACxC,OAAO,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,CAAC;IAC9C,MAAM,EAAE,CACN,OAAO,EAAE,iBAAiB,CAAC,eAAe,CAAC,KACxC,OAAO,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,CAAC;CAC/C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,eAAO,MAAM,qBAAqB,GAAI,eAAe,GAAG,MAAM,EAC5D,SAAS,eAAe,CAAC,eAAe,CAAC,KACxC,kBAAkB,CAAC,eAAe,CAiMpC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,4BAA4B,GACvC,eAAe,GAAG,MAAM,OACrB,kBAAkB,CAAC,eAAe,CAoGtC,CAAC"}
package/dist/types.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function n(i){return"tick"in i&&!("springs"in i)}function r(i){return"springs"in i}exports.isMultiSpring=r;exports.isSingleSpring=n;
package/dist/types.d.ts CHANGED
@@ -3,16 +3,101 @@ export type SpringConfig = {
3
3
  stiffness?: number;
4
4
  damping?: number;
5
5
  };
6
- export type TransitionConfig<TAnimationValue = number> = {
6
+ /**
7
+ * Schedule strategy for multi-spring animations
8
+ * - overlap: All springs start immediately (parallel execution)
9
+ * - wait: Each spring waits for previous to complete (sequential)
10
+ * - chain: Springs start with offset delays
11
+ */
12
+ export type ScheduleType = "overlap" | "wait" | "chain";
13
+ /**
14
+ * Base configuration shared by both single and multi-spring transitions
15
+ */
16
+ export type BaseTransitionConfig = {
17
+ prepare?: (element: HTMLElement) => void;
18
+ wait?: () => Promise<void>;
19
+ onStart?: () => void;
20
+ onEnd?: () => void;
21
+ };
22
+ /**
23
+ * Single spring configuration (existing - backward compatible)
24
+ * Used for simple transitions with a single animation value
25
+ */
26
+ export type SingleSpringConfig<TAnimationValue = number> = BaseTransitionConfig & {
7
27
  spring?: SpringConfig;
8
28
  from?: TAnimationValue;
9
29
  to?: TAnimationValue;
10
30
  tick?: (progress: TAnimationValue) => void;
11
- prepare?: (element: HTMLElement) => void;
12
- wait?: () => Promise<void>;
31
+ };
32
+ /**
33
+ * Individual spring item in a multi-spring animation
34
+ */
35
+ export type SpringItem<TAnimationValue = number> = {
36
+ from?: TAnimationValue;
37
+ to?: TAnimationValue;
38
+ spring?: SpringConfig;
39
+ /**
40
+ * Frame callback - called on each animation frame with progress value
41
+ *
42
+ * **Performance Warning:** Use WRITE-ONLY operations for best performance.
43
+ * Avoid reading layout properties inside tick to prevent layout thrashing.
44
+ *
45
+ * Layout-triggering properties (causes forced synchronous layout):
46
+ * - element.offsetWidth, offsetHeight, offsetTop, offsetLeft
47
+ * - element.clientWidth, clientHeight
48
+ * - element.getBoundingClientRect()
49
+ * - element.scrollWidth, scrollHeight, scrollTop, scrollLeft
50
+ * - window.getComputedStyle(element)
51
+ *
52
+ * @example
53
+ * // ❌ Bad: Layout read in tick (causes thrashing)
54
+ * tick: (progress) => {
55
+ * const height = element.offsetHeight // READ - forces layout!
56
+ * element.style.height = height * progress
57
+ * }
58
+ *
59
+ * @example
60
+ * // ✅ Good: Read in prepare, write in tick
61
+ * prepare: (element) => {
62
+ * const height = element.offsetHeight // READ once before animation
63
+ * element.dataset.height = height.toString()
64
+ * },
65
+ * tick: (progress) => {
66
+ * const height = parseFloat(element.dataset.height)
67
+ * element.style.height = height * progress // WRITE only
68
+ * }
69
+ */
70
+ tick: (progress: TAnimationValue) => void;
13
71
  onStart?: () => void;
14
- onEnd?: () => void;
72
+ onComplete?: () => void;
73
+ /**
74
+ * Delay offset in milliseconds before this spring starts
75
+ * Only applies to 'chain' schedule mode
76
+ */
77
+ offset?: number;
15
78
  };
79
+ /**
80
+ * Multi-spring configuration (new feature)
81
+ * Used for complex transitions with multiple coordinated animations
82
+ */
83
+ export type MultiSpringConfig<TAnimationValue = number> = BaseTransitionConfig & {
84
+ springs: SpringItem<TAnimationValue>[];
85
+ schedule?: ScheduleType;
86
+ onProgress?: (completed: number, total: number) => void;
87
+ };
88
+ /**
89
+ * Transition configuration - supports both single and multi-spring animations
90
+ * Uses Union Type for type safety and backward compatibility
91
+ */
92
+ export type TransitionConfig<TAnimationValue = number> = SingleSpringConfig<TAnimationValue> | MultiSpringConfig<TAnimationValue>;
93
+ /**
94
+ * Type guard to check if config is single spring
95
+ */
96
+ export declare function isSingleSpring<T>(config: TransitionConfig<T>): config is SingleSpringConfig<T>;
97
+ /**
98
+ * Type guard to check if config is multi-spring
99
+ */
100
+ export declare function isMultiSpring<T>(config: TransitionConfig<T>): config is MultiSpringConfig<T>;
16
101
  export type GetTransitionConfig<TContext = undefined, TAnimationValue = number> = TContext extends undefined ? (node: HTMLElement) => TransitionConfig<TAnimationValue> | Promise<TransitionConfig<TAnimationValue>> : (node: HTMLElement, context: TContext) => TransitionConfig<TAnimationValue> | Promise<TransitionConfig<TAnimationValue>>;
17
102
  export type Transition<TContext = undefined, TAnimationValue = number> = {
18
103
  in?: GetTransitionConfig<TContext, TAnimationValue>;
@@ -84,4 +169,73 @@ export type SsgoiConfig = {
84
169
  export type SsgoiContext = (path: string) => Transition & {
85
170
  key: TransitionKey;
86
171
  };
172
+ /**
173
+ * Normalized schedule entry for internal processing (discriminated union)
174
+ * Used by AnimationScheduler to unify different schedule strategies
175
+ * @internal
176
+ */
177
+ export type NormalizedScheduleEntry = OffsetScheduleEntry | WaitScheduleEntry;
178
+ /**
179
+ * Offset-based schedule entry (overlap/chain modes)
180
+ * - delay=0: immediate start (overlap)
181
+ * - delay>0: delayed start with fixed timing (chain)
182
+ * @internal
183
+ */
184
+ export type OffsetScheduleEntry = {
185
+ type: "offset";
186
+ id: string;
187
+ delay: number;
188
+ };
189
+ /**
190
+ * Wait-based schedule entry (wait mode)
191
+ * Dynamic dependency - starts after previous spring completes
192
+ * @internal
193
+ */
194
+ export type WaitScheduleEntry = {
195
+ type: "wait";
196
+ id: string;
197
+ };
198
+ /**
199
+ * Animation state (discriminated union)
200
+ * Different return types for single vs multi-spring animations
201
+ * @internal
202
+ */
203
+ export type AnimationState<T = number> = SingleAnimationState<T> | MultiAnimationState;
204
+ /**
205
+ * Single spring animation state
206
+ * Supports both number and object animations
207
+ * @internal
208
+ */
209
+ export type SingleAnimationState<T = number> = {
210
+ type: "single";
211
+ position: T;
212
+ velocity: T extends number ? number : Record<string, number>;
213
+ from: T;
214
+ to: T;
215
+ };
216
+ /**
217
+ * Multi-spring animation state
218
+ * Always uses number for progress tracking
219
+ * @internal
220
+ */
221
+ export type MultiAnimationState = {
222
+ type: "multi";
223
+ completed: number;
224
+ total: number;
225
+ direction: "forward" | "backward";
226
+ };
227
+ /**
228
+ * Common interface for animation controllers
229
+ * Implemented by both Animator (single spring) and AnimationScheduler (multi-spring)
230
+ * @internal
231
+ */
232
+ export interface AnimationController<T = number> {
233
+ forward(): void;
234
+ backward(): void;
235
+ stop(): void;
236
+ reverse(options?: {
237
+ offsetMode?: "immediate" | "mirror" | "reverse";
238
+ }): void;
239
+ getCurrentState(): AnimationState<T>;
240
+ }
87
241
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/lib/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,CAAC;AAE5C,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,gBAAgB,CAAC,eAAe,GAAG,MAAM,IAAI;IAEvD,MAAM,CAAC,EAAE,YAAY,CAAC;IAGtB,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,EAAE,CAAC,EAAE,eAAe,CAAC;IAGrB,IAAI,CAAC,EAAE,CAAC,QAAQ,EAAE,eAAe,KAAK,IAAI,CAAC;IAG3C,OAAO,CA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AAC;CACtC"}
package/dist/types.js CHANGED
@@ -1 +1,10 @@
1
-
1
+ function n(i) {
2
+ return "tick" in i && !("springs" in i);
3
+ }
4
+ function r(i) {
5
+ return "springs" in i;
6
+ }
7
+ export {
8
+ r as isMultiSpring,
9
+ n as isSingleSpring
10
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"blind.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/blind.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAU9D,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,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,KAAK,GAAI,UAAS,YAAiB,KAAG,eAmNlD,CAAC"}
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,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,KAAK,GAAI,UAAS,YAAiB,KAAG,eA8LlD,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { SggoiTransition, SpringConfig } from '../types';
2
+ type CurtainShape = "circle" | "square" | "triangle";
3
+ interface CurtainRevealOptions {
4
+ /** Background style.
5
+ *
6
+ * Supports both:
7
+ * - Solid colors (e.g., `"#000000"`, `"rgb(255, 0, 0)"`)
8
+ * - CSS gradients (e.g., `"linear-gradient(to right, #000, #fff)"`)
9
+ */
10
+ background?: string;
11
+ texts?: string[];
12
+ shape?: CurtainShape;
13
+ inSpring?: SpringConfig;
14
+ outSpring?: SpringConfig;
15
+ textStyle?: Partial<CSSStyleDeclaration>;
16
+ }
17
+ export declare const curtainReveal: (options?: CurtainRevealOptions) => SggoiTransition;
18
+ export {};
19
+ //# sourceMappingURL=curtain-reveal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"curtain-reveal.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/curtain-reveal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAiD9D,KAAK,YAAY,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAC;AAErD,UAAU,oBAAoB;IAC5B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,SAAS,CAAC,EAAE,YAAY,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAC1C;AAmBD,eAAO,MAAM,aAAa,GACxB,UAAS,oBAAyB,KACjC,eA0HF,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,EAAE,MAAM,UAAU,CAAC;AAQ9D,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,eAmDhD,CAAC"}
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;AAQ9D,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,eAuDhD,CAAC"}
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("../jaemin-DL1-g_B5.cjs"),H=t=>new Promise(e=>setTimeout(e,t)),N={stiffness:80,damping:25},B={stiffness:75,damping:25},G=300,M=10,q="horizontal",V="#000000",j=(t={})=>{const{inSpring:e=B,outSpring:o=N,transitionDelay:a=G,blindCount:i=M,direction:s=q,staggerDelay:r=100,blindColor:n=V}=t;let l,p=null;const d=(y,h,c,g=!1)=>{const f=Math.min(.5,r*c/1e3),$=1-f,x=(g?c-1-h:h)/c*f,w=x+$;return y<=x?0:y>=w?1:(y-x)/$},u=(y,h,c="left")=>{window.getComputedStyle(y).position==="static"&&(y.style.position="relative");const f=document.createElement("div");f.className="blind-container",f.style.cssText=`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("../jaemin-DL1-g_B5.cjs"),B=t=>new Promise(e=>setTimeout(e,t)),M={stiffness:80,damping:25},G={stiffness:75,damping:25},V=300,j=10,q="horizontal",K="#000000",Z=(t={})=>{const{inSpring:e=G,outSpring:r=M,transitionDelay:c=V,blindCount:s=j,direction:o=q,staggerDelay:l=100,blindColor:n=K}=t;let i,d=null;const a=(p,g,y="left")=>{window.getComputedStyle(p).position==="static"&&(p.style.position="relative");const h=document.createElement("div");h.className="blind-container",h.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 $=[];for(let m=0;m<i;m++){const x=document.createElement("div");if(s==="horizontal"){const w=100/i,A=`calc(${w}% + 1px)`;x.style.cssText=`
10
+ `;const f=[];for(let $=0;$<s;$++){const m=document.createElement("div");if(o==="horizontal"){const x=100/s,T=`calc(${x}% + 1px)`;m.style.cssText=`
11
11
  position: absolute;
12
- top: ${w*m}%;
12
+ top: ${x*$}%;
13
13
  left: 0;
14
14
  width: 100%;
15
- height: ${A};
15
+ height: ${T};
16
16
  background: ${n};
17
- transform: scaleX(${h==="hidden"?0:1});
18
- transform-origin: ${c} center;
17
+ transform: scaleX(${g==="hidden"?0:1});
18
+ transform-origin: ${y} center;
19
19
  will-change: transform;
20
- `}else{const w=100/i,A=`calc(${w}% + 1px)`;x.style.cssText=`
20
+ `}else{const x=100/s,T=`calc(${x}% + 1px)`;m.style.cssText=`
21
21
  position: absolute;
22
22
  top: 0;
23
- left: ${w*m}%;
24
- width: ${A};
23
+ left: ${x*$}%;
24
+ width: ${T};
25
25
  height: 100%;
26
26
  background: ${n};
27
- transform: scaleY(${h==="hidden"?0:1});
28
- transform-origin: ${c==="left"?"top":"bottom"} center;
27
+ transform: scaleY(${g==="hidden"?0:1});
28
+ transform-origin: ${y==="left"?"top":"bottom"} center;
29
29
  will-change: transform;
30
- `}$.push(x),f.appendChild(x)}return y.appendChild(f),{container:f,blinds:$}};return{out:()=>{let y=null;return l=new Promise(h=>{p=h}),{spring:o,prepare:h=>{b.prepareOutgoing(h),h.style.zIndex="1000",y=u(h,"hidden","left")},onStart:()=>{},tick:h=>{if(!y)return;const c=1-h;y.blinds.forEach((g,f)=>{const $=d(c,f,i,!1);s==="horizontal"?g.style.transform=`scaleX(${$})`:g.style.transform=`scaleY(${$})`})},onEnd:()=>{p&&p()}}},in:()=>{let y=null;return{spring:e,prepare:h=>{h.style.position="relative",h.style.zIndex="0",y=u(h,"closed","right")},onStart:()=>{},wait:async()=>{l&&await l,await H(a)},tick:h=>{y&&y.blinds.forEach((c,g)=>{const f=d(h,g,i,!1);s==="horizontal"?c.style.transform=`scaleX(${1-f})`:c.style.transform=`scaleY(${1-f})`})},onEnd:()=>{y&&y.container&&y.container.remove()}}}}},Z=(t={})=>{var i,s;const{opacity:e=!1,direction:o="enter"}=t,a={stiffness:((i=t.spring)==null?void 0:i.stiffness)??150,damping:((s=t.spring)==null?void 0:s.damping)??20};return o==="enter"?{in:r=>({spring:a,tick:n=>{r.style.transform=`translateX(${(1-n)*100}%)`,e&&(r.style.opacity=n.toString())}}),out:(r,n)=>({spring:a,prepare:l=>{b.prepareOutgoing(l,n),l.style.zIndex="-1"},tick:l=>{r.style.transform=`translateX(${-(1-l)*20}%)`,e&&(r.style.opacity=l.toString())}})}:{in:r=>({spring:{stiffness:100,damping:20},tick:n=>{r.style.transform=`translateX(${-(1-n)*20}%)`,e&&(r.style.opacity=n.toString())}}),out:(r,n)=>({spring:{stiffness:100,damping:20},prepare:l=>{b.prepareOutgoing(l,n),l.style.zIndex="100"},tick:l=>{r.style.transform=`translateX(${(1-l)*100}%)`,e&&(r.style.opacity=l.toString())}})}},J=t=>new Promise(e=>setTimeout(e,t)),K={stiffness:400,damping:20},Q={stiffness:40,damping:8},R=100,tt=(t={})=>{const{inSpring:e=Q,outSpring:o=K,transitionDelay:a=R}=t;let i,s=null;return{in:r=>({spring:e,prepare:n=>{n.style.opacity="0"},wait:async()=>{i&&(await i,await J(a))},tick:n=>{r.style.opacity=n.toString()}}),out:(r,n)=>(i=new Promise(l=>{s=l}),{spring:o,tick:l=>{r.style.opacity=l.toString()},prepare:l=>b.prepareOutgoing(l,n),onEnd:()=>{s&&s()}})}},et={stiffness:5,damping:3.5},nt=.8,it="white",E={start:0,end:.45},L={start:.85,end:1},T={start:.2,end:.9},st=t=>{var i;const e=(t==null?void 0:t.spring)??et,o=(t==null?void 0:t.scale)??nt,a=((i=t==null?void 0:t.border)==null?void 0:i.color)??it;return{out:async(s,r)=>{const n=P(r),l=b.getRect(document.body,r.positionedParent),p=lt(a,{...n,top:l.top});let d=1,u=-n.top;return{spring:e,prepare:()=>{b.prepareOutgoing(s),I(s,n),v(s,n),ot(s,n);for(const y of p)r.positionedParent.appendChild(y)},onEnd:()=>{s.style.clipPath="",s.style.transformOrigin="",setTimeout(()=>{for(const y of p)r.positionedParent.removeChild(y)},1e3)},tick:y=>{const h=1-y;if(E.start<=h&&h<=E.end){const f=k(h,E.start,E.end);d=1-(1-o)*f}if(L.start<=h&&h<=L.end){const f=k(h,L.start,L.end);d=o+(1-o)*f}if(T.start<=h&&h<=T.end){const f=k(h,T.start,T.end);u=-n.top-n.height*f}s.style.transform=`translateY(${u}px) scale(${d})`;const c=(n.width-n.width*d)/2,g=(n.height-n.height*d)/2;rt(p,c,g)}}},in:async(s,r)=>{const n=P(r);let l=o,p=-n.top+n.height;return{spring:e,prepare:()=>{I(s,n),v(s,n),s.style.transform=`translateY(${-n.top+n.height}px) scale(${o})`},onEnd:()=>{s.style.clipPath="",s.style.transformOrigin="",s.style.transform=""},tick:d=>{if(E.start<=d&&d<=E.end){const u=k(d,E.start,E.end);l=1-(1-o)*u}if(L.start<=d&&d<=L.end){const u=k(d,L.start,L.end);l=o+(1-o)*u}if(T.start<=d&&d<=T.end){const u=k(d,T.start,T.end);p=-n.top+n.height*(1-u)}s.style.transform=`translateY(${p}px) scale(${l})`}}}}};function rt(t,e,o){const a=e*.7,i=o*.7;t.topLeft.style.transform=`translate(${a}px, ${i}px)`,t.topRight.style.transform=`translate(${-a}px, ${i}px)`,t.bottomLeft.style.transform=`translate(${a}px, ${-i}px)`,t.bottomRight.style.transform=`translate(${-a}px, ${-i}px)`}function lt(t="white",e){const i=document.createElement("div");i.style.position="fixed",i.style.pointerEvents="none",i.style.zIndex="9999",i.style.top=`${e.top-1}px`,i.style.left=`${e.left-1}px`,i.style.width="15px",i.style.height="15px";const s=document.createElement("div");s.style.position="absolute",s.style.width="15px",s.style.height="1px",s.style.backgroundColor=t,s.style.top="0",s.style.left="0";const r=document.createElement("div");r.style.position="absolute",r.style.width="1px",r.style.height="15px",r.style.backgroundColor=t,r.style.top="0",r.style.left="0",i.appendChild(s),i.appendChild(r);const n=document.createElement("div");n.style.position="fixed",n.style.pointerEvents="none",n.style.zIndex="9999",n.style.top=`${e.top-1}px`,n.style.left=`${e.left+e.width-15+1}px`,n.style.width="15px",n.style.height="15px";const l=document.createElement("div");l.style.position="absolute",l.style.width="15px",l.style.height="1px",l.style.backgroundColor=t,l.style.top="0",l.style.right="0";const p=document.createElement("div");p.style.position="absolute",p.style.width="1px",p.style.height="15px",p.style.backgroundColor=t,p.style.top="0",p.style.right="0",n.appendChild(l),n.appendChild(p);const d=document.createElement("div");d.style.position="fixed",d.style.pointerEvents="none",d.style.zIndex="9999",d.style.top=`${e.top+e.height-15+1}px`,d.style.left=`${e.left-1}px`,d.style.width="15px",d.style.height="15px";const u=document.createElement("div");u.style.position="absolute",u.style.width="15px",u.style.height="1px",u.style.backgroundColor=t,u.style.bottom="0",u.style.left="0";const y=document.createElement("div");y.style.position="absolute",y.style.width="1px",y.style.height="15px",y.style.backgroundColor=t,y.style.bottom="0",y.style.left="0",d.appendChild(u),d.appendChild(y);const h=document.createElement("div");h.style.position="fixed",h.style.pointerEvents="none",h.style.zIndex="9999",h.style.top=`${e.top+e.height-15+1}px`,h.style.left=`${e.left+e.width-15+1}px`,h.style.width="15px",h.style.height="15px";const c=document.createElement("div");c.style.position="absolute",c.style.width="15px",c.style.height="1px",c.style.backgroundColor=t,c.style.bottom="0",c.style.right="0";const g=document.createElement("div");return g.style.position="absolute",g.style.width="1px",g.style.height="15px",g.style.backgroundColor=t,g.style.bottom="0",g.style.right="0",h.appendChild(c),h.appendChild(g),{topLeft:i,topRight:n,bottomLeft:d,bottomRight:h,*[Symbol.iterator](){yield i,yield n,yield d,yield h}}}function P(t){const e=b.getRect(document.body,t.positionedParent);return{top:t.scroll.y,left:0,width:e.width,height:window.innerHeight-e.top}}function I(t,e){const o=e.left+e.width/2,a=e.top+e.height/2;t.style.transformOrigin=`${o}px ${a}px`}function v(t,e){t.style.clipPath=`polygon(
30
+ `}f.push(m),h.appendChild(m)}return p.appendChild(h),{container:h,blinds:f}};return{out:()=>{let p=null;return i=new Promise(y=>{d=y}),{springs:Array.from({length:s},(y,u)=>({from:0,to:1,spring:r,offset:u*l,tick:h=>{if(!p)return;const f=p.blinds[u];f&&(o==="horizontal"?f.style.transform=`scaleX(${h})`:f.style.transform=`scaleY(${h})`)}})),schedule:"chain",prepare:y=>{b.prepareOutgoing(y),y.style.zIndex="1000",p=a(y,"hidden","left")},onStart:()=>{},onEnd:()=>{d&&d()}}},in:()=>{let p=null;return{springs:Array.from({length:s},(y,u)=>({from:1,to:0,spring:e,offset:u*l,tick:h=>{if(!p)return;const f=p.blinds[u];f&&(o==="horizontal"?f.style.transform=`scaleX(${h})`:f.style.transform=`scaleY(${h})`)}})),schedule:"chain",prepare:y=>{y.style.position="relative",y.style.zIndex="0",p=a(y,"closed","right")},onStart:()=>{},wait:async()=>{i&&await i,await B(c)},onEnd:()=>{p&&p.container&&p.container.remove()}}}}},J=(t={})=>{var s,o;const{opacity:e=!1,direction:r="enter"}=t,c={stiffness:((s=t.spring)==null?void 0:s.stiffness)??150,damping:((o=t.spring)==null?void 0:o.damping)??20};return r==="enter"?{in:l=>({spring:c,tick:n=>{l.style.transform=`translateX(${(1-n)*100}%)`,e&&(l.style.opacity=n.toString())}}),out:(l,n)=>({spring:c,prepare:i=>{b.prepareOutgoing(i,n),i.style.zIndex="-1"},tick:i=>{l.style.transform=`translateX(${-(1-i)*20}%)`,e&&(l.style.opacity=i.toString())}})}:{in:l=>({spring:{stiffness:100,damping:20},tick:n=>{l.style.transform=`translateX(${-(1-n)*20}%)`,e&&(l.style.opacity=n.toString())}}),out:(l,n)=>({spring:{stiffness:100,damping:20},prepare:i=>{b.prepareOutgoing(i,n),i.style.zIndex="100"},tick:i=>{l.style.transform=`translateX(${(1-i)*100}%)`,e&&(l.style.opacity=i.toString())}})}},Q=t=>new Promise(e=>setTimeout(e,t)),R={stiffness:7,damping:4},tt={stiffness:8,damping:4},et=0,nt=(t={})=>{const{inSpring:e=tt,outSpring:r=R,transitionDelay:c=et}=t;let s,o=null;return{in:l=>({spring:e,prepare:n=>{n.style.opacity="0",n.style.willChange="opacity"},wait:async()=>{s&&(await s,await Q(c))},tick:n=>{l.style.opacity=n.toString()}}),out:(l,n)=>(s=new Promise(i=>{o=i}),{spring:r,tick:i=>{l.style.opacity=i.toString()},prepare:i=>{b.prepareOutgoing(i,n),i.style.willChange="opacity"},onEnd:()=>{o&&o()}})}},it={stiffness:5,damping:3.5},st=.8,rt="white",w={start:0,end:.45},E={start:.85,end:1},L={start:.2,end:.9},ot=t=>{var s;const e=(t==null?void 0:t.spring)??it,r=(t==null?void 0:t.scale)??st,c=((s=t==null?void 0:t.border)==null?void 0:s.color)??rt;return{out:async(o,l)=>{const n=P(l),i=b.getRect(document.body,l.positionedParent),d=at(c,{...n,top:i.top});let a=1,p=-n.top;return{spring:e,prepare:()=>{b.prepareOutgoing(o),k(o,n),I(o,n),dt(o,n);for(const g of d)l.positionedParent.appendChild(g)},onEnd:()=>{o.style.clipPath="",o.style.transformOrigin="",setTimeout(()=>{for(const g of d)l.positionedParent.removeChild(g)},1e3)},tick:g=>{const y=1-g;if(w.start<=y&&y<=w.end){const f=A(y,w.start,w.end);a=1-(1-r)*f}if(E.start<=y&&y<=E.end){const f=A(y,E.start,E.end);a=r+(1-r)*f}if(L.start<=y&&y<=L.end){const f=A(y,L.start,L.end);p=-n.top-n.height*f}o.style.transform=`translateY(${p}px) scale(${a})`;const u=(n.width-n.width*a)/2,h=(n.height-n.height*a)/2;lt(d,u,h)}}},in:async(o,l)=>{const n=P(l);let i=r,d=-n.top+n.height;return{spring:e,prepare:()=>{k(o,n),I(o,n),o.style.transform=`translateY(${-n.top+n.height}px) scale(${r})`},onEnd:()=>{o.style.clipPath="",o.style.transformOrigin="",o.style.transform=""},tick:a=>{if(w.start<=a&&a<=w.end){const p=A(a,w.start,w.end);i=1-(1-r)*p}if(E.start<=a&&a<=E.end){const p=A(a,E.start,E.end);i=r+(1-r)*p}if(L.start<=a&&a<=L.end){const p=A(a,L.start,L.end);d=-n.top+n.height*(1-p)}o.style.transform=`translateY(${d}px) scale(${i})`}}}}};function lt(t,e,r){const c=e*.7,s=r*.7;t.topLeft.style.transform=`translate(${c}px, ${s}px)`,t.topRight.style.transform=`translate(${-c}px, ${s}px)`,t.bottomLeft.style.transform=`translate(${c}px, ${-s}px)`,t.bottomRight.style.transform=`translate(${-c}px, ${-s}px)`}function at(t="white",e){const s=document.createElement("div");s.style.position="fixed",s.style.pointerEvents="none",s.style.zIndex="9999",s.style.top=`${e.top-1}px`,s.style.left=`${e.left-1}px`,s.style.width="15px",s.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.left="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.left="0",s.appendChild(o),s.appendChild(l);const n=document.createElement("div");n.style.position="fixed",n.style.pointerEvents="none",n.style.zIndex="9999",n.style.top=`${e.top-1}px`,n.style.left=`${e.left+e.width-15+1}px`,n.style.width="15px",n.style.height="15px";const i=document.createElement("div");i.style.position="absolute",i.style.width="15px",i.style.height="1px",i.style.backgroundColor=t,i.style.top="0",i.style.right="0";const d=document.createElement("div");d.style.position="absolute",d.style.width="1px",d.style.height="15px",d.style.backgroundColor=t,d.style.top="0",d.style.right="0",n.appendChild(i),n.appendChild(d);const a=document.createElement("div");a.style.position="fixed",a.style.pointerEvents="none",a.style.zIndex="9999",a.style.top=`${e.top+e.height-15+1}px`,a.style.left=`${e.left-1}px`,a.style.width="15px",a.style.height="15px";const p=document.createElement("div");p.style.position="absolute",p.style.width="15px",p.style.height="1px",p.style.backgroundColor=t,p.style.bottom="0",p.style.left="0";const g=document.createElement("div");g.style.position="absolute",g.style.width="1px",g.style.height="15px",g.style.backgroundColor=t,g.style.bottom="0",g.style.left="0",a.appendChild(p),a.appendChild(g);const y=document.createElement("div");y.style.position="fixed",y.style.pointerEvents="none",y.style.zIndex="9999",y.style.top=`${e.top+e.height-15+1}px`,y.style.left=`${e.left+e.width-15+1}px`,y.style.width="15px",y.style.height="15px";const u=document.createElement("div");u.style.position="absolute",u.style.width="15px",u.style.height="1px",u.style.backgroundColor=t,u.style.bottom="0",u.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",y.appendChild(u),y.appendChild(h),{topLeft:s,topRight:n,bottomLeft:a,bottomRight:y,*[Symbol.iterator](){yield s,yield n,yield a,yield y}}}function P(t){const e=b.getRect(document.body,t.positionedParent);return{top:t.scroll.y,left:0,width:e.width,height:window.innerHeight-e.top}}function k(t,e){const r=e.left+e.width/2,c=e.top+e.height/2;t.style.transformOrigin=`${r}px ${c}px`}function I(t,e){t.style.clipPath=`polygon(
31
31
  ${e.left}px ${e.top}px,
32
32
  ${e.left+e.width}px ${e.top}px,
33
33
  ${e.left+e.width}px ${e.top+e.height}px,
34
34
  ${e.left}px ${e.top+e.height}px
35
- )`}function ot(t,e){t.style.transform=`translateY(${-e.top}px)`}function k(t,e,o){return t<=e?0:t>=o?1:(t-e)/(o-e)}function at(t,e){return t.querySelector(`[data-hero-key="${e}"]`)}const dt=(t={})=>{var r,n;const e={stiffness:((r=t.spring)==null?void 0:r.stiffness)??300,damping:((n=t.spring)==null?void 0:n.damping)??30},o=t.timeout??300,a=t.maxDistance??700;let i=null,s=null;return{in:async(l,p)=>{const d=l,u=Array.from(d.querySelectorAll("[data-hero-key]"));if(u.length===0)return{spring:e,tick:()=>{}};if(!await new Promise(c=>{i?c(!0):(s=c,setTimeout(()=>{s=null,c(!1)},o))})||!i)return i=null,{spring:e,tick:()=>{}};const h=u.map(c=>{const g=c.getAttribute("data-hero-key");if(!g)return null;const f=at(i,g);if(!f)return null;const $=c,m=b.getRect(i,f),x=b.getRect(d,$),w=m.left-x.left-p.scrollOffset.x,A=m.top-x.top-p.scrollOffset.y,_=m.width/x.width,F=m.height/x.height,X=$.style.transform,U=$.style.position,W=$.style.transformOrigin,z=$.style.zIndex;return{toEl:$,dx:w,dy:A,dw:_,dh:F,originalTransform:X,originalPosition:U,originalTransformOrigin:W,originalZIndex:z}}).filter(c=>c!==null&&Math.abs(c.dy)<=a);return i=null,h.length===0?{spring:e,tick:()=>{}}:{spring:e,prepare:()=>{h.forEach(({toEl:c})=>{c.style.position="relative",c.style.transformOrigin="top left",c.style.zIndex="1000"})},tick:c=>{h.forEach(({toEl:g,dx:f,dy:$,dw:m,dh:x})=>{g.style.transform=`translate(${(1-c)*f}px,${(1-c)*$}px) scale(${c+(1-c)*m}, ${c+(1-c)*x})`})},onEnd:()=>{h.forEach(({toEl:c,originalTransform:g,originalPosition:f,originalTransformOrigin:$,originalZIndex:m})=>{c.style.transform=g,c.style.position=f,c.style.transformOrigin=$,c.style.zIndex=m})}}},out:async l=>({onStart:()=>{i=l,s&&(s(!0),s=null)},prepare:p=>{b.prepareOutgoing(p),p.style.opacity="0"}})}};function ct({detailRect:t,galleryRect:e,pageRect:o,scrollOffset:a},i){const s=e.left-t.left+(e.width-t.width)/2-a.x,r=e.top-t.top+(e.height-t.height)/2-a.y,n=e.width/t.width,l=e.height/t.height,p=Math.max(n,l),d=t.top/o.height*100,u=(o.width-(t.left+t.width))/o.width*100,y=(o.height-(t.top+t.height))/o.height*100,h=t.left/o.width*100;return i.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`,c=>{const g=1-c,f=d*g,$=u*g,m=y*g,x=h*g;i.style.clipPath=`inset(${f}% ${$}% ${m}% ${x}%)`,i.style.transform=`translate(${s*g}px, ${r*g}px) scale(${1+(p-1)*g})`}}function pt({galleryRect:t,detailRect:e,scrollOffset:o},a){const i=e.left-t.left+(e.width-t.width)/2+o.x,s=e.top-t.top+(e.height-t.height)/2+o.y,r=e.width/t.width,n=e.height/t.height,l=Math.max(r,n);return p=>{a.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`;const d=1-p;a.style.transform=`translate(${i*d-o.x}px, ${s*d-o.y}px) scale(${1+(l-1)*d})`,a.style.opacity=`${1-d}`}}function ht({galleryRect:t,detailRect:e,scrollOffset:o},a){const i=e.left-t.left+(e.width-t.width)/2-o.x,s=e.top-t.top+(e.height-t.height)/2-o.y,r=e.width/t.width,n=e.height/t.height,l=Math.max(r,n);return p=>{const d=1-p,u=p;a.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`,a.style.transform=`translate(${i*d}px, ${s*d}px) scale(${1+(l-1)*d})`,a.style.opacity=`${u}`}}function yt({detailRect:t,galleryRect:e,pageRect:o,scrollOffset:a},i){const s=e.left-t.left+(e.width-t.width)/2+a.x,r=e.top-t.top+(e.height-t.height)/2+a.y,n=e.width/t.width,l=e.height/t.height,p=Math.min(n,l),d=t.top/o.height*100,u=(o.width-(t.left+t.width))/o.width*100,y=(o.height-(t.top+t.height))/o.height*100,h=t.left/o.width*100;return i.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`,c=>{const g=1-c,f=d*g,$=u*g,m=y*g,x=h*g;i.style.clipPath=`inset(${f}% ${$}% ${m}% ${x}%)`,i.style.transform=`translate(${s*g-a.x}px, ${r*g-a.y}px) scale(${1+(p-1)*g})`}}function ut(t,e,o){const a=t.querySelector("[data-pinterest-detail-key]"),i=e.querySelector("[data-pinterest-detail-key]");if(t.querySelectorAll("[data-pinterest-detail-key]").length>1||e.querySelectorAll("[data-pinterest-detail-key]").length>1)return null;let s=null,r=null,n=!1;if(!a&&i){r=i;const u=r.getAttribute("data-pinterest-detail-key");if(!u)return null;s=t.querySelector(`[data-pinterest-gallery-key="${u}"]`),s&&(n=!0)}else if(a&&!i){r=a;const u=r.getAttribute("data-pinterest-detail-key");if(!u)return null;s=e.querySelector(`[data-pinterest-gallery-key="${u}"]`),s&&(n=!1)}if(!s||!r)return null;const l=b.getRect(n?t:e,s),p=b.getRect(n?e:t,r),d=e.getBoundingClientRect();return n?{inAnimation:ct({detailRect:p,galleryRect:l,pageRect:d,scrollOffset:o},e),outAnimation:pt({galleryRect:l,detailRect:p,scrollOffset:o},t)}:{inAnimation:ht({galleryRect:l,detailRect:p,scrollOffset:o},e),outAnimation:yt({detailRect:p,galleryRect:l,pageRect:d,scrollOffset:o},t)}}const gt=(t={})=>{var r,n;const e={stiffness:((r=t.spring)==null?void 0:r.stiffness)??50,damping:((n=t.spring)==null?void 0:n.damping)??10},o=t.timeout??300;let a=null,i=null,s=null;return{in:async(l,{scrollOffset:p})=>{const d=l;return!await new Promise(y=>{a?y(!0):(i=y,setTimeout(()=>{i=null,y(!1)},o))})||!a?(a=null,{spring:e,tick:()=>{}}):(s=ut(a,d,p),s?(a=null,{spring:e,tick:y=>{s&&s.inAnimation(y)}}):{spring:e,tick:()=>{}})},out:async l=>({spring:e,onStart:()=>{a=l,i&&(i(!0),i=null)},prepare:p=>{b.prepareOutgoing(p),p.style.zIndex="-1"},tick:p=>{s&&s.outAnimation(p)}})}},D={stiffness:30,damping:7},ft=(t={})=>{var l,p;const e=t.direction??"up",o={stiffness:((l=t.spring)==null?void 0:l.stiffness)??D.stiffness,damping:((p=t.spring)==null?void 0:p.damping)??D.damping},a=e==="up";let i=null,s=null,r=null;const n=()=>{if(i===null||s===null)return null;const d=Math.min(i,s),u=window.innerHeight;return Math.max(d,u)};return{in:d=>(s=d.offsetHeight,i!==null&&(r=n()),{spring:o,tick:u=>{if(r===null&&(r=n(),r===null))return;const y=a?(1-u)*r:(1-u)*-r;d.style.transform=`translateY(${y}px)`}}),out:d=>({spring:o,onStart:()=>{i=d.offsetHeight,s!==null&&(r=n())},tick:u=>{if(r===null&&(r=n(),r===null))return;const y=a?(1-u)*-r:(1-u)*r;d.style.transform=`translateY(${y}px)`},prepare:u=>{b.prepareOutgoing(u),u.style.zIndex=a?"-1":"1"}})}},O={stiffness:30,damping:7},$t=(t={})=>{var i,s;const e=t.direction??"left",o={stiffness:((i=t.spring)==null?void 0:i.stiffness)??O.stiffness,damping:((s=t.spring)==null?void 0:s.damping)??O.damping},a=e==="left";return{in:r=>({spring:o,tick:n=>{const l=a?(1-n)*100:(1-n)*-100;r.style.transform=`translateX(${l}%)`}}),out:(r,n)=>({spring:o,tick:l=>{const p=a?(1-l)*-100:(1-l)*100;r.style.transform=`translateX(${p}%)`},prepare:l=>{b.prepareOutgoing(l,n),l.style.zIndex=a?"-1":"1"}})}},Y={stiffness:300,damping:30},S=20,C=800,xt=()=>{let t,e=null;return{in:o=>({spring:Y,prepare:a=>{a.style.transform=`perspective(${C}px) rotateY(${S}deg) translateX(-100%)`},wait:async()=>{t&&await t},tick:a=>{const i=(1-a)*S,s=-(1-a)*100;o.style.transform=`perspective(${C}px) rotateY(${i}deg) translateX(${s}%)`},onEnd:()=>{o.style.transform=""}}),out:(o,a)=>(t=new Promise(i=>{e=i}),{spring:Y,prepare:i=>{b.prepareOutgoing(i,a)},tick:i=>{const s=1-i,r=s*S,n=s*100;o.style.transform=`perspective(${C}px) rotateY(${-r}deg) translateX(${n}%)`},onEnd:()=>{e&&e(),o.style.transform=""}})}};exports.jaemin=b.jaemin;exports.blind=j;exports.drill=Z;exports.fade=tt;exports.film=st;exports.hero=dt;exports.pinterest=gt;exports.scroll=ft;exports.slide=$t;exports.strip=xt;
35
+ )`}function dt(t,e){t.style.transform=`translateY(${-e.top}px)`}function A(t,e,r){return t<=e?0:t>=r?1:(t-e)/(r-e)}function ct(t,e){return t.querySelector(`[data-hero-key="${e}"]`)}const pt=(t={})=>{var l,n;const e={stiffness:((l=t.spring)==null?void 0:l.stiffness)??300,damping:((n=t.spring)==null?void 0:n.damping)??30},r=t.timeout??300,c=t.maxDistance??700;let s=null,o=null;return{in:async(i,d)=>{const a=i,p=Array.from(a.querySelectorAll("[data-hero-key]"));if(p.length===0)return{spring:e,tick:()=>{}};if(!await new Promise(u=>{s?u(!0):(o=u,setTimeout(()=>{o=null,u(!1)},r))})||!s)return s=null,{spring:e,tick:()=>{}};const y=p.map(u=>{const h=u.getAttribute("data-hero-key");if(!h)return null;const f=ct(s,h);if(!f)return null;const $=u,m=b.getRect(s,f),x=b.getRect(a,$),T=m.left-x.left-d.scrollOffset.x,Y=m.top-x.top-d.scrollOffset.y,U=m.width/x.width,W=m.height/x.height,X=$.style.transform,N=$.style.position,z=$.style.transformOrigin,H=$.style.zIndex;return{toEl:$,dx:T,dy:Y,dw:U,dh:W,originalTransform:X,originalPosition:N,originalTransformOrigin:z,originalZIndex:H}}).filter(u=>u!==null&&Math.abs(u.dy)<=c);return s=null,y.length===0?{spring:e,tick:()=>{}}:{spring:e,prepare:()=>{y.forEach(({toEl:u})=>{u.style.position="relative",u.style.transformOrigin="top left",u.style.zIndex="1000"})},tick:u=>{y.forEach(({toEl:h,dx:f,dy:$,dw:m,dh:x})=>{h.style.transform=`translate(${(1-u)*f}px,${(1-u)*$}px) scale(${u+(1-u)*m}, ${u+(1-u)*x})`})},onEnd:()=>{y.forEach(({toEl:u,originalTransform:h,originalPosition:f,originalTransformOrigin:$,originalZIndex:m})=>{u.style.transform=h,u.style.position=f,u.style.transformOrigin=$,u.style.zIndex=m})}}},out:async i=>({onStart:()=>{s=i,o&&(o(!0),o=null)},prepare:d=>{b.prepareOutgoing(d),d.style.opacity="0"}})}};function ht({detailRect:t,galleryRect:e,pageRect:r,scrollOffset:c},s){const o=e.left-t.left+(e.width-t.width)/2-c.x,l=e.top-t.top+(e.height-t.height)/2-c.y,n=e.width/t.width,i=e.height/t.height,d=Math.max(n,i),a=t.top/r.height*100,p=(r.width-(t.left+t.width))/r.width*100,g=(r.height-(t.top+t.height))/r.height*100,y=t.left/r.width*100;return s.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`,u=>{const h=1-u,f=a*h,$=p*h,m=g*h,x=y*h;s.style.clipPath=`inset(${f}% ${$}% ${m}% ${x}%)`,s.style.transform=`translate(${o*h}px, ${l*h}px) scale(${1+(d-1)*h})`}}function yt({galleryRect:t,detailRect:e,scrollOffset:r},c){const s=e.left-t.left+(e.width-t.width)/2+r.x,o=e.top-t.top+(e.height-t.height)/2+r.y,l=e.width/t.width,n=e.height/t.height,i=Math.max(l,n);return d=>{c.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`;const a=1-d;c.style.transform=`translate(${s*a-r.x}px, ${o*a-r.y}px) scale(${1+(i-1)*a})`,c.style.opacity=`${1-a}`}}function ut({galleryRect:t,detailRect:e,scrollOffset:r},c){const s=e.left-t.left+(e.width-t.width)/2-r.x,o=e.top-t.top+(e.height-t.height)/2-r.y,l=e.width/t.width,n=e.height/t.height,i=Math.max(l,n);return d=>{const a=1-d,p=d;c.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`,c.style.transform=`translate(${s*a}px, ${o*a}px) scale(${1+(i-1)*a})`,c.style.opacity=`${p}`}}function gt({detailRect:t,galleryRect:e,pageRect:r,scrollOffset:c},s){const o=e.left-t.left+(e.width-t.width)/2+c.x,l=e.top-t.top+(e.height-t.height)/2+c.y,n=e.width/t.width,i=e.height/t.height,d=Math.min(n,i),a=t.top/r.height*100,p=(r.width-(t.left+t.width))/r.width*100,g=(r.height-(t.top+t.height))/r.height*100,y=t.left/r.width*100;return s.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`,u=>{const h=1-u,f=a*h,$=p*h,m=g*h,x=y*h;s.style.clipPath=`inset(${f}% ${$}% ${m}% ${x}%)`,s.style.transform=`translate(${o*h-c.x}px, ${l*h-c.y}px) scale(${1+(d-1)*h})`}}function ft(t,e,r){const c=t.querySelector("[data-pinterest-detail-key]"),s=e.querySelector("[data-pinterest-detail-key]");if(t.querySelectorAll("[data-pinterest-detail-key]").length>1||e.querySelectorAll("[data-pinterest-detail-key]").length>1)return null;let o=null,l=null,n=!1;if(!c&&s){l=s;const p=l.getAttribute("data-pinterest-detail-key");if(!p)return null;o=t.querySelector(`[data-pinterest-gallery-key="${p}"]`),o&&(n=!0)}else if(c&&!s){l=c;const p=l.getAttribute("data-pinterest-detail-key");if(!p)return null;o=e.querySelector(`[data-pinterest-gallery-key="${p}"]`),o&&(n=!1)}if(!o||!l)return null;const i=b.getRect(n?t:e,o),d=b.getRect(n?e:t,l),a=e.getBoundingClientRect();return n?{inAnimation:ht({detailRect:d,galleryRect:i,pageRect:a,scrollOffset:r},e),outAnimation:yt({galleryRect:i,detailRect:d,scrollOffset:r},t)}:{inAnimation:ut({galleryRect:i,detailRect:d,scrollOffset:r},e),outAnimation:gt({detailRect:d,galleryRect:i,pageRect:a,scrollOffset:r},t)}}const $t=(t={})=>{var l,n;const e={stiffness:((l=t.spring)==null?void 0:l.stiffness)??30,damping:((n=t.spring)==null?void 0:n.damping)??10},r=t.timeout??300;let c=null,s=null,o=null;return{in:async(i,{scrollOffset:d})=>{const a=i;return!await new Promise(g=>{c?g(!0):(s=g,setTimeout(()=>{s=null,g(!1)},r))})||!c?(c=null,{spring:e,tick:()=>{}}):(o=ft(c,a,d),o?(c=null,{spring:e,tick:g=>{o&&o.inAnimation(g)}}):{spring:e,tick:()=>{}})},out:async i=>({spring:e,onStart:()=>{c=i,s&&(s(!0),s=null)},prepare:d=>{b.prepareOutgoing(d),d.style.zIndex="-1"},tick:d=>{o&&o.outAnimation(d)}})}},O={stiffness:5,damping:4},mt=(t={})=>{var i,d;const e=t.direction??"up",r={stiffness:((i=t.spring)==null?void 0:i.stiffness)??O.stiffness,damping:((d=t.spring)==null?void 0:d.damping)??O.damping},c=e==="up";let s=null,o=null,l=null;const n=()=>{if(s===null||o===null)return null;const a=Math.min(s,o),p=window.innerHeight;return Math.max(a,p)};return{in:a=>(o=a.offsetHeight,s!==null&&(l=n()),{spring:r,tick:p=>{if(l===null&&(l=n(),l===null))return;const g=c?(1-p)*l:(1-p)*-l;a.style.transform=`translateY(${g}px)`}}),out:a=>({spring:r,onStart:()=>{s=a.offsetHeight,o!==null&&(l=n())},tick:p=>{if(l===null&&(l=n(),l===null))return;const g=c?(1-p)*-l:(1-p)*l;a.style.transform=`translateY(${g}px)`},prepare:p=>{b.prepareOutgoing(p),p.style.zIndex=c?"-1":"1"}})}},D={stiffness:15,damping:7},xt=(t={})=>{var s,o;const e=t.direction??"left",r={stiffness:((s=t.spring)==null?void 0:s.stiffness)??D.stiffness,damping:((o=t.spring)==null?void 0:o.damping)??D.damping},c=e==="left";return{in:l=>({spring:r,tick:n=>{const i=c?(1-n)*100:(1-n)*-100;l.style.transform=`translateX(${i}%)`}}),out:(l,n)=>({spring:r,tick:i=>{const d=c?(1-i)*-100:(1-i)*100;l.style.transform=`translateX(${d}%)`},prepare:i=>{b.prepareOutgoing(i,n),i.style.zIndex=c?"-1":"1"}})}},v={stiffness:17,damping:6},_=20,C=800,bt=()=>{let t,e=null;return{in:r=>({spring:v,prepare:c=>{c.style.transform=`perspective(${C}px) rotateY(${_}deg) translateX(-100%)`},wait:async()=>{t&&await t},tick:c=>{const s=(1-c)*_,o=-(1-c)*100;r.style.transform=`perspective(${C}px) rotateY(${s}deg) translateX(${o}%)`},onEnd:()=>{r.style.transform=""}}),out:(r,c)=>(t=new Promise(s=>{e=s}),{spring:v,prepare:s=>{b.prepareOutgoing(s,c)},tick:s=>{const o=1-s,l=o*_,n=o*100;r.style.transform=`perspective(${C}px) rotateY(${-l}deg) translateX(${n}%)`},onEnd:()=>{e&&e(),r.style.transform=""}})}},wt={stiffness:1,damping:1},Et={stiffness:20,damping:25},Lt="#000000",At="circle",F="CURTAIN_REVEAL_OVERLAY_ID",Tt={position:"fixed",inset:"0",width:"100vw",height:"100%",zIndex:"9999",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"},St={position:"relative",display:"inline-block",height:"5.5rem",overflow:"hidden"},_t={display:"flex",height:"100%",willChange:"transform",transition:"transform 0.3s ease"},Ct={display:"inline-flex",alignItems:"center",justifyContent:"center",whiteSpace:"nowrap",fontSize:"5.5rem",fontWeight:"900",letterSpacing:"0.02em",color:"#FFFFFF"},Pt=.4,S=.5,kt=.2;function It(t,e){switch(t){case"circle":return`circle(${e*100}% at 50% 50%)`;case"square":return`inset(${(1-e)*50}% round ${10*e}%)`;case"triangle":{const r=e*100;return`polygon(50% ${50-r}%, ${50-r}% ${50+r}%, ${50+r}% ${50+r}%)`}}}const Ot=t=>t.reduce((e,r)=>e+r,0),Dt=(t={})=>{const{background:e=Lt,texts:r=[],shape:c=At,inSpring:s=Et,outSpring:o=wt,textStyle:l={}}=t;return{out:(n,i)=>{const d=n.style.opacity;return{spring:o,from:1,to:0,prepare:a=>{b.prepareOutgoing(a,i),a.style.opacity="1"},tick:a=>{const p=Math.max(0,a-Pt);n.style.opacity=String(p)},onEnd:()=>{n.style.opacity=d}}},in:n=>{let i=null,d=null,a=null;const p=document.body.style.overflow,g=document.getElementById(F);let y=[];const u=()=>{i=document.createElement("div"),i.id=F,Object.assign(i.style,Tt,{background:e}),document.body.appendChild(i),d=document.createElement("div"),Object.assign(d.style,St),i.appendChild(d),a=document.createElement("div"),Object.assign(a.style,_t),d.appendChild(a),r.forEach(h=>{const f=document.createElement("div");f.textContent=h,Object.assign(f.style,Ct,l),a.appendChild(f)}),y=Array.from(a.children).map(h=>h.getBoundingClientRect().width)};return{spring:s,from:0,to:1,prepare:()=>{document.body.style.overflow="hidden",n.style.opacity="1",g==null||g.remove(),u(),i&&d&&(i.style.clipPath="none",d.style.transform="scale(1)")},tick:h=>{if(!(!i||!d||!a)){if(h<=S&&r.length>0){const f=h/S,$=Math.min(Math.floor(f*r.length),r.length-1),m=y[$]??0,x=Ot(y.slice(0,$));d.style.width=`${m}px`,a.style.transform=`translateX(-${x}px)`}if(h>S){const $=1-Math.max(0,Math.min(1,(h-S)/kt));i.style.clipPath=It(c,$),d.style.transform=`scale(${$})`}}},onEnd:()=>{i==null||i.remove(),i=d=a=null,document.body.style.overflow=p}}}}};exports.jaemin=b.jaemin;exports.blind=Z;exports.curtainReveal=Dt;exports.drill=J;exports.fade=nt;exports.film=ot;exports.hero=pt;exports.pinterest=$t;exports.scroll=mt;exports.slide=xt;exports.strip=bt;
@@ -8,4 +8,5 @@ export * from './pinterest';
8
8
  export * from './scroll';
9
9
  export * from './slide';
10
10
  export * from './strip';
11
+ export * from './curtain-reveal';
11
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC"}