@ssgoi/core 2.4.0 → 2.5.1

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 (42) hide show
  1. package/dist/animate.d.ts +35 -0
  2. package/dist/animate.d.ts.map +1 -0
  3. package/dist/animation-scheduler.d.ts +47 -0
  4. package/dist/animation-scheduler.d.ts.map +1 -0
  5. package/dist/animator.d.ts +3 -8
  6. package/dist/animator.d.ts.map +1 -1
  7. package/dist/create-ssgoi-transition-context.d.ts.map +1 -1
  8. package/dist/create-transition-callback.d.ts.map +1 -1
  9. package/dist/index.cjs +2 -2
  10. package/dist/index.d.ts +1 -0
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +787 -306
  13. package/dist/jaemin-BAi8PTrj.js +130 -0
  14. package/dist/jaemin-DL1-g_B5.cjs +1 -0
  15. package/dist/test-utils.d.ts +46 -0
  16. package/dist/test-utils.d.ts.map +1 -0
  17. package/dist/ticker.d.ts +37 -0
  18. package/dist/ticker.d.ts.map +1 -0
  19. package/dist/transition-strategy.d.ts +2 -3
  20. package/dist/transition-strategy.d.ts.map +1 -1
  21. package/dist/types.cjs +1 -1
  22. package/dist/types.d.ts +164 -4
  23. package/dist/types.d.ts.map +1 -1
  24. package/dist/types.js +10 -1
  25. package/dist/view-transitions/blind.d.ts.map +1 -1
  26. package/dist/view-transitions/curtain-reveal.d.ts +19 -0
  27. package/dist/view-transitions/curtain-reveal.d.ts.map +1 -0
  28. package/dist/view-transitions/fade.d.ts.map +1 -1
  29. package/dist/view-transitions/film.d.ts.map +1 -1
  30. package/dist/view-transitions/hero.d.ts +1 -0
  31. package/dist/view-transitions/hero.d.ts.map +1 -1
  32. package/dist/view-transitions/index.cjs +19 -19
  33. package/dist/view-transitions/index.d.ts +3 -1
  34. package/dist/view-transitions/index.d.ts.map +1 -1
  35. package/dist/view-transitions/index.js +620 -547
  36. package/dist/view-transitions/jaemin.d.ts +4 -0
  37. package/dist/view-transitions/jaemin.d.ts.map +1 -1
  38. package/dist/view-transitions/strip.d.ts +3 -0
  39. package/dist/view-transitions/strip.d.ts.map +1 -0
  40. package/package.json +16 -13
  41. package/dist/view-transitions/hero-rotate.d.ts +0 -28
  42. package/dist/view-transitions/hero-rotate.d.ts.map +0 -1
