@ssgoi/core 3.4.0 → 4.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.
Files changed (115) hide show
  1. package/dist/animator/integrator/double-spring-integrator.d.ts +25 -0
  2. package/dist/animator/integrator/double-spring-integrator.d.ts.map +1 -0
  3. package/dist/animator/integrator/index.d.ts +13 -0
  4. package/dist/animator/integrator/index.d.ts.map +1 -0
  5. package/dist/animator/integrator/inertia-integrator.d.ts +19 -0
  6. package/dist/animator/integrator/inertia-integrator.d.ts.map +1 -0
  7. package/dist/animator/integrator/provider.d.ts +22 -0
  8. package/dist/animator/integrator/provider.d.ts.map +1 -0
  9. package/dist/animator/integrator/spring-integrator.d.ts +13 -0
  10. package/dist/animator/integrator/spring-integrator.d.ts.map +1 -0
  11. package/dist/animator/integrator/types.d.ts +34 -0
  12. package/dist/animator/integrator/types.d.ts.map +1 -0
  13. package/dist/animator/multi-animator.d.ts +2 -2
  14. package/dist/animator/multi-animator.d.ts.map +1 -1
  15. package/dist/animator/{animate → runner}/css-runner.d.ts +2 -2
  16. package/dist/animator/runner/css-runner.d.ts.map +1 -0
  17. package/dist/animator/runner/provider.d.ts +35 -0
  18. package/dist/animator/runner/provider.d.ts.map +1 -0
  19. package/dist/animator/{animate → runner}/tick-runner.d.ts +2 -2
  20. package/dist/animator/runner/tick-runner.d.ts.map +1 -0
  21. package/dist/animator/runner/ticker.d.ts.map +1 -0
  22. package/dist/animator/{animate → runner}/types.d.ts +6 -3
  23. package/dist/animator/runner/types.d.ts.map +1 -0
  24. package/dist/animator/{index.d.ts → single-animator.d.ts} +17 -9
  25. package/dist/animator/single-animator.d.ts.map +1 -0
  26. package/dist/animator/{animation.d.ts → types.d.ts} +2 -2
  27. package/dist/animator/types.d.ts.map +1 -0
  28. package/dist/index.cjs +1 -1
  29. package/dist/index.d.ts +0 -1
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +480 -535
  32. package/dist/provider-B6Xnh0BA.cjs +1 -0
  33. package/dist/provider-CMBovM_W.js +134 -0
  34. package/dist/transition/transition-strategy.d.ts +2 -2
  35. package/dist/transition/transition-strategy.d.ts.map +1 -1
  36. package/dist/transitions/blur.d.ts +4 -7
  37. package/dist/transitions/blur.d.ts.map +1 -1
  38. package/dist/transitions/bounce.d.ts +4 -7
  39. package/dist/transitions/bounce.d.ts.map +1 -1
  40. package/dist/transitions/fade.d.ts +4 -7
  41. package/dist/transitions/fade.d.ts.map +1 -1
  42. package/dist/transitions/fly.d.ts +2 -5
  43. package/dist/transitions/fly.d.ts.map +1 -1
  44. package/dist/transitions/index.cjs +1 -1
  45. package/dist/transitions/index.d.ts +5 -0
  46. package/dist/transitions/index.d.ts.map +1 -1
  47. package/dist/transitions/index.js +153 -194
  48. package/dist/transitions/mask.d.ts +2 -5
  49. package/dist/transitions/mask.d.ts.map +1 -1
  50. package/dist/transitions/none.d.ts +2 -5
  51. package/dist/transitions/none.d.ts.map +1 -1
  52. package/dist/transitions/rotate.d.ts +4 -7
  53. package/dist/transitions/rotate.d.ts.map +1 -1
  54. package/dist/transitions/scale.d.ts +4 -7
  55. package/dist/transitions/scale.d.ts.map +1 -1
  56. package/dist/transitions/slide.d.ts +4 -7
  57. package/dist/transitions/slide.d.ts.map +1 -1
  58. package/dist/transitions/utils.d.ts +8 -0
  59. package/dist/transitions/utils.d.ts.map +1 -0
  60. package/dist/types.cjs +1 -1
  61. package/dist/types.d.ts +59 -3
  62. package/dist/types.d.ts.map +1 -1
  63. package/dist/types.js +6 -6
  64. package/dist/view-transitions/blind.d.ts +2 -3
  65. package/dist/view-transitions/blind.d.ts.map +1 -1
  66. package/dist/view-transitions/curtain-reveal.d.ts +2 -3
  67. package/dist/view-transitions/curtain-reveal.d.ts.map +1 -1
  68. package/dist/view-transitions/depth.d.ts +19 -0
  69. package/dist/view-transitions/depth.d.ts.map +1 -0
  70. package/dist/view-transitions/drill.d.ts +2 -2
  71. package/dist/view-transitions/drill.d.ts.map +1 -1
  72. package/dist/view-transitions/fade.d.ts +2 -3
  73. package/dist/view-transitions/fade.d.ts.map +1 -1
  74. package/dist/view-transitions/film.d.ts +2 -1
  75. package/dist/view-transitions/film.d.ts.map +1 -1
  76. package/dist/view-transitions/hero.d.ts +2 -2
  77. package/dist/view-transitions/hero.d.ts.map +1 -1
  78. package/dist/view-transitions/index.cjs +15 -15
  79. package/dist/view-transitions/index.d.ts +6 -2
  80. package/dist/view-transitions/index.d.ts.map +1 -1
  81. package/dist/view-transitions/index.js +1076 -678
  82. package/dist/view-transitions/instagram.d.ts +2 -2
  83. package/dist/view-transitions/instagram.d.ts.map +1 -1
  84. package/dist/view-transitions/jaemin.d.ts +2 -6
  85. package/dist/view-transitions/jaemin.d.ts.map +1 -1
  86. package/dist/view-transitions/pinterest.d.ts +2 -2
  87. package/dist/view-transitions/pinterest.d.ts.map +1 -1
  88. package/dist/view-transitions/rotate.d.ts +5 -2
  89. package/dist/view-transitions/rotate.d.ts.map +1 -1
  90. package/dist/view-transitions/scroll.d.ts +2 -2
  91. package/dist/view-transitions/scroll.d.ts.map +1 -1
  92. package/dist/view-transitions/sheet.d.ts +19 -0
  93. package/dist/view-transitions/sheet.d.ts.map +1 -0
  94. package/dist/view-transitions/slide.d.ts +2 -2
  95. package/dist/view-transitions/slide.d.ts.map +1 -1
  96. package/dist/view-transitions/snap.d.ts +14 -0
  97. package/dist/view-transitions/snap.d.ts.map +1 -0
  98. package/dist/view-transitions/strip.d.ts +6 -2
  99. package/dist/view-transitions/strip.d.ts.map +1 -1
  100. package/dist/view-transitions/swap.d.ts +13 -0
  101. package/dist/view-transitions/swap.d.ts.map +1 -0
  102. package/package.json +1 -1
  103. package/dist/animator/animate/css-runner.d.ts.map +0 -1
  104. package/dist/animator/animate/index.d.ts +0 -42
  105. package/dist/animator/animate/index.d.ts.map +0 -1
  106. package/dist/animator/animate/tick-runner.d.ts.map +0 -1
  107. package/dist/animator/animate/types.d.ts.map +0 -1
  108. package/dist/animator/animation.d.ts.map +0 -1
  109. package/dist/animator/index.d.ts.map +0 -1
  110. package/dist/animator/spring-core.d.ts +0 -82
  111. package/dist/animator/spring-core.d.ts.map +0 -1
  112. package/dist/animator/ticker.d.ts.map +0 -1
  113. package/dist/jaemin-BG8HRXG1.cjs +0 -1
  114. package/dist/jaemin-BWkrXq0V.js +0 -131
  115. /package/dist/animator/{ticker.d.ts → runner/ticker.d.ts} +0 -0
