@ssgoi/core 2.5.2 → 2.5.4

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 (61) hide show
  1. package/dist/animator/animate.d.ts.map +1 -0
  2. package/dist/{animation-scheduler.d.ts → animator/animation-scheduler.d.ts} +1 -1
  3. package/dist/animator/animation-scheduler.d.ts.map +1 -0
  4. package/dist/{animator.d.ts → animator/index.d.ts} +2 -2
  5. package/dist/animator/index.d.ts.map +1 -0
  6. package/dist/animator/ticker.d.ts.map +1 -0
  7. package/dist/index.cjs +2 -2
  8. package/dist/index.d.ts +3 -3
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +279 -267
  11. package/dist/presets/index.cjs +1 -1
  12. package/dist/presets/index.js +2 -2
  13. package/dist/ssgoi-transition/create-context-manager.d.ts +18 -0
  14. package/dist/ssgoi-transition/create-context-manager.d.ts.map +1 -0
  15. package/dist/ssgoi-transition/create-ssgoi-transition-context.d.ts +46 -0
  16. package/dist/ssgoi-transition/create-ssgoi-transition-context.d.ts.map +1 -0
  17. package/dist/ssgoi-transition/create-swipe-detector.d.ts +10 -0
  18. package/dist/ssgoi-transition/create-swipe-detector.d.ts.map +1 -0
  19. package/dist/ssgoi-transition/find-matching-transition.d.ts +24 -0
  20. package/dist/ssgoi-transition/find-matching-transition.d.ts.map +1 -0
  21. package/dist/ssgoi-transition/process-symmetric-transitions.d.ts +7 -0
  22. package/dist/ssgoi-transition/process-symmetric-transitions.d.ts.map +1 -0
  23. package/dist/ssgoi-transition/types.d.ts +8 -0
  24. package/dist/ssgoi-transition/types.d.ts.map +1 -0
  25. package/dist/{create-transition-callback.d.ts → transition/create-transition-callback.d.ts} +1 -1
  26. package/dist/transition/create-transition-callback.d.ts.map +1 -0
  27. package/dist/{transition-strategy.d.ts → transition/transition-strategy.d.ts} +1 -1
  28. package/dist/transition/transition-strategy.d.ts.map +1 -0
  29. package/dist/{transition.d.ts → transition/transition.d.ts} +1 -1
  30. package/dist/transition/transition.d.ts.map +1 -0
  31. package/dist/utils/index.d.ts +1 -0
  32. package/dist/utils/index.d.ts.map +1 -1
  33. package/dist/utils/number.d.ts +46 -0
  34. package/dist/utils/number.d.ts.map +1 -0
  35. package/dist/view-transitions/drill.d.ts.map +1 -1
  36. package/dist/view-transitions/fade.d.ts.map +1 -1
  37. package/dist/view-transitions/hero.d.ts.map +1 -1
  38. package/dist/view-transitions/index.cjs +15 -15
  39. package/dist/view-transitions/index.d.ts +1 -0
  40. package/dist/view-transitions/index.d.ts.map +1 -1
  41. package/dist/view-transitions/index.js +646 -480
  42. package/dist/view-transitions/instagram.d.ts +8 -0
  43. package/dist/view-transitions/instagram.d.ts.map +1 -0
  44. package/dist/view-transitions/pinterest.d.ts.map +1 -1
  45. package/dist/view-transitions/scroll.d.ts.map +1 -1
  46. package/dist/view-transitions/slide.d.ts.map +1 -1
  47. package/dist/view-transitions/strip.d.ts.map +1 -1
  48. package/package.json +1 -1
  49. package/dist/animate.d.ts.map +0 -1
  50. package/dist/animation-scheduler.d.ts.map +0 -1
  51. package/dist/animator.d.ts.map +0 -1
  52. package/dist/create-ssgoi-transition-context.d.ts +0 -15
  53. package/dist/create-ssgoi-transition-context.d.ts.map +0 -1
  54. package/dist/create-transition-callback.d.ts.map +0 -1
  55. package/dist/ticker.d.ts.map +0 -1
  56. package/dist/transition-strategy.d.ts.map +0 -1
  57. package/dist/transition.d.ts.map +0 -1
  58. package/dist/utils.d.ts +0 -17
  59. package/dist/utils.d.ts.map +0 -1
  60. /package/dist/{animate.d.ts → animator/animate.d.ts} +0 -0
  61. /package/dist/{ticker.d.ts → animator/ticker.d.ts} +0 -0
