@ssgoi/core 2.2.0 → 2.3.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.
@@ -1,21 +1,21 @@
1
- const E = (t) => {
1
+ const D = (t) => {
2
2
  t.style.position = "absolute", t.style.width = "100%", t.style.top = "0", t.style.left = "0";
3
- }, X = (t) => new Promise((i) => setTimeout(i, t)), z = { stiffness: 80, damping: 25 }, F = { stiffness: 75, damping: 25 }, U = 300, Y = 10, O = "horizontal", v = "#000000", J = (t = {}) => {
3
+ }, N = (t) => new Promise((n) => setTimeout(n, t)), C = { stiffness: 80, damping: 25 }, v = { stiffness: 75, damping: 25 }, G = 300, q = 10, B = "horizontal", M = "#000000", st = (t = {}) => {
4
4
  const {
5
- inSpring: i = F,
6
- outSpring: l = z,
7
- transitionDelay: e = U,
8
- blindCount: s = Y,
9
- direction: o = O,
5
+ inSpring: n = v,
6
+ outSpring: e = C,
7
+ transitionDelay: i = G,
8
+ blindCount: l = q,
9
+ direction: a = B,
10
10
  staggerDelay: r = 100,
11
- blindColor: n = v
11
+ blindColor: s = M
12
12
  } = t;
13
- let c, d = null;
14
- const p = (h, a, f, u = !1) => {
15
- const y = Math.min(0.5, r * f / 1e3), g = 1 - y, x = (u ? f - 1 - a : a) / f * y, k = x + g;
16
- return h <= x ? 0 : h >= k ? 1 : (h - x) / g;
17
- }, $ = (h, a, f = "left") => {
18
- window.getComputedStyle(h).position === "static" && (h.style.position = "relative");
13
+ let o, h = null;
14
+ const d = (p, c, f, u = !1) => {
15
+ const y = Math.min(0.5, r * f / 1e3), g = 1 - y, x = (u ? f - 1 - c : c) / f * y, S = x + g;
16
+ return p <= x ? 0 : p >= S ? 1 : (p - x) / g;
17
+ }, $ = (p, c, f = "left") => {
18
+ window.getComputedStyle(p).position === "static" && (p.style.position = "relative");
19
19
  const y = document.createElement("div");
20
20
  y.className = "blind-container", y.style.cssText = `
21
21
  position: absolute;
@@ -28,122 +28,122 @@ const E = (t) => {
28
28
  overflow: hidden;
29
29
  `;
30
30
  const g = [];
31
- for (let w = 0; w < s; w++) {
31
+ for (let w = 0; w < l; w++) {
32
32
  const x = document.createElement("div");
33
- if (o === "horizontal") {
34
- const k = 100 / s, T = `calc(${k}% + 1px)`;
33
+ if (a === "horizontal") {
34
+ const S = 100 / l, A = `calc(${S}% + 1px)`;
35
35
  x.style.cssText = `
36
36
  position: absolute;
37
- top: ${k * w}%;
37
+ top: ${S * w}%;
38
38
  left: 0;
39
39
  width: 100%;
40
- height: ${T};
41
- background: ${n};
42
- transform: scaleX(${a === "hidden" ? 0 : 1});
40
+ height: ${A};
41
+ background: ${s};
42
+ transform: scaleX(${c === "hidden" ? 0 : 1});
43
43
  transform-origin: ${f} center;
44
44
  will-change: transform;
45
45
  `;
46
46
  } else {
47
- const k = 100 / s, T = `calc(${k}% + 1px)`;
47
+ const S = 100 / l, A = `calc(${S}% + 1px)`;
48
48
  x.style.cssText = `
49
49
  position: absolute;
50
50
  top: 0;
51
- left: ${k * w}%;
52
- width: ${T};
51
+ left: ${S * w}%;
52
+ width: ${A};
53
53
  height: 100%;
54
- background: ${n};
55
- transform: scaleY(${a === "hidden" ? 0 : 1});
54
+ background: ${s};
55
+ transform: scaleY(${c === "hidden" ? 0 : 1});
56
56
  transform-origin: ${f === "left" ? "top" : "bottom"} center;
57
57
  will-change: transform;
58
58
  `;
59
59
  }
60
60
  g.push(x), y.appendChild(x);
61
61
  }
62
- return h.appendChild(y), { container: y, blinds: g };
62
+ return p.appendChild(y), { container: y, blinds: g };
63
63
  };
64
64
  return {
65
65
  out: () => {
66
- let h = null;
67
- return c = new Promise((a) => {
68
- d = a;
66
+ let p = null;
67
+ return o = new Promise((c) => {
68
+ h = c;
69
69
  }), {
70
- spring: l,
71
- prepare: (a) => {
72
- E(a), a.style.zIndex = "1000", h = $(a, "hidden", "left");
70
+ spring: e,
71
+ prepare: (c) => {
72
+ D(c), c.style.zIndex = "1000", p = $(c, "hidden", "left");
73
73
  },
74
74
  onStart: () => {
75
75
  },
76
- tick: (a) => {
77
- if (!h) return;
78
- const f = 1 - a;
79
- h.blinds.forEach((u, y) => {
80
- const g = p(
76
+ tick: (c) => {
77
+ if (!p) return;
78
+ const f = 1 - c;
79
+ p.blinds.forEach((u, y) => {
80
+ const g = d(
81
81
  f,
82
82
  y,
83
- s,
83
+ l,
84
84
  !1
85
85
  // not reversed - left to right
86
86
  );
87
- o === "horizontal" ? u.style.transform = `scaleX(${g})` : u.style.transform = `scaleY(${g})`;
87
+ a === "horizontal" ? u.style.transform = `scaleX(${g})` : u.style.transform = `scaleY(${g})`;
88
88
  });
89
89
  },
90
90
  onEnd: () => {
91
- d && d();
91
+ h && h();
92
92
  }
93
93
  };
94
94
  },
95
95
  in: () => {
96
- let h = null;
96
+ let p = null;
97
97
  return {
98
- spring: i,
99
- prepare: (a) => {
100
- a.style.position = "relative", a.style.zIndex = "0", h = $(a, "closed", "right");
98
+ spring: n,
99
+ prepare: (c) => {
100
+ c.style.position = "relative", c.style.zIndex = "0", p = $(c, "closed", "right");
101
101
  },
102
102
  onStart: () => {
103
103
  },
104
104
  wait: async () => {
105
- c && await c, await X(e);
105
+ o && await o, await N(i);
106
106
  },
107
- tick: (a) => {
108
- h && h.blinds.forEach((f, u) => {
109
- const y = p(
110
- a,
107
+ tick: (c) => {
108
+ p && p.blinds.forEach((f, u) => {
109
+ const y = d(
110
+ c,
111
111
  u,
112
- s,
112
+ l,
113
113
  !1
114
114
  // same direction as OUT - left to right
115
115
  );
116
- o === "horizontal" ? f.style.transform = `scaleX(${1 - y})` : f.style.transform = `scaleY(${1 - y})`;
116
+ a === "horizontal" ? f.style.transform = `scaleX(${1 - y})` : f.style.transform = `scaleY(${1 - y})`;
117
117
  });
118
118
  },
119
119
  onEnd: () => {
120
- h && h.container && h.container.remove();
120
+ p && p.container && p.container.remove();
121
121
  }
122
122
  };
123
123
  }
124
124
  };
125
- }, A = (t) => {
125
+ }, k = (t) => {
126
126
  t.style.position = "absolute", t.style.width = "100%", t.style.top = "0", t.style.left = "0";
127
- }, K = (t = {}) => {
128
- var s, o;
129
- const { opacity: i = !1, direction: l = "enter" } = t, e = {
130
- stiffness: ((s = t.spring) == null ? void 0 : s.stiffness) ?? 150,
131
- damping: ((o = t.spring) == null ? void 0 : o.damping) ?? 20
127
+ }, it = (t = {}) => {
128
+ var l, a;
129
+ const { opacity: n = !1, direction: e = "enter" } = t, i = {
130
+ stiffness: ((l = t.spring) == null ? void 0 : l.stiffness) ?? 150,
131
+ damping: ((a = t.spring) == null ? void 0 : a.damping) ?? 20
132
132
  };
133
- return l === "enter" ? {
133
+ return e === "enter" ? {
134
134
  in: (r) => ({
135
- spring: e,
136
- tick: (n) => {
137
- r.style.transform = `translateX(${(1 - n) * 100}%)`, i && (r.style.opacity = n.toString());
135
+ spring: i,
136
+ tick: (s) => {
137
+ r.style.transform = `translateX(${(1 - s) * 100}%)`, n && (r.style.opacity = s.toString());
138
138
  }
139
139
  }),
140
140
  out: (r) => ({
141
- spring: e,
142
- prepare: (n) => {
143
- A(n), n.style.zIndex = "-1";
141
+ spring: i,
142
+ prepare: (s) => {
143
+ k(s), s.style.zIndex = "-1";
144
144
  },
145
- tick: (n) => {
146
- r.style.transform = `translateX(${-(1 - n) * 20}%)`, i && (r.style.opacity = n.toString());
145
+ tick: (s) => {
146
+ r.style.transform = `translateX(${-(1 - s) * 20}%)`, n && (r.style.opacity = s.toString());
147
147
  }
148
148
  })
149
149
  } : {
@@ -152,8 +152,8 @@ const E = (t) => {
152
152
  stiffness: 100,
153
153
  damping: 20
154
154
  },
155
- tick: (n) => {
156
- r.style.transform = `translateX(${-(1 - n) * 20}%)`, i && (r.style.opacity = n.toString());
155
+ tick: (s) => {
156
+ r.style.transform = `translateX(${-(1 - s) * 20}%)`, n && (r.style.opacity = s.toString());
157
157
  }
158
158
  }),
159
159
  out: (r) => ({
@@ -161,355 +161,447 @@ const E = (t) => {
161
161
  stiffness: 100,
162
162
  damping: 20
163
163
  },
164
- prepare: (n) => {
165
- A(n), n.style.zIndex = "100";
164
+ prepare: (s) => {
165
+ k(s), s.style.zIndex = "100";
166
166
  },
167
- tick: (n) => {
168
- r.style.transform = `translateX(${(1 - n) * 100}%)`, i && (r.style.opacity = n.toString());
167
+ tick: (s) => {
168
+ r.style.transform = `translateX(${(1 - s) * 100}%)`, n && (r.style.opacity = s.toString());
169
169
  }
170
170
  })
171
171
  };
172
- }, C = (t) => new Promise((i) => setTimeout(i, t)), N = { stiffness: 400, damping: 20 }, q = { stiffness: 40, damping: 8 }, B = 100, Q = (t = {}) => {
172
+ }, H = (t) => new Promise((n) => setTimeout(n, t)), W = { stiffness: 400, damping: 20 }, Z = { stiffness: 40, damping: 8 }, j = 100, et = (t = {}) => {
173
173
  const {
174
- inSpring: i = q,
175
- outSpring: l = N,
176
- transitionDelay: e = B
174
+ inSpring: n = Z,
175
+ outSpring: e = W,
176
+ transitionDelay: i = j
177
177
  } = t;
178
- let s, o = null;
178
+ let l, a = null;
179
179
  return {
180
180
  in: (r) => ({
181
- spring: i,
182
- prepare: (n) => {
183
- n.style.opacity = "0";
181
+ spring: n,
182
+ prepare: (s) => {
183
+ s.style.opacity = "0";
184
184
  },
185
185
  wait: async () => {
186
- s && (await s, await C(e));
186
+ l && (await l, await H(i));
187
187
  },
188
- tick: (n) => {
189
- r.style.opacity = n.toString();
188
+ tick: (s) => {
189
+ r.style.opacity = s.toString();
190
190
  }
191
191
  }),
192
- out: (r) => (s = new Promise((n) => {
193
- o = n;
192
+ out: (r) => (l = new Promise((s) => {
193
+ a = s;
194
194
  }), {
195
- spring: l,
196
- tick: (n) => {
197
- r.style.opacity = n.toString();
195
+ spring: e,
196
+ tick: (s) => {
197
+ r.style.opacity = s.toString();
198
198
  },
199
- prepare: A,
199
+ prepare: k,
200
200
  onEnd: () => {
201
- o && o();
201
+ a && a();
202
202
  }
203
203
  })
204
204
  };
205
205
  };
206
- function m(t, i) {
207
- function l(o) {
208
- let r = 0, n = 0;
209
- const c = o.offsetWidth, d = o.offsetHeight;
210
- let p = o;
211
- for (; p; )
212
- r += p.offsetTop, n += p.offsetLeft, p = p.offsetParent;
213
- return r -= window.scrollY, n -= window.scrollX, { top: r, left: n, width: c, height: d };
206
+ function P(t, n) {
207
+ function e(a) {
208
+ let r = 0, s = 0;
209
+ const o = a.offsetWidth, h = a.offsetHeight;
210
+ let d = a;
211
+ for (; d; )
212
+ r += d.offsetTop, s += d.offsetLeft, d = d.offsetParent;
213
+ return r -= window.scrollY, s -= window.scrollX, { top: r, left: s, width: o, height: h };
214
214
  }
215
- const e = l(t), s = l(i);
215
+ const i = e(t), l = e(n);
216
216
  return new DOMRect(
217
- s.left - e.left,
218
- s.top - e.top,
219
- s.width,
220
- s.height
217
+ l.left - i.left,
218
+ l.top - i.top,
219
+ l.width,
220
+ l.height
221
221
  );
222
222
  }
223
- function G(t, i) {
224
- return t.querySelector(`[data-hero-key="${i}"]`);
223
+ const J = {
224
+ stiffness: 10,
225
+ // Lower stiffness for smoother motion
226
+ damping: 5
227
+ // Lower damping for more fluid movement
228
+ }, m = 0.2, T = 0.82;
229
+ function I(t) {
230
+ const n = P(document.body, t.positionedParent);
231
+ return {
232
+ top: t.scroll.y,
233
+ left: 0,
234
+ width: n.width,
235
+ height: window.innerHeight - n.top
236
+ };
237
+ }
238
+ function b(t, n) {
239
+ const e = n.left + n.width / 2, i = n.top + n.height / 2;
240
+ t.style.transformOrigin = `${e}px ${i}px`;
241
+ }
242
+ function Y(t, n) {
243
+ t.style.clipPath = `polygon(
244
+ ${n.left}px ${n.top}px,
245
+ ${n.left + n.width}px ${n.top}px,
246
+ ${n.left + n.width}px ${n.top + n.height}px,
247
+ ${n.left}px ${n.top + n.height}px
248
+ )`;
225
249
  }
226
- const V = (t = {}) => {
227
- var o, r;
228
- const i = {
229
- stiffness: ((o = t.spring) == null ? void 0 : o.stiffness) ?? 300,
250
+ function E(t, n, e) {
251
+ return t <= n ? 0 : t >= e ? 1 : (t - n) / (e - n);
252
+ }
253
+ const rt = (t) => {
254
+ const n = (t == null ? void 0 : t.spring) ?? J, e = (t == null ? void 0 : t.scale) ?? 0.9;
255
+ return {
256
+ out: async (i, l) => {
257
+ const a = I(l);
258
+ return {
259
+ spring: n,
260
+ prepare: () => {
261
+ D(i), b(i, a), Y(i, a);
262
+ },
263
+ onEnd: () => {
264
+ i.style.clipPath = "", i.style.transformOrigin = "";
265
+ },
266
+ tick: (r) => {
267
+ const s = 1 - r;
268
+ if (s < m) {
269
+ const o = E(s, 0, m), h = 1 - (1 - e) * o;
270
+ i.style.transform = `scale(${h})`;
271
+ } else if (s < T) {
272
+ const o = E(
273
+ s,
274
+ m,
275
+ T
276
+ ), h = -a.height * o;
277
+ i.style.transform = `translateY(${h}px) scale(${e})`;
278
+ } else {
279
+ const o = E(s, T, 1), h = e + (1 - e) * o;
280
+ i.style.transform = `translateY(${-a.height}px) scale(${h})`;
281
+ }
282
+ }
283
+ };
284
+ },
285
+ in: async (i, l) => {
286
+ const a = I(l);
287
+ return {
288
+ spring: n,
289
+ prepare: () => {
290
+ b(i, a), Y(i, a), i.style.transform = `translateY(${a.height}px) scale(${e})`;
291
+ },
292
+ onEnd: () => {
293
+ i.style.clipPath = "", i.style.transformOrigin = "";
294
+ },
295
+ tick: (r) => {
296
+ if (r < m)
297
+ i.style.transform = `translateY(${a.height}px) scale(${e})`, i.style.opacity = "0";
298
+ else if (r < T) {
299
+ const s = E(
300
+ r,
301
+ m,
302
+ T
303
+ ), o = a.height * (1 - s);
304
+ i.style.transform = `translateY(${o}px) scale(${e})`, i.style.opacity = "1";
305
+ } else {
306
+ const s = E(r, T, 1), o = e + (1 - e) * s;
307
+ i.style.transform = `scale(${o})`, i.style.opacity = "1";
308
+ }
309
+ }
310
+ };
311
+ }
312
+ };
313
+ };
314
+ function K(t, n) {
315
+ return t.querySelector(`[data-hero-key="${n}"]`);
316
+ }
317
+ const at = (t = {}) => {
318
+ var a, r;
319
+ const n = {
320
+ stiffness: ((a = t.spring) == null ? void 0 : a.stiffness) ?? 300,
230
321
  damping: ((r = t.spring) == null ? void 0 : r.damping) ?? 30
231
- }, l = t.timeout ?? 300;
232
- let e = null, s = null;
322
+ }, e = t.timeout ?? 300;
323
+ let i = null, l = null;
233
324
  return {
234
- in: async (n, c) => {
235
- const d = n, p = Array.from(d.querySelectorAll("[data-hero-key]"));
236
- if (p.length === 0)
325
+ in: async (s, o) => {
326
+ const h = s, d = Array.from(h.querySelectorAll("[data-hero-key]"));
327
+ if (d.length === 0)
237
328
  return {
238
- spring: i,
329
+ spring: n,
239
330
  tick: () => {
240
331
  }
241
332
  // No hero elements, skip animation
242
333
  };
243
- if (!await new Promise((a) => {
244
- e ? a(!0) : (s = a, setTimeout(() => {
245
- s = null, a(!1);
246
- }, l));
247
- }) || !e)
248
- return e = null, {
249
- spring: i,
334
+ if (!await new Promise((c) => {
335
+ i ? c(!0) : (l = c, setTimeout(() => {
336
+ l = null, c(!1);
337
+ }, e));
338
+ }) || !i)
339
+ return i = null, {
340
+ spring: n,
250
341
  tick: () => {
251
342
  }
252
343
  // No fromNode, skip animation
253
344
  };
254
- const h = p.map((a) => {
255
- const f = a.getAttribute("data-hero-key");
345
+ const p = d.map((c) => {
346
+ const f = c.getAttribute("data-hero-key");
256
347
  if (!f) return null;
257
- const u = G(e, f);
348
+ const u = K(i, f);
258
349
  if (!u) return null;
259
- const y = a, g = m(e, u), w = m(d, y), x = g.left - w.left - c.scrollOffset.x, k = g.top - w.top - c.scrollOffset.y, T = g.width / w.width, D = g.height / w.height, b = y.style.transform, L = y.style.position, P = y.style.transformOrigin, _ = y.style.zIndex;
350
+ const y = c, g = P(i, u), w = P(h, y), x = g.left - w.left - o.scrollOffset.x, S = g.top - w.top - o.scrollOffset.y, A = g.width / w.width, F = g.height / w.height, O = y.style.transform, X = y.style.position, U = y.style.transformOrigin, z = y.style.zIndex;
260
351
  return {
261
352
  toEl: y,
262
353
  dx: x,
263
- dy: k,
264
- dw: T,
265
- dh: D,
266
- originalTransform: b,
267
- originalPosition: L,
268
- originalTransformOrigin: P,
269
- originalZIndex: _
354
+ dy: S,
355
+ dw: A,
356
+ dh: F,
357
+ originalTransform: O,
358
+ originalPosition: X,
359
+ originalTransformOrigin: U,
360
+ originalZIndex: z
270
361
  };
271
362
  }).filter(Boolean);
272
- return e = null, h.length === 0 ? {
273
- spring: i,
363
+ return i = null, p.length === 0 ? {
364
+ spring: n,
274
365
  tick: () => {
275
366
  }
276
367
  // No matching hero elements
277
368
  } : {
278
- spring: i,
369
+ spring: n,
279
370
  prepare: () => {
280
- h.forEach(({ toEl: a }) => {
281
- a.style.position = "relative", a.style.transformOrigin = "top left", a.style.zIndex = "1000";
371
+ p.forEach(({ toEl: c }) => {
372
+ c.style.position = "relative", c.style.transformOrigin = "top left", c.style.zIndex = "1000";
282
373
  });
283
374
  },
284
- tick: (a) => {
285
- h.forEach(({ toEl: f, dx: u, dy: y, dw: g, dh: w }) => {
286
- f.style.transform = `translate(${(1 - a) * u}px,${(1 - a) * y}px) scale(${a + (1 - a) * g}, ${a + (1 - a) * w})`;
375
+ tick: (c) => {
376
+ p.forEach(({ toEl: f, dx: u, dy: y, dw: g, dh: w }) => {
377
+ f.style.transform = `translate(${(1 - c) * u}px,${(1 - c) * y}px) scale(${c + (1 - c) * g}, ${c + (1 - c) * w})`;
287
378
  });
288
379
  },
289
380
  onEnd: () => {
290
- h.forEach(
381
+ p.forEach(
291
382
  ({
292
- toEl: a,
383
+ toEl: c,
293
384
  originalTransform: f,
294
385
  originalPosition: u,
295
386
  originalTransformOrigin: y,
296
387
  originalZIndex: g
297
388
  }) => {
298
- a.style.transform = f, a.style.position = u, a.style.transformOrigin = y, a.style.zIndex = g;
389
+ c.style.transform = f, c.style.position = u, c.style.transformOrigin = y, c.style.zIndex = g;
299
390
  }
300
391
  );
301
392
  }
302
393
  };
303
394
  },
304
- out: async (n) => ({
395
+ out: async (s) => ({
305
396
  onStart: () => {
306
- e = n, s && (s(!0), s = null);
397
+ i = s, l && (l(!0), l = null);
307
398
  },
308
- prepare: (c) => {
309
- A(c), c.style.opacity = "0";
399
+ prepare: (o) => {
400
+ k(o), o.style.opacity = "0";
310
401
  }
311
402
  })
312
403
  };
313
404
  };
314
- function M({
405
+ function Q({
315
406
  detailRect: t,
316
- galleryRect: i,
317
- pageRect: l,
318
- scrollOffset: e
319
- }, s) {
320
- const o = i.left - t.left + (i.width - t.width) / 2 - e.x, r = i.top - t.top + (i.height - t.height) / 2 - e.y, n = i.width / t.width, c = i.height / t.height, d = Math.max(n, c), p = t.top / l.height * 100, $ = (l.width - (t.left + t.width)) / l.width * 100, h = (l.height - (t.top + t.height)) / l.height * 100, a = t.left / l.width * 100;
321
- return s.style.transformOrigin = `${t.left + t.width / 2}px ${t.top + t.height / 2}px`, (f) => {
322
- const u = 1 - f, y = p * u, g = $ * u, w = h * u, x = a * u;
323
- s.style.clipPath = `inset(${y}% ${g}% ${w}% ${x}%)`, s.style.transform = `translate(${o * u}px, ${r * u}px) scale(${1 + (d - 1) * u})`;
407
+ galleryRect: n,
408
+ pageRect: e,
409
+ scrollOffset: i
410
+ }, l) {
411
+ const a = n.left - t.left + (n.width - t.width) / 2 - i.x, r = n.top - t.top + (n.height - t.height) / 2 - i.y, s = n.width / t.width, o = n.height / t.height, h = Math.max(s, o), d = t.top / e.height * 100, $ = (e.width - (t.left + t.width)) / e.width * 100, p = (e.height - (t.top + t.height)) / e.height * 100, c = t.left / e.width * 100;
412
+ return l.style.transformOrigin = `${t.left + t.width / 2}px ${t.top + t.height / 2}px`, (f) => {
413
+ const u = 1 - f, y = d * u, g = $ * u, w = p * u, x = c * u;
414
+ l.style.clipPath = `inset(${y}% ${g}% ${w}% ${x}%)`, l.style.transform = `translate(${a * u}px, ${r * u}px) scale(${1 + (h - 1) * u})`;
324
415
  };
325
416
  }
326
- function H({
417
+ function V({
327
418
  galleryRect: t,
328
- detailRect: i,
329
- scrollOffset: l
330
- }, e) {
331
- const s = i.left - t.left + (i.width - t.width) / 2 + l.x, o = i.top - t.top + (i.height - t.height) / 2 + l.y, r = i.width / t.width, n = i.height / t.height, c = Math.max(r, n);
332
- return (d) => {
333
- e.style.transformOrigin = `${t.left + t.width / 2}px ${t.top + t.height / 2}px`;
334
- const p = 1 - d;
335
- e.style.transform = `translate(${s * p - l.x}px, ${o * p - l.y}px) scale(${1 + (c - 1) * p})`, e.style.opacity = `${1 - p}`;
419
+ detailRect: n,
420
+ scrollOffset: e
421
+ }, i) {
422
+ const l = n.left - t.left + (n.width - t.width) / 2 + e.x, a = n.top - t.top + (n.height - t.height) / 2 + e.y, r = n.width / t.width, s = n.height / t.height, o = Math.max(r, s);
423
+ return (h) => {
424
+ i.style.transformOrigin = `${t.left + t.width / 2}px ${t.top + t.height / 2}px`;
425
+ const d = 1 - h;
426
+ i.style.transform = `translate(${l * d - e.x}px, ${a * d - e.y}px) scale(${1 + (o - 1) * d})`, i.style.opacity = `${1 - d}`;
336
427
  };
337
428
  }
338
- function W({
429
+ function R({
339
430
  galleryRect: t,
340
- detailRect: i,
341
- scrollOffset: l
342
- }, e) {
343
- const s = i.left - t.left + (i.width - t.width) / 2 - l.x, o = i.top - t.top + (i.height - t.height) / 2 - l.y, r = i.width / t.width, n = i.height / t.height, c = Math.max(r, n);
344
- return (d) => {
345
- const p = 1 - d, $ = d;
346
- e.style.transformOrigin = `${t.left + t.width / 2}px ${t.top + t.height / 2}px`, e.style.transform = `translate(${s * p}px, ${o * p}px) scale(${1 + (c - 1) * p})`, e.style.opacity = `${$}`;
431
+ detailRect: n,
432
+ scrollOffset: e
433
+ }, i) {
434
+ const l = n.left - t.left + (n.width - t.width) / 2 - e.x, a = n.top - t.top + (n.height - t.height) / 2 - e.y, r = n.width / t.width, s = n.height / t.height, o = Math.max(r, s);
435
+ return (h) => {
436
+ const d = 1 - h, $ = h;
437
+ i.style.transformOrigin = `${t.left + t.width / 2}px ${t.top + t.height / 2}px`, i.style.transform = `translate(${l * d}px, ${a * d}px) scale(${1 + (o - 1) * d})`, i.style.opacity = `${$}`;
347
438
  };
348
439
  }
349
- function Z({
440
+ function tt({
350
441
  detailRect: t,
351
- galleryRect: i,
352
- pageRect: l,
353
- scrollOffset: e
354
- }, s) {
355
- const o = i.left - t.left + (i.width - t.width) / 2 + e.x, r = i.top - t.top + (i.height - t.height) / 2 + e.y, n = i.width / t.width, c = i.height / t.height, d = Math.min(n, c), p = t.top / l.height * 100, $ = (l.width - (t.left + t.width)) / l.width * 100, h = (l.height - (t.top + t.height)) / l.height * 100, a = t.left / l.width * 100;
356
- return s.style.transformOrigin = `${t.left + t.width / 2}px ${t.top + t.height / 2}px`, (f) => {
357
- const u = 1 - f, y = p * u, g = $ * u, w = h * u, x = a * u;
358
- s.style.clipPath = `inset(${y}% ${g}% ${w}% ${x}%)`, s.style.transform = `translate(${o * u - e.x}px, ${r * u - e.y}px) scale(${1 + (d - 1) * u})`;
442
+ galleryRect: n,
443
+ pageRect: e,
444
+ scrollOffset: i
445
+ }, l) {
446
+ const a = n.left - t.left + (n.width - t.width) / 2 + i.x, r = n.top - t.top + (n.height - t.height) / 2 + i.y, s = n.width / t.width, o = n.height / t.height, h = Math.min(s, o), d = t.top / e.height * 100, $ = (e.width - (t.left + t.width)) / e.width * 100, p = (e.height - (t.top + t.height)) / e.height * 100, c = t.left / e.width * 100;
447
+ return l.style.transformOrigin = `${t.left + t.width / 2}px ${t.top + t.height / 2}px`, (f) => {
448
+ const u = 1 - f, y = d * u, g = $ * u, w = p * u, x = c * u;
449
+ l.style.clipPath = `inset(${y}% ${g}% ${w}% ${x}%)`, l.style.transform = `translate(${a * u - i.x}px, ${r * u - i.y}px) scale(${1 + (h - 1) * u})`;
359
450
  };
360
451
  }
361
- function j(t, i, l) {
362
- const e = t.querySelector(
452
+ function nt(t, n, e) {
453
+ const i = t.querySelector(
363
454
  "[data-pinterest-detail-key]"
364
- ), s = i.querySelector(
455
+ ), l = n.querySelector(
365
456
  "[data-pinterest-detail-key]"
366
457
  );
367
- if (t.querySelectorAll("[data-pinterest-detail-key]").length > 1 || i.querySelectorAll("[data-pinterest-detail-key]").length > 1)
458
+ if (t.querySelectorAll("[data-pinterest-detail-key]").length > 1 || n.querySelectorAll("[data-pinterest-detail-key]").length > 1)
368
459
  return null;
369
- let o = null, r = null, n = !1;
370
- if (!e && s) {
371
- r = s;
460
+ let a = null, r = null, s = !1;
461
+ if (!i && l) {
462
+ r = l;
372
463
  const $ = r.getAttribute("data-pinterest-detail-key");
373
464
  if (!$) return null;
374
- o = t.querySelector(
465
+ a = t.querySelector(
375
466
  `[data-pinterest-gallery-key="${$}"]`
376
- ), o && (n = !0);
377
- } else if (e && !s) {
378
- r = e;
467
+ ), a && (s = !0);
468
+ } else if (i && !l) {
469
+ r = i;
379
470
  const $ = r.getAttribute("data-pinterest-detail-key");
380
471
  if (!$) return null;
381
- o = i.querySelector(
472
+ a = n.querySelector(
382
473
  `[data-pinterest-gallery-key="${$}"]`
383
- ), o && (n = !1);
474
+ ), a && (s = !1);
384
475
  }
385
- if (!o || !r)
476
+ if (!a || !r)
386
477
  return null;
387
- const c = m(n ? t : i, o), d = m(n ? i : t, r), p = i.getBoundingClientRect();
388
- return n ? {
389
- inAnimation: M(
390
- { detailRect: d, galleryRect: c, pageRect: p, scrollOffset: l },
391
- i
478
+ const o = P(s ? t : n, a), h = P(s ? n : t, r), d = n.getBoundingClientRect();
479
+ return s ? {
480
+ inAnimation: Q(
481
+ { detailRect: h, galleryRect: o, pageRect: d, scrollOffset: e },
482
+ n
392
483
  ),
393
- outAnimation: H(
394
- { galleryRect: c, detailRect: d, scrollOffset: l },
484
+ outAnimation: V(
485
+ { galleryRect: o, detailRect: h, scrollOffset: e },
395
486
  t
396
487
  )
397
488
  } : {
398
- inAnimation: W(
399
- { galleryRect: c, detailRect: d, scrollOffset: l },
400
- i
489
+ inAnimation: R(
490
+ { galleryRect: o, detailRect: h, scrollOffset: e },
491
+ n
401
492
  ),
402
- outAnimation: Z(
403
- { detailRect: d, galleryRect: c, pageRect: p, scrollOffset: l },
493
+ outAnimation: tt(
494
+ { detailRect: h, galleryRect: o, pageRect: d, scrollOffset: e },
404
495
  t
405
496
  )
406
497
  };
407
498
  }
408
- const R = (t = {}) => {
409
- var r, n;
410
- const i = {
499
+ const lt = (t = {}) => {
500
+ var r, s;
501
+ const n = {
411
502
  stiffness: ((r = t.spring) == null ? void 0 : r.stiffness) ?? 50,
412
- damping: ((n = t.spring) == null ? void 0 : n.damping) ?? 10
413
- }, l = t.timeout ?? 300;
414
- let e = null, s = null, o = null;
503
+ damping: ((s = t.spring) == null ? void 0 : s.damping) ?? 10
504
+ }, e = t.timeout ?? 300;
505
+ let i = null, l = null, a = null;
415
506
  return {
416
- in: async (c, { scrollOffset: d }) => {
417
- const p = c;
418
- return !await new Promise((h) => {
419
- e ? h(!0) : (s = h, setTimeout(() => {
420
- s = null, h(!1);
421
- }, l));
422
- }) || !e ? (e = null, {
423
- spring: i,
507
+ in: async (o, { scrollOffset: h }) => {
508
+ const d = o;
509
+ return !await new Promise((p) => {
510
+ i ? p(!0) : (l = p, setTimeout(() => {
511
+ l = null, p(!1);
512
+ }, e));
513
+ }) || !i ? (i = null, {
514
+ spring: n,
424
515
  tick: () => {
425
516
  }
426
- }) : (o = j(e, p, d), o ? (e = null, {
427
- spring: i,
428
- tick: (h) => {
429
- o && o.inAnimation(h);
517
+ }) : (a = nt(i, d, h), a ? (i = null, {
518
+ spring: n,
519
+ tick: (p) => {
520
+ a && a.inAnimation(p);
430
521
  }
431
522
  }) : {
432
- spring: i,
523
+ spring: n,
433
524
  tick: () => {
434
525
  }
435
526
  });
436
527
  },
437
- out: async (c) => ({
438
- spring: i,
528
+ out: async (o) => ({
529
+ spring: n,
439
530
  onStart: () => {
440
- e = c, s && (s(!0), s = null);
531
+ i = o, l && (l(!0), l = null);
441
532
  },
442
- prepare: (d) => {
443
- A(d), d.style.zIndex = "-1";
533
+ prepare: (h) => {
534
+ k(h), h.style.zIndex = "-1";
444
535
  },
445
- tick: (d) => {
446
- o && o.outAnimation(d);
536
+ tick: (h) => {
537
+ a && a.outAnimation(h);
447
538
  }
448
539
  })
449
540
  };
450
- }, S = {
541
+ }, _ = {
451
542
  stiffness: 30,
452
543
  damping: 7
453
- }, tt = (t = {}) => {
454
- var s, o;
455
- const i = t.direction ?? "up", l = {
456
- stiffness: ((s = t.spring) == null ? void 0 : s.stiffness) ?? S.stiffness,
457
- damping: ((o = t.spring) == null ? void 0 : o.damping) ?? S.damping
458
- }, e = i === "up";
544
+ }, ot = (t = {}) => {
545
+ var l, a;
546
+ const n = t.direction ?? "up", e = {
547
+ stiffness: ((l = t.spring) == null ? void 0 : l.stiffness) ?? _.stiffness,
548
+ damping: ((a = t.spring) == null ? void 0 : a.damping) ?? _.damping
549
+ }, i = n === "up";
459
550
  return {
460
551
  in: (r) => ({
461
- spring: l,
462
- tick: (n) => {
463
- const c = e ? (1 - n) * 100 : (1 - n) * -100;
464
- r.style.transform = `translateY(${c}vh)`;
552
+ spring: e,
553
+ tick: (s) => {
554
+ const o = i ? (1 - s) * 100 : (1 - s) * -100;
555
+ r.style.transform = `translateY(${o}vh)`;
465
556
  }
466
557
  }),
467
558
  out: (r) => ({
468
- spring: l,
469
- tick: (n) => {
470
- const c = e ? (1 - n) * -100 : (1 - n) * 100;
471
- r.style.transform = `translateY(${c}vh)`;
559
+ spring: e,
560
+ tick: (s) => {
561
+ const o = i ? (1 - s) * -100 : (1 - s) * 100;
562
+ r.style.transform = `translateY(${o}vh)`;
472
563
  },
473
- prepare: (n) => {
474
- A(n), n.style.zIndex = e ? "-1" : "1";
564
+ prepare: (s) => {
565
+ k(s), s.style.zIndex = i ? "-1" : "1";
475
566
  }
476
567
  })
477
568
  };
478
- }, I = {
569
+ }, L = {
479
570
  stiffness: 30,
480
571
  damping: 7
481
- }, nt = (t = {}) => {
482
- var s, o;
483
- const i = t.direction ?? "left", l = {
484
- stiffness: ((s = t.spring) == null ? void 0 : s.stiffness) ?? I.stiffness,
485
- damping: ((o = t.spring) == null ? void 0 : o.damping) ?? I.damping
486
- }, e = i === "left";
572
+ }, ct = (t = {}) => {
573
+ var l, a;
574
+ const n = t.direction ?? "left", e = {
575
+ stiffness: ((l = t.spring) == null ? void 0 : l.stiffness) ?? L.stiffness,
576
+ damping: ((a = t.spring) == null ? void 0 : a.damping) ?? L.damping
577
+ }, i = n === "left";
487
578
  return {
488
579
  in: (r) => ({
489
- spring: l,
490
- tick: (n) => {
491
- const c = e ? (1 - n) * 100 : (1 - n) * -100;
492
- r.style.transform = `translateX(${c}%)`;
580
+ spring: e,
581
+ tick: (s) => {
582
+ const o = i ? (1 - s) * 100 : (1 - s) * -100;
583
+ r.style.transform = `translateX(${o}%)`;
493
584
  }
494
585
  }),
495
586
  out: (r) => ({
496
- spring: l,
497
- tick: (n) => {
498
- const c = e ? (1 - n) * -100 : (1 - n) * 100;
499
- r.style.transform = `translateX(${c}%)`;
587
+ spring: e,
588
+ tick: (s) => {
589
+ const o = i ? (1 - s) * -100 : (1 - s) * 100;
590
+ r.style.transform = `translateX(${o}%)`;
500
591
  },
501
- prepare: (n) => {
502
- E(n), n.style.zIndex = e ? "-1" : "1";
592
+ prepare: (s) => {
593
+ D(s), s.style.zIndex = i ? "-1" : "1";
503
594
  }
504
595
  })
505
596
  };
506
597
  };
507
598
  export {
508
- J as blind,
509
- K as drill,
510
- Q as fade,
511
- V as hero,
512
- R as pinterest,
513
- tt as scroll,
514
- nt as slide
599
+ st as blind,
600
+ it as drill,
601
+ et as fade,
602
+ rt as film,
603
+ at as hero,
604
+ lt as pinterest,
605
+ ot as scroll,
606
+ ct as slide
515
607
  };