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