@ssgoi/core 3.4.0 → 3.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/index.cjs +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -14
- package/dist/transitions/blur.d.ts +2 -5
- package/dist/transitions/blur.d.ts.map +1 -1
- package/dist/transitions/bounce.d.ts +2 -5
- package/dist/transitions/bounce.d.ts.map +1 -1
- package/dist/transitions/fade.d.ts +2 -5
- package/dist/transitions/fade.d.ts.map +1 -1
- package/dist/transitions/fly.d.ts +2 -5
- package/dist/transitions/fly.d.ts.map +1 -1
- package/dist/transitions/index.cjs +1 -1
- package/dist/transitions/index.js +181 -172
- package/dist/transitions/mask.d.ts +2 -5
- package/dist/transitions/mask.d.ts.map +1 -1
- package/dist/transitions/none.d.ts +2 -5
- package/dist/transitions/none.d.ts.map +1 -1
- package/dist/transitions/rotate.d.ts +2 -5
- package/dist/transitions/rotate.d.ts.map +1 -1
- package/dist/transitions/scale.d.ts +2 -5
- package/dist/transitions/scale.d.ts.map +1 -1
- package/dist/transitions/slide.d.ts +2 -5
- package/dist/transitions/slide.d.ts.map +1 -1
- package/dist/view-transitions/depth.d.ts +19 -0
- package/dist/view-transitions/depth.d.ts.map +1 -0
- package/dist/view-transitions/index.cjs +13 -13
- package/dist/view-transitions/index.d.ts +5 -2
- package/dist/view-transitions/index.d.ts.map +1 -1
- package/dist/view-transitions/index.js +980 -602
- package/dist/view-transitions/instagram.d.ts.map +1 -1
- package/dist/view-transitions/jaemin.d.ts +0 -4
- package/dist/view-transitions/jaemin.d.ts.map +1 -1
- package/dist/view-transitions/pinterest.d.ts.map +1 -1
- package/dist/view-transitions/sheet.d.ts +19 -0
- package/dist/view-transitions/sheet.d.ts.map +1 -0
- package/dist/view-transitions/swap.d.ts +13 -0
- package/dist/view-transitions/swap.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/jaemin-BG8HRXG1.cjs +0 -1
- package/dist/jaemin-BWkrXq0V.js +0 -131
|
@@ -1,26 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
const m = (t, n) => {
|
|
2
|
+
var r;
|
|
3
|
+
t.style.position = "absolute", t.style.width = "100%", t.style.top = `${-1 * (((r = n == null ? void 0 : n.scrollOffset) == null ? void 0 : r.y) ?? 0)}px`, t.style.left = "0";
|
|
4
|
+
}, W = (t) => new Promise((n) => setTimeout(n, t));
|
|
5
|
+
function x(t, n) {
|
|
6
|
+
function r(o) {
|
|
7
|
+
let d = 0, s = 0;
|
|
8
|
+
const c = o.offsetWidth, e = o.offsetHeight;
|
|
9
|
+
let i = o;
|
|
10
|
+
for (; i; )
|
|
11
|
+
d += i.offsetTop, s += i.offsetLeft, i = i.offsetParent;
|
|
12
|
+
return d -= window.scrollY, s -= window.scrollX, { top: d, left: s, width: c, height: e };
|
|
13
|
+
}
|
|
14
|
+
const p = r(t), a = r(n);
|
|
15
|
+
return new DOMRect(
|
|
16
|
+
a.left - p.left,
|
|
17
|
+
a.top - p.top,
|
|
18
|
+
a.width,
|
|
19
|
+
a.height
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
function S() {
|
|
5
23
|
let t, n;
|
|
6
|
-
return { promise: new Promise((
|
|
7
|
-
t =
|
|
24
|
+
return { promise: new Promise((p, a) => {
|
|
25
|
+
t = p, n = a;
|
|
8
26
|
}), resolve: t, reject: n };
|
|
9
27
|
}
|
|
10
|
-
const
|
|
28
|
+
const Q = { stiffness: 80, damping: 25 }, R = { stiffness: 75, damping: 25 }, tt = 300, nt = 10, it = "horizontal", st = "#000000", Nt = (t = {}) => {
|
|
11
29
|
const {
|
|
12
|
-
inSpring: n =
|
|
13
|
-
outSpring:
|
|
14
|
-
transitionDelay:
|
|
15
|
-
blindCount: a =
|
|
16
|
-
direction:
|
|
17
|
-
blindColor:
|
|
30
|
+
inSpring: n = R,
|
|
31
|
+
outSpring: r = Q,
|
|
32
|
+
transitionDelay: p = tt,
|
|
33
|
+
blindCount: a = nt,
|
|
34
|
+
direction: o = it,
|
|
35
|
+
blindColor: d = st
|
|
18
36
|
} = t;
|
|
19
|
-
let
|
|
20
|
-
const
|
|
21
|
-
window.getComputedStyle(
|
|
22
|
-
const
|
|
23
|
-
|
|
37
|
+
let s, c = null;
|
|
38
|
+
const e = (i, y, h = "left") => {
|
|
39
|
+
window.getComputedStyle(i).position === "static" && (i.style.position = "relative");
|
|
40
|
+
const l = document.createElement("div");
|
|
41
|
+
l.className = "blind-container", l.style.cssText = `
|
|
24
42
|
position: absolute;
|
|
25
43
|
top: 0;
|
|
26
44
|
left: 0;
|
|
@@ -31,387 +49,613 @@ const N = { stiffness: 80, damping: 25 }, G = { stiffness: 75, damping: 25 }, q
|
|
|
31
49
|
overflow: hidden;
|
|
32
50
|
`;
|
|
33
51
|
const u = [];
|
|
34
|
-
for (let
|
|
52
|
+
for (let b = 0; b < a; b++) {
|
|
35
53
|
const f = document.createElement("div");
|
|
36
|
-
if (
|
|
37
|
-
const
|
|
54
|
+
if (o === "horizontal") {
|
|
55
|
+
const $ = 100 / a, w = `calc(${$}% + 1px)`;
|
|
38
56
|
f.style.cssText = `
|
|
39
57
|
position: absolute;
|
|
40
|
-
top: ${
|
|
58
|
+
top: ${$ * b}%;
|
|
41
59
|
left: 0;
|
|
42
60
|
width: 100%;
|
|
43
|
-
height: ${
|
|
44
|
-
background: ${
|
|
45
|
-
transform: scaleX(${
|
|
46
|
-
transform-origin: ${
|
|
61
|
+
height: ${w};
|
|
62
|
+
background: ${d};
|
|
63
|
+
transform: scaleX(${y === "hidden" ? 0 : 1});
|
|
64
|
+
transform-origin: ${h} center;
|
|
47
65
|
will-change: transform;
|
|
48
66
|
`;
|
|
49
67
|
} else {
|
|
50
|
-
const
|
|
68
|
+
const $ = 100 / a, w = `calc(${$}% + 1px)`;
|
|
51
69
|
f.style.cssText = `
|
|
52
70
|
position: absolute;
|
|
53
71
|
top: 0;
|
|
54
|
-
left: ${
|
|
55
|
-
width: ${
|
|
72
|
+
left: ${$ * b}%;
|
|
73
|
+
width: ${w};
|
|
56
74
|
height: 100%;
|
|
57
|
-
background: ${
|
|
58
|
-
transform: scaleY(${
|
|
59
|
-
transform-origin: ${
|
|
75
|
+
background: ${d};
|
|
76
|
+
transform: scaleY(${y === "hidden" ? 0 : 1});
|
|
77
|
+
transform-origin: ${h === "left" ? "top" : "bottom"} center;
|
|
60
78
|
will-change: transform;
|
|
61
79
|
`;
|
|
62
80
|
}
|
|
63
|
-
u.push(f),
|
|
81
|
+
u.push(f), l.appendChild(f);
|
|
64
82
|
}
|
|
65
|
-
return
|
|
83
|
+
return i.appendChild(l), { container: l, blinds: u };
|
|
66
84
|
};
|
|
67
85
|
return {
|
|
68
86
|
out: () => {
|
|
69
|
-
let
|
|
70
|
-
|
|
71
|
-
|
|
87
|
+
let i = null;
|
|
88
|
+
s = new Promise((g) => {
|
|
89
|
+
c = g;
|
|
72
90
|
});
|
|
73
|
-
const
|
|
74
|
-
const
|
|
91
|
+
const y = (g) => {
|
|
92
|
+
const l = 1 - g;
|
|
75
93
|
return {
|
|
76
|
-
transform:
|
|
94
|
+
transform: o === "horizontal" ? `scaleX(${l})` : `scaleY(${l})`
|
|
77
95
|
};
|
|
78
96
|
};
|
|
79
97
|
return {
|
|
80
|
-
springs: Array.from({ length: a }, (
|
|
81
|
-
spring:
|
|
98
|
+
springs: Array.from({ length: a }, (g, l) => ({
|
|
99
|
+
spring: r,
|
|
82
100
|
offset: 0.2,
|
|
83
101
|
css: {
|
|
84
102
|
// Use getter for lazy element access (evaluated after prepare)
|
|
85
103
|
get element() {
|
|
86
|
-
return
|
|
104
|
+
return i == null ? void 0 : i.blinds[l];
|
|
87
105
|
},
|
|
88
|
-
style:
|
|
106
|
+
style: y
|
|
89
107
|
}
|
|
90
108
|
})),
|
|
91
109
|
schedule: "stagger",
|
|
92
|
-
prepare: (
|
|
93
|
-
|
|
110
|
+
prepare: (g) => {
|
|
111
|
+
m(g), g.style.zIndex = "1000", i = e(g, "hidden", "left");
|
|
94
112
|
},
|
|
95
113
|
onStart: () => {
|
|
96
114
|
},
|
|
97
115
|
onEnd: () => {
|
|
98
|
-
|
|
116
|
+
c && c();
|
|
99
117
|
}
|
|
100
118
|
};
|
|
101
119
|
},
|
|
102
120
|
in: () => {
|
|
103
|
-
let
|
|
104
|
-
const
|
|
105
|
-
const
|
|
121
|
+
let i = null;
|
|
122
|
+
const y = (g) => {
|
|
123
|
+
const l = 1 - g;
|
|
106
124
|
return {
|
|
107
|
-
transform:
|
|
125
|
+
transform: o === "horizontal" ? `scaleX(${l})` : `scaleY(${l})`
|
|
108
126
|
};
|
|
109
127
|
};
|
|
110
128
|
return {
|
|
111
|
-
springs: Array.from({ length: a }, (
|
|
129
|
+
springs: Array.from({ length: a }, (g, l) => ({
|
|
112
130
|
spring: n,
|
|
113
131
|
offset: 0.2,
|
|
114
132
|
css: {
|
|
115
133
|
// Use getter for lazy element access (evaluated after prepare)
|
|
116
134
|
get element() {
|
|
117
|
-
return
|
|
135
|
+
return i == null ? void 0 : i.blinds[l];
|
|
118
136
|
},
|
|
119
|
-
style:
|
|
137
|
+
style: y
|
|
120
138
|
}
|
|
121
139
|
})),
|
|
122
140
|
schedule: "stagger",
|
|
123
|
-
prepare: (
|
|
124
|
-
|
|
141
|
+
prepare: (g) => {
|
|
142
|
+
g.style.position = "relative", g.style.zIndex = "0", i = e(g, "closed", "right");
|
|
125
143
|
},
|
|
126
144
|
onStart: () => {
|
|
127
145
|
},
|
|
128
146
|
wait: async () => {
|
|
129
|
-
|
|
147
|
+
s && await s, await W(p);
|
|
148
|
+
},
|
|
149
|
+
onEnd: () => {
|
|
150
|
+
i && i.container && i.container.remove();
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
}, et = { stiffness: 1, damping: 1 }, rt = { stiffness: 20, damping: 25 }, at = "#000000", ot = "circle", F = "CURTAIN_REVEAL_OVERLAY_ID", lt = {
|
|
156
|
+
position: "fixed",
|
|
157
|
+
inset: "0",
|
|
158
|
+
width: "100vw",
|
|
159
|
+
height: "100%",
|
|
160
|
+
zIndex: "9999",
|
|
161
|
+
display: "flex",
|
|
162
|
+
alignItems: "center",
|
|
163
|
+
justifyContent: "center",
|
|
164
|
+
overflow: "hidden"
|
|
165
|
+
}, ct = {
|
|
166
|
+
position: "relative",
|
|
167
|
+
display: "inline-block",
|
|
168
|
+
height: "5.5rem",
|
|
169
|
+
overflow: "hidden"
|
|
170
|
+
}, dt = {
|
|
171
|
+
display: "flex",
|
|
172
|
+
height: "100%",
|
|
173
|
+
willChange: "transform",
|
|
174
|
+
transition: "transform 0.3s ease"
|
|
175
|
+
}, pt = {
|
|
176
|
+
display: "inline-flex",
|
|
177
|
+
alignItems: "center",
|
|
178
|
+
justifyContent: "center",
|
|
179
|
+
whiteSpace: "nowrap",
|
|
180
|
+
fontSize: "5.5rem",
|
|
181
|
+
fontWeight: "900",
|
|
182
|
+
letterSpacing: "0.02em",
|
|
183
|
+
color: "#FFFFFF"
|
|
184
|
+
}, yt = 0.4, k = 0.5, ht = 0.2;
|
|
185
|
+
function gt(t, n) {
|
|
186
|
+
switch (t) {
|
|
187
|
+
case "circle":
|
|
188
|
+
return `circle(${n * 100}% at 50% 50%)`;
|
|
189
|
+
case "square":
|
|
190
|
+
return `inset(${(1 - n) * 50}% round ${10 * n}%)`;
|
|
191
|
+
case "triangle": {
|
|
192
|
+
const r = n * 100;
|
|
193
|
+
return `polygon(50% ${50 - r}%, ${50 - r}% ${50 + r}%, ${50 + r}% ${50 + r}%)`;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
const ut = (t) => t.reduce((n, r) => n + r, 0), Wt = (t = {}) => {
|
|
198
|
+
const {
|
|
199
|
+
background: n = at,
|
|
200
|
+
texts: r = [],
|
|
201
|
+
shape: p = ot,
|
|
202
|
+
inSpring: a = rt,
|
|
203
|
+
outSpring: o = et,
|
|
204
|
+
textStyle: d = {}
|
|
205
|
+
} = t;
|
|
206
|
+
return {
|
|
207
|
+
out: (s, c) => {
|
|
208
|
+
const e = s.style.opacity;
|
|
209
|
+
return {
|
|
210
|
+
spring: o,
|
|
211
|
+
from: 1,
|
|
212
|
+
to: 0,
|
|
213
|
+
prepare: (i) => {
|
|
214
|
+
m(i, c), i.style.opacity = "1";
|
|
215
|
+
},
|
|
216
|
+
tick: (i) => {
|
|
217
|
+
const y = Math.max(0, i - yt);
|
|
218
|
+
s.style.opacity = String(y);
|
|
219
|
+
},
|
|
220
|
+
onEnd: () => {
|
|
221
|
+
s.style.opacity = e;
|
|
222
|
+
}
|
|
223
|
+
};
|
|
224
|
+
},
|
|
225
|
+
in: (s) => {
|
|
226
|
+
let c = null, e = null, i = null;
|
|
227
|
+
const y = document.body.style.overflow, h = document.getElementById(
|
|
228
|
+
F
|
|
229
|
+
);
|
|
230
|
+
let g = [];
|
|
231
|
+
const l = () => {
|
|
232
|
+
c = document.createElement("div"), c.id = F, Object.assign(c.style, lt, { background: n }), document.body.appendChild(c), e = document.createElement("div"), Object.assign(e.style, ct), c.appendChild(e), i = document.createElement("div"), Object.assign(i.style, dt), e.appendChild(i), r.forEach((u) => {
|
|
233
|
+
const b = document.createElement("div");
|
|
234
|
+
b.textContent = u, Object.assign(b.style, pt, d), i.appendChild(b);
|
|
235
|
+
}), g = Array.from(i.children).map(
|
|
236
|
+
(u) => u.getBoundingClientRect().width
|
|
237
|
+
);
|
|
238
|
+
};
|
|
239
|
+
return {
|
|
240
|
+
spring: a,
|
|
241
|
+
from: 0,
|
|
242
|
+
to: 1,
|
|
243
|
+
prepare: () => {
|
|
244
|
+
document.body.style.overflow = "hidden", s.style.opacity = "1", h == null || h.remove(), l(), c && e && (c.style.clipPath = "none", e.style.transform = "scale(1)");
|
|
245
|
+
},
|
|
246
|
+
tick: (u) => {
|
|
247
|
+
if (!(!c || !e || !i)) {
|
|
248
|
+
if (u <= k && r.length > 0) {
|
|
249
|
+
const b = u / k, f = Math.min(
|
|
250
|
+
Math.floor(b * r.length),
|
|
251
|
+
r.length - 1
|
|
252
|
+
), $ = g[f] ?? 0, w = ut(g.slice(0, f));
|
|
253
|
+
e.style.width = `${$}px`, i.style.transform = `translateX(-${w}px)`;
|
|
254
|
+
}
|
|
255
|
+
if (u > k) {
|
|
256
|
+
const f = 1 - Math.max(
|
|
257
|
+
0,
|
|
258
|
+
Math.min(1, (u - k) / ht)
|
|
259
|
+
);
|
|
260
|
+
c.style.clipPath = gt(p, f), e.style.transform = `scale(${f})`;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
130
263
|
},
|
|
131
264
|
onEnd: () => {
|
|
132
|
-
|
|
265
|
+
c == null || c.remove(), c = e = i = null, document.body.style.overflow = y;
|
|
133
266
|
}
|
|
134
267
|
};
|
|
135
268
|
}
|
|
136
269
|
};
|
|
137
|
-
},
|
|
270
|
+
}, ft = {
|
|
271
|
+
stiffness: 300,
|
|
272
|
+
damping: 22,
|
|
273
|
+
doubleSpring: 0.5
|
|
274
|
+
}, wt = {
|
|
275
|
+
stiffness: 300,
|
|
276
|
+
damping: 22,
|
|
277
|
+
doubleSpring: 0.5
|
|
278
|
+
}, C = 0.05;
|
|
279
|
+
function P(t) {
|
|
280
|
+
const n = x(document.body, t.positionedParent), r = t.scroll.y, p = window.innerHeight - n.top;
|
|
281
|
+
return {
|
|
282
|
+
top: r,
|
|
283
|
+
left: 0,
|
|
284
|
+
width: n.width,
|
|
285
|
+
height: p
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
const Mt = (t = {}) => {
|
|
289
|
+
var d, s, c;
|
|
290
|
+
const { direction: n = "enter" } = t, r = n === "enter" ? ft : wt, p = {
|
|
291
|
+
stiffness: ((d = t.spring) == null ? void 0 : d.stiffness) ?? r.stiffness,
|
|
292
|
+
damping: ((s = t.spring) == null ? void 0 : s.damping) ?? r.damping,
|
|
293
|
+
doubleSpring: ((c = t.spring) == null ? void 0 : c.doubleSpring) ?? r.doubleSpring
|
|
294
|
+
};
|
|
295
|
+
let { promise: a, resolve: o } = S();
|
|
296
|
+
return n === "enter" ? {
|
|
297
|
+
// Entering page: scales up from small (0.8 → 1) with fade in
|
|
298
|
+
in: (e, i) => {
|
|
299
|
+
const y = P(i), h = y.left + y.width / 2, g = y.top + y.height / 2;
|
|
300
|
+
return {
|
|
301
|
+
spring: p,
|
|
302
|
+
prepare: () => {
|
|
303
|
+
e.style.opacity = "0", e.style.willChange = "transform, opacity", e.style.backfaceVisibility = "hidden", e.style.contain = "layout paint", e.style.transformOrigin = `${h}px ${g}px`;
|
|
304
|
+
},
|
|
305
|
+
wait: async () => {
|
|
306
|
+
if (a) {
|
|
307
|
+
await a;
|
|
308
|
+
const l = S();
|
|
309
|
+
a = l.promise, o = l.resolve;
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
css: (l) => ({
|
|
313
|
+
transform: `scale(${1 - C + l * C})`,
|
|
314
|
+
opacity: l
|
|
315
|
+
}),
|
|
316
|
+
onEnd: () => {
|
|
317
|
+
e.style.opacity = "1", e.style.willChange = "auto", e.style.backfaceVisibility = "", e.style.contain = "", e.style.transformOrigin = "";
|
|
318
|
+
}
|
|
319
|
+
};
|
|
320
|
+
},
|
|
321
|
+
// Exiting page: scales up (1 → 1.2) with fade out, goes to back
|
|
322
|
+
out: (e, i) => {
|
|
323
|
+
const y = P(i), h = y.left + y.width / 2, g = y.top + y.height / 2 + i.scrollOffset.y;
|
|
324
|
+
return {
|
|
325
|
+
spring: p,
|
|
326
|
+
prepare: (l) => {
|
|
327
|
+
m(l, i), l.style.zIndex = "-1", l.style.willChange = "transform, opacity", l.style.backfaceVisibility = "hidden", l.style.contain = "layout paint", l.style.pointerEvents = "none", l.style.transformOrigin = `${h}px ${g}px`;
|
|
328
|
+
},
|
|
329
|
+
css: (l) => ({
|
|
330
|
+
transform: `scale(${1 + (1 - l) * C})`,
|
|
331
|
+
opacity: l
|
|
332
|
+
}),
|
|
333
|
+
onEnd: () => {
|
|
334
|
+
o && o();
|
|
335
|
+
}
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
} : {
|
|
339
|
+
// Entering page: scales down from large (1.2 → 1) with fade in
|
|
340
|
+
in: (e, i) => {
|
|
341
|
+
const y = P(i), h = y.left + y.width / 2, g = y.top + y.height / 2;
|
|
342
|
+
return {
|
|
343
|
+
spring: p,
|
|
344
|
+
prepare: () => {
|
|
345
|
+
e.style.opacity = "0", e.style.willChange = "transform, opacity", e.style.backfaceVisibility = "hidden", e.style.contain = "layout paint", e.style.transformOrigin = `${h}px ${g}px`;
|
|
346
|
+
},
|
|
347
|
+
wait: async () => {
|
|
348
|
+
if (a) {
|
|
349
|
+
await a;
|
|
350
|
+
const l = S();
|
|
351
|
+
a = l.promise, o = l.resolve;
|
|
352
|
+
}
|
|
353
|
+
},
|
|
354
|
+
css: (l) => ({
|
|
355
|
+
transform: `scale(${1 + C - l * C})`,
|
|
356
|
+
opacity: l
|
|
357
|
+
}),
|
|
358
|
+
onEnd: () => {
|
|
359
|
+
e.style.opacity = "1", e.style.willChange = "auto", e.style.backfaceVisibility = "", e.style.contain = "", e.style.transformOrigin = "";
|
|
360
|
+
}
|
|
361
|
+
};
|
|
362
|
+
},
|
|
363
|
+
// Exiting page: scales down to small (1 → 0.8) with fade out
|
|
364
|
+
out: (e, i) => {
|
|
365
|
+
const y = P(i), h = y.left + y.width / 2, g = y.top + y.height / 2 + i.scrollOffset.y;
|
|
366
|
+
return {
|
|
367
|
+
spring: p,
|
|
368
|
+
prepare: (l) => {
|
|
369
|
+
m(l, i), l.style.zIndex = "100", l.style.willChange = "transform, opacity", l.style.backfaceVisibility = "hidden", l.style.contain = "layout paint", l.style.pointerEvents = "none", l.style.transformOrigin = `${h}px ${g}px`;
|
|
370
|
+
},
|
|
371
|
+
css: (l) => ({
|
|
372
|
+
transform: `scale(${1 - (1 - l) * C})`,
|
|
373
|
+
opacity: l
|
|
374
|
+
}),
|
|
375
|
+
onEnd: () => {
|
|
376
|
+
o && o();
|
|
377
|
+
}
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
};
|
|
381
|
+
}, bt = {
|
|
138
382
|
stiffness: 125,
|
|
139
|
-
damping:
|
|
140
|
-
doubleSpring: 0.
|
|
141
|
-
},
|
|
142
|
-
stiffness:
|
|
143
|
-
damping:
|
|
144
|
-
doubleSpring: 0.
|
|
145
|
-
},
|
|
146
|
-
var
|
|
147
|
-
const { opacity: n = !1, direction:
|
|
148
|
-
stiffness: ((
|
|
149
|
-
damping: ((
|
|
150
|
-
doubleSpring: ((
|
|
383
|
+
damping: 14,
|
|
384
|
+
doubleSpring: 0.5
|
|
385
|
+
}, $t = {
|
|
386
|
+
stiffness: 128,
|
|
387
|
+
damping: 14,
|
|
388
|
+
doubleSpring: 0.5
|
|
389
|
+
}, Gt = (t = {}) => {
|
|
390
|
+
var o, d, s;
|
|
391
|
+
const { opacity: n = !1, direction: r = "enter" } = t, p = r === "enter" ? bt : $t, a = {
|
|
392
|
+
stiffness: ((o = t.spring) == null ? void 0 : o.stiffness) ?? p.stiffness,
|
|
393
|
+
damping: ((d = t.spring) == null ? void 0 : d.damping) ?? p.damping,
|
|
394
|
+
doubleSpring: ((s = t.spring) == null ? void 0 : s.doubleSpring) ?? p.doubleSpring
|
|
151
395
|
};
|
|
152
|
-
return
|
|
153
|
-
in: (
|
|
396
|
+
return r === "enter" ? {
|
|
397
|
+
in: (c) => ({
|
|
154
398
|
spring: a,
|
|
155
399
|
prepare: () => {
|
|
156
|
-
|
|
400
|
+
c.style.willChange = n ? "transform, opacity" : "transform", c.style.backfaceVisibility = "hidden", c.style.contain = "layout paint";
|
|
157
401
|
},
|
|
158
|
-
css: (
|
|
159
|
-
const
|
|
160
|
-
transform: `translate3d(${(1 -
|
|
402
|
+
css: (e) => {
|
|
403
|
+
const i = {
|
|
404
|
+
transform: `translate3d(${(1 - e) * 100}%, 0, 0)`
|
|
161
405
|
};
|
|
162
|
-
return n && (
|
|
406
|
+
return n && (i.opacity = e), i;
|
|
163
407
|
},
|
|
164
408
|
onEnd: () => {
|
|
165
|
-
|
|
409
|
+
c.style.willChange = "auto", c.style.backfaceVisibility = "", c.style.contain = "";
|
|
166
410
|
}
|
|
167
411
|
}),
|
|
168
|
-
out: (
|
|
412
|
+
out: (c, e) => ({
|
|
169
413
|
spring: a,
|
|
170
|
-
prepare: (
|
|
171
|
-
|
|
414
|
+
prepare: (i) => {
|
|
415
|
+
m(i, e), i.style.zIndex = "-1", i.style.willChange = n ? "transform, opacity" : "transform", i.style.backfaceVisibility = "hidden", i.style.contain = "layout paint", i.style.pointerEvents = "none";
|
|
172
416
|
},
|
|
173
|
-
css: (
|
|
174
|
-
const
|
|
175
|
-
transform: `translate3d(${-(1 -
|
|
417
|
+
css: (i) => {
|
|
418
|
+
const y = {
|
|
419
|
+
transform: `translate3d(${-(1 - i) * 20}%, 0, 0)`
|
|
176
420
|
};
|
|
177
|
-
return n && (
|
|
421
|
+
return n && (y.opacity = i), y;
|
|
178
422
|
}
|
|
179
423
|
})
|
|
180
424
|
} : {
|
|
181
|
-
in: (
|
|
425
|
+
in: (c) => ({
|
|
182
426
|
spring: a,
|
|
183
427
|
prepare: () => {
|
|
184
|
-
|
|
428
|
+
c.style.willChange = n ? "transform, opacity" : "transform", c.style.backfaceVisibility = "hidden", c.style.contain = "layout paint";
|
|
185
429
|
},
|
|
186
|
-
css: (
|
|
187
|
-
const
|
|
188
|
-
transform: `translate3d(${-(1 -
|
|
430
|
+
css: (e) => {
|
|
431
|
+
const i = {
|
|
432
|
+
transform: `translate3d(${-(1 - e) * 20}%, 0, 0)`
|
|
189
433
|
};
|
|
190
|
-
return n && (
|
|
434
|
+
return n && (i.opacity = e), i;
|
|
191
435
|
},
|
|
192
436
|
onEnd: () => {
|
|
193
|
-
|
|
437
|
+
c.style.willChange = "auto", c.style.backfaceVisibility = "", c.style.contain = "";
|
|
194
438
|
}
|
|
195
439
|
}),
|
|
196
|
-
out: (
|
|
440
|
+
out: (c, e) => ({
|
|
197
441
|
spring: a,
|
|
198
|
-
prepare: (
|
|
199
|
-
|
|
442
|
+
prepare: (i) => {
|
|
443
|
+
m(i, e), i.style.zIndex = "100", i.style.willChange = n ? "transform, opacity" : "transform", i.style.backfaceVisibility = "hidden", i.style.contain = "layout paint", i.style.pointerEvents = "none";
|
|
200
444
|
},
|
|
201
|
-
css: (
|
|
202
|
-
const
|
|
203
|
-
transform: `translate3d(${(1 -
|
|
445
|
+
css: (i) => {
|
|
446
|
+
const y = {
|
|
447
|
+
transform: `translate3d(${(1 - i) * 100}%, 0, 0)`
|
|
204
448
|
};
|
|
205
|
-
return n && (
|
|
449
|
+
return n && (y.opacity = i), y;
|
|
206
450
|
}
|
|
207
451
|
})
|
|
208
452
|
};
|
|
209
|
-
},
|
|
453
|
+
}, mt = {
|
|
210
454
|
stiffness: 180,
|
|
211
455
|
damping: 20,
|
|
212
456
|
doubleSpring: !0
|
|
213
|
-
},
|
|
457
|
+
}, xt = {
|
|
214
458
|
stiffness: 170,
|
|
215
459
|
damping: 20,
|
|
216
460
|
doubleSpring: !0
|
|
217
|
-
},
|
|
461
|
+
}, Et = 0, Bt = (t = {}) => {
|
|
218
462
|
const {
|
|
219
|
-
inSpring: n =
|
|
220
|
-
outSpring:
|
|
221
|
-
transitionDelay:
|
|
463
|
+
inSpring: n = xt,
|
|
464
|
+
outSpring: r = mt,
|
|
465
|
+
transitionDelay: p = Et
|
|
222
466
|
} = t;
|
|
223
|
-
let { promise: a, resolve:
|
|
467
|
+
let { promise: a, resolve: o } = S();
|
|
224
468
|
return {
|
|
225
|
-
in: (
|
|
469
|
+
in: (d) => ({
|
|
226
470
|
spring: n,
|
|
227
471
|
prepare: () => {
|
|
228
|
-
|
|
472
|
+
d.style.opacity = "0", d.style.willChange = "opacity";
|
|
229
473
|
},
|
|
230
474
|
wait: async () => {
|
|
231
475
|
if (a) {
|
|
232
476
|
await a;
|
|
233
|
-
const
|
|
234
|
-
a =
|
|
477
|
+
const s = S();
|
|
478
|
+
a = s.promise, o = s.resolve, await W(p);
|
|
235
479
|
}
|
|
236
480
|
},
|
|
237
|
-
css: (
|
|
238
|
-
opacity:
|
|
481
|
+
css: (s) => ({
|
|
482
|
+
opacity: s
|
|
239
483
|
}),
|
|
240
484
|
onEnd: () => {
|
|
241
|
-
|
|
485
|
+
d.style.willChange = "auto", d.style.opacity = "1";
|
|
242
486
|
}
|
|
243
487
|
}),
|
|
244
|
-
out: (
|
|
245
|
-
spring:
|
|
246
|
-
css: (
|
|
247
|
-
opacity:
|
|
488
|
+
out: (d, s) => ({
|
|
489
|
+
spring: r,
|
|
490
|
+
css: (c) => ({
|
|
491
|
+
opacity: c
|
|
248
492
|
}),
|
|
249
493
|
prepare: () => {
|
|
250
|
-
|
|
494
|
+
m(d, s), d.style.willChange = "opacity";
|
|
251
495
|
},
|
|
252
496
|
onEnd: () => {
|
|
253
|
-
|
|
497
|
+
o && o(), d.style.willChange = "auto";
|
|
254
498
|
}
|
|
255
499
|
})
|
|
256
500
|
};
|
|
257
|
-
},
|
|
501
|
+
}, St = {
|
|
258
502
|
scaleDown: { stiffness: 20, damping: 7 },
|
|
259
503
|
// Soft start for cinematic scale
|
|
260
504
|
translate: { stiffness: 15, damping: 7 },
|
|
261
505
|
// Medium for movement
|
|
262
506
|
scaleUp: { stiffness: 20, damping: 7 }
|
|
263
507
|
// Crisp return to full size
|
|
264
|
-
},
|
|
508
|
+
}, A = {
|
|
265
509
|
scaleDown: 0,
|
|
266
510
|
// Start immediately
|
|
267
511
|
translate: 0.2,
|
|
268
512
|
// Start when scaleDown is 25% complete
|
|
269
513
|
scaleUp: 0.8
|
|
270
514
|
// Start when translate is 70% complete
|
|
271
|
-
},
|
|
515
|
+
}, Ct = 0.8, At = "white", qt = (t) => {
|
|
272
516
|
var a;
|
|
273
|
-
const n =
|
|
517
|
+
const n = St, r = Ct, p = ((a = t == null ? void 0 : t.border) == null ? void 0 : a.color) ?? At;
|
|
274
518
|
return {
|
|
275
|
-
out: async (
|
|
276
|
-
const
|
|
277
|
-
...
|
|
278
|
-
top:
|
|
279
|
-
}),
|
|
519
|
+
out: async (o, d) => {
|
|
520
|
+
const s = Y(d), c = x(document.body, d.positionedParent), e = Pt(p, {
|
|
521
|
+
...s,
|
|
522
|
+
top: c.top
|
|
523
|
+
}), i = {
|
|
280
524
|
scale: 1,
|
|
281
|
-
translateY: -
|
|
282
|
-
},
|
|
283
|
-
|
|
284
|
-
const
|
|
285
|
-
|
|
525
|
+
translateY: -s.top
|
|
526
|
+
}, y = () => {
|
|
527
|
+
o.style.transform = `translateY(${i.translateY}px) scale(${i.scale})`;
|
|
528
|
+
const h = (s.width - s.width * i.scale) / 2, g = (s.height - s.height * i.scale) / 2;
|
|
529
|
+
kt(e, h, g);
|
|
286
530
|
};
|
|
287
531
|
return {
|
|
288
532
|
springs: [
|
|
289
533
|
// Spring 1: Scale Down (1 → scale)
|
|
290
534
|
{
|
|
291
535
|
spring: n.scaleDown,
|
|
292
|
-
offset:
|
|
293
|
-
tick: (
|
|
294
|
-
const
|
|
295
|
-
|
|
536
|
+
offset: A.scaleDown,
|
|
537
|
+
tick: (h) => {
|
|
538
|
+
const g = 1 - h;
|
|
539
|
+
i.scale = 1 - (1 - r) * g, y();
|
|
296
540
|
}
|
|
297
541
|
},
|
|
298
542
|
// Spring 2: Translate (vertical movement)
|
|
299
543
|
{
|
|
300
544
|
spring: n.translate,
|
|
301
|
-
offset:
|
|
302
|
-
tick: (
|
|
303
|
-
const
|
|
304
|
-
|
|
545
|
+
offset: A.translate,
|
|
546
|
+
tick: (h) => {
|
|
547
|
+
const g = 1 - h;
|
|
548
|
+
i.translateY = -s.top - s.height * g, y();
|
|
305
549
|
}
|
|
306
550
|
},
|
|
307
551
|
// Spring 3: Scale Up (scale → 1)
|
|
308
552
|
{
|
|
309
553
|
spring: n.scaleUp,
|
|
310
|
-
offset:
|
|
311
|
-
tick: (
|
|
312
|
-
const
|
|
313
|
-
|
|
554
|
+
offset: A.scaleUp,
|
|
555
|
+
tick: (h) => {
|
|
556
|
+
const g = 1 - h;
|
|
557
|
+
i.scale = r + (1 - r) * g, y();
|
|
314
558
|
}
|
|
315
559
|
}
|
|
316
560
|
],
|
|
317
561
|
schedule: "stagger",
|
|
318
562
|
prepare: () => {
|
|
319
|
-
|
|
320
|
-
for (const
|
|
321
|
-
|
|
563
|
+
m(o), V(o, s), U(o, s), Tt(o, s);
|
|
564
|
+
for (const h of e)
|
|
565
|
+
d.positionedParent.appendChild(h);
|
|
322
566
|
},
|
|
323
567
|
onEnd: () => {
|
|
324
|
-
|
|
325
|
-
for (const
|
|
326
|
-
|
|
568
|
+
o.style.clipPath = "", o.style.transformOrigin = "", setTimeout(() => {
|
|
569
|
+
for (const h of e)
|
|
570
|
+
d.positionedParent.removeChild(h);
|
|
327
571
|
}, 1e3);
|
|
328
572
|
}
|
|
329
573
|
};
|
|
330
574
|
},
|
|
331
|
-
in: async (
|
|
332
|
-
const
|
|
333
|
-
scale:
|
|
334
|
-
translateY: -
|
|
335
|
-
},
|
|
336
|
-
|
|
575
|
+
in: async (o, d) => {
|
|
576
|
+
const s = Y(d), c = {
|
|
577
|
+
scale: r,
|
|
578
|
+
translateY: -s.top + s.height
|
|
579
|
+
}, e = () => {
|
|
580
|
+
o.style.transform = `translateY(${c.translateY}px) scale(${c.scale})`;
|
|
337
581
|
};
|
|
338
582
|
return {
|
|
339
583
|
springs: [
|
|
340
584
|
// Spring 1: Scale Down (1 → scale) - element starts scaled, shrinks further
|
|
341
585
|
{
|
|
342
586
|
spring: n.scaleDown,
|
|
343
|
-
offset:
|
|
344
|
-
tick: (
|
|
345
|
-
|
|
587
|
+
offset: A.scaleDown,
|
|
588
|
+
tick: (i) => {
|
|
589
|
+
c.scale = 1 - (1 - r) * i, e();
|
|
346
590
|
}
|
|
347
591
|
},
|
|
348
592
|
// Spring 2: Translate (vertical movement from bottom to top)
|
|
349
593
|
{
|
|
350
594
|
spring: n.translate,
|
|
351
|
-
offset:
|
|
352
|
-
tick: (
|
|
353
|
-
|
|
595
|
+
offset: A.translate,
|
|
596
|
+
tick: (i) => {
|
|
597
|
+
c.translateY = -s.top + s.height * (1 - i), e();
|
|
354
598
|
}
|
|
355
599
|
},
|
|
356
600
|
// Spring 3: Scale Up (scale → 1) - element returns to full size
|
|
357
601
|
{
|
|
358
602
|
spring: n.scaleUp,
|
|
359
|
-
offset:
|
|
360
|
-
tick: (
|
|
361
|
-
|
|
603
|
+
offset: A.scaleUp,
|
|
604
|
+
tick: (i) => {
|
|
605
|
+
c.scale = r + (1 - r) * i, e();
|
|
362
606
|
}
|
|
363
607
|
}
|
|
364
608
|
],
|
|
365
609
|
schedule: "stagger",
|
|
366
610
|
prepare: () => {
|
|
367
|
-
|
|
611
|
+
V(o, s), U(o, s), o.style.transform = `translateY(${-s.top + s.height}px) scale(${r})`;
|
|
368
612
|
},
|
|
369
613
|
onEnd: () => {
|
|
370
|
-
|
|
614
|
+
o.style.clipPath = "", o.style.transformOrigin = "", o.style.transform = "";
|
|
371
615
|
}
|
|
372
616
|
};
|
|
373
617
|
}
|
|
374
618
|
};
|
|
375
619
|
};
|
|
376
|
-
function
|
|
377
|
-
const
|
|
378
|
-
t.topLeft.style.transform = `translate(${
|
|
620
|
+
function kt(t, n, r) {
|
|
621
|
+
const p = n * 0.7, a = r * 0.7;
|
|
622
|
+
t.topLeft.style.transform = `translate(${p}px, ${a}px)`, t.topRight.style.transform = `translate(${-p}px, ${a}px)`, t.bottomLeft.style.transform = `translate(${p}px, ${-a}px)`, t.bottomRight.style.transform = `translate(${-p}px, ${-a}px)`;
|
|
379
623
|
}
|
|
380
|
-
function
|
|
624
|
+
function Pt(t = "white", n) {
|
|
381
625
|
const a = document.createElement("div");
|
|
382
626
|
a.style.position = "fixed", a.style.pointerEvents = "none", a.style.zIndex = "9999", a.style.top = `${n.top - 1}px`, a.style.left = `${n.left - 1}px`, a.style.width = "15px", a.style.height = "15px";
|
|
383
|
-
const s = document.createElement("div");
|
|
384
|
-
s.style.position = "absolute", s.style.width = "15px", s.style.height = "1px", s.style.backgroundColor = t, s.style.top = "0", s.style.left = "0";
|
|
385
|
-
const l = document.createElement("div");
|
|
386
|
-
l.style.position = "absolute", l.style.width = "1px", l.style.height = "15px", l.style.backgroundColor = t, l.style.top = "0", l.style.left = "0", a.appendChild(s), a.appendChild(l);
|
|
387
|
-
const r = document.createElement("div");
|
|
388
|
-
r.style.position = "fixed", r.style.pointerEvents = "none", r.style.zIndex = "9999", r.style.top = `${n.top - 1}px`, r.style.left = `${n.left + n.width - 15 + 1}px`, r.style.width = "15px", r.style.height = "15px";
|
|
389
627
|
const o = document.createElement("div");
|
|
390
|
-
o.style.position = "absolute", o.style.width = "15px", o.style.height = "1px", o.style.backgroundColor = t, o.style.top = "0", o.style.
|
|
628
|
+
o.style.position = "absolute", o.style.width = "15px", o.style.height = "1px", o.style.backgroundColor = t, o.style.top = "0", o.style.left = "0";
|
|
629
|
+
const d = document.createElement("div");
|
|
630
|
+
d.style.position = "absolute", d.style.width = "1px", d.style.height = "15px", d.style.backgroundColor = t, d.style.top = "0", d.style.left = "0", a.appendChild(o), a.appendChild(d);
|
|
631
|
+
const s = document.createElement("div");
|
|
632
|
+
s.style.position = "fixed", s.style.pointerEvents = "none", s.style.zIndex = "9999", s.style.top = `${n.top - 1}px`, s.style.left = `${n.left + n.width - 15 + 1}px`, s.style.width = "15px", s.style.height = "15px";
|
|
391
633
|
const c = document.createElement("div");
|
|
392
|
-
c.style.position = "absolute", c.style.width = "
|
|
634
|
+
c.style.position = "absolute", c.style.width = "15px", c.style.height = "1px", c.style.backgroundColor = t, c.style.top = "0", c.style.right = "0";
|
|
393
635
|
const e = document.createElement("div");
|
|
394
|
-
e.style.position = "
|
|
395
|
-
const
|
|
396
|
-
|
|
636
|
+
e.style.position = "absolute", e.style.width = "1px", e.style.height = "15px", e.style.backgroundColor = t, e.style.top = "0", e.style.right = "0", s.appendChild(c), s.appendChild(e);
|
|
637
|
+
const i = document.createElement("div");
|
|
638
|
+
i.style.position = "fixed", i.style.pointerEvents = "none", i.style.zIndex = "9999", i.style.top = `${n.top + n.height - 15 + 1}px`, i.style.left = `${n.left - 1}px`, i.style.width = "15px", i.style.height = "15px";
|
|
397
639
|
const y = document.createElement("div");
|
|
398
|
-
y.style.position = "absolute", y.style.width = "
|
|
640
|
+
y.style.position = "absolute", y.style.width = "15px", y.style.height = "1px", y.style.backgroundColor = t, y.style.bottom = "0", y.style.left = "0";
|
|
399
641
|
const h = document.createElement("div");
|
|
400
|
-
h.style.position = "
|
|
401
|
-
const
|
|
402
|
-
|
|
642
|
+
h.style.position = "absolute", h.style.width = "1px", h.style.height = "15px", h.style.backgroundColor = t, h.style.bottom = "0", h.style.left = "0", i.appendChild(y), i.appendChild(h);
|
|
643
|
+
const g = document.createElement("div");
|
|
644
|
+
g.style.position = "fixed", g.style.pointerEvents = "none", g.style.zIndex = "9999", g.style.top = `${n.top + n.height - 15 + 1}px`, g.style.left = `${n.left + n.width - 15 + 1}px`, g.style.width = "15px", g.style.height = "15px";
|
|
645
|
+
const l = document.createElement("div");
|
|
646
|
+
l.style.position = "absolute", l.style.width = "15px", l.style.height = "1px", l.style.backgroundColor = t, l.style.bottom = "0", l.style.right = "0";
|
|
403
647
|
const u = document.createElement("div");
|
|
404
|
-
return u.style.position = "absolute", u.style.width = "1px", u.style.height = "15px", u.style.backgroundColor = t, u.style.bottom = "0", u.style.right = "0",
|
|
648
|
+
return u.style.position = "absolute", u.style.width = "1px", u.style.height = "15px", u.style.backgroundColor = t, u.style.bottom = "0", u.style.right = "0", g.appendChild(l), g.appendChild(u), {
|
|
405
649
|
topLeft: a,
|
|
406
|
-
topRight:
|
|
407
|
-
bottomLeft:
|
|
408
|
-
bottomRight:
|
|
650
|
+
topRight: s,
|
|
651
|
+
bottomLeft: i,
|
|
652
|
+
bottomRight: g,
|
|
409
653
|
*[Symbol.iterator]() {
|
|
410
|
-
yield a, yield
|
|
654
|
+
yield a, yield s, yield i, yield g;
|
|
411
655
|
}
|
|
412
656
|
};
|
|
413
657
|
}
|
|
414
|
-
function
|
|
658
|
+
function Y(t) {
|
|
415
659
|
const n = x(document.body, t.positionedParent);
|
|
416
660
|
return {
|
|
417
661
|
top: t.scroll.y,
|
|
@@ -420,11 +664,11 @@ function k(t) {
|
|
|
420
664
|
height: window.innerHeight - n.top
|
|
421
665
|
};
|
|
422
666
|
}
|
|
423
|
-
function
|
|
424
|
-
const
|
|
425
|
-
t.style.transformOrigin = `${
|
|
667
|
+
function V(t, n) {
|
|
668
|
+
const r = n.left + n.width / 2, p = n.top + n.height / 2;
|
|
669
|
+
t.style.transformOrigin = `${r}px ${p}px`;
|
|
426
670
|
}
|
|
427
|
-
function
|
|
671
|
+
function U(t, n) {
|
|
428
672
|
t.style.clipPath = `polygon(
|
|
429
673
|
${n.left}px ${n.top}px,
|
|
430
674
|
${n.left + n.width}px ${n.top}px,
|
|
@@ -432,33 +676,33 @@ function I(t, n) {
|
|
|
432
676
|
${n.left}px ${n.top + n.height}px
|
|
433
677
|
)`;
|
|
434
678
|
}
|
|
435
|
-
function
|
|
679
|
+
function Tt(t, n) {
|
|
436
680
|
t.style.transform = `translateY(${-n.top}px)`;
|
|
437
681
|
}
|
|
438
|
-
function
|
|
682
|
+
function Ot(t, n) {
|
|
439
683
|
return t.querySelector(`[data-hero-key="${n}"]`);
|
|
440
684
|
}
|
|
441
|
-
const
|
|
442
|
-
var
|
|
685
|
+
const jt = (t = {}) => {
|
|
686
|
+
var d, s;
|
|
443
687
|
const n = {
|
|
444
|
-
stiffness: ((
|
|
445
|
-
damping: ((
|
|
446
|
-
},
|
|
447
|
-
let a = null,
|
|
688
|
+
stiffness: ((d = t.spring) == null ? void 0 : d.stiffness) ?? 300,
|
|
689
|
+
damping: ((s = t.spring) == null ? void 0 : s.damping) ?? 30
|
|
690
|
+
}, r = t.timeout ?? 300, p = t.maxDistance ?? 700;
|
|
691
|
+
let a = null, o = null;
|
|
448
692
|
return {
|
|
449
|
-
in: async (
|
|
450
|
-
const
|
|
451
|
-
if (
|
|
693
|
+
in: async (c, e) => {
|
|
694
|
+
const i = c, y = Array.from(i.querySelectorAll("[data-hero-key]"));
|
|
695
|
+
if (y.length === 0)
|
|
452
696
|
return {
|
|
453
697
|
spring: n,
|
|
454
698
|
tick: () => {
|
|
455
699
|
}
|
|
456
700
|
// No hero elements, skip animation
|
|
457
701
|
};
|
|
458
|
-
if (!await new Promise((
|
|
459
|
-
a ?
|
|
460
|
-
|
|
461
|
-
},
|
|
702
|
+
if (!await new Promise((l) => {
|
|
703
|
+
a ? l(!0) : (o = l, setTimeout(() => {
|
|
704
|
+
o = null, l(!1);
|
|
705
|
+
}, r));
|
|
462
706
|
}) || !a)
|
|
463
707
|
return a = null, {
|
|
464
708
|
spring: n,
|
|
@@ -466,380 +710,477 @@ const vt = (t = {}) => {
|
|
|
466
710
|
}
|
|
467
711
|
// No fromNode, skip animation
|
|
468
712
|
};
|
|
469
|
-
const
|
|
470
|
-
const u =
|
|
713
|
+
const g = y.map((l) => {
|
|
714
|
+
const u = l.getAttribute("data-hero-key");
|
|
471
715
|
if (!u) return null;
|
|
472
|
-
const
|
|
473
|
-
if (!
|
|
474
|
-
const f =
|
|
716
|
+
const b = Ot(a, u);
|
|
717
|
+
if (!b) return null;
|
|
718
|
+
const f = l, $ = x(a, b), w = x(i, f), E = $.left - w.left - e.scrollOffset.x, M = $.top - w.top - e.scrollOffset.y, G = $.width / w.width, B = $.height / w.height, q = f.style.transform, j = f.style.position, Z = f.style.transformOrigin, J = f.style.zIndex, K = f.style.willChange;
|
|
475
719
|
return {
|
|
476
720
|
toEl: f,
|
|
477
|
-
dx:
|
|
478
|
-
dy:
|
|
479
|
-
dw:
|
|
480
|
-
dh:
|
|
481
|
-
originalTransform:
|
|
482
|
-
originalPosition:
|
|
483
|
-
originalTransformOrigin:
|
|
484
|
-
originalZIndex:
|
|
485
|
-
originalWillChange:
|
|
721
|
+
dx: E,
|
|
722
|
+
dy: M,
|
|
723
|
+
dw: G,
|
|
724
|
+
dh: B,
|
|
725
|
+
originalTransform: q,
|
|
726
|
+
originalPosition: j,
|
|
727
|
+
originalTransformOrigin: Z,
|
|
728
|
+
originalZIndex: J,
|
|
729
|
+
originalWillChange: K
|
|
486
730
|
};
|
|
487
731
|
}).filter(
|
|
488
|
-
(
|
|
732
|
+
(l) => l !== null && Math.abs(l.dy) <= p
|
|
489
733
|
);
|
|
490
|
-
return a = null,
|
|
734
|
+
return a = null, g.length === 0 ? {
|
|
491
735
|
spring: n,
|
|
492
736
|
tick: () => {
|
|
493
737
|
}
|
|
494
738
|
// No matching hero elements
|
|
495
739
|
} : {
|
|
496
|
-
springs:
|
|
740
|
+
springs: g.map(({ toEl: l, dx: u, dy: b, dw: f, dh: $ }) => ({
|
|
497
741
|
spring: n,
|
|
498
|
-
tick: (
|
|
499
|
-
|
|
742
|
+
tick: (w) => {
|
|
743
|
+
l.style.transform = `translate(${(1 - w) * u}px, ${(1 - w) * b}px) scale(${w + (1 - w) * f}, ${w + (1 - w) * $})`;
|
|
500
744
|
}
|
|
501
745
|
})),
|
|
502
746
|
schedule: "parallel",
|
|
503
747
|
prepare: () => {
|
|
504
|
-
|
|
505
|
-
|
|
748
|
+
g.forEach(({ toEl: l }) => {
|
|
749
|
+
l.style.position = "relative", l.style.transformOrigin = "top left", l.style.zIndex = "1000", l.style.willChange = "transform";
|
|
506
750
|
});
|
|
507
751
|
},
|
|
508
752
|
onEnd: () => {
|
|
509
|
-
|
|
753
|
+
g.forEach(
|
|
510
754
|
({
|
|
511
|
-
toEl:
|
|
755
|
+
toEl: l,
|
|
512
756
|
originalTransform: u,
|
|
513
|
-
originalPosition:
|
|
757
|
+
originalPosition: b,
|
|
514
758
|
originalTransformOrigin: f,
|
|
515
|
-
originalZIndex:
|
|
516
|
-
originalWillChange:
|
|
759
|
+
originalZIndex: $,
|
|
760
|
+
originalWillChange: w
|
|
517
761
|
}) => {
|
|
518
|
-
|
|
762
|
+
l.style.transform = u, l.style.position = b, l.style.transformOrigin = f, l.style.zIndex = $, l.style.willChange = w;
|
|
519
763
|
}
|
|
520
764
|
);
|
|
521
765
|
}
|
|
522
766
|
};
|
|
523
767
|
},
|
|
524
|
-
out: async (
|
|
768
|
+
out: async (c) => ({
|
|
525
769
|
spring: n,
|
|
526
770
|
onStart: () => {
|
|
527
|
-
a =
|
|
771
|
+
a = c, o && (o(!0), o = null);
|
|
528
772
|
},
|
|
529
773
|
tick: () => {
|
|
530
774
|
},
|
|
531
|
-
prepare: (
|
|
532
|
-
|
|
775
|
+
prepare: (e) => {
|
|
776
|
+
m(e), e.style.opacity = "0";
|
|
533
777
|
}
|
|
534
778
|
})
|
|
535
779
|
};
|
|
780
|
+
}, L = {
|
|
781
|
+
stiffness: 140,
|
|
782
|
+
damping: 19,
|
|
783
|
+
doubleSpring: 0.8
|
|
536
784
|
};
|
|
537
|
-
function
|
|
785
|
+
function Lt({
|
|
538
786
|
detailRect: t,
|
|
539
787
|
galleryRect: n,
|
|
540
|
-
pageRect:
|
|
541
|
-
scrollOffset:
|
|
788
|
+
pageRect: r,
|
|
789
|
+
scrollOffset: p
|
|
542
790
|
}) {
|
|
543
|
-
const a = n.left - t.left + (n.width - t.width) / 2 -
|
|
791
|
+
const a = n.left - t.left + (n.width - t.width) / 2 - p.x, o = n.top - t.top + (n.height - t.height) / 2 - p.y, d = n.width / t.width, s = n.height / t.height, c = Math.max(d, s), e = t.top / r.height * 100, i = (r.width - (t.left + t.width)) / r.width * 100, y = (r.height - (t.top + t.height)) / r.height * 100, h = t.left / r.width * 100;
|
|
544
792
|
return {
|
|
545
793
|
transformOrigin: `${t.left + t.width / 2}px ${t.top + t.height / 2}px`,
|
|
546
|
-
animate: (
|
|
547
|
-
const u = 1 -
|
|
794
|
+
animate: (l) => {
|
|
795
|
+
const u = 1 - l;
|
|
548
796
|
return {
|
|
549
|
-
clipPath: `inset(${
|
|
550
|
-
transform: `translate(${a * u}px, ${
|
|
797
|
+
clipPath: `inset(${e * u}% ${i * u}% ${y * u}% ${h * u}%)`,
|
|
798
|
+
transform: `translate(${a * u}px, ${o * u}px) scale(${1 + (c - 1) * u})`
|
|
551
799
|
};
|
|
552
800
|
}
|
|
553
801
|
};
|
|
554
802
|
}
|
|
555
|
-
function
|
|
803
|
+
function vt({
|
|
556
804
|
detailRect: t,
|
|
557
805
|
galleryRect: n,
|
|
558
|
-
pageRect:
|
|
559
|
-
scrollOffset:
|
|
806
|
+
pageRect: r,
|
|
807
|
+
scrollOffset: p
|
|
560
808
|
}) {
|
|
561
|
-
const a = n.left - t.left + (n.width - t.width) / 2 +
|
|
809
|
+
const a = n.left - t.left + (n.width - t.width) / 2 + p.x, o = n.top - t.top + (n.height - t.height) / 2 + p.y, d = n.width / t.width, s = n.height / t.height, c = Math.min(d, s), e = t.top / r.height * 100, i = (r.width - (t.left + t.width)) / r.width * 100, y = (r.height - (t.top + t.height)) / r.height * 100, h = t.left / r.width * 100;
|
|
562
810
|
return {
|
|
563
811
|
transformOrigin: `${t.left + t.width / 2}px ${t.top + t.height / 2}px`,
|
|
564
|
-
animate: (
|
|
565
|
-
const u = 1 -
|
|
812
|
+
animate: (l) => {
|
|
813
|
+
const u = 1 - l;
|
|
566
814
|
return {
|
|
567
|
-
clipPath: `inset(${
|
|
568
|
-
transform: `translate(${a * u -
|
|
815
|
+
clipPath: `inset(${e * u}% ${i * u}% ${y * u}% ${h * u}%)`,
|
|
816
|
+
transform: `translate(${a * u - p.x}px, ${o * u - p.y}px) scale(${1 + (c - 1) * u})`
|
|
569
817
|
};
|
|
570
818
|
}
|
|
571
819
|
};
|
|
572
820
|
}
|
|
573
|
-
function
|
|
574
|
-
const
|
|
821
|
+
function It(t, n, r) {
|
|
822
|
+
const p = t.querySelector(
|
|
575
823
|
"[data-instagram-detail-key]"
|
|
576
824
|
), a = n.querySelector(
|
|
577
825
|
"[data-instagram-detail-key]"
|
|
578
826
|
);
|
|
579
827
|
if (t.querySelectorAll("[data-instagram-detail-key]").length > 1 || n.querySelectorAll("[data-instagram-detail-key]").length > 1)
|
|
580
828
|
return null;
|
|
581
|
-
let
|
|
582
|
-
if (!
|
|
583
|
-
|
|
584
|
-
const
|
|
585
|
-
if (!
|
|
586
|
-
|
|
587
|
-
`[data-instagram-gallery-key="${
|
|
588
|
-
),
|
|
589
|
-
} else if (
|
|
590
|
-
|
|
591
|
-
const
|
|
592
|
-
if (!
|
|
593
|
-
|
|
594
|
-
`[data-instagram-gallery-key="${
|
|
595
|
-
),
|
|
829
|
+
let o = null, d = null, s = !1;
|
|
830
|
+
if (!p && a) {
|
|
831
|
+
d = a;
|
|
832
|
+
const i = d.getAttribute("data-instagram-detail-key");
|
|
833
|
+
if (!i) return null;
|
|
834
|
+
o = t.querySelector(
|
|
835
|
+
`[data-instagram-gallery-key="${i}"]`
|
|
836
|
+
), o && (s = !0);
|
|
837
|
+
} else if (p && !a) {
|
|
838
|
+
d = p;
|
|
839
|
+
const i = d.getAttribute("data-instagram-detail-key");
|
|
840
|
+
if (!i) return null;
|
|
841
|
+
o = n.querySelector(
|
|
842
|
+
`[data-instagram-gallery-key="${i}"]`
|
|
843
|
+
), o && (s = !1);
|
|
596
844
|
}
|
|
597
|
-
if (!
|
|
845
|
+
if (!o || !d)
|
|
598
846
|
return null;
|
|
599
|
-
const
|
|
600
|
-
if (
|
|
601
|
-
const
|
|
602
|
-
detailRect:
|
|
603
|
-
galleryRect:
|
|
847
|
+
const c = x(s ? t : n, o), e = x(s ? n : t, d);
|
|
848
|
+
if (s) {
|
|
849
|
+
const i = Lt({
|
|
850
|
+
detailRect: e,
|
|
851
|
+
galleryRect: c,
|
|
604
852
|
pageRect: n.getBoundingClientRect(),
|
|
605
|
-
scrollOffset:
|
|
853
|
+
scrollOffset: r
|
|
606
854
|
});
|
|
607
|
-
return n.style.transformOrigin =
|
|
855
|
+
return n.style.transformOrigin = i.transformOrigin, {
|
|
608
856
|
isEnterMode: !0,
|
|
609
|
-
inAnimation:
|
|
857
|
+
inAnimation: i.animate
|
|
610
858
|
// No outAnimation - gallery stays visible
|
|
611
859
|
};
|
|
612
860
|
} else {
|
|
613
|
-
const
|
|
614
|
-
detailRect:
|
|
615
|
-
galleryRect:
|
|
861
|
+
const i = vt({
|
|
862
|
+
detailRect: e,
|
|
863
|
+
galleryRect: c,
|
|
616
864
|
pageRect: t.getBoundingClientRect(),
|
|
617
|
-
scrollOffset:
|
|
865
|
+
scrollOffset: r
|
|
618
866
|
});
|
|
619
|
-
return t.style.transformOrigin =
|
|
867
|
+
return t.style.transformOrigin = i.transformOrigin, {
|
|
620
868
|
isEnterMode: !1,
|
|
621
|
-
outAnimation:
|
|
869
|
+
outAnimation: i.animate
|
|
622
870
|
// No inAnimation - gallery stays visible
|
|
623
871
|
};
|
|
624
872
|
}
|
|
625
873
|
}
|
|
626
|
-
const
|
|
627
|
-
var
|
|
874
|
+
const Zt = (t = {}) => {
|
|
875
|
+
var s, c, e;
|
|
628
876
|
const n = {
|
|
629
|
-
stiffness: ((
|
|
630
|
-
damping: ((
|
|
631
|
-
doubleSpring: ((
|
|
632
|
-
},
|
|
633
|
-
let
|
|
877
|
+
stiffness: ((s = t.spring) == null ? void 0 : s.stiffness) ?? L.stiffness,
|
|
878
|
+
damping: ((c = t.spring) == null ? void 0 : c.damping) ?? L.damping,
|
|
879
|
+
doubleSpring: ((e = t.spring) == null ? void 0 : e.doubleSpring) ?? L.doubleSpring
|
|
880
|
+
}, r = t.timeout ?? 300;
|
|
881
|
+
let p = null, a = null, o = null, d = null;
|
|
634
882
|
return {
|
|
635
|
-
in: async (
|
|
636
|
-
const
|
|
637
|
-
return !await new Promise((
|
|
638
|
-
|
|
639
|
-
a = null,
|
|
640
|
-
},
|
|
641
|
-
}) || !
|
|
883
|
+
in: async (i, { scrollOffset: y }) => {
|
|
884
|
+
const h = i;
|
|
885
|
+
return !await new Promise((l) => {
|
|
886
|
+
p ? l(!0) : (a = l, setTimeout(() => {
|
|
887
|
+
a = null, l(!1);
|
|
888
|
+
}, r));
|
|
889
|
+
}) || !p ? (d == null || d(), d = null, p = null, {
|
|
642
890
|
spring: n,
|
|
643
891
|
css: () => ({})
|
|
644
|
-
}) : (
|
|
892
|
+
}) : (o = It(p, h, y), d == null || d(), d = null, o ? (p = null, {
|
|
645
893
|
spring: n,
|
|
646
|
-
css: (
|
|
647
|
-
}) : (
|
|
894
|
+
css: (l) => o != null && o.inAnimation ? o.inAnimation(l) : {}
|
|
895
|
+
}) : (p = null, {
|
|
648
896
|
spring: n,
|
|
649
897
|
css: () => ({})
|
|
650
898
|
}));
|
|
651
899
|
},
|
|
652
|
-
out: async (
|
|
653
|
-
const
|
|
654
|
-
|
|
900
|
+
out: async (i, y) => {
|
|
901
|
+
const h = new Promise((g) => {
|
|
902
|
+
d = g;
|
|
655
903
|
});
|
|
656
904
|
return {
|
|
657
905
|
spring: n,
|
|
658
|
-
prepare: (
|
|
659
|
-
|
|
906
|
+
prepare: (g) => {
|
|
907
|
+
o != null && o.isEnterMode ? m(g) : (m(g, y), g.style.zIndex = "-1");
|
|
660
908
|
},
|
|
661
909
|
wait: async () => {
|
|
662
|
-
|
|
910
|
+
p = i, a && (a(!0), a = null), await h;
|
|
663
911
|
},
|
|
664
|
-
css: (
|
|
912
|
+
css: (g) => o != null && o.outAnimation ? o.outAnimation(g) : {}
|
|
665
913
|
};
|
|
666
914
|
}
|
|
667
915
|
};
|
|
668
916
|
};
|
|
669
|
-
function
|
|
917
|
+
function _t(t) {
|
|
918
|
+
const n = x(document.body, t.positionedParent);
|
|
919
|
+
return {
|
|
920
|
+
top: t.scroll.y,
|
|
921
|
+
left: 0,
|
|
922
|
+
width: n.width,
|
|
923
|
+
height: window.innerHeight - n.top
|
|
924
|
+
};
|
|
925
|
+
}
|
|
926
|
+
const Jt = (t = {}) => {
|
|
927
|
+
var o, d;
|
|
928
|
+
const n = {
|
|
929
|
+
stiffness: ((o = t.spring) == null ? void 0 : o.stiffness) ?? 50,
|
|
930
|
+
damping: ((d = t.spring) == null ? void 0 : d.damping) ?? 30
|
|
931
|
+
}, r = t.initialRotation ?? 45, p = t.initialScale ?? 0.01, a = t.rotationTriggerPoint ?? 0.8;
|
|
932
|
+
return {
|
|
933
|
+
out: async (s, c) => {
|
|
934
|
+
const e = s.style.opacity;
|
|
935
|
+
return {
|
|
936
|
+
spring: {
|
|
937
|
+
stiffness: 80,
|
|
938
|
+
damping: 25
|
|
939
|
+
},
|
|
940
|
+
from: 1,
|
|
941
|
+
to: 0,
|
|
942
|
+
prepare: () => {
|
|
943
|
+
m(s, c), s.style.opacity = "1";
|
|
944
|
+
},
|
|
945
|
+
tick: (i) => {
|
|
946
|
+
s.style.opacity = String(i);
|
|
947
|
+
},
|
|
948
|
+
onEnd: () => {
|
|
949
|
+
s.style.opacity = e;
|
|
950
|
+
}
|
|
951
|
+
};
|
|
952
|
+
},
|
|
953
|
+
in: async (s, c) => {
|
|
954
|
+
const e = _t(c), i = s.style.transform, y = s.style.transformOrigin, h = s.style.position, g = s.style.zIndex;
|
|
955
|
+
return {
|
|
956
|
+
spring: n,
|
|
957
|
+
from: 0,
|
|
958
|
+
to: 1,
|
|
959
|
+
prepare: () => {
|
|
960
|
+
const l = Math.min(e.width, e.height) * 0.4;
|
|
961
|
+
s.style.setProperty(
|
|
962
|
+
"--max-border-radius",
|
|
963
|
+
`${l}px`
|
|
964
|
+
), s.style.setProperty("--border-radius-scale", "1"), s.style.willChange = "transform", s.style.backfaceVisibility = "hidden";
|
|
965
|
+
const u = e.left + e.width / 2, b = e.top + e.height / 2;
|
|
966
|
+
s.style.transformOrigin = `${u}px ${b}px`, s.style.position = "fixed", s.style.top = `${e.top}px`, s.style.left = `${e.left}px`, s.style.width = `${e.width}px`, s.style.height = `${e.height}px`, s.style.zIndex = "1000", s.style.overflow = "hidden", s.style.transform = `rotate(${r}deg) scale(${p}) translateZ(0)`, s.style.borderRadius = "calc(var(--max-border-radius) * var(--border-radius-scale))", s.style.opacity = "1";
|
|
967
|
+
},
|
|
968
|
+
tick: (l) => {
|
|
969
|
+
let u;
|
|
970
|
+
if (l <= 0.05)
|
|
971
|
+
u = p;
|
|
972
|
+
else if (l <= a) {
|
|
973
|
+
const w = (l - 0.05) / (a - 0.05), E = Math.pow(w, 9);
|
|
974
|
+
u = p + (0.8 - p) * E;
|
|
975
|
+
} else {
|
|
976
|
+
const w = (l - a) / (1 - a);
|
|
977
|
+
u = 0.8 + 0.2 * (1 - Math.pow(1 - w, 3));
|
|
978
|
+
}
|
|
979
|
+
let b;
|
|
980
|
+
const f = 0.7;
|
|
981
|
+
if (l <= f)
|
|
982
|
+
b = r;
|
|
983
|
+
else {
|
|
984
|
+
const w = (l - f) / (1 - f), E = 1 - Math.pow(1 - w, 2);
|
|
985
|
+
b = r * (1 - E);
|
|
986
|
+
}
|
|
987
|
+
let $;
|
|
988
|
+
if (l <= f)
|
|
989
|
+
$ = 1;
|
|
990
|
+
else {
|
|
991
|
+
const w = (l - f) / (1 - f);
|
|
992
|
+
$ = 1 - Math.pow(w, 0.5);
|
|
993
|
+
}
|
|
994
|
+
s.style.transform = `rotate(${b.toFixed(2)}deg) scale(${u.toFixed(4)}) translateZ(0)`, s.style.setProperty(
|
|
995
|
+
"--border-radius-scale",
|
|
996
|
+
$.toFixed(4)
|
|
997
|
+
);
|
|
998
|
+
},
|
|
999
|
+
onEnd: () => {
|
|
1000
|
+
s.style.willChange = "", s.style.backfaceVisibility = "", s.style.removeProperty("--max-border-radius"), s.style.removeProperty("--border-radius-scale"), s.style.transform = i, s.style.transformOrigin = y, s.style.position = h, s.style.zIndex = g, s.style.top = "", s.style.left = "", s.style.width = "", s.style.height = "", s.style.overflow = "", s.style.borderRadius = "";
|
|
1001
|
+
}
|
|
1002
|
+
};
|
|
1003
|
+
}
|
|
1004
|
+
};
|
|
1005
|
+
}, v = {
|
|
1006
|
+
stiffness: 140,
|
|
1007
|
+
damping: 19,
|
|
1008
|
+
doubleSpring: 0.7
|
|
1009
|
+
};
|
|
1010
|
+
function Dt({
|
|
670
1011
|
detailRect: t,
|
|
671
1012
|
galleryRect: n,
|
|
672
|
-
pageRect:
|
|
673
|
-
scrollOffset:
|
|
1013
|
+
pageRect: r,
|
|
1014
|
+
scrollOffset: p
|
|
674
1015
|
}) {
|
|
675
|
-
const a = n.left - t.left + (n.width - t.width) / 2 -
|
|
1016
|
+
const a = n.left - t.left + (n.width - t.width) / 2 - p.x, o = n.top - t.top + (n.height - t.height) / 2 - p.y, d = n.width / t.width, s = n.height / t.height, c = Math.max(d, s), e = t.top / r.height * 100, i = (r.width - (t.left + t.width)) / r.width * 100, y = (r.height - (t.top + t.height)) / r.height * 100, h = t.left / r.width * 100;
|
|
676
1017
|
return {
|
|
677
1018
|
transformOrigin: `${t.left + t.width / 2}px ${t.top + t.height / 2}px`,
|
|
678
|
-
animate: (
|
|
679
|
-
const u = 1 -
|
|
1019
|
+
animate: (l) => {
|
|
1020
|
+
const u = 1 - l;
|
|
680
1021
|
return {
|
|
681
|
-
clipPath: `inset(${
|
|
682
|
-
transform: `translate(${a * u}px, ${
|
|
1022
|
+
clipPath: `inset(${e * u}% ${i * u}% ${y * u}% ${h * u}%)`,
|
|
1023
|
+
transform: `translate(${a * u}px, ${o * u}px) scale(${1 + (c - 1) * u})`
|
|
683
1024
|
};
|
|
684
1025
|
}
|
|
685
1026
|
};
|
|
686
1027
|
}
|
|
687
|
-
function
|
|
1028
|
+
function Ft({
|
|
688
1029
|
galleryRect: t,
|
|
689
1030
|
detailRect: n,
|
|
690
|
-
scrollOffset:
|
|
1031
|
+
scrollOffset: r
|
|
691
1032
|
}) {
|
|
692
|
-
const
|
|
1033
|
+
const p = n.left - t.left + (n.width - t.width) / 2 + r.x, a = n.top - t.top + (n.height - t.height) / 2 + r.y, o = n.width / t.width, d = n.height / t.height, s = Math.max(o, d);
|
|
693
1034
|
return {
|
|
694
1035
|
transformOrigin: `${t.left + t.width / 2}px ${t.top + t.height / 2}px`,
|
|
695
|
-
animate: (
|
|
696
|
-
const
|
|
1036
|
+
animate: (e) => {
|
|
1037
|
+
const i = 1 - e;
|
|
697
1038
|
return {
|
|
698
|
-
transform: `translate(${
|
|
699
|
-
opacity: `${1 -
|
|
1039
|
+
transform: `translate(${p * i - r.x}px, ${a * i - r.y}px) scale(${1 + (s - 1) * i})`,
|
|
1040
|
+
opacity: `${1 - i}`
|
|
700
1041
|
};
|
|
701
1042
|
}
|
|
702
1043
|
};
|
|
703
1044
|
}
|
|
704
|
-
function
|
|
1045
|
+
function Yt({
|
|
705
1046
|
galleryRect: t,
|
|
706
1047
|
detailRect: n,
|
|
707
|
-
scrollOffset:
|
|
1048
|
+
scrollOffset: r
|
|
708
1049
|
}) {
|
|
709
|
-
const
|
|
1050
|
+
const p = n.left - t.left + (n.width - t.width) / 2 - r.x, a = n.top - t.top + (n.height - t.height) / 2 - r.y, o = n.width / t.width, d = n.height / t.height, s = Math.max(o, d);
|
|
710
1051
|
return {
|
|
711
1052
|
transformOrigin: `${t.left + t.width / 2}px ${t.top + t.height / 2}px`,
|
|
712
|
-
animate: (
|
|
713
|
-
const
|
|
1053
|
+
animate: (e) => {
|
|
1054
|
+
const i = 1 - e, y = e;
|
|
714
1055
|
return {
|
|
715
|
-
transform: `translate(${
|
|
716
|
-
opacity: `${
|
|
1056
|
+
transform: `translate(${p * i}px, ${a * i}px) scale(${1 + (s - 1) * i})`,
|
|
1057
|
+
opacity: `${y}`
|
|
717
1058
|
};
|
|
718
1059
|
}
|
|
719
1060
|
};
|
|
720
1061
|
}
|
|
721
|
-
function
|
|
1062
|
+
function Vt({
|
|
722
1063
|
detailRect: t,
|
|
723
1064
|
galleryRect: n,
|
|
724
|
-
pageRect:
|
|
725
|
-
scrollOffset:
|
|
1065
|
+
pageRect: r,
|
|
1066
|
+
scrollOffset: p
|
|
726
1067
|
}) {
|
|
727
|
-
const a = n.left - t.left + (n.width - t.width) / 2 +
|
|
1068
|
+
const a = n.left - t.left + (n.width - t.width) / 2 + p.x, o = n.top - t.top + (n.height - t.height) / 2 + p.y, d = n.width / t.width, s = n.height / t.height, c = Math.min(d, s), e = t.top / r.height * 100, i = (r.width - (t.left + t.width)) / r.width * 100, y = (r.height - (t.top + t.height)) / r.height * 100, h = t.left / r.width * 100;
|
|
728
1069
|
return {
|
|
729
1070
|
transformOrigin: `${t.left + t.width / 2}px ${t.top + t.height / 2}px`,
|
|
730
|
-
animate: (
|
|
731
|
-
const u = 1 -
|
|
1071
|
+
animate: (l) => {
|
|
1072
|
+
const u = 1 - l;
|
|
732
1073
|
return {
|
|
733
|
-
clipPath: `inset(${
|
|
734
|
-
transform: `translate(${a * u -
|
|
1074
|
+
clipPath: `inset(${e * u}% ${i * u}% ${y * u}% ${h * u}%)`,
|
|
1075
|
+
transform: `translate(${a * u - p.x}px, ${o * u - p.y}px) scale(${1 + (c - 1) * u})`
|
|
735
1076
|
};
|
|
736
1077
|
}
|
|
737
1078
|
};
|
|
738
1079
|
}
|
|
739
|
-
function
|
|
740
|
-
const
|
|
1080
|
+
function Ut(t, n, r) {
|
|
1081
|
+
const p = t.querySelector(
|
|
741
1082
|
"[data-pinterest-detail-key]"
|
|
742
1083
|
), a = n.querySelector(
|
|
743
1084
|
"[data-pinterest-detail-key]"
|
|
744
1085
|
);
|
|
745
1086
|
if (t.querySelectorAll("[data-pinterest-detail-key]").length > 1 || n.querySelectorAll("[data-pinterest-detail-key]").length > 1)
|
|
746
1087
|
return null;
|
|
747
|
-
let
|
|
748
|
-
if (!
|
|
749
|
-
|
|
750
|
-
const
|
|
751
|
-
if (!
|
|
752
|
-
|
|
753
|
-
`[data-pinterest-gallery-key="${
|
|
754
|
-
),
|
|
755
|
-
} else if (
|
|
756
|
-
|
|
757
|
-
const
|
|
758
|
-
if (!
|
|
759
|
-
|
|
760
|
-
`[data-pinterest-gallery-key="${
|
|
761
|
-
),
|
|
1088
|
+
let o = null, d = null, s = !1;
|
|
1089
|
+
if (!p && a) {
|
|
1090
|
+
d = a;
|
|
1091
|
+
const i = d.getAttribute("data-pinterest-detail-key");
|
|
1092
|
+
if (!i) return null;
|
|
1093
|
+
o = t.querySelector(
|
|
1094
|
+
`[data-pinterest-gallery-key="${i}"]`
|
|
1095
|
+
), o && (s = !0);
|
|
1096
|
+
} else if (p && !a) {
|
|
1097
|
+
d = p;
|
|
1098
|
+
const i = d.getAttribute("data-pinterest-detail-key");
|
|
1099
|
+
if (!i) return null;
|
|
1100
|
+
o = n.querySelector(
|
|
1101
|
+
`[data-pinterest-gallery-key="${i}"]`
|
|
1102
|
+
), o && (s = !1);
|
|
762
1103
|
}
|
|
763
|
-
if (!
|
|
1104
|
+
if (!o || !d)
|
|
764
1105
|
return null;
|
|
765
|
-
const
|
|
766
|
-
if (
|
|
767
|
-
const
|
|
768
|
-
detailRect:
|
|
769
|
-
galleryRect:
|
|
1106
|
+
const c = x(s ? t : n, o), e = x(s ? n : t, d);
|
|
1107
|
+
if (s) {
|
|
1108
|
+
const i = Dt({
|
|
1109
|
+
detailRect: e,
|
|
1110
|
+
galleryRect: c,
|
|
770
1111
|
pageRect: n.getBoundingClientRect(),
|
|
771
|
-
scrollOffset:
|
|
772
|
-
}),
|
|
773
|
-
galleryRect:
|
|
774
|
-
detailRect:
|
|
775
|
-
scrollOffset:
|
|
1112
|
+
scrollOffset: r
|
|
1113
|
+
}), y = Ft({
|
|
1114
|
+
galleryRect: c,
|
|
1115
|
+
detailRect: e,
|
|
1116
|
+
scrollOffset: r
|
|
776
1117
|
});
|
|
777
|
-
return n.style.transformOrigin =
|
|
778
|
-
inAnimation:
|
|
779
|
-
outAnimation:
|
|
1118
|
+
return n.style.transformOrigin = i.transformOrigin, t.style.transformOrigin = y.transformOrigin, {
|
|
1119
|
+
inAnimation: i.animate,
|
|
1120
|
+
outAnimation: y.animate
|
|
780
1121
|
};
|
|
781
1122
|
} else {
|
|
782
|
-
const
|
|
783
|
-
galleryRect:
|
|
784
|
-
detailRect:
|
|
785
|
-
scrollOffset:
|
|
786
|
-
}),
|
|
787
|
-
detailRect:
|
|
788
|
-
galleryRect:
|
|
1123
|
+
const i = Yt({
|
|
1124
|
+
galleryRect: c,
|
|
1125
|
+
detailRect: e,
|
|
1126
|
+
scrollOffset: r
|
|
1127
|
+
}), y = Vt({
|
|
1128
|
+
detailRect: e,
|
|
1129
|
+
galleryRect: c,
|
|
789
1130
|
pageRect: t.getBoundingClientRect(),
|
|
790
|
-
scrollOffset:
|
|
1131
|
+
scrollOffset: r
|
|
791
1132
|
});
|
|
792
|
-
return n.style.transformOrigin =
|
|
793
|
-
inAnimation:
|
|
794
|
-
outAnimation:
|
|
1133
|
+
return n.style.transformOrigin = i.transformOrigin, t.style.transformOrigin = y.transformOrigin, {
|
|
1134
|
+
inAnimation: i.animate,
|
|
1135
|
+
outAnimation: y.animate
|
|
795
1136
|
};
|
|
796
1137
|
}
|
|
797
1138
|
}
|
|
798
|
-
const
|
|
799
|
-
var
|
|
1139
|
+
const Kt = (t = {}) => {
|
|
1140
|
+
var s, c, e;
|
|
800
1141
|
const n = {
|
|
801
|
-
stiffness: ((
|
|
802
|
-
damping: ((
|
|
803
|
-
doubleSpring: ((
|
|
804
|
-
},
|
|
805
|
-
let
|
|
1142
|
+
stiffness: ((s = t.spring) == null ? void 0 : s.stiffness) ?? v.stiffness,
|
|
1143
|
+
damping: ((c = t.spring) == null ? void 0 : c.damping) ?? v.damping,
|
|
1144
|
+
doubleSpring: ((e = t.spring) == null ? void 0 : e.doubleSpring) ?? v.doubleSpring
|
|
1145
|
+
}, r = t.timeout ?? 300;
|
|
1146
|
+
let p = null, a = null, o = null, d = null;
|
|
806
1147
|
return {
|
|
807
|
-
in: async (
|
|
808
|
-
const
|
|
809
|
-
return !await new Promise((
|
|
810
|
-
|
|
811
|
-
a = null,
|
|
812
|
-
},
|
|
813
|
-
}) || !
|
|
1148
|
+
in: async (i, { scrollOffset: y }) => {
|
|
1149
|
+
const h = i;
|
|
1150
|
+
return !await new Promise((l) => {
|
|
1151
|
+
p ? l(!0) : (a = l, setTimeout(() => {
|
|
1152
|
+
a = null, l(!1);
|
|
1153
|
+
}, r));
|
|
1154
|
+
}) || !p ? (d == null || d(), d = null, p = null, {
|
|
814
1155
|
spring: n,
|
|
815
1156
|
css: () => ({})
|
|
816
|
-
}) : (
|
|
1157
|
+
}) : (o = Ut(p, h, y), d == null || d(), d = null, o ? (p = null, {
|
|
817
1158
|
spring: n,
|
|
818
|
-
css: (
|
|
819
|
-
}) : (
|
|
1159
|
+
css: (l) => o ? o.inAnimation(l) : {}
|
|
1160
|
+
}) : (p = null, {
|
|
820
1161
|
spring: n,
|
|
821
1162
|
css: () => ({})
|
|
822
1163
|
}));
|
|
823
1164
|
},
|
|
824
|
-
out: async (
|
|
825
|
-
const
|
|
826
|
-
|
|
1165
|
+
out: async (i) => {
|
|
1166
|
+
const y = new Promise((h) => {
|
|
1167
|
+
d = h;
|
|
827
1168
|
});
|
|
828
1169
|
return {
|
|
829
1170
|
spring: n,
|
|
830
|
-
prepare: (
|
|
831
|
-
|
|
1171
|
+
prepare: (h) => {
|
|
1172
|
+
m(h), h.style.zIndex = "-1";
|
|
832
1173
|
},
|
|
833
1174
|
wait: async () => {
|
|
834
|
-
|
|
1175
|
+
p = i, a && (a(!0), a = null), await y;
|
|
835
1176
|
},
|
|
836
|
-
css: (
|
|
1177
|
+
css: (h) => o ? o.outAnimation(h) : {}
|
|
837
1178
|
};
|
|
838
1179
|
}
|
|
839
1180
|
};
|
|
840
|
-
},
|
|
1181
|
+
}, X = { stiffness: 100, damping: 30 }, Qt = () => ({
|
|
841
1182
|
in: (t) => ({
|
|
842
|
-
spring:
|
|
1183
|
+
spring: X,
|
|
843
1184
|
prepare: () => {
|
|
844
1185
|
t.style.opacity = "0", t.style.transform = "rotate(-180deg)", t.style.transformOrigin = "center center", t.style.willChange = "transform, opacity";
|
|
845
1186
|
},
|
|
@@ -853,266 +1194,303 @@ const Yt = (t = {}) => {
|
|
|
853
1194
|
}
|
|
854
1195
|
}),
|
|
855
1196
|
out: (t, n) => ({
|
|
856
|
-
spring:
|
|
1197
|
+
spring: X,
|
|
857
1198
|
prepare: () => {
|
|
858
|
-
|
|
1199
|
+
m(t, n), t.style.transformOrigin = "center center", t.style.willChange = "transform, opacity";
|
|
859
1200
|
},
|
|
860
|
-
css: (
|
|
1201
|
+
css: (r) => ({
|
|
861
1202
|
// 0deg → 180deg, hide after 90deg (progress < 0.5)
|
|
862
|
-
transform: `rotate(${(1 -
|
|
863
|
-
opacity:
|
|
1203
|
+
transform: `rotate(${(1 - r) * 180}deg)`,
|
|
1204
|
+
opacity: r > 0.5 ? 1 : 0
|
|
864
1205
|
}),
|
|
865
1206
|
onEnd: () => {
|
|
866
1207
|
t.style.willChange = "auto";
|
|
867
1208
|
}
|
|
868
1209
|
})
|
|
869
|
-
}),
|
|
1210
|
+
}), z = {
|
|
870
1211
|
stiffness: 5,
|
|
871
1212
|
damping: 4
|
|
872
|
-
},
|
|
873
|
-
var
|
|
874
|
-
const n = t.direction ?? "up",
|
|
875
|
-
stiffness: ((
|
|
876
|
-
damping: ((
|
|
877
|
-
},
|
|
878
|
-
let a = null,
|
|
879
|
-
const
|
|
880
|
-
if (a === null ||
|
|
1213
|
+
}, Rt = (t = {}) => {
|
|
1214
|
+
var c, e;
|
|
1215
|
+
const n = t.direction ?? "up", r = {
|
|
1216
|
+
stiffness: ((c = t.spring) == null ? void 0 : c.stiffness) ?? z.stiffness,
|
|
1217
|
+
damping: ((e = t.spring) == null ? void 0 : e.damping) ?? z.damping
|
|
1218
|
+
}, p = n === "up";
|
|
1219
|
+
let a = null, o = null, d = null;
|
|
1220
|
+
const s = () => {
|
|
1221
|
+
if (a === null || o === null)
|
|
881
1222
|
return null;
|
|
882
|
-
const
|
|
883
|
-
return Math.max(
|
|
1223
|
+
const i = Math.min(a, o), y = window.innerHeight;
|
|
1224
|
+
return Math.max(i, y);
|
|
884
1225
|
};
|
|
885
1226
|
return {
|
|
886
|
-
in: (
|
|
887
|
-
spring:
|
|
1227
|
+
in: (i) => (o = i.offsetHeight, a !== null && (d = s()), {
|
|
1228
|
+
spring: r,
|
|
888
1229
|
prepare: () => {
|
|
889
|
-
|
|
1230
|
+
i.style.willChange = "transform", i.style.backfaceVisibility = "hidden", i.style.contain = "layout paint";
|
|
890
1231
|
},
|
|
891
|
-
tick: (
|
|
892
|
-
|
|
893
|
-
const
|
|
894
|
-
|
|
1232
|
+
tick: (y) => {
|
|
1233
|
+
d === null && (d = s());
|
|
1234
|
+
const h = d ?? window.innerHeight, g = p ? (1 - y) * h : (1 - y) * -h;
|
|
1235
|
+
i.style.transform = `translate3d(0, ${g}px, 0)`;
|
|
895
1236
|
},
|
|
896
1237
|
onEnd: () => {
|
|
897
|
-
|
|
1238
|
+
i.style.willChange = "auto", i.style.backfaceVisibility = "", i.style.contain = "";
|
|
898
1239
|
}
|
|
899
1240
|
}),
|
|
900
|
-
out: (
|
|
901
|
-
spring:
|
|
1241
|
+
out: (i, y) => ({
|
|
1242
|
+
spring: r,
|
|
902
1243
|
onStart: () => {
|
|
903
|
-
a =
|
|
1244
|
+
a = i.offsetHeight, o !== null && (d = s());
|
|
904
1245
|
},
|
|
905
|
-
tick: (
|
|
906
|
-
|
|
907
|
-
const
|
|
908
|
-
|
|
1246
|
+
tick: (h) => {
|
|
1247
|
+
d === null && (d = s());
|
|
1248
|
+
const g = d ?? window.innerHeight, l = p ? (1 - h) * -g : (1 - h) * g;
|
|
1249
|
+
i.style.transform = `translate3d(0, ${l}px, 0)`;
|
|
909
1250
|
},
|
|
910
|
-
prepare: (
|
|
911
|
-
|
|
1251
|
+
prepare: (h) => {
|
|
1252
|
+
m(h, y), h.style.zIndex = p ? "-1" : "1", h.style.willChange = "transform", h.style.backfaceVisibility = "hidden", h.style.contain = "layout paint", h.style.pointerEvents = "none";
|
|
912
1253
|
}
|
|
913
1254
|
})
|
|
914
1255
|
};
|
|
915
|
-
},
|
|
916
|
-
stiffness:
|
|
917
|
-
damping:
|
|
918
|
-
doubleSpring:
|
|
919
|
-
},
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
1256
|
+
}, Xt = {
|
|
1257
|
+
stiffness: 140,
|
|
1258
|
+
damping: 15,
|
|
1259
|
+
doubleSpring: 0.5
|
|
1260
|
+
}, zt = {
|
|
1261
|
+
stiffness: 145,
|
|
1262
|
+
damping: 15,
|
|
1263
|
+
doubleSpring: 0.5
|
|
1264
|
+
};
|
|
1265
|
+
function T(t) {
|
|
1266
|
+
const n = x(document.body, t.positionedParent), r = t.scroll.y, p = window.innerHeight - n.top;
|
|
926
1267
|
return {
|
|
927
|
-
|
|
928
|
-
|
|
1268
|
+
top: r,
|
|
1269
|
+
left: 0,
|
|
1270
|
+
width: n.width,
|
|
1271
|
+
height: p
|
|
1272
|
+
};
|
|
1273
|
+
}
|
|
1274
|
+
const tn = (t = {}) => {
|
|
1275
|
+
var a, o, d;
|
|
1276
|
+
const { direction: n = "enter" } = t, r = n === "enter" ? Xt : zt, p = {
|
|
1277
|
+
stiffness: ((a = t.spring) == null ? void 0 : a.stiffness) ?? r.stiffness,
|
|
1278
|
+
damping: ((o = t.spring) == null ? void 0 : o.damping) ?? r.damping,
|
|
1279
|
+
doubleSpring: ((d = t.spring) == null ? void 0 : d.doubleSpring) ?? r.doubleSpring
|
|
1280
|
+
};
|
|
1281
|
+
return n === "enter" ? {
|
|
1282
|
+
// Entering sheet: slides up from bottom
|
|
1283
|
+
in: (s, c) => {
|
|
1284
|
+
const i = T(c).height;
|
|
1285
|
+
return {
|
|
1286
|
+
spring: p,
|
|
1287
|
+
prepare: () => {
|
|
1288
|
+
s.style.willChange = "transform", s.style.backfaceVisibility = "hidden", s.style.contain = "layout paint";
|
|
1289
|
+
},
|
|
1290
|
+
css: (y) => ({
|
|
1291
|
+
transform: `translate3d(0, ${(1 - y) * i}px, 0)`
|
|
1292
|
+
}),
|
|
1293
|
+
onEnd: () => {
|
|
1294
|
+
s.style.willChange = "auto", s.style.backfaceVisibility = "", s.style.contain = "";
|
|
1295
|
+
}
|
|
1296
|
+
};
|
|
1297
|
+
},
|
|
1298
|
+
// Exiting background: scales down with fade
|
|
1299
|
+
out: (s, c) => {
|
|
1300
|
+
const e = T(c), i = e.left + e.width / 2, y = e.top + e.height / 2 + c.scrollOffset.y;
|
|
1301
|
+
return {
|
|
1302
|
+
spring: p,
|
|
1303
|
+
prepare: (h) => {
|
|
1304
|
+
m(h, c), h.style.zIndex = "-1", h.style.willChange = "transform, opacity", h.style.backfaceVisibility = "hidden", h.style.contain = "layout paint", h.style.pointerEvents = "none", h.style.transformOrigin = `${i}px ${y}px`;
|
|
1305
|
+
},
|
|
1306
|
+
css: (h) => ({
|
|
1307
|
+
transform: `scale(${0.8 + h * 0.2})`,
|
|
1308
|
+
opacity: h
|
|
1309
|
+
})
|
|
1310
|
+
};
|
|
1311
|
+
}
|
|
1312
|
+
} : {
|
|
1313
|
+
// Entering background: scales up with fade
|
|
1314
|
+
in: (s, c) => {
|
|
1315
|
+
const e = T(c), i = e.left + e.width / 2, y = e.top + e.height / 2;
|
|
1316
|
+
return {
|
|
1317
|
+
spring: p,
|
|
1318
|
+
prepare: () => {
|
|
1319
|
+
s.style.willChange = "transform, opacity", s.style.backfaceVisibility = "hidden", s.style.contain = "layout paint", s.style.transformOrigin = `${i}px ${y}px`;
|
|
1320
|
+
},
|
|
1321
|
+
css: (h) => ({
|
|
1322
|
+
transform: `scale(${0.8 + h * 0.2})`,
|
|
1323
|
+
opacity: h
|
|
1324
|
+
}),
|
|
1325
|
+
onEnd: () => {
|
|
1326
|
+
s.style.willChange = "auto", s.style.backfaceVisibility = "", s.style.contain = "", s.style.transformOrigin = "";
|
|
1327
|
+
}
|
|
1328
|
+
};
|
|
1329
|
+
},
|
|
1330
|
+
// Exiting sheet: slides down with high z-index
|
|
1331
|
+
out: (s, c) => {
|
|
1332
|
+
const i = T(c).height;
|
|
1333
|
+
return {
|
|
1334
|
+
spring: p,
|
|
1335
|
+
prepare: (y) => {
|
|
1336
|
+
m(y, c), y.style.zIndex = "100", y.style.willChange = "transform", y.style.backfaceVisibility = "hidden", y.style.contain = "layout paint", y.style.pointerEvents = "none";
|
|
1337
|
+
},
|
|
1338
|
+
css: (y) => ({
|
|
1339
|
+
transform: `translate3d(0, ${(1 - y) * i}px, 0)`
|
|
1340
|
+
})
|
|
1341
|
+
};
|
|
1342
|
+
}
|
|
1343
|
+
};
|
|
1344
|
+
}, I = {
|
|
1345
|
+
stiffness: 140,
|
|
1346
|
+
damping: 19,
|
|
1347
|
+
doubleSpring: 0.8
|
|
1348
|
+
}, nn = (t = {}) => {
|
|
1349
|
+
var a, o, d;
|
|
1350
|
+
const n = t.direction ?? "left", r = {
|
|
1351
|
+
stiffness: ((a = t.spring) == null ? void 0 : a.stiffness) ?? I.stiffness,
|
|
1352
|
+
damping: ((o = t.spring) == null ? void 0 : o.damping) ?? I.damping,
|
|
1353
|
+
doubleSpring: ((d = t.spring) == null ? void 0 : d.doubleSpring) ?? I.doubleSpring
|
|
1354
|
+
}, p = n === "left";
|
|
1355
|
+
return {
|
|
1356
|
+
in: (s) => ({
|
|
1357
|
+
spring: r,
|
|
929
1358
|
prepare: () => {
|
|
930
|
-
|
|
1359
|
+
s.style.willChange = "transform", s.style.backfaceVisibility = "hidden", s.style.contain = "layout paint";
|
|
931
1360
|
},
|
|
932
|
-
css: (
|
|
933
|
-
transform: `translate3d(${
|
|
1361
|
+
css: (c) => ({
|
|
1362
|
+
transform: `translate3d(${p ? (1 - c) * 100 : (1 - c) * -100}%, 0, 0)`
|
|
934
1363
|
}),
|
|
935
1364
|
onEnd: () => {
|
|
936
|
-
|
|
1365
|
+
s.style.willChange = "auto", s.style.backfaceVisibility = "", s.style.contain = "";
|
|
937
1366
|
}
|
|
938
1367
|
}),
|
|
939
|
-
out: (
|
|
940
|
-
spring:
|
|
941
|
-
css: (
|
|
942
|
-
transform: `translate3d(${
|
|
1368
|
+
out: (s, c) => ({
|
|
1369
|
+
spring: r,
|
|
1370
|
+
css: (e) => ({
|
|
1371
|
+
transform: `translate3d(${p ? (1 - e) * -100 : (1 - e) * 100}%, 0, 0)`
|
|
943
1372
|
}),
|
|
944
|
-
prepare: (
|
|
945
|
-
|
|
1373
|
+
prepare: (e) => {
|
|
1374
|
+
m(e, c), e.style.willChange = "transform", e.style.backfaceVisibility = "hidden", e.style.contain = "layout paint", e.style.pointerEvents = "none";
|
|
946
1375
|
}
|
|
947
1376
|
})
|
|
948
1377
|
};
|
|
949
|
-
},
|
|
1378
|
+
}, H = { stiffness: 17, damping: 6 }, _ = 20, O = 800, sn = () => {
|
|
950
1379
|
let t, n = null;
|
|
951
1380
|
return {
|
|
952
|
-
in: (
|
|
953
|
-
spring:
|
|
1381
|
+
in: (r) => ({
|
|
1382
|
+
spring: H,
|
|
954
1383
|
prepare: () => {
|
|
955
|
-
|
|
1384
|
+
r.style.willChange = "transform", r.style.backfaceVisibility = "hidden", r.style.contain = "layout paint", r.style.transform = `perspective(${O}px) rotateY(${_}deg) translate3d(-100%, 0, 0)`;
|
|
956
1385
|
},
|
|
957
1386
|
wait: async () => {
|
|
958
1387
|
t && await t;
|
|
959
1388
|
},
|
|
960
|
-
css: (
|
|
961
|
-
const a = (1 -
|
|
1389
|
+
css: (p) => {
|
|
1390
|
+
const a = (1 - p) * _, o = -(1 - p) * 100;
|
|
962
1391
|
return {
|
|
963
|
-
transform: `perspective(${
|
|
1392
|
+
transform: `perspective(${O}px) rotateY(${a}deg) translate3d(${o}%, 0, 0)`
|
|
964
1393
|
};
|
|
965
1394
|
},
|
|
966
1395
|
onEnd: () => {
|
|
967
|
-
|
|
1396
|
+
r.style.transform = "", r.style.willChange = "auto", r.style.backfaceVisibility = "", r.style.contain = "";
|
|
968
1397
|
}
|
|
969
1398
|
}),
|
|
970
|
-
out: (
|
|
1399
|
+
out: (r, p) => (t = new Promise((a) => {
|
|
971
1400
|
n = a;
|
|
972
1401
|
}), {
|
|
973
|
-
spring:
|
|
1402
|
+
spring: H,
|
|
974
1403
|
prepare: (a) => {
|
|
975
|
-
|
|
1404
|
+
m(a, p), a.style.willChange = "transform", a.style.backfaceVisibility = "hidden", a.style.contain = "layout paint", a.style.pointerEvents = "none", a.style.transform = `perspective(${O}px) rotateY(0deg) translate3d(0%, 0, 0)`;
|
|
976
1405
|
},
|
|
977
1406
|
css: (a) => {
|
|
978
|
-
const
|
|
1407
|
+
const o = 1 - a, d = o * _, s = o * 100;
|
|
979
1408
|
return {
|
|
980
|
-
transform: `perspective(${
|
|
1409
|
+
transform: `perspective(${O}px) rotateY(${-d}deg) translate3d(${s}%, 0, 0)`
|
|
981
1410
|
};
|
|
982
1411
|
},
|
|
983
1412
|
onEnd: () => {
|
|
984
|
-
n && n(),
|
|
1413
|
+
n && n(), r.style.transform = "";
|
|
985
1414
|
}
|
|
986
1415
|
})
|
|
987
1416
|
};
|
|
988
|
-
},
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
height: "5.5rem",
|
|
1002
|
-
overflow: "hidden"
|
|
1003
|
-
}, Ct = {
|
|
1004
|
-
display: "flex",
|
|
1005
|
-
height: "100%",
|
|
1006
|
-
willChange: "transform",
|
|
1007
|
-
transition: "transform 0.3s ease"
|
|
1008
|
-
}, At = {
|
|
1009
|
-
display: "inline-flex",
|
|
1010
|
-
alignItems: "center",
|
|
1011
|
-
justifyContent: "center",
|
|
1012
|
-
whiteSpace: "nowrap",
|
|
1013
|
-
fontSize: "5.5rem",
|
|
1014
|
-
fontWeight: "900",
|
|
1015
|
-
letterSpacing: "0.02em",
|
|
1016
|
-
color: "#FFFFFF"
|
|
1017
|
-
}, St = 0.4, A = 0.5, Lt = 0.2;
|
|
1018
|
-
function Tt(t, n) {
|
|
1019
|
-
switch (t) {
|
|
1020
|
-
case "circle":
|
|
1021
|
-
return `circle(${n * 100}% at 50% 50%)`;
|
|
1022
|
-
case "square":
|
|
1023
|
-
return `inset(${(1 - n) * 50}% round ${10 * n}%)`;
|
|
1024
|
-
case "triangle": {
|
|
1025
|
-
const i = n * 100;
|
|
1026
|
-
return `polygon(50% ${50 - i}%, ${50 - i}% ${50 + i}%, ${50 + i}% ${50 + i}%)`;
|
|
1027
|
-
}
|
|
1028
|
-
}
|
|
1417
|
+
}, D = {
|
|
1418
|
+
stiffness: 300,
|
|
1419
|
+
damping: 22,
|
|
1420
|
+
doubleSpring: 0.5
|
|
1421
|
+
}, N = 0.05;
|
|
1422
|
+
function Ht(t) {
|
|
1423
|
+
const n = x(document.body, t.positionedParent), r = t.scroll.y, p = window.innerHeight - n.top;
|
|
1424
|
+
return {
|
|
1425
|
+
top: r,
|
|
1426
|
+
left: 0,
|
|
1427
|
+
width: n.width,
|
|
1428
|
+
height: p
|
|
1429
|
+
};
|
|
1029
1430
|
}
|
|
1030
|
-
const
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
} = t;
|
|
1431
|
+
const en = (t = {}) => {
|
|
1432
|
+
var a, o, d;
|
|
1433
|
+
const n = {
|
|
1434
|
+
stiffness: ((a = t.spring) == null ? void 0 : a.stiffness) ?? D.stiffness,
|
|
1435
|
+
damping: ((o = t.spring) == null ? void 0 : o.damping) ?? D.damping,
|
|
1436
|
+
doubleSpring: ((d = t.spring) == null ? void 0 : d.doubleSpring) ?? D.doubleSpring
|
|
1437
|
+
};
|
|
1438
|
+
let { promise: r, resolve: p } = S();
|
|
1039
1439
|
return {
|
|
1040
|
-
|
|
1041
|
-
|
|
1440
|
+
// Entering page: scales up from small (0.95 → 1) with fade in
|
|
1441
|
+
in: (s, c) => {
|
|
1442
|
+
const e = Ht(c), i = e.left + e.width / 2, y = e.top + e.height / 2;
|
|
1042
1443
|
return {
|
|
1043
|
-
spring:
|
|
1044
|
-
from: 1,
|
|
1045
|
-
to: 0,
|
|
1046
|
-
prepare: (e) => {
|
|
1047
|
-
b(e, o), e.style.opacity = "1";
|
|
1048
|
-
},
|
|
1049
|
-
tick: (e) => {
|
|
1050
|
-
const g = Math.max(0, e - St);
|
|
1051
|
-
r.style.opacity = String(g);
|
|
1052
|
-
},
|
|
1053
|
-
onEnd: () => {
|
|
1054
|
-
r.style.opacity = c;
|
|
1055
|
-
}
|
|
1056
|
-
};
|
|
1057
|
-
},
|
|
1058
|
-
in: (r) => {
|
|
1059
|
-
let o = null, c = null, e = null;
|
|
1060
|
-
const g = document.body.style.overflow, y = document.getElementById(
|
|
1061
|
-
v
|
|
1062
|
-
);
|
|
1063
|
-
let h = [];
|
|
1064
|
-
const p = () => {
|
|
1065
|
-
o = document.createElement("div"), o.id = v, Object.assign(o.style, xt, { background: n }), document.body.appendChild(o), c = document.createElement("div"), Object.assign(c.style, Et), o.appendChild(c), e = document.createElement("div"), Object.assign(e.style, Ct), c.appendChild(e), i.forEach((u) => {
|
|
1066
|
-
const m = document.createElement("div");
|
|
1067
|
-
m.textContent = u, Object.assign(m.style, At, l), e.appendChild(m);
|
|
1068
|
-
}), h = Array.from(e.children).map(
|
|
1069
|
-
(u) => u.getBoundingClientRect().width
|
|
1070
|
-
);
|
|
1071
|
-
};
|
|
1072
|
-
return {
|
|
1073
|
-
spring: a,
|
|
1074
|
-
from: 0,
|
|
1075
|
-
to: 1,
|
|
1444
|
+
spring: n,
|
|
1076
1445
|
prepare: () => {
|
|
1077
|
-
|
|
1446
|
+
s.style.opacity = "0", s.style.willChange = "transform, opacity", s.style.backfaceVisibility = "hidden", s.style.contain = "layout paint", s.style.transformOrigin = `${i}px ${y}px`;
|
|
1078
1447
|
},
|
|
1079
|
-
|
|
1080
|
-
if (
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
i.length - 1
|
|
1085
|
-
), w = h[f] ?? 0, $ = kt(h.slice(0, f));
|
|
1086
|
-
c.style.width = `${w}px`, e.style.transform = `translateX(-${$}px)`;
|
|
1087
|
-
}
|
|
1088
|
-
if (u > A) {
|
|
1089
|
-
const f = 1 - Math.max(
|
|
1090
|
-
0,
|
|
1091
|
-
Math.min(1, (u - A) / Lt)
|
|
1092
|
-
);
|
|
1093
|
-
o.style.clipPath = Tt(d, f), c.style.transform = `scale(${f})`;
|
|
1094
|
-
}
|
|
1448
|
+
wait: async () => {
|
|
1449
|
+
if (r) {
|
|
1450
|
+
await r;
|
|
1451
|
+
const h = S();
|
|
1452
|
+
r = h.promise, p = h.resolve;
|
|
1095
1453
|
}
|
|
1096
1454
|
},
|
|
1455
|
+
css: (h) => ({
|
|
1456
|
+
transform: `scale(${1 - N + h * N})`,
|
|
1457
|
+
opacity: h
|
|
1458
|
+
}),
|
|
1097
1459
|
onEnd: () => {
|
|
1098
|
-
|
|
1460
|
+
s.style.opacity = "1", s.style.willChange = "auto", s.style.backfaceVisibility = "", s.style.contain = "", s.style.transformOrigin = "";
|
|
1099
1461
|
}
|
|
1100
1462
|
};
|
|
1101
|
-
}
|
|
1463
|
+
},
|
|
1464
|
+
// Exiting page: fade out only (no scale)
|
|
1465
|
+
out: (s, c) => ({
|
|
1466
|
+
spring: n,
|
|
1467
|
+
prepare: (e) => {
|
|
1468
|
+
m(e, c), e.style.willChange = "opacity", e.style.backfaceVisibility = "hidden", e.style.contain = "layout paint", e.style.pointerEvents = "none";
|
|
1469
|
+
},
|
|
1470
|
+
css: (e) => ({
|
|
1471
|
+
opacity: e
|
|
1472
|
+
}),
|
|
1473
|
+
onEnd: () => {
|
|
1474
|
+
p && p();
|
|
1475
|
+
}
|
|
1476
|
+
})
|
|
1102
1477
|
};
|
|
1103
1478
|
};
|
|
1104
1479
|
export {
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1480
|
+
Nt as blind,
|
|
1481
|
+
Wt as curtainReveal,
|
|
1482
|
+
Mt as depth,
|
|
1483
|
+
Gt as drill,
|
|
1484
|
+
Bt as fade,
|
|
1485
|
+
qt as film,
|
|
1486
|
+
jt as hero,
|
|
1487
|
+
Zt as instagram,
|
|
1488
|
+
Jt as jaemin,
|
|
1489
|
+
Kt as pinterest,
|
|
1490
|
+
Qt as rotate,
|
|
1491
|
+
Rt as scroll,
|
|
1492
|
+
tn as sheet,
|
|
1493
|
+
nn as slide,
|
|
1494
|
+
sn as strip,
|
|
1495
|
+
en as swap
|
|
1118
1496
|
};
|