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