@@ -1,23 +1,20 @@
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 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 = {}) => {
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 = 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
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");
19
- const f = document.createElement("div");
20
- f.className = "blind-container", f.style.cssText = `
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 = `
21
18
  position: absolute;
22
19
  top: 0;
23
20
  left: 0;
@@ -27,737 +24,813 @@ const W = (t) => new Promise((n) => setTimeout(n, t)), m = (t, n) => {
27
24
  z-index: 9999;
28
25
  overflow: hidden;
29
26
  `;
30
- const $ = [];
31
- for (let b = 0; b < o; b++) {
32
- const x = document.createElement("div");
33
- if (i === "horizontal") {
34
- const w = 100 / o, L = `calc(${w}% + 1px)`;
35
- x.style.cssText = `
27
+ 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 = `
36
33
  position: absolute;
37
- top: ${w * b}%;
34
+ top: ${x * $}%;
38
35
  left: 0;
39
36
  width: 100%;
40
- height: ${L};
41
- background: ${e};
42
- transform: scaleX(${a === "hidden" ? 0 : 1});
43
- transform-origin: ${g} center;
37
+ height: ${S};
38
+ background: ${n};
39
+ transform: scaleX(${g === "hidden" ? 0 : 1});
40
+ transform-origin: ${y} center;
44
41
  will-change: transform;
45
42
  `;
46
43
  } else {
47
- const w = 100 / o, L = `calc(${w}% + 1px)`;
48
- x.style.cssText = `
44
+ const x = 100 / s, S = `calc(${x}% + 1px)`;
45
+ m.style.cssText = `
49
46
  position: absolute;
50
47
  top: 0;
51
- left: ${w * b}%;
52
- width: ${L};
48
+ left: ${x * $}%;
49
+ width: ${S};
53
50
  height: 100%;
54
- background: ${e};
55
- transform: scaleY(${a === "hidden" ? 0 : 1});
56
- transform-origin: ${g === "left" ? "top" : "bottom"} center;
51
+ background: ${n};
52
+ transform: scaleY(${g === "hidden" ? 0 : 1});
53
+ transform-origin: ${y === "left" ? "top" : "bottom"} center;
57
54
  will-change: transform;
58
55
  `;
59
56
  }
60
- $.push(x), f.appendChild(x);
57
+ f.push(m), p.appendChild(m);
61
58
  }
62
- return p.appendChild(f), { container: f, blinds: $ };
59
+ return h.appendChild(p), { container: p, blinds: f };
63
60
  };
64
61
  return {
65
62
  out: () => {
66
- let p = null;
67
- return r = new Promise((a) => {
68
- d = a;
63
+ let h = null;
64
+ return i = new Promise((y) => {
65
+ d = y;
69
66
  }), {
70
- spring: l,
71
- prepare: (a) => {
72
- m(a), a.style.zIndex = "1000", p = u(a, "hidden", "left");
67
+ springs: Array.from({ length: s }, (y, u) => ({
68
+ from: 0,
69
+ 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})`);
76
+ }
77
+ })),
78
+ schedule: "chain",
79
+ prepare: (y) => {
80
+ b(y), y.style.zIndex = "1000", h = a(y, "hidden", "left");
73
81
  },
74
82
  onStart: () => {
75
83
  },
76
- tick: (a) => {
77
- if (!p) return;
78
- const g = 1 - a;
79
- p.blinds.forEach((y, f) => {
80
- const $ = c(
81
- g,
82
- f,
83
- o,
84
- !1
85
- // not reversed - left to right
86
- );
87
- i === "horizontal" ? y.style.transform = `scaleX(${$})` : y.style.transform = `scaleY(${$})`;
88
- });
89
- },
90
84
  onEnd: () => {
91
85
  d && d();
92
86
  }
93
87
  };
94
88
  },