@@ -1,7 +1,7 @@
1
- import { SpringConfig, SggoiTransition } from '../types';
1
+ import { SggoiTransition, PhysicsOptions } from '../types';
2
2
  interface InstagramOptions {
3
- spring?: Partial<SpringConfig>;
4
3
  timeout?: number;
4
+ physics?: PhysicsOptions;
5
5
  }
6
6
  export declare const instagram: (options?: InstagramOptions) => SggoiTransition;
7
7
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"instagram.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/instagram.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAI9D,UAAU,gBAAgB;IACxB,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAgPD,eAAO,MAAM,SAAS,GAAI,UAAS,gBAAqB,KAAG,eA+G1D,CAAC"}
1
+ {"version":3,"file":"instagram.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/instagram.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAQhE,UAAU,gBAAgB;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B;AAgPD,eAAO,MAAM,SAAS,GAAI,UAAS,gBAAqB,KAAG,eA2G1D,CAAC"}
@@ -1,13 +1,10 @@
1
- import { SpringConfig, SggoiTransition } from '../types';
1
+ import { SggoiTransition, PhysicsOptions } from '../types';
2
2
  interface JaeminOptions {
3
- spring?: Partial<SpringConfig>;
3
+ physics?: PhysicsOptions;
4
4
  initialRotation?: number;
5
5
  initialScale?: number;
6
6
  rotationTriggerPoint?: number;
7
7
  }
