@ssgoi/core 5.2.2 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/animation/animation.d.ts +50 -0
- package/dist/animation/animation.d.ts.map +1 -0
- package/dist/animation/host-animation.d.ts +43 -0
- package/dist/animation/host-animation.d.ts.map +1 -0
- package/dist/animation/index.d.ts +6 -0
- package/dist/animation/index.d.ts.map +1 -0
- package/dist/animation/integrator/double-spring-integrator.d.ts.map +1 -0
- package/dist/{animator → animation}/integrator/index.d.ts +1 -0
- package/dist/animation/integrator/index.d.ts.map +1 -0
- package/dist/animation/integrator/inertia-integrator.d.ts.map +1 -0
- package/dist/animation/integrator/linear-integrator.d.ts +23 -0
- package/dist/animation/integrator/linear-integrator.d.ts.map +1 -0
- package/dist/{animator → animation}/integrator/provider.d.ts +1 -1
- package/dist/animation/integrator/provider.d.ts.map +1 -0
- package/dist/animation/integrator/spring-integrator.d.ts.map +1 -0
- package/dist/animation/integrator/types.d.ts.map +1 -0
- package/dist/animation/multi-animation.d.ts +39 -0
- package/dist/animation/multi-animation.d.ts.map +1 -0
- package/dist/animation/web-animation.d.ts +63 -0
- package/dist/animation/web-animation.d.ts.map +1 -0
- package/dist/index.cjs +35 -1
- package/dist/index.d.ts +4 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1271 -1192
- package/dist/internal.cjs +1 -0
- package/dist/internal.d.ts +4 -0
- package/dist/internal.d.ts.map +1 -0
- package/dist/internal.js +504 -0
- package/dist/multi-animation-B_Hl1HEU.cjs +1 -0
- package/dist/multi-animation-CST6aZ8y.js +276 -0
- package/dist/ssgoi-transition/create-context-manager.d.ts +1 -1
- package/dist/ssgoi-transition/create-context-manager.d.ts.map +1 -1
- package/dist/ssgoi-transition/create-ssgoi-transition-context.d.ts +18 -31
- package/dist/ssgoi-transition/create-ssgoi-transition-context.d.ts.map +1 -1
- package/dist/ssgoi-transition/find-matching-transition.d.ts +4 -4
- package/dist/ssgoi-transition/find-matching-transition.d.ts.map +1 -1
- package/dist/ssgoi-transition/navigation-detector-strategy.d.ts +5 -15
- package/dist/ssgoi-transition/navigation-detector-strategy.d.ts.map +1 -1
- package/dist/ssgoi-transition/process-symmetric-transitions.d.ts +2 -2
- package/dist/ssgoi-transition/process-symmetric-transitions.d.ts.map +1 -1
- package/dist/ssgoi-transition/unmount-observer.d.ts +17 -0
- package/dist/ssgoi-transition/unmount-observer.d.ts.map +1 -0
- package/dist/transitions/blind/index.d.ts +6 -0
- package/dist/transitions/blind/index.d.ts.map +1 -0
- package/dist/transitions/blind/transition.d.ts +16 -0
- package/dist/transitions/blind/transition.d.ts.map +1 -0
- package/dist/transitions/drill/index.d.ts +9 -0
- package/dist/transitions/drill/index.d.ts.map +1 -0
- package/dist/transitions/drill/provider/crossfade.d.ts +3 -0
- package/dist/transitions/drill/provider/crossfade.d.ts.map +1 -0
- package/dist/transitions/drill/provider/index.d.ts +3 -0
- package/dist/transitions/drill/provider/index.d.ts.map +1 -0
- package/dist/transitions/drill/provider/parallax.d.ts +3 -0
- package/dist/transitions/drill/provider/parallax.d.ts.map +1 -0
- package/dist/transitions/drill/transition.d.ts +5 -0
- package/dist/transitions/drill/transition.d.ts.map +1 -0
- package/dist/transitions/drill/types.d.ts +23 -0
- package/dist/transitions/drill/types.d.ts.map +1 -0
- package/dist/transitions/fade/index.d.ts +6 -0
- package/dist/transitions/fade/index.d.ts.map +1 -0
- package/dist/transitions/fade/transition.d.ts +6 -0
- package/dist/transitions/fade/transition.d.ts.map +1 -0
- package/dist/transitions/film/index.d.ts +6 -0
- package/dist/transitions/film/index.d.ts.map +1 -0
- package/dist/transitions/film/transition.d.ts +27 -0
- package/dist/transitions/film/transition.d.ts.map +1 -0
- package/dist/transitions/hero/index.d.ts +6 -0
- package/dist/transitions/hero/index.d.ts.map +1 -0
- package/dist/transitions/hero/transition.d.ts +7 -0
- package/dist/transitions/hero/transition.d.ts.map +1 -0
- package/dist/transitions/index.d.ts +10 -12
- package/dist/transitions/index.d.ts.map +1 -1
- package/dist/transitions/jaemin/index.d.ts +6 -0
- package/dist/transitions/jaemin/index.d.ts.map +1 -0
- package/dist/transitions/jaemin/transition.d.ts +18 -0
- package/dist/transitions/jaemin/transition.d.ts.map +1 -0
- package/dist/transitions/rotate/index.d.ts +6 -0
- package/dist/transitions/rotate/index.d.ts.map +1 -0
- package/dist/transitions/rotate/transition.d.ts +6 -0
- package/dist/transitions/rotate/transition.d.ts.map +1 -0
- package/dist/transitions/scroll/index.d.ts +15 -0
- package/dist/transitions/scroll/index.d.ts.map +1 -0
- package/dist/transitions/scroll/transition.d.ts +7 -0
- package/dist/transitions/scroll/transition.d.ts.map +1 -0
- package/dist/transitions/sheet/index.d.ts +9 -0
- package/dist/transitions/sheet/index.d.ts.map +1 -0
- package/dist/transitions/sheet/provider/background-scale.d.ts +3 -0
- package/dist/transitions/sheet/provider/background-scale.d.ts.map +1 -0
- package/dist/transitions/sheet/provider/index.d.ts +3 -0
- package/dist/transitions/sheet/provider/index.d.ts.map +1 -0
- package/dist/transitions/sheet/provider/static.d.ts +3 -0
- package/dist/transitions/sheet/provider/static.d.ts.map +1 -0
- package/dist/transitions/sheet/transition.d.ts +5 -0
- package/dist/transitions/sheet/transition.d.ts.map +1 -0
- package/dist/transitions/sheet/types.d.ts +19 -0
- package/dist/transitions/sheet/types.d.ts.map +1 -0
- package/dist/transitions/slide/index.d.ts +6 -0
- package/dist/transitions/slide/index.d.ts.map +1 -0
- package/dist/transitions/slide/transition.d.ts +7 -0
- package/dist/transitions/slide/transition.d.ts.map +1 -0
- package/dist/transitions/strip/index.d.ts +6 -0
- package/dist/transitions/strip/index.d.ts.map +1 -0
- package/dist/transitions/strip/transition.d.ts +6 -0
- package/dist/transitions/strip/transition.d.ts.map +1 -0
- package/dist/transitions/utils.d.ts +11 -7
- package/dist/transitions/utils.d.ts.map +1 -1
- package/dist/transitions/zoom/index.d.ts +8 -0
- package/dist/transitions/zoom/index.d.ts.map +1 -0
- package/dist/transitions/zoom/provider/expand.d.ts +5 -0
- package/dist/transitions/zoom/provider/expand.d.ts.map +1 -0
- package/dist/transitions/zoom/provider/index.d.ts +3 -0
- package/dist/transitions/zoom/provider/index.d.ts.map +1 -0
- package/dist/transitions/zoom/provider/static.d.ts +5 -0
- package/dist/transitions/zoom/provider/static.d.ts.map +1 -0
- package/dist/transitions/zoom/transition.d.ts +5 -0
- package/dist/transitions/zoom/transition.d.ts.map +1 -0
- package/dist/transitions/zoom/types.d.ts +34 -0
- package/dist/transitions/zoom/types.d.ts.map +1 -0
- package/dist/transitions/zoom/zoom-element.d.ts +4 -0
- package/dist/transitions/zoom/zoom-element.d.ts.map +1 -0
- package/dist/types/index.d.ts +175 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types.cjs +1 -1
- package/dist/types.d.ts +2 -504
- package/dist/types.js +3 -77
- package/dist/utils/get-viewport-rect.d.ts +17 -0
- package/dist/utils/get-viewport-rect.d.ts.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/prepare-outgoing.d.ts +2 -2
- package/dist/utils/prepare-outgoing.d.ts.map +1 -1
- package/dist/utils/promise-all.d.ts +18 -0
- package/dist/utils/promise-all.d.ts.map +1 -0
- package/package.json +7 -19
- package/dist/animator/integrator/double-spring-integrator.d.ts.map +0 -1
- package/dist/animator/integrator/index.d.ts.map +0 -1
- package/dist/animator/integrator/inertia-integrator.d.ts.map +0 -1
- package/dist/animator/integrator/provider.d.ts.map +0 -1
- package/dist/animator/integrator/spring-integrator.d.ts.map +0 -1
- package/dist/animator/integrator/types.d.ts.map +0 -1
- package/dist/animator/multi-animator.d.ts +0 -101
- package/dist/animator/multi-animator.d.ts.map +0 -1
- package/dist/animator/runner/css-runner.d.ts +0 -17
- package/dist/animator/runner/css-runner.d.ts.map +0 -1
- package/dist/animator/runner/keyframes-runner.d.ts +0 -14
- package/dist/animator/runner/keyframes-runner.d.ts.map +0 -1
- package/dist/animator/runner/provider.d.ts +0 -44
- package/dist/animator/runner/provider.d.ts.map +0 -1
- package/dist/animator/runner/tick-runner.d.ts +0 -16
- package/dist/animator/runner/tick-runner.d.ts.map +0 -1
- package/dist/animator/runner/ticker.d.ts +0 -38
- package/dist/animator/runner/ticker.d.ts.map +0 -1
- package/dist/animator/runner/types.d.ts +0 -34
- package/dist/animator/runner/types.d.ts.map +0 -1
- package/dist/animator/single-animator.d.ts +0 -65
- package/dist/animator/single-animator.d.ts.map +0 -1
- package/dist/animator/types.d.ts +0 -57
- package/dist/animator/types.d.ts.map +0 -1
- package/dist/presets/index.cjs +0 -1
- package/dist/presets/index.d.ts +0 -22
- package/dist/presets/index.d.ts.map +0 -1
- package/dist/presets/index.js +0 -50
- package/dist/provider-B2B8CK6H.js +0 -142
- package/dist/provider-BKaONTeg.cjs +0 -1
- package/dist/spring-integrator-95Mh7mdw.cjs +0 -1
- package/dist/spring-integrator-BM4a-82c.js +0 -33
- package/dist/transition/create-transition-callback.d.ts +0 -8
- package/dist/transition/create-transition-callback.d.ts.map +0 -1
- package/dist/transition/transition-scope.d.ts +0 -36
- package/dist/transition/transition-scope.d.ts.map +0 -1
- package/dist/transition/transition-strategy.d.ts +0 -75
- package/dist/transition/transition-strategy.d.ts.map +0 -1
- package/dist/transition/transition.d.ts +0 -51
- package/dist/transition/transition.d.ts.map +0 -1
- package/dist/transition/unmount-observer.d.ts +0 -43
- package/dist/transition/unmount-observer.d.ts.map +0 -1
- package/dist/transitions/blur.d.ts +0 -12
- package/dist/transitions/blur.d.ts.map +0 -1
- package/dist/transitions/bounce.d.ts +0 -13
- package/dist/transitions/bounce.d.ts.map +0 -1
- package/dist/transitions/fade.d.ts +0 -10
- package/dist/transitions/fade.d.ts.map +0 -1
- package/dist/transitions/fly.d.ts +0 -11
- package/dist/transitions/fly.d.ts.map +0 -1
- package/dist/transitions/index.cjs +0 -1
- package/dist/transitions/index.js +0 -285
- package/dist/transitions/mask.d.ts +0 -12
- package/dist/transitions/mask.d.ts.map +0 -1
- package/dist/transitions/none.d.ts +0 -8
- package/dist/transitions/none.d.ts.map +0 -1
- package/dist/transitions/rotate.d.ts +0 -15
- package/dist/transitions/rotate.d.ts.map +0 -1
- package/dist/transitions/scale.d.ts +0 -11
- package/dist/transitions/scale.d.ts.map +0 -1
- package/dist/transitions/slide.d.ts +0 -13
- package/dist/transitions/slide.d.ts.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/view-transitions/blind.d.ts +0 -11
- package/dist/view-transitions/blind.d.ts.map +0 -1
- package/dist/view-transitions/curtain-reveal.d.ts +0 -18
- package/dist/view-transitions/curtain-reveal.d.ts.map +0 -1
- package/dist/view-transitions/depth.d.ts +0 -21
- package/dist/view-transitions/depth.d.ts.map +0 -1
- package/dist/view-transitions/drill.d.ts +0 -9
- package/dist/view-transitions/drill.d.ts.map +0 -1
- package/dist/view-transitions/fade.d.ts +0 -8
- package/dist/view-transitions/fade.d.ts.map +0 -1
- package/dist/view-transitions/film.d.ts +0 -10
- package/dist/view-transitions/film.d.ts.map +0 -1
- package/dist/view-transitions/hero.d.ts +0 -9
- package/dist/view-transitions/hero.d.ts.map +0 -1
- package/dist/view-transitions/index.cjs +0 -35
- package/dist/view-transitions/index.d.ts +0 -18
- package/dist/view-transitions/index.d.ts.map +0 -1
- package/dist/view-transitions/index.js +0 -1614
- package/dist/view-transitions/instagram.d.ts +0 -8
- package/dist/view-transitions/instagram.d.ts.map +0 -1
- package/dist/view-transitions/jaemin.d.ts +0 -21
- package/dist/view-transitions/jaemin.d.ts.map +0 -1
- package/dist/view-transitions/pinterest.d.ts +0 -8
- package/dist/view-transitions/pinterest.d.ts.map +0 -1
- package/dist/view-transitions/rotate.d.ts +0 -6
- package/dist/view-transitions/rotate.d.ts.map +0 -1
- package/dist/view-transitions/scroll.d.ts +0 -8
- package/dist/view-transitions/scroll.d.ts.map +0 -1
- package/dist/view-transitions/sheet.d.ts +0 -21
- package/dist/view-transitions/sheet.d.ts.map +0 -1
- package/dist/view-transitions/slide.d.ts +0 -8
- package/dist/view-transitions/slide.d.ts.map +0 -1
- package/dist/view-transitions/snap.d.ts +0 -16
- package/dist/view-transitions/snap.d.ts.map +0 -1
- package/dist/view-transitions/strip.d.ts +0 -7
- package/dist/view-transitions/strip.d.ts.map +0 -1
- package/dist/view-transitions/swap.d.ts +0 -15
- package/dist/view-transitions/swap.d.ts.map +0 -1
- /package/dist/{animator → animation}/integrator/double-spring-integrator.d.ts +0 -0
- /package/dist/{animator → animation}/integrator/inertia-integrator.d.ts +0 -0
- /package/dist/{animator → animation}/integrator/spring-integrator.d.ts +0 -0
- /package/dist/{animator → animation}/integrator/types.d.ts +0 -0
package/dist/index.js
CHANGED
|
@@ -1,1291 +1,1370 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
// Lag smoothing (mobile optimization)
|
|
18
|
-
d(this, "lagThreshold", 500);
|
|
19
|
-
// ms - detect tab switches, backgrounding
|
|
20
|
-
d(this, "adjustedLag", 33);
|
|
21
|
-
// ms - max time jump to prevent animation skip
|
|
22
|
-
d(this, "maxDeltaTime", 33);
|
|
23
|
-
// ms - clamp for physics stability (30fps minimum)
|
|
24
|
-
// FPS throttling
|
|
25
|
-
d(this, "gap", 1e3 / 240);
|
|
26
|
-
// max 240fps
|
|
27
|
-
d(this, "nextTime", this.gap);
|
|
28
|
-
d(this, "tick", () => {
|
|
29
|
-
const i = Date.now();
|
|
30
|
-
let n = i - this.lastUpdate;
|
|
31
|
-
n > this.lagThreshold || n < 0 ? (this.startTime += n - this.adjustedLag, n = this.adjustedLag) : n > this.maxDeltaTime && (n = this.maxDeltaTime), this.lastUpdate = i;
|
|
32
|
-
const r = i - this.startTime, o = r - this.nextTime;
|
|
33
|
-
if (o > 0) {
|
|
34
|
-
const s = n / 1e3;
|
|
35
|
-
this.elapsed = r / 1e3, this.nextTime += o + (o >= this.gap ? 4 : this.gap - o), this.listeners.forEach((m) => {
|
|
36
|
-
m(s, this.elapsed);
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
this.listeners.size > 0 ? this.rafId = requestAnimationFrame(this.tick) : (this.isRunning = !1, this.rafId = null);
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
subscribe(i) {
|
|
43
|
-
return this.listeners.add(i), this.isRunning || (this.isRunning = !0, this.rafId = requestAnimationFrame(this.tick)), () => {
|
|
44
|
-
this.unsubscribe(i);
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
unsubscribe(i) {
|
|
48
|
-
this.listeners.delete(i), this.listeners.size === 0 && this.rafId !== null && (cancelAnimationFrame(this.rafId), this.isRunning = !1, this.rafId = null);
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Configure lag smoothing behavior
|
|
52
|
-
* @param threshold - Time threshold to detect lag (default: 500ms)
|
|
53
|
-
* @param adjustedLag - Max time jump when lag detected (default: 33ms)
|
|
54
|
-
*/
|
|
55
|
-
lagSmoothing(i, t) {
|
|
56
|
-
this.lagThreshold = i, this.adjustedLag = Math.min(t, i);
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Set maximum FPS
|
|
60
|
-
* @param fps - Target FPS (default: 240)
|
|
61
|
-
*/
|
|
62
|
-
fps(i) {
|
|
63
|
-
this.gap = 1e3 / i, this.nextTime = this.elapsed * 1e3 + this.gap;
|
|
64
|
-
}
|
|
65
|
-
getListenerCount() {
|
|
66
|
-
return this.listeners.size;
|
|
67
|
-
}
|
|
68
|
-
getElapsed() {
|
|
69
|
-
return this.elapsed;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
const z = new at();
|
|
73
|
-
function ct(e) {
|
|
74
|
-
const {
|
|
75
|
-
integrator: i,
|
|
76
|
-
from: t,
|
|
77
|
-
to: n,
|
|
78
|
-
velocity: r = 0,
|
|
79
|
-
onUpdate: o,
|
|
80
|
-
onComplete: s,
|
|
81
|
-
onStart: m
|
|
82
|
-
} = e;
|
|
83
|
-
let l = { position: t, velocity: r }, u = !0, h = 0, v = !1;
|
|
84
|
-
const E = (S) => {
|
|
85
|
-
if (u) {
|
|
86
|
-
if (v || (v = !0, m == null || m()), l = i.step(l, n, S), i.isSettled(l, n)) {
|
|
87
|
-
if (h += Math.min(S, 0.033), h >= Z) {
|
|
88
|
-
l = { position: n, velocity: 0 }, u = !1, o(l.position), z.unsubscribe(E), s();
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
} else
|
|
92
|
-
h = 0;
|
|
93
|
-
o(l.position);
|
|
1
|
+
var ht = Object.defineProperty;
|
|
2
|
+
var mt = (e, t, n) => t in e ? ht(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var S = (e, t, n) => mt(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import { P as B, V as nt, W as w, M as $, S as ut } from "./multi-animation-CST6aZ8y.js";
|
|
5
|
+
import { A as Xe } from "./multi-animation-CST6aZ8y.js";
|
|
6
|
+
function P(e, t) {
|
|
7
|
+
const n = [];
|
|
8
|
+
for (let s = 0; s < e.length; s++)
|
|
9
|
+
for (let o = s + 1; o < e.length; o++) {
|
|
10
|
+
const a = e[s], i = e[o];
|
|
11
|
+
!a || !i || n.push({
|
|
12
|
+
from: a,
|
|
13
|
+
to: i,
|
|
14
|
+
transition: t(),
|
|
15
|
+
symmetric: !0
|
|
16
|
+
});
|
|
94
17
|
}
|
|
95
|
-
|
|
96
|
-
return z.subscribe(E), {
|
|
97
|
-
stop: () => {
|
|
98
|
-
u && (u = !1, z.unsubscribe(E));
|
|
99
|
-
},
|
|
100
|
-
getPosition: () => l.position,
|
|
101
|
-
getVelocity: () => l.velocity,
|
|
102
|
-
isRunning: () => u
|
|
103
|
-
};
|
|
18
|
+
return n;
|
|
104
19
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
if (m.push({
|
|
112
|
-
time: u,
|
|
113
|
-
position: o.position,
|
|
114
|
-
velocity: o.velocity
|
|
115
|
-
}), o = e.step(o, t, L / 1e3), e.isSettled(o, t)) {
|
|
116
|
-
if (s += L / 1e3, s >= Z) {
|
|
117
|
-
m.push({
|
|
118
|
-
time: (l + 1) * L,
|
|
119
|
-
position: t,
|
|
120
|
-
velocity: 0
|
|
121
|
-
});
|
|
122
|
-
break;
|
|
123
|
-
}
|
|
124
|
-
} else
|
|
125
|
-
s = 0;
|
|
126
|
-
}
|
|
127
|
-
return m;
|
|
128
|
-
}
|
|
129
|
-
function U(e, i) {
|
|
130
|
-
if (e.length === 0)
|
|
131
|
-
return { position: 0, velocity: 0 };
|
|
132
|
-
const t = e[0], n = e[e.length - 1];
|
|
133
|
-
if (i <= 0)
|
|
134
|
-
return { position: t.position, velocity: t.velocity };
|
|
135
|
-
if (i >= n.time)
|
|
136
|
-
return { position: n.position, velocity: n.velocity };
|
|
137
|
-
let r = 0, o = e.length - 1;
|
|
138
|
-
for (; r < o - 1; ) {
|
|
139
|
-
const u = Math.floor((r + o) / 2);
|
|
140
|
-
e[u].time <= i ? r = u : o = u;
|
|
141
|
-
}
|
|
142
|
-
const s = e[r], m = e[o], l = (i - s.time) / (m.time - s.time);
|
|
143
|
-
return {
|
|
144
|
-
position: s.position + (m.position - s.position) * l,
|
|
145
|
-
velocity: s.velocity + (m.velocity - s.velocity) * l
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
function ut(e, i) {
|
|
149
|
-
return e.map((t) => i(t.position));
|
|
150
|
-
}
|
|
151
|
-
function ft(e) {
|
|
152
|
-
const {
|
|
153
|
-
integrator: i,
|
|
154
|
-
element: t,
|
|
155
|
-
from: n,
|
|
156
|
-
to: r,
|
|
157
|
-
velocity: o = 0,
|
|
158
|
-
style: s,
|
|
159
|
-
onComplete: m,
|
|
160
|
-
onStart: l
|
|
161
|
-
} = e, u = lt(i, n, r, o);
|
|
162
|
-
if (u.length === 0)
|
|
163
|
-
return l == null || l(), m(), {
|
|
164
|
-
stop: () => {
|
|
165
|
-
},
|
|
166
|
-
getPosition: () => r,
|
|
167
|
-
getVelocity: () => 0,
|
|
168
|
-
isRunning: () => !1
|
|
169
|
-
};
|
|
170
|
-
const h = ut(u, s), v = u[u.length - 1], E = v.time, S = h[0];
|
|
171
|
-
if (S)
|
|
172
|
-
for (const T of Object.keys(S))
|
|
173
|
-
t.style[T] = "";
|
|
174
|
-
const y = t.animate(h, {
|
|
175
|
-
duration: E,
|
|
176
|
-
fill: "forwards",
|
|
177
|
-
easing: "linear",
|
|
178
|
-
composite: "replace"
|
|
179
|
-
});
|
|
180
|
-
let p = !0;
|
|
181
|
-
const k = performance.now();
|
|
182
|
-
return l == null || l(), y.onfinish = () => {
|
|
183
|
-
p && (p = !1, m());
|
|
184
|
-
}, {
|
|
185
|
-
stop: () => {
|
|
186
|
-
p && (p = !1, y.cancel());
|
|
187
|
-
},
|
|
188
|
-
getPosition: () => {
|
|
189
|
-
if (!p)
|
|
190
|
-
return v.position;
|
|
191
|
-
const T = performance.now() - k;
|
|
192
|
-
return U(u, T).position;
|
|
193
|
-
},
|
|
194
|
-
getVelocity: () => {
|
|
195
|
-
if (!p)
|
|
196
|
-
return 0;
|
|
197
|
-
const T = performance.now() - k;
|
|
198
|
-
return U(u, T).velocity;
|
|
199
|
-
},
|
|
200
|
-
isRunning: () => p
|
|
201
|
-
};
|
|
202
|
-
}
|
|
203
|
-
function mt(e) {
|
|
204
|
-
const {
|
|
205
|
-
element: i,
|
|
206
|
-
frames: t,
|
|
207
|
-
duration: n,
|
|
208
|
-
easing: r = "linear",
|
|
209
|
-
from: o,
|
|
210
|
-
to: s,
|
|
211
|
-
onComplete: m,
|
|
212
|
-
onStart: l
|
|
213
|
-
} = e, u = t[0];
|
|
214
|
-
if (u)
|
|
215
|
-
for (const S of Object.keys(u))
|
|
216
|
-
S === "offset" || S === "easing" || S === "composite" || (i.style[S] = "");
|
|
217
|
-
const h = i.animate(t, {
|
|
218
|
-
duration: n,
|
|
219
|
-
fill: "forwards",
|
|
220
|
-
easing: r,
|
|
221
|
-
composite: "replace"
|
|
222
|
-
});
|
|
223
|
-
let v = !0;
|
|
224
|
-
const E = performance.now();
|
|
225
|
-
return l == null || l(), h.onfinish = () => {
|
|
226
|
-
v && (v = !1, m());
|
|
227
|
-
}, {
|
|
228
|
-
stop: () => {
|
|
229
|
-
v && (v = !1, h.cancel());
|
|
230
|
-
},
|
|
231
|
-
// Linear progress mapped onto [from, to] — used by MultiAnimator for
|
|
232
|
-
// stagger thresholds. The actual visual motion is whatever the keyframes
|
|
233
|
-
// dictate; this mapping just gives the orchestration layer a monotonic
|
|
234
|
-
// progress signal.
|
|
235
|
-
getPosition: () => {
|
|
236
|
-
if (!v) return s;
|
|
237
|
-
const S = performance.now() - E, y = Math.min(Math.max(S / n, 0), 1);
|
|
238
|
-
return o + (s - o) * y;
|
|
239
|
-
},
|
|
240
|
-
// Baked animations don't expose velocity — interruption/resumption isn't
|
|
241
|
-
// supported here (you can stop, but can't resume mid-flight with momentum).
|
|
242
|
-
getVelocity: () => 0,
|
|
243
|
-
isRunning: () => v
|
|
244
|
-
};
|
|
245
|
-
}
|
|
246
|
-
function dt(e) {
|
|
247
|
-
const { to: i, onStart: t, onComplete: n } = e;
|
|
248
|
-
return t == null || t(), n(), {
|
|
249
|
-
stop: () => {
|
|
20
|
+
function st(e, t) {
|
|
21
|
+
return [
|
|
22
|
+
{
|
|
23
|
+
from: e.exit,
|
|
24
|
+
to: e.enter,
|
|
25
|
+
transition: t("enter")
|
|
250
26
|
},
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
27
|
+
{
|
|
28
|
+
from: e.enter,
|
|
29
|
+
to: e.exit,
|
|
30
|
+
transition: t("exit")
|
|
31
|
+
}
|
|
32
|
+
];
|
|
255
33
|
}
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
34
|
+
function ot(e, t, n) {
|
|
35
|
+
const s = [];
|
|
36
|
+
for (let o = 0; o < e.length; o++)
|
|
37
|
+
for (let a = o + 1; a < e.length; a++) {
|
|
38
|
+
const i = e[o], l = e[a];
|
|
39
|
+
!i || !l || s.push(
|
|
40
|
+
{
|
|
41
|
+
from: i,
|
|
42
|
+
to: l,
|
|
43
|
+
transition: n(t.forward)
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
from: l,
|
|
47
|
+
to: i,
|
|
48
|
+
transition: n(t.backward)
|
|
49
|
+
}
|
|
269
50
|
);
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
frames: r.frames,
|
|
273
|
-
duration: r.duration,
|
|
274
|
-
easing: r.easing,
|
|
275
|
-
from: s.from,
|
|
276
|
-
to: s.to,
|
|
277
|
-
onComplete: s.onComplete,
|
|
278
|
-
onStart: s.onStart
|
|
279
|
-
}) : n ? (s) => {
|
|
280
|
-
if (!s.integrator)
|
|
281
|
-
throw new Error("css mode requires an integrator");
|
|
282
|
-
return ft({
|
|
283
|
-
integrator: s.integrator,
|
|
284
|
-
from: s.from,
|
|
285
|
-
to: s.to,
|
|
286
|
-
velocity: s.velocity,
|
|
287
|
-
onComplete: s.onComplete,
|
|
288
|
-
onStart: s.onStart,
|
|
289
|
-
element: n.element,
|
|
290
|
-
style: n.style
|
|
291
|
-
});
|
|
292
|
-
} : t ? (s) => {
|
|
293
|
-
if (!s.integrator)
|
|
294
|
-
throw new Error("tick mode requires an integrator");
|
|
295
|
-
return ct({
|
|
296
|
-
integrator: s.integrator,
|
|
297
|
-
from: s.from,
|
|
298
|
-
to: s.to,
|
|
299
|
-
velocity: s.velocity,
|
|
300
|
-
onComplete: s.onComplete,
|
|
301
|
-
onStart: s.onStart,
|
|
302
|
-
onUpdate: t
|
|
303
|
-
});
|
|
304
|
-
} : dt;
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
class J {
|
|
51
|
+
}
|
|
52
|
+
return s;
|
|
308
53
|
}
|
|
309
|
-
|
|
310
|
-
class B extends J {
|
|
54
|
+
class v {
|
|
311
55
|
constructor(t) {
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
d(this, "isKeyframesMode");
|
|
321
|
-
if (this.options = {
|
|
322
|
-
from: t.from ?? 0,
|
|
323
|
-
to: t.to ?? 1,
|
|
324
|
-
physics: t.physics,
|
|
325
|
-
onComplete: t.onComplete ?? (() => {
|
|
326
|
-
}),
|
|
327
|
-
onStart: t.onStart
|
|
328
|
-
}, this.currentValue = this.options.from, this.isKeyframesMode = !!t.keyframes, t.tick)
|
|
329
|
-
this.updateFn = (n) => {
|
|
330
|
-
var r;
|
|
331
|
-
return (r = t.tick) == null ? void 0 : r.call(t, n);
|
|
332
|
-
};
|
|
333
|
-
else if (t.css) {
|
|
334
|
-
const { element: n, style: r } = t.css;
|
|
335
|
-
this.updateFn = (o) => {
|
|
336
|
-
const s = r(o);
|
|
337
|
-
for (const [m, l] of Object.entries(s))
|
|
338
|
-
n.style[m] = typeof l == "number" ? String(l) : l;
|
|
339
|
-
};
|
|
340
|
-
} else
|
|
341
|
-
this.updateFn = () => {
|
|
342
|
-
};
|
|
343
|
-
this.runner = ht.from({
|
|
344
|
-
tick: t.tick,
|
|
345
|
-
css: t.css,
|
|
346
|
-
keyframes: t.keyframes
|
|
347
|
-
});
|
|
348
|
-
}
|
|
349
|
-
/**
|
|
350
|
-
* Sync element state to current progress value
|
|
351
|
-
* Uses the update callback if provided
|
|
352
|
-
*/
|
|
353
|
-
syncState() {
|
|
354
|
-
var t;
|
|
355
|
-
(t = this.updateFn) == null || t.call(this, this.currentValue);
|
|
356
|
-
}
|
|
357
|
-
/**
|
|
358
|
-
* Create Integrator from physics options
|
|
359
|
-
* Priority: integrator factory > inertia/spring config > default spring
|
|
360
|
-
*/
|
|
361
|
-
createIntegrator() {
|
|
362
|
-
const t = this.options.physics;
|
|
363
|
-
return t != null && t.integrator ? t.integrator() : t != null && t.spring || t != null && t.inertia ? st.from({
|
|
364
|
-
spring: t.spring,
|
|
365
|
-
inertia: t.inertia
|
|
366
|
-
}) : new ot(gt);
|
|
56
|
+
S(this, "omega");
|
|
57
|
+
// Angular frequency
|
|
58
|
+
S(this, "zeta");
|
|
59
|
+
// Damping ratio
|
|
60
|
+
S(this, "restDelta");
|
|
61
|
+
S(this, "restSpeed");
|
|
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 ?? B, this.restSpeed = t.restSpeed ?? nt;
|
|
367
64
|
}
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
// Keyframes mode plays a pre-baked WAAPI animation — no integrator
|
|
371
|
-
// needed. tick/css modes still require one.
|
|
372
|
-
integrator: this.isKeyframesMode ? void 0 : this.createIntegrator(),
|
|
373
|
-
from: this.currentValue,
|
|
374
|
-
to: t,
|
|
375
|
-
velocity: this.currentVelocity,
|
|
376
|
-
onStart: this.options.onStart,
|
|
377
|
-
onComplete: () => {
|
|
378
|
-
this.currentValue = t, this.currentVelocity = 0, this.isAnimating = !1, this.controls = null, this.options.onComplete();
|
|
379
|
-
}
|
|
380
|
-
});
|
|
381
|
-
}
|
|
382
|
-
forward() {
|
|
383
|
-
this.stop(), this.runAnimation(this.options.to);
|
|
384
|
-
}
|
|
385
|
-
backward() {
|
|
386
|
-
this.stop(), this.runAnimation(this.options.from);
|
|
387
|
-
}
|
|
388
|
-
reverse() {
|
|
389
|
-
const t = this.options.from;
|
|
390
|
-
this.options.from = this.options.to, this.options.to = t, this.isAnimating && (this.stop(), this.runAnimation(this.options.to));
|
|
391
|
-
}
|
|
392
|
-
stop() {
|
|
393
|
-
this.controls && (this.currentValue = this.controls.getPosition(), this.currentVelocity = this.controls.getVelocity(), this.controls.stop(), this.controls = null), this.isAnimating = !1;
|
|
394
|
-
}
|
|
395
|
-
getVelocity() {
|
|
396
|
-
var t;
|
|
397
|
-
return ((t = this.controls) == null ? void 0 : t.getVelocity()) ?? this.currentVelocity;
|
|
398
|
-
}
|
|
399
|
-
getCurrentValue() {
|
|
400
|
-
var t;
|
|
401
|
-
return ((t = this.controls) == null ? void 0 : t.getPosition()) ?? this.currentValue;
|
|
402
|
-
}
|
|
403
|
-
getIsAnimating() {
|
|
404
|
-
return this.isAnimating;
|
|
405
|
-
}
|
|
406
|
-
getCurrentState() {
|
|
65
|
+
step(t, n, s) {
|
|
66
|
+
const o = Math.min(s, 0.033), { omega: a, zeta: i } = this, { position: l, velocity: c } = t, r = -2 * o * i * a * c, p = o * a * a * (n - l), d = c + r + p;
|
|
407
67
|
return {
|
|
408
|
-
position:
|
|
409
|
-
velocity:
|
|
410
|
-
from: this.options.from,
|
|
411
|
-
to: this.options.to
|
|
68
|
+
position: l + o * d,
|
|
69
|
+
velocity: d
|
|
412
70
|
};
|
|
413
71
|
}
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
setVelocity(t) {
|
|
418
|
-
this.currentVelocity = t;
|
|
419
|
-
}
|
|
420
|
-
updateOptions(t) {
|
|
421
|
-
this.options = { ...this.options, ...t };
|
|
72
|
+
isSettled(t, n) {
|
|
73
|
+
const s = Math.abs(n - t.position), o = Math.abs(t.velocity);
|
|
74
|
+
return s < this.restDelta && o < this.restSpeed;
|
|
422
75
|
}
|
|
423
76
|
}
|
|
424
|
-
class
|
|
77
|
+
class yt {
|
|
425
78
|
constructor(t) {
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
}
|
|
443
|
-
generateId() {
|
|
444
|
-
return `spring_${this.idCounter++}`;
|
|
445
|
-
}
|
|
446
|
-
initializeAnimators() {
|
|
447
|
-
this.config.items.forEach((t, n) => {
|
|
448
|
-
const r = this.generateId(), o = new B({
|
|
449
|
-
from: this.from,
|
|
450
|
-
to: this.to,
|
|
451
|
-
physics: t.physics,
|
|
452
|
-
tick: t.tick,
|
|
453
|
-
css: t.css,
|
|
454
|
-
keyframes: t.keyframes,
|
|
455
|
-
onComplete: () => this.onAnimatorComplete(r),
|
|
456
|
-
onStart: t.onStart
|
|
457
|
-
});
|
|
458
|
-
(n === 0 || t.normalizedOffset === 0) && (o.setValue(this.initialState.position), o.setVelocity(this.initialState.velocity), o.syncState()), this.animators.set(r, {
|
|
459
|
-
id: r,
|
|
460
|
-
item: t,
|
|
461
|
-
animator: o,
|
|
462
|
-
started: !1
|
|
463
|
-
}), this.itemOrder.push(r);
|
|
79
|
+
S(this, "leader");
|
|
80
|
+
S(this, "follower");
|
|
81
|
+
S(this, "restDelta");
|
|
82
|
+
S(this, "restSpeed");
|
|
83
|
+
this.restDelta = t.restDelta ?? B, this.restSpeed = t.restSpeed ?? nt, this.leader = new v({
|
|
84
|
+
stiffness: t.stiffness,
|
|
85
|
+
damping: t.damping,
|
|
86
|
+
restDelta: this.restDelta,
|
|
87
|
+
restSpeed: this.restSpeed
|
|
88
|
+
});
|
|
89
|
+
let n, s, o, a;
|
|
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, a = t.follower.restSpeed) : (n = t.stiffness, s = t.damping), this.follower = new v({
|
|
91
|
+
stiffness: n,
|
|
92
|
+
damping: s,
|
|
93
|
+
restDelta: o ?? this.restDelta,
|
|
94
|
+
restSpeed: a ?? this.restSpeed
|
|
464
95
|
});
|
|
465
96
|
}
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
getOrderedIds() {
|
|
480
|
-
return this.direction === "forward" ? this.itemOrder : [...this.itemOrder].reverse();
|
|
481
|
-
}
|
|
482
|
-
onAnimatorComplete(t) {
|
|
483
|
-
var r, o, s, m, l, u;
|
|
484
|
-
const n = this.animators.get(t);
|
|
485
|
-
!n || this.completedAnimators.has(t) || (this.completedAnimators.add(t), this.completedCount++, (o = (r = n.item).onComplete) == null || o.call(r), (m = (s = this.config).onProgress) == null || m.call(s, this.completedCount, this.config.items.length), this.completedCount === this.config.items.length && (this.stopScheduler(), (u = (l = this.config).onEnd) == null || u.call(l)));
|
|
486
|
-
}
|
|
487
|
-
/**
|
|
488
|
-
* Check and start springs based on previous spring's progress
|
|
489
|
-
* Called on each frame while animation is running
|
|
490
|
-
*/
|
|
491
|
-
checkAndStartSprings() {
|
|
492
|
-
const t = this.getOrderedIds();
|
|
493
|
-
for (let n = 0; n < t.length; n++) {
|
|
494
|
-
const r = t[n], o = this.animators.get(r);
|
|
495
|
-
if (!o || o.started) continue;
|
|
496
|
-
if (n === 0) {
|
|
497
|
-
this.startAnimator(r);
|
|
498
|
-
continue;
|
|
499
|
-
}
|
|
500
|
-
const s = t[n - 1], m = this.animators.get(s);
|
|
501
|
-
if (!m || !m.started) continue;
|
|
502
|
-
const l = this.getAnimatorProgress(m), u = o.item.normalizedOffset;
|
|
503
|
-
l >= u && this.startAnimator(r);
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
startAnimator(t) {
|
|
507
|
-
const n = this.animators.get(t);
|
|
508
|
-
!n || n.started || (n.started = !0, this.direction === "forward" ? n.animator.forward() : n.animator.backward());
|
|
509
|
-
}
|
|
510
|
-
/**
|
|
511
|
-
* Start the scheduler loop that checks spring progress
|
|
512
|
-
*/
|
|
513
|
-
startScheduler() {
|
|
514
|
-
const t = () => {
|
|
515
|
-
this.checkAndStartSprings(), this.getIsAnimating() && (this.rafId = requestAnimationFrame(t));
|
|
97
|
+
step(t, n, s) {
|
|
98
|
+
const a = t._leader ?? {
|
|
99
|
+
position: t.position,
|
|
100
|
+
velocity: t.velocity
|
|
101
|
+
}, i = this.leader.step(a, n, s), l = this.follower.step(
|
|
102
|
+
t,
|
|
103
|
+
i.position,
|
|
104
|
+
s
|
|
105
|
+
);
|
|
106
|
+
return {
|
|
107
|
+
position: l.position,
|
|
108
|
+
velocity: l.velocity,
|
|
109
|
+
_leader: i
|
|
516
110
|
};
|
|
517
|
-
t();
|
|
518
|
-
}
|
|
519
|
-
stopScheduler() {
|
|
520
|
-
this.rafId !== null && (cancelAnimationFrame(this.rafId), this.rafId = null);
|
|
521
|
-
}
|
|
522
|
-
getFirstAnimator() {
|
|
523
|
-
var n;
|
|
524
|
-
const t = this.itemOrder[0];
|
|
525
|
-
return t ? ((n = this.animators.get(t)) == null ? void 0 : n.animator) ?? null : null;
|
|
526
|
-
}
|
|
527
|
-
forward() {
|
|
528
|
-
var t, n;
|
|
529
|
-
this.stop(), this.direction = "forward", this.completedCount = 0, this.completedAnimators.clear(), this.resetStartedFlags(), (n = (t = this.config).onStart) == null || n.call(t), this.startScheduler();
|
|
530
|
-
}
|
|
531
|
-
backward() {
|
|
532
|
-
var t, n;
|
|
533
|
-
this.stop(), this.direction = "backward", this.completedCount = 0, this.completedAnimators.clear(), this.resetStartedFlags(), (n = (t = this.config).onStart) == null || n.call(t), this.startScheduler();
|
|
534
111
|
}
|
|
535
|
-
|
|
536
|
-
this.
|
|
537
|
-
|
|
538
|
-
});
|
|
539
|
-
}
|
|
540
|
-
stop() {
|
|
541
|
-
this.stopScheduler(), this.animators.forEach((t) => {
|
|
542
|
-
t.animator.stop(), t.started = !1;
|
|
543
|
-
});
|
|
112
|
+
isSettled(t, n) {
|
|
113
|
+
const s = t, o = Math.abs(n - t.position) < this.restDelta && Math.abs(t.velocity) < this.restSpeed;
|
|
114
|
+
return s._leader ? Math.abs(n - s._leader.position) < this.restDelta && Math.abs(s._leader.velocity) < this.restSpeed && o : o;
|
|
544
115
|
}
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
onComplete: () => this.onAnimatorComplete(t.id),
|
|
559
|
-
onStart: t.item.onStart
|
|
560
|
-
});
|
|
561
|
-
o.setValue(this.to), o.setVelocity(0), o.syncState(), o.forward(), t.animator = o;
|
|
562
|
-
} else
|
|
563
|
-
t.animator.reverse();
|
|
564
|
-
});
|
|
116
|
+
}
|
|
117
|
+
const gt = 0.01, wt = 500, bt = 10;
|
|
118
|
+
class St {
|
|
119
|
+
constructor(t) {
|
|
120
|
+
S(this, "acceleration");
|
|
121
|
+
S(this, "resistance");
|
|
122
|
+
S(this, "resistanceType");
|
|
123
|
+
S(this, "min");
|
|
124
|
+
S(this, "max");
|
|
125
|
+
S(this, "bounceStiffness");
|
|
126
|
+
S(this, "bounceDamping");
|
|
127
|
+
S(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 ?? wt, this.bounceDamping = t.bounceDamping ?? bt, this.restDelta = t.restDelta ?? gt;
|
|
565
129
|
}
|
|
566
|
-
|
|
567
|
-
const
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
130
|
+
step(t, n, s) {
|
|
131
|
+
const o = Math.min(s, 0.033), { acceleration: a, resistance: i, resistanceType: l, min: c, max: r } = this, { position: p, velocity: d } = t, h = c !== void 0 && p < c, u = r !== void 0 && p > r;
|
|
132
|
+
let f;
|
|
133
|
+
if (h || u) {
|
|
134
|
+
const b = p - (h ? c : r), C = -this.bounceStiffness * b, E = -this.bounceDamping * d;
|
|
135
|
+
f = C + E;
|
|
136
|
+
} else {
|
|
137
|
+
const x = n > p ? 1 : -1;
|
|
138
|
+
let b;
|
|
139
|
+
l === "linear" ? b = i * d : b = i * d * Math.abs(d), f = x * a - b;
|
|
140
|
+
}
|
|
141
|
+
const m = d + f * o;
|
|
142
|
+
let y = p + m * o;
|
|
143
|
+
if (!h && !u) {
|
|
144
|
+
const x = n > p ? 1 : -1;
|
|
145
|
+
(x > 0 && y > n || x < 0 && y < n) && (y = n);
|
|
146
|
+
}
|
|
147
|
+
return {
|
|
148
|
+
position: y,
|
|
149
|
+
velocity: y === n ? 0 : m
|
|
573
150
|
};
|
|
574
151
|
}
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
*/
|
|
578
|
-
getCurrentValue() {
|
|
579
|
-
const t = this.getFirstAnimator();
|
|
580
|
-
return (t == null ? void 0 : t.getCurrentValue()) ?? 0;
|
|
152
|
+
isSettled(t, n) {
|
|
153
|
+
return Math.abs(n - t.position) < this.restDelta;
|
|
581
154
|
}
|
|
155
|
+
}
|
|
156
|
+
class g {
|
|
582
157
|
/**
|
|
583
|
-
*
|
|
158
|
+
* Create an Integrator from physics config
|
|
159
|
+
*
|
|
160
|
+
* @param config Physics configuration (spring or inertia)
|
|
161
|
+
* @returns Appropriate Integrator instance
|
|
162
|
+
* @throws Error if both spring and inertia are provided
|
|
584
163
|
*/
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
164
|
+
static from(t) {
|
|
165
|
+
if (t.spring && t.inertia)
|
|
166
|
+
throw new Error(
|
|
167
|
+
"Cannot use both 'spring' and 'inertia' together. Choose one physics type."
|
|
168
|
+
);
|
|
169
|
+
if (t.inertia)
|
|
170
|
+
return new St({
|
|
171
|
+
acceleration: t.inertia.acceleration,
|
|
172
|
+
resistance: t.inertia.resistance,
|
|
173
|
+
resistanceType: t.inertia.resistanceType,
|
|
174
|
+
min: t.inertia.min,
|
|
175
|
+
max: t.inertia.max,
|
|
176
|
+
bounceStiffness: t.inertia.bounceStiffness,
|
|
177
|
+
bounceDamping: t.inertia.bounceDamping,
|
|
178
|
+
restDelta: t.inertia.restDelta
|
|
179
|
+
});
|
|
180
|
+
const n = t.spring ?? { stiffness: 300, damping: 30 };
|
|
181
|
+
if (n.doubleSpring) {
|
|
182
|
+
const s = n.doubleSpring;
|
|
183
|
+
let o;
|
|
184
|
+
return typeof s == "number" ? o = s : typeof s == "object" && (o = {
|
|
185
|
+
stiffness: s.stiffness,
|
|
186
|
+
damping: s.damping
|
|
187
|
+
}), new yt({
|
|
188
|
+
stiffness: n.stiffness,
|
|
189
|
+
damping: n.damping,
|
|
190
|
+
follower: o,
|
|
191
|
+
restDelta: n.restDelta,
|
|
192
|
+
restSpeed: n.restSpeed
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
return new v({
|
|
196
|
+
stiffness: n.stiffness,
|
|
197
|
+
damping: n.damping,
|
|
198
|
+
restDelta: n.restDelta,
|
|
199
|
+
restSpeed: n.restSpeed
|
|
200
|
+
});
|
|
588
201
|
}
|
|
589
202
|
/**
|
|
590
|
-
*
|
|
591
|
-
*
|
|
203
|
+
* Create an Integrator from SpringConfig (legacy support)
|
|
204
|
+
* @deprecated Use from({ spring: config }) instead
|
|
592
205
|
*/
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
n == null || n.setValue(t);
|
|
206
|
+
static fromSpring(t) {
|
|
207
|
+
return g.from({ spring: t });
|
|
596
208
|
}
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
const n = this.getFirstAnimator();
|
|
603
|
-
n == null || n.setVelocity(t);
|
|
209
|
+
}
|
|
210
|
+
class $t {
|
|
211
|
+
constructor(t) {
|
|
212
|
+
S(this, "durationSec");
|
|
213
|
+
this.durationSec = Math.max(1 / 60, t.durationSec);
|
|
604
214
|
}
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
if (t.animator.getIsAnimating())
|
|
611
|
-
return !0;
|
|
612
|
-
return !1;
|
|
215
|
+
step(t, n, s) {
|
|
216
|
+
const o = n - t.position;
|
|
217
|
+
if (o === 0) return t;
|
|
218
|
+
const a = Math.sign(o), i = Math.abs(o) / this.durationSec, l = a * i * s, c = t.position + l;
|
|
219
|
+
return (a > 0 ? c >= n : c <= n) ? { position: n, velocity: 0 } : { position: c, velocity: a * i };
|
|
613
220
|
}
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
* Uses first animator's state for initialization
|
|
617
|
-
*/
|
|
618
|
-
static fromState(t, n) {
|
|
619
|
-
return new _({ ...n, state: t });
|
|
221
|
+
isSettled(t, n) {
|
|
222
|
+
return Math.abs(t.position - n) < B;
|
|
620
223
|
}
|
|
621
224
|
}
|
|
622
|
-
const
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
}
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
// Will actually go 1→0 (backward means toward 'from')
|
|
668
|
-
};
|
|
225
|
+
const xt = {
|
|
226
|
+
spring: { stiffness: 200, damping: 22 }
|
|
227
|
+
}, Ct = 10, Et = "horizontal", Pt = "#000000";
|
|
228
|
+
function N(e, t, n, s, o, a) {
|
|
229
|
+
window.getComputedStyle(e).position === "static" && (e.style.position = "relative");
|
|
230
|
+
const l = document.createElement("div");
|
|
231
|
+
l.style.cssText = `
|
|
232
|
+
position: absolute;
|
|
233
|
+
top: 0;
|
|
234
|
+
left: 0;
|
|
235
|
+
width: 100%;
|
|
236
|
+
height: 100%;
|
|
237
|
+
pointer-events: none;
|
|
238
|
+
z-index: 9999;
|
|
239
|
+
overflow: hidden;
|
|
240
|
+
`;
|
|
241
|
+
const c = [];
|
|
242
|
+
for (let r = 0; r < t; r++) {
|
|
243
|
+
const p = document.createElement("div");
|
|
244
|
+
if (n === "horizontal") {
|
|
245
|
+
const d = 100 / t;
|
|
246
|
+
p.style.cssText = `
|
|
247
|
+
position: absolute;
|
|
248
|
+
top: ${d * r}%;
|
|
249
|
+
left: 0;
|
|
250
|
+
width: 100%;
|
|
251
|
+
height: calc(${d}% + 1px);
|
|
252
|
+
background: ${s};
|
|
253
|
+
transform: scaleX(${o === "hidden" ? 0 : 1});
|
|
254
|
+
transform-origin: ${a} center;
|
|
255
|
+
will-change: transform;
|
|
256
|
+
`;
|
|
257
|
+
} else {
|
|
258
|
+
const d = 100 / t;
|
|
259
|
+
p.style.cssText = `
|
|
260
|
+
position: absolute;
|
|
261
|
+
top: 0;
|
|
262
|
+
left: ${d * r}%;
|
|
263
|
+
width: calc(${d}% + 1px);
|
|
264
|
+
height: 100%;
|
|
265
|
+
background: ${s};
|
|
266
|
+
transform: scaleY(${o === "hidden" ? 0 : 1});
|
|
267
|
+
transform-origin: ${a === "left" ? "top" : "bottom"} center;
|
|
268
|
+
will-change: transform;
|
|
269
|
+
`;
|
|
669
270
|
}
|
|
670
|
-
|
|
671
|
-
config: await i.out,
|
|
672
|
-
state: {
|
|
673
|
-
position: 1,
|
|
674
|
-
velocity: 0
|
|
675
|
-
},
|
|
676
|
-
from: 1,
|
|
677
|
-
to: 0,
|
|
678
|
-
direction: "forward"
|
|
679
|
-
} : {
|
|
680
|
-
state: {
|
|
681
|
-
position: 1,
|
|
682
|
-
velocity: 0
|
|
683
|
-
},
|
|
684
|
-
from: 1,
|
|
685
|
-
to: 0,
|
|
686
|
-
direction: "forward"
|
|
687
|
-
};
|
|
271
|
+
c.push(p), l.appendChild(p);
|
|
688
272
|
}
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
273
|
+
return e.appendChild(l), { container: l, blinds: c };
|
|
274
|
+
}
|
|
275
|
+
const Dt = (e = {}) => {
|
|
276
|
+
const t = e.blindCount ?? Ct, n = e.direction ?? Et, s = e.blindColor ?? Pt, o = e.physics ?? xt;
|
|
277
|
+
return {
|
|
278
|
+
prepare: async ({ from: a, to: i }) => {
|
|
279
|
+
const l = await a, c = await i;
|
|
280
|
+
l.style.zIndex = "1000";
|
|
281
|
+
const r = N(
|
|
282
|
+
l,
|
|
283
|
+
t,
|
|
284
|
+
n,
|
|
285
|
+
s,
|
|
286
|
+
"hidden",
|
|
287
|
+
"left"
|
|
288
|
+
);
|
|
289
|
+
c.style.position = "relative", c.style.zIndex = "0";
|
|
290
|
+
const p = N(
|
|
291
|
+
c,
|
|
292
|
+
t,
|
|
293
|
+
n,
|
|
294
|
+
s,
|
|
295
|
+
"closed",
|
|
296
|
+
"right"
|
|
297
|
+
);
|
|
298
|
+
return {
|
|
299
|
+
fromBlinds: r.blinds,
|
|
300
|
+
fromContainer: r.container,
|
|
301
|
+
toBlinds: p.blinds,
|
|
302
|
+
toContainer: p.container
|
|
303
|
+
};
|
|
703
304
|
},
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
305
|
+
animation: ({ fromBlinds: a, fromContainer: i, toBlinds: l, toContainer: c }) => {
|
|
306
|
+
const r = a.map(
|
|
307
|
+
(u) => new w({
|
|
308
|
+
element: u,
|
|
309
|
+
integrator: g.from(o),
|
|
310
|
+
style: (f) => ({
|
|
311
|
+
transform: n === "horizontal" ? `scaleX(${f})` : `scaleY(${f})`
|
|
312
|
+
})
|
|
313
|
+
})
|
|
314
|
+
), p = l.map(
|
|
315
|
+
(u, f) => new w({
|
|
316
|
+
element: u,
|
|
317
|
+
integrator: g.from(o),
|
|
318
|
+
style: (m, y) => ({
|
|
319
|
+
transform: n === "horizontal" ? `scaleX(${y})` : `scaleY(${y})`
|
|
320
|
+
}),
|
|
321
|
+
onComplete: f === l.length - 1 ? () => {
|
|
322
|
+
c.remove(), i.remove();
|
|
323
|
+
} : void 0
|
|
324
|
+
})
|
|
325
|
+
), d = new $(r, { mode: "parallel" }), h = new $(p, { mode: "parallel" });
|
|
326
|
+
return new $([d, h], { mode: "sequence" });
|
|
327
|
+
}
|
|
328
|
+
};
|
|
329
|
+
};
|
|
330
|
+
function Ie({ paths: e }) {
|
|
331
|
+
return P(e, () => Dt());
|
|
332
|
+
}
|
|
333
|
+
const Ot = {
|
|
334
|
+
spring: { stiffness: 200, damping: 20, doubleSpring: 0.7 }
|
|
335
|
+
}, I = 0.5;
|
|
336
|
+
function It(e) {
|
|
337
|
+
const t = e === "enter" ? -100 : 100, n = e === "enter" ? 100 : -100;
|
|
338
|
+
return {
|
|
339
|
+
out: {
|
|
340
|
+
willChange: "transform, opacity",
|
|
341
|
+
startStyle: {},
|
|
342
|
+
animate: (s) => ({
|
|
343
|
+
transform: `translate3d(${t * s}%, 0, 0)`,
|
|
344
|
+
opacity: `${I + (1 - I) * (1 - s)}`
|
|
345
|
+
})
|
|
713
346
|
},
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
347
|
+
in: {
|
|
348
|
+
willChange: "transform, opacity",
|
|
349
|
+
startStyle: {
|
|
350
|
+
transform: `translate3d(${n}%, 0, 0)`,
|
|
351
|
+
opacity: `${I}`
|
|
352
|
+
},
|
|
353
|
+
animate: (s) => ({
|
|
354
|
+
transform: `translate3d(${n * (1 - s)}%, 0, 0)`,
|
|
355
|
+
opacity: `${I + (1 - I) * s}`
|
|
356
|
+
})
|
|
357
|
+
}
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
function Tt() {
|
|
361
|
+
return {
|
|
362
|
+
physics: Ot,
|
|
363
|
+
build: It
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
const At = {
|
|
367
|
+
spring: { stiffness: 170, damping: 22 }
|
|
368
|
+
};
|
|
369
|
+
function _t(e) {
|
|
370
|
+
const t = e === "enter" ? -20 : 100, n = e === "enter" ? 100 : -20;
|
|
371
|
+
return {
|
|
372
|
+
out: {
|
|
373
|
+
willChange: "transform",
|
|
374
|
+
startStyle: {},
|
|
375
|
+
animate: (s) => ({
|
|
376
|
+
transform: `translate3d(${t * s}%, 0, 0)`
|
|
377
|
+
})
|
|
721
378
|
},
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
}
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
queueMicrotask(() => {
|
|
732
|
-
e.setAttribute(et, "true");
|
|
733
|
-
});
|
|
734
|
-
}), () => {
|
|
735
|
-
};
|
|
379
|
+
in: {
|
|
380
|
+
willChange: "transform",
|
|
381
|
+
startStyle: {
|
|
382
|
+
transform: `translate3d(${n}%, 0, 0)`
|
|
383
|
+
},
|
|
384
|
+
animate: (s) => ({
|
|
385
|
+
transform: `translate3d(${n * (1 - s)}%, 0, 0)`
|
|
386
|
+
})
|
|
387
|
+
}
|
|
736
388
|
};
|
|
737
389
|
}
|
|
738
|
-
function
|
|
739
|
-
return
|
|
390
|
+
function kt() {
|
|
391
|
+
return {
|
|
392
|
+
physics: At,
|
|
393
|
+
build: _t
|
|
394
|
+
};
|
|
740
395
|
}
|
|
741
|
-
|
|
742
|
-
|
|
396
|
+
const vt = {
|
|
397
|
+
parallax: kt(),
|
|
398
|
+
crossfade: Tt()
|
|
399
|
+
}, Lt = "parallax";
|
|
400
|
+
function Z(e, t) {
|
|
401
|
+
e.style.willChange = t.willChange, e.style.backfaceVisibility = "hidden", e.style.contain = "layout paint";
|
|
402
|
+
for (const [n, s] of Object.entries(t.startStyle))
|
|
403
|
+
e.style[n] = s;
|
|
743
404
|
}
|
|
744
|
-
const
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
return new Promise((i) => {
|
|
765
|
-
requestAnimationFrame(() => {
|
|
766
|
-
requestAnimationFrame(() => {
|
|
767
|
-
i();
|
|
405
|
+
const Yt = (e = {}) => {
|
|
406
|
+
const t = e.direction ?? "enter", n = vt[e.type ?? Lt], s = n.physics, o = n.build(t);
|
|
407
|
+
return {
|
|
408
|
+
prepare: ({ from: a, to: i }) => (a.then((l) => {
|
|
409
|
+
Z(l, o.out), l.style.pointerEvents = "none", l.style.zIndex = t === "enter" ? "-1" : "100";
|
|
410
|
+
}), i.then((l) => {
|
|
411
|
+
Z(l, o.in);
|
|
412
|
+
}), {}),
|
|
413
|
+
animation: ({ from: a, to: i }) => {
|
|
414
|
+
const l = new w({
|
|
415
|
+
element: a,
|
|
416
|
+
integrator: g.from(s),
|
|
417
|
+
style: (r) => o.out.animate(r)
|
|
418
|
+
}), c = new w({
|
|
419
|
+
element: i,
|
|
420
|
+
integrator: g.from(s),
|
|
421
|
+
style: (r) => o.in.animate(r),
|
|
422
|
+
onComplete: () => {
|
|
423
|
+
i.style.willChange = "auto", i.style.backfaceVisibility = "", i.style.contain = "", i.style.transform = "", i.style.opacity = "";
|
|
424
|
+
}
|
|
768
425
|
});
|
|
769
|
-
|
|
770
|
-
});
|
|
771
|
-
}
|
|
772
|
-
function At(e, i) {
|
|
773
|
-
var S;
|
|
774
|
-
let t = null, n = null, r = null, o = null;
|
|
775
|
-
const s = {
|
|
776
|
-
get currentAnimation() {
|
|
777
|
-
return t;
|
|
778
|
-
}
|
|
779
|
-
}, m = ((S = i == null ? void 0 : i.strategy) == null ? void 0 : S.call(i, s)) || yt(s), l = async (y) => {
|
|
780
|
-
var g, C;
|
|
781
|
-
n && (n.remove(), n = null);
|
|
782
|
-
const p = e(), k = p.in && p.in(y), T = !(i != null && i.strategy) && p.out ? p.out(y) : void 0;
|
|
783
|
-
if (!k)
|
|
784
|
-
return;
|
|
785
|
-
const w = {
|
|
786
|
-
in: F(k),
|
|
787
|
-
out: T ? F(T) : void 0
|
|
788
|
-
}, f = await m.runIn(w);
|
|
789
|
-
if (!f.config) {
|
|
790
|
-
t && (t.direction = "in");
|
|
791
|
-
return;
|
|
426
|
+
return new $([l, c], { mode: "parallel" });
|
|
792
427
|
}
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
428
|
+
};
|
|
429
|
+
};
|
|
430
|
+
function Te({ type: e, ...t }) {
|
|
431
|
+
return st(
|
|
432
|
+
t,
|
|
433
|
+
(n) => Yt({ direction: n, type: e })
|
|
434
|
+
);
|
|
435
|
+
}
|
|
436
|
+
const Ft = {
|
|
437
|
+
spring: { stiffness: 180, damping: 20, doubleSpring: !0 }
|
|
438
|
+
}, Mt = {
|
|
439
|
+
spring: { stiffness: 170, damping: 20, doubleSpring: !0 }
|
|
440
|
+
}, Ht = (e = {}) => {
|
|
441
|
+
const t = e.physics ?? Mt, n = e.physics ?? Ft;
|
|
442
|
+
return {
|
|
443
|
+
prepare: ({ to: s }) => (s.then((o) => {
|
|
444
|
+
o.style.opacity = "0", o.style.willChange = "opacity";
|
|
445
|
+
}), {}),
|
|
446
|
+
animation: ({ from: s, to: o }) => {
|
|
447
|
+
const a = new w({
|
|
448
|
+
element: s,
|
|
449
|
+
integrator: g.from(n),
|
|
450
|
+
// Default bounds (0, 1). `u` runs 1→0 as the animation moves
|
|
451
|
+
// forward, mapping opacity from fully visible to invisible.
|
|
452
|
+
style: (l, c) => ({ opacity: c }),
|
|
453
|
+
onComplete: () => {
|
|
454
|
+
s.style.willChange = "auto";
|
|
801
455
|
}
|
|
802
|
-
},
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
from: f.from,
|
|
809
|
-
to: f.to
|
|
810
|
-
});
|
|
811
|
-
t = { controller: c, direction: "in" }, (C = a.onReady) == null || C.call(a), await K(), f.direction === "forward" ? c.forward() : c.backward();
|
|
812
|
-
}, u = async (y) => {
|
|
813
|
-
var C, b;
|
|
814
|
-
n = y;
|
|
815
|
-
const p = e(), k = !(i != null && i.strategy) && p.in ? p.in(y) : void 0, T = p.out && p.out(y);
|
|
816
|
-
if (!T)
|
|
817
|
-
return;
|
|
818
|
-
const w = {
|
|
819
|
-
in: k ? F(k) : void 0,
|
|
820
|
-
out: F(T)
|
|
821
|
-
}, f = await m.runOut(w);
|
|
822
|
-
if (!f.config) {
|
|
823
|
-
t && (t.direction = "out"), n && (n.remove(), n = null);
|
|
824
|
-
return;
|
|
825
|
-
}
|
|
826
|
-
const a = f.config;
|
|
827
|
-
g(), (C = a.prepare) == null || C.call(a);
|
|
828
|
-
const A = W(
|
|
829
|
-
{
|
|
830
|
-
...a,
|
|
831
|
-
onEnd: () => {
|
|
832
|
-
var R, M;
|
|
833
|
-
(R = a.onEnd) == null || R.call(a), n && (n.remove(), n = null), t = null, (M = i == null ? void 0 : i.onCleanupEnd) == null || M.call(i);
|
|
456
|
+
}), i = new w({
|
|
457
|
+
element: o,
|
|
458
|
+
integrator: g.from(t),
|
|
459
|
+
style: (l) => ({ opacity: l }),
|
|
460
|
+
onComplete: () => {
|
|
461
|
+
o.style.willChange = "auto", o.style.opacity = "";
|
|
834
462
|
}
|
|
835
|
-
}
|
|
836
|
-
|
|
837
|
-
);
|
|
838
|
-
a.wait && await a.wait();
|
|
839
|
-
const c = _.fromState(f.state, {
|
|
840
|
-
config: A,
|
|
841
|
-
from: f.from,
|
|
842
|
-
to: f.to
|
|
843
|
-
});
|
|
844
|
-
t = { controller: c, direction: "out" }, (b = a.onReady) == null || b.call(a), await K(), f.direction === "forward" ? c.forward() : c.backward();
|
|
845
|
-
function g() {
|
|
846
|
-
!r || !n || (o && r.contains(o) ? r.insertBefore(n, o) : r.appendChild(n));
|
|
463
|
+
});
|
|
464
|
+
return new $([a, i], { mode: "sequence" });
|
|
847
465
|
}
|
|
848
466
|
};
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
v = !0;
|
|
853
|
-
const p = y.cloneNode(!0);
|
|
854
|
-
h ? queueMicrotask(() => {
|
|
855
|
-
document.contains(h) && u(p);
|
|
856
|
-
}) : u(p);
|
|
857
|
-
};
|
|
858
|
-
return (y) => {
|
|
859
|
-
if (y)
|
|
860
|
-
return requestAnimationFrame(() => {
|
|
861
|
-
r = y.parentElement, o = y.nextElementSibling;
|
|
862
|
-
}), v = !1, (i == null ? void 0 : i.scope) === "local" ? queueMicrotask(() => {
|
|
863
|
-
h = vt(y), !(h && !pt(h)) && l(y);
|
|
864
|
-
}) : l(y), E(y);
|
|
865
|
-
};
|
|
467
|
+
};
|
|
468
|
+
function Ae({ paths: e }) {
|
|
469
|
+
return P(e, () => Ht());
|
|
866
470
|
}
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
}
|
|
471
|
+
function O(e, t) {
|
|
472
|
+
function n(a) {
|
|
473
|
+
let i = 0, l = 0;
|
|
474
|
+
const c = a.offsetWidth, r = a.offsetHeight;
|
|
475
|
+
let p = a;
|
|
476
|
+
for (; p; )
|
|
477
|
+
i += p.offsetTop, l += p.offsetLeft, p = p.offsetParent;
|
|
478
|
+
return i -= window.scrollY, l -= window.scrollX, { top: i, left: l, width: c, height: r };
|
|
875
479
|
}
|
|
876
|
-
const
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
480
|
+
const s = n(e), o = n(t);
|
|
481
|
+
return new DOMRect(
|
|
482
|
+
o.left - s.left,
|
|
483
|
+
o.top - s.top,
|
|
484
|
+
o.width,
|
|
485
|
+
o.height
|
|
486
|
+
);
|
|
487
|
+
}
|
|
488
|
+
function T(e, t) {
|
|
489
|
+
const { scrollingElement: n, positionedParent: s } = e, o = n !== s && n.contains(s) ? O(n, s).top : 0;
|
|
490
|
+
return {
|
|
491
|
+
top: e[t].scroll.y,
|
|
492
|
+
left: 0,
|
|
493
|
+
width: n.clientWidth,
|
|
494
|
+
height: n.clientHeight - o
|
|
495
|
+
};
|
|
496
|
+
}
|
|
497
|
+
const M = {
|
|
498
|
+
scaleDown: { stiffness: 20, damping: 7 },
|
|
499
|
+
translate: { stiffness: 15, damping: 7 },
|
|
500
|
+
scaleUp: { stiffness: 20, damping: 7 }
|
|
501
|
+
}, D = {
|
|
502
|
+
scaleDown: 0,
|
|
503
|
+
translate: 0.2,
|
|
504
|
+
scaleUp: 0.8
|
|
505
|
+
}, Ut = 0.8, zt = "white", q = 1e3 / 60, Vt = 600;
|
|
506
|
+
function Xt(e) {
|
|
507
|
+
const { items: t, from: n, to: s, recordFrame: o } = e, a = q / 1e3, i = Math.abs(s - n), l = t.map((r) => ({
|
|
508
|
+
item: r,
|
|
509
|
+
integrator: new v({
|
|
510
|
+
stiffness: r.spring.stiffness,
|
|
511
|
+
damping: r.spring.damping
|
|
512
|
+
}),
|
|
513
|
+
state: { position: n, velocity: 0 },
|
|
514
|
+
started: !1,
|
|
515
|
+
settled: !1,
|
|
516
|
+
settleTime: 0
|
|
517
|
+
}));
|
|
518
|
+
for (let r = 0; r < l.length; r++)
|
|
519
|
+
(r === 0 || l[r].item.offset === 0) && (l[r].started = !0);
|
|
520
|
+
o(0);
|
|
521
|
+
let c = 0;
|
|
522
|
+
for (let r = 1; r <= Vt; r++) {
|
|
523
|
+
const p = r * q;
|
|
524
|
+
c = p;
|
|
525
|
+
for (const d of l)
|
|
526
|
+
!d.started || d.settled || (d.state = d.integrator.step(d.state, s, a), d.integrator.isSettled(d.state, s) ? (d.settleTime += a, d.settleTime >= ut && (d.state = { position: s, velocity: 0 }, d.settled = !0)) : d.settleTime = 0, d.item.tick(d.state.position));
|
|
527
|
+
for (let d = 1; d < l.length; d++) {
|
|
528
|
+
const h = l[d];
|
|
529
|
+
if (h.started) continue;
|
|
530
|
+
const u = l[d - 1];
|
|
531
|
+
if (!u.started) continue;
|
|
532
|
+
(i === 0 ? 1 : Math.abs(u.state.position - n) / i) >= h.item.offset && (h.started = !0);
|
|
533
|
+
}
|
|
534
|
+
if (o(p), l.every((d) => d.settled)) return p;
|
|
880
535
|
}
|
|
536
|
+
return c;
|
|
881
537
|
}
|
|
882
|
-
function
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
538
|
+
function H(e, t) {
|
|
539
|
+
return e != null && e.spring ? {
|
|
540
|
+
stiffness: e.spring.stiffness,
|
|
541
|
+
damping: e.spring.damping
|
|
542
|
+
} : t;
|
|
543
|
+
}
|
|
544
|
+
function j(e) {
|
|
545
|
+
const { rect: t, scale: n, direction: s, override: o } = e, a = s === "out" ? { scale: 1, translateY: -t.top } : { scale: n, translateY: -t.top + t.height }, i = H(o, M.scaleDown), l = H(o, M.translate), c = H(o, M.scaleUp), r = s === "out" ? 1 : 0, p = s === "out" ? 0 : 1, d = s === "out" ? [
|
|
546
|
+
{
|
|
547
|
+
spring: i,
|
|
548
|
+
offset: D.scaleDown,
|
|
549
|
+
tick: (f) => {
|
|
550
|
+
const m = 1 - f;
|
|
551
|
+
a.scale = 1 - (1 - n) * m;
|
|
552
|
+
}
|
|
553
|
+
},
|
|
554
|
+
{
|
|
555
|
+
spring: l,
|
|
556
|
+
offset: D.translate,
|
|
557
|
+
tick: (f) => {
|
|
558
|
+
const m = 1 - f;
|
|
559
|
+
a.translateY = -t.top - t.height * m;
|
|
560
|
+
}
|
|
561
|
+
},
|
|
562
|
+
{
|
|
563
|
+
spring: c,
|
|
564
|
+
offset: D.scaleUp,
|
|
565
|
+
tick: (f) => {
|
|
566
|
+
const m = 1 - f;
|
|
567
|
+
a.scale = n + (1 - n) * m;
|
|
889
568
|
}
|
|
890
569
|
}
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
570
|
+
] : [
|
|
571
|
+
{
|
|
572
|
+
spring: i,
|
|
573
|
+
offset: D.scaleDown,
|
|
574
|
+
tick: (f) => {
|
|
575
|
+
a.scale = 1 - (1 - n) * f;
|
|
576
|
+
}
|
|
577
|
+
},
|
|
578
|
+
{
|
|
579
|
+
spring: l,
|
|
580
|
+
offset: D.translate,
|
|
581
|
+
tick: (f) => {
|
|
582
|
+
a.translateY = -t.top + t.height * (1 - f);
|
|
583
|
+
}
|
|
901
584
|
},
|
|
902
|
-
{
|
|
903
|
-
|
|
585
|
+
{
|
|
586
|
+
spring: c,
|
|
587
|
+
offset: D.scaleUp,
|
|
588
|
+
tick: (f) => {
|
|
589
|
+
a.scale = n + (1 - n) * f;
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
], h = [], u = Xt({
|
|
593
|
+
items: d,
|
|
594
|
+
from: r,
|
|
595
|
+
to: p,
|
|
596
|
+
recordFrame: (f) => h.push({
|
|
597
|
+
time: f,
|
|
598
|
+
scale: a.scale,
|
|
599
|
+
translateY: a.translateY
|
|
600
|
+
})
|
|
601
|
+
});
|
|
602
|
+
return { snapshots: h, totalDuration: u };
|
|
904
603
|
}
|
|
905
|
-
function
|
|
906
|
-
|
|
604
|
+
function Bt(e, t) {
|
|
605
|
+
if (e.length === 0) return { time: 0, scale: 1, translateY: 0 };
|
|
606
|
+
if (e.length === 1 || t <= 0) return e[0];
|
|
607
|
+
if (t >= 1) return e[e.length - 1];
|
|
608
|
+
const n = t * (e.length - 1), s = Math.floor(n), o = Math.ceil(n);
|
|
609
|
+
if (s === o) return e[s];
|
|
610
|
+
const a = e[s], i = e[o], l = n - s;
|
|
611
|
+
return {
|
|
612
|
+
time: a.time + (i.time - a.time) * l,
|
|
613
|
+
scale: a.scale + (i.scale - a.scale) * l,
|
|
614
|
+
translateY: a.translateY + (i.translateY - a.translateY) * l
|
|
615
|
+
};
|
|
907
616
|
}
|
|
908
|
-
|
|
909
|
-
|
|
617
|
+
const Wt = [
|
|
618
|
+
[1, 1],
|
|
619
|
+
[-1, 1],
|
|
620
|
+
[1, -1],
|
|
621
|
+
[-1, -1]
|
|
622
|
+
];
|
|
623
|
+
function Nt(e, t) {
|
|
624
|
+
const o = (a, i, l) => {
|
|
625
|
+
const c = document.createElement("div");
|
|
626
|
+
Object.assign(c.style, {
|
|
627
|
+
position: "fixed",
|
|
628
|
+
pointerEvents: "none",
|
|
629
|
+
zIndex: "9999",
|
|
630
|
+
width: "15px",
|
|
631
|
+
height: "15px",
|
|
632
|
+
...a
|
|
633
|
+
});
|
|
634
|
+
const r = document.createElement("div");
|
|
635
|
+
Object.assign(r.style, {
|
|
636
|
+
position: "absolute",
|
|
637
|
+
width: "15px",
|
|
638
|
+
height: "1px",
|
|
639
|
+
backgroundColor: e,
|
|
640
|
+
[l]: "0",
|
|
641
|
+
[i]: "0"
|
|
642
|
+
});
|
|
643
|
+
const p = document.createElement("div");
|
|
644
|
+
return Object.assign(p.style, {
|
|
645
|
+
position: "absolute",
|
|
646
|
+
width: "1px",
|
|
647
|
+
height: "15px",
|
|
648
|
+
backgroundColor: e,
|
|
649
|
+
[l]: "0",
|
|
650
|
+
[i]: "0"
|
|
651
|
+
}), c.appendChild(r), c.appendChild(p), c;
|
|
652
|
+
};
|
|
653
|
+
return {
|
|
654
|
+
topLeft: o(
|
|
655
|
+
{
|
|
656
|
+
top: `${t.top - 1}px`,
|
|
657
|
+
left: `${t.left - 1}px`
|
|
658
|
+
},
|
|
659
|
+
"left",
|
|
660
|
+
"top"
|
|
661
|
+
),
|
|
662
|
+
topRight: o(
|
|
663
|
+
{
|
|
664
|
+
top: `${t.top - 1}px`,
|
|
665
|
+
left: `${t.left + t.width - 15 + 1}px`
|
|
666
|
+
},
|
|
667
|
+
"right",
|
|
668
|
+
"top"
|
|
669
|
+
),
|
|
670
|
+
bottomLeft: o(
|
|
671
|
+
{
|
|
672
|
+
top: `${t.top + t.height - 15 + 1}px`,
|
|
673
|
+
left: `${t.left - 1}px`
|
|
674
|
+
},
|
|
675
|
+
"left",
|
|
676
|
+
"bottom"
|
|
677
|
+
),
|
|
678
|
+
bottomRight: o(
|
|
679
|
+
{
|
|
680
|
+
top: `${t.top + t.height - 15 + 1}px`,
|
|
681
|
+
left: `${t.left + t.width - 15 + 1}px`
|
|
682
|
+
},
|
|
683
|
+
"right",
|
|
684
|
+
"bottom"
|
|
685
|
+
)
|
|
686
|
+
};
|
|
910
687
|
}
|
|
911
|
-
function
|
|
912
|
-
|
|
688
|
+
function G(e, t) {
|
|
689
|
+
const n = t.left + t.width / 2, s = t.top + t.height / 2;
|
|
690
|
+
e.style.transformOrigin = `${n}px ${s}px`;
|
|
913
691
|
}
|
|
914
|
-
function
|
|
915
|
-
|
|
916
|
-
|
|
692
|
+
function K(e, t) {
|
|
693
|
+
e.style.clipPath = `polygon(
|
|
694
|
+
${t.left}px ${t.top}px,
|
|
695
|
+
${t.left + t.width}px ${t.top}px,
|
|
696
|
+
${t.left + t.width}px ${t.top + t.height}px,
|
|
697
|
+
${t.left}px ${t.top + t.height}px
|
|
698
|
+
)`;
|
|
917
699
|
}
|
|
918
|
-
function
|
|
919
|
-
|
|
700
|
+
function U(e, t, n, s, o) {
|
|
701
|
+
const a = n / 1e3;
|
|
702
|
+
return new w({
|
|
703
|
+
element: e,
|
|
704
|
+
integrator: new $t({ durationSec: a }),
|
|
705
|
+
lowerBound: 0,
|
|
706
|
+
upperBound: 1,
|
|
707
|
+
style: (i) => s(Bt(t, i)),
|
|
708
|
+
onComplete: o
|
|
709
|
+
});
|
|
920
710
|
}
|
|
921
|
-
const
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
const
|
|
931
|
-
|
|
711
|
+
const Zt = (e = {}) => {
|
|
712
|
+
var o;
|
|
713
|
+
const t = ((o = e.border) == null ? void 0 : o.color) ?? zt, n = Ut, s = e.physics;
|
|
714
|
+
return {
|
|
715
|
+
prepare: ({ from: a, to: i, context: l }) => {
|
|
716
|
+
const c = T(l, "from"), r = T(l, "to"), p = O(document.body, l.positionedParent), d = Nt(t, {
|
|
717
|
+
...c,
|
|
718
|
+
top: p.top
|
|
719
|
+
});
|
|
720
|
+
for (const h of [
|
|
721
|
+
"topLeft",
|
|
722
|
+
"topRight",
|
|
723
|
+
"bottomLeft",
|
|
724
|
+
"bottomRight"
|
|
725
|
+
])
|
|
726
|
+
l.positionedParent.appendChild(d[h]);
|
|
727
|
+
return a.then((h) => {
|
|
728
|
+
G(h, c), K(h, c), h.style.transform = `translateY(${-c.top}px)`;
|
|
729
|
+
}), i.then((h) => {
|
|
730
|
+
G(h, r), K(h, r), h.style.transform = `translateY(${-r.top + r.height}px) scale(${n})`;
|
|
731
|
+
}), { borders: d, fromRect: c, toRect: r };
|
|
932
732
|
},
|
|
933
|
-
{
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
733
|
+
animation: ({ from: a, to: i, context: l, borders: c, fromRect: r, toRect: p }) => {
|
|
734
|
+
const d = j({
|
|
735
|
+
rect: r,
|
|
736
|
+
scale: n,
|
|
737
|
+
direction: "out",
|
|
738
|
+
override: s
|
|
739
|
+
}), h = j({
|
|
740
|
+
rect: p,
|
|
741
|
+
scale: n,
|
|
742
|
+
direction: "in",
|
|
743
|
+
override: s
|
|
744
|
+
}), u = U(
|
|
745
|
+
a,
|
|
746
|
+
d.snapshots,
|
|
747
|
+
d.totalDuration,
|
|
748
|
+
(b) => ({
|
|
749
|
+
transform: `translateY(${b.translateY}px) scale(${b.scale})`
|
|
750
|
+
}),
|
|
751
|
+
() => {
|
|
752
|
+
a.style.clipPath = "", a.style.transformOrigin = "";
|
|
753
|
+
}
|
|
754
|
+
), f = U(
|
|
755
|
+
i,
|
|
756
|
+
h.snapshots,
|
|
757
|
+
h.totalDuration,
|
|
758
|
+
(b) => ({
|
|
759
|
+
transform: `translateY(${b.translateY}px) scale(${b.scale})`
|
|
760
|
+
}),
|
|
761
|
+
() => {
|
|
762
|
+
i.style.clipPath = "", i.style.transformOrigin = "", i.style.transform = "";
|
|
763
|
+
}
|
|
764
|
+
), m = Wt.map(([b, C], E) => {
|
|
765
|
+
const L = ["topLeft", "topRight", "bottomLeft", "bottomRight"][E];
|
|
766
|
+
return U(
|
|
767
|
+
c[L],
|
|
768
|
+
d.snapshots,
|
|
769
|
+
d.totalDuration,
|
|
770
|
+
(A) => {
|
|
771
|
+
const Y = (r.width - r.width * A.scale) / 2 * 0.7 * b, F = (r.height - r.height * A.scale) / 2 * 0.7 * C;
|
|
772
|
+
return { transform: `translate(${Y}px, ${F}px)` };
|
|
773
|
+
}
|
|
774
|
+
);
|
|
775
|
+
}), y = new $([u, f, ...m], {
|
|
776
|
+
mode: "parallel"
|
|
777
|
+
}), x = y.onComplete;
|
|
778
|
+
return y.onComplete = () => {
|
|
779
|
+
x == null || x();
|
|
780
|
+
const b = l.positionedParent;
|
|
781
|
+
for (const C of [
|
|
782
|
+
"topLeft",
|
|
783
|
+
"topRight",
|
|
784
|
+
"bottomLeft",
|
|
785
|
+
"bottomRight"
|
|
786
|
+
]) {
|
|
787
|
+
const E = c[C];
|
|
788
|
+
E.parentElement === b && b.removeChild(E);
|
|
789
|
+
}
|
|
790
|
+
}, y;
|
|
939
791
|
}
|
|
940
|
-
|
|
792
|
+
};
|
|
793
|
+
};
|
|
794
|
+
function _e({ paths: e }) {
|
|
795
|
+
return P(e, () => Zt());
|
|
941
796
|
}
|
|
942
|
-
|
|
943
|
-
|
|
797
|
+
const qt = {
|
|
798
|
+
spring: { stiffness: 300, damping: 30 }
|
|
799
|
+
};
|
|
800
|
+
function jt(e, t) {
|
|
801
|
+
return e.querySelector(`[data-hero-key="${t}"]`);
|
|
944
802
|
}
|
|
945
|
-
|
|
946
|
-
const t =
|
|
947
|
-
|
|
948
|
-
{
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
}
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
803
|
+
const Gt = (e = {}) => {
|
|
804
|
+
const t = e.physics ?? qt, n = e.maxDistance ?? 700;
|
|
805
|
+
return {
|
|
806
|
+
prepare: ({ from: s }) => (s.then((o) => {
|
|
807
|
+
o.style.opacity = "0";
|
|
808
|
+
}), {}),
|
|
809
|
+
animation: ({ from: s, to: o, context: a }) => {
|
|
810
|
+
const i = s, l = o, c = Array.from(
|
|
811
|
+
l.querySelectorAll("[data-hero-key]")
|
|
812
|
+
), r = [];
|
|
813
|
+
for (const f of c) {
|
|
814
|
+
const m = f.getAttribute("data-hero-key");
|
|
815
|
+
if (!m) continue;
|
|
816
|
+
const y = jt(i, m);
|
|
817
|
+
y && r.push({ key: m, fromEl: y, toEl: f });
|
|
818
|
+
}
|
|
819
|
+
if (r.length === 0)
|
|
820
|
+
return new $([], { mode: "parallel" });
|
|
821
|
+
const p = [], d = [];
|
|
822
|
+
for (const { fromEl: f, toEl: m } of r) {
|
|
823
|
+
const y = O(i, f), x = O(l, m), b = y.left - x.left - a.scrollOffset.x, C = y.top - x.top - a.scrollOffset.y, E = y.width / x.width, L = y.height / x.height;
|
|
824
|
+
if (Math.abs(C) > n) continue;
|
|
825
|
+
const A = m.style.transform, Y = m.style.position, F = m.style.transformOrigin, at = m.style.zIndex, lt = m.style.willChange;
|
|
826
|
+
m.style.position = "relative", m.style.transformOrigin = "top left", m.style.zIndex = "1000", m.style.willChange = "transform", p.push(
|
|
827
|
+
new w({
|
|
828
|
+
element: m,
|
|
829
|
+
integrator: g.from(t),
|
|
830
|
+
style: (W, _) => {
|
|
831
|
+
const ct = _ * b, pt = _ * C, dt = W + _ * E, ft = W + _ * L;
|
|
832
|
+
return {
|
|
833
|
+
transform: `translate(${ct}px, ${pt}px) scale(${dt}, ${ft})`
|
|
834
|
+
};
|
|
835
|
+
}
|
|
836
|
+
})
|
|
837
|
+
), d.push(() => {
|
|
838
|
+
m.style.transform = A, m.style.position = Y, m.style.transformOrigin = F, m.style.zIndex = at, m.style.willChange = lt;
|
|
839
|
+
});
|
|
840
|
+
}
|
|
841
|
+
const h = new $(p, {
|
|
842
|
+
mode: "parallel"
|
|
843
|
+
}), u = h.onComplete;
|
|
844
|
+
return h.onComplete = () => {
|
|
845
|
+
for (const f of d) f();
|
|
846
|
+
u == null || u();
|
|
847
|
+
}, h;
|
|
955
848
|
}
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
849
|
+
};
|
|
850
|
+
};
|
|
851
|
+
function ke({ paths: e }) {
|
|
852
|
+
return P(e, () => Gt());
|
|
853
|
+
}
|
|
854
|
+
const Kt = {
|
|
855
|
+
spring: { stiffness: 50, damping: 30 }
|
|
856
|
+
}, Jt = {
|
|
857
|
+
spring: { stiffness: 80, damping: 25 }
|
|
858
|
+
}, Qt = (e = {}) => {
|
|
859
|
+
const t = e.physics ?? Kt, n = e.initialRotation ?? 45, s = e.initialScale ?? 0.01, o = e.rotationTriggerPoint ?? 0.8;
|
|
860
|
+
return {
|
|
861
|
+
prepare: ({ from: a, to: i, context: l }) => (a.then((c) => {
|
|
862
|
+
c.style.opacity = "1";
|
|
863
|
+
}), i.then((c) => {
|
|
864
|
+
const r = T(l, "to"), p = Math.min(r.width, r.height) * 0.4;
|
|
865
|
+
c.style.setProperty("--max-border-radius", `${p}px`), c.style.setProperty("--border-radius-scale", "1"), c.style.willChange = "transform", c.style.backfaceVisibility = "hidden";
|
|
866
|
+
const d = r.left + r.width / 2, h = r.top + r.height / 2;
|
|
867
|
+
c.style.transformOrigin = `${d}px ${h}px`, c.style.position = "fixed", c.style.top = `${r.top}px`, c.style.left = `${r.left}px`, c.style.width = `${r.width}px`, c.style.height = `${r.height}px`, c.style.zIndex = "1000", c.style.overflow = "hidden", c.style.transform = `rotate(${n}deg) scale(${s}) translateZ(0)`, c.style.borderRadius = "calc(var(--max-border-radius) * var(--border-radius-scale))", c.style.opacity = "1";
|
|
868
|
+
}), {}),
|
|
869
|
+
animation: ({ from: a, to: i }) => {
|
|
870
|
+
const l = new w({
|
|
871
|
+
element: a,
|
|
872
|
+
integrator: g.from(Jt),
|
|
873
|
+
style: (r, p) => ({ opacity: p })
|
|
874
|
+
}), c = new w({
|
|
875
|
+
element: i,
|
|
876
|
+
integrator: g.from(t),
|
|
877
|
+
style: (r) => {
|
|
878
|
+
let p;
|
|
879
|
+
if (r <= 0.05)
|
|
880
|
+
p = s;
|
|
881
|
+
else if (r <= o) {
|
|
882
|
+
const f = (r - 0.05) / (o - 0.05), m = Math.pow(f, 9);
|
|
883
|
+
p = s + (0.8 - s) * m;
|
|
884
|
+
} else {
|
|
885
|
+
const f = (r - o) / (1 - o);
|
|
886
|
+
p = 0.8 + 0.2 * (1 - Math.pow(1 - f, 3));
|
|
887
|
+
}
|
|
888
|
+
const d = 0.7;
|
|
889
|
+
let h;
|
|
890
|
+
if (r <= d)
|
|
891
|
+
h = n;
|
|
892
|
+
else {
|
|
893
|
+
const f = (r - d) / (1 - d), m = 1 - Math.pow(1 - f, 2);
|
|
894
|
+
h = n * (1 - m);
|
|
895
|
+
}
|
|
896
|
+
let u;
|
|
897
|
+
if (r <= d)
|
|
898
|
+
u = 1;
|
|
899
|
+
else {
|
|
900
|
+
const f = (r - d) / (1 - d);
|
|
901
|
+
u = 1 - Math.pow(f, 0.5);
|
|
902
|
+
}
|
|
903
|
+
return {
|
|
904
|
+
transform: `rotate(${h.toFixed(2)}deg) scale(${p.toFixed(4)}) translateZ(0)`,
|
|
905
|
+
"--border-radius-scale": u.toFixed(4)
|
|
906
|
+
};
|
|
907
|
+
},
|
|
908
|
+
onComplete: () => {
|
|
909
|
+
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
|
+
}
|
|
911
|
+
});
|
|
912
|
+
return new $([l, c], { mode: "parallel" });
|
|
964
913
|
}
|
|
965
|
-
}
|
|
914
|
+
};
|
|
915
|
+
};
|
|
916
|
+
function ve({ paths: e }) {
|
|
917
|
+
return P(e, () => Qt());
|
|
966
918
|
}
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
919
|
+
const Rt = {
|
|
920
|
+
spring: { stiffness: 100, damping: 30 }
|
|
921
|
+
}, te = (e = {}) => {
|
|
922
|
+
const t = e.physics ?? Rt;
|
|
923
|
+
return {
|
|
924
|
+
prepare: ({ from: n, to: s }) => (n.then((o) => {
|
|
925
|
+
o.style.transformOrigin = "center center", o.style.willChange = "transform, opacity";
|
|
926
|
+
}), s.then((o) => {
|
|
927
|
+
o.style.opacity = "0", o.style.transform = "rotate(-180deg)", o.style.transformOrigin = "center center", o.style.willChange = "transform, opacity";
|
|
928
|
+
}), {}),
|
|
929
|
+
animation: ({ from: n, to: s }) => {
|
|
930
|
+
const o = new w({
|
|
931
|
+
element: n,
|
|
932
|
+
integrator: g.from(t),
|
|
933
|
+
style: (i) => ({
|
|
934
|
+
transform: `rotate(${i * 180}deg)`,
|
|
935
|
+
opacity: i < 0.5 ? 1 : 0
|
|
936
|
+
})
|
|
937
|
+
}), a = new w({
|
|
938
|
+
element: s,
|
|
939
|
+
integrator: g.from(t),
|
|
940
|
+
// u runs 1→0, so -u*180 unwinds -180→0.
|
|
941
|
+
style: (i, l) => ({
|
|
942
|
+
transform: `rotate(${-l * 180}deg)`,
|
|
943
|
+
opacity: i > 0.5 ? 1 : 0
|
|
944
|
+
}),
|
|
945
|
+
onComplete: () => {
|
|
946
|
+
s.style.willChange = "auto", s.style.transform = "", s.style.transformOrigin = "", s.style.opacity = "";
|
|
947
|
+
}
|
|
948
|
+
});
|
|
949
|
+
return new $([o, a], { mode: "parallel" });
|
|
950
|
+
}
|
|
951
|
+
};
|
|
952
|
+
};
|
|
953
|
+
function Le({ paths: e }) {
|
|
954
|
+
return P(e, () => te());
|
|
974
955
|
}
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
956
|
+
const ee = {
|
|
957
|
+
spring: {
|
|
958
|
+
stiffness: 20,
|
|
959
|
+
damping: 8,
|
|
960
|
+
doubleSpring: 1,
|
|
961
|
+
restDelta: 1e-3,
|
|
962
|
+
restSpeed: 1e-3
|
|
981
963
|
}
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
964
|
+
}, J = (e = {}) => {
|
|
965
|
+
const t = e.direction ?? "up", n = e.physics ?? ee, s = t === "up";
|
|
966
|
+
return {
|
|
967
|
+
prepare: ({ from: o, to: a }) => (o.then((i) => {
|
|
968
|
+
i.style.zIndex = s ? "-1" : "1", i.style.willChange = "transform", i.style.backfaceVisibility = "hidden", i.style.contain = "layout paint", i.style.pointerEvents = "none";
|
|
969
|
+
}), a.then((i) => {
|
|
970
|
+
i.style.willChange = "transform", i.style.backfaceVisibility = "hidden", i.style.contain = "layout paint";
|
|
971
|
+
}), {}),
|
|
972
|
+
animation: ({ from: o, to: a }) => {
|
|
973
|
+
const i = o.offsetHeight, l = a.offsetHeight, c = window.innerHeight, r = Math.max(Math.min(i, l), c), p = new w({
|
|
974
|
+
element: o,
|
|
975
|
+
integrator: g.from(n),
|
|
976
|
+
style: (h) => ({ transform: `translate3d(0, ${s ? -r * h : r * h}px, 0)` })
|
|
977
|
+
}), d = new w({
|
|
978
|
+
element: a,
|
|
979
|
+
integrator: g.from(n),
|
|
980
|
+
style: (h, u) => ({ transform: `translate3d(0, ${s ? u * r : u * -r}px, 0)` }),
|
|
981
|
+
onComplete: () => {
|
|
982
|
+
a.style.willChange = "auto", a.style.backfaceVisibility = "", a.style.contain = "", a.style.transform = "";
|
|
983
|
+
}
|
|
984
|
+
});
|
|
985
|
+
return new $([p, d], { mode: "parallel" });
|
|
986
|
+
}
|
|
987
|
+
};
|
|
988
|
+
};
|
|
989
|
+
function Ye({
|
|
990
|
+
paths: e,
|
|
991
|
+
type: t = "directional",
|
|
992
|
+
direction: n = "up"
|
|
993
|
+
}) {
|
|
994
|
+
return t === "non-directional" ? P(
|
|
995
|
+
e,
|
|
996
|
+
() => J({ direction: n })
|
|
997
|
+
) : ot(
|
|
998
|
+
e,
|
|
999
|
+
{ forward: "up", backward: "down" },
|
|
1000
|
+
(s) => J({ direction: s })
|
|
1001
|
+
);
|
|
992
1002
|
}
|
|
993
|
-
const
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
+
const ne = {
|
|
1004
|
+
spring: { stiffness: 200, damping: 24 }
|
|
1005
|
+
}, se = {
|
|
1006
|
+
inertia: { acceleration: 25, resistance: 1.2 }
|
|
1007
|
+
}, z = 0.2;
|
|
1008
|
+
function oe() {
|
|
1009
|
+
return {
|
|
1010
|
+
enterPhysics: ne,
|
|
1011
|
+
exitPhysics: se,
|
|
1012
|
+
background: {
|
|
1013
|
+
willChange: "transform, opacity",
|
|
1014
|
+
enterStyle: (e, t) => ({
|
|
1015
|
+
transform: `scale(${1 - z * e})`,
|
|
1016
|
+
opacity: t
|
|
1017
|
+
}),
|
|
1018
|
+
exitStyle: (e) => ({
|
|
1019
|
+
transform: `scale(${1 - z + z * e})`,
|
|
1020
|
+
opacity: e
|
|
1021
|
+
})
|
|
1022
|
+
}
|
|
1003
1023
|
};
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
top: g.y,
|
|
1020
|
-
left: g.x
|
|
1021
|
-
}), !(Math.abs(n.scrollTop - g.y) < 1 && Math.abs(n.scrollLeft - g.x) < 1) && C < Mt && (C++, requestAnimationFrame(b));
|
|
1022
|
-
};
|
|
1023
|
-
requestAnimationFrame(b);
|
|
1024
|
+
}
|
|
1025
|
+
const ie = {
|
|
1026
|
+
spring: { stiffness: 200, damping: 24 }
|
|
1027
|
+
}, re = {
|
|
1028
|
+
inertia: { acceleration: 25, resistance: 1.2 }
|
|
1029
|
+
};
|
|
1030
|
+
function ae() {
|
|
1031
|
+
return {
|
|
1032
|
+
enterPhysics: ie,
|
|
1033
|
+
exitPhysics: re,
|
|
1034
|
+
background: {
|
|
1035
|
+
willChange: "",
|
|
1036
|
+
enterStyle: () => ({}),
|
|
1037
|
+
exitStyle: () => ({})
|
|
1038
|
+
}
|
|
1024
1039
|
};
|
|
1040
|
+
}
|
|
1041
|
+
const le = {
|
|
1042
|
+
static: ae(),
|
|
1043
|
+
"background-scale": oe()
|
|
1044
|
+
}, ce = "static", pe = "transform", de = (e = {}) => {
|
|
1045
|
+
const t = e.direction ?? "enter", n = le[e.type ?? ce], s = t === "enter" ? n.enterPhysics : n.exitPhysics, o = n.background, a = o.willChange !== "";
|
|
1025
1046
|
return {
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
})), v = g, p(g);
|
|
1034
|
-
let b = 0;
|
|
1035
|
-
const R = () => {
|
|
1036
|
-
C === S && (b++, b >= Vt ? E = !1 : requestAnimationFrame(R));
|
|
1037
|
-
};
|
|
1038
|
-
requestAnimationFrame(R);
|
|
1047
|
+
prepare: ({ from: i, to: l }) => {
|
|
1048
|
+
const c = t === "enter" ? l : i, r = t === "enter" ? i : l;
|
|
1049
|
+
return c.then((p) => {
|
|
1050
|
+
p.style.willChange = pe, p.style.backfaceVisibility = "hidden", p.style.contain = "layout paint", t === "exit" && (p.style.pointerEvents = "none", p.style.zIndex = "100");
|
|
1051
|
+
}), r.then((p) => {
|
|
1052
|
+
a && (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
|
+
}), {};
|
|
1039
1054
|
},
|
|
1040
|
-
|
|
1041
|
-
const
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
}
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1055
|
+
animation: ({ from: i, to: l, context: c }) => {
|
|
1056
|
+
const r = t === "enter" ? l : i, p = t === "enter" ? i : l, d = T(
|
|
1057
|
+
c,
|
|
1058
|
+
t === "enter" ? "to" : "from"
|
|
1059
|
+
);
|
|
1060
|
+
r.style.clipPath = `inset(${d.top}px 0 calc(100% - ${d.top + d.height}px) 0)`;
|
|
1061
|
+
const h = t === "enter" ? (C, E) => ({
|
|
1062
|
+
transform: `translate3d(0, ${E * d.height}px, 0)`
|
|
1063
|
+
}) : (C) => ({
|
|
1064
|
+
transform: `translate3d(0, ${C * d.height}px, 0)`
|
|
1065
|
+
}), u = new w({
|
|
1066
|
+
element: r,
|
|
1067
|
+
integrator: g.from(s),
|
|
1068
|
+
style: h,
|
|
1069
|
+
onComplete: () => {
|
|
1070
|
+
r.style.willChange = "auto", r.style.backfaceVisibility = "", r.style.contain = "", r.style.clipPath = "", r.style.transform = "";
|
|
1071
|
+
}
|
|
1072
|
+
});
|
|
1073
|
+
if (!a)
|
|
1074
|
+
return new $([u], { mode: "parallel" });
|
|
1075
|
+
const f = T(
|
|
1076
|
+
c,
|
|
1077
|
+
t === "enter" ? "from" : "to"
|
|
1078
|
+
), m = f.left + f.width / 2, y = f.top + f.height / 2;
|
|
1079
|
+
p.style.clipPath = `inset(${f.top}px 0 calc(100% - ${f.top + f.height}px) 0)`, p.style.transformOrigin = `${m}px ${y}px`;
|
|
1080
|
+
const x = t === "enter" ? (C, E) => o.enterStyle(C, E) : (C) => o.exitStyle(C), b = new w({
|
|
1081
|
+
element: p,
|
|
1082
|
+
integrator: g.from(s),
|
|
1083
|
+
style: x,
|
|
1084
|
+
onComplete: t === "exit" ? () => {
|
|
1085
|
+
p.style.willChange = "auto", p.style.backfaceVisibility = "", p.style.contain = "", p.style.clipPath = "", p.style.transformOrigin = "";
|
|
1086
|
+
} : void 0
|
|
1087
|
+
});
|
|
1088
|
+
return new $([u, b], { mode: "parallel" });
|
|
1089
|
+
}
|
|
1054
1090
|
};
|
|
1091
|
+
};
|
|
1092
|
+
function Fe({ type: e, ...t }) {
|
|
1093
|
+
return st(
|
|
1094
|
+
t,
|
|
1095
|
+
(n) => de({ direction: n, type: e })
|
|
1096
|
+
);
|
|
1055
1097
|
}
|
|
1056
|
-
const
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
const
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
}
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
return;
|
|
1082
|
-
}
|
|
1083
|
-
const a = window.innerWidth, A = f.clientX <= j, c = f.clientX >= a - j;
|
|
1084
|
-
if (!A && !c) {
|
|
1085
|
-
e = null;
|
|
1086
|
-
return;
|
|
1087
|
-
}
|
|
1088
|
-
e = {
|
|
1089
|
-
identifier: f.identifier,
|
|
1090
|
-
startX: f.clientX,
|
|
1091
|
-
startY: f.clientY,
|
|
1092
|
-
fromLeftEdge: A,
|
|
1093
|
-
moved: !1
|
|
1094
|
-
};
|
|
1095
|
-
}, v = (w) => {
|
|
1096
|
-
if (!e) return;
|
|
1097
|
-
if (w.touches.length !== 1) {
|
|
1098
|
-
e = null;
|
|
1099
|
-
return;
|
|
1100
|
-
}
|
|
1101
|
-
const f = s(w.touches, e.identifier);
|
|
1102
|
-
if (!f) {
|
|
1103
|
-
e = null;
|
|
1104
|
-
return;
|
|
1098
|
+
const fe = {
|
|
1099
|
+
spring: { stiffness: 170, damping: 22, doubleSpring: 0.8 }
|
|
1100
|
+
}, he = (e = {}) => {
|
|
1101
|
+
const t = e.direction ?? "left", n = e.physics ?? fe, s = t === "left";
|
|
1102
|
+
return {
|
|
1103
|
+
prepare: ({ from: o, to: a }) => (o.then((i) => {
|
|
1104
|
+
i.style.willChange = "transform", i.style.backfaceVisibility = "hidden", i.style.contain = "layout paint", i.style.pointerEvents = "none";
|
|
1105
|
+
}), a.then((i) => {
|
|
1106
|
+
const l = s ? 100 : -100;
|
|
1107
|
+
i.style.transform = `translate3d(${l}%, 0, 0)`, i.style.willChange = "transform", i.style.backfaceVisibility = "hidden", i.style.contain = "layout paint";
|
|
1108
|
+
}), {}),
|
|
1109
|
+
animation: ({ from: o, to: a }) => {
|
|
1110
|
+
const i = new w({
|
|
1111
|
+
element: o,
|
|
1112
|
+
integrator: g.from(n),
|
|
1113
|
+
style: (c) => ({ transform: `translate3d(${s ? -100 * c : 100 * c}%, 0, 0)` })
|
|
1114
|
+
}), l = new w({
|
|
1115
|
+
element: a,
|
|
1116
|
+
integrator: g.from(n),
|
|
1117
|
+
style: (c, r) => ({ transform: `translate3d(${s ? r * 100 : r * -100}%, 0, 0)` }),
|
|
1118
|
+
onComplete: () => {
|
|
1119
|
+
a.style.willChange = "auto", a.style.backfaceVisibility = "", a.style.contain = "", a.style.transform = "";
|
|
1120
|
+
}
|
|
1121
|
+
});
|
|
1122
|
+
return new $([i, l], { mode: "parallel" });
|
|
1105
1123
|
}
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1124
|
+
};
|
|
1125
|
+
};
|
|
1126
|
+
function Me({ paths: e }) {
|
|
1127
|
+
return ot(
|
|
1128
|
+
e,
|
|
1129
|
+
{ forward: "left", backward: "right" },
|
|
1130
|
+
(t) => he({ direction: t })
|
|
1131
|
+
);
|
|
1132
|
+
}
|
|
1133
|
+
const me = {
|
|
1134
|
+
spring: { stiffness: 17, damping: 6 }
|
|
1135
|
+
}, V = 20, k = 800, ue = (e = {}) => {
|
|
1136
|
+
const t = e.physics ?? me;
|
|
1137
|
+
return {
|
|
1138
|
+
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(${k}px) rotateY(0deg) translate3d(0%, 0, 0)`;
|
|
1140
|
+
}), s.then((o) => {
|
|
1141
|
+
o.style.willChange = "transform", o.style.backfaceVisibility = "hidden", o.style.contain = "layout paint", o.style.transform = `perspective(${k}px) rotateY(${V}deg) translate3d(-100%, 0, 0)`;
|
|
1142
|
+
}), {}),
|
|
1143
|
+
animation: ({ from: n, to: s }) => {
|
|
1144
|
+
const o = new w({
|
|
1145
|
+
element: n,
|
|
1146
|
+
integrator: g.from(t),
|
|
1147
|
+
style: (i) => {
|
|
1148
|
+
const l = -i * V, c = i * 100;
|
|
1149
|
+
return {
|
|
1150
|
+
transform: `perspective(${k}px) rotateY(${l}deg) translate3d(${c}%, 0, 0)`
|
|
1151
|
+
};
|
|
1152
|
+
}
|
|
1153
|
+
}), a = new w({
|
|
1154
|
+
element: s,
|
|
1155
|
+
integrator: g.from(t),
|
|
1156
|
+
style: (i, l) => {
|
|
1157
|
+
const c = l * V, r = -l * 100;
|
|
1158
|
+
return {
|
|
1159
|
+
transform: `perspective(${k}px) rotateY(${c}deg) translate3d(${r}%, 0, 0)`
|
|
1160
|
+
};
|
|
1161
|
+
},
|
|
1162
|
+
onComplete: () => {
|
|
1163
|
+
s.style.transform = "", s.style.willChange = "auto", s.style.backfaceVisibility = "", s.style.contain = "";
|
|
1164
|
+
}
|
|
1165
|
+
});
|
|
1166
|
+
return new $([o, a], { mode: "sequence" });
|
|
1110
1167
|
}
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1168
|
+
};
|
|
1169
|
+
};
|
|
1170
|
+
function He({ paths: e }) {
|
|
1171
|
+
return P(e, () => ue());
|
|
1172
|
+
}
|
|
1173
|
+
function it({
|
|
1174
|
+
enterRect: e,
|
|
1175
|
+
exitRect: t,
|
|
1176
|
+
pageRect: n,
|
|
1177
|
+
scrollOffset: s
|
|
1178
|
+
}) {
|
|
1179
|
+
const o = t.left - e.left + (t.width - e.width) / 2 - s.x, a = t.top - e.top + (t.height - e.height) / 2 - s.y, i = t.width / e.width, l = t.height / e.height, c = Math.max(i, l), r = e.top / n.height * 100, p = (n.width - (e.left + e.width)) / n.width * 100, d = (n.height - (e.top + e.height)) / n.height * 100, h = e.left / n.width * 100;
|
|
1180
|
+
return {
|
|
1181
|
+
transformOrigin: `${e.left + e.width / 2}px ${e.top + e.height / 2}px`,
|
|
1182
|
+
animate: (u) => {
|
|
1183
|
+
const f = 1 - u;
|
|
1184
|
+
return {
|
|
1185
|
+
clipPath: `inset(${r * f}% ${p * f}% ${d * f}% ${h * f}%)`,
|
|
1186
|
+
transform: `translate(${o * f}px, ${a * f}px) scale(${1 + (c - 1) * f})`
|
|
1187
|
+
};
|
|
1119
1188
|
}
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1189
|
+
};
|
|
1190
|
+
}
|
|
1191
|
+
function rt({
|
|
1192
|
+
enterRect: e,
|
|
1193
|
+
exitRect: t,
|
|
1194
|
+
pageRect: n,
|
|
1195
|
+
scrollOffset: s
|
|
1196
|
+
}) {
|
|
1197
|
+
const o = t.left - e.left + (t.width - e.width) / 2 + s.x, a = t.top - e.top + (t.height - e.height) / 2 + s.y, i = t.width / e.width, l = t.height / e.height, c = Math.min(i, l), r = e.top / n.height * 100, p = (n.width - (e.left + e.width)) / n.width * 100, d = (n.height - (e.top + e.height)) / n.height * 100, h = e.left / n.width * 100;
|
|
1198
|
+
return {
|
|
1199
|
+
transformOrigin: `${e.left + e.width / 2}px ${e.top + e.height / 2}px`,
|
|
1200
|
+
animate: (u) => {
|
|
1201
|
+
const f = 1 - u;
|
|
1202
|
+
return {
|
|
1203
|
+
clipPath: `inset(${r * f}% ${p * f}% ${d * f}% ${h * f}%)`,
|
|
1204
|
+
transform: `translate(${o * f - s.x}px, ${a * f}px) scale(${1 + (c - 1) * f})`
|
|
1205
|
+
};
|
|
1124
1206
|
}
|
|
1125
|
-
e.moved && Math.abs(a) >= $ && u(), e = null;
|
|
1126
|
-
}, S = () => {
|
|
1127
|
-
e && (e.moved && u(), e = null);
|
|
1128
1207
|
};
|
|
1129
|
-
return { initialize: () => {
|
|
1130
|
-
if (typeof window > "u" || o) return;
|
|
1131
|
-
o = !0;
|
|
1132
|
-
const w = { passive: !0, capture: !0 };
|
|
1133
|
-
window.addEventListener("touchstart", h, w), window.addEventListener("touchmove", v, w), window.addEventListener("touchend", E, w), window.addEventListener("touchcancel", S, w);
|
|
1134
|
-
}, destroy: () => {
|
|
1135
|
-
if (typeof window > "u" || !o) return;
|
|
1136
|
-
o = !1;
|
|
1137
|
-
const w = { capture: !0 };
|
|
1138
|
-
window.removeEventListener("touchstart", h, w), window.removeEventListener("touchmove", v, w), window.removeEventListener("touchend", E, w), window.removeEventListener("touchcancel", S, w), m(), l(), e = null, i = !1, t = !1;
|
|
1139
|
-
}, isSwipeBack: () => {
|
|
1140
|
-
const w = i || t;
|
|
1141
|
-
return w && m(), w;
|
|
1142
|
-
}, onPageEnter: () => {
|
|
1143
|
-
i = !1, m(), l(), r = setTimeout(() => {
|
|
1144
|
-
t = !1, r = null;
|
|
1145
|
-
}, 0);
|
|
1146
|
-
} };
|
|
1147
1208
|
}
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1209
|
+
const ye = {
|
|
1210
|
+
spring: { stiffness: 340, damping: 30, doubleSpring: 1 }
|
|
1211
|
+
};
|
|
1212
|
+
function ge({
|
|
1213
|
+
enterRect: e,
|
|
1214
|
+
exitRect: t,
|
|
1215
|
+
scrollOffset: n
|
|
1216
|
+
}) {
|
|
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, a = e.width / t.width, i = e.height / t.height, l = Math.max(a, i);
|
|
1218
|
+
return {
|
|
1219
|
+
transformOrigin: `${t.left + t.width / 2}px ${t.top + t.height / 2}px`,
|
|
1220
|
+
animate: (c) => {
|
|
1221
|
+
const r = 1 - c;
|
|
1222
|
+
return {
|
|
1223
|
+
transform: `translate(${s * r - n.x}px, ${o * r}px) scale(${1 + (l - 1) * r})`,
|
|
1224
|
+
opacity: `${1 - r}`
|
|
1225
|
+
};
|
|
1154
1226
|
}
|
|
1155
|
-
}
|
|
1227
|
+
};
|
|
1228
|
+
}
|
|
1229
|
+
function we({
|
|
1230
|
+
enterRect: e,
|
|
1231
|
+
exitRect: t,
|
|
1232
|
+
scrollOffset: n
|
|
1233
|
+
}) {
|
|
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, a = e.width / t.width, i = e.height / t.height, l = Math.max(a, i);
|
|
1156
1235
|
return {
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
}
|
|
1236
|
+
transformOrigin: `${t.left + t.width / 2}px ${t.top + t.height / 2}px`,
|
|
1237
|
+
animate: (c) => {
|
|
1238
|
+
const r = 1 - c;
|
|
1239
|
+
return {
|
|
1240
|
+
transform: `translate(${s * r}px, ${o * r}px) scale(${1 + (l - 1) * r})`,
|
|
1241
|
+
opacity: `${c}`
|
|
1242
|
+
};
|
|
1164
1243
|
}
|
|
1165
1244
|
};
|
|
1166
1245
|
}
|
|
1167
|
-
function
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1246
|
+
function be() {
|
|
1247
|
+
return {
|
|
1248
|
+
physics: ye,
|
|
1249
|
+
in: it,
|
|
1250
|
+
out: rt,
|
|
1251
|
+
backgroundIn: we,
|
|
1252
|
+
backgroundOut: ge
|
|
1253
|
+
};
|
|
1254
|
+
}
|
|
1255
|
+
const Se = {
|
|
1256
|
+
spring: { stiffness: 420, damping: 34 }
|
|
1257
|
+
};
|
|
1258
|
+
function Q() {
|
|
1259
|
+
return {
|
|
1260
|
+
transformOrigin: "",
|
|
1261
|
+
animate: () => ({})
|
|
1262
|
+
};
|
|
1263
|
+
}
|
|
1264
|
+
function $e() {
|
|
1265
|
+
return {
|
|
1266
|
+
physics: Se,
|
|
1267
|
+
in: it,
|
|
1268
|
+
out: rt,
|
|
1269
|
+
backgroundIn: () => Q(),
|
|
1270
|
+
backgroundOut: () => Q()
|
|
1271
|
+
};
|
|
1272
|
+
}
|
|
1273
|
+
const xe = {
|
|
1274
|
+
expand: be(),
|
|
1275
|
+
static: $e()
|
|
1276
|
+
}, X = "data-zoom-enter-key", R = "data-zoom-exit-key";
|
|
1277
|
+
function tt(e) {
|
|
1278
|
+
const t = e.querySelectorAll(`[${X}]`);
|
|
1279
|
+
return t.length !== 1 ? null : t[0];
|
|
1280
|
+
}
|
|
1281
|
+
function et(e, t) {
|
|
1282
|
+
const n = e.querySelectorAll(`[${R}]`);
|
|
1283
|
+
for (const s of n)
|
|
1284
|
+
if (s.getAttribute(R) === t)
|
|
1285
|
+
return s;
|
|
1286
|
+
return null;
|
|
1287
|
+
}
|
|
1288
|
+
function Ce(e, t) {
|
|
1289
|
+
const n = tt(e), s = tt(t);
|
|
1290
|
+
if (!n && s) {
|
|
1291
|
+
const o = s.getAttribute(X);
|
|
1292
|
+
if (!o) return null;
|
|
1293
|
+
const a = et(e, o);
|
|
1294
|
+
return a ? { mode: "enter", enterEl: s, exitEl: a } : null;
|
|
1172
1295
|
}
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
}
|
|
1179
|
-
const n = { from: e.from, to: e.to };
|
|
1180
|
-
e.outResolve(n), e.inResolve(n), e = null;
|
|
1181
|
-
}
|
|
1296
|
+
if (n && !s) {
|
|
1297
|
+
const o = n.getAttribute(X);
|
|
1298
|
+
if (!o) return null;
|
|
1299
|
+
const a = et(t, o);
|
|
1300
|
+
return a ? { mode: "exit", enterEl: n, exitEl: a } : null;
|
|
1182
1301
|
}
|
|
1302
|
+
return null;
|
|
1303
|
+
}
|
|
1304
|
+
function Ee(e, t, n, s) {
|
|
1183
1305
|
return {
|
|
1184
|
-
|
|
1185
|
-
e
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1306
|
+
enterRect: O(
|
|
1307
|
+
e.mode === "enter" ? n : t,
|
|
1308
|
+
e.enterEl
|
|
1309
|
+
),
|
|
1310
|
+
exitRect: O(
|
|
1311
|
+
e.mode === "enter" ? t : n,
|
|
1312
|
+
e.exitEl
|
|
1313
|
+
),
|
|
1314
|
+
pageRect: e.mode === "enter" ? n.getBoundingClientRect() : t.getBoundingClientRect(),
|
|
1315
|
+
scrollOffset: s
|
|
1192
1316
|
};
|
|
1193
1317
|
}
|
|
1194
|
-
|
|
1195
|
-
const
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
c.from,
|
|
1222
|
-
c.to
|
|
1223
|
-
), R = It(
|
|
1224
|
-
g,
|
|
1225
|
-
C,
|
|
1226
|
-
l
|
|
1227
|
-
) || n;
|
|
1228
|
-
if (!R) return () => ({});
|
|
1229
|
-
const M = v(c.from, c.to);
|
|
1230
|
-
if (a === "out") {
|
|
1231
|
-
const x = {
|
|
1232
|
-
scrollOffset: M,
|
|
1233
|
-
scroll: k(c.from),
|
|
1234
|
-
get scrollingElement() {
|
|
1235
|
-
return y() || document.documentElement;
|
|
1236
|
-
},
|
|
1237
|
-
get positionedParent() {
|
|
1238
|
-
return p();
|
|
1239
|
-
}
|
|
1240
|
-
};
|
|
1241
|
-
return c.from && !S(c.from) && E(c.from), (D) => R.out(D, x);
|
|
1242
|
-
} else {
|
|
1243
|
-
const x = {
|
|
1244
|
-
scrollOffset: M,
|
|
1245
|
-
get scroll() {
|
|
1246
|
-
return k(c.to);
|
|
1247
|
-
},
|
|
1248
|
-
get scrollingElement() {
|
|
1249
|
-
return y() || document.documentElement;
|
|
1250
|
-
},
|
|
1251
|
-
get positionedParent() {
|
|
1252
|
-
return p();
|
|
1318
|
+
const Pe = (e) => {
|
|
1319
|
+
const t = xe[e.type], n = t.physics;
|
|
1320
|
+
return {
|
|
1321
|
+
prepare: ({ from: s }) => (s.then((o) => {
|
|
1322
|
+
o.style.willChange = "transform, clip-path, opacity", o.style.backfaceVisibility = "hidden", o.style.contain = "layout paint";
|
|
1323
|
+
}), {}),
|
|
1324
|
+
animation: ({ from: s, to: o, context: a }) => {
|
|
1325
|
+
const i = Ce(s, o);
|
|
1326
|
+
if (!i)
|
|
1327
|
+
return new $([], { mode: "parallel" });
|
|
1328
|
+
const l = Ee(i, s, o, a.scrollOffset), c = i.mode === "enter" ? t.in(l) : t.backgroundIn(l), r = i.mode === "enter" ? t.backgroundOut(l) : t.out(l);
|
|
1329
|
+
c && (o.style.transformOrigin = c.transformOrigin), r && (s.style.transformOrigin = r.transformOrigin);
|
|
1330
|
+
const p = i.mode === "enter" ? o : s, d = p.style.zIndex;
|
|
1331
|
+
p.style.zIndex = "9999";
|
|
1332
|
+
const h = new w({
|
|
1333
|
+
element: s,
|
|
1334
|
+
integrator: g.from(n),
|
|
1335
|
+
// The provider's `animate` was authored against legacy convention
|
|
1336
|
+
// where OUT runs `progress: 1 → 0`. Our `u` mirrors that, so feeding
|
|
1337
|
+
// `u` keeps the visual direction (full page → shrunk to tile) intact.
|
|
1338
|
+
style: (f, m) => r.animate(m)
|
|
1339
|
+
}), u = new w({
|
|
1340
|
+
element: o,
|
|
1341
|
+
integrator: g.from(n),
|
|
1342
|
+
style: (f) => c.animate(f),
|
|
1343
|
+
onComplete: () => {
|
|
1344
|
+
o.style.willChange = "auto", o.style.backfaceVisibility = "", o.style.transformOrigin = "", o.style.contain = "", p.style.zIndex = d;
|
|
1253
1345
|
}
|
|
1254
|
-
};
|
|
1255
|
-
return
|
|
1346
|
+
});
|
|
1347
|
+
return new $([h, u], { mode: "parallel" });
|
|
1256
1348
|
}
|
|
1257
1349
|
};
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
out: async (a) => (await T(f, "out"))(a),
|
|
1262
|
-
// Add page transition strategy for page-level transitions
|
|
1263
|
-
[Q]: wt
|
|
1264
|
-
});
|
|
1350
|
+
};
|
|
1351
|
+
function Ue({ paths: e, type: t }) {
|
|
1352
|
+
return P(e, () => Pe({ type: t }));
|
|
1265
1353
|
}
|
|
1266
1354
|
export {
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
Qt as isSingleAnimation,
|
|
1283
|
-
te as isTickAnimation,
|
|
1284
|
-
Wt as isWatched,
|
|
1285
|
-
W as normalizeSchedule,
|
|
1286
|
-
F as normalizeToMultiAnimation,
|
|
1287
|
-
Ht as resetObserver,
|
|
1288
|
-
Kt as transition,
|
|
1289
|
-
Bt as triggerUnmount,
|
|
1290
|
-
Tt as watchUnmount
|
|
1355
|
+
Xe as Animation,
|
|
1356
|
+
$ as MultiAnimation,
|
|
1357
|
+
w as WebAnimation,
|
|
1358
|
+
Ie as blind,
|
|
1359
|
+
Te as drill,
|
|
1360
|
+
Ae as fade,
|
|
1361
|
+
_e as film,
|
|
1362
|
+
ke as hero,
|
|
1363
|
+
ve as jaemin,
|
|
1364
|
+
Le as rotate,
|
|
1365
|
+
Ye as scroll,
|
|
1366
|
+
Fe as sheet,
|
|
1367
|
+
Me as slide,
|
|
1368
|
+
He as strip,
|
|
1369
|
+
Ue as zoom
|
|
1291
1370
|
};
|