95
89
  in: () => {
96
- let p = null;
90
+ let h = null;
97
91
  return {
98
- spring: n,
99
- prepare: (a) => {
100
- a.style.position = "relative", a.style.zIndex = "0", p = u(a, "closed", "right");
92
+ springs: Array.from({ length: s }, (y, u) => ({
93
+ from: 1,
94
+ 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})`);
101
+ }
102
+ })),
103
+ schedule: "chain",
104
+ prepare: (y) => {
105
+ y.style.position = "relative", y.style.zIndex = "0", h = a(y, "closed", "right");
101
106
  },
102
107
  onStart: () => {
103
108
  },
104
109
  wait: async () => {
105
- r && await r, await W(h);
106
- },
107
- tick: (a) => {
108
- p && p.blinds.forEach((g, y) => {
109
- const f = c(
110
- a,
111
- y,
112
- o,
113
- !1
114
- // same direction as OUT - left to right
115
- );
116
- i === "horizontal" ? g.style.transform = `scaleX(${1 - f})` : g.style.transform = `scaleY(${1 - f})`;
117
- });
110
+ i && await i, await G(c);
118
111
  },
119
112
  onEnd: () => {
120
- p && p.container && p.container.remove();
113
+ h && h.container && h.container.remove();
121
114
  }
122
115
  };
123
116
  }
124
117
  };
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
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
130
123
  };
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());
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());
136
129
  }
137
130
  }),
138
- out: (s, e) => ({
139
- spring: h,
140
- prepare: (r) => {
141
- m(r, e), r.style.zIndex = "-1";
131
+ out: (l, n) => ({
132
+ spring: c,
133
+ prepare: (i) => {
134
+ b(i, n), i.style.zIndex = "-1";
142
135
  },
143
- tick: (r) => {
144
- s.style.transform = `translateX(${-(1 - r) * 20}%)`, n && (s.style.opacity = r.toString());
136
+ tick: (i) => {
137
+ l.style.transform = `translateX(${-(1 - i) * 20}%)`, e && (l.style.opacity = i.toString());
145
138
  }
146
139
  })
147
140
  } : {
148
- in: (s) => ({
141
+ in: (l) => ({
149
142
  spring: {
150
143
  stiffness: 100,
151
144
  damping: 20
152
145
  },
153
- tick: (e) => {
154
- s.style.transform = `translateX(${-(1 - e) * 20}%)`, n && (s.style.opacity = e.toString());
146
+ tick: (n) => {
147
+ l.style.transform = `translateX(${-(1 - n) * 20}%)`, e && (l.style.opacity = n.toString());
155
148
  }
156
149
  }),
157
- out: (s, e) => ({
150
+ out: (l, n) => ({
158
151
  spring: {
159
152
  stiffness: 100,
160
153
  damping: 20
161
154
  },
162
- prepare: (r) => {
163
- m(r, e), r.style.zIndex = "100";
155
+ prepare: (i) => {
156
+ b(i, n), i.style.zIndex = "100";
164
157
  },
165
- tick: (r) => {
166
- s.style.transform = `translateX(${(1 - r) * 100}%)`, n && (s.style.opacity = r.toString());
158
+ tick: (i) => {
159
+ l.style.transform = `translateX(${(1 - i) * 100}%)`, e && (l.style.opacity = i.toString());
167
160
  }
168
161
  })
169
162
  };
170
- }, G = (t) => new Promise((n) => setTimeout(n, t)), q = { stiffness: 400, damping: 20 }, V = { stiffness: 40, damping: 8 }, Z = 100, lt = (t = {}) => {
163
+ }, J = (t) => new Promise((e) => setTimeout(e, t)), Q = { stiffness: 7, damping: 4 }, R = { stiffness: 8, damping: 4 }, tt = 0, Ct = (t = {}) => {
171
164
  const {
172
- inSpring: n = V,
173
- outSpring: l = q,
174
- transitionDelay: h = Z
165
+ inSpring: e = R,
166
+ outSpring: r = Q,
167
+ transitionDelay: c = tt
175
168
  } = t;
176
- let o, i = null;
169
+ let s, o = null;
177
170
  return {
178
- in: (s) => ({
179
- spring: n,
180
- prepare: (e) => {
181
- e.style.opacity = "0";
171
+ in: (l) => ({
172
+ spring: e,
173
+ prepare: (n) => {
174
+ n.style.opacity = "0", n.style.willChange = "opacity";
182
175
  },
183
176
  wait: async () => {
184
- o && (await o, await G(h));
177
+ s && (await s, await J(c));
185
178
  },
186
- tick: (e) => {
187
- s.style.opacity = e.toString();
179
+ tick: (n) => {
180
+ l.style.opacity = n.toString();
188
181
  }
189
182
  }),
190
- out: (s, e) => (o = new Promise((r) => {
191
- i = r;
183
+ out: (l, n) => (s = new Promise((i) => {
184
+ o = i;
192
185
  }), {
193
- spring: l,
194
- tick: (r) => {
195
- s.style.opacity = r.toString();
186
+ spring: r,
187
+ tick: (i) => {
188
+ l.style.opacity = i.toString();
189
+ },
190
+ prepare: (i) => {
191
+ b(i, n), i.style.willChange = "opacity";
196
192
  },
197
- prepare: (r) => m(r, e),
198
193
  onEnd: () => {
199
- i && i();
194
+ o && o();
200
195
  }
201
196
  })
202
197
  };
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,
198
+ }, et = {
199
+ stiffness: 5,
223
200
  // Lower stiffness for smoother motion
224
- damping: 5
201
+ damping: 3.5
225
202
  // 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";
203
+ }, nt = 0.8, it = "white", w = {
204
+ start: 0,
205
+ end: 0.45
206
+ }, E = {
207
+ start: 0.85,
208
+ end: 1
209
+ }, L = {
210
+ start: 0.2,
211
+ 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;
294
215
  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
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
299
220
  });
221
+ let a = 1, h = -n.top;
300
222
  return {
301
- spring: n,
223
+ spring: e,
302
224
  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";
225
+ b(o), I(o, n), D(o, n), ot(o, n);
226
+ for (const g of d)
227
+ l.positionedParent.appendChild(g);
306
228
  },
307
229
  onEnd: () => {
308
- i.style.clipPath = "", i.style.transformOrigin = "", setTimeout(() => {
309
- for (const c of d)
310
- s.positionedParent.removeChild(c);
230
+ o.style.clipPath = "", o.style.transformOrigin = "", setTimeout(() => {
231
+ for (const g of d)
232
+ l.positionedParent.removeChild(g);
311
233
  }, 1e3);
312
234
  },
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);
235
+ 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
242
+ );
243
+ a = 1 - (1 - r) * f;
244
+ }
245
+ if (E.start <= y && y <= E.end) {
246
+ const f = A(
247
+ y,
248
+ E.start,
249
+ E.end
250
+ );
251
+ a = r + (1 - r) * f;
332
252
  }
253
+ if (L.start <= y && y <= L.end) {
254
+ const f = A(
255
+ y,
256
+ L.start,
257
+ L.end
258
+ );
259
+ h = -n.top - n.height * f;
260
+ }
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);
333
264
  }
334
265
  };
335
266
  },
336
- in: async (i, s) => {
337
- const e = T(s);
267
+ in: async (o, l) => {
268
+ const n = P(l);
269
+ let i = r, d = -n.top + n.height;
338
270
  return {
339
- spring: n,
271
+ spring: e,
340
272
  prepare: () => {
341
- A(i, e), I(i, e), i.style.transform = `translateY(${-e.top + e.height}px) scale(${l})`;
273
+ I(o, n), D(o, n), o.style.transform = `translateY(${-n.top + n.height}px) scale(${r})`;
342
274
  },
343
275
  onEnd: () => {
344
- i.style.clipPath = "", i.style.transformOrigin = "", i.style.transform = "";
276
+ o.style.clipPath = "", o.style.transformOrigin = "", o.style.transform = "";
345
277
  },
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";
278
+ tick: (a) => {
279
+ if (w.start <= a && a <= w.end) {
280
+ const h = A(
281
+ a,
282
+ w.start,
283
+ w.end
284
+ );
285
+ i = 1 - (1 - r) * h;
286
+ }
287
+ if (E.start <= a && a <= E.end) {
288
+ const h = A(
289
+ a,
290
+ E.start,
291
+ E.end
292
+ );
293
+ i = r + (1 - r) * h;
359
294
  }
295
+ if (L.start <= a && a <= L.end) {
296
+ const h = A(
297
+ a,
298
+ L.start,
299
+ L.end
300
+ );
301
+ d = -n.top + n.height * (1 - h);
302
+ }
303
+ o.style.transform = `translateY(${d}px) scale(${i})`;
360
304
  }
361
305
  };
362
306
  }
363
307
  };
364
308
  };
365
- function Q(t, n) {
366
- return t.querySelector(`[data-hero-key="${n}"]`);
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)`;
312
+ }
313
+ function rt(t = "white", e) {
314
+ 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";
316
+ 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";
318
+ 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";
330
+ 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";
334
+ 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,
342
+ *[Symbol.iterator]() {
343
+ yield s, yield n, yield a, yield y;
344
+ }
345
+ };
346
+ }
347
+ function P(t) {
348
+ const e = T(document.body, t.positionedParent);
349
+ return {
350
+ top: t.scroll.y,
351
+ left: 0,
352
+ width: e.width,
353
+ height: window.innerHeight - e.top
354
+ };
355
+ }
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`;
359
+ }
360
+ function D(t, e) {
361
+ 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
366
+ )`;
367
+ }
368
+ function ot(t, e) {
369
+ t.style.transform = `translateY(${-e.top}px)`;
370
+ }
371
+ function A(t, e, r) {
372
+ return t <= e ? 0 : t >= r ? 1 : (t - e) / (r - e);
373
+ }
374
+ function lt(t, e) {
375
+ return t.querySelector(`[data-hero-key="${e}"]`);
367
376
  }
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;
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;
375
384
  return {
376
- in: async (e, r) => {
377
- const d = e, c = Array.from(d.querySelectorAll("[data-hero-key]"));
378
- if (c.length === 0)
385
+ in: async (i, d) => {
386
+ const a = i, h = Array.from(a.querySelectorAll("[data-hero-key]"));
387
+ if (h.length === 0)
379
388
  return {
380
- spring: n,
389
+ spring: e,
381
390
  tick: () => {
382
391
  }
383
392
  // No hero elements, skip animation
384
393
  };
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,
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,
392
401
  tick: () => {
393
402
  }
394
403
  // No fromNode, skip animation
395
404
  };
396
- const p = c.map((a) => {
397
- const g = a.getAttribute("data-hero-key");
398
- 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;
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);
409
+ 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;
402
411
  return {
403
- toEl: f,
404
- dx: x,
405
- dy: w,
406
- dw: L,
407
- dh: F,
408
- originalTransform: Y,
409
- originalPosition: _,
410
- originalTransformOrigin: z,
411
- originalZIndex: O
412
+ toEl: $,
413
+ dx: S,
414
+ dy: U,
415
+ dw: W,
416
+ dh: X,
417
+ originalTransform: N,
418
+ originalPosition: z,
419
+ originalTransformOrigin: H,
420
+ originalZIndex: B
412
421
  };
413
- }).filter(Boolean);
414
- return h = null, p.length === 0 ? {
415
- spring: n,
422
+ }).filter(
423
+ (u) => u !== null && Math.abs(u.dy) <= c
424
+ );
425
+ return s = null, y.length === 0 ? {
426
+ spring: e,
416
427
  tick: () => {
417
428
  }
418
429
  // No matching hero elements
419
430
  } : {
420
- spring: n,
431
+ spring: e,
421
432
  prepare: () => {
422
- p.forEach(({ toEl: a }) => {
423
- a.style.position = "relative", a.style.transformOrigin = "top left", a.style.zIndex = "1000";
433
+ y.forEach(({ toEl: u }) => {
434
+ u.style.position = "relative", u.style.transformOrigin = "top left", u.style.zIndex = "1000";
424
435
  });
425
436
  },
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})`;
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})`;
429
440
  });