8
- interface JaeminInternalOptions extends JaeminOptions {
9
- containerMode?: "positioned-parent" | "viewport";
10
- }
11
8
  /**
12
9
  * Jaemin Transition
13
10
  *
@@ -20,6 +17,5 @@ interface JaeminInternalOptions extends JaeminOptions {
20
17
  * Created by Jaemin
21
18
  */
22
19
  export declare const jaemin: (options?: JaeminOptions) => SggoiTransition;
23
- export declare const jaeminInternal: (options?: JaeminInternalOptions) => SggoiTransition;
24
20
  export {};
25
21
  //# sourceMappingURL=jaemin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"jaemin.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/jaemin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,eAAe,EAEhB,MAAM,UAAU,CAAC;AAIlB,UAAU,aAAa;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAC/B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAGD,UAAU,qBAAsB,SAAQ,aAAa;IACnD,aAAa,CAAC,EAAE,mBAAmB,GAAG,UAAU,CAAC;CAClD;AAiCD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,MAAM,GAAI,UAAS,aAAkB,KAAG,eAEpD,CAAC;AAGF,eAAO,MAAM,cAAc,GACzB,UAAS,qBAA0B,KAClC,eA8KF,CAAC"}
1
+ {"version":3,"file":"jaemin.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/jaemin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EAEf,cAAc,EACf,MAAM,UAAU,CAAC;AAQlB,UAAU,aAAa;IACrB,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAiBD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,MAAM,GAAI,UAAS,aAAkB,KAAG,eAoIpD,CAAC"}
@@ -1,7 +1,7 @@
1
- import { SpringConfig, SggoiTransition } from '../types';
1
+ import { SggoiTransition, PhysicsOptions } from '../types';
2
2
  interface PinterestOptions {
3
- spring?: Partial<SpringConfig>;
4
3
  timeout?: number;
4
+ physics?: PhysicsOptions;
5
5
  }
6
6
  export declare const pinterest: (options?: PinterestOptions) => SggoiTransition;
7
7
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"pinterest.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/pinterest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAI9D,UAAU,gBAAgB;IACxB,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AA0UD,eAAO,MAAM,SAAS,GAAI,UAAS,gBAAqB,KAAG,eAyG1D,CAAC"}
1
+ {"version":3,"file":"pinterest.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/pinterest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAQhE,UAAU,gBAAgB;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B;AA0UD,eAAO,MAAM,SAAS,GAAI,UAAS,gBAAqB,KAAG,eAqG1D,CAAC"}
@@ -1,3 +1,6 @@
1
- import { SggoiTransition } from '../types';
2
- export declare const rotate: () => SggoiTransition;
1
+ import { PhysicsOptions, SggoiTransition } from '../types';
2
+ export interface RotateOptions {
3
+ physics?: PhysicsOptions;
4
+ }
5
+ export declare const rotate: (options?: RotateOptions) => SggoiTransition;
3
6
  //# sourceMappingURL=rotate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rotate.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/rotate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAe,MAAM,UAAU,CAAC;AAK7D,eAAO,MAAM,MAAM,QAAO,eA2CzB,CAAC"}
1
+ {"version":3,"file":"rotate.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/rotate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAe,MAAM,UAAU,CAAC;AAO7E,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B;AAED,eAAO,MAAM,MAAM,GAAI,UAAS,aAAkB,KAAG,eA4CpD,CAAC"}
@@ -1,7 +1,7 @@
1
- import { SpringConfig, SggoiTransition } from '../types';
1
+ import { SggoiTransition, PhysicsOptions } from '../types';
2
2
  interface ScrollOptions {
3
3
  direction?: "up" | "down";
4
- spring?: Partial<SpringConfig>;
4
+ physics?: PhysicsOptions;
5
5
  }
6
6
  export declare const scroll: (options?: ScrollOptions) => SggoiTransition;
