@ssgoi/core 3.2.2 → 3.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/README.md +10 -9
- package/dist/index.cjs +1 -2
- package/dist/index.js +172 -202
- package/dist/transition/create-transition-callback.d.ts.map +1 -1
- package/dist/transition/transition.d.ts +1 -2
- package/dist/transition/transition.d.ts.map +1 -1
- package/dist/transitions/blur.d.ts +2 -18
- package/dist/transitions/blur.d.ts.map +1 -1
- package/dist/transitions/bounce.d.ts +2 -18
- package/dist/transitions/bounce.d.ts.map +1 -1
- package/dist/transitions/fade.d.ts +2 -18
- package/dist/transitions/fade.d.ts.map +1 -1
- package/dist/transitions/fly.d.ts +2 -18
- package/dist/transitions/fly.d.ts.map +1 -1
- package/dist/transitions/index.cjs +1 -1
- package/dist/transitions/index.js +188 -172
- package/dist/transitions/mask.d.ts +2 -18
- package/dist/transitions/mask.d.ts.map +1 -1
- package/dist/transitions/none.d.ts +2 -18
- package/dist/transitions/none.d.ts.map +1 -1
- package/dist/transitions/rotate.d.ts +2 -18
- package/dist/transitions/rotate.d.ts.map +1 -1
- package/dist/transitions/scale.d.ts +2 -18
- package/dist/transitions/scale.d.ts.map +1 -1
- package/dist/transitions/slide.d.ts +2 -18
- package/dist/transitions/slide.d.ts.map +1 -1
- package/dist/types.d.ts +1 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/with-resolvers.d.ts +7 -0
- package/dist/utils/with-resolvers.d.ts.map +1 -0
- package/dist/view-transitions/fade.d.ts.map +1 -1
- package/dist/view-transitions/index.cjs +7 -7
- package/dist/view-transitions/index.d.ts +1 -0
- package/dist/view-transitions/index.d.ts.map +1 -1
- package/dist/view-transitions/index.js +256 -217
- package/dist/view-transitions/rotate.d.ts +3 -0
- package/dist/view-transitions/rotate.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/utils/parse-caller-location.d.ts +0 -6
- package/dist/utils/parse-caller-location.d.ts.map +0 -1
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
import { p as x, g as b } from "../jaemin-BWkrXq0V.js";
|
|
2
|
-
import { a as
|
|
3
|
-
const
|
|
2
|
+
import { a as Ht } from "../jaemin-BWkrXq0V.js";
|
|
3
|
+
const F = (t) => new Promise((n) => setTimeout(n, t));
|
|
4
|
+
function T() {
|
|
5
|
+
let t, n;
|
|
6
|
+
return { promise: new Promise((d, r) => {
|
|
7
|
+
t = d, n = r;
|
|
8
|
+
}), resolve: t, reject: n };
|
|
9
|
+
}
|
|
10
|
+
const N = { stiffness: 80, damping: 25 }, G = { stiffness: 75, damping: 25 }, q = 300, j = 10, K = "horizontal", Z = "#000000", It = (t = {}) => {
|
|
4
11
|
const {
|
|
5
|
-
inSpring: n =
|
|
6
|
-
outSpring:
|
|
7
|
-
transitionDelay: d =
|
|
8
|
-
blindCount: r =
|
|
9
|
-
direction:
|
|
10
|
-
blindColor: l =
|
|
12
|
+
inSpring: n = G,
|
|
13
|
+
outSpring: s = N,
|
|
14
|
+
transitionDelay: d = q,
|
|
15
|
+
blindCount: r = j,
|
|
16
|
+
direction: a = K,
|
|
17
|
+
blindColor: l = Z
|
|
11
18
|
} = t;
|
|
12
19
|
let i, c = null;
|
|
13
20
|
const o = (e, p, y = "left") => {
|
|
@@ -26,7 +33,7 @@ const P = (t) => new Promise((n) => setTimeout(n, t)), B = { stiffness: 80, damp
|
|
|
26
33
|
const u = [];
|
|
27
34
|
for (let m = 0; m < r; m++) {
|
|
28
35
|
const f = document.createElement("div");
|
|
29
|
-
if (
|
|
36
|
+
if (a === "horizontal") {
|
|
30
37
|
const w = 100 / r, $ = `calc(${w}% + 1px)`;
|
|
31
38
|
f.style.cssText = `
|
|
32
39
|
position: absolute;
|
|
@@ -66,12 +73,12 @@ const P = (t) => new Promise((n) => setTimeout(n, t)), B = { stiffness: 80, damp
|
|
|
66
73
|
const p = (h) => {
|
|
67
74
|
const g = 1 - h;
|
|
68
75
|
return {
|
|
69
|
-
transform:
|
|
76
|
+
transform: a === "horizontal" ? `scaleX(${g})` : `scaleY(${g})`
|
|
70
77
|
};
|
|
71
78
|
};
|
|
72
79
|
return {
|
|
73
80
|
springs: Array.from({ length: r }, (h, g) => ({
|
|
74
|
-
spring:
|
|
81
|
+
spring: s,
|
|
75
82
|
offset: 0.2,
|
|
76
83
|
css: {
|
|
77
84
|
// Use getter for lazy element access (evaluated after prepare)
|
|
@@ -97,7 +104,7 @@ const P = (t) => new Promise((n) => setTimeout(n, t)), B = { stiffness: 80, damp
|
|
|
97
104
|
const p = (h) => {
|
|
98
105
|
const g = 1 - h;
|
|
99
106
|
return {
|
|
100
|
-
transform:
|
|
107
|
+
transform: a === "horizontal" ? `scaleX(${g})` : `scaleY(${g})`
|
|
101
108
|
};
|
|
102
109
|
};
|
|
103
110
|
return {
|
|
@@ -119,7 +126,7 @@ const P = (t) => new Promise((n) => setTimeout(n, t)), B = { stiffness: 80, damp
|
|
|
119
126
|
onStart: () => {
|
|
120
127
|
},
|
|
121
128
|
wait: async () => {
|
|
122
|
-
i && await i, await
|
|
129
|
+
i && await i, await F(d);
|
|
123
130
|
},
|
|
124
131
|
onEnd: () => {
|
|
125
132
|
e && e.container && e.container.remove();
|
|
@@ -127,19 +134,19 @@ const P = (t) => new Promise((n) => setTimeout(n, t)), B = { stiffness: 80, damp
|
|
|
127
134
|
};
|
|
128
135
|
}
|
|
129
136
|
};
|
|
130
|
-
},
|
|
137
|
+
}, J = {
|
|
131
138
|
stiffness: 150,
|
|
132
139
|
damping: 20
|
|
133
|
-
},
|
|
140
|
+
}, Q = {
|
|
134
141
|
stiffness: 100,
|
|
135
142
|
damping: 20
|
|
136
|
-
},
|
|
137
|
-
var
|
|
138
|
-
const { opacity: n = !1, direction:
|
|
139
|
-
stiffness: ((
|
|
143
|
+
}, Ot = (t = {}) => {
|
|
144
|
+
var a, l;
|
|
145
|
+
const { opacity: n = !1, direction: s = "enter" } = t, d = s === "enter" ? J : Q, r = {
|
|
146
|
+
stiffness: ((a = t.spring) == null ? void 0 : a.stiffness) ?? d.stiffness,
|
|
140
147
|
damping: ((l = t.spring) == null ? void 0 : l.damping) ?? d.damping
|
|
141
148
|
};
|
|
142
|
-
return
|
|
149
|
+
return s === "enter" ? {
|
|
143
150
|
in: (i) => ({
|
|
144
151
|
spring: r,
|
|
145
152
|
prepare: () => {
|
|
@@ -196,33 +203,35 @@ const P = (t) => new Promise((n) => setTimeout(n, t)), B = { stiffness: 80, damp
|
|
|
196
203
|
}
|
|
197
204
|
})
|
|
198
205
|
};
|
|
199
|
-
},
|
|
206
|
+
}, R = { stiffness: 120, damping: 15 }, tt = { stiffness: 100, damping: 20 }, nt = 0, Dt = (t = {}) => {
|
|
200
207
|
const {
|
|
201
|
-
inSpring: n =
|
|
202
|
-
outSpring:
|
|
203
|
-
transitionDelay: d =
|
|
208
|
+
inSpring: n = tt,
|
|
209
|
+
outSpring: s = R,
|
|
210
|
+
transitionDelay: d = nt
|
|
204
211
|
} = t;
|
|
205
|
-
let r,
|
|
212
|
+
let { promise: r, resolve: a } = T();
|
|
206
213
|
return {
|
|
207
214
|
in: (l) => ({
|
|
208
215
|
spring: n,
|
|
209
216
|
prepare: () => {
|
|
210
|
-
l.style.willChange = "opacity";
|
|
217
|
+
l.style.opacity = "0", l.style.willChange = "opacity";
|
|
211
218
|
},
|
|
212
219
|
wait: async () => {
|
|
213
|
-
|
|
220
|
+
if (r) {
|
|
221
|
+
await r;
|
|
222
|
+
const i = T();
|
|
223
|
+
r = i.promise, a = i.resolve, await F(d);
|
|
224
|
+
}
|
|
214
225
|
},
|
|
215
226
|
css: (i) => ({
|
|
216
227
|
opacity: i
|
|
217
228
|
}),
|
|
218
229
|
onEnd: () => {
|
|
219
|
-
l.style.willChange = "auto";
|
|
230
|
+
l.style.willChange = "auto", l.style.opacity = "1";
|
|
220
231
|
}
|
|
221
232
|
}),
|
|
222
|
-
out: (l, i) => (
|
|
223
|
-
s
|
|
224
|
-
}), {
|
|
225
|
-
spring: a,
|
|
233
|
+
out: (l, i) => ({
|
|
234
|
+
spring: s,
|
|
226
235
|
css: (c) => ({
|
|
227
236
|
opacity: c
|
|
228
237
|
}),
|
|
@@ -230,11 +239,11 @@ const P = (t) => new Promise((n) => setTimeout(n, t)), B = { stiffness: 80, damp
|
|
|
230
239
|
x(l, i), l.style.willChange = "opacity";
|
|
231
240
|
},
|
|
232
241
|
onEnd: () => {
|
|
233
|
-
|
|
242
|
+
a && a(), l.style.willChange = "auto";
|
|
234
243
|
}
|
|
235
244
|
})
|
|
236
245
|
};
|
|
237
|
-
},
|
|
246
|
+
}, et = {
|
|
238
247
|
scaleDown: { stiffness: 20, damping: 7 },
|
|
239
248
|
// Soft start for cinematic scale
|
|
240
249
|
translate: { stiffness: 15, damping: 7 },
|
|
@@ -248,21 +257,21 @@ const P = (t) => new Promise((n) => setTimeout(n, t)), B = { stiffness: 80, damp
|
|
|
248
257
|
// Start when scaleDown is 25% complete
|
|
249
258
|
scaleUp: 0.8
|
|
250
259
|
// Start when translate is 70% complete
|
|
251
|
-
},
|
|
260
|
+
}, it = 0.8, st = "white", Pt = (t) => {
|
|
252
261
|
var r;
|
|
253
|
-
const n =
|
|
262
|
+
const n = et, s = it, d = ((r = t == null ? void 0 : t.border) == null ? void 0 : r.color) ?? st;
|
|
254
263
|
return {
|
|
255
|
-
out: async (
|
|
256
|
-
const i =
|
|
264
|
+
out: async (a, l) => {
|
|
265
|
+
const i = k(l), c = b(document.body, l.positionedParent), o = rt(d, {
|
|
257
266
|
...i,
|
|
258
267
|
top: c.top
|
|
259
268
|
}), e = {
|
|
260
269
|
scale: 1,
|
|
261
270
|
translateY: -i.top
|
|
262
271
|
}, p = () => {
|
|
263
|
-
|
|
272
|
+
a.style.transform = `translateY(${e.translateY}px) scale(${e.scale})`;
|
|
264
273
|
const y = (i.width - i.width * e.scale) / 2, h = (i.height - i.height * e.scale) / 2;
|
|
265
|
-
|
|
274
|
+
at(o, y, h);
|
|
266
275
|
};
|
|
267
276
|
return {
|
|
268
277
|
springs: [
|
|
@@ -272,7 +281,7 @@ const P = (t) => new Promise((n) => setTimeout(n, t)), B = { stiffness: 80, damp
|
|
|
272
281
|
offset: E.scaleDown,
|
|
273
282
|
tick: (y) => {
|
|
274
283
|
const h = 1 - y;
|
|
275
|
-
e.scale = 1 - (1 -
|
|
284
|
+
e.scale = 1 - (1 - s) * h, p();
|
|
276
285
|
}
|
|
277
286
|
},
|
|
278
287
|
// Spring 2: Translate (vertical movement)
|
|
@@ -290,30 +299,30 @@ const P = (t) => new Promise((n) => setTimeout(n, t)), B = { stiffness: 80, damp
|
|
|
290
299
|
offset: E.scaleUp,
|
|
291
300
|
tick: (y) => {
|
|
292
301
|
const h = 1 - y;
|
|
293
|
-
e.scale =
|
|
302
|
+
e.scale = s + (1 - s) * h, p();
|
|
294
303
|
}
|
|
295
304
|
}
|
|
296
305
|
],
|
|
297
306
|
schedule: "stagger",
|
|
298
307
|
prepare: () => {
|
|
299
|
-
x(
|
|
308
|
+
x(a), S(a, i), _(a, i), lt(a, i);
|
|
300
309
|
for (const y of o)
|
|
301
310
|
l.positionedParent.appendChild(y);
|
|
302
311
|
},
|
|
303
312
|
onEnd: () => {
|
|
304
|
-
|
|
313
|
+
a.style.clipPath = "", a.style.transformOrigin = "", setTimeout(() => {
|
|
305
314
|
for (const y of o)
|
|
306
315
|
l.positionedParent.removeChild(y);
|
|
307
316
|
}, 1e3);
|
|
308
317
|
}
|
|
309
318
|
};
|
|
310
319
|
},
|
|
311
|
-
in: async (
|
|
312
|
-
const i =
|
|
313
|
-
scale:
|
|
320
|
+
in: async (a, l) => {
|
|
321
|
+
const i = k(l), c = {
|
|
322
|
+
scale: s,
|
|
314
323
|
translateY: -i.top + i.height
|
|
315
324
|
}, o = () => {
|
|
316
|
-
|
|
325
|
+
a.style.transform = `translateY(${c.translateY}px) scale(${c.scale})`;
|
|
317
326
|
};
|
|
318
327
|
return {
|
|
319
328
|
springs: [
|
|
@@ -322,7 +331,7 @@ const P = (t) => new Promise((n) => setTimeout(n, t)), B = { stiffness: 80, damp
|
|
|
322
331
|
spring: n.scaleDown,
|
|
323
332
|
offset: E.scaleDown,
|
|
324
333
|
tick: (e) => {
|
|
325
|
-
c.scale = 1 - (1 -
|
|
334
|
+
c.scale = 1 - (1 - s) * e, o();
|
|
326
335
|
}
|
|
327
336
|
},
|
|
328
337
|
// Spring 2: Translate (vertical movement from bottom to top)
|
|
@@ -338,32 +347,32 @@ const P = (t) => new Promise((n) => setTimeout(n, t)), B = { stiffness: 80, damp
|
|
|
338
347
|
spring: n.scaleUp,
|
|
339
348
|
offset: E.scaleUp,
|
|
340
349
|
tick: (e) => {
|
|
341
|
-
c.scale =
|
|
350
|
+
c.scale = s + (1 - s) * e, o();
|
|
342
351
|
}
|
|
343
352
|
}
|
|
344
353
|
],
|
|
345
354
|
schedule: "stagger",
|
|
346
355
|
prepare: () => {
|
|
347
|
-
|
|
356
|
+
S(a, i), _(a, i), a.style.transform = `translateY(${-i.top + i.height}px) scale(${s})`;
|
|
348
357
|
},
|
|
349
358
|
onEnd: () => {
|
|
350
|
-
|
|
359
|
+
a.style.clipPath = "", a.style.transformOrigin = "", a.style.transform = "";
|
|
351
360
|
}
|
|
352
361
|
};
|
|
353
362
|
}
|
|
354
363
|
};
|
|
355
364
|
};
|
|
356
|
-
function
|
|
357
|
-
const d = n * 0.7, r =
|
|
365
|
+
function at(t, n, s) {
|
|
366
|
+
const d = n * 0.7, r = s * 0.7;
|
|
358
367
|
t.topLeft.style.transform = `translate(${d}px, ${r}px)`, t.topRight.style.transform = `translate(${-d}px, ${r}px)`, t.bottomLeft.style.transform = `translate(${d}px, ${-r}px)`, t.bottomRight.style.transform = `translate(${-d}px, ${-r}px)`;
|
|
359
368
|
}
|
|
360
|
-
function
|
|
369
|
+
function rt(t = "white", n) {
|
|
361
370
|
const r = document.createElement("div");
|
|
362
371
|
r.style.position = "fixed", r.style.pointerEvents = "none", r.style.zIndex = "9999", r.style.top = `${n.top - 1}px`, r.style.left = `${n.left - 1}px`, r.style.width = "15px", r.style.height = "15px";
|
|
363
|
-
const
|
|
364
|
-
|
|
372
|
+
const a = document.createElement("div");
|
|
373
|
+
a.style.position = "absolute", a.style.width = "15px", a.style.height = "1px", a.style.backgroundColor = t, a.style.top = "0", a.style.left = "0";
|
|
365
374
|
const l = document.createElement("div");
|
|
366
|
-
l.style.position = "absolute", l.style.width = "1px", l.style.height = "15px", l.style.backgroundColor = t, l.style.top = "0", l.style.left = "0", r.appendChild(
|
|
375
|
+
l.style.position = "absolute", l.style.width = "1px", l.style.height = "15px", l.style.backgroundColor = t, l.style.top = "0", l.style.left = "0", r.appendChild(a), r.appendChild(l);
|
|
367
376
|
const i = document.createElement("div");
|
|
368
377
|
i.style.position = "fixed", i.style.pointerEvents = "none", i.style.zIndex = "9999", i.style.top = `${n.top - 1}px`, i.style.left = `${n.left + n.width - 15 + 1}px`, i.style.width = "15px", i.style.height = "15px";
|
|
369
378
|
const c = document.createElement("div");
|
|
@@ -391,7 +400,7 @@ function st(t = "white", n) {
|
|
|
391
400
|
}
|
|
392
401
|
};
|
|
393
402
|
}
|
|
394
|
-
function
|
|
403
|
+
function k(t) {
|
|
395
404
|
const n = b(document.body, t.positionedParent);
|
|
396
405
|
return {
|
|
397
406
|
top: t.scroll.y,
|
|
@@ -400,11 +409,11 @@ function T(t) {
|
|
|
400
409
|
height: window.innerHeight - n.top
|
|
401
410
|
};
|
|
402
411
|
}
|
|
403
|
-
function k(t, n) {
|
|
404
|
-
const a = n.left + n.width / 2, d = n.top + n.height / 2;
|
|
405
|
-
t.style.transformOrigin = `${a}px ${d}px`;
|
|
406
|
-
}
|
|
407
412
|
function S(t, n) {
|
|
413
|
+
const s = n.left + n.width / 2, d = n.top + n.height / 2;
|
|
414
|
+
t.style.transformOrigin = `${s}px ${d}px`;
|
|
415
|
+
}
|
|
416
|
+
function _(t, n) {
|
|
408
417
|
t.style.clipPath = `polygon(
|
|
409
418
|
${n.left}px ${n.top}px,
|
|
410
419
|
${n.left + n.width}px ${n.top}px,
|
|
@@ -412,19 +421,19 @@ function S(t, n) {
|
|
|
412
421
|
${n.left}px ${n.top + n.height}px
|
|
413
422
|
)`;
|
|
414
423
|
}
|
|
415
|
-
function
|
|
424
|
+
function lt(t, n) {
|
|
416
425
|
t.style.transform = `translateY(${-n.top}px)`;
|
|
417
426
|
}
|
|
418
|
-
function
|
|
427
|
+
function ot(t, n) {
|
|
419
428
|
return t.querySelector(`[data-hero-key="${n}"]`);
|
|
420
429
|
}
|
|
421
|
-
const
|
|
430
|
+
const vt = (t = {}) => {
|
|
422
431
|
var l, i;
|
|
423
432
|
const n = {
|
|
424
433
|
stiffness: ((l = t.spring) == null ? void 0 : l.stiffness) ?? 300,
|
|
425
434
|
damping: ((i = t.spring) == null ? void 0 : i.damping) ?? 30
|
|
426
|
-
},
|
|
427
|
-
let r = null,
|
|
435
|
+
}, s = t.timeout ?? 300, d = t.maxDistance ?? 700;
|
|
436
|
+
let r = null, a = null;
|
|
428
437
|
return {
|
|
429
438
|
in: async (c, o) => {
|
|
430
439
|
const e = c, p = Array.from(e.querySelectorAll("[data-hero-key]"));
|
|
@@ -436,9 +445,9 @@ const Dt = (t = {}) => {
|
|
|
436
445
|
// No hero elements, skip animation
|
|
437
446
|
};
|
|
438
447
|
if (!await new Promise((g) => {
|
|
439
|
-
r ? g(!0) : (
|
|
440
|
-
|
|
441
|
-
},
|
|
448
|
+
r ? g(!0) : (a = g, setTimeout(() => {
|
|
449
|
+
a = null, g(!1);
|
|
450
|
+
}, s));
|
|
442
451
|
}) || !r)
|
|
443
452
|
return r = null, {
|
|
444
453
|
spring: n,
|
|
@@ -449,20 +458,20 @@ const Dt = (t = {}) => {
|
|
|
449
458
|
const h = p.map((g) => {
|
|
450
459
|
const u = g.getAttribute("data-hero-key");
|
|
451
460
|
if (!u) return null;
|
|
452
|
-
const m =
|
|
461
|
+
const m = ot(r, u);
|
|
453
462
|
if (!m) return null;
|
|
454
|
-
const f = g, w = b(r, m), $ = b(e, f),
|
|
463
|
+
const f = g, w = b(r, m), $ = b(e, f), Y = w.left - $.left - o.scrollOffset.x, U = w.top - $.top - o.scrollOffset.y, V = w.width / $.width, W = w.height / $.height, z = f.style.transform, X = f.style.position, M = f.style.transformOrigin, B = f.style.zIndex, H = f.style.willChange;
|
|
455
464
|
return {
|
|
456
465
|
toEl: f,
|
|
457
|
-
dx:
|
|
458
|
-
dy:
|
|
459
|
-
dw:
|
|
460
|
-
dh:
|
|
461
|
-
originalTransform:
|
|
462
|
-
originalPosition:
|
|
463
|
-
originalTransformOrigin:
|
|
464
|
-
originalZIndex:
|
|
465
|
-
originalWillChange:
|
|
466
|
+
dx: Y,
|
|
467
|
+
dy: U,
|
|
468
|
+
dw: V,
|
|
469
|
+
dh: W,
|
|
470
|
+
originalTransform: z,
|
|
471
|
+
originalPosition: X,
|
|
472
|
+
originalTransformOrigin: M,
|
|
473
|
+
originalZIndex: B,
|
|
474
|
+
originalWillChange: H
|
|
466
475
|
};
|
|
467
476
|
}).filter(
|
|
468
477
|
(g) => g !== null && Math.abs(g.dy) <= d
|
|
@@ -504,7 +513,7 @@ const Dt = (t = {}) => {
|
|
|
504
513
|
out: async (c) => ({
|
|
505
514
|
spring: n,
|
|
506
515
|
onStart: () => {
|
|
507
|
-
r = c,
|
|
516
|
+
r = c, a && (a(!0), a = null);
|
|
508
517
|
},
|
|
509
518
|
tick: () => {
|
|
510
519
|
},
|
|
@@ -514,43 +523,43 @@ const Dt = (t = {}) => {
|
|
|
514
523
|
})
|
|
515
524
|
};
|
|
516
525
|
};
|
|
517
|
-
function
|
|
526
|
+
function ct({
|
|
518
527
|
detailRect: t,
|
|
519
528
|
galleryRect: n,
|
|
520
|
-
pageRect:
|
|
529
|
+
pageRect: s,
|
|
521
530
|
scrollOffset: d
|
|
522
531
|
}) {
|
|
523
|
-
const r = n.left - t.left + (n.width - t.width) / 2 - d.x,
|
|
532
|
+
const r = n.left - t.left + (n.width - t.width) / 2 - d.x, a = n.top - t.top + (n.height - t.height) / 2 - d.y, l = n.width / t.width, i = n.height / t.height, c = Math.max(l, i), o = t.top / s.height * 100, e = (s.width - (t.left + t.width)) / s.width * 100, p = (s.height - (t.top + t.height)) / s.height * 100, y = t.left / s.width * 100;
|
|
524
533
|
return {
|
|
525
534
|
transformOrigin: `${t.left + t.width / 2}px ${t.top + t.height / 2}px`,
|
|
526
535
|
animate: (g) => {
|
|
527
536
|
const u = 1 - g;
|
|
528
537
|
return {
|
|
529
538
|
clipPath: `inset(${o * u}% ${e * u}% ${p * u}% ${y * u}%)`,
|
|
530
|
-
transform: `translate(${r * u}px, ${
|
|
539
|
+
transform: `translate(${r * u}px, ${a * u}px) scale(${1 + (c - 1) * u})`
|
|
531
540
|
};
|
|
532
541
|
}
|
|
533
542
|
};
|
|
534
543
|
}
|
|
535
|
-
function
|
|
544
|
+
function dt({
|
|
536
545
|
detailRect: t,
|
|
537
546
|
galleryRect: n,
|
|
538
|
-
pageRect:
|
|
547
|
+
pageRect: s,
|
|
539
548
|
scrollOffset: d
|
|
540
549
|
}) {
|
|
541
|
-
const r = n.left - t.left + (n.width - t.width) / 2 + d.x,
|
|
550
|
+
const r = n.left - t.left + (n.width - t.width) / 2 + d.x, a = n.top - t.top + (n.height - t.height) / 2 + d.y, l = n.width / t.width, i = n.height / t.height, c = Math.min(l, i), o = t.top / s.height * 100, e = (s.width - (t.left + t.width)) / s.width * 100, p = (s.height - (t.top + t.height)) / s.height * 100, y = t.left / s.width * 100;
|
|
542
551
|
return {
|
|
543
552
|
transformOrigin: `${t.left + t.width / 2}px ${t.top + t.height / 2}px`,
|
|
544
553
|
animate: (g) => {
|
|
545
554
|
const u = 1 - g;
|
|
546
555
|
return {
|
|
547
556
|
clipPath: `inset(${o * u}% ${e * u}% ${p * u}% ${y * u}%)`,
|
|
548
|
-
transform: `translate(${r * u - d.x}px, ${
|
|
557
|
+
transform: `translate(${r * u - d.x}px, ${a * u - d.y}px) scale(${1 + (c - 1) * u})`
|
|
549
558
|
};
|
|
550
559
|
}
|
|
551
560
|
};
|
|
552
561
|
}
|
|
553
|
-
function
|
|
562
|
+
function ht(t, n, s) {
|
|
554
563
|
const d = t.querySelector(
|
|
555
564
|
"[data-instagram-detail-key]"
|
|
556
565
|
), r = n.querySelector(
|
|
@@ -558,31 +567,31 @@ function ct(t, n, a) {
|
|
|
558
567
|
);
|
|
559
568
|
if (t.querySelectorAll("[data-instagram-detail-key]").length > 1 || n.querySelectorAll("[data-instagram-detail-key]").length > 1)
|
|
560
569
|
return null;
|
|
561
|
-
let
|
|
570
|
+
let a = null, l = null, i = !1;
|
|
562
571
|
if (!d && r) {
|
|
563
572
|
l = r;
|
|
564
573
|
const e = l.getAttribute("data-instagram-detail-key");
|
|
565
574
|
if (!e) return null;
|
|
566
|
-
|
|
575
|
+
a = t.querySelector(
|
|
567
576
|
`[data-instagram-gallery-key="${e}"]`
|
|
568
|
-
),
|
|
577
|
+
), a && (i = !0);
|
|
569
578
|
} else if (d && !r) {
|
|
570
579
|
l = d;
|
|
571
580
|
const e = l.getAttribute("data-instagram-detail-key");
|
|
572
581
|
if (!e) return null;
|
|
573
|
-
|
|
582
|
+
a = n.querySelector(
|
|
574
583
|
`[data-instagram-gallery-key="${e}"]`
|
|
575
|
-
),
|
|
584
|
+
), a && (i = !1);
|
|
576
585
|
}
|
|
577
|
-
if (!
|
|
586
|
+
if (!a || !l)
|
|
578
587
|
return null;
|
|
579
|
-
const c = b(i ? t : n,
|
|
588
|
+
const c = b(i ? t : n, a), o = b(i ? n : t, l);
|
|
580
589
|
if (i) {
|
|
581
|
-
const e =
|
|
590
|
+
const e = ct({
|
|
582
591
|
detailRect: o,
|
|
583
592
|
galleryRect: c,
|
|
584
593
|
pageRect: n.getBoundingClientRect(),
|
|
585
|
-
scrollOffset:
|
|
594
|
+
scrollOffset: s
|
|
586
595
|
});
|
|
587
596
|
return n.style.transformOrigin = e.transformOrigin, {
|
|
588
597
|
isEnterMode: !0,
|
|
@@ -590,11 +599,11 @@ function ct(t, n, a) {
|
|
|
590
599
|
// No outAnimation - gallery stays visible
|
|
591
600
|
};
|
|
592
601
|
} else {
|
|
593
|
-
const e =
|
|
602
|
+
const e = dt({
|
|
594
603
|
detailRect: o,
|
|
595
604
|
galleryRect: c,
|
|
596
605
|
pageRect: t.getBoundingClientRect(),
|
|
597
|
-
scrollOffset:
|
|
606
|
+
scrollOffset: s
|
|
598
607
|
});
|
|
599
608
|
return t.style.transformOrigin = e.transformOrigin, {
|
|
600
609
|
isEnterMode: !1,
|
|
@@ -603,26 +612,26 @@ function ct(t, n, a) {
|
|
|
603
612
|
};
|
|
604
613
|
}
|
|
605
614
|
}
|
|
606
|
-
const
|
|
615
|
+
const Ft = (t = {}) => {
|
|
607
616
|
var i, c;
|
|
608
617
|
const n = {
|
|
609
618
|
stiffness: ((i = t.spring) == null ? void 0 : i.stiffness) ?? 150,
|
|
610
619
|
damping: ((c = t.spring) == null ? void 0 : c.damping) ?? 20
|
|
611
|
-
},
|
|
612
|
-
let d = null, r = null,
|
|
620
|
+
}, s = t.timeout ?? 300;
|
|
621
|
+
let d = null, r = null, a = null, l = null;
|
|
613
622
|
return {
|
|
614
623
|
in: async (o, { scrollOffset: e }) => {
|
|
615
624
|
const p = o;
|
|
616
625
|
return !await new Promise((h) => {
|
|
617
626
|
d ? h(!0) : (r = h, setTimeout(() => {
|
|
618
627
|
r = null, h(!1);
|
|
619
|
-
},
|
|
628
|
+
}, s));
|
|
620
629
|
}) || !d ? (l == null || l(), l = null, d = null, {
|
|
621
630
|
spring: n,
|
|
622
631
|
css: () => ({})
|
|
623
|
-
}) : (
|
|
632
|
+
}) : (a = ht(d, p, e), l == null || l(), l = null, a ? (d = null, {
|
|
624
633
|
spring: n,
|
|
625
|
-
css: (h) =>
|
|
634
|
+
css: (h) => a != null && a.inAnimation ? a.inAnimation(h) : {}
|
|
626
635
|
}) : (d = null, {
|
|
627
636
|
spring: n,
|
|
628
637
|
css: () => ({})
|
|
@@ -635,57 +644,57 @@ const Pt = (t = {}) => {
|
|
|
635
644
|
return {
|
|
636
645
|
spring: n,
|
|
637
646
|
prepare: (y) => {
|
|
638
|
-
|
|
647
|
+
a != null && a.isEnterMode ? x(y) : (x(y, e), y.style.zIndex = "-1");
|
|
639
648
|
},
|
|
640
649
|
wait: async () => {
|
|
641
650
|
d = o, r && (r(!0), r = null), await p;
|
|
642
651
|
},
|
|
643
|
-
css: (y) =>
|
|
652
|
+
css: (y) => a != null && a.outAnimation ? a.outAnimation(y) : {}
|
|
644
653
|
};
|
|
645
654
|
}
|
|
646
655
|
};
|
|
647
656
|
};
|
|
648
|
-
function
|
|
657
|
+
function pt({
|
|
649
658
|
detailRect: t,
|
|
650
659
|
galleryRect: n,
|
|
651
|
-
pageRect:
|
|
660
|
+
pageRect: s,
|
|
652
661
|
scrollOffset: d
|
|
653
662
|
}) {
|
|
654
|
-
const r = n.left - t.left + (n.width - t.width) / 2 - d.x,
|
|
663
|
+
const r = n.left - t.left + (n.width - t.width) / 2 - d.x, a = n.top - t.top + (n.height - t.height) / 2 - d.y, l = n.width / t.width, i = n.height / t.height, c = Math.max(l, i), o = t.top / s.height * 100, e = (s.width - (t.left + t.width)) / s.width * 100, p = (s.height - (t.top + t.height)) / s.height * 100, y = t.left / s.width * 100;
|
|
655
664
|
return {
|
|
656
665
|
transformOrigin: `${t.left + t.width / 2}px ${t.top + t.height / 2}px`,
|
|
657
666
|
animate: (g) => {
|
|
658
667
|
const u = 1 - g;
|
|
659
668
|
return {
|
|
660
669
|
clipPath: `inset(${o * u}% ${e * u}% ${p * u}% ${y * u}%)`,
|
|
661
|
-
transform: `translate(${r * u}px, ${
|
|
670
|
+
transform: `translate(${r * u}px, ${a * u}px) scale(${1 + (c - 1) * u})`
|
|
662
671
|
};
|
|
663
672
|
}
|
|
664
673
|
};
|
|
665
674
|
}
|
|
666
|
-
function
|
|
675
|
+
function yt({
|
|
667
676
|
galleryRect: t,
|
|
668
677
|
detailRect: n,
|
|
669
|
-
scrollOffset:
|
|
678
|
+
scrollOffset: s
|
|
670
679
|
}) {
|
|
671
|
-
const d = n.left - t.left + (n.width - t.width) / 2 +
|
|
680
|
+
const d = n.left - t.left + (n.width - t.width) / 2 + s.x, r = n.top - t.top + (n.height - t.height) / 2 + s.y, a = n.width / t.width, l = n.height / t.height, i = Math.max(a, l);
|
|
672
681
|
return {
|
|
673
682
|
transformOrigin: `${t.left + t.width / 2}px ${t.top + t.height / 2}px`,
|
|
674
683
|
animate: (o) => {
|
|
675
684
|
const e = 1 - o;
|
|
676
685
|
return {
|
|
677
|
-
transform: `translate(${d * e -
|
|
686
|
+
transform: `translate(${d * e - s.x}px, ${r * e - s.y}px) scale(${1 + (i - 1) * e})`,
|
|
678
687
|
opacity: `${1 - e}`
|
|
679
688
|
};
|
|
680
689
|
}
|
|
681
690
|
};
|
|
682
691
|
}
|
|
683
|
-
function
|
|
692
|
+
function gt({
|
|
684
693
|
galleryRect: t,
|
|
685
694
|
detailRect: n,
|
|
686
|
-
scrollOffset:
|
|
695
|
+
scrollOffset: s
|
|
687
696
|
}) {
|
|
688
|
-
const d = n.left - t.left + (n.width - t.width) / 2 -
|
|
697
|
+
const d = n.left - t.left + (n.width - t.width) / 2 - s.x, r = n.top - t.top + (n.height - t.height) / 2 - s.y, a = n.width / t.width, l = n.height / t.height, i = Math.max(a, l);
|
|
689
698
|
return {
|
|
690
699
|
transformOrigin: `${t.left + t.width / 2}px ${t.top + t.height / 2}px`,
|
|
691
700
|
animate: (o) => {
|
|
@@ -697,25 +706,25 @@ function pt({
|
|
|
697
706
|
}
|
|
698
707
|
};
|
|
699
708
|
}
|
|
700
|
-
function
|
|
709
|
+
function ut({
|
|
701
710
|
detailRect: t,
|
|
702
711
|
galleryRect: n,
|
|
703
|
-
pageRect:
|
|
712
|
+
pageRect: s,
|
|
704
713
|
scrollOffset: d
|
|
705
714
|
}) {
|
|
706
|
-
const r = n.left - t.left + (n.width - t.width) / 2 + d.x,
|
|
715
|
+
const r = n.left - t.left + (n.width - t.width) / 2 + d.x, a = n.top - t.top + (n.height - t.height) / 2 + d.y, l = n.width / t.width, i = n.height / t.height, c = Math.min(l, i), o = t.top / s.height * 100, e = (s.width - (t.left + t.width)) / s.width * 100, p = (s.height - (t.top + t.height)) / s.height * 100, y = t.left / s.width * 100;
|
|
707
716
|
return {
|
|
708
717
|
transformOrigin: `${t.left + t.width / 2}px ${t.top + t.height / 2}px`,
|
|
709
718
|
animate: (g) => {
|
|
710
719
|
const u = 1 - g;
|
|
711
720
|
return {
|
|
712
721
|
clipPath: `inset(${o * u}% ${e * u}% ${p * u}% ${y * u}%)`,
|
|
713
|
-
transform: `translate(${r * u - d.x}px, ${
|
|
722
|
+
transform: `translate(${r * u - d.x}px, ${a * u - d.y}px) scale(${1 + (c - 1) * u})`
|
|
714
723
|
};
|
|
715
724
|
}
|
|
716
725
|
};
|
|
717
726
|
}
|
|
718
|
-
function
|
|
727
|
+
function ft(t, n, s) {
|
|
719
728
|
const d = t.querySelector(
|
|
720
729
|
"[data-pinterest-detail-key]"
|
|
721
730
|
), r = n.querySelector(
|
|
@@ -723,50 +732,50 @@ function gt(t, n, a) {
|
|
|
723
732
|
);
|
|
724
733
|
if (t.querySelectorAll("[data-pinterest-detail-key]").length > 1 || n.querySelectorAll("[data-pinterest-detail-key]").length > 1)
|
|
725
734
|
return null;
|
|
726
|
-
let
|
|
735
|
+
let a = null, l = null, i = !1;
|
|
727
736
|
if (!d && r) {
|
|
728
737
|
l = r;
|
|
729
738
|
const e = l.getAttribute("data-pinterest-detail-key");
|
|
730
739
|
if (!e) return null;
|
|
731
|
-
|
|
740
|
+
a = t.querySelector(
|
|
732
741
|
`[data-pinterest-gallery-key="${e}"]`
|
|
733
|
-
),
|
|
742
|
+
), a && (i = !0);
|
|
734
743
|
} else if (d && !r) {
|
|
735
744
|
l = d;
|
|
736
745
|
const e = l.getAttribute("data-pinterest-detail-key");
|
|
737
746
|
if (!e) return null;
|
|
738
|
-
|
|
747
|
+
a = n.querySelector(
|
|
739
748
|
`[data-pinterest-gallery-key="${e}"]`
|
|
740
|
-
),
|
|
749
|
+
), a && (i = !1);
|
|
741
750
|
}
|
|
742
|
-
if (!
|
|
751
|
+
if (!a || !l)
|
|
743
752
|
return null;
|
|
744
|
-
const c = b(i ? t : n,
|
|
753
|
+
const c = b(i ? t : n, a), o = b(i ? n : t, l);
|
|
745
754
|
if (i) {
|
|
746
|
-
const e =
|
|
755
|
+
const e = pt({
|
|
747
756
|
detailRect: o,
|
|
748
757
|
galleryRect: c,
|
|
749
758
|
pageRect: n.getBoundingClientRect(),
|
|
750
|
-
scrollOffset:
|
|
751
|
-
}), p =
|
|
759
|
+
scrollOffset: s
|
|
760
|
+
}), p = yt({
|
|
752
761
|
galleryRect: c,
|
|
753
762
|
detailRect: o,
|
|
754
|
-
scrollOffset:
|
|
763
|
+
scrollOffset: s
|
|
755
764
|
});
|
|
756
765
|
return n.style.transformOrigin = e.transformOrigin, t.style.transformOrigin = p.transformOrigin, {
|
|
757
766
|
inAnimation: e.animate,
|
|
758
767
|
outAnimation: p.animate
|
|
759
768
|
};
|
|
760
769
|
} else {
|
|
761
|
-
const e =
|
|
770
|
+
const e = gt({
|
|
762
771
|
galleryRect: c,
|
|
763
772
|
detailRect: o,
|
|
764
|
-
scrollOffset:
|
|
765
|
-
}), p =
|
|
773
|
+
scrollOffset: s
|
|
774
|
+
}), p = ut({
|
|
766
775
|
detailRect: o,
|
|
767
776
|
galleryRect: c,
|
|
768
777
|
pageRect: t.getBoundingClientRect(),
|
|
769
|
-
scrollOffset:
|
|
778
|
+
scrollOffset: s
|
|
770
779
|
});
|
|
771
780
|
return n.style.transformOrigin = e.transformOrigin, t.style.transformOrigin = p.transformOrigin, {
|
|
772
781
|
inAnimation: e.animate,
|
|
@@ -774,26 +783,26 @@ function gt(t, n, a) {
|
|
|
774
783
|
};
|
|
775
784
|
}
|
|
776
785
|
}
|
|
777
|
-
const
|
|
786
|
+
const Yt = (t = {}) => {
|
|
778
787
|
var i, c;
|
|
779
788
|
const n = {
|
|
780
789
|
stiffness: ((i = t.spring) == null ? void 0 : i.stiffness) ?? 30,
|
|
781
790
|
damping: ((c = t.spring) == null ? void 0 : c.damping) ?? 10
|
|
782
|
-
},
|
|
783
|
-
let d = null, r = null,
|
|
791
|
+
}, s = t.timeout ?? 300;
|
|
792
|
+
let d = null, r = null, a = null, l = null;
|
|
784
793
|
return {
|
|
785
794
|
in: async (o, { scrollOffset: e }) => {
|
|
786
795
|
const p = o;
|
|
787
796
|
return !await new Promise((h) => {
|
|
788
797
|
d ? h(!0) : (r = h, setTimeout(() => {
|
|
789
798
|
r = null, h(!1);
|
|
790
|
-
},
|
|
799
|
+
}, s));
|
|
791
800
|
}) || !d ? (l == null || l(), l = null, d = null, {
|
|
792
801
|
spring: n,
|
|
793
802
|
css: () => ({})
|
|
794
|
-
}) : (
|
|
803
|
+
}) : (a = ft(d, p, e), l == null || l(), l = null, a ? (d = null, {
|
|
795
804
|
spring: n,
|
|
796
|
-
css: (h) =>
|
|
805
|
+
css: (h) => a ? a.inAnimation(h) : {}
|
|
797
806
|
}) : (d = null, {
|
|
798
807
|
spring: n,
|
|
799
808
|
css: () => ({})
|
|
@@ -811,29 +820,58 @@ const vt = (t = {}) => {
|
|
|
811
820
|
wait: async () => {
|
|
812
821
|
d = o, r && (r(!0), r = null), await e;
|
|
813
822
|
},
|
|
814
|
-
css: (p) =>
|
|
823
|
+
css: (p) => a ? a.outAnimation(p) : {}
|
|
815
824
|
};
|
|
816
825
|
}
|
|
817
826
|
};
|
|
818
|
-
},
|
|
827
|
+
}, I = { stiffness: 100, damping: 30 }, Ut = () => ({
|
|
828
|
+
in: (t) => ({
|
|
829
|
+
spring: I,
|
|
830
|
+
prepare: () => {
|
|
831
|
+
t.style.opacity = "0", t.style.transform = "rotate(-180deg)", t.style.transformOrigin = "center center", t.style.willChange = "transform, opacity";
|
|
832
|
+
},
|
|
833
|
+
css: (n) => ({
|
|
834
|
+
// -180deg → 0deg, show after 90deg (progress > 0.5)
|
|
835
|
+
transform: `rotate(${(n - 1) * 180}deg)`,
|
|
836
|
+
opacity: n > 0.5 ? 1 : 0
|
|
837
|
+
}),
|
|
838
|
+
onEnd: () => {
|
|
839
|
+
t.style.willChange = "auto", t.style.transform = "", t.style.transformOrigin = "", t.style.opacity = "";
|
|
840
|
+
}
|
|
841
|
+
}),
|
|
842
|
+
out: (t, n) => ({
|
|
843
|
+
spring: I,
|
|
844
|
+
prepare: () => {
|
|
845
|
+
x(t, n), t.style.transformOrigin = "center center", t.style.willChange = "transform, opacity";
|
|
846
|
+
},
|
|
847
|
+
css: (s) => ({
|
|
848
|
+
// 0deg → 180deg, hide after 90deg (progress < 0.5)
|
|
849
|
+
transform: `rotate(${(1 - s) * 180}deg)`,
|
|
850
|
+
opacity: s > 0.5 ? 1 : 0
|
|
851
|
+
}),
|
|
852
|
+
onEnd: () => {
|
|
853
|
+
t.style.willChange = "auto";
|
|
854
|
+
}
|
|
855
|
+
})
|
|
856
|
+
}), O = {
|
|
819
857
|
stiffness: 5,
|
|
820
858
|
damping: 4
|
|
821
|
-
},
|
|
859
|
+
}, Vt = (t = {}) => {
|
|
822
860
|
var c, o;
|
|
823
|
-
const n = t.direction ?? "up",
|
|
824
|
-
stiffness: ((c = t.spring) == null ? void 0 : c.stiffness) ??
|
|
825
|
-
damping: ((o = t.spring) == null ? void 0 : o.damping) ??
|
|
861
|
+
const n = t.direction ?? "up", s = {
|
|
862
|
+
stiffness: ((c = t.spring) == null ? void 0 : c.stiffness) ?? O.stiffness,
|
|
863
|
+
damping: ((o = t.spring) == null ? void 0 : o.damping) ?? O.damping
|
|
826
864
|
}, d = n === "up";
|
|
827
|
-
let r = null,
|
|
865
|
+
let r = null, a = null, l = null;
|
|
828
866
|
const i = () => {
|
|
829
|
-
if (r === null ||
|
|
867
|
+
if (r === null || a === null)
|
|
830
868
|
return null;
|
|
831
|
-
const e = Math.min(r,
|
|
869
|
+
const e = Math.min(r, a), p = window.innerHeight;
|
|
832
870
|
return Math.max(e, p);
|
|
833
871
|
};
|
|
834
872
|
return {
|
|
835
|
-
in: (e) => (
|
|
836
|
-
spring:
|
|
873
|
+
in: (e) => (a = e.offsetHeight, r !== null && (l = i()), {
|
|
874
|
+
spring: s,
|
|
837
875
|
prepare: () => {
|
|
838
876
|
e.style.willChange = "transform", e.style.backfaceVisibility = "hidden", e.style.contain = "layout paint";
|
|
839
877
|
},
|
|
@@ -847,9 +885,9 @@ const vt = (t = {}) => {
|
|
|
847
885
|
}
|
|
848
886
|
}),
|
|
849
887
|
out: (e, p) => ({
|
|
850
|
-
spring:
|
|
888
|
+
spring: s,
|
|
851
889
|
onStart: () => {
|
|
852
|
-
r = e.offsetHeight,
|
|
890
|
+
r = e.offsetHeight, a !== null && (l = i());
|
|
853
891
|
},
|
|
854
892
|
tick: (y) => {
|
|
855
893
|
l === null && (l = i());
|
|
@@ -861,18 +899,18 @@ const vt = (t = {}) => {
|
|
|
861
899
|
}
|
|
862
900
|
})
|
|
863
901
|
};
|
|
864
|
-
},
|
|
902
|
+
}, D = {
|
|
865
903
|
stiffness: 15,
|
|
866
904
|
damping: 7
|
|
867
|
-
},
|
|
868
|
-
var r,
|
|
869
|
-
const n = t.direction ?? "left",
|
|
870
|
-
stiffness: ((r = t.spring) == null ? void 0 : r.stiffness) ??
|
|
871
|
-
damping: ((
|
|
905
|
+
}, Wt = (t = {}) => {
|
|
906
|
+
var r, a;
|
|
907
|
+
const n = t.direction ?? "left", s = {
|
|
908
|
+
stiffness: ((r = t.spring) == null ? void 0 : r.stiffness) ?? D.stiffness,
|
|
909
|
+
damping: ((a = t.spring) == null ? void 0 : a.damping) ?? D.damping
|
|
872
910
|
}, d = n === "left";
|
|
873
911
|
return {
|
|
874
912
|
in: (l) => ({
|
|
875
|
-
spring:
|
|
913
|
+
spring: s,
|
|
876
914
|
prepare: () => {
|
|
877
915
|
l.style.willChange = "transform", l.style.backfaceVisibility = "hidden", l.style.contain = "layout paint";
|
|
878
916
|
},
|
|
@@ -884,7 +922,7 @@ const vt = (t = {}) => {
|
|
|
884
922
|
}
|
|
885
923
|
}),
|
|
886
924
|
out: (l, i) => ({
|
|
887
|
-
spring:
|
|
925
|
+
spring: s,
|
|
888
926
|
css: (c) => ({
|
|
889
927
|
transform: `translate3d(${d ? (1 - c) * -100 : (1 - c) * 100}%, 0, 0)`
|
|
890
928
|
}),
|
|
@@ -893,46 +931,46 @@ const vt = (t = {}) => {
|
|
|
893
931
|
}
|
|
894
932
|
})
|
|
895
933
|
};
|
|
896
|
-
},
|
|
934
|
+
}, P = { stiffness: 17, damping: 6 }, L = 20, C = 800, zt = () => {
|
|
897
935
|
let t, n = null;
|
|
898
936
|
return {
|
|
899
|
-
in: (
|
|
900
|
-
spring:
|
|
937
|
+
in: (s) => ({
|
|
938
|
+
spring: P,
|
|
901
939
|
prepare: () => {
|
|
902
|
-
|
|
940
|
+
s.style.willChange = "transform", s.style.backfaceVisibility = "hidden", s.style.contain = "layout paint", s.style.transform = `perspective(${C}px) rotateY(${L}deg) translate3d(-100%, 0, 0)`;
|
|
903
941
|
},
|
|
904
942
|
wait: async () => {
|
|
905
943
|
t && await t;
|
|
906
944
|
},
|
|
907
945
|
css: (d) => {
|
|
908
|
-
const r = (1 - d) * L,
|
|
946
|
+
const r = (1 - d) * L, a = -(1 - d) * 100;
|
|
909
947
|
return {
|
|
910
|
-
transform: `perspective(${C}px) rotateY(${r}deg) translate3d(${
|
|
948
|
+
transform: `perspective(${C}px) rotateY(${r}deg) translate3d(${a}%, 0, 0)`
|
|
911
949
|
};
|
|
912
950
|
},
|
|
913
951
|
onEnd: () => {
|
|
914
|
-
|
|
952
|
+
s.style.transform = "", s.style.willChange = "auto", s.style.backfaceVisibility = "", s.style.contain = "";
|
|
915
953
|
}
|
|
916
954
|
}),
|
|
917
|
-
out: (
|
|
955
|
+
out: (s, d) => (t = new Promise((r) => {
|
|
918
956
|
n = r;
|
|
919
957
|
}), {
|
|
920
|
-
spring:
|
|
958
|
+
spring: P,
|
|
921
959
|
prepare: (r) => {
|
|
922
960
|
x(r, d), r.style.willChange = "transform", r.style.backfaceVisibility = "hidden", r.style.contain = "layout paint", r.style.pointerEvents = "none", r.style.transform = `perspective(${C}px) rotateY(0deg) translate3d(0%, 0, 0)`;
|
|
923
961
|
},
|
|
924
962
|
css: (r) => {
|
|
925
|
-
const
|
|
963
|
+
const a = 1 - r, l = a * L, i = a * 100;
|
|
926
964
|
return {
|
|
927
965
|
transform: `perspective(${C}px) rotateY(${-l}deg) translate3d(${i}%, 0, 0)`
|
|
928
966
|
};
|
|
929
967
|
},
|
|
930
968
|
onEnd: () => {
|
|
931
|
-
n && n(),
|
|
969
|
+
n && n(), s.style.transform = "";
|
|
932
970
|
}
|
|
933
971
|
})
|
|
934
972
|
};
|
|
935
|
-
},
|
|
973
|
+
}, $t = { stiffness: 1, damping: 1 }, mt = { stiffness: 20, damping: 25 }, wt = "#000000", xt = "circle", v = "CURTAIN_REVEAL_OVERLAY_ID", bt = {
|
|
936
974
|
position: "fixed",
|
|
937
975
|
inset: "0",
|
|
938
976
|
width: "100vw",
|
|
@@ -942,17 +980,17 @@ const vt = (t = {}) => {
|
|
|
942
980
|
alignItems: "center",
|
|
943
981
|
justifyContent: "center",
|
|
944
982
|
overflow: "hidden"
|
|
945
|
-
},
|
|
983
|
+
}, Et = {
|
|
946
984
|
position: "relative",
|
|
947
985
|
display: "inline-block",
|
|
948
986
|
height: "5.5rem",
|
|
949
987
|
overflow: "hidden"
|
|
950
|
-
},
|
|
988
|
+
}, Ct = {
|
|
951
989
|
display: "flex",
|
|
952
990
|
height: "100%",
|
|
953
991
|
willChange: "transform",
|
|
954
992
|
transition: "transform 0.3s ease"
|
|
955
|
-
},
|
|
993
|
+
}, At = {
|
|
956
994
|
display: "inline-flex",
|
|
957
995
|
alignItems: "center",
|
|
958
996
|
justifyContent: "center",
|
|
@@ -961,40 +999,40 @@ const vt = (t = {}) => {
|
|
|
961
999
|
fontWeight: "900",
|
|
962
1000
|
letterSpacing: "0.02em",
|
|
963
1001
|
color: "#FFFFFF"
|
|
964
|
-
},
|
|
965
|
-
function
|
|
1002
|
+
}, Lt = 0.4, A = 0.5, Tt = 0.2;
|
|
1003
|
+
function kt(t, n) {
|
|
966
1004
|
switch (t) {
|
|
967
1005
|
case "circle":
|
|
968
1006
|
return `circle(${n * 100}% at 50% 50%)`;
|
|
969
1007
|
case "square":
|
|
970
1008
|
return `inset(${(1 - n) * 50}% round ${10 * n}%)`;
|
|
971
1009
|
case "triangle": {
|
|
972
|
-
const
|
|
973
|
-
return `polygon(50% ${50 -
|
|
1010
|
+
const s = n * 100;
|
|
1011
|
+
return `polygon(50% ${50 - s}%, ${50 - s}% ${50 + s}%, ${50 + s}% ${50 + s}%)`;
|
|
974
1012
|
}
|
|
975
1013
|
}
|
|
976
1014
|
}
|
|
977
|
-
const
|
|
1015
|
+
const St = (t) => t.reduce((n, s) => n + s, 0), Xt = (t = {}) => {
|
|
978
1016
|
const {
|
|
979
|
-
background: n =
|
|
980
|
-
texts:
|
|
981
|
-
shape: d =
|
|
982
|
-
inSpring: r =
|
|
983
|
-
outSpring:
|
|
1017
|
+
background: n = wt,
|
|
1018
|
+
texts: s = [],
|
|
1019
|
+
shape: d = xt,
|
|
1020
|
+
inSpring: r = mt,
|
|
1021
|
+
outSpring: a = $t,
|
|
984
1022
|
textStyle: l = {}
|
|
985
1023
|
} = t;
|
|
986
1024
|
return {
|
|
987
1025
|
out: (i, c) => {
|
|
988
1026
|
const o = i.style.opacity;
|
|
989
1027
|
return {
|
|
990
|
-
spring:
|
|
1028
|
+
spring: a,
|
|
991
1029
|
from: 1,
|
|
992
1030
|
to: 0,
|
|
993
1031
|
prepare: (e) => {
|
|
994
1032
|
x(e, c), e.style.opacity = "1";
|
|
995
1033
|
},
|
|
996
1034
|
tick: (e) => {
|
|
997
|
-
const p = Math.max(0, e -
|
|
1035
|
+
const p = Math.max(0, e - Lt);
|
|
998
1036
|
i.style.opacity = String(p);
|
|
999
1037
|
},
|
|
1000
1038
|
onEnd: () => {
|
|
@@ -1005,13 +1043,13 @@ const Tt = (t) => t.reduce((n, a) => n + a, 0), Vt = (t = {}) => {
|
|
|
1005
1043
|
in: (i) => {
|
|
1006
1044
|
let c = null, o = null, e = null;
|
|
1007
1045
|
const p = document.body.style.overflow, y = document.getElementById(
|
|
1008
|
-
|
|
1046
|
+
v
|
|
1009
1047
|
);
|
|
1010
1048
|
let h = [];
|
|
1011
1049
|
const g = () => {
|
|
1012
|
-
c = document.createElement("div"), c.id =
|
|
1050
|
+
c = document.createElement("div"), c.id = v, Object.assign(c.style, bt, { background: n }), document.body.appendChild(c), o = document.createElement("div"), Object.assign(o.style, Et), c.appendChild(o), e = document.createElement("div"), Object.assign(e.style, Ct), o.appendChild(e), s.forEach((u) => {
|
|
1013
1051
|
const m = document.createElement("div");
|
|
1014
|
-
m.textContent = u, Object.assign(m.style,
|
|
1052
|
+
m.textContent = u, Object.assign(m.style, At, l), e.appendChild(m);
|
|
1015
1053
|
}), h = Array.from(e.children).map(
|
|
1016
1054
|
(u) => u.getBoundingClientRect().width
|
|
1017
1055
|
);
|
|
@@ -1025,19 +1063,19 @@ const Tt = (t) => t.reduce((n, a) => n + a, 0), Vt = (t = {}) => {
|
|
|
1025
1063
|
},
|
|
1026
1064
|
tick: (u) => {
|
|
1027
1065
|
if (!(!c || !o || !e)) {
|
|
1028
|
-
if (u <= A &&
|
|
1066
|
+
if (u <= A && s.length > 0) {
|
|
1029
1067
|
const m = u / A, f = Math.min(
|
|
1030
|
-
Math.floor(m *
|
|
1031
|
-
|
|
1032
|
-
), w = h[f] ?? 0, $ =
|
|
1068
|
+
Math.floor(m * s.length),
|
|
1069
|
+
s.length - 1
|
|
1070
|
+
), w = h[f] ?? 0, $ = St(h.slice(0, f));
|
|
1033
1071
|
o.style.width = `${w}px`, e.style.transform = `translateX(-${$}px)`;
|
|
1034
1072
|
}
|
|
1035
1073
|
if (u > A) {
|
|
1036
1074
|
const f = 1 - Math.max(
|
|
1037
1075
|
0,
|
|
1038
|
-
Math.min(1, (u - A) /
|
|
1076
|
+
Math.min(1, (u - A) / Tt)
|
|
1039
1077
|
);
|
|
1040
|
-
c.style.clipPath =
|
|
1078
|
+
c.style.clipPath = kt(d, f), o.style.transform = `scale(${f})`;
|
|
1041
1079
|
}
|
|
1042
1080
|
}
|
|
1043
1081
|
},
|
|
@@ -1049,16 +1087,17 @@ const Tt = (t) => t.reduce((n, a) => n + a, 0), Vt = (t = {}) => {
|
|
|
1049
1087
|
};
|
|
1050
1088
|
};
|
|
1051
1089
|
export {
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1090
|
+
It as blind,
|
|
1091
|
+
Xt as curtainReveal,
|
|
1092
|
+
Ot as drill,
|
|
1093
|
+
Dt as fade,
|
|
1094
|
+
Pt as film,
|
|
1095
|
+
vt as hero,
|
|
1096
|
+
Ft as instagram,
|
|
1097
|
+
Ht as jaemin,
|
|
1098
|
+
Yt as pinterest,
|
|
1099
|
+
Ut as rotate,
|
|
1100
|
+
Vt as scroll,
|
|
1101
|
+
Wt as slide,
|
|
1102
|
+
zt as strip
|
|
1064
1103
|
};
|