430
441
  },
431
442
  onEnd: () => {
432
- p.forEach(
443
+ y.forEach(
433
444
  ({
434
- toEl: a,
435
- originalTransform: g,
436
- originalPosition: y,
437
- originalTransformOrigin: f,
438
- originalZIndex: $
445
+ toEl: u,
446
+ originalTransform: p,
447
+ originalPosition: f,
448
+ originalTransformOrigin: $,
449
+ originalZIndex: m
439
450
  }) => {
440
- a.style.transform = g, a.style.position = y, a.style.transformOrigin = f, a.style.zIndex = $;
451
+ u.style.transform = p, u.style.position = f, u.style.transformOrigin = $, u.style.zIndex = m;
441
452
  }
442
453
  );
443
454
  }
444
455
  };
445
456
  },
446
- out: async (e) => ({
457
+ out: async (i) => ({
447
458
  onStart: () => {
448
- h = e, o && (o(!0), o = null);
459
+ s = i, o && (o(!0), o = null);
449
460
  },
450
- prepare: (r) => {
451
- m(r), r.style.opacity = "0";
461
+ prepare: (d) => {
462
+ b(d), d.style.opacity = "0";
452
463
  }
453
464
  })
454
465
  };
455
466
  };
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({
467
+ function at({
547
468
  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})`;
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})`;
556
477
  };
557
478
  }
558
- function et({
479
+ function dt({
559
480
  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);
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);
564
485
  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
+ 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}`;
568
489
  };
569
490
  }
570
- function nt({
491
+ function ct({
571
492
  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);
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);
576
497
  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
+ 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}`;
579
500
  };
580
501
  }
