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