@@ -1,20 +1,25 @@
1
- import { p as b, g as T } from "../jaemin-BAi8PTrj.js";
2
- import { a as Wt } from "../jaemin-BAi8PTrj.js";
3
- const G = (t) => new Promise((e) => setTimeout(e, t)), M = { stiffness: 80, damping: 25 }, V = { stiffness: 75, damping: 25 }, q = 300, j = 10, K = "horizontal", Z = "#000000", St = (t = {}) => {
1
+ import { p as m, g as L } from "../jaemin-BAi8PTrj.js";
2
+ import { a as qt } from "../jaemin-BAi8PTrj.js";
3
+ const U = (t) => new Promise((n) => setTimeout(n, t));
4
+ function G(t, n = 0) {
5
+ const i = Math.pow(10, n);
6
+ return Math.round(t * i) / i;
7
+ }
8
+ const V = { stiffness: 80, damping: 25 }, j = { stiffness: 75, damping: 25 }, K = 300, Z = 10, J = "horizontal", Q = "#000000", Dt = (t = {}) => {
4
9
  const {
5
- inSpring: e = V,
6
- outSpring: r = M,
7
- transitionDelay: c = q,
8
- blindCount: s = j,
9
- direction: o = K,
10
- staggerDelay: l = 100,
11
- blindColor: n = Z
10
+ inSpring: n = j,
11
+ outSpring: i = V,
12
+ transitionDelay: d = K,
13
+ blindCount: r = Z,
14
+ direction: s = J,
15
+ staggerDelay: h = 100,
16
+ blindColor: e = Q
12
17
  } = t;
13
- let i, d = null;
14
- const a = (h, g, y = "left") => {
15
- window.getComputedStyle(h).position === "static" && (h.style.position = "relative");
16
- const p = document.createElement("div");
17
- p.className = "blind-container", p.style.cssText = `
18
+ let a, o = null;
19
+ const l = (p, g, u = "left") => {
20
+ window.getComputedStyle(p).position === "static" && (p.style.position = "relative");
21
+ const c = document.createElement("div");
22
+ c.className = "blind-container", c.style.cssText = `
18
23
  position: absolute;
19
24
  top: 0;
20
25
  left: 0;
@@ -25,687 +30,847 @@ const G = (t) => new Promise((e) => setTimeout(e, t)), M = { stiffness: 80, damp
25
30
  overflow: hidden;
26
31
  `;
27
32
  const f = [];
28
- for (let $ = 0; $ < s; $++) {
29
- const m = document.createElement("div");
30
- if (o === "horizontal") {
31
- const x = 100 / s, S = `calc(${x}% + 1px)`;
32
- m.style.cssText = `
33
+ for (let $ = 0; $ < r; $++) {
34
+ const x = document.createElement("div");
35
+ if (s === "horizontal") {
36
+ const w = 100 / r, T = `calc(${w}% + 1px)`;
37
+ x.style.cssText = `
33
38
  position: absolute;
34
- top: ${x * $}%;
39
+ top: ${w * $}%;
35
40
  left: 0;
36
41
  width: 100%;
37
- height: ${S};
38
- background: ${n};
42
+ height: ${T};
43
+ background: ${e};
39
44
  transform: scaleX(${g === "hidden" ? 0 : 1});
40
- transform-origin: ${y} center;
45
+ transform-origin: ${u} center;
41
46
  will-change: transform;
42
47
  `;
43
48
  } else {
44
- const x = 100 / s, S = `calc(${x}% + 1px)`;
45
- m.style.cssText = `
49
+ const w = 100 / r, T = `calc(${w}% + 1px)`;
50
+ x.style.cssText = `
46
51
  position: absolute;
47
52
  top: 0;
48
- left: ${x * $}%;
49
- width: ${S};
53
+ left: ${w * $}%;
54
+ width: ${T};
50
55
  height: 100%;
51
- background: ${n};
56
+ background: ${e};
52
57
  transform: scaleY(${g === "hidden" ? 0 : 1});
53
- transform-origin: ${y === "left" ? "top" : "bottom"} center;
58
+ transform-origin: ${u === "left" ? "top" : "bottom"} center;
54
59
  will-change: transform;
55
60
  `;
56
61
  }
57
- f.push(m), p.appendChild(m);
62
+ f.push(x), c.appendChild(x);
58
63
  }
59
- return h.appendChild(p), { container: p, blinds: f };
64
+ return p.appendChild(c), { container: c, blinds: f };
60
65
  };
61
66
  return {
62
67
  out: () => {
63
- let h = null;
64
- return i = new Promise((y) => {
65
- d = y;
68
+ let p = null;
69
+ return a = new Promise((u) => {
70
+ o = u;
66
71
  }), {
67
- springs: Array.from({ length: s }, (y, u) => ({
72
+ springs: Array.from({ length: r }, (u, y) => ({
68
73
  from: 0,
69
74
  to: 1,
70
- spring: r,
71
- offset: u * l,
72
- tick: (p) => {
73
- if (!h) return;
74
- const f = h.blinds[u];
75
- f && (o === "horizontal" ? f.style.transform = `scaleX(${p})` : f.style.transform = `scaleY(${p})`);
75
+ spring: i,
76
+ offset: y * h,
77
+ tick: (c) => {
78
+ if (!p) return;
79
+ const f = p.blinds[y];
80
+ f && (s === "horizontal" ? f.style.transform = `scaleX(${c})` : f.style.transform = `scaleY(${c})`);
76
81
  }
77
82
  })),
78
83
  schedule: "chain",
79
- prepare: (y) => {
80
- b(y), y.style.zIndex = "1000", h = a(y, "hidden", "left");
84
+ prepare: (u) => {
85
+ m(u), u.style.zIndex = "1000", p = l(u, "hidden", "left");
81
86
  },
82
87
  onStart: () => {
83
88
  },
84
89
  onEnd: () => {
85
- d && d();
90
+ o && o();
86
91
  }
87
92
  };
88
93
  },
89
94
  in: () => {
90
- let h = null;
95
+ let p = null;
91
96
  return {
92
- springs: Array.from({ length: s }, (y, u) => ({
97
+ springs: Array.from({ length: r }, (u, y) => ({
93
98
  from: 1,
94
99
  to: 0,
95
- spring: e,
96
- offset: u * l,
97
- tick: (p) => {
98
- if (!h) return;
99
- const f = h.blinds[u];
100
- f && (o === "horizontal" ? f.style.transform = `scaleX(${p})` : f.style.transform = `scaleY(${p})`);
100
+ spring: n,
101
+ offset: y * h,
102
+ tick: (c) => {
103
+ if (!p) return;
104
+ const f = p.blinds[y];
105
+ f && (s === "horizontal" ? f.style.transform = `scaleX(${c})` : f.style.transform = `scaleY(${c})`);
101
106
  }
102
107
  })),
103
108
  schedule: "chain",
104
- prepare: (y) => {
105
- y.style.position = "relative", y.style.zIndex = "0", h = a(y, "closed", "right");
109
+ prepare: (u) => {
110
+ u.style.position = "relative", u.style.zIndex = "0", p = l(u, "closed", "right");
106
111
  },
107
112
  onStart: () => {
108
113
  },
109
114
  wait: async () => {
110
- i && await i, await G(c);
115
+ a && await a, await U(d);
111
116
  },
112
117
  onEnd: () => {
113
- h && h.container && h.container.remove();
118
+ p && p.container && p.container.remove();
114
119
  }
115
120
  };
116
121
  }
117
122
  };
118
- }, _t = (t = {}) => {
119
- var s, o;
120
- const { opacity: e = !1, direction: r = "enter" } = t, c = {
121
- stiffness: ((s = t.spring) == null ? void 0 : s.stiffness) ?? 150,
122
- damping: ((o = t.spring) == null ? void 0 : o.damping) ?? 20
123
+ }, R = {
124
+ stiffness: 150,
125
+ damping: 20
126
+ }, tt = {
127
+ stiffness: 100,
128
+ damping: 20
129
+ }, vt = (t = {}) => {
130
+ var s, h;
131
+ const { opacity: n = !1, direction: i = "enter" } = t, d = i === "enter" ? R : tt, r = {
132
+ stiffness: ((s = t.spring) == null ? void 0 : s.stiffness) ?? d.stiffness,
133
+ damping: ((h = t.spring) == null ? void 0 : h.damping) ?? d.damping
123
134
  };
124
- return r === "enter" ? {
125
- in: (l) => ({
126
- spring: c,
127
- tick: (n) => {
128
- l.style.transform = `translateX(${(1 - n) * 100}%)`, e && (l.style.opacity = n.toString());
135
+ return i === "enter" ? {
136
+ in: (e) => ({
137
+ spring: r,
138
+ prepare: () => {
139
+ e.style.willChange = n ? "transform, opacity" : "transform";
140
+ },
141
+ tick: (a) => {
142
+ e.style.transform = `translateX(${(1 - a) * 100}%)`, n && (e.style.opacity = a.toString());
143
+ },
144
+ onEnd: () => {
145
+ e.style.willChange = "auto";
129
146
  }
130
147
  }),
131
- out: (l, n) => ({
132
- spring: c,
133
- prepare: (i) => {
134
- b(i, n), i.style.zIndex = "-1";
148
+ out: (e, a) => ({
149
+ spring: r,
150
+ prepare: (o) => {
151
+ m(o, a), o.style.zIndex = "-1", o.style.willChange = n ? "transform, opacity" : "transform";
135
152
  },
136
- tick: (i) => {
137
- l.style.transform = `translateX(${-(1 - i) * 20}%)`, e && (l.style.opacity = i.toString());
153
+ tick: (o) => {
154
+ e.style.transform = `translateX(${-(1 - o) * 20}%)`, n && (e.style.opacity = o.toString());
138
155
  }
139
156
  })
140
157
  } : {
141
- in: (l) => ({
142
- spring: {
143
- stiffness: 100,
144
- damping: 20
158
+ in: (e) => ({
159
+ spring: r,
160
+ prepare: () => {
161
+ e.style.willChange = n ? "transform, opacity" : "transform";
162
+ },
163
+ tick: (a) => {
164
+ e.style.transform = `translateX(${-(1 - a) * 20}%)`, n && (e.style.opacity = a.toString());
145
165
  },
146
- tick: (n) => {
147
- l.style.transform = `translateX(${-(1 - n) * 20}%)`, e && (l.style.opacity = n.toString());
166
+ onEnd: () => {
167
+ e.style.willChange = "auto";
148
168
  }
149
169
  }),
150
- out: (l, n) => ({
151
- spring: {
152
- stiffness: 100,
153
- damping: 20
154
- },
155
- prepare: (i) => {
156
- b(i, n), i.style.zIndex = "100";
170
+ out: (e, a) => ({
171
+ spring: r,
172
+ prepare: (o) => {
173
+ m(o, a), o.style.willChange = n ? "transform, opacity" : "transform", o.style.zIndex = "100";
157
174
  },
158
- tick: (i) => {
159
- l.style.transform = `translateX(${(1 - i) * 100}%)`, e && (l.style.opacity = i.toString());
175
+ tick: (o) => {
176
+ e.style.transform = `translateX(${(1 - o) * 100}%)`, n && (e.style.opacity = o.toString());
160
177
  }
161
178
  })
162
179
  };
163
- }, J = (t) => new Promise((e) => setTimeout(e, t)), Q = { stiffness: 7, damping: 4 }, R = { stiffness: 8, damping: 4 }, tt = 0, Ct = (t = {}) => {
180
+ }, nt = { stiffness: 65, damping: 16 }, et = { stiffness: 65, damping: 14 }, it = 0, Ft = (t = {}) => {
164
181
  const {
165
- inSpring: e = R,
166
- outSpring: r = Q,
167
- transitionDelay: c = tt
182
+ inSpring: n = et,
183
+ outSpring: i = nt,
184
+ transitionDelay: d = it
168
185
  } = t;
169
- let s, o = null;
186
+ let r, s = null;
170
187
  return {
171
- in: (l) => ({
172
- spring: e,
173
- prepare: (n) => {
174
- n.style.opacity = "0", n.style.willChange = "opacity";
188
+ in: (h) => ({
189
+ spring: n,
190
+ prepare: (e) => {
191
+ e.style.opacity = "0", e.style.willChange = "opacity";
175
192
  },
176
193
  wait: async () => {
177
- s && (await s, await J(c));
194
+ r && (await r, await U(d));
195
+ },
196
+ tick: (e) => {
197
+ const a = G(e, 2);
198
+ h.style.opacity = a.toString();
178
199
  },
179
- tick: (n) => {
180
- l.style.opacity = n.toString();
200
+ onEnd: () => {
201
+ h.style.willChange = "auto";
181
202
  }
182
203
  }),
183
- out: (l, n) => (s = new Promise((i) => {
184
- o = i;
204
+ out: (h, e) => (r = new Promise((a) => {
205
+ s = a;
185
206
  }), {
186
- spring: r,
187
- tick: (i) => {
188
- l.style.opacity = i.toString();
207
+ spring: i,
208
+ tick: (a) => {
209
+ h.style.opacity = a.toString();
189
210
  },
190
- prepare: (i) => {
191
- b(i, n), i.style.willChange = "opacity";
211
+ prepare: () => {
212
+ m(h, e), h.style.willChange = "opacity";
192
213
  },
193
214
  onEnd: () => {
194
- o && o();
215
+ s && s(), h.style.willChange = "auto";
195
216
  }
196
217
  })
197
218
  };
198
- }, et = {
219
+ }, st = {
199
220
  stiffness: 5,
200
221
  // Lower stiffness for smoother motion
201
222
  damping: 3.5
202
223
  // Lower damping for more fluid movement
203
- }, nt = 0.8, it = "white", w = {
224
+ }, rt = 0.8, lt = "white", b = {
204
225
  start: 0,
205
226
  end: 0.45
206
227
  }, E = {
207
228
  start: 0.85,
208
229
  end: 1
209
- }, L = {
230
+ }, A = {
210
231
  start: 0.2,
211
232
  end: 0.9
212
- }, kt = (t) => {
213
- var s;
214
- const e = (t == null ? void 0 : t.spring) ?? et, r = (t == null ? void 0 : t.scale) ?? nt, c = ((s = t == null ? void 0 : t.border) == null ? void 0 : s.color) ?? it;
233
+ }, Yt = (t) => {
234
+ var r;
235
+ const n = (t == null ? void 0 : t.spring) ?? st, i = (t == null ? void 0 : t.scale) ?? rt, d = ((r = t == null ? void 0 : t.border) == null ? void 0 : r.color) ?? lt;
215
236
  return {
216
- out: async (o, l) => {
217
- const n = P(l), i = T(document.body, l.positionedParent), d = rt(c, {
218
- ...n,
219
- top: i.top
237
+ out: async (s, h) => {
238
+ const e = I(h), a = L(document.body, h.positionedParent), o = ot(d, {
239
+ ...e,
240
+ top: a.top
220
241
  });
221
- let a = 1, h = -n.top;
242
+ let l = 1, p = -e.top;
222
243
  return {
223
- spring: e,
244
+ spring: n,
224
245
  prepare: () => {
225
- b(o), I(o, n), D(o, n), ot(o, n);
226
- for (const g of d)
227
- l.positionedParent.appendChild(g);
246
+ m(s), P(s, e), D(s, e), ht(s, e);
247
+ for (const g of o)
248
+ h.positionedParent.appendChild(g);
228
249
  },
229
250
  onEnd: () => {
230
- o.style.clipPath = "", o.style.transformOrigin = "", setTimeout(() => {
231
- for (const g of d)
232
- l.positionedParent.removeChild(g);
251
+ s.style.clipPath = "", s.style.transformOrigin = "", setTimeout(() => {
252
+ for (const g of o)
253
+ h.positionedParent.removeChild(g);
233
254
  }, 1e3);
234
255
  },
235
256
  tick: (g) => {
236
- const y = 1 - g;
237
- if (w.start <= y && y <= w.end) {
238
- const f = A(
239
- y,
240
- w.start,
241
- w.end
257
+ const u = 1 - g;
258
+ if (b.start <= u && u <= b.end) {
259
+ const f = C(
260
+ u,
261
+ b.start,
262
+ b.end
242
263
  );
243
- a = 1 - (1 - r) * f;
264
+ l = 1 - (1 - i) * f;
244
265
  }
245
- if (E.start <= y && y <= E.end) {
246
- const f = A(
247
- y,
266
+ if (E.start <= u && u <= E.end) {
267
+ const f = C(
268
+ u,
248
269
  E.start,
249
270
  E.end
250
271
  );
251
- a = r + (1 - r) * f;
272
+ l = i + (1 - i) * f;
252
273
  }
253
- if (L.start <= y && y <= L.end) {
254
- const f = A(
255
- y,
256
- L.start,
257
- L.end
274
+ if (A.start <= u && u <= A.end) {
275
+ const f = C(
276
+ u,
277
+ A.start,
278
+ A.end
258
279
  );
259
- h = -n.top - n.height * f;
280
+ p = -e.top - e.height * f;
260
281
  }
261
- o.style.transform = `translateY(${h}px) scale(${a})`;
262
- const u = (n.width - n.width * a) / 2, p = (n.height - n.height * a) / 2;
263
- st(d, u, p);
282
+ s.style.transform = `translateY(${p}px) scale(${l})`;
283
+ const y = (e.width - e.width * l) / 2, c = (e.height - e.height * l) / 2;
284
+ at(o, y, c);
264
285
  }
265
286
  };
266
287
  },
267
- in: async (o, l) => {
268
- const n = P(l);
269
- let i = r, d = -n.top + n.height;
288
+ in: async (s, h) => {
289
+ const e = I(h);
290
+ let a = i, o = -e.top + e.height;
270
291
  return {
271
- spring: e,
292
+ spring: n,
272
293
  prepare: () => {
273
- I(o, n), D(o, n), o.style.transform = `translateY(${-n.top + n.height}px) scale(${r})`;
294
+ P(s, e), D(s, e), s.style.transform = `translateY(${-e.top + e.height}px) scale(${i})`;
274
295
  },
275
296
  onEnd: () => {
276
- o.style.clipPath = "", o.style.transformOrigin = "", o.style.transform = "";
297
+ s.style.clipPath = "", s.style.transformOrigin = "", s.style.transform = "";
277
298
  },
278
- tick: (a) => {
279
- if (w.start <= a && a <= w.end) {
280
- const h = A(
281
- a,
282
- w.start,
283
- w.end
299
+ tick: (l) => {
300
+ if (b.start <= l && l <= b.end) {
301
+ const p = C(
302
+ l,
303
+ b.start,
304
+ b.end
284
305
  );
285
- i = 1 - (1 - r) * h;
306
+ a = 1 - (1 - i) * p;
286
307
  }
287
- if (E.start <= a && a <= E.end) {
288
- const h = A(
289
- a,
308
+ if (E.start <= l && l <= E.end) {
309
+ const p = C(
310
+ l,
290
311
  E.start,
291
312
  E.end
292
313
  );
293
- i = r + (1 - r) * h;
314
+ a = i + (1 - i) * p;
294
315
  }
295
- if (L.start <= a && a <= L.end) {
296
- const h = A(
297
- a,
298
- L.start,
299
- L.end
316
+ if (A.start <= l && l <= A.end) {
317
+ const p = C(
318
+ l,
319
+ A.start,
320
+ A.end
300
321
  );
301
- d = -n.top + n.height * (1 - h);
322
+ o = -e.top + e.height * (1 - p);
302
323
  }
303
- o.style.transform = `translateY(${d}px) scale(${i})`;
324
+ s.style.transform = `translateY(${o}px) scale(${a})`;
304
325
  }
305
326
  };
306
327
  }
307
328
  };
308
329
  };
309
- function st(t, e, r) {
310
- const c = e * 0.7, s = r * 0.7;
311
- 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)`;
330
+ function at(t, n, i) {
331
+ const d = n * 0.7, r = i * 0.7;
332
+ t.topLeft.style.transform = `translate(${d}px, ${r}px)`, t.topRight.style.transform = `translate(${-d}px, ${r}px)`, t.bottomLeft.style.transform = `translate(${d}px, ${-r}px)`, t.bottomRight.style.transform = `translate(${-d}px, ${-r}px)`;
312
333
  }
313
- function rt(t = "white", e) {
334
+ function ot(t = "white", n) {
335
+ const r = document.createElement("div");
336
+ r.style.position = "fixed", r.style.pointerEvents = "none", r.style.zIndex = "9999", r.style.top = `${n.top - 1}px`, r.style.left = `${n.left - 1}px`, r.style.width = "15px", r.style.height = "15px";
314
337
  const s = document.createElement("div");
315
- 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";
338
+ s.style.position = "absolute", s.style.width = "15px", s.style.height = "1px", s.style.backgroundColor = t, s.style.top = "0", s.style.left = "0";
339
+ const h = document.createElement("div");
340
+ h.style.position = "absolute", h.style.width = "1px", h.style.height = "15px", h.style.backgroundColor = t, h.style.top = "0", h.style.left = "0", r.appendChild(s), r.appendChild(h);
341
+ const e = document.createElement("div");
342
+ e.style.position = "fixed", e.style.pointerEvents = "none", e.style.zIndex = "9999", e.style.top = `${n.top - 1}px`, e.style.left = `${n.left + n.width - 15 + 1}px`, e.style.width = "15px", e.style.height = "15px";
343
+ const a = document.createElement("div");
344
+ a.style.position = "absolute", a.style.width = "15px", a.style.height = "1px", a.style.backgroundColor = t, a.style.top = "0", a.style.right = "0";
316
345
  const o = document.createElement("div");
317
- o.style.position = "absolute", o.style.width = "15px", o.style.height = "1px", o.style.backgroundColor = t, o.style.top = "0", o.style.left = "0";
346
+ o.style.position = "absolute", o.style.width = "1px", o.style.height = "15px", o.style.backgroundColor = t, o.style.top = "0", o.style.right = "0", e.appendChild(a), e.appendChild(o);
318
347
  const l = document.createElement("div");
319
- 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);
320
- const n = document.createElement("div");
321
- 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";
322
- const i = document.createElement("div");
323
- i.style.position = "absolute", i.style.width = "15px", i.style.height = "1px", i.style.backgroundColor = t, i.style.top = "0", i.style.right = "0";
324
- const d = document.createElement("div");
325
- 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);
326
- const a = document.createElement("div");
327
- 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";
328
- const h = document.createElement("div");
329
- h.style.position = "absolute", h.style.width = "15px", h.style.height = "1px", h.style.backgroundColor = t, h.style.bottom = "0", h.style.left = "0";
348
+ l.style.position = "fixed", l.style.pointerEvents = "none", l.style.zIndex = "9999", l.style.top = `${n.top + n.height - 15 + 1}px`, l.style.left = `${n.left - 1}px`, l.style.width = "15px", l.style.height = "15px";
349
+ const p = document.createElement("div");
350
+ p.style.position = "absolute", p.style.width = "15px", p.style.height = "1px", p.style.backgroundColor = t, p.style.bottom = "0", p.style.left = "0";
330
351
  const g = document.createElement("div");
331
- 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(h), a.appendChild(g);
332
- const y = document.createElement("div");
333
- 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";
352
+ g.style.position = "absolute", g.style.width = "1px", g.style.height = "15px", g.style.backgroundColor = t, g.style.bottom = "0", g.style.left = "0", l.appendChild(p), l.appendChild(g);
334
353
  const u = document.createElement("div");
335
- u.style.position = "absolute", u.style.width = "15px", u.style.height = "1px", u.style.backgroundColor = t, u.style.bottom = "0", u.style.right = "0";
336
- const p = document.createElement("div");
337
- return p.style.position = "absolute", p.style.width = "1px", p.style.height = "15px", p.style.backgroundColor = t, p.style.bottom = "0", p.style.right = "0", y.appendChild(u), y.appendChild(p), {
338
- topLeft: s,
339
- topRight: n,
340
- bottomLeft: a,
341
- bottomRight: y,
354
+ 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";
355
+ const y = document.createElement("div");
356
+ y.style.position = "absolute", y.style.width = "15px", y.style.height = "1px", y.style.backgroundColor = t, y.style.bottom = "0", y.style.right = "0";
357
+ const c = document.createElement("div");
358
+ return c.style.position = "absolute", c.style.width = "1px", c.style.height = "15px", c.style.backgroundColor = t, c.style.bottom = "0", c.style.right = "0", u.appendChild(y), u.appendChild(c), {
359
+ topLeft: r,
360
+ topRight: e,
361
+ bottomLeft: l,
362
+ bottomRight: u,
342
363
  *[Symbol.iterator]() {
343
- yield s, yield n, yield a, yield y;
364
+ yield r, yield e, yield l, yield u;
344
365
  }
345
366
  };
346
367
  }
347
- function P(t) {
348
- const e = T(document.body, t.positionedParent);
368
+ function I(t) {
369
+ const n = L(document.body, t.positionedParent);
349
370
  return {
350
371
  top: t.scroll.y,
351
372
  left: 0,
352
- width: e.width,
353
- height: window.innerHeight - e.top
373
+ width: n.width,
374
+ height: window.innerHeight - n.top
354
375
  };
355
376
  }
356
- function I(t, e) {
357
- const r = e.left + e.width / 2, c = e.top + e.height / 2;
358
- t.style.transformOrigin = `${r}px ${c}px`;
377
+ function P(t, n) {
378
+ const i = n.left + n.width / 2, d = n.top + n.height / 2;
379
+ t.style.transformOrigin = `${i}px ${d}px`;
359
380
  }
360
- function D(t, e) {
381
+ function D(t, n) {
361
382
  t.style.clipPath = `polygon(
362
- ${e.left}px ${e.top}px,
363
- ${e.left + e.width}px ${e.top}px,
364
- ${e.left + e.width}px ${e.top + e.height}px,
365
- ${e.left}px ${e.top + e.height}px
383
+ ${n.left}px ${n.top}px,
384
+ ${n.left + n.width}px ${n.top}px,
385
+ ${n.left + n.width}px ${n.top + n.height}px,
386
+ ${n.left}px ${n.top + n.height}px
366
387
  )`;
367
388
  }
368
- function ot(t, e) {
369
- t.style.transform = `translateY(${-e.top}px)`;
389
+ function ht(t, n) {
390
+ t.style.transform = `translateY(${-n.top}px)`;
370
391
  }
371
- function A(t, e, r) {
372
- return t <= e ? 0 : t >= r ? 1 : (t - e) / (r - e);
392
+ function C(t, n, i) {
393
+ return t <= n ? 0 : t >= i ? 1 : (t - n) / (i - n);
373
394
  }
374
- function lt(t, e) {
375
- return t.querySelector(`[data-hero-key="${e}"]`);
395
+ function dt(t, n) {
396
+ return t.querySelector(`[data-hero-key="${n}"]`);
376
397
  }
377
- const Pt = (t = {}) => {
378
- var l, n;
379
- const e = {
380
- stiffness: ((l = t.spring) == null ? void 0 : l.stiffness) ?? 300,
381
- damping: ((n = t.spring) == null ? void 0 : n.damping) ?? 30
382
- }, r = t.timeout ?? 300, c = t.maxDistance ?? 700;
383
- let s = null, o = null;
398
+ const Ot = (t = {}) => {
399
+ var h, e;
400
+ const n = {
401
+ stiffness: ((h = t.spring) == null ? void 0 : h.stiffness) ?? 300,
402
+ damping: ((e = t.spring) == null ? void 0 : e.damping) ?? 30
403
+ }, i = t.timeout ?? 300, d = t.maxDistance ?? 700;
404
+ let r = null, s = null;
384
405
  return {
385
- in: async (i, d) => {
386
- const a = i, h = Array.from(a.querySelectorAll("[data-hero-key]"));
387
- if (h.length === 0)
406
+ in: async (a, o) => {
407
+ const l = a, p = Array.from(l.querySelectorAll("[data-hero-key]"));
408
+ if (p.length === 0)
388
409
  return {
389
- spring: e,
410
+ spring: n,
390
411
  tick: () => {
391
412
  }
392
413
  // No hero elements, skip animation
393
414
  };
394
- if (!await new Promise((u) => {
395
- s ? u(!0) : (o = u, setTimeout(() => {
396
- o = null, u(!1);
397
- }, r));
398
- }) || !s)
399
- return s = null, {
400
- spring: e,
415
+ if (!await new Promise((y) => {
416
+ r ? y(!0) : (s = y, setTimeout(() => {
417
+ s = null, y(!1);
418
+ }, i));
419
+ }) || !r)
420
+ return r = null, {
421
+ spring: n,
401
422
  tick: () => {
402
423
  }
403
424
  // No fromNode, skip animation
404
425
  };
405
- const y = h.map((u) => {
406
- const p = u.getAttribute("data-hero-key");
407
- if (!p) return null;
408
- const f = lt(s, p);
426
+ const u = p.map((y) => {
427
+ const c = y.getAttribute("data-hero-key");
428
+ if (!c) return null;
429
+ const f = dt(r, c);
409
430
  if (!f) return null;
410
- const $ = u, m = T(s, f), x = T(a, $), S = m.left - x.left - d.scrollOffset.x, U = m.top - x.top - d.scrollOffset.y, W = m.width / x.width, X = m.height / x.height, N = $.style.transform, z = $.style.position, H = $.style.transformOrigin, B = $.style.zIndex;
431
+ const $ = y, x = L(r, f), w = L(l, $), T = x.left - w.left - o.scrollOffset.x, X = x.top - w.top - o.scrollOffset.y, W = x.width / w.width, z = x.height / w.height, B = $.style.transform, H = $.style.position, M = $.style.transformOrigin, N = $.style.zIndex, q = $.style.willChange;
411
432
  return {
412
433
  toEl: $,
413
- dx: S,
414
- dy: U,
434
+ dx: T,
435
+ dy: X,
415
436
  dw: W,
416
- dh: X,
417
- originalTransform: N,
418
- originalPosition: z,
419
- originalTransformOrigin: H,
420
- originalZIndex: B
437
+ dh: z,
438
+ originalTransform: B,
439
+ originalPosition: H,
440
+ originalTransformOrigin: M,
441
+ originalZIndex: N,
442
+ originalWillChange: q
421
443
  };
422
444
  }).filter(
423
- (u) => u !== null && Math.abs(u.dy) <= c
445
+ (y) => y !== null && Math.abs(y.dy) <= d
424
446
  );
425
- return s = null, y.length === 0 ? {
426
- spring: e,
447
+ return r = null, u.length === 0 ? {
448
+ spring: n,
427
449
  tick: () => {
428
450
  }
429
451
  // No matching hero elements
430
452
  } : {
431
- spring: e,
453
+ spring: n,
432
454
  prepare: () => {
433
- y.forEach(({ toEl: u }) => {
434
- u.style.position = "relative", u.style.transformOrigin = "top left", u.style.zIndex = "1000";
455
+ u.forEach(({ toEl: y }) => {
456
+ y.style.position = "relative", y.style.transformOrigin = "top left", y.style.zIndex = "1000", y.style.willChange = "transform";
435
457
  });
436
458
  },
437
- tick: (u) => {
438
- y.forEach(({ toEl: p, dx: f, dy: $, dw: m, dh: x }) => {
439
- p.style.transform = `translate(${(1 - u) * f}px,${(1 - u) * $}px) scale(${u + (1 - u) * m}, ${u + (1 - u) * x})`;
459
+ tick: (y) => {
460
+ u.forEach(({ toEl: c, dx: f, dy: $, dw: x, dh: w }) => {
461
+ c.style.transform = `translate(${(1 - y) * f}px,${(1 - y) * $}px) scale(${y + (1 - y) * x}, ${y + (1 - y) * w})`;
440
462
  });
441
463
  },
442
464
  onEnd: () => {
443
- y.forEach(
465
+ u.forEach(
444
466
  ({
445
- toEl: u,
446
- originalTransform: p,
467
+ toEl: y,
468
+ originalTransform: c,
447
469
  originalPosition: f,
448
470
  originalTransformOrigin: $,
449
- originalZIndex: m
471
+ originalZIndex: x,
472
+ originalWillChange: w
450
473
  }) => {
451
- u.style.transform = p, u.style.position = f, u.style.transformOrigin = $, u.style.zIndex = m;
474
+ y.style.transform = c, y.style.position = f, y.style.transformOrigin = $, y.style.zIndex = x, y.style.willChange = w;
452
475
  }
453
476
  );
454
477
  }
455
478
  };
456
479
  },
457
- out: async (i) => ({
480
+ out: async (a) => ({
458
481
  onStart: () => {
459
- s = i, o && (o(!0), o = null);
482
+ r = a, s && (s(!0), s = null);
460
483
  },
461
- prepare: (d) => {
462
- b(d), d.style.opacity = "0";
484
+ prepare: (o) => {
485
+ m(o), o.style.opacity = "0";
463
486
  }
464
487
  })
465
488
  };
466
489
  };
467
- function at({
490
+ function ct({
468
491
  detailRect: t,
469
- galleryRect: e,
470
- pageRect: r,
471
- scrollOffset: c
472
- }, s) {
473
- 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, h = (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;
474
- return s.style.transformOrigin = `${t.left + t.width / 2}px ${t.top + t.height / 2}px`, (u) => {
475
- const p = 1 - u, f = a * p, $ = h * p, m = g * p, x = y * p;
476
- s.style.clipPath = `inset(${f}% ${$}% ${m}% ${x}%)`, s.style.transform = `translate(${o * p}px, ${l * p}px) scale(${1 + (d - 1) * p})`;
492
+ galleryRect: n,
493
+ pageRect: i,
494
+ scrollOffset: d
495
+ }, r) {
496
+ const s = n.left - t.left + (n.width - t.width) / 2 - d.x, h = n.top - t.top + (n.height - t.height) / 2 - d.y, e = n.width / t.width, a = n.height / t.height, o = Math.max(e, a), l = 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;
497
+ return r.style.transformOrigin = `${t.left + t.width / 2}px ${t.top + t.height / 2}px`, (y) => {
498
+ const c = 1 - y, f = l * c, $ = p * c, x = g * c, w = u * c;
499
+ r.style.clipPath = `inset(${f}% ${$}% ${x}% ${w}%)`, r.style.transform = `translate(${s * c}px, ${h * c}px) scale(${1 + (o - 1) * c})`;
477
500
  };
478
501
  }
479
- function dt({
502
+ function pt({
503
+ detailRect: t,
504
+ galleryRect: n,
505
+ pageRect: i,
506
+ scrollOffset: d
507
+ }, r) {
508
+ const s = n.left - t.left + (n.width - t.width) / 2 + d.x, h = n.top - t.top + (n.height - t.height) / 2 + d.y, e = n.width / t.width, a = n.height / t.height, o = Math.min(e, a), l = 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;
509
+ return r.style.transformOrigin = `${t.left + t.width / 2}px ${t.top + t.height / 2}px`, (y) => {
510
+ const c = 1 - y, f = l * c, $ = p * c, x = g * c, w = u * c;
511
+ r.style.clipPath = `inset(${f}% ${$}% ${x}% ${w}%)`, r.style.transform = `translate(${s * c - d.x}px, ${h * c - d.y}px) scale(${1 + (o - 1) * c})`;
512
+ };
513
+ }
514
+ function yt(t, n, i) {
515
+ const d = t.querySelector(
516
+ "[data-instagram-detail-key]"
517
+ ), r = n.querySelector(
518
+ "[data-instagram-detail-key]"
519
+ );
520
+ if (t.querySelectorAll("[data-instagram-detail-key]").length > 1 || n.querySelectorAll("[data-instagram-detail-key]").length > 1)
521
+ return null;
522
+ let s = null, h = null, e = !1;
523
+ if (!d && r) {
524
+ h = r;
525
+ const l = h.getAttribute("data-instagram-detail-key");
526
+ if (!l) return null;
527
+ s = t.querySelector(
528
+ `[data-instagram-gallery-key="${l}"]`
529
+ ), s && (e = !0);
530
+ } else if (d && !r) {
531
+ h = d;
532
+ const l = h.getAttribute("data-instagram-detail-key");
533
+ if (!l) return null;
534
+ s = n.querySelector(
535
+ `[data-instagram-gallery-key="${l}"]`
536
+ ), s && (e = !1);
537
+ }
538
+ if (!s || !h)
539
+ return null;
540
+ const a = L(e ? t : n, s), o = L(e ? n : t, h);
541
+ return e ? {
542
+ isEnterMode: !0,
543
+ inAnimation: ct(
544
+ {
545
+ detailRect: o,
546
+ galleryRect: a,
547
+ pageRect: n.getBoundingClientRect(),
548
+ scrollOffset: i
549
+ },
550
+ n
551
+ )
552
+ // No outAnimation - gallery stays visible
553
+ } : {
554
+ isEnterMode: !1,
555
+ outAnimation: pt(
556
+ {
557
+ detailRect: o,
558
+ galleryRect: a,
559
+ pageRect: t.getBoundingClientRect(),
560
+ scrollOffset: i
561
+ },
562
+ t
563
+ )
564
+ // No inAnimation - gallery stays visible
565
+ };
566
+ }
567
+ const Ut = (t = {}) => {
568
+ var h, e;
569
+ const n = {
570
+ stiffness: ((h = t.spring) == null ? void 0 : h.stiffness) ?? 150,
571
+ damping: ((e = t.spring) == null ? void 0 : e.damping) ?? 20
572
+ }, i = t.timeout ?? 300;
573
+ let d = null, r = null, s = null;
574
+ return {
575
+ in: async (a, { scrollOffset: o }) => {
576
+ const l = a;
577
+ return !await new Promise((g) => {
578
+ d ? g(!0) : (r = g, setTimeout(() => {
579
+ r = null, g(!1);
580
+ }, i));
581
+ }) || !d ? (d = null, {
582
+ spring: n,
583
+ tick: () => {
584
+ }
585
+ }) : (s = yt(d, l, o), s ? (d = null, {
586
+ spring: n,
587
+ tick: (g) => {
588
+ s != null && s.inAnimation && s.inAnimation(g);
589
+ }
590
+ }) : {
591
+ spring: n,
592
+ tick: () => {
593
+ }
594
+ });
595
+ },
596
+ out: async (a, o) => ({
597
+ spring: n,
598
+ onStart: () => {
599
+ d = a, r && (r(!0), r = null);
600
+ },
601
+ prepare: (l) => {
602
+ m(l, o), s != null && s.isEnterMode || (l.style.zIndex = "-1");
603
+ },
604
+ tick: (l) => {
605
+ s != null && s.outAnimation && s.outAnimation(l);
606
+ }
607
+ })
608
+ };
609
+ };
610
+ function ut({
611
+ detailRect: t,
612
+ galleryRect: n,
613
+ pageRect: i,
614
+ scrollOffset: d
615
+ }, r) {
616
+ const s = n.left - t.left + (n.width - t.width) / 2 - d.x, h = n.top - t.top + (n.height - t.height) / 2 - d.y, e = n.width / t.width, a = n.height / t.height, o = Math.max(e, a), l = 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;
617
+ return r.style.transformOrigin = `${t.left + t.width / 2}px ${t.top + t.height / 2}px`, (y) => {
618
+ const c = 1 - y, f = l * c, $ = p * c, x = g * c, w = u * c;
619
+ r.style.clipPath = `inset(${f}% ${$}% ${x}% ${w}%)`, r.style.transform = `translate(${s * c}px, ${h * c}px) scale(${1 + (o - 1) * c})`;
620
+ };
621
+ }
622
+ function gt({
480
623
  galleryRect: t,
481
- detailRect: e,
482
- scrollOffset: r
483
- }, c) {
484
- 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);
485
- return (d) => {
486
- c.style.transformOrigin = `${t.left + t.width / 2}px ${t.top + t.height / 2}px`;
487
- const a = 1 - d;
488
- c.style.transform = `translate(${s * a - r.x}px, ${o * a - r.y}px) scale(${1 + (i - 1) * a})`, c.style.opacity = `${1 - a}`;
624
+ detailRect: n,
625
+ scrollOffset: i
626
+ }, d) {
627
+ const r = n.left - t.left + (n.width - t.width) / 2 + i.x, s = n.top - t.top + (n.height - t.height) / 2 + i.y, h = n.width / t.width, e = n.height / t.height, a = Math.max(h, e);
628
+ return (o) => {
629
+ d.style.transformOrigin = `${t.left + t.width / 2}px ${t.top + t.height / 2}px`;
630
+ const l = 1 - o;
631
+ d.style.transform = `translate(${r * l - i.x}px, ${s * l - i.y}px) scale(${1 + (a - 1) * l})`, d.style.opacity = `${1 - l}`;
489
632
  };
490
633
  }
491
- function ct({
634
+ function ft({
492
635
  galleryRect: t,
493
- detailRect: e,
494
- scrollOffset: r
495
- }, c) {
496
- 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);
497
- return (d) => {
498
- const a = 1 - d, h = d;
499
- 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 = `${h}`;
636
+ detailRect: n,
637
+ scrollOffset: i
638
+ }, d) {
639
+ const r = n.left - t.left + (n.width - t.width) / 2 - i.x, s = n.top - t.top + (n.height - t.height) / 2 - i.y, h = n.width / t.width, e = n.height / t.height, a = Math.max(h, e);
640
+ return (o) => {
641
+ const l = 1 - o, p = o;
642
+ d.style.transformOrigin = `${t.left + t.width / 2}px ${t.top + t.height / 2}px`, d.style.transform = `translate(${r * l}px, ${s * l}px) scale(${1 + (a - 1) * l})`, d.style.opacity = `${p}`;
500
643
  };
501
644
  }
502
- function ht({
645
+ function $t({
503
646
  detailRect: t,
504
- galleryRect: e,
505
- pageRect: r,
506
- scrollOffset: c
507
- }, s) {
508
- 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, h = (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;
509
- return s.style.transformOrigin = `${t.left + t.width / 2}px ${t.top + t.height / 2}px`, (u) => {
510
- const p = 1 - u, f = a * p, $ = h * p, m = g * p, x = y * p;
511
- s.style.clipPath = `inset(${f}% ${$}% ${m}% ${x}%)`, s.style.transform = `translate(${o * p - c.x}px, ${l * p - c.y}px) scale(${1 + (d - 1) * p})`;
647
+ galleryRect: n,
648
+ pageRect: i,
649
+ scrollOffset: d
650
+ }, r) {
651
+ const s = n.left - t.left + (n.width - t.width) / 2 + d.x, h = n.top - t.top + (n.height - t.height) / 2 + d.y, e = n.width / t.width, a = n.height / t.height, o = Math.min(e, a), l = 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;
652
+ return r.style.transformOrigin = `${t.left + t.width / 2}px ${t.top + t.height / 2}px`, (y) => {
653
+ const c = 1 - y, f = l * c, $ = p * c, x = g * c, w = u * c;
654
+ r.style.clipPath = `inset(${f}% ${$}% ${x}% ${w}%)`, r.style.transform = `translate(${s * c - d.x}px, ${h * c - d.y}px) scale(${1 + (o - 1) * c})`;
512
655
  };
513
656
  }
514
- function pt(t, e, r) {
515
- const c = t.querySelector(
657
+ function wt(t, n, i) {
658
+ const d = t.querySelector(
516
659
  "[data-pinterest-detail-key]"
517
- ), s = e.querySelector(
660
+ ), r = n.querySelector(
518
661
  "[data-pinterest-detail-key]"
519
662
  );
520
- if (t.querySelectorAll("[data-pinterest-detail-key]").length > 1 || e.querySelectorAll("[data-pinterest-detail-key]").length > 1)
663
+ if (t.querySelectorAll("[data-pinterest-detail-key]").length > 1 || n.querySelectorAll("[data-pinterest-detail-key]").length > 1)
521
664
  return null;
522
- let o = null, l = null, n = !1;
523
- if (!c && s) {
524
- l = s;
525
- const h = l.getAttribute("data-pinterest-detail-key");
526
- if (!h) return null;
527
- o = t.querySelector(
528
- `[data-pinterest-gallery-key="${h}"]`
529
- ), o && (n = !0);
530
- } else if (c && !s) {
531
- l = c;
532
- const h = l.getAttribute("data-pinterest-detail-key");
533
- if (!h) return null;
534
- o = e.querySelector(
535
- `[data-pinterest-gallery-key="${h}"]`
536
- ), o && (n = !1);
665
+ let s = null, h = null, e = !1;
666
+ if (!d && r) {
667
+ h = r;
668
+ const l = h.getAttribute("data-pinterest-detail-key");
669
+ if (!l) return null;
670
+ s = t.querySelector(
671
+ `[data-pinterest-gallery-key="${l}"]`
672
+ ), s && (e = !0);
673
+ } else if (d && !r) {
674
+ h = d;
675
+ const l = h.getAttribute("data-pinterest-detail-key");
676
+ if (!l) return null;
677
+ s = n.querySelector(
678
+ `[data-pinterest-gallery-key="${l}"]`
679
+ ), s && (e = !1);
537
680
  }
538
- if (!o || !l)
681
+ if (!s || !h)
539
682
  return null;
540
- const i = T(n ? t : e, o), d = T(n ? e : t, l), a = e.getBoundingClientRect();
541
- return n ? {
542
- inAnimation: at(
543
- { detailRect: d, galleryRect: i, pageRect: a, scrollOffset: r },
544
- e
683
+ const a = L(e ? t : n, s), o = L(e ? n : t, h);
684
+ return e ? {
685
+ inAnimation: ut(
686
+ {
687
+ detailRect: o,
688
+ galleryRect: a,
689
+ pageRect: n.getBoundingClientRect(),
690
+ scrollOffset: i
691
+ },
692
+ n
545
693
  ),
546
- outAnimation: dt(
547
- { galleryRect: i, detailRect: d, scrollOffset: r },
694
+ outAnimation: gt(
695
+ { galleryRect: a, detailRect: o, scrollOffset: i },
548
696
  t
549
697
  )
550
698
  } : {
551
- inAnimation: ct(
552
- { galleryRect: i, detailRect: d, scrollOffset: r },
553
- e
699
+ inAnimation: ft(
700
+ { galleryRect: a, detailRect: o, scrollOffset: i },
701
+ n
554
702
  ),
555
- outAnimation: ht(
556
- { detailRect: d, galleryRect: i, pageRect: a, scrollOffset: r },
703
+ outAnimation: $t(
704
+ {
705
+ detailRect: o,
706
+ galleryRect: a,
707
+ pageRect: t.getBoundingClientRect(),
708
+ scrollOffset: i
709
+ },
557
710
  t
558
711
  )
559
712
  };
560
713
  }
561
- const It = (t = {}) => {
562
- var l, n;
563
- const e = {
564
- stiffness: ((l = t.spring) == null ? void 0 : l.stiffness) ?? 30,
565
- damping: ((n = t.spring) == null ? void 0 : n.damping) ?? 10
566
- }, r = t.timeout ?? 300;
567
- let c = null, s = null, o = null;
714
+ const Xt = (t = {}) => {
715
+ var h, e;
716
+ const n = {
717
+ stiffness: ((h = t.spring) == null ? void 0 : h.stiffness) ?? 30,
718
+ damping: ((e = t.spring) == null ? void 0 : e.damping) ?? 10
719
+ }, i = t.timeout ?? 300;
720
+ let d = null, r = null, s = null;
568
721
  return {
569
- in: async (i, { scrollOffset: d }) => {
570
- const a = i;
722
+ in: async (a, { scrollOffset: o }) => {
723
+ const l = a;
571
724
  return !await new Promise((g) => {
572
- c ? g(!0) : (s = g, setTimeout(() => {
573
- s = null, g(!1);
574
- }, r));
575
- }) || !c ? (c = null, {
576
- spring: e,
725
+ d ? g(!0) : (r = g, setTimeout(() => {
726
+ r = null, g(!1);
727
+ }, i));
728
+ }) || !d ? (d = null, {
729
+ spring: n,
577
730
  tick: () => {
578
731
  }
579
- }) : (o = pt(c, a, d), o ? (c = null, {
580
- spring: e,
732
+ }) : (s = wt(d, l, o), s ? (d = null, {
733
+ spring: n,
581
734
  tick: (g) => {
582
- o && o.inAnimation(g);
735
+ s && s.inAnimation(g);
583
736
  }
584
737
  }) : {
585
- spring: e,
738
+ spring: n,
586
739
  tick: () => {
587
740
  }
588
741
  });
589
742
  },
590
- out: async (i) => ({
591
- spring: e,
743
+ out: async (a) => ({
744
+ spring: n,
592
745
  onStart: () => {
593
- c = i, s && (s(!0), s = null);
746
+ d = a, r && (r(!0), r = null);
594
747
  },
595
- prepare: (d) => {
596
- b(d), d.style.zIndex = "-1";
748
+ prepare: (o) => {
749
+ m(o), o.style.zIndex = "-1";
597
750
  },
598
- tick: (d) => {
599
- o && o.outAnimation(d);
751
+ tick: (o) => {
752
+ s && s.outAnimation(o);
600
753
  }
601
754
  })
602
755
  };
603
756
  }, v = {
604
757
  stiffness: 5,
605
758
  damping: 4
606
- }, Dt = (t = {}) => {
607
- var i, d;
608
- const e = t.direction ?? "up", r = {
609
- stiffness: ((i = t.spring) == null ? void 0 : i.stiffness) ?? v.stiffness,
610
- damping: ((d = t.spring) == null ? void 0 : d.damping) ?? v.damping
611
- }, c = e === "up";
612
- let s = null, o = null, l = null;
613
- const n = () => {
614
- if (s === null || o === null)
759
+ }, Wt = (t = {}) => {
760
+ var a, o;
761
+ const n = t.direction ?? "up", i = {
762
+ stiffness: ((a = t.spring) == null ? void 0 : a.stiffness) ?? v.stiffness,
763
+ damping: ((o = t.spring) == null ? void 0 : o.damping) ?? v.damping
764
+ }, d = n === "up";
765
+ let r = null, s = null, h = null;
766
+ const e = () => {
767
+ if (r === null || s === null)
615
768
  return null;
616
- const a = Math.min(s, o), h = window.innerHeight;
617
- return Math.max(a, h);
769
+ const l = Math.min(r, s), p = window.innerHeight;
770
+ return Math.max(l, p);
618
771
  };
619
772
  return {
620
- in: (a) => (o = a.offsetHeight, s !== null && (l = n()), {
621
- spring: r,
622
- tick: (h) => {
623
- if (l === null && (l = n(), l === null))
773
+ in: (l) => (s = l.offsetHeight, r !== null && (h = e()), {
774
+ spring: i,
775
+ prepare: () => {
776
+ l.style.willChange = "transform";
777
+ },
778
+ tick: (p) => {
779
+ if (h === null && (h = e(), h === null))
624
780
  return;
625
- const g = c ? (1 - h) * l : (1 - h) * -l;
626
- a.style.transform = `translateY(${g}px)`;
781
+ const g = d ? (1 - p) * h : (1 - p) * -h;
782
+ l.style.transform = `translateY(${g}px)`;
783
+ },
784
+ onEnd: () => {
785
+ l.style.willChange = "auto";
627
786
  }
628
787
  }),
629
- out: (a) => ({
630
- spring: r,
788
+ out: (l) => ({
789
+ spring: i,
631
790
  onStart: () => {
632
- s = a.offsetHeight, o !== null && (l = n());
791
+ r = l.offsetHeight, s !== null && (h = e());
633
792
  },
634
- tick: (h) => {
635
- if (l === null && (l = n(), l === null))
793
+ tick: (p) => {
794
+ if (h === null && (h = e(), h === null))
636
795
  return;
637
- const g = c ? (1 - h) * -l : (1 - h) * l;
638
- a.style.transform = `translateY(${g}px)`;
796
+ const g = d ? (1 - p) * -h : (1 - p) * h;
797
+ l.style.transform = `translateY(${g}px)`;
639
798
  },
640
- prepare: (h) => {
641
- b(h), h.style.zIndex = c ? "-1" : "1";
799
+ prepare: (p) => {
800
+ m(p), p.style.zIndex = d ? "-1" : "1", p.style.willChange = "transform";
642
801
  }
643
802
  })
644
803
  };
645
804
  }, F = {
646
805
  stiffness: 15,
647
806
  damping: 7
648
- }, vt = (t = {}) => {
649
- var s, o;
650
- const e = t.direction ?? "left", r = {
651
- stiffness: ((s = t.spring) == null ? void 0 : s.stiffness) ?? F.stiffness,
652
- damping: ((o = t.spring) == null ? void 0 : o.damping) ?? F.damping
653
- }, c = e === "left";
807
+ }, zt = (t = {}) => {
808
+ var r, s;
809
+ const n = t.direction ?? "left", i = {
810
+ stiffness: ((r = t.spring) == null ? void 0 : r.stiffness) ?? F.stiffness,
811
+ damping: ((s = t.spring) == null ? void 0 : s.damping) ?? F.damping
812
+ }, d = n === "left";
654
813
  return {
655
- in: (l) => ({
656
- spring: r,
657
- tick: (n) => {
658
- const i = c ? (1 - n) * 100 : (1 - n) * -100;
659
- l.style.transform = `translateX(${i}%)`;
814
+ in: (h) => ({
815
+ spring: i,
816
+ prepare: () => {
817
+ h.style.willChange = "transform";
818
+ },
819
+ tick: (e) => {
820
+ const a = d ? (1 - e) * 100 : (1 - e) * -100;
821
+ h.style.transform = `translateX(${a}%)`;
822
+ },
823
+ onEnd: () => {
824
+ h.style.willChange = "auto";
660
825
  }
661
826
  }),
662
- out: (l, n) => ({
663
- spring: r,
664
- tick: (i) => {
665
- const d = c ? (1 - i) * -100 : (1 - i) * 100;
666
- l.style.transform = `translateX(${d}%)`;
827
+ out: (h, e) => ({
828
+ spring: i,
829
+ tick: (a) => {
830
+ const o = d ? (1 - a) * -100 : (1 - a) * 100;
831
+ h.style.transform = `translateX(${o}%)`;
667
832
  },
668
- prepare: (i) => {
669
- b(i, n), i.style.zIndex = c ? "-1" : "1";
833
+ prepare: (a) => {
834
+ m(a, e), a.style.zIndex = d ? "-1" : "1", a.style.willChange = "transform";
670
835
  }
671
836
  })
672
837
  };
673
- }, O = { stiffness: 17, damping: 6 }, C = 20, k = 800, Ft = () => {
674
- let t, e = null;
838
+ }, Y = { stiffness: 17, damping: 6 }, k = 20, _ = 800, Bt = () => {
839
+ let t, n = null;
675
840
  return {
676
- in: (r) => ({
677
- spring: O,
678
- prepare: (c) => {
679
- c.style.transform = `perspective(${k}px) rotateY(${C}deg) translateX(-100%)`;
841
+ in: (i) => ({
842
+ spring: Y,
843
+ prepare: (d) => {
844
+ d.style.willChange = "transform", d.style.transform = `perspective(${_}px) rotateY(${k}deg) translateX(-100%)`;
680
845
  },
681
846
  wait: async () => {
682
847
  t && await t;
683
848
  },
684
- tick: (c) => {
685
- const s = (1 - c) * C, o = -(1 - c) * 100;
686
- r.style.transform = `perspective(${k}px) rotateY(${s}deg) translateX(${o}%)`;
849
+ tick: (d) => {
850
+ const r = (1 - d) * k, s = -(1 - d) * 100;
851
+ i.style.transform = `perspective(${_}px) rotateY(${r}deg) translateX(${s}%)`;
687
852
  },
688
853
  onEnd: () => {
689
- r.style.transform = "";
854
+ i.style.transform = "", i.style.willChange = "auto";
690
855
  }
691
856
  }),
692
- out: (r, c) => (t = new Promise((s) => {
693
- e = s;
857
+ out: (i, d) => (t = new Promise((r) => {
858
+ n = r;
694
859
  }), {
695
- spring: O,
696
- prepare: (s) => {
697
- b(s, c);
860
+ spring: Y,
861
+ prepare: (r) => {
862
+ m(r, d), r.style.willChange = "transform";
698
863
  },
699
- tick: (s) => {
700
- const o = 1 - s, l = o * C, n = o * 100;
701
- r.style.transform = `perspective(${k}px) rotateY(${-l}deg) translateX(${n}%)`;
864
+ tick: (r) => {
865
+ const s = 1 - r, h = s * k, e = s * 100;
866
+ i.style.transform = `perspective(${_}px) rotateY(${-h}deg) translateX(${e}%)`;
702
867
  },
703
868
  onEnd: () => {
704
- e && e(), r.style.transform = "";
869
+ n && n(), i.style.transform = "";
705
870
  }
706
871
  })
707
872
  };
708
- }, yt = { stiffness: 1, damping: 1 }, ut = { stiffness: 20, damping: 25 }, gt = "#000000", ft = "circle", Y = "CURTAIN_REVEAL_OVERLAY_ID", $t = {
873
+ }, xt = { stiffness: 1, damping: 1 }, mt = { stiffness: 20, damping: 25 }, bt = "#000000", Et = "circle", O = "CURTAIN_REVEAL_OVERLAY_ID", At = {
709
874
  position: "fixed",
710
875
  inset: "0",
711
876
  width: "100vw",
@@ -715,17 +880,17 @@ const It = (t = {}) => {
715
880
  alignItems: "center",
716
881
  justifyContent: "center",
717
882
  overflow: "hidden"
718
- }, mt = {
883
+ }, Lt = {
719
884
  position: "relative",
720
885
  display: "inline-block",
721
886
  height: "5.5rem",
722
887
  overflow: "hidden"
723
- }, xt = {
888
+ }, Ct = {
724
889
  display: "flex",
725
890
  height: "100%",
726
891
  willChange: "transform",
727
892
  transition: "transform 0.3s ease"
728
- }, bt = {
893
+ }, Tt = {
729
894
  display: "inline-flex",
730
895
  alignItems: "center",
731
896
  justifyContent: "center",
@@ -734,103 +899,104 @@ const It = (t = {}) => {
734
899
  fontWeight: "900",
735
900
  letterSpacing: "0.02em",
736
901
  color: "#FFFFFF"
737
- }, wt = 0.4, _ = 0.5, Et = 0.2;
738
- function Lt(t, e) {
902
+ }, St = 0.4, S = 0.5, kt = 0.2;
903
+ function _t(t, n) {
739
904
  switch (t) {
740
905
  case "circle":
741
- return `circle(${e * 100}% at 50% 50%)`;
906
+ return `circle(${n * 100}% at 50% 50%)`;
742
907
  case "square":
743
- return `inset(${(1 - e) * 50}% round ${10 * e}%)`;
908
+ return `inset(${(1 - n) * 50}% round ${10 * n}%)`;
744
909
  case "triangle": {
745
- const r = e * 100;
746
- return `polygon(50% ${50 - r}%, ${50 - r}% ${50 + r}%, ${50 + r}% ${50 + r}%)`;
910
+ const i = n * 100;
911
+ return `polygon(50% ${50 - i}%, ${50 - i}% ${50 + i}%, ${50 + i}% ${50 + i}%)`;
747
912
  }
748
913
  }
749
914
  }
750
- const At = (t) => t.reduce((e, r) => e + r, 0), Ot = (t = {}) => {
915
+ const It = (t) => t.reduce((n, i) => n + i, 0), Ht = (t = {}) => {
751
916
  const {
752
- background: e = gt,
753
- texts: r = [],
754
- shape: c = ft,
755
- inSpring: s = ut,
756
- outSpring: o = yt,
757
- textStyle: l = {}
917
+ background: n = bt,
918
+ texts: i = [],
919
+ shape: d = Et,
920
+ inSpring: r = mt,
921
+ outSpring: s = xt,
922
+ textStyle: h = {}
758
923
  } = t;
759
924
  return {
760
- out: (n, i) => {
761
- const d = n.style.opacity;
925
+ out: (e, a) => {
926
+ const o = e.style.opacity;
762
927
  return {
763
- spring: o,
928
+ spring: s,
764
929
  from: 1,
765
930
  to: 0,
766
- prepare: (a) => {
767
- b(a, i), a.style.opacity = "1";
931
+ prepare: (l) => {
932
+ m(l, a), l.style.opacity = "1";
768
933
  },
769
- tick: (a) => {
770
- const h = Math.max(0, a - wt);
771
- n.style.opacity = String(h);
934
+ tick: (l) => {
935
+ const p = Math.max(0, l - St);
936
+ e.style.opacity = String(p);
772
937
  },
773
938
  onEnd: () => {
774
- n.style.opacity = d;
939
+ e.style.opacity = o;
775
940
  }
776
941
  };
777
942
  },
778
- in: (n) => {
779
- let i = null, d = null, a = null;
780
- const h = document.body.style.overflow, g = document.getElementById(
781
- Y
943
+ in: (e) => {
944
+ let a = null, o = null, l = null;
945
+ const p = document.body.style.overflow, g = document.getElementById(
946
+ O
782
947
  );
783
- let y = [];
784
- const u = () => {
785
- i = document.createElement("div"), i.id = Y, Object.assign(i.style, $t, { background: e }), document.body.appendChild(i), d = document.createElement("div"), Object.assign(d.style, mt), i.appendChild(d), a = document.createElement("div"), Object.assign(a.style, xt), d.appendChild(a), r.forEach((p) => {
948
+ let u = [];
949
+ const y = () => {
950
+ a = document.createElement("div"), a.id = O, Object.assign(a.style, At, { background: n }), document.body.appendChild(a), o = document.createElement("div"), Object.assign(o.style, Lt), a.appendChild(o), l = document.createElement("div"), Object.assign(l.style, Ct), o.appendChild(l), i.forEach((c) => {
786
951
  const f = document.createElement("div");
787
- f.textContent = p, Object.assign(f.style, bt, l), a.appendChild(f);
788
- }), y = Array.from(a.children).map(
789
- (p) => p.getBoundingClientRect().width
952
+ f.textContent = c, Object.assign(f.style, Tt, h), l.appendChild(f);
953
+ }), u = Array.from(l.children).map(
954
+ (c) => c.getBoundingClientRect().width
790
955
  );
791
956
  };
792
957
  return {
793
- spring: s,
958
+ spring: r,
794
959
  from: 0,
795
960
  to: 1,
796
961
  prepare: () => {
797
- 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)");
962
+ document.body.style.overflow = "hidden", e.style.opacity = "1", g == null || g.remove(), y(), a && o && (a.style.clipPath = "none", o.style.transform = "scale(1)");
798
963
  },
799
- tick: (p) => {
800
- if (!(!i || !d || !a)) {
801
- if (p <= _ && r.length > 0) {
802
- const f = p / _, $ = Math.min(
803
- Math.floor(f * r.length),
804
- r.length - 1
805
- ), m = y[$] ?? 0, x = At(y.slice(0, $));
806
- d.style.width = `${m}px`, a.style.transform = `translateX(-${x}px)`;
964
+ tick: (c) => {
965
+ if (!(!a || !o || !l)) {
966
+ if (c <= S && i.length > 0) {
967
+ const f = c / S, $ = Math.min(
968
+ Math.floor(f * i.length),
969
+ i.length - 1
970
+ ), x = u[$] ?? 0, w = It(u.slice(0, $));
971
+ o.style.width = `${x}px`, l.style.transform = `translateX(-${w}px)`;
807
972
  }
808
- if (p > _) {
973
+ if (c > S) {
809
974
  const $ = 1 - Math.max(
810
975
  0,
811
- Math.min(1, (p - _) / Et)
976
+ Math.min(1, (c - S) / kt)
812
977
  );
813
- i.style.clipPath = Lt(c, $), d.style.transform = `scale(${$})`;
978
+ a.style.clipPath = _t(d, $), o.style.transform = `scale(${$})`;
814
979
  }
815
980
  }
816
981
  },
817
982
  onEnd: () => {
818
- i == null || i.remove(), i = d = a = null, document.body.style.overflow = h;
983
+ a == null || a.remove(), a = o = l = null, document.body.style.overflow = p;
819
984
  }
820
985
  };
821
986
  }
822
987
  };
823
988
  };
824
989
  export {
825
- St as blind,
826
- Ot as curtainReveal,
827
- _t as drill,
828
- Ct as fade,
829
- kt as film,
830
- Pt as hero,
831
- Wt as jaemin,
832
- It as pinterest,
833
- Dt as scroll,
834
- vt as slide,
835
- Ft as strip
990
+ Dt as blind,
991
+ Ht as curtainReveal,
992
+ vt as drill,
993
+ Ft as fade,
994
+ Yt as film,
995
+ Ot as hero,
996
+ Ut as instagram,
997
+ qt as jaemin,
998
+ Xt as pinterest,
999
+ Wt as scroll,
1000
+ zt as slide,
1001
+ Bt as strip
836
1002
  };