@ssgoi/core 2.4.0 → 2.5.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.
@@ -1,21 +1,21 @@
1
- const W = (t) => new Promise((n) => setTimeout(n, t)), m = (t, n) => {
2
- t.style.position = "absolute", t.style.width = "100%", t.style.top = `${-1 * ((n == null ? void 0 : n.scroll.y) ?? 0)}px`, t.style.left = "0";
3
- }, H = { stiffness: 80, damping: 25 }, X = { stiffness: 75, damping: 25 }, U = 300, N = 10, M = "horizontal", B = "#000000", rt = (t = {}) => {
1
+ import { p as b, g as A } from "../jaemin-BAi8PTrj.js";
2
+ import { a as Lt } from "../jaemin-BAi8PTrj.js";
3
+ const N = (t) => new Promise((e) => setTimeout(e, t)), B = { stiffness: 80, damping: 25 }, G = { stiffness: 75, damping: 25 }, M = 300, q = 10, V = "horizontal", j = "#000000", pt = (t = {}) => {
4
4
  const {
5
- inSpring: n = X,
6
- outSpring: l = H,
7
- transitionDelay: h = U,
8
- blindCount: o = N,
9
- direction: i = M,
10
- staggerDelay: s = 100,
11
- blindColor: e = B
5
+ inSpring: e = G,
6
+ outSpring: o = B,
7
+ transitionDelay: a = M,
8
+ blindCount: i = q,
9
+ direction: s = V,
10
+ staggerDelay: r = 100,
11
+ blindColor: n = j
12
12
  } = t;
13
- let r, d = null;
14
- const c = (p, a, g, y = !1) => {
15
- const f = Math.min(0.5, s * g / 1e3), $ = 1 - f, x = (y ? g - 1 - a : a) / g * f, w = x + $;
16
- return p <= x ? 0 : p >= w ? 1 : (p - x) / $;
17
- }, u = (p, a, g = "left") => {
18
- window.getComputedStyle(p).position === "static" && (p.style.position = "relative");
13
+ let l, c = null;
14
+ const d = (y, p, h, g = !1) => {
15
+ const f = Math.min(0.5, r * h / 1e3), $ = 1 - f, x = (g ? h - 1 - p : p) / h * f, w = x + $;
16
+ return y <= x ? 0 : y >= w ? 1 : (y - x) / $;
17
+ }, u = (y, p, h = "left") => {
18
+ window.getComputedStyle(y).position === "static" && (y.style.position = "relative");
19
19
  const f = document.createElement("div");
20
20
  f.className = "blind-container", f.style.cssText = `
21
21
  position: absolute;
@@ -28,736 +28,698 @@ const W = (t) => new Promise((n) => setTimeout(n, t)), m = (t, n) => {
28
28
  overflow: hidden;
29
29
  `;
30
30
  const $ = [];
31
- for (let b = 0; b < o; b++) {
31
+ for (let m = 0; m < i; m++) {
32
32
  const x = document.createElement("div");
33
- if (i === "horizontal") {
34
- const w = 100 / o, L = `calc(${w}% + 1px)`;
33
+ if (s === "horizontal") {
34
+ const w = 100 / i, S = `calc(${w}% + 1px)`;
35
35
  x.style.cssText = `
36
36
  position: absolute;
37
- top: ${w * b}%;
37
+ top: ${w * m}%;
38
38
  left: 0;
39
39
  width: 100%;
40
- height: ${L};
41
- background: ${e};
42
- transform: scaleX(${a === "hidden" ? 0 : 1});
43
- transform-origin: ${g} center;
40
+ height: ${S};
41
+ background: ${n};
42
+ transform: scaleX(${p === "hidden" ? 0 : 1});
43
+ transform-origin: ${h} center;
44
44
  will-change: transform;
45
45
  `;
46
46
  } else {
47
- const w = 100 / o, L = `calc(${w}% + 1px)`;
47
+ const w = 100 / i, S = `calc(${w}% + 1px)`;
48
48
  x.style.cssText = `
49
49
  position: absolute;
50
50
  top: 0;
51
- left: ${w * b}%;
52
- width: ${L};
51
+ left: ${w * m}%;
52
+ width: ${S};
53
53
  height: 100%;
54
- background: ${e};
55
- transform: scaleY(${a === "hidden" ? 0 : 1});
56
- transform-origin: ${g === "left" ? "top" : "bottom"} center;
54
+ background: ${n};
55
+ transform: scaleY(${p === "hidden" ? 0 : 1});
56
+ transform-origin: ${h === "left" ? "top" : "bottom"} center;
57
57
  will-change: transform;
58
58
  `;
59
59
  }
60
60
  $.push(x), f.appendChild(x);
61
61
  }
62
- return p.appendChild(f), { container: f, blinds: $ };
62
+ return y.appendChild(f), { container: f, blinds: $ };
63
63
  };
64
64
  return {
65
65
  out: () => {
66
- let p = null;
67
- return r = new Promise((a) => {
68
- d = a;
66
+ let y = null;
67
+ return l = new Promise((p) => {
68
+ c = p;
69
69
  }), {
70
- spring: l,
71
- prepare: (a) => {
72
- m(a), a.style.zIndex = "1000", p = u(a, "hidden", "left");
70
+ spring: o,
71
+ prepare: (p) => {
72
+ b(p), p.style.zIndex = "1000", y = u(p, "hidden", "left");
73
73
  },
74
74
  onStart: () => {
75
75
  },
76
- tick: (a) => {
77
- if (!p) return;
78
- const g = 1 - a;
79
- p.blinds.forEach((y, f) => {
80
- const $ = c(
81
- g,
76
+ tick: (p) => {
77
+ if (!y) return;
78
+ const h = 1 - p;
79
+ y.blinds.forEach((g, f) => {
80
+ const $ = d(
81
+ h,
82
82
  f,
83
- o,
83
+ i,
84
84
  !1
85
85
  // not reversed - left to right
86
86
  );
87
- i === "horizontal" ? y.style.transform = `scaleX(${$})` : y.style.transform = `scaleY(${$})`;
87
+ s === "horizontal" ? g.style.transform = `scaleX(${$})` : g.style.transform = `scaleY(${$})`;
88
88
  });
89
89
  },
90
90
  onEnd: () => {
91
- d && d();
91
+ c && c();
92
92
  }
93
93
  };
94
94
  },
95
95
  in: () => {
96
- let p = null;
96
+ let y = null;
97
97
  return {
98
- spring: n,
99
- prepare: (a) => {
100
- a.style.position = "relative", a.style.zIndex = "0", p = u(a, "closed", "right");
98
+ spring: e,
99
+ prepare: (p) => {
100
+ p.style.position = "relative", p.style.zIndex = "0", y = u(p, "closed", "right");
101
101
  },
102
102
  onStart: () => {
103
103
  },
104
104
  wait: async () => {
105
- r && await r, await W(h);
105
+ l && await l, await N(a);
106
106
  },
107
- tick: (a) => {
108
- p && p.blinds.forEach((g, y) => {
109
- const f = c(
110
- a,
111
- y,
112
- o,
107
+ tick: (p) => {
108
+ y && y.blinds.forEach((h, g) => {
109
+ const f = d(
110
+ p,
111
+ g,
112
+ i,
113
113
  !1
114
114
  // same direction as OUT - left to right
115
115
  );
116
- i === "horizontal" ? g.style.transform = `scaleX(${1 - f})` : g.style.transform = `scaleY(${1 - f})`;
116
+ s === "horizontal" ? h.style.transform = `scaleX(${1 - f})` : h.style.transform = `scaleY(${1 - f})`;
117
117
  });
118
118
  },
119
119
  onEnd: () => {
120
- p && p.container && p.container.remove();
120
+ y && y.container && y.container.remove();
121
121
  }
122
122
  };
123
123
  }
124
124
  };
125
- }, ot = (t = {}) => {
126
- var o, i;
127
- const { opacity: n = !1, direction: l = "enter" } = t, h = {
128
- stiffness: ((o = t.spring) == null ? void 0 : o.stiffness) ?? 150,
129
- damping: ((i = t.spring) == null ? void 0 : i.damping) ?? 20
125
+ }, yt = (t = {}) => {
126
+ var i, s;
127
+ const { opacity: e = !1, direction: o = "enter" } = t, a = {
128
+ stiffness: ((i = t.spring) == null ? void 0 : i.stiffness) ?? 150,
129
+ damping: ((s = t.spring) == null ? void 0 : s.damping) ?? 20
130
130
  };
131
- return l === "enter" ? {
132
- in: (s) => ({
133
- spring: h,
134
- tick: (e) => {
135
- s.style.transform = `translateX(${(1 - e) * 100}%)`, n && (s.style.opacity = e.toString());
131
+ return o === "enter" ? {
132
+ in: (r) => ({
133
+ spring: a,
134
+ tick: (n) => {
135
+ r.style.transform = `translateX(${(1 - n) * 100}%)`, e && (r.style.opacity = n.toString());
136
136
  }
137
137
  }),
138
- out: (s, e) => ({
139
- spring: h,
140
- prepare: (r) => {
141
- m(r, e), r.style.zIndex = "-1";
138
+ out: (r, n) => ({
139
+ spring: a,
140
+ prepare: (l) => {
141
+ b(l, n), l.style.zIndex = "-1";
142
142
  },
143
- tick: (r) => {
144
- s.style.transform = `translateX(${-(1 - r) * 20}%)`, n && (s.style.opacity = r.toString());
143
+ tick: (l) => {
144
+ r.style.transform = `translateX(${-(1 - l) * 20}%)`, e && (r.style.opacity = l.toString());
145
145
  }
146
146
  })
147
147
  } : {
148
- in: (s) => ({
148
+ in: (r) => ({
149
149
  spring: {
150
150
  stiffness: 100,
151
151
  damping: 20
152
152
  },
153
- tick: (e) => {
154
- s.style.transform = `translateX(${-(1 - e) * 20}%)`, n && (s.style.opacity = e.toString());
153
+ tick: (n) => {
154
+ r.style.transform = `translateX(${-(1 - n) * 20}%)`, e && (r.style.opacity = n.toString());
155
155
  }
156
156
  }),
157
- out: (s, e) => ({
157
+ out: (r, n) => ({
158
158
  spring: {
159
159
  stiffness: 100,
160
160
  damping: 20
161
161
  },
162
- prepare: (r) => {
163
- m(r, e), r.style.zIndex = "100";
162
+ prepare: (l) => {
163
+ b(l, n), l.style.zIndex = "100";
164
164
  },
165
- tick: (r) => {
166
- s.style.transform = `translateX(${(1 - r) * 100}%)`, n && (s.style.opacity = r.toString());
165
+ tick: (l) => {
166
+ r.style.transform = `translateX(${(1 - l) * 100}%)`, e && (r.style.opacity = l.toString());
167
167
  }
168
168
  })
169
169
  };
170
- }, G = (t) => new Promise((n) => setTimeout(n, t)), q = { stiffness: 400, damping: 20 }, V = { stiffness: 40, damping: 8 }, Z = 100, lt = (t = {}) => {
170
+ }, Z = (t) => new Promise((e) => setTimeout(e, t)), J = { stiffness: 400, damping: 20 }, K = { stiffness: 40, damping: 8 }, Q = 100, ut = (t = {}) => {
171
171
  const {
172
- inSpring: n = V,
173
- outSpring: l = q,
174
- transitionDelay: h = Z
172
+ inSpring: e = K,
173
+ outSpring: o = J,
174
+ transitionDelay: a = Q
175
175
  } = t;
176
- let o, i = null;
176
+ let i, s = null;
177
177
  return {
178
- in: (s) => ({
179
- spring: n,
180
- prepare: (e) => {
181
- e.style.opacity = "0";
178
+ in: (r) => ({
179
+ spring: e,
180
+ prepare: (n) => {
181
+ n.style.opacity = "0";
182
182
  },
183
183
  wait: async () => {
184
- o && (await o, await G(h));
184
+ i && (await i, await Z(a));
185
185
  },
186
- tick: (e) => {
187
- s.style.opacity = e.toString();
186
+ tick: (n) => {
187
+ r.style.opacity = n.toString();
188
188
  }
189
189
  }),
190
- out: (s, e) => (o = new Promise((r) => {
191
- i = r;
190
+ out: (r, n) => (i = new Promise((l) => {
191
+ s = l;
192
192
  }), {
193
- spring: l,
194
- tick: (r) => {
195
- s.style.opacity = r.toString();
193
+ spring: o,
194
+ tick: (l) => {
195
+ r.style.opacity = l.toString();
196
196
  },
197
- prepare: (r) => m(r, e),
197
+ prepare: (l) => b(l, n),
198
198
  onEnd: () => {
199
- i && i();
199
+ s && s();
200
200
  }
201
201
  })
202
202
  };
203
- };
204
- function P(t, n) {
205
- function l(i) {
206
- let s = 0, e = 0;
207
- const r = i.offsetWidth, d = i.offsetHeight;
208
- let c = i;
209
- for (; c; )
210
- s += c.offsetTop, e += c.offsetLeft, c = c.offsetParent;
211
- return s -= window.scrollY, e -= window.scrollX, { top: s, left: e, width: r, height: d };
212
- }
213
- const h = l(t), o = l(n);
214
- return new DOMRect(
215
- o.left - h.left,
216
- o.top - h.top,
217
- o.width,
218
- o.height
219
- );
220
- }
221
- const j = {
222
- stiffness: 10,
203
+ }, R = {
204
+ stiffness: 5,
223
205
  // Lower stiffness for smoother motion
224
- damping: 5
206
+ damping: 3.5
225
207
  // Lower damping for more fluid movement
226
- }, k = 0.2, E = 0.82;
227
- function T(t) {
228
- const n = P(document.body, t.positionedParent);
229
- return {
230
- top: t.scroll.y,
231
- left: 0,
232
- width: n.width,
233
- height: window.innerHeight - n.top
234
- };
235
- }
236
- function A(t, n) {
237
- const l = n.left + n.width / 2, h = n.top + n.height / 2;
238
- t.style.transformOrigin = `${l}px ${h}px`;
239
- }
240
- function I(t, n) {
241
- t.style.clipPath = `polygon(
242
- ${n.left}px ${n.top}px,
243
- ${n.left + n.width}px ${n.top}px,
244
- ${n.left + n.width}px ${n.top + n.height}px,
245
- ${n.left}px ${n.top + n.height}px
246
- )`;
247
- }
248
- function J(t, n) {
249
- t.style.transform = `translateY(${-n.top}px)`;
250
- }
251
- function S(t, n, l) {
252
- return t <= n ? 0 : t >= l ? 1 : (t - n) / (l - n);
253
- }
254
- function C(t, n, l) {
255
- t.topLeft.style.transform = `translate(${n}px, ${l}px)`, t.topRight.style.transform = `translate(${-n}px, ${l}px)`, t.bottomLeft.style.transform = `translate(${n}px, ${-l}px)`, t.bottomRight.style.transform = `translate(${-n}px, ${-l}px)`;
256
- }
257
- function K(t = "white", n) {
258
- const o = document.createElement("div");
259
- o.style.position = "fixed", o.style.pointerEvents = "none", o.style.zIndex = "9999", o.style.top = `${n.top - 2}px`, o.style.left = `${n.left - 2}px`, o.style.width = "10px", o.style.height = "10px";
260
- const i = document.createElement("div");
261
- i.style.position = "absolute", i.style.width = "10px", i.style.height = "2px", i.style.backgroundColor = t, i.style.top = "0", i.style.left = "0";
262
- const s = document.createElement("div");
263
- s.style.position = "absolute", s.style.width = "2px", s.style.height = "10px", s.style.backgroundColor = t, s.style.top = "0", s.style.left = "0", o.appendChild(i), o.appendChild(s);
264
- const e = document.createElement("div");
265
- e.style.position = "fixed", e.style.pointerEvents = "none", e.style.zIndex = "9999", e.style.top = `${n.top - 2}px`, e.style.left = `${n.left + n.width - 10 + 2}px`, e.style.width = "10px", e.style.height = "10px";
266
- const r = document.createElement("div");
267
- r.style.position = "absolute", r.style.width = "10px", r.style.height = "2px", r.style.backgroundColor = t, r.style.top = "0", r.style.right = "0";
268
- const d = document.createElement("div");
269
- d.style.position = "absolute", d.style.width = "2px", d.style.height = "10px", d.style.backgroundColor = t, d.style.top = "0", d.style.right = "0", e.appendChild(r), e.appendChild(d);
270
- const c = document.createElement("div");
271
- c.style.position = "fixed", c.style.pointerEvents = "none", c.style.zIndex = "9999", c.style.top = `${n.top + n.height - 10 + 2}px`, c.style.left = `${n.left - 2}px`, c.style.width = "10px", c.style.height = "10px";
272
- const u = document.createElement("div");
273
- u.style.position = "absolute", u.style.width = "10px", u.style.height = "2px", u.style.backgroundColor = t, u.style.bottom = "0", u.style.left = "0";
274
- const p = document.createElement("div");
275
- p.style.position = "absolute", p.style.width = "2px", p.style.height = "10px", p.style.backgroundColor = t, p.style.bottom = "0", p.style.left = "0", c.appendChild(u), c.appendChild(p);
276
- const a = document.createElement("div");
277
- a.style.position = "fixed", a.style.pointerEvents = "none", a.style.zIndex = "9999", a.style.top = `${n.top + n.height - 10 + 2}px`, a.style.left = `${n.left + n.width - 10 + 2}px`, a.style.width = "10px", a.style.height = "10px";
278
- const g = document.createElement("div");
279
- g.style.position = "absolute", g.style.width = "10px", g.style.height = "2px", g.style.backgroundColor = t, g.style.bottom = "0", g.style.right = "0";
280
- const y = document.createElement("div");
281
- return y.style.position = "absolute", y.style.width = "2px", y.style.height = "10px", y.style.backgroundColor = t, y.style.bottom = "0", y.style.right = "0", a.appendChild(g), a.appendChild(y), {
282
- topLeft: o,
283
- topRight: e,
284
- bottomLeft: c,
285
- bottomRight: a,
286
- *[Symbol.iterator]() {
287
- yield o, yield e, yield c, yield a;
288
- }
289
- };
290
- }
291
- const at = (t) => {
292
- var o;
293
- const n = (t == null ? void 0 : t.spring) ?? j, l = (t == null ? void 0 : t.scale) ?? 0.92, h = ((o = t == null ? void 0 : t.border) == null ? void 0 : o.color) ?? "white";
208
+ }, tt = 0.8, et = "white", E = {
209
+ start: 0,
210
+ end: 0.45
211
+ }, L = {
212
+ start: 0.85,
213
+ end: 1
214
+ }, k = {
215
+ start: 0.2,
216
+ end: 0.9
217
+ }, gt = (t) => {
218
+ var i;
219
+ const e = (t == null ? void 0 : t.spring) ?? R, o = (t == null ? void 0 : t.scale) ?? tt, a = ((i = t == null ? void 0 : t.border) == null ? void 0 : i.color) ?? et;
294
220
  return {
295
- out: async (i, s) => {
296
- const e = T(s), r = P(document.body, s.positionedParent), d = K(h, {
297
- ...e,
298
- top: r.top
221
+ out: async (s, r) => {
222
+ const n = I(r), l = A(document.body, r.positionedParent), c = it(a, {
223
+ ...n,
224
+ top: l.top
299
225
  });
226
+ let d = 1, u = -n.top;
300
227
  return {
301
- spring: n,
228
+ spring: e,
302
229
  prepare: () => {
303
- m(i), A(i, e), I(i, e), J(i, e);
304
- for (const c of d)
305
- s.positionedParent.appendChild(c), c.style.transition = "transform 0.1s ease-out";
230
+ b(s), D(s, n), v(s, n), st(s, n);
231
+ for (const y of c)
232
+ r.positionedParent.appendChild(y);
306
233
  },
307
234
  onEnd: () => {
308
- i.style.clipPath = "", i.style.transformOrigin = "", setTimeout(() => {
309
- for (const c of d)
310
- s.positionedParent.removeChild(c);
235
+ s.style.clipPath = "", s.style.transformOrigin = "", setTimeout(() => {
236
+ for (const y of c)
237
+ r.positionedParent.removeChild(y);
311
238
  }, 1e3);
312
239
  },
313
- tick: (c) => {
314
- const u = 1 - c;
315
- if (u < k) {
316
- const p = S(u, 0, k), a = 1 - (1 - l) * p;
317
- i.style.transform = `translateY(${-e.top}px) scale(${a})`;
318
- const g = (e.width - e.width * a) / 2, y = (e.height - e.height * a) / 2;
319
- C(d, g, y);
320
- } else if (u < E) {
321
- const p = S(
322
- u,
323
- k,
324
- E
325
- ), a = -e.top - e.height * p;
326
- i.style.transform = `translateY(${a}px) scale(${l})`;
327
- } else {
328
- const p = S(u, E, 1), a = l + (1 - l) * p;
329
- i.style.transform = `translateY(${-e.top - e.height}px) scale(${a})`;
330
- const g = (e.width - e.width * a) / 2, y = (e.height - e.height * a) / 2;
331
- C(d, g, y);
240
+ tick: (y) => {
241
+ const p = 1 - y;
242
+ if (E.start <= p && p <= E.end) {
243
+ const f = T(
244
+ p,
245
+ E.start,
246
+ E.end
247
+ );
248
+ d = 1 - (1 - o) * f;
249
+ }
250
+ if (L.start <= p && p <= L.end) {
251
+ const f = T(
252
+ p,
253
+ L.start,
254
+ L.end
255
+ );
256
+ d = o + (1 - o) * f;
332
257
  }
258
+ if (k.start <= p && p <= k.end) {
259
+ const f = T(
260
+ p,
261
+ k.start,
262
+ k.end
263
+ );
264
+ u = -n.top - n.height * f;
265
+ }
266
+ s.style.transform = `translateY(${u}px) scale(${d})`;
267
+ const h = (n.width - n.width * d) / 2, g = (n.height - n.height * d) / 2;
268
+ nt(c, h, g);
333
269
  }
334
270
  };
335
271
  },
336
- in: async (i, s) => {
337
- const e = T(s);
272
+ in: async (s, r) => {
273
+ const n = I(r);
274
+ let l = o, c = -n.top + n.height;
338
275
  return {
339
- spring: n,
276
+ spring: e,
340
277
  prepare: () => {
341
- A(i, e), I(i, e), i.style.transform = `translateY(${-e.top + e.height}px) scale(${l})`;
278
+ D(s, n), v(s, n), s.style.transform = `translateY(${-n.top + n.height}px) scale(${o})`;
342
279
  },
343
280
  onEnd: () => {
344
- i.style.clipPath = "", i.style.transformOrigin = "", i.style.transform = "";
281
+ s.style.clipPath = "", s.style.transformOrigin = "", s.style.transform = "";
345
282
  },
346
- tick: (r) => {
347
- if (r < k)
348
- i.style.transform = `translateY(${-e.top + e.height}px) scale(${l})`, i.style.opacity = "0";
349
- else if (r < E) {
350
- const d = S(
351
- r,
352
- k,
353
- E
354
- ), c = -e.top + e.height * (1 - d);
355
- i.style.transform = `translateY(${c}px) scale(${l})`, i.style.opacity = "1";
356
- } else {
357
- const d = S(r, E, 1), c = l + (1 - l) * d;
358
- i.style.transform = `translateY(${-e.top}px) scale(${c})`, i.style.opacity = "1";
283
+ tick: (d) => {
284
+ if (E.start <= d && d <= E.end) {
285
+ const u = T(
286
+ d,
287
+ E.start,
288
+ E.end
289
+ );
290
+ l = 1 - (1 - o) * u;
291
+ }
292
+ if (L.start <= d && d <= L.end) {
293
+ const u = T(
294
+ d,
295
+ L.start,
296
+ L.end
297
+ );
298
+ l = o + (1 - o) * u;
299
+ }
300
+ if (k.start <= d && d <= k.end) {
301
+ const u = T(
302
+ d,
303
+ k.start,
304
+ k.end
305
+ );
306
+ c = -n.top + n.height * (1 - u);
359
307
  }
308
+ s.style.transform = `translateY(${c}px) scale(${l})`;
360
309
  }
361
310
  };
362
311
  }
363
312
  };
364
313
  };
365
- function Q(t, n) {
366
- return t.querySelector(`[data-hero-key="${n}"]`);
314
+ function nt(t, e, o) {
315
+ const a = e * 0.7, i = o * 0.7;
316
+ t.topLeft.style.transform = `translate(${a}px, ${i}px)`, t.topRight.style.transform = `translate(${-a}px, ${i}px)`, t.bottomLeft.style.transform = `translate(${a}px, ${-i}px)`, t.bottomRight.style.transform = `translate(${-a}px, ${-i}px)`;
367
317
  }
368
- const dt = (t = {}) => {
369
- var i, s;
370
- const n = {
371
- stiffness: ((i = t.spring) == null ? void 0 : i.stiffness) ?? 300,
372
- damping: ((s = t.spring) == null ? void 0 : s.damping) ?? 30
373
- }, l = t.timeout ?? 300;
374
- let h = null, o = null;
318
+ function it(t = "white", e) {
319
+ const i = document.createElement("div");
320
+ i.style.position = "fixed", i.style.pointerEvents = "none", i.style.zIndex = "9999", i.style.top = `${e.top - 1}px`, i.style.left = `${e.left - 1}px`, i.style.width = "15px", i.style.height = "15px";
321
+ const s = document.createElement("div");
322
+ s.style.position = "absolute", s.style.width = "15px", s.style.height = "1px", s.style.backgroundColor = t, s.style.top = "0", s.style.left = "0";
323
+ const r = document.createElement("div");
324
+ r.style.position = "absolute", r.style.width = "1px", r.style.height = "15px", r.style.backgroundColor = t, r.style.top = "0", r.style.left = "0", i.appendChild(s), i.appendChild(r);
325
+ const n = document.createElement("div");
326
+ 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";
327
+ const l = document.createElement("div");
328
+ l.style.position = "absolute", l.style.width = "15px", l.style.height = "1px", l.style.backgroundColor = t, l.style.top = "0", l.style.right = "0";
329
+ const c = document.createElement("div");
330
+ c.style.position = "absolute", c.style.width = "1px", c.style.height = "15px", c.style.backgroundColor = t, c.style.top = "0", c.style.right = "0", n.appendChild(l), n.appendChild(c);
331
+ const d = document.createElement("div");
332
+ d.style.position = "fixed", d.style.pointerEvents = "none", d.style.zIndex = "9999", d.style.top = `${e.top + e.height - 15 + 1}px`, d.style.left = `${e.left - 1}px`, d.style.width = "15px", d.style.height = "15px";
333
+ const u = document.createElement("div");
334
+ u.style.position = "absolute", u.style.width = "15px", u.style.height = "1px", u.style.backgroundColor = t, u.style.bottom = "0", u.style.left = "0";
335
+ const y = document.createElement("div");
336
+ y.style.position = "absolute", y.style.width = "1px", y.style.height = "15px", y.style.backgroundColor = t, y.style.bottom = "0", y.style.left = "0", d.appendChild(u), d.appendChild(y);
337
+ const p = document.createElement("div");
338
+ p.style.position = "fixed", p.style.pointerEvents = "none", p.style.zIndex = "9999", p.style.top = `${e.top + e.height - 15 + 1}px`, p.style.left = `${e.left + e.width - 15 + 1}px`, p.style.width = "15px", p.style.height = "15px";
339
+ const h = document.createElement("div");
340
+ h.style.position = "absolute", h.style.width = "15px", h.style.height = "1px", h.style.backgroundColor = t, h.style.bottom = "0", h.style.right = "0";
341
+ const g = document.createElement("div");
342
+ return g.style.position = "absolute", g.style.width = "1px", g.style.height = "15px", g.style.backgroundColor = t, g.style.bottom = "0", g.style.right = "0", p.appendChild(h), p.appendChild(g), {
343
+ topLeft: i,
344
+ topRight: n,
345
+ bottomLeft: d,
346
+ bottomRight: p,
347
+ *[Symbol.iterator]() {
348
+ yield i, yield n, yield d, yield p;
349
+ }
350
+ };
351
+ }
352
+ function I(t) {
353
+ const e = A(document.body, t.positionedParent);
375
354
  return {
376
- in: async (e, r) => {
377
- const d = e, c = Array.from(d.querySelectorAll("[data-hero-key]"));
378
- if (c.length === 0)
355
+ top: t.scroll.y,
356
+ left: 0,
357
+ width: e.width,
358
+ height: window.innerHeight - e.top
359
+ };
360
+ }
361
+ function D(t, e) {
362
+ const o = e.left + e.width / 2, a = e.top + e.height / 2;
363
+ t.style.transformOrigin = `${o}px ${a}px`;
364
+ }
365
+ function v(t, e) {
366
+ t.style.clipPath = `polygon(
367
+ ${e.left}px ${e.top}px,
368
+ ${e.left + e.width}px ${e.top}px,
369
+ ${e.left + e.width}px ${e.top + e.height}px,
370
+ ${e.left}px ${e.top + e.height}px
371
+ )`;
372
+ }
373
+ function st(t, e) {
374
+ t.style.transform = `translateY(${-e.top}px)`;
375
+ }
376
+ function T(t, e, o) {
377
+ return t <= e ? 0 : t >= o ? 1 : (t - e) / (o - e);
378
+ }
379
+ function rt(t, e) {
380
+ return t.querySelector(`[data-hero-key="${e}"]`);
381
+ }
382
+ const ft = (t = {}) => {
383
+ var r, n;
384
+ const e = {
385
+ stiffness: ((r = t.spring) == null ? void 0 : r.stiffness) ?? 300,
386
+ damping: ((n = t.spring) == null ? void 0 : n.damping) ?? 30
387
+ }, o = t.timeout ?? 300, a = t.maxDistance ?? 700;
388
+ let i = null, s = null;
389
+ return {
390
+ in: async (l, c) => {
391
+ const d = l, u = Array.from(d.querySelectorAll("[data-hero-key]"));
392
+ if (u.length === 0)
379
393
  return {
380
- spring: n,
394
+ spring: e,
381
395
  tick: () => {
382
396
  }
383
397
  // No hero elements, skip animation
384
398
  };
385
- if (!await new Promise((a) => {
386
- h ? a(!0) : (o = a, setTimeout(() => {
387
- o = null, a(!1);
388
- }, l));
389
- }) || !h)
390
- return h = null, {
391
- spring: n,
399
+ if (!await new Promise((h) => {
400
+ i ? h(!0) : (s = h, setTimeout(() => {
401
+ s = null, h(!1);
402
+ }, o));
403
+ }) || !i)
404
+ return i = null, {
405
+ spring: e,
392
406
  tick: () => {
393
407
  }
394
408
  // No fromNode, skip animation
395
409
  };
396
- const p = c.map((a) => {
397
- const g = a.getAttribute("data-hero-key");
410
+ const p = u.map((h) => {
411
+ const g = h.getAttribute("data-hero-key");
398
412
  if (!g) return null;
399
- const y = Q(h, g);
400
- if (!y) return null;
401
- const f = a, $ = P(h, y), b = P(d, f), x = $.left - b.left - r.scrollOffset.x, w = $.top - b.top - r.scrollOffset.y, L = $.width / b.width, F = $.height / b.height, Y = f.style.transform, _ = f.style.position, z = f.style.transformOrigin, O = f.style.zIndex;
413
+ const f = rt(i, g);
414
+ if (!f) return null;
415
+ const $ = h, m = A(i, f), x = A(d, $), w = m.left - x.left - c.scrollOffset.x, S = m.top - x.top - c.scrollOffset.y, X = m.width / x.width, O = m.height / x.height, U = $.style.transform, W = $.style.position, z = $.style.transformOrigin, H = $.style.zIndex;
402
416
  return {
403
- toEl: f,
404
- dx: x,
405
- dy: w,
406
- dw: L,
407
- dh: F,
408
- originalTransform: Y,
409
- originalPosition: _,
417
+ toEl: $,
418
+ dx: w,
419
+ dy: S,
420
+ dw: X,
421
+ dh: O,
422
+ originalTransform: U,
423
+ originalPosition: W,
410
424
  originalTransformOrigin: z,
411
- originalZIndex: O
425
+ originalZIndex: H
412
426
  };
413
- }).filter(Boolean);
414
- return h = null, p.length === 0 ? {
415
- spring: n,
427
+ }).filter(
428
+ (h) => h !== null && Math.abs(h.dy) <= a
429
+ );
430
+ return i = null, p.length === 0 ? {
431
+ spring: e,
416
432
  tick: () => {
417
433
  }
418
434
  // No matching hero elements
419
435
  } : {
420
- spring: n,
436
+ spring: e,
421
437
  prepare: () => {
422
- p.forEach(({ toEl: a }) => {
423
- a.style.position = "relative", a.style.transformOrigin = "top left", a.style.zIndex = "1000";
438
+ p.forEach(({ toEl: h }) => {
439
+ h.style.position = "relative", h.style.transformOrigin = "top left", h.style.zIndex = "1000";
424
440
  });
425
441
  },
426
- tick: (a) => {
427
- p.forEach(({ toEl: g, dx: y, dy: f, dw: $, dh: b }) => {
428
- g.style.transform = `translate(${(1 - a) * y}px,${(1 - a) * f}px) scale(${a + (1 - a) * $}, ${a + (1 - a) * b})`;
442
+ tick: (h) => {
443
+ p.forEach(({ toEl: g, dx: f, dy: $, dw: m, dh: x }) => {
444
+ g.style.transform = `translate(${(1 - h) * f}px,${(1 - h) * $}px) scale(${h + (1 - h) * m}, ${h + (1 - h) * x})`;
429
445
  });
430
446
  },
431
447
  onEnd: () => {
432
448
  p.forEach(
433
449
  ({
434
- toEl: a,
450
+ toEl: h,
435
451
  originalTransform: g,
436
- originalPosition: y,
437
- originalTransformOrigin: f,
438
- originalZIndex: $
452
+ originalPosition: f,
453
+ originalTransformOrigin: $,
454
+ originalZIndex: m
439
455
  }) => {
440
- a.style.transform = g, a.style.position = y, a.style.transformOrigin = f, a.style.zIndex = $;
456
+ h.style.transform = g, h.style.position = f, h.style.transformOrigin = $, h.style.zIndex = m;
441
457
  }
442
458
  );
443
459
  }
444
460
  };
445
461
  },
446
- out: async (e) => ({
462
+ out: async (l) => ({
447
463
  onStart: () => {
448
- h = e, o && (o(!0), o = null);
464
+ i = l, s && (s(!0), s = null);
449
465
  },
450
- prepare: (r) => {
451
- m(r), r.style.opacity = "0";
466
+ prepare: (c) => {
467
+ b(c), c.style.opacity = "0";
452
468
  }
453
469
  })
454
470
  };
455
471
  };
456
- function R(t) {
457
- const n = P(document.body, t.positionedParent);
458
- return {
459
- top: t.scroll.y,
460
- left: 0,
461
- width: n.width,
462
- height: window.innerHeight - n.top
463
- };
464
- }
465
- const ct = (t = {}) => {
466
- var i, s;
467
- const n = {
468
- // Much slower animation - 4x duration by reducing stiffness further
469
- stiffness: ((i = t.spring) == null ? void 0 : i.stiffness) ?? 50,
470
- damping: ((s = t.spring) == null ? void 0 : s.damping) ?? 30
471
- }, l = t.initialRotation ?? 45, h = t.initialScale ?? 0.01, o = t.rotationTriggerPoint ?? 0.8;
472
- return {
473
- out: async (e, r) => {
474
- const d = e.style.opacity;
475
- return {
476
- spring: {
477
- stiffness: 80,
478
- damping: 25
479
- },
480
- from: 1,
481
- to: 0,
482
- prepare: () => {
483
- m(e, r), e.style.opacity = "1";
484
- },
485
- tick: (c) => {
486
- e.style.opacity = String(c);
487
- },
488
- onEnd: () => {
489
- e.style.opacity = d;
490
- }
491
- };
492
- },
493
- in: async (e, r) => {
494
- const d = R(r), c = e.style.transform, u = e.style.transformOrigin, p = e.style.position, a = e.style.zIndex;
495
- return {
496
- spring: n,
497
- from: 0,
498
- to: 1,
499
- prepare: () => {
500
- const g = Math.min(d.width, d.height) * 0.4;
501
- e.style.setProperty(
502
- "--max-border-radius",
503
- `${g}px`
504
- ), e.style.setProperty("--border-radius-scale", "1"), e.style.willChange = "transform", e.style.backfaceVisibility = "hidden";
505
- const y = d.left + d.width / 2, f = d.top + d.height / 2;
506
- e.style.transformOrigin = `${y}px ${f}px`, e.style.position = "fixed", e.style.top = `${d.top}px`, e.style.left = `${d.left}px`, e.style.width = `${d.width}px`, e.style.height = `${d.height}px`, e.style.zIndex = "1000", e.style.overflow = "hidden", e.style.transform = `rotate(${l}deg) scale(${h}) translateZ(0)`, e.style.borderRadius = "calc(var(--max-border-radius) * var(--border-radius-scale))", e.style.opacity = "1";
507
- },
508
- tick: (g) => {
509
- let y;
510
- if (g <= 0.05)
511
- y = h;
512
- else if (g <= o) {
513
- const x = (g - 0.05) / (o - 0.05), w = Math.pow(x, 9);
514
- y = h + (0.8 - h) * w;
515
- } else {
516
- const x = (g - o) / (1 - o);
517
- y = 0.8 + 0.2 * (1 - Math.pow(1 - x, 3));
518
- }
519
- let f;
520
- const $ = 0.7;
521
- if (g <= $)
522
- f = l;
523
- else {
524
- const x = (g - $) / (1 - $), w = 1 - Math.pow(1 - x, 2);
525
- f = l * (1 - w);
526
- }
527
- let b;
528
- if (g <= $)
529
- b = 1;
530
- else {
531
- const x = (g - $) / (1 - $);
532
- b = 1 - Math.pow(x, 0.5);
533
- }
534
- e.style.transform = `rotate(${f.toFixed(2)}deg) scale(${y.toFixed(4)}) translateZ(0)`, e.style.setProperty(
535
- "--border-radius-scale",
536
- b.toFixed(4)
537
- );
538
- },
539
- onEnd: () => {
540
- e.style.willChange = "", e.style.backfaceVisibility = "", e.style.removeProperty("--max-border-radius"), e.style.removeProperty("--border-radius-scale"), e.style.transform = c, e.style.transformOrigin = u, e.style.position = p, e.style.zIndex = a, e.style.top = "", e.style.left = "", e.style.width = "", e.style.height = "", e.style.overflow = "", e.style.borderRadius = "";
541
- }
542
- };
543
- }
544
- };
545
- };
546
- function tt({
472
+ function lt({
547
473
  detailRect: t,
548
- galleryRect: n,
549
- pageRect: l,
550
- scrollOffset: h
551
- }, o) {
552
- const i = n.left - t.left + (n.width - t.width) / 2 - h.x, s = n.top - t.top + (n.height - t.height) / 2 - h.y, e = n.width / t.width, r = n.height / t.height, d = Math.max(e, r), c = t.top / l.height * 100, u = (l.width - (t.left + t.width)) / l.width * 100, p = (l.height - (t.top + t.height)) / l.height * 100, a = t.left / l.width * 100;
553
- return o.style.transformOrigin = `${t.left + t.width / 2}px ${t.top + t.height / 2}px`, (g) => {
554
- const y = 1 - g, f = c * y, $ = u * y, b = p * y, x = a * y;
555
- o.style.clipPath = `inset(${f}% ${$}% ${b}% ${x}%)`, o.style.transform = `translate(${i * y}px, ${s * y}px) scale(${1 + (d - 1) * y})`;
474
+ galleryRect: e,
475
+ pageRect: o,
476
+ scrollOffset: a
477
+ }, i) {
478
+ const s = e.left - t.left + (e.width - t.width) / 2 - a.x, r = e.top - t.top + (e.height - t.height) / 2 - a.y, n = e.width / t.width, l = e.height / t.height, c = Math.max(n, l), d = t.top / o.height * 100, u = (o.width - (t.left + t.width)) / o.width * 100, y = (o.height - (t.top + t.height)) / o.height * 100, p = t.left / o.width * 100;
479
+ return i.style.transformOrigin = `${t.left + t.width / 2}px ${t.top + t.height / 2}px`, (h) => {
480
+ const g = 1 - h, f = d * g, $ = u * g, m = y * g, x = p * g;
481
+ i.style.clipPath = `inset(${f}% ${$}% ${m}% ${x}%)`, i.style.transform = `translate(${s * g}px, ${r * g}px) scale(${1 + (c - 1) * g})`;
556
482
  };
557
483
  }
558
- function et({
484
+ function ot({
559
485
  galleryRect: t,
560
- detailRect: n,
561
- scrollOffset: l
562
- }, h) {
563
- const o = n.left - t.left + (n.width - t.width) / 2 + l.x, i = n.top - t.top + (n.height - t.height) / 2 + l.y, s = n.width / t.width, e = n.height / t.height, r = Math.max(s, e);
564
- return (d) => {
565
- h.style.transformOrigin = `${t.left + t.width / 2}px ${t.top + t.height / 2}px`;
566
- const c = 1 - d;
567
- h.style.transform = `translate(${o * c - l.x}px, ${i * c - l.y}px) scale(${1 + (r - 1) * c})`, h.style.opacity = `${1 - c}`;
486
+ detailRect: e,
487
+ scrollOffset: o
488
+ }, a) {
489
+ const i = e.left - t.left + (e.width - t.width) / 2 + o.x, s = e.top - t.top + (e.height - t.height) / 2 + o.y, r = e.width / t.width, n = e.height / t.height, l = Math.max(r, n);
490
+ return (c) => {
491
+ a.style.transformOrigin = `${t.left + t.width / 2}px ${t.top + t.height / 2}px`;
492
+ const d = 1 - c;
493
+ a.style.transform = `translate(${i * d - o.x}px, ${s * d - o.y}px) scale(${1 + (l - 1) * d})`, a.style.opacity = `${1 - d}`;
568
494
  };
569
495
  }
570
- function nt({
496
+ function at({
571
497
  galleryRect: t,
572
- detailRect: n,
573
- scrollOffset: l
574
- }, h) {
575
- const o = n.left - t.left + (n.width - t.width) / 2 - l.x, i = n.top - t.top + (n.height - t.height) / 2 - l.y, s = n.width / t.width, e = n.height / t.height, r = Math.max(s, e);
576
- return (d) => {
577
- const c = 1 - d, u = d;
578
- h.style.transformOrigin = `${t.left + t.width / 2}px ${t.top + t.height / 2}px`, h.style.transform = `translate(${o * c}px, ${i * c}px) scale(${1 + (r - 1) * c})`, h.style.opacity = `${u}`;
498
+ detailRect: e,
499
+ scrollOffset: o
500
+ }, a) {
501
+ const i = e.left - t.left + (e.width - t.width) / 2 - o.x, s = e.top - t.top + (e.height - t.height) / 2 - o.y, r = e.width / t.width, n = e.height / t.height, l = Math.max(r, n);
502
+ return (c) => {
503
+ const d = 1 - c, u = c;
504
+ a.style.transformOrigin = `${t.left + t.width / 2}px ${t.top + t.height / 2}px`, a.style.transform = `translate(${i * d}px, ${s * d}px) scale(${1 + (l - 1) * d})`, a.style.opacity = `${u}`;
579
505
  };
580
506
  }
581
- function it({
507
+ function dt({
582
508
  detailRect: t,
583
- galleryRect: n,
584
- pageRect: l,
585
- scrollOffset: h
586
- }, o) {
587
- const i = n.left - t.left + (n.width - t.width) / 2 + h.x, s = n.top - t.top + (n.height - t.height) / 2 + h.y, e = n.width / t.width, r = n.height / t.height, d = Math.min(e, r), c = t.top / l.height * 100, u = (l.width - (t.left + t.width)) / l.width * 100, p = (l.height - (t.top + t.height)) / l.height * 100, a = t.left / l.width * 100;
588
- return o.style.transformOrigin = `${t.left + t.width / 2}px ${t.top + t.height / 2}px`, (g) => {
589
- const y = 1 - g, f = c * y, $ = u * y, b = p * y, x = a * y;
590
- o.style.clipPath = `inset(${f}% ${$}% ${b}% ${x}%)`, o.style.transform = `translate(${i * y - h.x}px, ${s * y - h.y}px) scale(${1 + (d - 1) * y})`;
509
+ galleryRect: e,
510
+ pageRect: o,
511
+ scrollOffset: a
512
+ }, i) {
513
+ const s = e.left - t.left + (e.width - t.width) / 2 + a.x, r = e.top - t.top + (e.height - t.height) / 2 + a.y, n = e.width / t.width, l = e.height / t.height, c = Math.min(n, l), d = t.top / o.height * 100, u = (o.width - (t.left + t.width)) / o.width * 100, y = (o.height - (t.top + t.height)) / o.height * 100, p = t.left / o.width * 100;
514
+ return i.style.transformOrigin = `${t.left + t.width / 2}px ${t.top + t.height / 2}px`, (h) => {
515
+ const g = 1 - h, f = d * g, $ = u * g, m = y * g, x = p * g;
516
+ i.style.clipPath = `inset(${f}% ${$}% ${m}% ${x}%)`, i.style.transform = `translate(${s * g - a.x}px, ${r * g - a.y}px) scale(${1 + (c - 1) * g})`;
591
517
  };
592
518
  }
593
- function st(t, n, l) {
594
- const h = t.querySelector(
519
+ function ht(t, e, o) {
520
+ const a = t.querySelector(
595
521
  "[data-pinterest-detail-key]"
596
- ), o = n.querySelector(
522
+ ), i = e.querySelector(
597
523
  "[data-pinterest-detail-key]"
598
524
  );
599
- if (t.querySelectorAll("[data-pinterest-detail-key]").length > 1 || n.querySelectorAll("[data-pinterest-detail-key]").length > 1)
525
+ if (t.querySelectorAll("[data-pinterest-detail-key]").length > 1 || e.querySelectorAll("[data-pinterest-detail-key]").length > 1)
600
526
  return null;
601
- let i = null, s = null, e = !1;
602
- if (!h && o) {
603
- s = o;
604
- const u = s.getAttribute("data-pinterest-detail-key");
527
+ let s = null, r = null, n = !1;
528
+ if (!a && i) {
529
+ r = i;
530
+ const u = r.getAttribute("data-pinterest-detail-key");
605
531
  if (!u) return null;
606
- i = t.querySelector(
532
+ s = t.querySelector(
607
533
  `[data-pinterest-gallery-key="${u}"]`
608
- ), i && (e = !0);
609
- } else if (h && !o) {
610
- s = h;
611
- const u = s.getAttribute("data-pinterest-detail-key");
534
+ ), s && (n = !0);
535
+ } else if (a && !i) {
536
+ r = a;
537
+ const u = r.getAttribute("data-pinterest-detail-key");
612
538
  if (!u) return null;
613
- i = n.querySelector(
539
+ s = e.querySelector(
614
540
  `[data-pinterest-gallery-key="${u}"]`
615
- ), i && (e = !1);
541
+ ), s && (n = !1);
616
542
  }
617
- if (!i || !s)
543
+ if (!s || !r)
618
544
  return null;
619
- const r = P(e ? t : n, i), d = P(e ? n : t, s), c = n.getBoundingClientRect();
620
- return e ? {
621
- inAnimation: tt(
622
- { detailRect: d, galleryRect: r, pageRect: c, scrollOffset: l },
623
- n
545
+ const l = A(n ? t : e, s), c = A(n ? e : t, r), d = e.getBoundingClientRect();
546
+ return n ? {
547
+ inAnimation: lt(
548
+ { detailRect: c, galleryRect: l, pageRect: d, scrollOffset: o },
549
+ e
624
550
  ),
625
- outAnimation: et(
626
- { galleryRect: r, detailRect: d, scrollOffset: l },
551
+ outAnimation: ot(
552
+ { galleryRect: l, detailRect: c, scrollOffset: o },
627
553
  t
628
554
  )
629
555
  } : {
630
- inAnimation: nt(
631
- { galleryRect: r, detailRect: d, scrollOffset: l },
632
- n
556
+ inAnimation: at(
557
+ { galleryRect: l, detailRect: c, scrollOffset: o },
558
+ e
633
559
  ),
634
- outAnimation: it(
635
- { detailRect: d, galleryRect: r, pageRect: c, scrollOffset: l },
560
+ outAnimation: dt(
561
+ { detailRect: c, galleryRect: l, pageRect: d, scrollOffset: o },
636
562
  t
637
563
  )
638
564
  };
639
565
  }
640
- const ht = (t = {}) => {
641
- var s, e;
642
- const n = {
643
- stiffness: ((s = t.spring) == null ? void 0 : s.stiffness) ?? 50,
644
- damping: ((e = t.spring) == null ? void 0 : e.damping) ?? 10
645
- }, l = t.timeout ?? 300;
646
- let h = null, o = null, i = null;
566
+ const $t = (t = {}) => {
567
+ var r, n;
568
+ const e = {
569
+ stiffness: ((r = t.spring) == null ? void 0 : r.stiffness) ?? 50,
570
+ damping: ((n = t.spring) == null ? void 0 : n.damping) ?? 10
571
+ }, o = t.timeout ?? 300;
572
+ let a = null, i = null, s = null;
647
573
  return {
648
- in: async (r, { scrollOffset: d }) => {
649
- const c = r;
650
- return !await new Promise((p) => {
651
- h ? p(!0) : (o = p, setTimeout(() => {
652
- o = null, p(!1);
653
- }, l));
654
- }) || !h ? (h = null, {
655
- spring: n,
574
+ in: async (l, { scrollOffset: c }) => {
575
+ const d = l;
576
+ return !await new Promise((y) => {
577
+ a ? y(!0) : (i = y, setTimeout(() => {
578
+ i = null, y(!1);
579
+ }, o));
580
+ }) || !a ? (a = null, {
581
+ spring: e,
656
582
  tick: () => {
657
583
  }
658
- }) : (i = st(h, c, d), i ? (h = null, {
659
- spring: n,
660
- tick: (p) => {
661
- i && i.inAnimation(p);
584
+ }) : (s = ht(a, d, c), s ? (a = null, {
585
+ spring: e,
586
+ tick: (y) => {
587
+ s && s.inAnimation(y);
662
588
  }
663
589
  }) : {
664
- spring: n,
590
+ spring: e,
665
591
  tick: () => {
666
592
  }
667
593
  });
668
594
  },
669
- out: async (r) => ({
670
- spring: n,
595
+ out: async (l) => ({
596
+ spring: e,
671
597
  onStart: () => {
672
- h = r, o && (o(!0), o = null);
598
+ a = l, i && (i(!0), i = null);
673
599
  },
674
- prepare: (d) => {
675
- m(d), d.style.zIndex = "-1";
600
+ prepare: (c) => {
601
+ b(c), c.style.zIndex = "-1";
676
602
  },
677
- tick: (d) => {
678
- i && i.outAnimation(d);
603
+ tick: (c) => {
604
+ s && s.outAnimation(c);
679
605
  }
680
606
  })
681
607
  };
682
- }, v = {
608
+ }, Y = {
683
609
  stiffness: 30,
684
610
  damping: 7
685
- }, pt = (t = {}) => {
686
- var r, d;
687
- const n = t.direction ?? "up", l = {
688
- stiffness: ((r = t.spring) == null ? void 0 : r.stiffness) ?? v.stiffness,
689
- damping: ((d = t.spring) == null ? void 0 : d.damping) ?? v.damping
690
- }, h = n === "up";
691
- let o = null, i = null, s = null;
692
- const e = () => {
693
- if (o === null || i === null)
611
+ }, xt = (t = {}) => {
612
+ var l, c;
613
+ const e = t.direction ?? "up", o = {
614
+ stiffness: ((l = t.spring) == null ? void 0 : l.stiffness) ?? Y.stiffness,
615
+ damping: ((c = t.spring) == null ? void 0 : c.damping) ?? Y.damping
616
+ }, a = e === "up";
617
+ let i = null, s = null, r = null;
618
+ const n = () => {
619
+ if (i === null || s === null)
694
620
  return null;
695
- const c = Math.min(o, i), u = window.innerHeight;
696
- return Math.max(c, u);
621
+ const d = Math.min(i, s), u = window.innerHeight;
622
+ return Math.max(d, u);
697
623
  };
698
624
  return {
699
- in: (c) => (i = c.offsetHeight, o !== null && (s = e()), {
700
- spring: l,
625
+ in: (d) => (s = d.offsetHeight, i !== null && (r = n()), {
626
+ spring: o,
701
627
  tick: (u) => {
702
- if (s === null && (s = e(), s === null))
628
+ if (r === null && (r = n(), r === null))
703
629
  return;
704
- const p = h ? (1 - u) * s : (1 - u) * -s;
705
- c.style.transform = `translateY(${p}px)`;
630
+ const y = a ? (1 - u) * r : (1 - u) * -r;
631
+ d.style.transform = `translateY(${y}px)`;
706
632
  }
707
633
  }),
708
- out: (c) => ({
709
- spring: l,
634
+ out: (d) => ({
635
+ spring: o,
710
636
  onStart: () => {
711
- o = c.offsetHeight, i !== null && (s = e());
637
+ i = d.offsetHeight, s !== null && (r = n());
712
638
  },
713
639
  tick: (u) => {
714
- if (s === null && (s = e(), s === null))
640
+ if (r === null && (r = n(), r === null))
715
641
  return;
716
- const p = h ? (1 - u) * -s : (1 - u) * s;
717
- c.style.transform = `translateY(${p}px)`;
642
+ const y = a ? (1 - u) * -r : (1 - u) * r;
643
+ d.style.transform = `translateY(${y}px)`;
718
644
  },
719
645
  prepare: (u) => {
720
- m(u), u.style.zIndex = h ? "-1" : "1";
646
+ b(u), u.style.zIndex = a ? "-1" : "1";
721
647
  }
722
648
  })
723
649
  };
724
- }, D = {
650
+ }, _ = {
725
651
  stiffness: 30,
726
652
  damping: 7
727
- }, yt = (t = {}) => {
728
- var o, i;
729
- const n = t.direction ?? "left", l = {
730
- stiffness: ((o = t.spring) == null ? void 0 : o.stiffness) ?? D.stiffness,
731
- damping: ((i = t.spring) == null ? void 0 : i.damping) ?? D.damping
732
- }, h = n === "left";
653
+ }, mt = (t = {}) => {
654
+ var i, s;
655
+ const e = t.direction ?? "left", o = {
656
+ stiffness: ((i = t.spring) == null ? void 0 : i.stiffness) ?? _.stiffness,
657
+ damping: ((s = t.spring) == null ? void 0 : s.damping) ?? _.damping
658
+ }, a = e === "left";
733
659
  return {
734
- in: (s) => ({
735
- spring: l,
736
- tick: (e) => {
737
- const r = h ? (1 - e) * 100 : (1 - e) * -100;
738
- s.style.transform = `translateX(${r}%)`;
660
+ in: (r) => ({
661
+ spring: o,
662
+ tick: (n) => {
663
+ const l = a ? (1 - n) * 100 : (1 - n) * -100;
664
+ r.style.transform = `translateX(${l}%)`;
739
665
  }
740
666
  }),
741
- out: (s, e) => ({
742
- spring: l,
743
- tick: (r) => {
744
- const d = h ? (1 - r) * -100 : (1 - r) * 100;
745
- s.style.transform = `translateX(${d}%)`;
667
+ out: (r, n) => ({
668
+ spring: o,
669
+ tick: (l) => {
670
+ const c = a ? (1 - l) * -100 : (1 - l) * 100;
671
+ r.style.transform = `translateX(${c}%)`;
746
672
  },
747
- prepare: (r) => {
748
- m(r, e), r.style.zIndex = h ? "-1" : "1";
673
+ prepare: (l) => {
674
+ b(l, n), l.style.zIndex = a ? "-1" : "1";
675
+ }
676
+ })
677
+ };
678
+ }, F = { stiffness: 300, damping: 30 }, C = 20, P = 800, bt = () => {
679
+ let t, e = null;
680
+ return {
681
+ in: (o) => ({
682
+ spring: F,
683
+ prepare: (a) => {
684
+ a.style.transform = `perspective(${P}px) rotateY(${C}deg) translateX(-100%)`;
685
+ },
686
+ wait: async () => {
687
+ t && await t;
688
+ },
689
+ tick: (a) => {
690
+ const i = (1 - a) * C, s = -(1 - a) * 100;
691
+ o.style.transform = `perspective(${P}px) rotateY(${i}deg) translateX(${s}%)`;
692
+ },
693
+ onEnd: () => {
694
+ o.style.transform = "";
695
+ }
696
+ }),
697
+ out: (o, a) => (t = new Promise((i) => {
698
+ e = i;
699
+ }), {
700
+ spring: F,
701
+ prepare: (i) => {
702
+ b(i, a);
703
+ },
704
+ tick: (i) => {
705
+ const s = 1 - i, r = s * C, n = s * 100;
706
+ o.style.transform = `perspective(${P}px) rotateY(${-r}deg) translateX(${n}%)`;
707
+ },
708
+ onEnd: () => {
709
+ e && e(), o.style.transform = "";
749
710
  }
750
711
  })
751
712
  };
752
713
  };
753
714
  export {
754
- rt as blind,
755
- ot as drill,
756
- lt as fade,
757
- at as film,
758
- dt as hero,
759
- ct as jaemin,
760
- ht as pinterest,
761
- pt as scroll,
762
- yt as slide
715
+ pt as blind,
716
+ yt as drill,
717
+ ut as fade,
718
+ gt as film,
719
+ ft as hero,
720
+ Lt as jaemin,
721
+ $t as pinterest,
722
+ xt as scroll,
723
+ mt as slide,
724
+ bt as strip
763
725
  };