581
- function it({
502
+ function ht({
582
503
  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})`;
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})`;
591
512
  };
592
513
  }
593
- function st(t, n, l) {
594
- const h = t.querySelector(
514
+ function pt(t, e, r) {
515
+ const c = t.querySelector(
595
516
  "[data-pinterest-detail-key]"
596
- ), o = n.querySelector(
517
+ ), s = e.querySelector(
597
518
  "[data-pinterest-detail-key]"
598
519
  );
599
- if (t.querySelectorAll("[data-pinterest-detail-key]").length > 1 || n.querySelectorAll("[data-pinterest-detail-key]").length > 1)
520
+ if (t.querySelectorAll("[data-pinterest-detail-key]").length > 1 || e.querySelectorAll("[data-pinterest-detail-key]").length > 1)
600
521
  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");
605
- if (!u) return null;
606
- i = t.querySelector(
607
- `[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");
612
- if (!u) return null;
613
- i = n.querySelector(
614
- `[data-pinterest-gallery-key="${u}"]`
615
- ), i && (e = !1);
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);
616
537
  }
617
- if (!i || !s)
538
+ if (!o || !l)
618
539
  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
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
624
545
  ),
625
- outAnimation: et(
626
- { galleryRect: r, detailRect: d, scrollOffset: l },
546
+ outAnimation: dt(
547
+ { galleryRect: i, detailRect: d, scrollOffset: r },
627
548
  t
628
549
  )
629
550
  } : {
630
- inAnimation: nt(
631
- { galleryRect: r, detailRect: d, scrollOffset: l },
632
- n
551
+ inAnimation: ct(
552
+ { galleryRect: i, detailRect: d, scrollOffset: r },
553
+ e
633
554
  ),
634
- outAnimation: it(
635
- { detailRect: d, galleryRect: r, pageRect: c, scrollOffset: l },
555
+ outAnimation: ht(
556
+ { detailRect: d, galleryRect: i, pageRect: a, scrollOffset: r },
636
557
  t
637
558
  )
638
559
  };
639
560
  }
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;
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;
647
568
  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,
569
+ in: async (i, { scrollOffset: d }) => {
570
+ const a = i;
571
+ 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,
656
577
  tick: () => {
657
578
  }
658
- }) : (i = st(h, c, d), i ? (h = null, {
659
- spring: n,
660
- tick: (p) => {
661
- i && i.inAnimation(p);
579
+ }) : (o = pt(c, a, d), o ? (c = null, {
580
+ spring: e,
581
+ tick: (g) => {
582
+ o && o.inAnimation(g);
662
583
  }
663
584
  }) : {
664
- spring: n,
585
+ spring: e,
665
586
  tick: () => {
666
587
  }
667
588
  });
668
589
  },
669
- out: async (r) => ({
670
- spring: n,
590
+ out: async (i) => ({
591
+ spring: e,
671
592
  onStart: () => {
672
- h = r, o && (o(!0), o = null);
593
+ c = i, s && (s(!0), s = null);
673
594
  },
674
595
  prepare: (d) => {
675
- m(d), d.style.zIndex = "-1";
596
+ b(d), d.style.zIndex = "-1";
676
597
  },
677
598
  tick: (d) => {
678
- i && i.outAnimation(d);
599
+ o && o.outAnimation(d);
679
600
  }
680
601
  })
681
602
  };
682
603
  }, v = {
683
- stiffness: 30,
684
- 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,
604
+ stiffness: 5,
605
+ 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,
689
610
  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
+ }, c = e === "up";
612
+ let s = null, o = null, l = null;
613
+ const n = () => {
614
+ if (s === null || o === null)
694
615
  return null;
695
- const c = Math.min(o, i), u = window.innerHeight;
696
- return Math.max(c, u);
616
+ const a = Math.min(s, o), h = window.innerHeight;
617
+ return Math.max(a, h);
697
618
  };
698
619
  return {
699
- in: (c) => (i = c.offsetHeight, o !== null && (s = e()), {
700
- spring: l,
701
- tick: (u) => {
702
- if (s === null && (s = e(), s === null))
620
+ in: (a) => (o = a.offsetHeight, s !== null && (l = n()), {
621
+ spring: r,
622
+ tick: (h) => {
623
+ if (l === null && (l = n(), l === null))
703
624
  return;
704
- const p = h ? (1 - u) * s : (1 - u) * -s;
705
- c.style.transform = `translateY(${p}px)`;
625
+ const g = c ? (1 - h) * l : (1 - h) * -l;
626
+ a.style.transform = `translateY(${g}px)`;
706
627
  }
707
628
  }),
708
- out: (c) => ({
709
- spring: l,
629
+ out: (a) => ({
630
+ spring: r,
710
631
  onStart: () => {
711
- o = c.offsetHeight, i !== null && (s = e());
632
+ s = a.offsetHeight, o !== null && (l = n());
712
633
  },
713
- tick: (u) => {
714
- if (s === null && (s = e(), s === null))
634
+ tick: (h) => {
635
+ if (l === null && (l = n(), l === null))
715
636
  return;
716
- const p = h ? (1 - u) * -s : (1 - u) * s;
717
- c.style.transform = `translateY(${p}px)`;
637
+ const g = c ? (1 - h) * -l : (1 - h) * l;
638
+ a.style.transform = `translateY(${g}px)`;
718
639
  },
719
- prepare: (u) => {
720
- m(u), u.style.zIndex = h ? "-1" : "1";
640
+ prepare: (h) => {
641
+ b(h), h.style.zIndex = c ? "-1" : "1";
721
642
  }
722
643
  })
723
644
  };
724
- }, D = {
725
- stiffness: 30,
645
+ }, F = {
646
+ stiffness: 15,
726
647
  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";
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";
733
654
  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}%)`;
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}%)`;
739
660
  }
740
661
  }),
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}%)`;
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}%)`;
746
667
  },
747
- prepare: (r) => {
748
- m(r, e), r.style.zIndex = h ? "-1" : "1";
668
+ prepare: (i) => {
669
+ b(i, n), i.style.zIndex = c ? "-1" : "1";
749
670
  }
750
671
  })
751
672
  };
673
+ }, O = { stiffness: 17, damping: 6 }, C = 20, k = 800, Ft = () => {
674
+ let t, e = null;
675
+ return {
676
+ in: (r) => ({
677
+ spring: O,
678
+ prepare: (c) => {
679
+ c.style.transform = `perspective(${k}px) rotateY(${C}deg) translateX(-100%)`;
680
+ },
681
+ wait: async () => {
682
+ t && await t;
683
+ },
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}%)`;
687
+ },
688
+ onEnd: () => {
689
+ r.style.transform = "";
690
+ }
691
+ }),
692
+ out: (r, c) => (t = new Promise((s) => {
693
+ e = s;
694
+ }), {
695
+ spring: O,
696
+ prepare: (s) => {
697
+ b(s, c);
698
+ },
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}%)`;
702
+ },
703
+ onEnd: () => {
704
+ e && e(), r.style.transform = "";
705
+ }
706
+ })
707
+ };
708
+ }, yt = { stiffness: 1, damping: 1 }, ut = { stiffness: 20, damping: 25 }, gt = "#000000", ft = "circle", Y = "CURTAIN_REVEAL_OVERLAY_ID", $t = {
709
+ position: "fixed",
710
+ inset: "0",
711
+ width: "100vw",
712
+ height: "100%",
713
+ zIndex: "9999",
714
+ display: "flex",
715
+ alignItems: "center",
716
+ justifyContent: "center",
717
+ overflow: "hidden"
718
+ }, mt = {
719
+ position: "relative",
720
+ display: "inline-block",
721
+ height: "5.5rem",
722
+ overflow: "hidden"
723
+ }, xt = {
724
+ display: "flex",
725
+ height: "100%",
726
+ willChange: "transform",
727
+ transition: "transform 0.3s ease"
728
+ }, bt = {
729
+ display: "inline-flex",
730
+ alignItems: "center",
731
+ justifyContent: "center",
732
+ whiteSpace: "nowrap",
733
+ fontSize: "5.5rem",
734
+ fontWeight: "900",
735
+ letterSpacing: "0.02em",
736
+ color: "#FFFFFF"
737
+ }, wt = 0.4, _ = 0.5, Et = 0.2;
738
+ function Lt(t, e) {
739
+ switch (t) {
740
+ case "circle":
741
+ return `circle(${e * 100}% at 50% 50%)`;
742
+ case "square":
743
+ return `inset(${(1 - e) * 50}% round ${10 * e}%)`;
744
+ case "triangle": {
745
+ const r = e * 100;
746
+ return `polygon(50% ${50 - r}%, ${50 - r}% ${50 + r}%, ${50 + r}% ${50 + r}%)`;
747
+ }
748
+ }
749
+ }
750
+ const At = (t) => t.reduce((e, r) => e + r, 0), Ot = (t = {}) => {
751
+ const {
752
+ background: e = gt,
753
+ texts: r = [],
754
+ shape: c = ft,
755
+ inSpring: s = ut,
756
+ outSpring: o = yt,
757
+ textStyle: l = {}
758
+ } = t;
759
+ return {
760
+ out: (n, i) => {
761
+ const d = n.style.opacity;
762
+ return {
763
+ spring: o,
764
+ from: 1,
765
+ to: 0,
766
+ prepare: (a) => {
767
+ b(a, i), a.style.opacity = "1";
768
+ },
769
+ tick: (a) => {
770
+ const h = Math.max(0, a - wt);
771
+ n.style.opacity = String(h);
772
+ },
773
+ onEnd: () => {
774
+ n.style.opacity = d;
775
+ }
776
+ };
777
+ },
778
+ in: (n) => {
779
+ let i = null, d = null, a = null;
780
+ const h = document.body.style.overflow, g = document.getElementById(
781
+ Y
782
+ );
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) => {
786
+ 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
790
+ );
791
+ };
792
+ return {
793
+ spring: s,
794
+ from: 0,
795
+ to: 1,
796
+ 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)");
798
+ },
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)`;
807
+ }
808
+ if (p > _) {
809
+ const $ = 1 - Math.max(
810
+ 0,
811
+ Math.min(1, (p - _) / Et)
812
+ );
813
+ i.style.clipPath = Lt(c, $), d.style.transform = `scale(${$})`;
814
+ }
815
+ }
816
+ },
817
+ onEnd: () => {
818
+ i == null || i.remove(), i = d = a = null, document.body.style.overflow = h;
819
+ }
820
+ };
821
+ }
822
+ };
752
823
  };
753
824
  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
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
763
836
  };