@ssgoi/core 6.0.0 → 6.1.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 +5 -6
- package/dist/animation/animation.d.ts +18 -0
- package/dist/animation/animation.d.ts.map +1 -1
- package/dist/animation/host-animation.d.ts +2 -0
- package/dist/animation/host-animation.d.ts.map +1 -1
- package/dist/animation/multi-animation.d.ts +20 -4
- package/dist/animation/multi-animation.d.ts.map +1 -1
- package/dist/animation/web-animation.d.ts +2 -0
- package/dist/animation/web-animation.d.ts.map +1 -1
- package/dist/index.cjs +10 -10
- package/dist/index.js +998 -561
- package/dist/internal.cjs +1 -1
- package/dist/internal.js +208 -201
- package/dist/multi-animation-CnxqLEka.js +322 -0
- package/dist/multi-animation-Dw2JTJI2.cjs +1 -0
- package/dist/ssgoi-transition/create-ssgoi-transition-context.d.ts.map +1 -1
- package/dist/transitions/axis/index.d.ts +43 -0
- package/dist/transitions/axis/index.d.ts.map +1 -0
- package/dist/transitions/axis/provider/index.d.ts +8 -0
- package/dist/transitions/axis/provider/index.d.ts.map +1 -0
- package/dist/transitions/axis/provider/x/fluid.d.ts +3 -0
- package/dist/transitions/axis/provider/x/fluid.d.ts.map +1 -0
- package/dist/transitions/axis/provider/x/index.d.ts +3 -0
- package/dist/transitions/axis/provider/x/index.d.ts.map +1 -0
- package/dist/transitions/axis/provider/x/snappy.d.ts +3 -0
- package/dist/transitions/axis/provider/x/snappy.d.ts.map +1 -0
- package/dist/transitions/axis/provider/y.d.ts +3 -0
- package/dist/transitions/axis/provider/y.d.ts.map +1 -0
- package/dist/transitions/axis/provider/z.d.ts +3 -0
- package/dist/transitions/axis/provider/z.d.ts.map +1 -0
- package/dist/transitions/axis/transition.d.ts +5 -0
- package/dist/transitions/axis/transition.d.ts.map +1 -0
- package/dist/transitions/axis/types.d.ts +52 -0
- package/dist/transitions/axis/types.d.ts.map +1 -0
- package/dist/transitions/blind/index.d.ts +10 -1
- package/dist/transitions/blind/index.d.ts.map +1 -1
- package/dist/transitions/drill/index.d.ts +37 -6
- package/dist/transitions/drill/index.d.ts.map +1 -1
- package/dist/transitions/drill/types.d.ts +10 -0
- package/dist/transitions/drill/types.d.ts.map +1 -1
- package/dist/transitions/fade/index.d.ts +13 -3
- package/dist/transitions/fade/index.d.ts.map +1 -1
- package/dist/transitions/fade/types.d.ts +14 -0
- package/dist/transitions/fade/types.d.ts.map +1 -0
- package/dist/transitions/film/index.d.ts +13 -3
- package/dist/transitions/film/index.d.ts.map +1 -1
- package/dist/transitions/film/types.d.ts +16 -0
- package/dist/transitions/film/types.d.ts.map +1 -0
- package/dist/transitions/hero/index.d.ts +14 -3
- package/dist/transitions/hero/index.d.ts.map +1 -1
- package/dist/transitions/hero/types.d.ts +12 -0
- package/dist/transitions/hero/types.d.ts.map +1 -0
- package/dist/transitions/index.d.ts +1 -0
- package/dist/transitions/index.d.ts.map +1 -1
- package/dist/transitions/jaemin/index.d.ts +13 -3
- package/dist/transitions/jaemin/index.d.ts.map +1 -1
- package/dist/transitions/jaemin/types.d.ts +9 -0
- package/dist/transitions/jaemin/types.d.ts.map +1 -0
- package/dist/transitions/rotate/index.d.ts +12 -3
- package/dist/transitions/rotate/index.d.ts.map +1 -1
- package/dist/transitions/rotate/types.d.ts +9 -0
- package/dist/transitions/rotate/types.d.ts.map +1 -0
- package/dist/transitions/scroll/index.d.ts +7 -7
- package/dist/transitions/scroll/index.d.ts.map +1 -1
- package/dist/transitions/sheet/index.d.ts +38 -6
- package/dist/transitions/sheet/index.d.ts.map +1 -1
- package/dist/transitions/sheet/types.d.ts +10 -0
- package/dist/transitions/sheet/types.d.ts.map +1 -1
- package/dist/transitions/slide/index.d.ts +13 -3
- package/dist/transitions/slide/index.d.ts.map +1 -1
- package/dist/transitions/slide/types.d.ts +10 -0
- package/dist/transitions/slide/types.d.ts.map +1 -0
- package/dist/transitions/strip/index.d.ts +13 -3
- package/dist/transitions/strip/index.d.ts.map +1 -1
- package/dist/transitions/strip/types.d.ts +9 -0
- package/dist/transitions/strip/types.d.ts.map +1 -0
- package/dist/transitions/utils.d.ts +16 -0
- package/dist/transitions/utils.d.ts.map +1 -1
- package/dist/transitions/zoom/index.d.ts +17 -3
- package/dist/transitions/zoom/index.d.ts.map +1 -1
- package/dist/transitions/zoom/provider/blur.d.ts +14 -0
- package/dist/transitions/zoom/provider/blur.d.ts.map +1 -0
- package/dist/transitions/zoom/provider/expand.d.ts +6 -1
- package/dist/transitions/zoom/provider/expand.d.ts.map +1 -1
- package/dist/transitions/zoom/provider/index.d.ts +10 -1
- package/dist/transitions/zoom/provider/index.d.ts.map +1 -1
- package/dist/transitions/zoom/provider/static.d.ts +6 -1
- package/dist/transitions/zoom/provider/static.d.ts.map +1 -1
- package/dist/transitions/zoom/transition.d.ts +3 -3
- package/dist/transitions/zoom/transition.d.ts.map +1 -1
- package/dist/transitions/zoom/types.d.ts +78 -3
- package/dist/transitions/zoom/types.d.ts.map +1 -1
- package/dist/transitions/zoom/zoom-element.d.ts +2 -2
- package/dist/transitions/zoom/zoom-element.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -4
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/multi-animation-B_Hl1HEU.cjs +0 -1
- package/dist/multi-animation-CST6aZ8y.js +0 -276
package/dist/index.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { P as
|
|
5
|
-
import { A as
|
|
1
|
+
var xt = Object.defineProperty;
|
|
2
|
+
var Et = (e, t, n) => t in e ? xt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var $ = (e, t, n) => Et(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import { P as Z, V as ft, W as b, M as E, S as Ct } from "./multi-animation-CnxqLEka.js";
|
|
5
|
+
import { A as zn } from "./multi-animation-CnxqLEka.js";
|
|
6
6
|
function P(e, t) {
|
|
7
7
|
const n = [];
|
|
8
8
|
for (let s = 0; s < e.length; s++)
|
|
9
9
|
for (let o = s + 1; o < e.length; o++) {
|
|
10
|
-
const
|
|
11
|
-
!
|
|
12
|
-
from:
|
|
13
|
-
to:
|
|
10
|
+
const i = e[s], r = e[o];
|
|
11
|
+
!i || !r || n.push({
|
|
12
|
+
from: i,
|
|
13
|
+
to: r,
|
|
14
14
|
transition: t(),
|
|
15
15
|
symmetric: !0
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
return n;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function ht(e, t) {
|
|
21
21
|
return [
|
|
22
22
|
{
|
|
23
23
|
from: e.exit,
|
|
@@ -31,39 +31,39 @@ function st(e, t) {
|
|
|
31
31
|
}
|
|
32
32
|
];
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function q(e, t, n) {
|
|
35
35
|
const s = [];
|
|
36
36
|
for (let o = 0; o < e.length; o++)
|
|
37
|
-
for (let
|
|
38
|
-
const
|
|
39
|
-
!
|
|
37
|
+
for (let i = o + 1; i < e.length; i++) {
|
|
38
|
+
const r = e[o], l = e[i];
|
|
39
|
+
!r || !l || s.push(
|
|
40
40
|
{
|
|
41
|
-
from:
|
|
41
|
+
from: r,
|
|
42
42
|
to: l,
|
|
43
43
|
transition: n(t.forward)
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
46
|
from: l,
|
|
47
|
-
to:
|
|
47
|
+
to: r,
|
|
48
48
|
transition: n(t.backward)
|
|
49
49
|
}
|
|
50
50
|
);
|
|
51
51
|
}
|
|
52
52
|
return s;
|
|
53
53
|
}
|
|
54
|
-
class
|
|
54
|
+
class F {
|
|
55
55
|
constructor(t) {
|
|
56
|
-
|
|
56
|
+
$(this, "omega");
|
|
57
57
|
// Angular frequency
|
|
58
|
-
|
|
58
|
+
$(this, "zeta");
|
|
59
59
|
// Damping ratio
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
$(this, "restDelta");
|
|
61
|
+
$(this, "restSpeed");
|
|
62
62
|
const { stiffness: n, damping: s } = t, o = 1;
|
|
63
|
-
this.omega = Math.sqrt(n / o), this.zeta = s / (2 * Math.sqrt(n * o)), this.restDelta = t.restDelta ??
|
|
63
|
+
this.omega = Math.sqrt(n / o), this.zeta = s / (2 * Math.sqrt(n * o)), this.restDelta = t.restDelta ?? Z, this.restSpeed = t.restSpeed ?? ft;
|
|
64
64
|
}
|
|
65
65
|
step(t, n, s) {
|
|
66
|
-
const o = Math.min(s, 0.033), { omega:
|
|
66
|
+
const o = Math.min(s, 0.033), { omega: i, zeta: r } = this, { position: l, velocity: c } = t, a = -2 * o * r * i * c, p = o * i * i * (n - l), d = c + a + p;
|
|
67
67
|
return {
|
|
68
68
|
position: l + o * d,
|
|
69
69
|
velocity: d
|
|
@@ -74,39 +74,39 @@ class v {
|
|
|
74
74
|
return s < this.restDelta && o < this.restSpeed;
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
-
class
|
|
77
|
+
class Pt {
|
|
78
78
|
constructor(t) {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
this.restDelta = t.restDelta ??
|
|
79
|
+
$(this, "leader");
|
|
80
|
+
$(this, "follower");
|
|
81
|
+
$(this, "restDelta");
|
|
82
|
+
$(this, "restSpeed");
|
|
83
|
+
this.restDelta = t.restDelta ?? Z, this.restSpeed = t.restSpeed ?? ft, this.leader = new F({
|
|
84
84
|
stiffness: t.stiffness,
|
|
85
85
|
damping: t.damping,
|
|
86
86
|
restDelta: this.restDelta,
|
|
87
87
|
restSpeed: this.restSpeed
|
|
88
88
|
});
|
|
89
|
-
let n, s, o,
|
|
90
|
-
typeof t.follower == "number" ? (n = t.stiffness * t.follower, s = t.damping) : t.follower ? (n = t.follower.stiffness, s = t.follower.damping, o = t.follower.restDelta,
|
|
89
|
+
let n, s, o, i;
|
|
90
|
+
typeof t.follower == "number" ? (n = t.stiffness * t.follower, s = t.damping) : t.follower ? (n = t.follower.stiffness, s = t.follower.damping, o = t.follower.restDelta, i = t.follower.restSpeed) : (n = t.stiffness, s = t.damping), this.follower = new F({
|
|
91
91
|
stiffness: n,
|
|
92
92
|
damping: s,
|
|
93
93
|
restDelta: o ?? this.restDelta,
|
|
94
|
-
restSpeed:
|
|
94
|
+
restSpeed: i ?? this.restSpeed
|
|
95
95
|
});
|
|
96
96
|
}
|
|
97
97
|
step(t, n, s) {
|
|
98
|
-
const
|
|
98
|
+
const i = t._leader ?? {
|
|
99
99
|
position: t.position,
|
|
100
100
|
velocity: t.velocity
|
|
101
|
-
},
|
|
101
|
+
}, r = this.leader.step(i, n, s), l = this.follower.step(
|
|
102
102
|
t,
|
|
103
|
-
|
|
103
|
+
r.position,
|
|
104
104
|
s
|
|
105
105
|
);
|
|
106
106
|
return {
|
|
107
107
|
position: l.position,
|
|
108
108
|
velocity: l.velocity,
|
|
109
|
-
_leader:
|
|
109
|
+
_leader: r
|
|
110
110
|
};
|
|
111
111
|
}
|
|
112
112
|
isSettled(t, n) {
|
|
@@ -114,39 +114,39 @@ class yt {
|
|
|
114
114
|
return s._leader ? Math.abs(n - s._leader.position) < this.restDelta && Math.abs(s._leader.velocity) < this.restSpeed && o : o;
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
|
-
const
|
|
118
|
-
class
|
|
117
|
+
const vt = 0.01, Tt = 500, Dt = 10;
|
|
118
|
+
class _t {
|
|
119
119
|
constructor(t) {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
this.acceleration = t.acceleration, this.resistance = t.resistance, this.resistanceType = t.resistanceType ?? "quadratic", this.min = t.min, this.max = t.max, this.bounceStiffness = t.bounceStiffness ??
|
|
120
|
+
$(this, "acceleration");
|
|
121
|
+
$(this, "resistance");
|
|
122
|
+
$(this, "resistanceType");
|
|
123
|
+
$(this, "min");
|
|
124
|
+
$(this, "max");
|
|
125
|
+
$(this, "bounceStiffness");
|
|
126
|
+
$(this, "bounceDamping");
|
|
127
|
+
$(this, "restDelta");
|
|
128
|
+
this.acceleration = t.acceleration, this.resistance = t.resistance, this.resistanceType = t.resistanceType ?? "quadratic", this.min = t.min, this.max = t.max, this.bounceStiffness = t.bounceStiffness ?? Tt, this.bounceDamping = t.bounceDamping ?? Dt, this.restDelta = t.restDelta ?? vt;
|
|
129
129
|
}
|
|
130
130
|
step(t, n, s) {
|
|
131
|
-
const o = Math.min(s, 0.033), { acceleration:
|
|
131
|
+
const o = Math.min(s, 0.033), { acceleration: i, resistance: r, resistanceType: l, min: c, max: a } = this, { position: p, velocity: d } = t, u = c !== void 0 && p < c, m = a !== void 0 && p > a;
|
|
132
132
|
let f;
|
|
133
|
-
if (
|
|
134
|
-
const
|
|
135
|
-
f =
|
|
133
|
+
if (u || m) {
|
|
134
|
+
const S = p - (u ? c : a), x = -this.bounceStiffness * S, C = -this.bounceDamping * d;
|
|
135
|
+
f = x + C;
|
|
136
136
|
} else {
|
|
137
|
-
const
|
|
138
|
-
let
|
|
139
|
-
l === "linear" ?
|
|
137
|
+
const w = n > p ? 1 : -1;
|
|
138
|
+
let S;
|
|
139
|
+
l === "linear" ? S = r * d : S = r * d * Math.abs(d), f = w * i - S;
|
|
140
140
|
}
|
|
141
|
-
const
|
|
142
|
-
let y = p +
|
|
143
|
-
if (!
|
|
144
|
-
const
|
|
145
|
-
(
|
|
141
|
+
const h = d + f * o;
|
|
142
|
+
let y = p + h * o;
|
|
143
|
+
if (!u && !m) {
|
|
144
|
+
const w = n > p ? 1 : -1;
|
|
145
|
+
(w > 0 && y > n || w < 0 && y < n) && (y = n);
|
|
146
146
|
}
|
|
147
147
|
return {
|
|
148
148
|
position: y,
|
|
149
|
-
velocity: y === n ? 0 :
|
|
149
|
+
velocity: y === n ? 0 : h
|
|
150
150
|
};
|
|
151
151
|
}
|
|
152
152
|
isSettled(t, n) {
|
|
@@ -167,7 +167,7 @@ class g {
|
|
|
167
167
|
"Cannot use both 'spring' and 'inertia' together. Choose one physics type."
|
|
168
168
|
);
|
|
169
169
|
if (t.inertia)
|
|
170
|
-
return new
|
|
170
|
+
return new _t({
|
|
171
171
|
acceleration: t.inertia.acceleration,
|
|
172
172
|
resistance: t.inertia.resistance,
|
|
173
173
|
resistanceType: t.inertia.resistanceType,
|
|
@@ -184,7 +184,7 @@ class g {
|
|
|
184
184
|
return typeof s == "number" ? o = s : typeof s == "object" && (o = {
|
|
185
185
|
stiffness: s.stiffness,
|
|
186
186
|
damping: s.damping
|
|
187
|
-
}), new
|
|
187
|
+
}), new Pt({
|
|
188
188
|
stiffness: n.stiffness,
|
|
189
189
|
damping: n.damping,
|
|
190
190
|
follower: o,
|
|
@@ -192,7 +192,7 @@ class g {
|
|
|
192
192
|
restSpeed: n.restSpeed
|
|
193
193
|
});
|
|
194
194
|
}
|
|
195
|
-
return new
|
|
195
|
+
return new F({
|
|
196
196
|
stiffness: n.stiffness,
|
|
197
197
|
damping: n.damping,
|
|
198
198
|
restDelta: n.restDelta,
|
|
@@ -207,25 +207,237 @@ class g {
|
|
|
207
207
|
return g.from({ spring: t });
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
|
-
class
|
|
210
|
+
class At {
|
|
211
211
|
constructor(t) {
|
|
212
|
-
|
|
212
|
+
$(this, "durationSec");
|
|
213
213
|
this.durationSec = Math.max(1 / 60, t.durationSec);
|
|
214
214
|
}
|
|
215
215
|
step(t, n, s) {
|
|
216
216
|
const o = n - t.position;
|
|
217
217
|
if (o === 0) return t;
|
|
218
|
-
const
|
|
219
|
-
return (
|
|
218
|
+
const i = Math.sign(o), r = Math.abs(o) / this.durationSec, l = i * r * s, c = t.position + l;
|
|
219
|
+
return (i > 0 ? c >= n : c <= n) ? { position: n, velocity: 0 } : { position: c, velocity: i * r };
|
|
220
220
|
}
|
|
221
221
|
isSettled(t, n) {
|
|
222
|
-
return Math.abs(t.position - n) <
|
|
222
|
+
return Math.abs(t.position - n) < Z;
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
|
-
const
|
|
225
|
+
const G = 8, K = {
|
|
226
|
+
spring: { stiffness: 1e3, damping: 40, doubleSpring: 1.2 }
|
|
227
|
+
};
|
|
228
|
+
function It({
|
|
229
|
+
direction: e
|
|
230
|
+
}) {
|
|
231
|
+
const t = e === "forward" ? G : -G;
|
|
232
|
+
return {
|
|
233
|
+
out: {
|
|
234
|
+
willChange: "transform, opacity",
|
|
235
|
+
startStyle: {},
|
|
236
|
+
animate: (n) => ({
|
|
237
|
+
opacity: `${1 - n}`
|
|
238
|
+
})
|
|
239
|
+
},
|
|
240
|
+
in: {
|
|
241
|
+
willChange: "transform, opacity",
|
|
242
|
+
startStyle: {
|
|
243
|
+
transform: `translate3d(${t}px, 0, 0)`,
|
|
244
|
+
opacity: "0"
|
|
245
|
+
},
|
|
246
|
+
animate: (n) => ({
|
|
247
|
+
transform: `translate3d(${t * (1 - n)}px, 0, 0)`,
|
|
248
|
+
opacity: `${n}`
|
|
249
|
+
})
|
|
250
|
+
}
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
function Ot() {
|
|
254
|
+
return {
|
|
255
|
+
outPhysics: K,
|
|
256
|
+
inPhysics: K,
|
|
257
|
+
// Both sides run together — the cross-fade is the whole point of the
|
|
258
|
+
// snappy feel. (fluid's sibling uses staggered fade-through.)
|
|
259
|
+
composition: { mode: "parallel", startAt: [0, 0] },
|
|
260
|
+
build: It
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
const J = 30, kt = {
|
|
264
|
+
inertia: { acceleration: 150, resistance: 1.5 }
|
|
265
|
+
}, Lt = {
|
|
266
|
+
spring: { stiffness: 180, damping: 34 }
|
|
267
|
+
};
|
|
268
|
+
function Ft({
|
|
269
|
+
direction: e
|
|
270
|
+
}) {
|
|
271
|
+
const t = e === "forward" ? 1 : -1, n = -J * t, s = J * t;
|
|
272
|
+
return {
|
|
273
|
+
out: {
|
|
274
|
+
willChange: "transform, opacity",
|
|
275
|
+
startStyle: {},
|
|
276
|
+
animate: (o) => ({
|
|
277
|
+
transform: `translate3d(${n * o}px, 0, 0)`,
|
|
278
|
+
opacity: `${1 - o}`
|
|
279
|
+
})
|
|
280
|
+
},
|
|
281
|
+
in: {
|
|
282
|
+
willChange: "transform, opacity",
|
|
283
|
+
startStyle: {
|
|
284
|
+
transform: `translate3d(${s}px, 0, 0)`,
|
|
285
|
+
opacity: "0"
|
|
286
|
+
},
|
|
287
|
+
animate: (o) => ({
|
|
288
|
+
transform: `translate3d(${s * (1 - o)}px, 0, 0)`,
|
|
289
|
+
opacity: `${o}`
|
|
290
|
+
})
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
function Yt() {
|
|
295
|
+
return {
|
|
296
|
+
outPhysics: kt,
|
|
297
|
+
inPhysics: Lt,
|
|
298
|
+
// Phased motion: outgoing falls away first under inertia, then incoming
|
|
299
|
+
// springs in. The fade-through shape comes from the integrator curves
|
|
300
|
+
// plus the sequence handoff, not from FADE_SPLIT inside animate(t).
|
|
301
|
+
composition: { mode: "sequence" },
|
|
302
|
+
build: Ft
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
const Ht = {
|
|
306
|
+
snappy: Ot(),
|
|
307
|
+
fluid: Yt()
|
|
308
|
+
}, Q = {
|
|
309
|
+
spring: { stiffness: 2400, damping: 65, doubleSpring: 0.7 }
|
|
310
|
+
}, O = 8;
|
|
311
|
+
function Mt({ direction: e }) {
|
|
312
|
+
const t = e === "forward" ? -O : O, n = e === "forward" ? O : -O;
|
|
313
|
+
return {
|
|
314
|
+
out: {
|
|
315
|
+
willChange: "transform, opacity",
|
|
316
|
+
startStyle: {},
|
|
317
|
+
animate: (s) => ({
|
|
318
|
+
transform: `translate3d(0, ${t * s}px, 0)`,
|
|
319
|
+
opacity: `${1 - s}`
|
|
320
|
+
})
|
|
321
|
+
},
|
|
322
|
+
in: {
|
|
323
|
+
willChange: "transform, opacity",
|
|
324
|
+
startStyle: {
|
|
325
|
+
transform: `translate3d(0, ${n}px, 0)`,
|
|
326
|
+
opacity: "0"
|
|
327
|
+
},
|
|
328
|
+
animate: (s) => ({
|
|
329
|
+
transform: `translate3d(0, ${n * (1 - s)}px, 0)`,
|
|
330
|
+
opacity: `${s}`
|
|
331
|
+
})
|
|
332
|
+
}
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
function zt() {
|
|
336
|
+
return {
|
|
337
|
+
outPhysics: Q,
|
|
338
|
+
inPhysics: Q,
|
|
339
|
+
composition: { mode: "parallel", startAt: [0, 0.3] },
|
|
340
|
+
build: Mt
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
const R = {
|
|
344
|
+
spring: { stiffness: 280, damping: 30 }
|
|
345
|
+
}, k = 0.05;
|
|
346
|
+
function Ut() {
|
|
347
|
+
return {
|
|
348
|
+
// Outgoing scales up slightly (1 → 1+s) while fading — recedes toward
|
|
349
|
+
// viewer feel, complementing the incoming page rising from below.
|
|
350
|
+
out: {
|
|
351
|
+
willChange: "transform, opacity",
|
|
352
|
+
startStyle: {},
|
|
353
|
+
animate: (e) => ({
|
|
354
|
+
transform: `scale(${1 + e * k})`,
|
|
355
|
+
opacity: `${1 - e}`
|
|
356
|
+
})
|
|
357
|
+
},
|
|
358
|
+
// Incoming rises from below (1-s → 1) with fade in.
|
|
359
|
+
in: {
|
|
360
|
+
willChange: "transform, opacity",
|
|
361
|
+
startStyle: {
|
|
362
|
+
transform: `scale(${1 - k})`,
|
|
363
|
+
opacity: "0"
|
|
364
|
+
},
|
|
365
|
+
animate: (e) => ({
|
|
366
|
+
transform: `scale(${1 - k + e * k})`,
|
|
367
|
+
opacity: `${e}`
|
|
368
|
+
})
|
|
369
|
+
}
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
function Xt() {
|
|
373
|
+
return {
|
|
374
|
+
outPhysics: R,
|
|
375
|
+
inPhysics: R,
|
|
376
|
+
// Both pages share the canvas (in-place scale+fade), so a strict
|
|
377
|
+
// fade-through-with-offset would feel disjointed. Run them together
|
|
378
|
+
// for a cleaner cross-fade.
|
|
379
|
+
composition: { mode: "parallel" },
|
|
380
|
+
build: Ut
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
const Vt = zt(), Bt = Xt(), Nt = {
|
|
384
|
+
x: Ht,
|
|
385
|
+
// y and z don't yet have a `fluid` variant — the lookup falls back to
|
|
386
|
+
// `snappy` if asked for `fluid` on them.
|
|
387
|
+
y: { snappy: Vt },
|
|
388
|
+
z: { snappy: Bt }
|
|
389
|
+
};
|
|
390
|
+
function Wt(e, t) {
|
|
391
|
+
const n = Nt[e];
|
|
392
|
+
return n[t] ?? n.snappy;
|
|
393
|
+
}
|
|
394
|
+
const Zt = "x", qt = "snappy";
|
|
395
|
+
function tt(e, t) {
|
|
396
|
+
e.style.willChange = t.willChange, e.style.backfaceVisibility = "hidden", e.style.contain = "layout paint";
|
|
397
|
+
for (const [n, s] of Object.entries(t.startStyle))
|
|
398
|
+
e.style[n] = s;
|
|
399
|
+
}
|
|
400
|
+
function jt(e) {
|
|
401
|
+
e.style.willChange = "auto", e.style.backfaceVisibility = "", e.style.contain = "", e.style.transform = "", e.style.opacity = "";
|
|
402
|
+
}
|
|
403
|
+
const Gt = (e = {}) => {
|
|
404
|
+
const t = e.direction ?? "forward", n = e.type ?? Zt, s = e.feel ?? qt, o = Wt(n, s), i = o.build({ direction: t });
|
|
405
|
+
return {
|
|
406
|
+
prepare: ({ from: r, to: l }) => (r.then((c) => {
|
|
407
|
+
tt(c, i.out), c.style.pointerEvents = "none";
|
|
408
|
+
}), l.then((c) => {
|
|
409
|
+
tt(c, i.in);
|
|
410
|
+
}), {}),
|
|
411
|
+
animation: ({ from: r, to: l }) => {
|
|
412
|
+
const c = new b({
|
|
413
|
+
element: r,
|
|
414
|
+
integrator: g.from(o.outPhysics),
|
|
415
|
+
style: (p) => i.out.animate(p)
|
|
416
|
+
}), a = new b({
|
|
417
|
+
element: l,
|
|
418
|
+
integrator: g.from(o.inPhysics),
|
|
419
|
+
style: (p) => i.in.animate(p),
|
|
420
|
+
onComplete: () => jt(l)
|
|
421
|
+
});
|
|
422
|
+
return new E([c, a], o.composition);
|
|
423
|
+
}
|
|
424
|
+
};
|
|
425
|
+
};
|
|
426
|
+
function Kt(e, t, n) {
|
|
427
|
+
return e !== "x" || t === "snappy" || n === "snappy" ? "snappy" : "fluid";
|
|
428
|
+
}
|
|
429
|
+
function Cn(e) {
|
|
430
|
+
const { paths: t } = e, n = e.type ?? "x", s = e.variant, o = e.feel, i = Kt(n, s, o);
|
|
431
|
+
return q(
|
|
432
|
+
t,
|
|
433
|
+
{ forward: "forward", backward: "backward" },
|
|
434
|
+
(r) => Gt({ type: n, direction: r, feel: i })
|
|
435
|
+
);
|
|
436
|
+
}
|
|
437
|
+
const Jt = {
|
|
226
438
|
spring: { stiffness: 200, damping: 22 }
|
|
227
|
-
},
|
|
228
|
-
function
|
|
439
|
+
}, Qt = 10, Rt = "horizontal", te = "#000000";
|
|
440
|
+
function et(e, t, n, s, o, i) {
|
|
229
441
|
window.getComputedStyle(e).position === "static" && (e.style.position = "relative");
|
|
230
442
|
const l = document.createElement("div");
|
|
231
443
|
l.style.cssText = `
|
|
@@ -239,19 +451,19 @@ function N(e, t, n, s, o, a) {
|
|
|
239
451
|
overflow: hidden;
|
|
240
452
|
`;
|
|
241
453
|
const c = [];
|
|
242
|
-
for (let
|
|
454
|
+
for (let a = 0; a < t; a++) {
|
|
243
455
|
const p = document.createElement("div");
|
|
244
456
|
if (n === "horizontal") {
|
|
245
457
|
const d = 100 / t;
|
|
246
458
|
p.style.cssText = `
|
|
247
459
|
position: absolute;
|
|
248
|
-
top: ${d *
|
|
460
|
+
top: ${d * a}%;
|
|
249
461
|
left: 0;
|
|
250
462
|
width: 100%;
|
|
251
463
|
height: calc(${d}% + 1px);
|
|
252
464
|
background: ${s};
|
|
253
465
|
transform: scaleX(${o === "hidden" ? 0 : 1});
|
|
254
|
-
transform-origin: ${
|
|
466
|
+
transform-origin: ${i} center;
|
|
255
467
|
will-change: transform;
|
|
256
468
|
`;
|
|
257
469
|
} else {
|
|
@@ -259,12 +471,12 @@ function N(e, t, n, s, o, a) {
|
|
|
259
471
|
p.style.cssText = `
|
|
260
472
|
position: absolute;
|
|
261
473
|
top: 0;
|
|
262
|
-
left: ${d *
|
|
474
|
+
left: ${d * a}%;
|
|
263
475
|
width: calc(${d}% + 1px);
|
|
264
476
|
height: 100%;
|
|
265
477
|
background: ${s};
|
|
266
478
|
transform: scaleY(${o === "hidden" ? 0 : 1});
|
|
267
|
-
transform-origin: ${
|
|
479
|
+
transform-origin: ${i === "left" ? "top" : "bottom"} center;
|
|
268
480
|
will-change: transform;
|
|
269
481
|
`;
|
|
270
482
|
}
|
|
@@ -272,13 +484,13 @@ function N(e, t, n, s, o, a) {
|
|
|
272
484
|
}
|
|
273
485
|
return e.appendChild(l), { container: l, blinds: c };
|
|
274
486
|
}
|
|
275
|
-
const
|
|
276
|
-
const t = e.blindCount ??
|
|
487
|
+
const ee = (e = {}) => {
|
|
488
|
+
const t = e.blindCount ?? Qt, n = e.direction ?? Rt, s = e.blindColor ?? te, o = e.physics ?? Jt;
|
|
277
489
|
return {
|
|
278
|
-
prepare: async ({ from:
|
|
279
|
-
const l = await
|
|
490
|
+
prepare: async ({ from: i, to: r }) => {
|
|
491
|
+
const l = await i, c = await r;
|
|
280
492
|
l.style.zIndex = "1000";
|
|
281
|
-
const
|
|
493
|
+
const a = et(
|
|
282
494
|
l,
|
|
283
495
|
t,
|
|
284
496
|
n,
|
|
@@ -287,7 +499,7 @@ const Dt = (e = {}) => {
|
|
|
287
499
|
"left"
|
|
288
500
|
);
|
|
289
501
|
c.style.position = "relative", c.style.zIndex = "0";
|
|
290
|
-
const p =
|
|
502
|
+
const p = et(
|
|
291
503
|
c,
|
|
292
504
|
t,
|
|
293
505
|
n,
|
|
@@ -296,44 +508,48 @@ const Dt = (e = {}) => {
|
|
|
296
508
|
"right"
|
|
297
509
|
);
|
|
298
510
|
return {
|
|
299
|
-
fromBlinds:
|
|
300
|
-
fromContainer:
|
|
511
|
+
fromBlinds: a.blinds,
|
|
512
|
+
fromContainer: a.container,
|
|
301
513
|
toBlinds: p.blinds,
|
|
302
514
|
toContainer: p.container
|
|
303
515
|
};
|
|
304
516
|
},
|
|
305
|
-
animation: ({ fromBlinds:
|
|
306
|
-
const
|
|
307
|
-
(
|
|
308
|
-
element:
|
|
517
|
+
animation: ({ fromBlinds: i, fromContainer: r, toBlinds: l, toContainer: c }) => {
|
|
518
|
+
const a = i.map(
|
|
519
|
+
(m) => new b({
|
|
520
|
+
element: m,
|
|
309
521
|
integrator: g.from(o),
|
|
310
522
|
style: (f) => ({
|
|
311
523
|
transform: n === "horizontal" ? `scaleX(${f})` : `scaleY(${f})`
|
|
312
524
|
})
|
|
313
525
|
})
|
|
314
526
|
), p = l.map(
|
|
315
|
-
(
|
|
316
|
-
element:
|
|
527
|
+
(m, f) => new b({
|
|
528
|
+
element: m,
|
|
317
529
|
integrator: g.from(o),
|
|
318
|
-
style: (
|
|
530
|
+
style: (h, y) => ({
|
|
319
531
|
transform: n === "horizontal" ? `scaleX(${y})` : `scaleY(${y})`
|
|
320
532
|
}),
|
|
321
533
|
onComplete: f === l.length - 1 ? () => {
|
|
322
|
-
c.remove(),
|
|
534
|
+
c.remove(), r.remove();
|
|
323
535
|
} : void 0
|
|
324
536
|
})
|
|
325
|
-
), d = new
|
|
326
|
-
return new
|
|
537
|
+
), d = new E(a, { mode: "parallel" }), u = new E(p, { mode: "parallel" });
|
|
538
|
+
return new E([d, u], { mode: "sequence" });
|
|
327
539
|
}
|
|
328
540
|
};
|
|
329
541
|
};
|
|
330
|
-
function
|
|
331
|
-
|
|
542
|
+
function Pn(e) {
|
|
543
|
+
const { paths: t, type: n = "horizontal" } = e;
|
|
544
|
+
return P(
|
|
545
|
+
t,
|
|
546
|
+
() => ee({ direction: n })
|
|
547
|
+
);
|
|
332
548
|
}
|
|
333
|
-
const
|
|
549
|
+
const ne = {
|
|
334
550
|
spring: { stiffness: 200, damping: 20, doubleSpring: 0.7 }
|
|
335
|
-
},
|
|
336
|
-
function
|
|
551
|
+
}, D = 0.5;
|
|
552
|
+
function se(e) {
|
|
337
553
|
const t = e === "enter" ? -100 : 100, n = e === "enter" ? 100 : -100;
|
|
338
554
|
return {
|
|
339
555
|
out: {
|
|
@@ -341,32 +557,32 @@ function It(e) {
|
|
|
341
557
|
startStyle: {},
|
|
342
558
|
animate: (s) => ({
|
|
343
559
|
transform: `translate3d(${t * s}%, 0, 0)`,
|
|
344
|
-
opacity: `${
|
|
560
|
+
opacity: `${D + (1 - D) * (1 - s)}`
|
|
345
561
|
})
|
|
346
562
|
},
|
|
347
563
|
in: {
|
|
348
564
|
willChange: "transform, opacity",
|
|
349
565
|
startStyle: {
|
|
350
566
|
transform: `translate3d(${n}%, 0, 0)`,
|
|
351
|
-
opacity: `${
|
|
567
|
+
opacity: `${D}`
|
|
352
568
|
},
|
|
353
569
|
animate: (s) => ({
|
|
354
570
|
transform: `translate3d(${n * (1 - s)}%, 0, 0)`,
|
|
355
|
-
opacity: `${
|
|
571
|
+
opacity: `${D + (1 - D) * s}`
|
|
356
572
|
})
|
|
357
573
|
}
|
|
358
574
|
};
|
|
359
575
|
}
|
|
360
|
-
function
|
|
576
|
+
function oe() {
|
|
361
577
|
return {
|
|
362
|
-
physics:
|
|
363
|
-
build:
|
|
578
|
+
physics: ne,
|
|
579
|
+
build: se
|
|
364
580
|
};
|
|
365
581
|
}
|
|
366
|
-
const
|
|
582
|
+
const re = {
|
|
367
583
|
spring: { stiffness: 170, damping: 22 }
|
|
368
584
|
};
|
|
369
|
-
function
|
|
585
|
+
function ie(e) {
|
|
370
586
|
const t = e === "enter" ? -20 : 100, n = e === "enter" ? 100 : -20;
|
|
371
587
|
return {
|
|
372
588
|
out: {
|
|
@@ -387,64 +603,68 @@ function _t(e) {
|
|
|
387
603
|
}
|
|
388
604
|
};
|
|
389
605
|
}
|
|
390
|
-
function
|
|
606
|
+
function ae() {
|
|
391
607
|
return {
|
|
392
|
-
physics:
|
|
393
|
-
build:
|
|
608
|
+
physics: re,
|
|
609
|
+
build: ie
|
|
394
610
|
};
|
|
395
611
|
}
|
|
396
|
-
const
|
|
397
|
-
parallax:
|
|
398
|
-
crossfade:
|
|
399
|
-
},
|
|
400
|
-
function
|
|
612
|
+
const le = {
|
|
613
|
+
parallax: ae(),
|
|
614
|
+
crossfade: oe()
|
|
615
|
+
}, ce = "parallax";
|
|
616
|
+
function nt(e, t) {
|
|
401
617
|
e.style.willChange = t.willChange, e.style.backfaceVisibility = "hidden", e.style.contain = "layout paint";
|
|
402
618
|
for (const [n, s] of Object.entries(t.startStyle))
|
|
403
619
|
e.style[n] = s;
|
|
404
620
|
}
|
|
405
|
-
const
|
|
406
|
-
const t = e.direction ?? "enter", n =
|
|
621
|
+
const pe = (e = {}) => {
|
|
622
|
+
const t = e.direction ?? "enter", n = le[e.type ?? ce], s = n.physics, o = n.build(t);
|
|
407
623
|
return {
|
|
408
|
-
prepare: ({ from:
|
|
409
|
-
|
|
410
|
-
}),
|
|
411
|
-
|
|
624
|
+
prepare: ({ from: i, to: r }) => (i.then((l) => {
|
|
625
|
+
nt(l, o.out), l.style.pointerEvents = "none", l.style.zIndex = t === "enter" ? "-1" : "100";
|
|
626
|
+
}), r.then((l) => {
|
|
627
|
+
nt(l, o.in);
|
|
412
628
|
}), {}),
|
|
413
|
-
animation: ({ from:
|
|
414
|
-
const l = new
|
|
415
|
-
element: a,
|
|
416
|
-
integrator: g.from(s),
|
|
417
|
-
style: (r) => o.out.animate(r)
|
|
418
|
-
}), c = new w({
|
|
629
|
+
animation: ({ from: i, to: r }) => {
|
|
630
|
+
const l = new b({
|
|
419
631
|
element: i,
|
|
420
632
|
integrator: g.from(s),
|
|
421
|
-
style: (
|
|
633
|
+
style: (a) => o.out.animate(a)
|
|
634
|
+
}), c = new b({
|
|
635
|
+
element: r,
|
|
636
|
+
integrator: g.from(s),
|
|
637
|
+
style: (a) => o.in.animate(a),
|
|
422
638
|
onComplete: () => {
|
|
423
|
-
|
|
639
|
+
r.style.willChange = "auto", r.style.backfaceVisibility = "", r.style.contain = "", r.style.transform = "", r.style.opacity = "";
|
|
424
640
|
}
|
|
425
641
|
});
|
|
426
|
-
return new
|
|
642
|
+
return new E([l, c], { mode: "parallel" });
|
|
427
643
|
}
|
|
428
644
|
};
|
|
429
645
|
};
|
|
430
|
-
function
|
|
431
|
-
return
|
|
432
|
-
|
|
433
|
-
|
|
646
|
+
function de(e) {
|
|
647
|
+
return e === "slide" || e === "crossfade" ? "crossfade" : "parallax";
|
|
648
|
+
}
|
|
649
|
+
function vn(e) {
|
|
650
|
+
const { enter: t, exit: n } = e, s = e.type, o = de(s);
|
|
651
|
+
return ht(
|
|
652
|
+
{ enter: t, exit: n },
|
|
653
|
+
(i) => pe({ direction: i, type: o })
|
|
434
654
|
);
|
|
435
655
|
}
|
|
436
|
-
const
|
|
656
|
+
const fe = {
|
|
437
657
|
spring: { stiffness: 180, damping: 20, doubleSpring: !0 }
|
|
438
|
-
},
|
|
658
|
+
}, he = {
|
|
439
659
|
spring: { stiffness: 170, damping: 20, doubleSpring: !0 }
|
|
440
|
-
},
|
|
441
|
-
const t = e.physics ??
|
|
660
|
+
}, ue = (e = {}) => {
|
|
661
|
+
const t = e.physics ?? he, n = e.physics ?? fe;
|
|
442
662
|
return {
|
|
443
663
|
prepare: ({ to: s }) => (s.then((o) => {
|
|
444
664
|
o.style.opacity = "0", o.style.willChange = "opacity";
|
|
445
665
|
}), {}),
|
|
446
666
|
animation: ({ from: s, to: o }) => {
|
|
447
|
-
const
|
|
667
|
+
const i = new b({
|
|
448
668
|
element: s,
|
|
449
669
|
integrator: g.from(n),
|
|
450
670
|
// Default bounds (0, 1). `u` runs 1→0 as the animation moves
|
|
@@ -453,7 +673,7 @@ const Ft = {
|
|
|
453
673
|
onComplete: () => {
|
|
454
674
|
s.style.willChange = "auto";
|
|
455
675
|
}
|
|
456
|
-
}),
|
|
676
|
+
}), r = new b({
|
|
457
677
|
element: o,
|
|
458
678
|
integrator: g.from(t),
|
|
459
679
|
style: (l) => ({ opacity: l }),
|
|
@@ -461,21 +681,22 @@ const Ft = {
|
|
|
461
681
|
o.style.willChange = "auto", o.style.opacity = "";
|
|
462
682
|
}
|
|
463
683
|
});
|
|
464
|
-
return new
|
|
684
|
+
return new E([i, r], { mode: "sequence" });
|
|
465
685
|
}
|
|
466
686
|
};
|
|
467
687
|
};
|
|
468
|
-
function
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
688
|
+
function Tn(e) {
|
|
689
|
+
const { paths: t } = e;
|
|
690
|
+
return P(t, () => ue());
|
|
691
|
+
}
|
|
692
|
+
function T(e, t) {
|
|
693
|
+
function n(i) {
|
|
694
|
+
let r = 0, l = 0;
|
|
695
|
+
const c = i.offsetWidth, a = i.offsetHeight;
|
|
696
|
+
let p = i;
|
|
476
697
|
for (; p; )
|
|
477
|
-
|
|
478
|
-
return
|
|
698
|
+
r += p.offsetTop, l += p.offsetLeft, p = p.offsetParent;
|
|
699
|
+
return r -= window.scrollY, l -= window.scrollX, { top: r, left: l, width: c, height: a };
|
|
479
700
|
}
|
|
480
701
|
const s = n(e), o = n(t);
|
|
481
702
|
return new DOMRect(
|
|
@@ -485,8 +706,8 @@ function O(e, t) {
|
|
|
485
706
|
o.height
|
|
486
707
|
);
|
|
487
708
|
}
|
|
488
|
-
function
|
|
489
|
-
const { scrollingElement: n, positionedParent: s } = e, o = n !== s && n.contains(s) ?
|
|
709
|
+
function _(e, t) {
|
|
710
|
+
const { scrollingElement: n, positionedParent: s } = e, o = n !== s && n.contains(s) ? T(n, s).top : 0;
|
|
490
711
|
return {
|
|
491
712
|
top: e[t].scroll.y,
|
|
492
713
|
left: 0,
|
|
@@ -494,134 +715,134 @@ function T(e, t) {
|
|
|
494
715
|
height: n.clientHeight - o
|
|
495
716
|
};
|
|
496
717
|
}
|
|
497
|
-
const
|
|
718
|
+
const z = {
|
|
498
719
|
scaleDown: { stiffness: 20, damping: 7 },
|
|
499
720
|
translate: { stiffness: 15, damping: 7 },
|
|
500
721
|
scaleUp: { stiffness: 20, damping: 7 }
|
|
501
|
-
},
|
|
722
|
+
}, v = {
|
|
502
723
|
scaleDown: 0,
|
|
503
724
|
translate: 0.2,
|
|
504
725
|
scaleUp: 0.8
|
|
505
|
-
},
|
|
506
|
-
function
|
|
507
|
-
const { items: t, from: n, to: s, recordFrame: o } = e,
|
|
508
|
-
item:
|
|
509
|
-
integrator: new
|
|
510
|
-
stiffness:
|
|
511
|
-
damping:
|
|
726
|
+
}, me = 0.8, ye = "white", st = 1e3 / 60, ge = 600;
|
|
727
|
+
function be(e) {
|
|
728
|
+
const { items: t, from: n, to: s, recordFrame: o } = e, i = st / 1e3, r = Math.abs(s - n), l = t.map((a) => ({
|
|
729
|
+
item: a,
|
|
730
|
+
integrator: new F({
|
|
731
|
+
stiffness: a.spring.stiffness,
|
|
732
|
+
damping: a.spring.damping
|
|
512
733
|
}),
|
|
513
734
|
state: { position: n, velocity: 0 },
|
|
514
735
|
started: !1,
|
|
515
736
|
settled: !1,
|
|
516
737
|
settleTime: 0
|
|
517
738
|
}));
|
|
518
|
-
for (let
|
|
519
|
-
(
|
|
739
|
+
for (let a = 0; a < l.length; a++)
|
|
740
|
+
(a === 0 || l[a].item.offset === 0) && (l[a].started = !0);
|
|
520
741
|
o(0);
|
|
521
742
|
let c = 0;
|
|
522
|
-
for (let
|
|
523
|
-
const p =
|
|
743
|
+
for (let a = 1; a <= ge; a++) {
|
|
744
|
+
const p = a * st;
|
|
524
745
|
c = p;
|
|
525
746
|
for (const d of l)
|
|
526
|
-
!d.started || d.settled || (d.state = d.integrator.step(d.state, s,
|
|
747
|
+
!d.started || d.settled || (d.state = d.integrator.step(d.state, s, i), d.integrator.isSettled(d.state, s) ? (d.settleTime += i, d.settleTime >= Ct && (d.state = { position: s, velocity: 0 }, d.settled = !0)) : d.settleTime = 0, d.item.tick(d.state.position));
|
|
527
748
|
for (let d = 1; d < l.length; d++) {
|
|
528
|
-
const
|
|
529
|
-
if (
|
|
530
|
-
const
|
|
531
|
-
if (!
|
|
532
|
-
(
|
|
749
|
+
const u = l[d];
|
|
750
|
+
if (u.started) continue;
|
|
751
|
+
const m = l[d - 1];
|
|
752
|
+
if (!m.started) continue;
|
|
753
|
+
(r === 0 ? 1 : Math.abs(m.state.position - n) / r) >= u.item.offset && (u.started = !0);
|
|
533
754
|
}
|
|
534
755
|
if (o(p), l.every((d) => d.settled)) return p;
|
|
535
756
|
}
|
|
536
757
|
return c;
|
|
537
758
|
}
|
|
538
|
-
function
|
|
759
|
+
function U(e, t) {
|
|
539
760
|
return e != null && e.spring ? {
|
|
540
761
|
stiffness: e.spring.stiffness,
|
|
541
762
|
damping: e.spring.damping
|
|
542
763
|
} : t;
|
|
543
764
|
}
|
|
544
|
-
function
|
|
545
|
-
const { rect: t, scale: n, direction: s, override: o } = e,
|
|
765
|
+
function ot(e) {
|
|
766
|
+
const { rect: t, scale: n, direction: s, override: o } = e, i = s === "out" ? { scale: 1, translateY: -t.top } : { scale: n, translateY: -t.top + t.height }, r = U(o, z.scaleDown), l = U(o, z.translate), c = U(o, z.scaleUp), a = s === "out" ? 1 : 0, p = s === "out" ? 0 : 1, d = s === "out" ? [
|
|
546
767
|
{
|
|
547
|
-
spring:
|
|
548
|
-
offset:
|
|
768
|
+
spring: r,
|
|
769
|
+
offset: v.scaleDown,
|
|
549
770
|
tick: (f) => {
|
|
550
|
-
const
|
|
551
|
-
|
|
771
|
+
const h = 1 - f;
|
|
772
|
+
i.scale = 1 - (1 - n) * h;
|
|
552
773
|
}
|
|
553
774
|
},
|
|
554
775
|
{
|
|
555
776
|
spring: l,
|
|
556
|
-
offset:
|
|
777
|
+
offset: v.translate,
|
|
557
778
|
tick: (f) => {
|
|
558
|
-
const
|
|
559
|
-
|
|
779
|
+
const h = 1 - f;
|
|
780
|
+
i.translateY = -t.top - t.height * h;
|
|
560
781
|
}
|
|
561
782
|
},
|
|
562
783
|
{
|
|
563
784
|
spring: c,
|
|
564
|
-
offset:
|
|
785
|
+
offset: v.scaleUp,
|
|
565
786
|
tick: (f) => {
|
|
566
|
-
const
|
|
567
|
-
|
|
787
|
+
const h = 1 - f;
|
|
788
|
+
i.scale = n + (1 - n) * h;
|
|
568
789
|
}
|
|
569
790
|
}
|
|
570
791
|
] : [
|
|
571
792
|
{
|
|
572
|
-
spring:
|
|
573
|
-
offset:
|
|
793
|
+
spring: r,
|
|
794
|
+
offset: v.scaleDown,
|
|
574
795
|
tick: (f) => {
|
|
575
|
-
|
|
796
|
+
i.scale = 1 - (1 - n) * f;
|
|
576
797
|
}
|
|
577
798
|
},
|
|
578
799
|
{
|
|
579
800
|
spring: l,
|
|
580
|
-
offset:
|
|
801
|
+
offset: v.translate,
|
|
581
802
|
tick: (f) => {
|
|
582
|
-
|
|
803
|
+
i.translateY = -t.top + t.height * (1 - f);
|
|
583
804
|
}
|
|
584
805
|
},
|
|
585
806
|
{
|
|
586
807
|
spring: c,
|
|
587
|
-
offset:
|
|
808
|
+
offset: v.scaleUp,
|
|
588
809
|
tick: (f) => {
|
|
589
|
-
|
|
810
|
+
i.scale = n + (1 - n) * f;
|
|
590
811
|
}
|
|
591
812
|
}
|
|
592
|
-
],
|
|
813
|
+
], u = [], m = be({
|
|
593
814
|
items: d,
|
|
594
|
-
from:
|
|
815
|
+
from: a,
|
|
595
816
|
to: p,
|
|
596
|
-
recordFrame: (f) =>
|
|
817
|
+
recordFrame: (f) => u.push({
|
|
597
818
|
time: f,
|
|
598
|
-
scale:
|
|
599
|
-
translateY:
|
|
819
|
+
scale: i.scale,
|
|
820
|
+
translateY: i.translateY
|
|
600
821
|
})
|
|
601
822
|
});
|
|
602
|
-
return { snapshots:
|
|
823
|
+
return { snapshots: u, totalDuration: m };
|
|
603
824
|
}
|
|
604
|
-
function
|
|
825
|
+
function we(e, t) {
|
|
605
826
|
if (e.length === 0) return { time: 0, scale: 1, translateY: 0 };
|
|
606
827
|
if (e.length === 1 || t <= 0) return e[0];
|
|
607
828
|
if (t >= 1) return e[e.length - 1];
|
|
608
829
|
const n = t * (e.length - 1), s = Math.floor(n), o = Math.ceil(n);
|
|
609
830
|
if (s === o) return e[s];
|
|
610
|
-
const
|
|
831
|
+
const i = e[s], r = e[o], l = n - s;
|
|
611
832
|
return {
|
|
612
|
-
time:
|
|
613
|
-
scale:
|
|
614
|
-
translateY:
|
|
833
|
+
time: i.time + (r.time - i.time) * l,
|
|
834
|
+
scale: i.scale + (r.scale - i.scale) * l,
|
|
835
|
+
translateY: i.translateY + (r.translateY - i.translateY) * l
|
|
615
836
|
};
|
|
616
837
|
}
|
|
617
|
-
const
|
|
838
|
+
const Se = [
|
|
618
839
|
[1, 1],
|
|
619
840
|
[-1, 1],
|
|
620
841
|
[1, -1],
|
|
621
842
|
[-1, -1]
|
|
622
843
|
];
|
|
623
|
-
function
|
|
624
|
-
const o = (
|
|
844
|
+
function $e(e, t) {
|
|
845
|
+
const o = (i, r, l) => {
|
|
625
846
|
const c = document.createElement("div");
|
|
626
847
|
Object.assign(c.style, {
|
|
627
848
|
position: "fixed",
|
|
@@ -629,16 +850,16 @@ function Nt(e, t) {
|
|
|
629
850
|
zIndex: "9999",
|
|
630
851
|
width: "15px",
|
|
631
852
|
height: "15px",
|
|
632
|
-
...
|
|
853
|
+
...i
|
|
633
854
|
});
|
|
634
|
-
const
|
|
635
|
-
Object.assign(
|
|
855
|
+
const a = document.createElement("div");
|
|
856
|
+
Object.assign(a.style, {
|
|
636
857
|
position: "absolute",
|
|
637
858
|
width: "15px",
|
|
638
859
|
height: "1px",
|
|
639
860
|
backgroundColor: e,
|
|
640
861
|
[l]: "0",
|
|
641
|
-
[
|
|
862
|
+
[r]: "0"
|
|
642
863
|
});
|
|
643
864
|
const p = document.createElement("div");
|
|
644
865
|
return Object.assign(p.style, {
|
|
@@ -647,8 +868,8 @@ function Nt(e, t) {
|
|
|
647
868
|
height: "15px",
|
|
648
869
|
backgroundColor: e,
|
|
649
870
|
[l]: "0",
|
|
650
|
-
[
|
|
651
|
-
}), c.appendChild(
|
|
871
|
+
[r]: "0"
|
|
872
|
+
}), c.appendChild(a), c.appendChild(p), c;
|
|
652
873
|
};
|
|
653
874
|
return {
|
|
654
875
|
topLeft: o(
|
|
@@ -685,11 +906,11 @@ function Nt(e, t) {
|
|
|
685
906
|
)
|
|
686
907
|
};
|
|
687
908
|
}
|
|
688
|
-
function
|
|
909
|
+
function rt(e, t) {
|
|
689
910
|
const n = t.left + t.width / 2, s = t.top + t.height / 2;
|
|
690
911
|
e.style.transformOrigin = `${n}px ${s}px`;
|
|
691
912
|
}
|
|
692
|
-
function
|
|
913
|
+
function it(e, t) {
|
|
693
914
|
e.style.clipPath = `polygon(
|
|
694
915
|
${t.left}px ${t.top}px,
|
|
695
916
|
${t.left + t.width}px ${t.top}px,
|
|
@@ -697,229 +918,232 @@ function K(e, t) {
|
|
|
697
918
|
${t.left}px ${t.top + t.height}px
|
|
698
919
|
)`;
|
|
699
920
|
}
|
|
700
|
-
function
|
|
701
|
-
const
|
|
702
|
-
return new
|
|
921
|
+
function X(e, t, n, s, o) {
|
|
922
|
+
const i = n / 1e3;
|
|
923
|
+
return new b({
|
|
703
924
|
element: e,
|
|
704
|
-
integrator: new
|
|
925
|
+
integrator: new At({ durationSec: i }),
|
|
705
926
|
lowerBound: 0,
|
|
706
927
|
upperBound: 1,
|
|
707
|
-
style: (
|
|
928
|
+
style: (r) => s(we(t, r)),
|
|
708
929
|
onComplete: o
|
|
709
930
|
});
|
|
710
931
|
}
|
|
711
|
-
const
|
|
932
|
+
const xe = (e = {}) => {
|
|
712
933
|
var o;
|
|
713
|
-
const t = ((o = e.border) == null ? void 0 : o.color) ??
|
|
934
|
+
const t = ((o = e.border) == null ? void 0 : o.color) ?? ye, n = me, s = e.physics;
|
|
714
935
|
return {
|
|
715
|
-
prepare: ({ from:
|
|
716
|
-
const c =
|
|
936
|
+
prepare: ({ from: i, to: r, context: l }) => {
|
|
937
|
+
const c = _(l, "from"), a = _(l, "to"), p = T(document.body, l.positionedParent), d = $e(t, {
|
|
717
938
|
...c,
|
|
718
939
|
top: p.top
|
|
719
940
|
});
|
|
720
|
-
for (const
|
|
941
|
+
for (const u of [
|
|
721
942
|
"topLeft",
|
|
722
943
|
"topRight",
|
|
723
944
|
"bottomLeft",
|
|
724
945
|
"bottomRight"
|
|
725
946
|
])
|
|
726
|
-
l.positionedParent.appendChild(d[
|
|
727
|
-
return
|
|
728
|
-
|
|
729
|
-
}),
|
|
730
|
-
|
|
731
|
-
}), { borders: d, fromRect: c, toRect:
|
|
947
|
+
l.positionedParent.appendChild(d[u]);
|
|
948
|
+
return i.then((u) => {
|
|
949
|
+
rt(u, c), it(u, c), u.style.transform = `translateY(${-c.top}px)`;
|
|
950
|
+
}), r.then((u) => {
|
|
951
|
+
rt(u, a), it(u, a), u.style.transform = `translateY(${-a.top + a.height}px) scale(${n})`;
|
|
952
|
+
}), { borders: d, fromRect: c, toRect: a };
|
|
732
953
|
},
|
|
733
|
-
animation: ({ from:
|
|
734
|
-
const d =
|
|
735
|
-
rect:
|
|
954
|
+
animation: ({ from: i, to: r, context: l, borders: c, fromRect: a, toRect: p }) => {
|
|
955
|
+
const d = ot({
|
|
956
|
+
rect: a,
|
|
736
957
|
scale: n,
|
|
737
958
|
direction: "out",
|
|
738
959
|
override: s
|
|
739
|
-
}),
|
|
960
|
+
}), u = ot({
|
|
740
961
|
rect: p,
|
|
741
962
|
scale: n,
|
|
742
963
|
direction: "in",
|
|
743
964
|
override: s
|
|
744
|
-
}),
|
|
745
|
-
|
|
965
|
+
}), m = X(
|
|
966
|
+
i,
|
|
746
967
|
d.snapshots,
|
|
747
968
|
d.totalDuration,
|
|
748
|
-
(
|
|
749
|
-
transform: `translateY(${
|
|
969
|
+
(S) => ({
|
|
970
|
+
transform: `translateY(${S.translateY}px) scale(${S.scale})`
|
|
750
971
|
}),
|
|
751
972
|
() => {
|
|
752
|
-
|
|
973
|
+
i.style.clipPath = "", i.style.transformOrigin = "";
|
|
753
974
|
}
|
|
754
|
-
), f =
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
(
|
|
759
|
-
transform: `translateY(${
|
|
975
|
+
), f = X(
|
|
976
|
+
r,
|
|
977
|
+
u.snapshots,
|
|
978
|
+
u.totalDuration,
|
|
979
|
+
(S) => ({
|
|
980
|
+
transform: `translateY(${S.translateY}px) scale(${S.scale})`
|
|
760
981
|
}),
|
|
761
982
|
() => {
|
|
762
|
-
|
|
983
|
+
r.style.clipPath = "", r.style.transformOrigin = "", r.style.transform = "";
|
|
763
984
|
}
|
|
764
|
-
),
|
|
765
|
-
const
|
|
766
|
-
return
|
|
767
|
-
c[
|
|
985
|
+
), h = Se.map(([S, x], C) => {
|
|
986
|
+
const Y = ["topLeft", "topRight", "bottomLeft", "bottomRight"][C];
|
|
987
|
+
return X(
|
|
988
|
+
c[Y],
|
|
768
989
|
d.snapshots,
|
|
769
990
|
d.totalDuration,
|
|
770
991
|
(A) => {
|
|
771
|
-
const
|
|
772
|
-
return { transform: `translate(${
|
|
992
|
+
const H = (a.width - a.width * A.scale) / 2 * 0.7 * S, M = (a.height - a.height * A.scale) / 2 * 0.7 * x;
|
|
993
|
+
return { transform: `translate(${H}px, ${M}px)` };
|
|
773
994
|
}
|
|
774
995
|
);
|
|
775
|
-
}), y = new
|
|
996
|
+
}), y = new E([m, f, ...h], {
|
|
776
997
|
mode: "parallel"
|
|
777
|
-
}),
|
|
998
|
+
}), w = y.onComplete;
|
|
778
999
|
return y.onComplete = () => {
|
|
779
|
-
|
|
780
|
-
const
|
|
781
|
-
for (const
|
|
1000
|
+
w == null || w();
|
|
1001
|
+
const S = l.positionedParent;
|
|
1002
|
+
for (const x of [
|
|
782
1003
|
"topLeft",
|
|
783
1004
|
"topRight",
|
|
784
1005
|
"bottomLeft",
|
|
785
1006
|
"bottomRight"
|
|
786
1007
|
]) {
|
|
787
|
-
const
|
|
788
|
-
|
|
1008
|
+
const C = c[x];
|
|
1009
|
+
C.parentElement === S && S.removeChild(C);
|
|
789
1010
|
}
|
|
790
1011
|
}, y;
|
|
791
1012
|
}
|
|
792
1013
|
};
|
|
793
1014
|
};
|
|
794
|
-
function
|
|
795
|
-
|
|
1015
|
+
function Dn(e) {
|
|
1016
|
+
const { paths: t, options: n } = e, s = (n == null ? void 0 : n.borderColor) !== void 0 ? { border: { color: n.borderColor } } : void 0;
|
|
1017
|
+
return P(t, () => xe(s));
|
|
796
1018
|
}
|
|
797
|
-
const
|
|
1019
|
+
const Ee = {
|
|
798
1020
|
spring: { stiffness: 300, damping: 30 }
|
|
799
1021
|
};
|
|
800
|
-
function
|
|
1022
|
+
function Ce(e, t) {
|
|
801
1023
|
return e.querySelector(`[data-hero-key="${t}"]`);
|
|
802
1024
|
}
|
|
803
|
-
const
|
|
804
|
-
const t = e.physics ??
|
|
1025
|
+
const Pe = (e = {}) => {
|
|
1026
|
+
const t = e.physics ?? Ee, n = e.maxDistance ?? 700;
|
|
805
1027
|
return {
|
|
806
1028
|
prepare: ({ from: s }) => (s.then((o) => {
|
|
807
1029
|
o.style.opacity = "0";
|
|
808
1030
|
}), {}),
|
|
809
|
-
animation: ({ from: s, to: o, context:
|
|
810
|
-
const
|
|
1031
|
+
animation: ({ from: s, to: o, context: i }) => {
|
|
1032
|
+
const r = s, l = o, c = Array.from(
|
|
811
1033
|
l.querySelectorAll("[data-hero-key]")
|
|
812
|
-
),
|
|
1034
|
+
), a = [];
|
|
813
1035
|
for (const f of c) {
|
|
814
|
-
const
|
|
815
|
-
if (!
|
|
816
|
-
const y =
|
|
817
|
-
y &&
|
|
1036
|
+
const h = f.getAttribute("data-hero-key");
|
|
1037
|
+
if (!h) continue;
|
|
1038
|
+
const y = Ce(r, h);
|
|
1039
|
+
y && a.push({ key: h, fromEl: y, toEl: f });
|
|
818
1040
|
}
|
|
819
|
-
if (
|
|
820
|
-
return new
|
|
1041
|
+
if (a.length === 0)
|
|
1042
|
+
return new E([], { mode: "parallel" });
|
|
821
1043
|
const p = [], d = [];
|
|
822
|
-
for (const { fromEl: f, toEl:
|
|
823
|
-
const y =
|
|
824
|
-
if (Math.abs(
|
|
825
|
-
const A =
|
|
826
|
-
|
|
827
|
-
new
|
|
828
|
-
element:
|
|
1044
|
+
for (const { fromEl: f, toEl: h } of a) {
|
|
1045
|
+
const y = T(r, f), w = T(l, h), S = y.left - w.left - i.scrollOffset.x, x = y.top - w.top - i.scrollOffset.y, C = y.width / w.width, Y = y.height / w.height;
|
|
1046
|
+
if (Math.abs(x) > n) continue;
|
|
1047
|
+
const A = h.style.transform, H = h.style.position, M = h.style.transformOrigin, yt = h.style.zIndex, gt = h.style.willChange;
|
|
1048
|
+
h.style.position = "relative", h.style.transformOrigin = "top left", h.style.zIndex = "1000", h.style.willChange = "transform", p.push(
|
|
1049
|
+
new b({
|
|
1050
|
+
element: h,
|
|
829
1051
|
integrator: g.from(t),
|
|
830
|
-
style: (
|
|
831
|
-
const
|
|
1052
|
+
style: (j, I) => {
|
|
1053
|
+
const bt = I * S, wt = I * x, St = j + I * C, $t = j + I * Y;
|
|
832
1054
|
return {
|
|
833
|
-
transform: `translate(${
|
|
1055
|
+
transform: `translate(${bt}px, ${wt}px) scale(${St}, ${$t})`
|
|
834
1056
|
};
|
|
835
1057
|
}
|
|
836
1058
|
})
|
|
837
1059
|
), d.push(() => {
|
|
838
|
-
|
|
1060
|
+
h.style.transform = A, h.style.position = H, h.style.transformOrigin = M, h.style.zIndex = yt, h.style.willChange = gt;
|
|
839
1061
|
});
|
|
840
1062
|
}
|
|
841
|
-
const
|
|
1063
|
+
const u = new E(p, {
|
|
842
1064
|
mode: "parallel"
|
|
843
|
-
}),
|
|
844
|
-
return
|
|
1065
|
+
}), m = u.onComplete;
|
|
1066
|
+
return u.onComplete = () => {
|
|
845
1067
|
for (const f of d) f();
|
|
846
|
-
|
|
847
|
-
},
|
|
1068
|
+
m == null || m();
|
|
1069
|
+
}, u;
|
|
848
1070
|
}
|
|
849
1071
|
};
|
|
850
1072
|
};
|
|
851
|
-
function
|
|
852
|
-
|
|
1073
|
+
function _n(e) {
|
|
1074
|
+
const { paths: t } = e;
|
|
1075
|
+
return P(t, () => Pe());
|
|
853
1076
|
}
|
|
854
|
-
const
|
|
1077
|
+
const ve = {
|
|
855
1078
|
spring: { stiffness: 50, damping: 30 }
|
|
856
|
-
},
|
|
1079
|
+
}, Te = {
|
|
857
1080
|
spring: { stiffness: 80, damping: 25 }
|
|
858
|
-
},
|
|
859
|
-
const t = e.physics ??
|
|
1081
|
+
}, De = (e = {}) => {
|
|
1082
|
+
const t = e.physics ?? ve, n = e.initialRotation ?? 45, s = e.initialScale ?? 0.01, o = e.rotationTriggerPoint ?? 0.8;
|
|
860
1083
|
return {
|
|
861
|
-
prepare: ({ from:
|
|
1084
|
+
prepare: ({ from: i, to: r, context: l }) => (i.then((c) => {
|
|
862
1085
|
c.style.opacity = "1";
|
|
863
|
-
}),
|
|
864
|
-
const
|
|
1086
|
+
}), r.then((c) => {
|
|
1087
|
+
const a = _(l, "to"), p = Math.min(a.width, a.height) * 0.4;
|
|
865
1088
|
c.style.setProperty("--max-border-radius", `${p}px`), c.style.setProperty("--border-radius-scale", "1"), c.style.willChange = "transform", c.style.backfaceVisibility = "hidden";
|
|
866
|
-
const d =
|
|
867
|
-
c.style.transformOrigin = `${d}px ${
|
|
1089
|
+
const d = a.left + a.width / 2, u = a.top + a.height / 2;
|
|
1090
|
+
c.style.transformOrigin = `${d}px ${u}px`, c.style.position = "fixed", c.style.top = `${a.top}px`, c.style.left = `${a.left}px`, c.style.width = `${a.width}px`, c.style.height = `${a.height}px`, c.style.zIndex = "1000", c.style.overflow = "hidden", c.style.transform = `rotate(${n}deg) scale(${s}) translateZ(0)`, c.style.borderRadius = "calc(var(--max-border-radius) * var(--border-radius-scale))", c.style.opacity = "1";
|
|
868
1091
|
}), {}),
|
|
869
|
-
animation: ({ from:
|
|
870
|
-
const l = new
|
|
871
|
-
element: a,
|
|
872
|
-
integrator: g.from(Jt),
|
|
873
|
-
style: (r, p) => ({ opacity: p })
|
|
874
|
-
}), c = new w({
|
|
1092
|
+
animation: ({ from: i, to: r }) => {
|
|
1093
|
+
const l = new b({
|
|
875
1094
|
element: i,
|
|
1095
|
+
integrator: g.from(Te),
|
|
1096
|
+
style: (a, p) => ({ opacity: p })
|
|
1097
|
+
}), c = new b({
|
|
1098
|
+
element: r,
|
|
876
1099
|
integrator: g.from(t),
|
|
877
|
-
style: (
|
|
1100
|
+
style: (a) => {
|
|
878
1101
|
let p;
|
|
879
|
-
if (
|
|
1102
|
+
if (a <= 0.05)
|
|
880
1103
|
p = s;
|
|
881
|
-
else if (
|
|
882
|
-
const f = (
|
|
883
|
-
p = s + (0.8 - s) *
|
|
1104
|
+
else if (a <= o) {
|
|
1105
|
+
const f = (a - 0.05) / (o - 0.05), h = Math.pow(f, 9);
|
|
1106
|
+
p = s + (0.8 - s) * h;
|
|
884
1107
|
} else {
|
|
885
|
-
const f = (
|
|
1108
|
+
const f = (a - o) / (1 - o);
|
|
886
1109
|
p = 0.8 + 0.2 * (1 - Math.pow(1 - f, 3));
|
|
887
1110
|
}
|
|
888
1111
|
const d = 0.7;
|
|
889
|
-
let
|
|
890
|
-
if (
|
|
891
|
-
|
|
1112
|
+
let u;
|
|
1113
|
+
if (a <= d)
|
|
1114
|
+
u = n;
|
|
892
1115
|
else {
|
|
893
|
-
const f = (
|
|
894
|
-
|
|
1116
|
+
const f = (a - d) / (1 - d), h = 1 - Math.pow(1 - f, 2);
|
|
1117
|
+
u = n * (1 - h);
|
|
895
1118
|
}
|
|
896
|
-
let
|
|
897
|
-
if (
|
|
898
|
-
|
|
1119
|
+
let m;
|
|
1120
|
+
if (a <= d)
|
|
1121
|
+
m = 1;
|
|
899
1122
|
else {
|
|
900
|
-
const f = (
|
|
901
|
-
|
|
1123
|
+
const f = (a - d) / (1 - d);
|
|
1124
|
+
m = 1 - Math.pow(f, 0.5);
|
|
902
1125
|
}
|
|
903
1126
|
return {
|
|
904
|
-
transform: `rotate(${
|
|
905
|
-
"--border-radius-scale":
|
|
1127
|
+
transform: `rotate(${u.toFixed(2)}deg) scale(${p.toFixed(4)}) translateZ(0)`,
|
|
1128
|
+
"--border-radius-scale": m.toFixed(4)
|
|
906
1129
|
};
|
|
907
1130
|
},
|
|
908
1131
|
onComplete: () => {
|
|
909
|
-
|
|
1132
|
+
r.style.willChange = "", r.style.backfaceVisibility = "", r.style.removeProperty("--max-border-radius"), r.style.removeProperty("--border-radius-scale"), r.style.transform = "", r.style.transformOrigin = "", r.style.position = "", r.style.zIndex = "", r.style.top = "", r.style.left = "", r.style.width = "", r.style.height = "", r.style.overflow = "", r.style.borderRadius = "";
|
|
910
1133
|
}
|
|
911
1134
|
});
|
|
912
|
-
return new
|
|
1135
|
+
return new E([l, c], { mode: "parallel" });
|
|
913
1136
|
}
|
|
914
1137
|
};
|
|
915
1138
|
};
|
|
916
|
-
function
|
|
917
|
-
|
|
1139
|
+
function An(e) {
|
|
1140
|
+
const { paths: t } = e;
|
|
1141
|
+
return P(t, () => De());
|
|
918
1142
|
}
|
|
919
|
-
const
|
|
1143
|
+
const _e = {
|
|
920
1144
|
spring: { stiffness: 100, damping: 30 }
|
|
921
|
-
},
|
|
922
|
-
const t = e.physics ??
|
|
1145
|
+
}, Ae = (e = {}) => {
|
|
1146
|
+
const t = e.physics ?? _e;
|
|
923
1147
|
return {
|
|
924
1148
|
prepare: ({ from: n, to: s }) => (n.then((o) => {
|
|
925
1149
|
o.style.transformOrigin = "center center", o.style.willChange = "transform, opacity";
|
|
@@ -927,33 +1151,34 @@ const Rt = {
|
|
|
927
1151
|
o.style.opacity = "0", o.style.transform = "rotate(-180deg)", o.style.transformOrigin = "center center", o.style.willChange = "transform, opacity";
|
|
928
1152
|
}), {}),
|
|
929
1153
|
animation: ({ from: n, to: s }) => {
|
|
930
|
-
const o = new
|
|
1154
|
+
const o = new b({
|
|
931
1155
|
element: n,
|
|
932
1156
|
integrator: g.from(t),
|
|
933
|
-
style: (
|
|
934
|
-
transform: `rotate(${
|
|
935
|
-
opacity:
|
|
1157
|
+
style: (r) => ({
|
|
1158
|
+
transform: `rotate(${r * 180}deg)`,
|
|
1159
|
+
opacity: r < 0.5 ? 1 : 0
|
|
936
1160
|
})
|
|
937
|
-
}),
|
|
1161
|
+
}), i = new b({
|
|
938
1162
|
element: s,
|
|
939
1163
|
integrator: g.from(t),
|
|
940
1164
|
// u runs 1→0, so -u*180 unwinds -180→0.
|
|
941
|
-
style: (
|
|
1165
|
+
style: (r, l) => ({
|
|
942
1166
|
transform: `rotate(${-l * 180}deg)`,
|
|
943
|
-
opacity:
|
|
1167
|
+
opacity: r > 0.5 ? 1 : 0
|
|
944
1168
|
}),
|
|
945
1169
|
onComplete: () => {
|
|
946
1170
|
s.style.willChange = "auto", s.style.transform = "", s.style.transformOrigin = "", s.style.opacity = "";
|
|
947
1171
|
}
|
|
948
1172
|
});
|
|
949
|
-
return new
|
|
1173
|
+
return new E([o, i], { mode: "parallel" });
|
|
950
1174
|
}
|
|
951
1175
|
};
|
|
952
1176
|
};
|
|
953
|
-
function
|
|
954
|
-
|
|
1177
|
+
function In(e) {
|
|
1178
|
+
const { paths: t } = e;
|
|
1179
|
+
return P(t, () => Ae());
|
|
955
1180
|
}
|
|
956
|
-
const
|
|
1181
|
+
const Ie = {
|
|
957
1182
|
spring: {
|
|
958
1183
|
stiffness: 20,
|
|
959
1184
|
damping: 8,
|
|
@@ -961,76 +1186,73 @@ const ee = {
|
|
|
961
1186
|
restDelta: 1e-3,
|
|
962
1187
|
restSpeed: 1e-3
|
|
963
1188
|
}
|
|
964
|
-
},
|
|
965
|
-
const t = e.direction ?? "up", n = e.physics ??
|
|
1189
|
+
}, at = (e = {}) => {
|
|
1190
|
+
const t = e.direction ?? "up", n = e.physics ?? Ie, s = t === "up";
|
|
966
1191
|
return {
|
|
967
|
-
prepare: ({ from: o, to:
|
|
968
|
-
|
|
969
|
-
}),
|
|
970
|
-
|
|
1192
|
+
prepare: ({ from: o, to: i }) => (o.then((r) => {
|
|
1193
|
+
r.style.zIndex = s ? "-1" : "1", r.style.willChange = "transform", r.style.backfaceVisibility = "hidden", r.style.contain = "layout paint", r.style.pointerEvents = "none";
|
|
1194
|
+
}), i.then((r) => {
|
|
1195
|
+
r.style.willChange = "transform", r.style.backfaceVisibility = "hidden", r.style.contain = "layout paint";
|
|
971
1196
|
}), {}),
|
|
972
|
-
animation: ({ from: o, to:
|
|
973
|
-
const
|
|
1197
|
+
animation: ({ from: o, to: i }) => {
|
|
1198
|
+
const r = o.offsetHeight, l = i.offsetHeight, c = window.innerHeight, a = Math.max(Math.min(r, l), c), p = new b({
|
|
974
1199
|
element: o,
|
|
975
1200
|
integrator: g.from(n),
|
|
976
|
-
style: (
|
|
977
|
-
}), d = new
|
|
978
|
-
element:
|
|
1201
|
+
style: (u) => ({ transform: `translate3d(0, ${s ? -a * u : a * u}px, 0)` })
|
|
1202
|
+
}), d = new b({
|
|
1203
|
+
element: i,
|
|
979
1204
|
integrator: g.from(n),
|
|
980
|
-
style: (
|
|
1205
|
+
style: (u, m) => ({ transform: `translate3d(0, ${s ? m * a : m * -a}px, 0)` }),
|
|
981
1206
|
onComplete: () => {
|
|
982
|
-
|
|
1207
|
+
i.style.willChange = "auto", i.style.backfaceVisibility = "", i.style.contain = "", i.style.transform = "";
|
|
983
1208
|
}
|
|
984
1209
|
});
|
|
985
|
-
return new
|
|
1210
|
+
return new E([p, d], { mode: "parallel" });
|
|
986
1211
|
}
|
|
987
1212
|
};
|
|
988
1213
|
};
|
|
989
|
-
function
|
|
990
|
-
paths: e
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
() => J({ direction: n })
|
|
997
|
-
) : ot(
|
|
998
|
-
e,
|
|
1214
|
+
function On(e) {
|
|
1215
|
+
const { paths: t, type: n = "directional" } = e;
|
|
1216
|
+
return n === "non-directional" ? P(
|
|
1217
|
+
t,
|
|
1218
|
+
() => at({ direction: "up" })
|
|
1219
|
+
) : q(
|
|
1220
|
+
t,
|
|
999
1221
|
{ forward: "up", backward: "down" },
|
|
1000
|
-
(s) =>
|
|
1222
|
+
(s) => at({ direction: s })
|
|
1001
1223
|
);
|
|
1002
1224
|
}
|
|
1003
|
-
const
|
|
1225
|
+
const Oe = {
|
|
1004
1226
|
spring: { stiffness: 200, damping: 24 }
|
|
1005
|
-
},
|
|
1227
|
+
}, ke = {
|
|
1006
1228
|
inertia: { acceleration: 25, resistance: 1.2 }
|
|
1007
|
-
},
|
|
1008
|
-
function
|
|
1229
|
+
}, V = 0.2;
|
|
1230
|
+
function Le() {
|
|
1009
1231
|
return {
|
|
1010
|
-
enterPhysics:
|
|
1011
|
-
exitPhysics:
|
|
1232
|
+
enterPhysics: Oe,
|
|
1233
|
+
exitPhysics: ke,
|
|
1012
1234
|
background: {
|
|
1013
1235
|
willChange: "transform, opacity",
|
|
1014
1236
|
enterStyle: (e, t) => ({
|
|
1015
|
-
transform: `scale(${1 -
|
|
1237
|
+
transform: `scale(${1 - V * e})`,
|
|
1016
1238
|
opacity: t
|
|
1017
1239
|
}),
|
|
1018
1240
|
exitStyle: (e) => ({
|
|
1019
|
-
transform: `scale(${1 -
|
|
1241
|
+
transform: `scale(${1 - V + V * e})`,
|
|
1020
1242
|
opacity: e
|
|
1021
1243
|
})
|
|
1022
1244
|
}
|
|
1023
1245
|
};
|
|
1024
1246
|
}
|
|
1025
|
-
const
|
|
1026
|
-
spring: { stiffness:
|
|
1027
|
-
},
|
|
1028
|
-
inertia: { acceleration:
|
|
1247
|
+
const Fe = {
|
|
1248
|
+
spring: { stiffness: 300, damping: 30 }
|
|
1249
|
+
}, Ye = {
|
|
1250
|
+
inertia: { acceleration: 70, resistance: 1.2 }
|
|
1029
1251
|
};
|
|
1030
|
-
function
|
|
1252
|
+
function He() {
|
|
1031
1253
|
return {
|
|
1032
|
-
enterPhysics:
|
|
1033
|
-
exitPhysics:
|
|
1254
|
+
enterPhysics: Fe,
|
|
1255
|
+
exitPhysics: Ye,
|
|
1034
1256
|
background: {
|
|
1035
1257
|
willChange: "",
|
|
1036
1258
|
enterStyle: () => ({}),
|
|
@@ -1038,333 +1260,548 @@ function ae() {
|
|
|
1038
1260
|
}
|
|
1039
1261
|
};
|
|
1040
1262
|
}
|
|
1041
|
-
const
|
|
1042
|
-
static:
|
|
1043
|
-
"background-scale":
|
|
1044
|
-
},
|
|
1045
|
-
const t = e.direction ?? "enter", n =
|
|
1263
|
+
const Me = {
|
|
1264
|
+
static: He(),
|
|
1265
|
+
"background-scale": Le()
|
|
1266
|
+
}, ze = "static", Ue = "transform", Xe = (e = {}) => {
|
|
1267
|
+
const t = e.direction ?? "enter", n = Me[e.type ?? ze], s = t === "enter" ? n.enterPhysics : n.exitPhysics, o = n.background, i = o.willChange !== "";
|
|
1046
1268
|
return {
|
|
1047
|
-
prepare: ({ from:
|
|
1048
|
-
const c = t === "enter" ? l :
|
|
1269
|
+
prepare: ({ from: r, to: l }) => {
|
|
1270
|
+
const c = t === "enter" ? l : r, a = t === "enter" ? r : l;
|
|
1049
1271
|
return c.then((p) => {
|
|
1050
|
-
p.style.willChange =
|
|
1051
|
-
}),
|
|
1052
|
-
|
|
1272
|
+
p.style.willChange = Ue, p.style.backfaceVisibility = "hidden", p.style.contain = "layout paint", t === "exit" && (p.style.pointerEvents = "none", p.style.zIndex = "100");
|
|
1273
|
+
}), a.then((p) => {
|
|
1274
|
+
i && (p.style.willChange = o.willChange, p.style.backfaceVisibility = "hidden", p.style.contain = "layout paint"), t === "enter" && (p.style.pointerEvents = "none", p.style.zIndex = "-1");
|
|
1053
1275
|
}), {};
|
|
1054
1276
|
},
|
|
1055
|
-
animation: ({ from:
|
|
1056
|
-
const
|
|
1277
|
+
animation: ({ from: r, to: l, context: c }) => {
|
|
1278
|
+
const a = t === "enter" ? l : r, p = t === "enter" ? r : l, d = _(
|
|
1057
1279
|
c,
|
|
1058
1280
|
t === "enter" ? "to" : "from"
|
|
1059
1281
|
);
|
|
1060
|
-
|
|
1061
|
-
const
|
|
1062
|
-
transform: `translate3d(0, ${E * d.height}px, 0)`
|
|
1063
|
-
}) : (C) => ({
|
|
1282
|
+
a.style.clipPath = `inset(${d.top}px 0 calc(100% - ${d.top + d.height}px) 0)`;
|
|
1283
|
+
const u = t === "enter" ? (x, C) => ({
|
|
1064
1284
|
transform: `translate3d(0, ${C * d.height}px, 0)`
|
|
1065
|
-
})
|
|
1066
|
-
|
|
1285
|
+
}) : (x) => ({
|
|
1286
|
+
transform: `translate3d(0, ${x * d.height}px, 0)`
|
|
1287
|
+
}), m = new b({
|
|
1288
|
+
element: a,
|
|
1067
1289
|
integrator: g.from(s),
|
|
1068
|
-
style:
|
|
1290
|
+
style: u,
|
|
1069
1291
|
onComplete: () => {
|
|
1070
|
-
|
|
1292
|
+
a.style.willChange = "auto", a.style.backfaceVisibility = "", a.style.contain = "", a.style.clipPath = "", a.style.transform = "";
|
|
1071
1293
|
}
|
|
1072
1294
|
});
|
|
1073
|
-
if (!
|
|
1074
|
-
return new
|
|
1075
|
-
const f =
|
|
1295
|
+
if (!i)
|
|
1296
|
+
return new E([m], { mode: "parallel" });
|
|
1297
|
+
const f = _(
|
|
1076
1298
|
c,
|
|
1077
1299
|
t === "enter" ? "from" : "to"
|
|
1078
|
-
),
|
|
1079
|
-
p.style.clipPath = `inset(${f.top}px 0 calc(100% - ${f.top + f.height}px) 0)`, p.style.transformOrigin = `${
|
|
1080
|
-
const
|
|
1300
|
+
), h = f.left + f.width / 2, y = f.top + f.height / 2;
|
|
1301
|
+
p.style.clipPath = `inset(${f.top}px 0 calc(100% - ${f.top + f.height}px) 0)`, p.style.transformOrigin = `${h}px ${y}px`;
|
|
1302
|
+
const w = t === "enter" ? (x, C) => o.enterStyle(x, C) : (x) => o.exitStyle(x), S = new b({
|
|
1081
1303
|
element: p,
|
|
1082
1304
|
integrator: g.from(s),
|
|
1083
|
-
style:
|
|
1305
|
+
style: w,
|
|
1084
1306
|
onComplete: t === "exit" ? () => {
|
|
1085
1307
|
p.style.willChange = "auto", p.style.backfaceVisibility = "", p.style.contain = "", p.style.clipPath = "", p.style.transformOrigin = "";
|
|
1086
1308
|
} : void 0
|
|
1087
1309
|
});
|
|
1088
|
-
return new
|
|
1310
|
+
return new E([m, S], { mode: "parallel" });
|
|
1089
1311
|
}
|
|
1090
1312
|
};
|
|
1091
1313
|
};
|
|
1092
|
-
function
|
|
1093
|
-
return
|
|
1094
|
-
|
|
1095
|
-
|
|
1314
|
+
function Ve(e) {
|
|
1315
|
+
return e === "scale" || e === "background-scale" ? "background-scale" : "static";
|
|
1316
|
+
}
|
|
1317
|
+
function kn(e) {
|
|
1318
|
+
const { enter: t, exit: n } = e, s = e.type, o = Ve(s);
|
|
1319
|
+
return ht(
|
|
1320
|
+
{ enter: t, exit: n },
|
|
1321
|
+
(i) => Xe({ direction: i, type: o })
|
|
1096
1322
|
);
|
|
1097
1323
|
}
|
|
1098
|
-
const
|
|
1324
|
+
const Be = {
|
|
1099
1325
|
spring: { stiffness: 170, damping: 22, doubleSpring: 0.8 }
|
|
1100
|
-
},
|
|
1101
|
-
const t = e.direction ?? "left", n = e.physics ??
|
|
1326
|
+
}, Ne = (e = {}) => {
|
|
1327
|
+
const t = e.direction ?? "left", n = e.physics ?? Be, s = t === "left";
|
|
1102
1328
|
return {
|
|
1103
|
-
prepare: ({ from: o, to:
|
|
1104
|
-
|
|
1105
|
-
}),
|
|
1329
|
+
prepare: ({ from: o, to: i }) => (o.then((r) => {
|
|
1330
|
+
r.style.willChange = "transform", r.style.backfaceVisibility = "hidden", r.style.contain = "layout paint", r.style.pointerEvents = "none";
|
|
1331
|
+
}), i.then((r) => {
|
|
1106
1332
|
const l = s ? 100 : -100;
|
|
1107
|
-
|
|
1333
|
+
r.style.transform = `translate3d(${l}%, 0, 0)`, r.style.willChange = "transform", r.style.backfaceVisibility = "hidden", r.style.contain = "layout paint";
|
|
1108
1334
|
}), {}),
|
|
1109
|
-
animation: ({ from: o, to:
|
|
1110
|
-
const
|
|
1335
|
+
animation: ({ from: o, to: i }) => {
|
|
1336
|
+
const r = new b({
|
|
1111
1337
|
element: o,
|
|
1112
1338
|
integrator: g.from(n),
|
|
1113
1339
|
style: (c) => ({ transform: `translate3d(${s ? -100 * c : 100 * c}%, 0, 0)` })
|
|
1114
|
-
}), l = new
|
|
1115
|
-
element:
|
|
1340
|
+
}), l = new b({
|
|
1341
|
+
element: i,
|
|
1116
1342
|
integrator: g.from(n),
|
|
1117
|
-
style: (c,
|
|
1343
|
+
style: (c, a) => ({ transform: `translate3d(${s ? a * 100 : a * -100}%, 0, 0)` }),
|
|
1118
1344
|
onComplete: () => {
|
|
1119
|
-
|
|
1345
|
+
i.style.willChange = "auto", i.style.backfaceVisibility = "", i.style.contain = "", i.style.transform = "";
|
|
1120
1346
|
}
|
|
1121
1347
|
});
|
|
1122
|
-
return new
|
|
1348
|
+
return new E([r, l], { mode: "parallel" });
|
|
1123
1349
|
}
|
|
1124
1350
|
};
|
|
1125
1351
|
};
|
|
1126
|
-
function
|
|
1127
|
-
|
|
1128
|
-
|
|
1352
|
+
function Ln(e) {
|
|
1353
|
+
const { paths: t } = e;
|
|
1354
|
+
return q(
|
|
1355
|
+
t,
|
|
1129
1356
|
{ forward: "left", backward: "right" },
|
|
1130
|
-
(
|
|
1357
|
+
(n) => Ne({ direction: n })
|
|
1131
1358
|
);
|
|
1132
1359
|
}
|
|
1133
|
-
const
|
|
1360
|
+
const We = {
|
|
1134
1361
|
spring: { stiffness: 17, damping: 6 }
|
|
1135
|
-
},
|
|
1136
|
-
const t = e.physics ??
|
|
1362
|
+
}, B = 20, L = 800, Ze = (e = {}) => {
|
|
1363
|
+
const t = e.physics ?? We;
|
|
1137
1364
|
return {
|
|
1138
1365
|
prepare: ({ from: n, to: s }) => (n.then((o) => {
|
|
1139
|
-
o.style.willChange = "transform", o.style.backfaceVisibility = "hidden", o.style.contain = "layout paint", o.style.pointerEvents = "none", o.style.transform = `perspective(${
|
|
1366
|
+
o.style.willChange = "transform", o.style.backfaceVisibility = "hidden", o.style.contain = "layout paint", o.style.pointerEvents = "none", o.style.transform = `perspective(${L}px) rotateY(0deg) translate3d(0%, 0, 0)`;
|
|
1140
1367
|
}), s.then((o) => {
|
|
1141
|
-
o.style.willChange = "transform", o.style.backfaceVisibility = "hidden", o.style.contain = "layout paint", o.style.transform = `perspective(${
|
|
1368
|
+
o.style.willChange = "transform", o.style.backfaceVisibility = "hidden", o.style.contain = "layout paint", o.style.transform = `perspective(${L}px) rotateY(${B}deg) translate3d(-100%, 0, 0)`;
|
|
1142
1369
|
}), {}),
|
|
1143
1370
|
animation: ({ from: n, to: s }) => {
|
|
1144
|
-
const o = new
|
|
1371
|
+
const o = new b({
|
|
1145
1372
|
element: n,
|
|
1146
1373
|
integrator: g.from(t),
|
|
1147
|
-
style: (
|
|
1148
|
-
const l = -
|
|
1374
|
+
style: (r) => {
|
|
1375
|
+
const l = -r * B, c = r * 100;
|
|
1149
1376
|
return {
|
|
1150
|
-
transform: `perspective(${
|
|
1377
|
+
transform: `perspective(${L}px) rotateY(${l}deg) translate3d(${c}%, 0, 0)`
|
|
1151
1378
|
};
|
|
1152
1379
|
}
|
|
1153
|
-
}),
|
|
1380
|
+
}), i = new b({
|
|
1154
1381
|
element: s,
|
|
1155
1382
|
integrator: g.from(t),
|
|
1156
|
-
style: (
|
|
1157
|
-
const c = l *
|
|
1383
|
+
style: (r, l) => {
|
|
1384
|
+
const c = l * B, a = -l * 100;
|
|
1158
1385
|
return {
|
|
1159
|
-
transform: `perspective(${
|
|
1386
|
+
transform: `perspective(${L}px) rotateY(${c}deg) translate3d(${a}%, 0, 0)`
|
|
1160
1387
|
};
|
|
1161
1388
|
},
|
|
1162
1389
|
onComplete: () => {
|
|
1163
1390
|
s.style.transform = "", s.style.willChange = "auto", s.style.backfaceVisibility = "", s.style.contain = "";
|
|
1164
1391
|
}
|
|
1165
1392
|
});
|
|
1166
|
-
return new
|
|
1393
|
+
return new E([o, i], { mode: "sequence" });
|
|
1167
1394
|
}
|
|
1168
1395
|
};
|
|
1169
1396
|
};
|
|
1170
|
-
function
|
|
1171
|
-
|
|
1397
|
+
function Fn(e) {
|
|
1398
|
+
const { paths: t } = e;
|
|
1399
|
+
return P(t, () => Ze());
|
|
1172
1400
|
}
|
|
1173
|
-
function
|
|
1401
|
+
function qe({
|
|
1174
1402
|
enterRect: e,
|
|
1175
1403
|
exitRect: t,
|
|
1176
1404
|
pageRect: n,
|
|
1177
|
-
scrollOffset: s
|
|
1405
|
+
scrollOffset: s,
|
|
1406
|
+
enterRadius: o,
|
|
1407
|
+
exitRadius: i
|
|
1178
1408
|
}) {
|
|
1179
|
-
const
|
|
1409
|
+
const r = t.left - e.left + (t.width - e.width) / 2 - s.x, l = t.top - e.top + (t.height - e.height) / 2 - s.y, c = t.width / e.width, a = t.height / e.height, p = e.top / n.height * 100, d = (n.width - (e.left + e.width)) / n.width * 100, u = (n.height - (e.top + e.height)) / n.height * 100, m = e.left / n.width * 100;
|
|
1180
1410
|
return {
|
|
1181
1411
|
transformOrigin: `${e.left + e.width / 2}px ${e.top + e.height / 2}px`,
|
|
1182
|
-
animate: (
|
|
1183
|
-
const f = 1 -
|
|
1412
|
+
animate: (f) => {
|
|
1413
|
+
const h = 1 - f, y = 1 + (c - 1) * h, w = 1 + (a - 1) * h, x = (i * h + o * (1 - h)) / ((y + w) / 2);
|
|
1184
1414
|
return {
|
|
1185
|
-
clipPath: `inset(${
|
|
1186
|
-
transform: `translate(${
|
|
1415
|
+
clipPath: `inset(${p * h}% ${d * h}% ${u * h}% ${m * h}% round ${x}px)`,
|
|
1416
|
+
transform: `translate(${r * h}px, ${l * h}px) scale(${y}, ${w})`
|
|
1187
1417
|
};
|
|
1188
1418
|
}
|
|
1189
1419
|
};
|
|
1190
1420
|
}
|
|
1191
|
-
function
|
|
1421
|
+
function je({
|
|
1192
1422
|
enterRect: e,
|
|
1193
1423
|
exitRect: t,
|
|
1194
1424
|
pageRect: n,
|
|
1195
|
-
scrollOffset: s
|
|
1425
|
+
scrollOffset: s,
|
|
1426
|
+
enterRadius: o,
|
|
1427
|
+
exitRadius: i
|
|
1196
1428
|
}) {
|
|
1197
|
-
const
|
|
1429
|
+
const r = t.left - e.left + (t.width - e.width) / 2 + s.x, l = t.top - e.top + (t.height - e.height) / 2 + s.y, c = t.width / e.width, a = t.height / e.height, p = e.top / n.height * 100, d = (n.width - (e.left + e.width)) / n.width * 100, u = (n.height - (e.top + e.height)) / n.height * 100, m = e.left / n.width * 100;
|
|
1198
1430
|
return {
|
|
1199
1431
|
transformOrigin: `${e.left + e.width / 2}px ${e.top + e.height / 2}px`,
|
|
1200
|
-
animate: (
|
|
1201
|
-
const f = 1 -
|
|
1432
|
+
animate: (f) => {
|
|
1433
|
+
const h = 1 - f, y = 1 + (c - 1) * h, w = 1 + (a - 1) * h, x = (o * (1 - h) + i * h) / ((y + w) / 2);
|
|
1434
|
+
return {
|
|
1435
|
+
clipPath: `inset(${p * h}% ${d * h}% ${u * h}% ${m * h}% round ${x}px)`,
|
|
1436
|
+
transform: `translate(${r * h - s.x}px, ${l * h}px) scale(${y}, ${w})`
|
|
1437
|
+
};
|
|
1438
|
+
}
|
|
1439
|
+
};
|
|
1440
|
+
}
|
|
1441
|
+
const Ge = {
|
|
1442
|
+
spring: { stiffness: 200, damping: 24 }
|
|
1443
|
+
}, ut = 0.12, Ke = 18;
|
|
1444
|
+
function Je() {
|
|
1445
|
+
return {
|
|
1446
|
+
transformOrigin: "50% 50%",
|
|
1447
|
+
animate: (e) => {
|
|
1448
|
+
const t = 1 - e;
|
|
1449
|
+
return {
|
|
1450
|
+
transform: `scale(${1 - ut * t})`
|
|
1451
|
+
};
|
|
1452
|
+
}
|
|
1453
|
+
};
|
|
1454
|
+
}
|
|
1455
|
+
function Qe() {
|
|
1456
|
+
return {
|
|
1457
|
+
transformOrigin: "50% 50%",
|
|
1458
|
+
animate: (e) => {
|
|
1459
|
+
const t = 1 - e;
|
|
1202
1460
|
return {
|
|
1203
|
-
|
|
1204
|
-
transform: `translate(${o * f - s.x}px, ${a * f}px) scale(${1 + (c - 1) * f})`
|
|
1461
|
+
transform: `scale(${1 - ut * t})`
|
|
1205
1462
|
};
|
|
1206
1463
|
}
|
|
1207
1464
|
};
|
|
1208
1465
|
}
|
|
1209
|
-
const
|
|
1466
|
+
const N = {
|
|
1467
|
+
willChange: "backdrop-filter",
|
|
1468
|
+
initialStyle: {
|
|
1469
|
+
position: "absolute",
|
|
1470
|
+
inset: "0",
|
|
1471
|
+
pointerEvents: "none",
|
|
1472
|
+
// Sits above the background page but below the zoomed page (z-index 9999
|
|
1473
|
+
// in transition.ts). backdrop-filter therefore blurs the background,
|
|
1474
|
+
// while the zoom tile stays sharp as it expands on top.
|
|
1475
|
+
zIndex: "5000",
|
|
1476
|
+
backdropFilter: "blur(0px)",
|
|
1477
|
+
WebkitBackdropFilter: "blur(0px)"
|
|
1478
|
+
},
|
|
1479
|
+
style: (e, t) => {
|
|
1480
|
+
const n = e === "enter" ? t : 1 - t, s = `blur(${Ke * n}px)`;
|
|
1481
|
+
return {
|
|
1482
|
+
backdropFilter: s,
|
|
1483
|
+
WebkitBackdropFilter: s
|
|
1484
|
+
};
|
|
1485
|
+
}
|
|
1486
|
+
};
|
|
1487
|
+
class Re {
|
|
1488
|
+
constructor() {
|
|
1489
|
+
$(this, "physics", Ge);
|
|
1490
|
+
}
|
|
1491
|
+
contribute(t) {
|
|
1492
|
+
const { from: n, to: s, resolved: o, physics: i } = t, r = o.mode === "enter", l = r ? n : s, c = r ? Je() : Qe();
|
|
1493
|
+
return c && (l.style.transformOrigin = c.transformOrigin), [
|
|
1494
|
+
new b({
|
|
1495
|
+
element: l,
|
|
1496
|
+
integrator: g.from(i),
|
|
1497
|
+
style: r ? (a, p) => c.animate(p) : (a) => c.animate(a)
|
|
1498
|
+
})
|
|
1499
|
+
];
|
|
1500
|
+
}
|
|
1501
|
+
}
|
|
1502
|
+
class tn {
|
|
1503
|
+
prepare(t) {
|
|
1504
|
+
const n = t.createElement("zoom-overlay");
|
|
1505
|
+
return Object.assign(n.style, N.initialStyle), n.style.willChange = N.willChange, t.context.positionedParent.appendChild(n), { overlay: n };
|
|
1506
|
+
}
|
|
1507
|
+
contribute(t) {
|
|
1508
|
+
const n = t.extras.overlay;
|
|
1509
|
+
return n ? [
|
|
1510
|
+
new b({
|
|
1511
|
+
element: n,
|
|
1512
|
+
integrator: g.from(t.physics),
|
|
1513
|
+
style: (s) => N.style(t.resolved.mode, s)
|
|
1514
|
+
})
|
|
1515
|
+
] : [];
|
|
1516
|
+
}
|
|
1517
|
+
}
|
|
1518
|
+
const en = {
|
|
1210
1519
|
spring: { stiffness: 340, damping: 30, doubleSpring: 1 }
|
|
1211
1520
|
};
|
|
1212
|
-
function
|
|
1521
|
+
function nn({
|
|
1213
1522
|
enterRect: e,
|
|
1214
1523
|
exitRect: t,
|
|
1215
1524
|
scrollOffset: n
|
|
1216
1525
|
}) {
|
|
1217
|
-
const s = e.left - t.left + (e.width - t.width) / 2 + n.x, o = e.top - t.top + (e.height - t.height) / 2 + n.y,
|
|
1526
|
+
const s = e.left - t.left + (e.width - t.width) / 2 + n.x, o = e.top - t.top + (e.height - t.height) / 2 + n.y, i = e.width / t.width, r = e.height / t.height, l = Math.max(i, r);
|
|
1218
1527
|
return {
|
|
1219
1528
|
transformOrigin: `${t.left + t.width / 2}px ${t.top + t.height / 2}px`,
|
|
1220
1529
|
animate: (c) => {
|
|
1221
|
-
const
|
|
1530
|
+
const a = 1 - c;
|
|
1222
1531
|
return {
|
|
1223
|
-
transform: `translate(${s *
|
|
1224
|
-
opacity: `${1 -
|
|
1532
|
+
transform: `translate(${s * a - n.x}px, ${o * a}px) scale(${1 + (l - 1) * a})`,
|
|
1533
|
+
opacity: `${1 - a}`
|
|
1225
1534
|
};
|
|
1226
1535
|
}
|
|
1227
1536
|
};
|
|
1228
1537
|
}
|
|
1229
|
-
function
|
|
1538
|
+
function sn({
|
|
1230
1539
|
enterRect: e,
|
|
1231
1540
|
exitRect: t,
|
|
1232
1541
|
scrollOffset: n
|
|
1233
1542
|
}) {
|
|
1234
|
-
const s = e.left - t.left + (e.width - t.width) / 2 - n.x, o = e.top - t.top + (e.height - t.height) / 2 - n.y,
|
|
1543
|
+
const s = e.left - t.left + (e.width - t.width) / 2 - n.x, o = e.top - t.top + (e.height - t.height) / 2 - n.y, i = e.width / t.width, r = e.height / t.height, l = Math.max(i, r);
|
|
1235
1544
|
return {
|
|
1236
1545
|
transformOrigin: `${t.left + t.width / 2}px ${t.top + t.height / 2}px`,
|
|
1237
1546
|
animate: (c) => {
|
|
1238
|
-
const
|
|
1547
|
+
const a = 1 - c;
|
|
1239
1548
|
return {
|
|
1240
|
-
transform: `translate(${s *
|
|
1549
|
+
transform: `translate(${s * a}px, ${o * a}px) scale(${1 + (l - 1) * a})`,
|
|
1241
1550
|
opacity: `${c}`
|
|
1242
1551
|
};
|
|
1243
1552
|
}
|
|
1244
1553
|
};
|
|
1245
1554
|
}
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
physics
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1555
|
+
class on {
|
|
1556
|
+
constructor() {
|
|
1557
|
+
$(this, "physics", en);
|
|
1558
|
+
}
|
|
1559
|
+
contribute(t) {
|
|
1560
|
+
const { from: n, to: s, resolved: o, input: i, physics: r } = t, l = o.mode === "enter", c = l ? n : s, a = l ? nn(i) : sn(i);
|
|
1561
|
+
return a && (c.style.transformOrigin = a.transformOrigin), [
|
|
1562
|
+
new b({
|
|
1563
|
+
element: c,
|
|
1564
|
+
integrator: g.from(r),
|
|
1565
|
+
style: l ? (p, d) => a.animate(d) : (p) => a.animate(p)
|
|
1566
|
+
})
|
|
1567
|
+
];
|
|
1568
|
+
}
|
|
1254
1569
|
}
|
|
1255
|
-
const
|
|
1570
|
+
const rn = {
|
|
1256
1571
|
spring: { stiffness: 420, damping: 34 }
|
|
1257
1572
|
};
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1573
|
+
class an {
|
|
1574
|
+
constructor() {
|
|
1575
|
+
$(this, "physics", rn);
|
|
1576
|
+
}
|
|
1577
|
+
contribute(t) {
|
|
1578
|
+
return [];
|
|
1579
|
+
}
|
|
1263
1580
|
}
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1581
|
+
const ln = {
|
|
1582
|
+
expand: () => new on(),
|
|
1583
|
+
static: () => new an(),
|
|
1584
|
+
blur: () => new Re()
|
|
1585
|
+
};
|
|
1586
|
+
function cn(e) {
|
|
1587
|
+
return ln[e]();
|
|
1588
|
+
}
|
|
1589
|
+
const W = "data-zoom-enter-key", lt = "data-zoom-exit-key", pn = "data-zoom-radius";
|
|
1590
|
+
function ct(e) {
|
|
1591
|
+
const t = e.getAttribute(pn);
|
|
1592
|
+
if (!t) return 0;
|
|
1593
|
+
const n = parseFloat(t);
|
|
1594
|
+
return Number.isFinite(n) && n > 0 ? n : 0;
|
|
1272
1595
|
}
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1596
|
+
function dn(e, t) {
|
|
1597
|
+
const n = [];
|
|
1598
|
+
let s = t;
|
|
1599
|
+
for (; s && s !== e; ) {
|
|
1600
|
+
const o = s.parentElement;
|
|
1601
|
+
if (!o) break;
|
|
1602
|
+
for (const i of Array.from(o.children))
|
|
1603
|
+
i !== s && i instanceof HTMLElement && n.push(i);
|
|
1604
|
+
s = o;
|
|
1605
|
+
}
|
|
1606
|
+
return n;
|
|
1607
|
+
}
|
|
1608
|
+
function pt(e) {
|
|
1609
|
+
const t = e.querySelectorAll(`[${W}]`);
|
|
1279
1610
|
return t.length !== 1 ? null : t[0];
|
|
1280
1611
|
}
|
|
1281
|
-
function
|
|
1282
|
-
const n = e.querySelectorAll(`[${
|
|
1612
|
+
function dt(e, t) {
|
|
1613
|
+
const n = e.querySelectorAll(`[${lt}]`);
|
|
1283
1614
|
for (const s of n)
|
|
1284
|
-
if (s.getAttribute(
|
|
1615
|
+
if (s.getAttribute(lt) === t)
|
|
1285
1616
|
return s;
|
|
1286
1617
|
return null;
|
|
1287
1618
|
}
|
|
1288
|
-
function
|
|
1289
|
-
const n =
|
|
1619
|
+
function fn(e, t) {
|
|
1620
|
+
const n = pt(e), s = pt(t);
|
|
1290
1621
|
if (!n && s) {
|
|
1291
|
-
const o = s.getAttribute(
|
|
1622
|
+
const o = s.getAttribute(W);
|
|
1292
1623
|
if (!o) return null;
|
|
1293
|
-
const
|
|
1294
|
-
return
|
|
1624
|
+
const i = dt(e, o);
|
|
1625
|
+
return i ? { mode: "enter", enterEl: s, exitEl: i } : null;
|
|
1295
1626
|
}
|
|
1296
1627
|
if (n && !s) {
|
|
1297
|
-
const o = n.getAttribute(
|
|
1628
|
+
const o = n.getAttribute(W);
|
|
1298
1629
|
if (!o) return null;
|
|
1299
|
-
const
|
|
1300
|
-
return
|
|
1630
|
+
const i = dt(t, o);
|
|
1631
|
+
return i ? { mode: "exit", enterEl: n, exitEl: i } : null;
|
|
1301
1632
|
}
|
|
1302
1633
|
return null;
|
|
1303
1634
|
}
|
|
1304
|
-
function
|
|
1635
|
+
function hn(e, t, n, s) {
|
|
1305
1636
|
return {
|
|
1306
|
-
enterRect:
|
|
1637
|
+
enterRect: T(
|
|
1307
1638
|
e.mode === "enter" ? n : t,
|
|
1308
1639
|
e.enterEl
|
|
1309
1640
|
),
|
|
1310
|
-
exitRect:
|
|
1641
|
+
exitRect: T(
|
|
1311
1642
|
e.mode === "enter" ? t : n,
|
|
1312
1643
|
e.exitEl
|
|
1313
1644
|
),
|
|
1314
1645
|
pageRect: e.mode === "enter" ? n.getBoundingClientRect() : t.getBoundingClientRect(),
|
|
1315
|
-
scrollOffset: s
|
|
1646
|
+
scrollOffset: s,
|
|
1647
|
+
enterRadius: ct(e.enterEl),
|
|
1648
|
+
exitRadius: ct(e.exitEl)
|
|
1316
1649
|
};
|
|
1317
1650
|
}
|
|
1318
|
-
|
|
1319
|
-
|
|
1651
|
+
class un {
|
|
1652
|
+
prepare(t) {
|
|
1653
|
+
t.from.then((n) => {
|
|
1654
|
+
n.style.willChange = "transform, clip-path, opacity", n.style.backfaceVisibility = "hidden", n.style.contain = "layout paint";
|
|
1655
|
+
});
|
|
1656
|
+
}
|
|
1657
|
+
contribute(t) {
|
|
1658
|
+
const { from: n, to: s, resolved: o, input: i, physics: r, onComplete: l } = t, c = o.mode === "enter", a = c ? qe(i) : je(i), p = c ? s : n, d = c ? "t" : "u";
|
|
1659
|
+
a && (p.style.transformOrigin = a.transformOrigin);
|
|
1660
|
+
const u = p.style.zIndex;
|
|
1661
|
+
return p.style.zIndex = "9999", l(() => {
|
|
1662
|
+
p.style.willChange = "auto", p.style.backfaceVisibility = "", p.style.transformOrigin = "", p.style.contain = "", p.style.zIndex = u;
|
|
1663
|
+
}), [
|
|
1664
|
+
new b({
|
|
1665
|
+
element: p,
|
|
1666
|
+
integrator: g.from(r),
|
|
1667
|
+
// Enter: tile expands as `t` (0 → 1). Exit: tile shrinks as `u` —
|
|
1668
|
+
// the legacy convention from v5's outAnim path. Either way, feed
|
|
1669
|
+
// the progress that matches the tileConfig's authored direction.
|
|
1670
|
+
style: d === "t" ? (m) => a.animate(m) : (m, f) => a.animate(f)
|
|
1671
|
+
})
|
|
1672
|
+
];
|
|
1673
|
+
}
|
|
1674
|
+
}
|
|
1675
|
+
class mn {
|
|
1676
|
+
contribute(t) {
|
|
1677
|
+
const { resolved: n, physics: s, from: o, to: i, onComplete: r } = t, l = n.mode === "enter" ? i : o, c = dn(l, n.enterEl);
|
|
1678
|
+
if (c.length === 0) return [];
|
|
1679
|
+
const a = c.map((p) => p.style.opacity);
|
|
1680
|
+
if (n.mode === "enter")
|
|
1681
|
+
for (const p of c) p.style.opacity = "0";
|
|
1682
|
+
return r(() => {
|
|
1683
|
+
for (let p = 0; p < c.length; p++) {
|
|
1684
|
+
const d = c[p];
|
|
1685
|
+
d && (d.style.opacity = a[p] ?? "");
|
|
1686
|
+
}
|
|
1687
|
+
}), c.map(
|
|
1688
|
+
(p) => new b({
|
|
1689
|
+
element: p,
|
|
1690
|
+
integrator: g.from(s),
|
|
1691
|
+
style: (d, u) => ({
|
|
1692
|
+
opacity: n.mode === "enter" ? d : u
|
|
1693
|
+
})
|
|
1694
|
+
})
|
|
1695
|
+
);
|
|
1696
|
+
}
|
|
1697
|
+
}
|
|
1698
|
+
class mt {
|
|
1699
|
+
contribute() {
|
|
1700
|
+
return [];
|
|
1701
|
+
}
|
|
1702
|
+
}
|
|
1703
|
+
const yn = {
|
|
1704
|
+
default: () => new mt(),
|
|
1705
|
+
fade: () => new mn()
|
|
1706
|
+
};
|
|
1707
|
+
function gn(e) {
|
|
1708
|
+
return yn[e]();
|
|
1709
|
+
}
|
|
1710
|
+
class bn extends mt {
|
|
1711
|
+
}
|
|
1712
|
+
function wn(e) {
|
|
1713
|
+
const t = cn(e.type);
|
|
1714
|
+
return { strategies: [
|
|
1715
|
+
new un(),
|
|
1716
|
+
t,
|
|
1717
|
+
gn(e.variant),
|
|
1718
|
+
new bn(),
|
|
1719
|
+
// Overlay is intrinsically tied to backdrop-filter-driven types. Today
|
|
1720
|
+
// that's only `blur`; the table-driven factory above owns the mapping
|
|
1721
|
+
// so this conditional is the single line that knows the relationship.
|
|
1722
|
+
...e.type === "blur" ? [new tn()] : []
|
|
1723
|
+
], physics: t.physics };
|
|
1724
|
+
}
|
|
1725
|
+
const Sn = (e) => {
|
|
1726
|
+
const { strategies: t, physics: n } = wn(e);
|
|
1320
1727
|
return {
|
|
1321
|
-
prepare: (
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1728
|
+
prepare: (s) => {
|
|
1729
|
+
const o = {
|
|
1730
|
+
from: s.from,
|
|
1731
|
+
to: s.to,
|
|
1732
|
+
context: { positionedParent: s.context.positionedParent },
|
|
1733
|
+
// `createElement` from the dispatcher is generic over tag; the
|
|
1734
|
+
// strategy interface narrows the cast to keep both signatures
|
|
1735
|
+
// compatible.
|
|
1736
|
+
createElement: s.createElement
|
|
1737
|
+
}, i = {};
|
|
1738
|
+
for (const r of t) {
|
|
1739
|
+
if (!r.prepare) continue;
|
|
1740
|
+
const l = r.prepare(o);
|
|
1741
|
+
l && Object.assign(i, l);
|
|
1742
|
+
}
|
|
1743
|
+
return i;
|
|
1744
|
+
},
|
|
1745
|
+
animation: ({ from: s, to: o, context: i, ...r }) => {
|
|
1746
|
+
const l = fn(s, o);
|
|
1747
|
+
if (!l)
|
|
1748
|
+
return new E([], { mode: "parallel" });
|
|
1749
|
+
const c = hn(l, s, o, i.scrollOffset), a = [], d = {
|
|
1750
|
+
from: s,
|
|
1751
|
+
to: o,
|
|
1752
|
+
resolved: l,
|
|
1753
|
+
input: c,
|
|
1754
|
+
physics: n,
|
|
1755
|
+
extras: r,
|
|
1756
|
+
onComplete: (f) => {
|
|
1757
|
+
a.push(f);
|
|
1345
1758
|
}
|
|
1346
|
-
}
|
|
1347
|
-
|
|
1759
|
+
}, u = [];
|
|
1760
|
+
for (const f of t)
|
|
1761
|
+
f.contribute && u.push(...f.contribute(d));
|
|
1762
|
+
const m = u[0];
|
|
1763
|
+
if (m) {
|
|
1764
|
+
const f = m.onComplete;
|
|
1765
|
+
m.onComplete = () => {
|
|
1766
|
+
f == null || f();
|
|
1767
|
+
for (const h of a)
|
|
1768
|
+
try {
|
|
1769
|
+
h();
|
|
1770
|
+
} catch (y) {
|
|
1771
|
+
console.error("[zoom] cleanup error", y);
|
|
1772
|
+
}
|
|
1773
|
+
};
|
|
1774
|
+
}
|
|
1775
|
+
return new E(u, { mode: "parallel" });
|
|
1348
1776
|
}
|
|
1349
1777
|
};
|
|
1350
1778
|
};
|
|
1351
|
-
function
|
|
1352
|
-
|
|
1779
|
+
function $n(e) {
|
|
1780
|
+
const t = e.type ?? "static", n = e.variant ?? (e.fade ? "fade" : "default");
|
|
1781
|
+
return { type: t, variant: n };
|
|
1782
|
+
}
|
|
1783
|
+
function Yn(e) {
|
|
1784
|
+
const t = $n(e);
|
|
1785
|
+
return P(
|
|
1786
|
+
e.paths,
|
|
1787
|
+
() => Sn(t)
|
|
1788
|
+
);
|
|
1353
1789
|
}
|
|
1354
1790
|
export {
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1791
|
+
zn as Animation,
|
|
1792
|
+
E as MultiAnimation,
|
|
1793
|
+
b as WebAnimation,
|
|
1794
|
+
Cn as axis,
|
|
1795
|
+
Pn as blind,
|
|
1796
|
+
vn as drill,
|
|
1797
|
+
Tn as fade,
|
|
1798
|
+
Dn as film,
|
|
1799
|
+
_n as hero,
|
|
1800
|
+
An as jaemin,
|
|
1801
|
+
In as rotate,
|
|
1802
|
+
On as scroll,
|
|
1803
|
+
kn as sheet,
|
|
1804
|
+
Ln as slide,
|
|
1805
|
+
Fn as strip,
|
|
1806
|
+
Yn as zoom
|
|
1370
1807
|
};
|