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