@ssgoi/core 2.1.2 → 2.3.0

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