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