7
7
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"scroll.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/scroll.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAG9D,UAAU,aAAa;IACrB,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;CAChC;AAOD,eAAO,MAAM,MAAM,GAAI,UAAS,aAAkB,KAAG,eAuGpD,CAAC"}
1
+ {"version":3,"file":"scroll.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/scroll.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAGhE,UAAU,aAAa;IACrB,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAC1B,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B;AAMD,eAAO,MAAM,MAAM,GAAI,UAAS,aAAkB,KAAG,eAoGpD,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { PhysicsOptions, SggoiTransition } from '../types';
2
+ interface SheetOptions {
3
+ direction?: "enter" | "exit";
4
+ physics?: PhysicsOptions;
5
+ }
6
+ /**
7
+ * Mobile-optimized bottom sheet style transition
8
+ *
9
+ * Enter direction (forward navigation):
10
+ * - IN: Sheet slides up from bottom
11
+ * - OUT: Background page scales down (1 → 0.8) with fade
12
+ *
13
+ * Exit direction (back navigation):
14
+ * - IN: Background page scales up (0.8 → 1) with fade
15
+ * - OUT: Sheet slides down with high z-index
16
+ */
17
+ export declare const sheet: (options?: SheetOptions) => SggoiTransition;
18
+ export {};
19
+ //# sourceMappingURL=sheet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sheet.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/sheet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EAGhB,MAAM,UAAU,CAAC;AAkBlB,UAAU,YAAY;IACpB,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC7B,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B;AAoBD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,KAAK,GAAI,UAAS,YAAiB,KAAG,eAmHlD,CAAC"}
@@ -1,7 +1,7 @@
1
- import { SpringConfig, SggoiTransition } from '../types';
1
+ import { SggoiTransition, PhysicsOptions } from '../types';
2
2
  interface SlideOptions {
3
3
  direction?: "left" | "right";
4
- spring?: Partial<SpringConfig>;
4
+ physics?: PhysicsOptions;
5
5
  }
6
6
  export declare const slide: (options?: SlideOptions) => SggoiTransition;
7
7
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"slide.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/slide.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAe,MAAM,UAAU,CAAC;AAG3E,UAAU,YAAY;IACpB,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC7B,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;CAChC;AAQD,eAAO,MAAM,KAAK,GAAI,UAAS,YAAiB,KAAG,eAwDlD,CAAC"}
1
+ {"version":3,"file":"slide.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/slide.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAe,cAAc,EAAE,MAAM,UAAU,CAAC;AAG7E,UAAU,YAAY;IACpB,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC7B,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B;AAUD,eAAO,MAAM,KAAK,GAAI,UAAS,YAAiB,KAAG,eAoDlD,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { PhysicsOptions, SggoiTransition } from '../types';
2
+ interface SnapOptions {
3
+ direction?: "left" | "right";
4
+ physics?: PhysicsOptions;
5
+ }
6
+ /**
7
+ * Snap transition - fast, subtle page transition with directional slide
8
+ *
9
+ * - OUT: Fade out + slide in same direction (waits for completion before IN)
10
+ * - IN: Fade in + slide from opposite direction
11
+ */
12
+ export declare const snap: (options?: SnapOptions) => SggoiTransition;
13
+ export {};
14
+ //# sourceMappingURL=snap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snap.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/snap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAe,MAAM,UAAU,CAAC;AAe7E,UAAU,WAAW;IACnB,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC7B,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B;AAED;;;;;GAKG;AACH,eAAO,MAAM,IAAI,GAAI,UAAS,WAAgB,KAAG,eAiGhD,CAAC"}
@@ -1,3 +1,7 @@
1
- import { SggoiTransition } from '../types';
2
- export declare const strip: () => SggoiTransition;
1
+ import { SggoiTransition, PhysicsOptions } from '../types';
2
+ interface StripOptions {
3
+ physics?: PhysicsOptions;
4
+ }
5
+ export declare const strip: (options?: StripOptions) => SggoiTransition;
6
+ export {};
3
7
  //# sourceMappingURL=strip.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"strip.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/strip.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAe,MAAM,UAAU,CAAC;AAO7D,eAAO,MAAM,KAAK,QAAO,eA6ExB,CAAC"}
1
+ {"version":3,"file":"strip.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/strip.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAe,cAAc,EAAE,MAAM,UAAU,CAAC;AAS7E,UAAU,YAAY;IACpB,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B;AAED,eAAO,MAAM,KAAK,GAAI,UAAS,YAAiB,KAAG,eA8ElD,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { PhysicsOptions, SggoiTransition } from '../types';
2
+ interface SwapOptions {
3
+ physics?: PhysicsOptions;
4
+ }
5
+ /**
6
+ * Swap transition for peer-level navigation (e.g. bottom tabs)
7
+ *
8
+ * - OUT: Fade out only (no scale)
9
+ * - IN: Scale up from smaller + fade in (waits for OUT to complete)
10
+ */
11
+ export declare const swap: (options?: SwapOptions) => SggoiTransition;
12
+ export {};
13
+ //# sourceMappingURL=swap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"swap.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/swap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EAGhB,MAAM,UAAU,CAAC;AAelB,UAAU,WAAW;IACnB,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B;AAoBD;;;;;GAKG;AACH,eAAO,MAAM,IAAI,GAAI,UAAS,WAAgB,KAAG,eAqEhD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ssgoi/core",
3
- "version": "3.4.0",
3
+ "version": "4.0.0",
4
4
  "description": "Core animation engine for SSGOI - Native app-like page transitions with spring physics",
5
5
  "private": false,
6
6
  "type": "module",
@@ -1 +0,0 @@
1
- {"version":3,"file":"css-runner.d.ts","sourceRoot":"","sources":["../../../src/lib/animator/animate/css-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAML,KAAK,YAAY,EAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE9D,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,WAAW,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,YAAY,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,WAAW,CAAC;IACzC,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AA4HD;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,iBAAiB,CA6E5E"}
@@ -1,42 +0,0 @@
1
- import { AnimationControls, AnimationOptions } from './types';
2
- export type { AnimationControls, AnimationOptions };
3
- /**
4
- * Run spring animation
5
- *
6
- * tick option: RAF-based real-time animation
7
- * css option: Web Animation API based (GPU accelerated)
8
- *
9
- * @example
10
- * ```ts
11
- * // Tick mode (RAF)
12
- * const controls = animate({
13
- * from: 0,
14
- * to: 1,
15
- * spring: { stiffness: 300, damping: 30 },
16
- * tick: (value) => element.style.opacity = String(value),
17
- * onComplete: () => console.log('done'),
18
- * });
19
- *
20
- * // CSS mode (Web Animation API)
21
- * const controls = animate({
22
- * from: 0,
23
- * to: 1,
24
- * spring: { stiffness: 300, damping: 30 },
25
- * css: {
26
- * element: myElement,
27
- * style: (progress) => ({
28
- * opacity: String(progress),
29
- * transform: `scale(${0.5 + 0.5 * progress})`,
30
- * }),
31
- * },
32
- * onComplete: () => console.log('done'),
33
- * });
34
- *
35
- * // Stop mid-animation and check state
36
- * controls.stop();
37
- * console.log(controls.getPosition()); // Current position
38
- * console.log(controls.getVelocity()); // Current velocity
39
- * ```
40
- */
41
- export declare function animate(options: AnimationOptions): AnimationControls;
42
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/animator/animate/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEnE,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,gBAAgB,GAAG,iBAAiB,CA6CpE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"tick-runner.d.ts","sourceRoot":"","sources":["../../../src/lib/animator/animate/tick-runner.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAML,KAAK,YAAY,EAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,YAAY,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,iBAAiB,GACzB,iBAAiB,CA8DnB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/animator/animate/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,WAAW,EAAE,MAAM,MAAM,CAAC;IAC1B,WAAW,EAAE,MAAM,MAAM,CAAC;IAC1B,SAAS,EAAE,MAAM,OAAO,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,YAAY,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAGrB,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,GAAG,CAAC,EAAE;QACJ,OAAO,EAAE,WAAW,CAAC;QACrB,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,WAAW,CAAC;KAC1C,CAAC;CACH"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"animation.d.ts","sourceRoot":"","sources":["../../src/lib/animator/animation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C;;;;;GAKG;AACH,8BAAsB,SAAS;IAC7B;;;OAGG;IACH,QAAQ,CAAC,OAAO,IAAI,IAAI;IAExB;;;OAGG;IACH,QAAQ,CAAC,QAAQ,IAAI,IAAI;IAEzB;;OAEG;IACH,QAAQ,CAAC,IAAI,IAAI,IAAI;IAErB;;;OAGG;IACH,QAAQ,CAAC,OAAO,IAAI,IAAI;IAExB;;OAEG;IACH,QAAQ,CAAC,eAAe,IAAI,cAAc;IAE1C;;;OAGG;IACH,QAAQ,CAAC,eAAe,IAAI,MAAM;IAElC;;;OAGG;IACH,QAAQ,CAAC,WAAW,IAAI,MAAM;IAE9B;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAEtC;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAE5C;;OAEG;IACH,QAAQ,CAAC,cAAc,IAAI,OAAO;CACnC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/animator/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAqB,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,YAAY,EAAE,WAAW,EAAE,CAAC;AAE5B,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,IAAI,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,GAAG,CAAC,EAAE;QACJ,OAAO,EAAE,WAAW,CAAC;QACrB,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,WAAW,CAAC;KAC1C,CAAC;IACF,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED;;;;;;GAMG;AACH,qBAAa,QAAS,SAAQ,SAAS;IACrC,OAAO,CAAC,OAAO,CAWb;IACF,OAAO,CAAC,QAAQ,CAAkC;IAClD,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,eAAe,CAAa;gBAExB,OAAO,EAAE,eAAe;IAmBpC,OAAO,CAAC,YAAY;IAqBpB,OAAO,IAAI,IAAI;IAKf,QAAQ,IAAI,IAAI;IAKhB,OAAO,IAAI,IAAI;IAWf,IAAI,IAAI,IAAI;IAWZ,WAAW,IAAI,MAAM;IAIrB,eAAe,IAAI,MAAM;IAIzB,cAAc,IAAI,OAAO;IAIzB,eAAe,IAAI,cAAc;IASjC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAI7B,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAInC,aAAa,CAAC,UAAU,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,IAAI;IAIzD,MAAM,CAAC,SAAS,CACd,KAAK,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,EAC7C,OAAO,EAAE,eAAe,GACvB,QAAQ;CAMZ"}
@@ -1,82 +0,0 @@
1
- /**
2
- * Spring Core
3
- *
4
- * Core module containing spring physics calculation logic
5
- * Used by both tick-runner (RAF based) and css-runner (synchronous simulation)
6
- *
7
- * Uses optimized Semi-implicit Euler method (Allen Chou's approach)
8
- */
9
- export interface SpringConfig {
10
- stiffness: number;
11
- damping: number;
12
- /**
13
- * Enable double spring for ease-in-out effect (Chained/Lagged Spring)
14
- *
15
- * - true: same stiffness for both springs
16
- * - number (0-1): follower stiffness ratio (smaller = stronger ease-in)
17
- * - 1.0: same as true
18
- * - 0.5: follower has half stiffness → stronger ease-in
19
- * - 0.3: even stronger ease-in
20
- *
21
- * Creates a two-spring system:
22
- * - Leader spring: tracks the target directly
23
- * - Follower spring: tracks the leader's position (this is the output)
24
- */
25
- doubleSpring?: boolean | number;
26
- }
27
- export interface SpringState {
28
- position: number;
29
- velocity: number;
30
- }
31
- export interface SpringConstants {
32
- omega: number;
33
- zeta: number;
34
- /** @internal - Follower constants for double spring */
35
- follower?: {
36
- omega: number;
37
- zeta: number;
38
- };
39
- }
40
- /**
41
- * Pre-compute spring constants (performance optimization)
42
- *
43
- * @param config Spring configuration
44
- * @returns omega (angular frequency), zeta (damping ratio)
45
- */
46
- export declare function computeSpringConstants(config: SpringConfig): SpringConstants;
47
- /**
48
- * Calculate one spring step (Semi-implicit Euler)
49
- *
50
- * Automatically handles double spring if constants.follower exists.
51
- * For double spring, output position/velocity is from the follower.
52
- *
53
- * @param state Current state (position, velocity)
54
- * @param target Target position
55
- * @param constants Pre-computed spring constants (omega, zeta, optionally follower)
56
- * @param dt Delta time (seconds)
57
- * @returns New state
58
- */
59
- export declare function stepSpring(state: SpringState, target: number, constants: SpringConstants, dt: number): SpringState;
60
- export declare const POSITION_THRESHOLD = 0.01;
61
- export declare const VELOCITY_THRESHOLD = 0.01;
62
- export declare const SETTLE_THRESHOLD = 0.05;
63
- /**
64
- * Check if spring has converged to target
65
- * For double spring, checks both leader and follower
66
- */
67
- export declare function isSettled(state: SpringState, target: number): boolean;
68
- /**
69
- * Full spring simulation (synchronous)
70
- * Used for Web Animation API keyframe generation
71
- *
72
- * @param config Spring configuration
73
- * @param from Start value
74
- * @param to Target value
75
- * @param initialVelocity Initial velocity
76
- * @returns Frame-by-frame progress array and duration
77
- */
78
- export declare function simulateSpring(config: SpringConfig, from: number, to: number, initialVelocity?: number): {
79
- frames: number[];
80
- duration: number;
81
- };
82
- //# sourceMappingURL=spring-core.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"spring-core.d.ts","sourceRoot":"","sources":["../../src/lib/animator/spring-core.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;;;;;;;;OAYG;IACH,YAAY,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CACjC;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAOD,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,QAAQ,CAAC,EAAE;QACT,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,YAAY,GAAG,eAAe,CAoB5E;AAoBD;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,eAAe,EAC1B,EAAE,EAAE,MAAM,GACT,WAAW,CAwDb;AAGD,eAAO,MAAM,kBAAkB,OAAO,CAAC;AACvC,eAAO,MAAM,kBAAkB,OAAO,CAAC;AACvC,eAAO,MAAM,gBAAgB,OAAO,CAAC;AAErC;;;GAGG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAkBrE;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,YAAY,EACpB,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,EACV,eAAe,SAAI,GAClB;IAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAmCxC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ticker.d.ts","sourceRoot":"","sources":["../../src/lib/animator/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;IACzB,OAAO,CAAC,YAAY,CAAM;IAG1B,OAAO,CAAC,GAAG,CAAc;IACzB,OAAO,CAAC,QAAQ,CAAY;IAE5B,OAAO,CAAC,IAAI,CAyCV;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 +0,0 @@
1
- "use strict";function b(i,a){function o(d){let l=0,y=0;const t=d.offsetWidth,g=d.offsetHeight;let s=d;for(;s;)l+=s.offsetTop,y+=s.offsetLeft,s=s.offsetParent;return l-=window.scrollY,y-=window.scrollX,{top:l,left:y,width:t,height:g}}const e=o(i),n=o(a);return new DOMRect(n.left-e.left,n.top-e.top,n.width,n.height)}const x=(i,a)=>{var o;i.style.position="absolute",i.style.width="100%",i.style.top=`${-1*(((o=a==null?void 0:a.scrollOffset)==null?void 0:o.y)??0)}px`,i.style.left="0"};function M(i,a="viewport"){if(a==="positioned-parent"){const o=i.positionedParent.getBoundingClientRect();return{top:o.top,left:o.left,width:o.width,height:o.height}}else{const o=b(document.body,i.positionedParent);return{top:i.scroll.y,left:0,width:o.width,height:window.innerHeight-o.top}}}const F=(i={})=>R(i),R=(i={})=>{var l,y;const a={stiffness:((l=i.spring)==null?void 0:l.stiffness)??50,damping:((y=i.spring)==null?void 0:y.damping)??30},o=i.initialRotation??45,e=i.initialScale??.01,n=i.rotationTriggerPoint??.8,d=i.containerMode??"viewport";return{out:async(t,g)=>{const s=t.style.opacity;return{spring:{stiffness:80,damping:25},from:1,to:0,prepare:()=>{x(t,g),t.style.opacity="1"},tick:w=>{t.style.opacity=String(w)},onEnd:()=>{t.style.opacity=s}}},in:async(t,g)=>{const s=M(g,d),w=t.style.transform,$=t.style.transformOrigin,O=t.style.position,v=t.style.zIndex;return{spring:a,from:0,to:1,prepare:()=>{const r=Math.min(s.width,s.height)*.4;if(t.style.setProperty("--max-border-radius",`${r}px`),t.style.setProperty("--border-radius-scale","1"),t.style.willChange="transform",t.style.backfaceVisibility="hidden",d==="positioned-parent")t.style.transformOrigin="50% 50%",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.width=`${s.width}px`,t.style.height=`${s.height}px`;else{const f=s.left+s.width/2,h=s.top+s.height/2;t.style.transformOrigin=`${f}px ${h}px`,t.style.position="fixed",t.style.top=`${s.top}px`,t.style.left=`${s.left}px`,t.style.width=`${s.width}px`,t.style.height=`${s.height}px`}t.style.zIndex="1000",t.style.overflow="hidden",t.style.transform=`rotate(${o}deg) scale(${e}) translateZ(0)`,t.style.borderRadius="calc(var(--max-border-radius) * var(--border-radius-scale))",t.style.opacity="1"},tick:r=>{let f;if(r<=.05)f=e;else if(r<=n){const c=(r-.05)/(n-.05),u=Math.pow(c,9);f=e+(.8-e)*u}else{const c=(r-n)/(1-n);f=.8+.2*(1-Math.pow(1-c,3))}let h;const p=.7;if(r<=p)h=o;else{const c=(r-p)/(1-p),u=1-Math.pow(1-c,2);h=o*(1-u)}let P;if(r<=p)P=1;else{const c=(r-p)/(1-p);P=1-Math.pow(c,.5)}t.style.transform=`rotate(${h.toFixed(2)}deg) scale(${f.toFixed(4)}) translateZ(0)`,t.style.setProperty("--border-radius-scale",P.toFixed(4))},onEnd:()=>{t.style.willChange="",t.style.backfaceVisibility="",t.style.removeProperty("--max-border-radius"),t.style.removeProperty("--border-radius-scale"),t.style.transform=w,t.style.transformOrigin=$,t.style.position=O,t.style.zIndex=v,t.style.top="",t.style.left="",t.style.width="",t.style.height="",t.style.overflow="",t.style.borderRadius=""}}}}};exports.getRect=b;exports.jaemin=F;exports.jaeminInternal=R;exports.prepareOutgoing=x;
@@ -1,131 +0,0 @@
1
- function R(i, a) {
2
- function o(d) {
3
- let l = 0, y = 0;
4
- const t = d.offsetWidth, g = d.offsetHeight;
5
- let s = d;
6
- for (; s; )
7
- l += s.offsetTop, y += s.offsetLeft, s = s.offsetParent;
8
- return l -= window.scrollY, y -= window.scrollX, { top: l, left: y, width: t, height: g };
9
- }
10
- const e = o(i), n = o(a);
11
- return new DOMRect(
12
- n.left - e.left,
13
- n.top - e.top,
14
- n.width,
15
- n.height
16
- );
17
- }
18
- const O = (i, a) => {
19
- var o;
20
- i.style.position = "absolute", i.style.width = "100%", i.style.top = `${-1 * (((o = a == null ? void 0 : a.scrollOffset) == null ? void 0 : o.y) ?? 0)}px`, i.style.left = "0";
21
- };
22
- function v(i, a = "viewport") {
23
- if (a === "positioned-parent") {
24
- const o = i.positionedParent.getBoundingClientRect();
25
- return {
26
- top: o.top,
27
- left: o.left,
28
- width: o.width,
29
- height: o.height
30
- };
31
- } else {
32
- const o = R(document.body, i.positionedParent);
33
- return {
34
- top: i.scroll.y,
35
- left: 0,
36
- width: o.width,
37
- height: window.innerHeight - o.top
38
- };
39
- }
40
- }
41
- const F = (i = {}) => M(i), M = (i = {}) => {
42
- var l, y;
43
- const a = {
44
- // Much slower animation - 4x duration by reducing stiffness further
45
- stiffness: ((l = i.spring) == null ? void 0 : l.stiffness) ?? 50,
46
- damping: ((y = i.spring) == null ? void 0 : y.damping) ?? 30
47
- }, o = i.initialRotation ?? 45, e = i.initialScale ?? 0.01, n = i.rotationTriggerPoint ?? 0.8, d = i.containerMode ?? "viewport";
48
- return {
49
- out: async (t, g) => {
50
- const s = t.style.opacity;
51
- return {
52
- spring: {
53
- stiffness: 80,
54
- damping: 25
55
- },
56
- from: 1,
57
- to: 0,
58
- prepare: () => {
59
- O(t, g), t.style.opacity = "1";
60
- },
61
- tick: (w) => {
62
- t.style.opacity = String(w);
63
- },
64
- onEnd: () => {
65
- t.style.opacity = s;
66
- }
67
- };
68
- },
69
- in: async (t, g) => {
70
- const s = v(g, d), w = t.style.transform, b = t.style.transformOrigin, x = t.style.position, $ = t.style.zIndex;
71
- return {
72
- spring: a,
73
- from: 0,
74
- to: 1,
75
- prepare: () => {
76
- const r = Math.min(s.width, s.height) * 0.4;
77
- if (t.style.setProperty(
78
- "--max-border-radius",
79
- `${r}px`
80
- ), t.style.setProperty("--border-radius-scale", "1"), t.style.willChange = "transform", t.style.backfaceVisibility = "hidden", d === "positioned-parent")
81
- t.style.transformOrigin = "50% 50%", t.style.position = "absolute", t.style.top = "0px", t.style.left = "0px", t.style.width = `${s.width}px`, t.style.height = `${s.height}px`;
82
- else {
83
- const f = s.left + s.width / 2, h = s.top + s.height / 2;
84
- t.style.transformOrigin = `${f}px ${h}px`, t.style.position = "fixed", t.style.top = `${s.top}px`, t.style.left = `${s.left}px`, t.style.width = `${s.width}px`, t.style.height = `${s.height}px`;
85
- }
86
- t.style.zIndex = "1000", t.style.overflow = "hidden", t.style.transform = `rotate(${o}deg) scale(${e}) translateZ(0)`, t.style.borderRadius = "calc(var(--max-border-radius) * var(--border-radius-scale))", t.style.opacity = "1";
87
- },
88
- tick: (r) => {
89
- let f;
90
- if (r <= 0.05)
91
- f = e;
92
- else if (r <= n) {
93
- const c = (r - 0.05) / (n - 0.05), u = Math.pow(c, 9);
94
- f = e + (0.8 - e) * u;
95
- } else {
96
- const c = (r - n) / (1 - n);
97
- f = 0.8 + 0.2 * (1 - Math.pow(1 - c, 3));
98
- }
99
- let h;
100
- const p = 0.7;
101
- if (r <= p)
102
- h = o;
103
- else {
104
- const c = (r - p) / (1 - p), u = 1 - Math.pow(1 - c, 2);
105
- h = o * (1 - u);
106
- }
107
- let P;
108
- if (r <= p)
109
- P = 1;
110
- else {
111
- const c = (r - p) / (1 - p);
112
- P = 1 - Math.pow(c, 0.5);
113
- }
114
- t.style.transform = `rotate(${h.toFixed(2)}deg) scale(${f.toFixed(4)}) translateZ(0)`, t.style.setProperty(
115
- "--border-radius-scale",
116
- P.toFixed(4)
117
- );
118
- },
119
- onEnd: () => {
120
- t.style.willChange = "", t.style.backfaceVisibility = "", t.style.removeProperty("--max-border-radius"), t.style.removeProperty("--border-radius-scale"), t.style.transform = w, t.style.transformOrigin = b, t.style.position = x, t.style.zIndex = $, t.style.top = "", t.style.left = "", t.style.width = "", t.style.height = "", t.style.overflow = "", t.style.borderRadius = "";
121
- }
122
- };
123
- }
124
- };
125
- };
126
- export {
127
- F as a,
128
- R as g,
129
- M as j,
130
- O as p
131
- };