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