@ssgoi/core 5.2.2 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -6
- package/dist/animation/animation.d.ts +68 -0
- package/dist/animation/animation.d.ts.map +1 -0
- package/dist/animation/host-animation.d.ts +45 -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 +55 -0
- package/dist/animation/multi-animation.d.ts.map +1 -0
- package/dist/animation/web-animation.d.ts +65 -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 +1702 -1186
- 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 +511 -0
- package/dist/multi-animation-CnxqLEka.js +322 -0
- package/dist/multi-animation-Dw2JTJI2.cjs +1 -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/axis/index.d.ts +43 -0
- package/dist/transitions/axis/index.d.ts.map +1 -0
- package/dist/transitions/axis/provider/index.d.ts +8 -0
- package/dist/transitions/axis/provider/index.d.ts.map +1 -0
- package/dist/transitions/axis/provider/x/fluid.d.ts +3 -0
- package/dist/transitions/axis/provider/x/fluid.d.ts.map +1 -0
- package/dist/transitions/axis/provider/x/index.d.ts +3 -0
- package/dist/transitions/axis/provider/x/index.d.ts.map +1 -0
- package/dist/transitions/axis/provider/x/snappy.d.ts +3 -0
- package/dist/transitions/axis/provider/x/snappy.d.ts.map +1 -0
- package/dist/transitions/axis/provider/y.d.ts +3 -0
- package/dist/transitions/axis/provider/y.d.ts.map +1 -0
- package/dist/transitions/axis/provider/z.d.ts +3 -0
- package/dist/transitions/axis/provider/z.d.ts.map +1 -0
- package/dist/transitions/axis/transition.d.ts +5 -0
- package/dist/transitions/axis/transition.d.ts.map +1 -0
- package/dist/transitions/axis/types.d.ts +52 -0
- package/dist/transitions/axis/types.d.ts.map +1 -0
- package/dist/transitions/blind/index.d.ts +15 -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 +40 -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 +33 -0
- package/dist/transitions/drill/types.d.ts.map +1 -0
- package/dist/transitions/fade/index.d.ts +16 -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/fade/types.d.ts +14 -0
- package/dist/transitions/fade/types.d.ts.map +1 -0
- package/dist/transitions/film/index.d.ts +16 -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/film/types.d.ts +16 -0
- package/dist/transitions/film/types.d.ts.map +1 -0
- package/dist/transitions/hero/index.d.ts +17 -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/hero/types.d.ts +12 -0
- package/dist/transitions/hero/types.d.ts.map +1 -0
- package/dist/transitions/index.d.ts +11 -12
- package/dist/transitions/index.d.ts.map +1 -1
- package/dist/transitions/jaemin/index.d.ts +16 -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/jaemin/types.d.ts +9 -0
- package/dist/transitions/jaemin/types.d.ts.map +1 -0
- package/dist/transitions/rotate/index.d.ts +15 -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/rotate/types.d.ts +9 -0
- package/dist/transitions/rotate/types.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 +41 -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 +29 -0
- package/dist/transitions/sheet/types.d.ts.map +1 -0
- package/dist/transitions/slide/index.d.ts +16 -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/slide/types.d.ts +10 -0
- package/dist/transitions/slide/types.d.ts.map +1 -0
- package/dist/transitions/strip/index.d.ts +16 -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/strip/types.d.ts +9 -0
- package/dist/transitions/strip/types.d.ts.map +1 -0
- package/dist/transitions/utils.d.ts +25 -5
- package/dist/transitions/utils.d.ts.map +1 -1
- package/dist/transitions/zoom/index.d.ts +22 -0
- package/dist/transitions/zoom/index.d.ts.map +1 -0
- package/dist/transitions/zoom/provider/blur.d.ts +14 -0
- package/dist/transitions/zoom/provider/blur.d.ts.map +1 -0
- package/dist/transitions/zoom/provider/expand.d.ts +10 -0
- package/dist/transitions/zoom/provider/expand.d.ts.map +1 -0
- package/dist/transitions/zoom/provider/index.d.ts +12 -0
- package/dist/transitions/zoom/provider/index.d.ts.map +1 -0
- package/dist/transitions/zoom/provider/static.d.ts +10 -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 +109 -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 +174 -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
|
@@ -1,1614 +0,0 @@
|
|
|
1
|
-
import { a as W, S as B } from "../spring-integrator-BM4a-82c.js";
|
|
2
|
-
const $ = (t, e) => {
|
|
3
|
-
var o;
|
|
4
|
-
t.style.position = "absolute", t.style.width = "100%", t.style.top = `${-1 * (((o = e == null ? void 0 : e.scrollOffset) == null ? void 0 : o.y) ?? 0)}px`, t.style.left = "0";
|
|
5
|
-
}, V = (t) => new Promise((e) => setTimeout(e, t));
|
|
6
|
-
function x(t, e) {
|
|
7
|
-
function o(n) {
|
|
8
|
-
let a = 0, i = 0;
|
|
9
|
-
const c = n.offsetWidth, p = n.offsetHeight;
|
|
10
|
-
let r = n;
|
|
11
|
-
for (; r; )
|
|
12
|
-
a += r.offsetTop, i += r.offsetLeft, r = r.offsetParent;
|
|
13
|
-
return a -= window.scrollY, i -= window.scrollX, { top: a, left: i, width: c, height: p };
|
|
14
|
-
}
|
|
15
|
-
const l = o(t), s = o(e);
|
|
16
|
-
return new DOMRect(
|
|
17
|
-
s.left - l.left,
|
|
18
|
-
s.top - l.top,
|
|
19
|
-
s.width,
|
|
20
|
-
s.height
|
|
21
|
-
);
|
|
22
|
-
}
|
|
23
|
-
function E() {
|
|
24
|
-
let t, e;
|
|
25
|
-
return { promise: new Promise((l, s) => {
|
|
26
|
-
t = l, e = s;
|
|
27
|
-
}), resolve: t, reject: e };
|
|
28
|
-
}
|
|
29
|
-
const q = {
|
|
30
|
-
spring: { stiffness: 200, damping: 22 }
|
|
31
|
-
}, j = {
|
|
32
|
-
spring: { stiffness: 200, damping: 22 }
|
|
33
|
-
}, N = 300, G = 10, Z = "horizontal", K = "#000000", Rt = (t = {}) => {
|
|
34
|
-
const {
|
|
35
|
-
transitionDelay: e = N,
|
|
36
|
-
blindCount: o = G,
|
|
37
|
-
direction: l = Z,
|
|
38
|
-
blindColor: s = K
|
|
39
|
-
} = t, n = t.physics ?? j, a = t.physics ?? q;
|
|
40
|
-
let i, c = null;
|
|
41
|
-
const p = (r, y, f = "left") => {
|
|
42
|
-
window.getComputedStyle(r).position === "static" && (r.style.position = "relative");
|
|
43
|
-
const d = document.createElement("div");
|
|
44
|
-
d.className = "blind-container", d.style.cssText = `
|
|
45
|
-
position: absolute;
|
|
46
|
-
top: 0;
|
|
47
|
-
left: 0;
|
|
48
|
-
width: 100%;
|
|
49
|
-
height: 100%;
|
|
50
|
-
pointer-events: none;
|
|
51
|
-
z-index: 9999;
|
|
52
|
-
overflow: hidden;
|
|
53
|
-
`;
|
|
54
|
-
const h = [];
|
|
55
|
-
for (let g = 0; g < o; g++) {
|
|
56
|
-
const w = document.createElement("div");
|
|
57
|
-
if (l === "horizontal") {
|
|
58
|
-
const b = 100 / o, C = `calc(${b}% + 1px)`;
|
|
59
|
-
w.style.cssText = `
|
|
60
|
-
position: absolute;
|
|
61
|
-
top: ${b * g}%;
|
|
62
|
-
left: 0;
|
|
63
|
-
width: 100%;
|
|
64
|
-
height: ${C};
|
|
65
|
-
background: ${s};
|
|
66
|
-
transform: scaleX(${y === "hidden" ? 0 : 1});
|
|
67
|
-
transform-origin: ${f} center;
|
|
68
|
-
will-change: transform;
|
|
69
|
-
`;
|
|
70
|
-
} else {
|
|
71
|
-
const b = 100 / o, C = `calc(${b}% + 1px)`;
|
|
72
|
-
w.style.cssText = `
|
|
73
|
-
position: absolute;
|
|
74
|
-
top: 0;
|
|
75
|
-
left: ${b * g}%;
|
|
76
|
-
width: ${C};
|
|
77
|
-
height: 100%;
|
|
78
|
-
background: ${s};
|
|
79
|
-
transform: scaleY(${y === "hidden" ? 0 : 1});
|
|
80
|
-
transform-origin: ${f === "left" ? "top" : "bottom"} center;
|
|
81
|
-
will-change: transform;
|
|
82
|
-
`;
|
|
83
|
-
}
|
|
84
|
-
h.push(w), d.appendChild(w);
|
|
85
|
-
}
|
|
86
|
-
return r.appendChild(d), { container: d, blinds: h };
|
|
87
|
-
};
|
|
88
|
-
return {
|
|
89
|
-
out: (r) => {
|
|
90
|
-
let y = null;
|
|
91
|
-
i = new Promise((d) => {
|
|
92
|
-
c = d;
|
|
93
|
-
});
|
|
94
|
-
const f = (d) => {
|
|
95
|
-
const h = 1 - d;
|
|
96
|
-
return {
|
|
97
|
-
transform: l === "horizontal" ? `scaleX(${h})` : `scaleY(${h})`
|
|
98
|
-
};
|
|
99
|
-
};
|
|
100
|
-
return {
|
|
101
|
-
items: Array.from({ length: o }, (d, h) => ({
|
|
102
|
-
physics: a,
|
|
103
|
-
offset: 0.2,
|
|
104
|
-
css: {
|
|
105
|
-
// Use getter for lazy element access (evaluated after prepare)
|
|
106
|
-
get element() {
|
|
107
|
-
return y == null ? void 0 : y.blinds[h];
|
|
108
|
-
},
|
|
109
|
-
style: f
|
|
110
|
-
}
|
|
111
|
-
})),
|
|
112
|
-
schedule: "stagger",
|
|
113
|
-
prepare: () => {
|
|
114
|
-
$(r), r.style.zIndex = "1000", y = p(r, "hidden", "left");
|
|
115
|
-
},
|
|
116
|
-
onStart: () => {
|
|
117
|
-
},
|
|
118
|
-
onEnd: () => {
|
|
119
|
-
c && c();
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
},
|
|
123
|
-
in: (r) => {
|
|
124
|
-
let y = null;
|
|
125
|
-
const f = (d) => {
|
|
126
|
-
const h = 1 - d;
|
|
127
|
-
return {
|
|
128
|
-
transform: l === "horizontal" ? `scaleX(${h})` : `scaleY(${h})`
|
|
129
|
-
};
|
|
130
|
-
};
|
|
131
|
-
return {
|
|
132
|
-
items: Array.from({ length: o }, (d, h) => ({
|
|
133
|
-
physics: n,
|
|
134
|
-
offset: 0.2,
|
|
135
|
-
css: {
|
|
136
|
-
// Use getter for lazy element access (evaluated after prepare)
|
|
137
|
-
get element() {
|
|
138
|
-
return y == null ? void 0 : y.blinds[h];
|
|
139
|
-
},
|
|
140
|
-
style: f
|
|
141
|
-
}
|
|
142
|
-
})),
|
|
143
|
-
schedule: "stagger",
|
|
144
|
-
prepare: () => {
|
|
145
|
-
r.style.position = "relative", r.style.zIndex = "0", y = p(r, "closed", "right");
|
|
146
|
-
},
|
|
147
|
-
onStart: () => {
|
|
148
|
-
},
|
|
149
|
-
wait: async () => {
|
|
150
|
-
i && await i, await V(e);
|
|
151
|
-
},
|
|
152
|
-
onEnd: () => {
|
|
153
|
-
y && y.container && y.container.remove();
|
|
154
|
-
}
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
};
|
|
158
|
-
}, J = {
|
|
159
|
-
spring: { stiffness: 1, damping: 1 }
|
|
160
|
-
}, Q = {
|
|
161
|
-
spring: { stiffness: 20, damping: 25 }
|
|
162
|
-
}, R = "#000000", tt = "circle", v = "CURTAIN_REVEAL_OVERLAY_ID", st = {
|
|
163
|
-
position: "fixed",
|
|
164
|
-
inset: "0",
|
|
165
|
-
width: "100vw",
|
|
166
|
-
height: "100%",
|
|
167
|
-
zIndex: "9999",
|
|
168
|
-
display: "flex",
|
|
169
|
-
alignItems: "center",
|
|
170
|
-
justifyContent: "center",
|
|
171
|
-
overflow: "hidden"
|
|
172
|
-
}, it = {
|
|
173
|
-
position: "relative",
|
|
174
|
-
display: "inline-block",
|
|
175
|
-
height: "5.5rem",
|
|
176
|
-
overflow: "hidden"
|
|
177
|
-
}, nt = {
|
|
178
|
-
display: "flex",
|
|
179
|
-
height: "100%",
|
|
180
|
-
willChange: "transform",
|
|
181
|
-
transition: "transform 0.3s ease"
|
|
182
|
-
}, et = {
|
|
183
|
-
display: "inline-flex",
|
|
184
|
-
alignItems: "center",
|
|
185
|
-
justifyContent: "center",
|
|
186
|
-
whiteSpace: "nowrap",
|
|
187
|
-
fontSize: "5.5rem",
|
|
188
|
-
fontWeight: "900",
|
|
189
|
-
letterSpacing: "0.02em",
|
|
190
|
-
color: "#FFFFFF"
|
|
191
|
-
}, at = 0.4, O = 0.5, ot = 0.2;
|
|
192
|
-
function rt(t, e) {
|
|
193
|
-
switch (t) {
|
|
194
|
-
case "circle":
|
|
195
|
-
return `circle(${e * 100}% at 50% 50%)`;
|
|
196
|
-
case "square":
|
|
197
|
-
return `inset(${(1 - e) * 50}% round ${10 * e}%)`;
|
|
198
|
-
case "triangle": {
|
|
199
|
-
const o = e * 100;
|
|
200
|
-
return `polygon(50% ${50 - o}%, ${50 - o}% ${50 + o}%, ${50 + o}% ${50 + o}%)`;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
const lt = (t) => t.reduce((e, o) => e + o, 0), ts = (t = {}) => {
|
|
205
|
-
const {
|
|
206
|
-
background: e = R,
|
|
207
|
-
texts: o = [],
|
|
208
|
-
shape: l = tt,
|
|
209
|
-
textStyle: s = {}
|
|
210
|
-
} = t, n = t.physics ?? Q, a = t.physics ?? J;
|
|
211
|
-
return {
|
|
212
|
-
out: (i, c) => {
|
|
213
|
-
const p = i.style.opacity;
|
|
214
|
-
return {
|
|
215
|
-
physics: a,
|
|
216
|
-
from: 1,
|
|
217
|
-
to: 0,
|
|
218
|
-
prepare: () => {
|
|
219
|
-
$(i, c), i.style.opacity = "1";
|
|
220
|
-
},
|
|
221
|
-
tick: (r) => {
|
|
222
|
-
const y = Math.max(0, r - at);
|
|
223
|
-
i.style.opacity = String(y);
|
|
224
|
-
},
|
|
225
|
-
onEnd: () => {
|
|
226
|
-
i.style.opacity = p;
|
|
227
|
-
}
|
|
228
|
-
};
|
|
229
|
-
},
|
|
230
|
-
in: (i) => {
|
|
231
|
-
let c = null, p = null, r = null;
|
|
232
|
-
const y = document.body.style.overflow, f = document.getElementById(
|
|
233
|
-
v
|
|
234
|
-
);
|
|
235
|
-
let u = [];
|
|
236
|
-
const d = () => {
|
|
237
|
-
c = document.createElement("div"), c.id = v, Object.assign(c.style, st, { background: e }), document.body.appendChild(c), p = document.createElement("div"), Object.assign(p.style, it), c.appendChild(p), r = document.createElement("div"), Object.assign(r.style, nt), p.appendChild(r), o.forEach((h) => {
|
|
238
|
-
const g = document.createElement("div");
|
|
239
|
-
g.textContent = h, Object.assign(g.style, et, s), r.appendChild(g);
|
|
240
|
-
}), u = Array.from(r.children).map(
|
|
241
|
-
(h) => h.getBoundingClientRect().width
|
|
242
|
-
);
|
|
243
|
-
};
|
|
244
|
-
return {
|
|
245
|
-
physics: n,
|
|
246
|
-
from: 0,
|
|
247
|
-
to: 1,
|
|
248
|
-
prepare: () => {
|
|
249
|
-
document.body.style.overflow = "hidden", i.style.opacity = "1", f == null || f.remove(), d(), c && p && (c.style.clipPath = "none", p.style.transform = "scale(1)");
|
|
250
|
-
},
|
|
251
|
-
tick: (h) => {
|
|
252
|
-
if (!(!c || !p || !r)) {
|
|
253
|
-
if (h <= O && o.length > 0) {
|
|
254
|
-
const g = h / O, w = Math.min(
|
|
255
|
-
Math.floor(g * o.length),
|
|
256
|
-
o.length - 1
|
|
257
|
-
), b = u[w] ?? 0, C = lt(u.slice(0, w));
|
|
258
|
-
p.style.width = `${b}px`, r.style.transform = `translateX(-${C}px)`;
|
|
259
|
-
}
|
|
260
|
-
if (h > O) {
|
|
261
|
-
const w = 1 - Math.max(
|
|
262
|
-
0,
|
|
263
|
-
Math.min(1, (h - O) / ot)
|
|
264
|
-
);
|
|
265
|
-
c.style.clipPath = rt(l, w), p.style.transform = `scale(${w})`;
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
},
|
|
269
|
-
onEnd: () => {
|
|
270
|
-
c == null || c.remove(), c = p = r = null, document.body.style.overflow = y;
|
|
271
|
-
}
|
|
272
|
-
};
|
|
273
|
-
}
|
|
274
|
-
};
|
|
275
|
-
}, ct = {
|
|
276
|
-
spring: {
|
|
277
|
-
stiffness: 280,
|
|
278
|
-
damping: 30,
|
|
279
|
-
restDelta: 0.1,
|
|
280
|
-
restSpeed: 1e14
|
|
281
|
-
}
|
|
282
|
-
}, yt = {
|
|
283
|
-
spring: {
|
|
284
|
-
stiffness: 280,
|
|
285
|
-
damping: 30,
|
|
286
|
-
restDelta: 0.1,
|
|
287
|
-
restSpeed: 1e14
|
|
288
|
-
}
|
|
289
|
-
}, pt = 0.05;
|
|
290
|
-
function A(t) {
|
|
291
|
-
const e = x(document.body, t.positionedParent), o = t.scroll.y, l = window.innerHeight - e.top;
|
|
292
|
-
return {
|
|
293
|
-
top: o,
|
|
294
|
-
left: 0,
|
|
295
|
-
width: e.width,
|
|
296
|
-
height: l
|
|
297
|
-
};
|
|
298
|
-
}
|
|
299
|
-
const ss = (t = {}) => {
|
|
300
|
-
const { direction: e = "enter" } = t, o = t.physics ?? (e === "enter" ? ct : yt), l = t.scaleOffset ?? pt;
|
|
301
|
-
let { promise: s, resolve: n } = E();
|
|
302
|
-
return e === "enter" ? {
|
|
303
|
-
// Entering page: scales up from small (0.8 → 1) with fade in
|
|
304
|
-
in: (a, i) => {
|
|
305
|
-
const c = A(i), p = c.left + c.width / 2, r = c.top + c.height / 2;
|
|
306
|
-
return {
|
|
307
|
-
physics: o,
|
|
308
|
-
prepare: () => {
|
|
309
|
-
a.style.opacity = "0", a.style.willChange = "transform, opacity", a.style.backfaceVisibility = "hidden", a.style.contain = "layout paint", a.style.transformOrigin = `${p}px ${r}px`;
|
|
310
|
-
},
|
|
311
|
-
wait: async () => {
|
|
312
|
-
if (s) {
|
|
313
|
-
await s;
|
|
314
|
-
const y = E();
|
|
315
|
-
s = y.promise, n = y.resolve;
|
|
316
|
-
}
|
|
317
|
-
},
|
|
318
|
-
css: (y) => ({
|
|
319
|
-
transform: `scale(${1 - l + y * l})`,
|
|
320
|
-
opacity: y
|
|
321
|
-
}),
|
|
322
|
-
onEnd: () => {
|
|
323
|
-
a.style.opacity = "1", a.style.willChange = "auto", a.style.backfaceVisibility = "", a.style.contain = "", a.style.transformOrigin = "";
|
|
324
|
-
}
|
|
325
|
-
};
|
|
326
|
-
},
|
|
327
|
-
// Exiting page: scales up (1 → 1.2) with fade out, goes to back
|
|
328
|
-
out: (a, i) => {
|
|
329
|
-
const c = A(i), p = c.left + c.width / 2, r = c.top + c.height / 2 + i.scrollOffset.y;
|
|
330
|
-
return {
|
|
331
|
-
physics: o,
|
|
332
|
-
prepare: () => {
|
|
333
|
-
$(a, i), a.style.zIndex = "-1", a.style.willChange = "transform, opacity", a.style.backfaceVisibility = "hidden", a.style.contain = "layout paint", a.style.pointerEvents = "none", a.style.transformOrigin = `${p}px ${r}px`;
|
|
334
|
-
},
|
|
335
|
-
css: (y) => ({
|
|
336
|
-
transform: `scale(${1 + (1 - y) * l})`,
|
|
337
|
-
opacity: y
|
|
338
|
-
}),
|
|
339
|
-
onEnd: () => {
|
|
340
|
-
n && n();
|
|
341
|
-
}
|
|
342
|
-
};
|
|
343
|
-
}
|
|
344
|
-
} : {
|
|
345
|
-
// Entering page: scales down from large (1.2 → 1) with fade in
|
|
346
|
-
in: (a, i) => {
|
|
347
|
-
const c = A(i), p = c.left + c.width / 2, r = c.top + c.height / 2;
|
|
348
|
-
return {
|
|
349
|
-
physics: o,
|
|
350
|
-
prepare: () => {
|
|
351
|
-
a.style.opacity = "0", a.style.willChange = "transform, opacity", a.style.backfaceVisibility = "hidden", a.style.contain = "layout paint", a.style.transformOrigin = `${p}px ${r}px`;
|
|
352
|
-
},
|
|
353
|
-
wait: async () => {
|
|
354
|
-
if (s) {
|
|
355
|
-
await s;
|
|
356
|
-
const y = E();
|
|
357
|
-
s = y.promise, n = y.resolve;
|
|
358
|
-
}
|
|
359
|
-
},
|
|
360
|
-
css: (y) => ({
|
|
361
|
-
transform: `scale(${1 + l - y * l})`,
|
|
362
|
-
opacity: y
|
|
363
|
-
}),
|
|
364
|
-
onEnd: () => {
|
|
365
|
-
a.style.opacity = "1", a.style.willChange = "auto", a.style.backfaceVisibility = "", a.style.contain = "", a.style.transformOrigin = "";
|
|
366
|
-
}
|
|
367
|
-
};
|
|
368
|
-
},
|
|
369
|
-
// Exiting page: scales down to small (1 → 0.8) with fade out
|
|
370
|
-
out: (a, i) => {
|
|
371
|
-
const c = A(i), p = c.left + c.width / 2, r = c.top + c.height / 2 + i.scrollOffset.y;
|
|
372
|
-
return {
|
|
373
|
-
physics: o,
|
|
374
|
-
prepare: () => {
|
|
375
|
-
$(a, i), a.style.zIndex = "100", a.style.willChange = "transform, opacity", a.style.backfaceVisibility = "hidden", a.style.contain = "layout paint", a.style.pointerEvents = "none", a.style.transformOrigin = `${p}px ${r}px`;
|
|
376
|
-
},
|
|
377
|
-
css: (y) => ({
|
|
378
|
-
transform: `scale(${1 - (1 - y) * l})`,
|
|
379
|
-
opacity: y
|
|
380
|
-
}),
|
|
381
|
-
onEnd: () => {
|
|
382
|
-
n && n();
|
|
383
|
-
}
|
|
384
|
-
};
|
|
385
|
-
}
|
|
386
|
-
};
|
|
387
|
-
}, ht = {
|
|
388
|
-
spring: {
|
|
389
|
-
stiffness: 170,
|
|
390
|
-
damping: 22
|
|
391
|
-
}
|
|
392
|
-
}, dt = {
|
|
393
|
-
spring: {
|
|
394
|
-
stiffness: 170,
|
|
395
|
-
damping: 22
|
|
396
|
-
}
|
|
397
|
-
}, is = (t = {}) => {
|
|
398
|
-
const { opacity: e = !1, direction: o = "enter" } = t, l = t.physics ?? (o === "enter" ? ht : dt);
|
|
399
|
-
return o === "enter" ? {
|
|
400
|
-
in: (s) => ({
|
|
401
|
-
physics: l,
|
|
402
|
-
prepare: () => {
|
|
403
|
-
s.style.willChange = e ? "transform, opacity" : "transform", s.style.backfaceVisibility = "hidden", s.style.contain = "layout paint";
|
|
404
|
-
},
|
|
405
|
-
css: (n) => {
|
|
406
|
-
const a = {
|
|
407
|
-
transform: `translate3d(${(1 - n) * 100}%, 0, 0)`
|
|
408
|
-
};
|
|
409
|
-
return e && (a.opacity = n), a;
|
|
410
|
-
},
|
|
411
|
-
onEnd: () => {
|
|
412
|
-
s.style.willChange = "auto", s.style.backfaceVisibility = "", s.style.contain = "";
|
|
413
|
-
}
|
|
414
|
-
}),
|
|
415
|
-
out: (s, n) => ({
|
|
416
|
-
physics: l,
|
|
417
|
-
prepare: () => {
|
|
418
|
-
$(s, n), s.style.zIndex = "-1", s.style.willChange = e ? "transform, opacity" : "transform", s.style.backfaceVisibility = "hidden", s.style.contain = "layout paint", s.style.pointerEvents = "none";
|
|
419
|
-
},
|
|
420
|
-
css: (a) => {
|
|
421
|
-
const i = {
|
|
422
|
-
transform: `translate3d(${-(1 - a) * 20}%, 0, 0)`
|
|
423
|
-
};
|
|
424
|
-
return e && (i.opacity = a), i;
|
|
425
|
-
}
|
|
426
|
-
})
|
|
427
|
-
} : {
|
|
428
|
-
in: (s) => ({
|
|
429
|
-
physics: l,
|
|
430
|
-
prepare: () => {
|
|
431
|
-
s.style.willChange = e ? "transform, opacity" : "transform", s.style.backfaceVisibility = "hidden", s.style.contain = "layout paint";
|
|
432
|
-
},
|
|
433
|
-
css: (n) => {
|
|
434
|
-
const a = {
|
|
435
|
-
transform: `translate3d(${-(1 - n) * 20}%, 0, 0)`
|
|
436
|
-
};
|
|
437
|
-
return e && (a.opacity = n), a;
|
|
438
|
-
},
|
|
439
|
-
onEnd: () => {
|
|
440
|
-
s.style.willChange = "auto", s.style.backfaceVisibility = "", s.style.contain = "";
|
|
441
|
-
}
|
|
442
|
-
}),
|
|
443
|
-
out: (s, n) => ({
|
|
444
|
-
physics: l,
|
|
445
|
-
prepare: () => {
|
|
446
|
-
$(s, n), s.style.zIndex = "100", s.style.willChange = e ? "transform, opacity" : "transform", s.style.backfaceVisibility = "hidden", s.style.contain = "layout paint", s.style.pointerEvents = "none";
|
|
447
|
-
},
|
|
448
|
-
css: (a) => {
|
|
449
|
-
const i = {
|
|
450
|
-
transform: `translate3d(${(1 - a) * 100}%, 0, 0)`
|
|
451
|
-
};
|
|
452
|
-
return e && (i.opacity = a), i;
|
|
453
|
-
}
|
|
454
|
-
})
|
|
455
|
-
};
|
|
456
|
-
}, ft = {
|
|
457
|
-
spring: { stiffness: 180, damping: 20, doubleSpring: !0 }
|
|
458
|
-
}, ut = {
|
|
459
|
-
spring: { stiffness: 170, damping: 20, doubleSpring: !0 }
|
|
460
|
-
}, gt = 0, ns = (t = {}) => {
|
|
461
|
-
const { transitionDelay: e = gt } = t, o = t.physics ?? ut, l = t.physics ?? ft;
|
|
462
|
-
let { promise: s, resolve: n } = E();
|
|
463
|
-
return {
|
|
464
|
-
in: (a) => ({
|
|
465
|
-
physics: o,
|
|
466
|
-
prepare: () => {
|
|
467
|
-
a.style.opacity = "0", a.style.willChange = "opacity";
|
|
468
|
-
},
|
|
469
|
-
wait: async () => {
|
|
470
|
-
if (s) {
|
|
471
|
-
await s;
|
|
472
|
-
const i = E();
|
|
473
|
-
s = i.promise, n = i.resolve, await V(e);
|
|
474
|
-
}
|
|
475
|
-
},
|
|
476
|
-
css: (i) => ({
|
|
477
|
-
opacity: i
|
|
478
|
-
}),
|
|
479
|
-
onEnd: () => {
|
|
480
|
-
a.style.willChange = "auto", a.style.opacity = "1";
|
|
481
|
-
}
|
|
482
|
-
}),
|
|
483
|
-
out: (a, i) => ({
|
|
484
|
-
physics: l,
|
|
485
|
-
css: (c) => ({
|
|
486
|
-
opacity: c
|
|
487
|
-
}),
|
|
488
|
-
prepare: () => {
|
|
489
|
-
$(a, i), a.style.willChange = "opacity";
|
|
490
|
-
},
|
|
491
|
-
onEnd: () => {
|
|
492
|
-
n && n(), a.style.willChange = "auto";
|
|
493
|
-
}
|
|
494
|
-
})
|
|
495
|
-
};
|
|
496
|
-
}, wt = {
|
|
497
|
-
scaleDown: { stiffness: 20, damping: 7 },
|
|
498
|
-
// Soft start for cinematic scale
|
|
499
|
-
translate: { stiffness: 15, damping: 7 },
|
|
500
|
-
// Medium for movement
|
|
501
|
-
scaleUp: { stiffness: 20, damping: 7 }
|
|
502
|
-
// Crisp return to full size
|
|
503
|
-
}, S = {
|
|
504
|
-
scaleDown: 0,
|
|
505
|
-
translate: 0.2,
|
|
506
|
-
scaleUp: 0.8
|
|
507
|
-
}, $t = 0.8, bt = "white", F = 1e3 / 60, xt = 600;
|
|
508
|
-
function Et(t) {
|
|
509
|
-
const { items: e, from: o, to: l, recordFrame: s } = t, n = F / 1e3, a = Math.abs(l - o), i = e.map((p) => ({
|
|
510
|
-
item: p,
|
|
511
|
-
integrator: new W({
|
|
512
|
-
stiffness: p.spring.stiffness,
|
|
513
|
-
damping: p.spring.damping
|
|
514
|
-
}),
|
|
515
|
-
state: { position: o, velocity: 0 },
|
|
516
|
-
started: !1,
|
|
517
|
-
settled: !1,
|
|
518
|
-
settleTime: 0
|
|
519
|
-
}));
|
|
520
|
-
for (let p = 0; p < i.length; p++)
|
|
521
|
-
(p === 0 || i[p].item.offset === 0) && (i[p].started = !0);
|
|
522
|
-
s(0);
|
|
523
|
-
let c = 0;
|
|
524
|
-
for (let p = 1; p <= xt; p++) {
|
|
525
|
-
const r = p * F;
|
|
526
|
-
c = r;
|
|
527
|
-
for (const y of i)
|
|
528
|
-
!y.started || y.settled || (y.state = y.integrator.step(y.state, l, n), y.integrator.isSettled(y.state, l) ? (y.settleTime += n, y.settleTime >= B && (y.state = { position: l, velocity: 0 }, y.settled = !0)) : y.settleTime = 0, y.item.tick(y.state.position));
|
|
529
|
-
for (let y = 1; y < i.length; y++) {
|
|
530
|
-
const f = i[y];
|
|
531
|
-
if (f.started) continue;
|
|
532
|
-
const u = i[y - 1];
|
|
533
|
-
if (!u.started) continue;
|
|
534
|
-
(a === 0 ? 1 : Math.abs(u.state.position - o) / a) >= f.item.offset && (f.started = !0);
|
|
535
|
-
}
|
|
536
|
-
if (s(r), i.every((y) => y.settled))
|
|
537
|
-
return r;
|
|
538
|
-
}
|
|
539
|
-
return c;
|
|
540
|
-
}
|
|
541
|
-
function P(t, e) {
|
|
542
|
-
return t != null && t.spring ? {
|
|
543
|
-
stiffness: t.spring.stiffness,
|
|
544
|
-
damping: t.spring.damping
|
|
545
|
-
} : e;
|
|
546
|
-
}
|
|
547
|
-
function _(t) {
|
|
548
|
-
const { rect: e, springs: o, scale: l, direction: s, override: n } = t, a = s === "out" ? { scale: 1, translateY: -e.top } : { scale: l, translateY: -e.top + e.height }, i = P(n, o.scaleDown), c = P(n, o.translate), p = P(n, o.scaleUp), r = s === "out" ? 1 : 0, y = s === "out" ? 0 : 1, f = s === "out" ? [
|
|
549
|
-
{
|
|
550
|
-
spring: i,
|
|
551
|
-
offset: S.scaleDown,
|
|
552
|
-
tick: (h) => {
|
|
553
|
-
const g = 1 - h;
|
|
554
|
-
a.scale = 1 - (1 - l) * g;
|
|
555
|
-
}
|
|
556
|
-
},
|
|
557
|
-
{
|
|
558
|
-
spring: c,
|
|
559
|
-
offset: S.translate,
|
|
560
|
-
tick: (h) => {
|
|
561
|
-
const g = 1 - h;
|
|
562
|
-
a.translateY = -e.top - e.height * g;
|
|
563
|
-
}
|
|
564
|
-
},
|
|
565
|
-
{
|
|
566
|
-
spring: p,
|
|
567
|
-
offset: S.scaleUp,
|
|
568
|
-
tick: (h) => {
|
|
569
|
-
const g = 1 - h;
|
|
570
|
-
a.scale = l + (1 - l) * g;
|
|
571
|
-
}
|
|
572
|
-
}
|
|
573
|
-
] : [
|
|
574
|
-
{
|
|
575
|
-
spring: i,
|
|
576
|
-
offset: S.scaleDown,
|
|
577
|
-
tick: (h) => {
|
|
578
|
-
a.scale = 1 - (1 - l) * h;
|
|
579
|
-
}
|
|
580
|
-
},
|
|
581
|
-
{
|
|
582
|
-
spring: c,
|
|
583
|
-
offset: S.translate,
|
|
584
|
-
tick: (h) => {
|
|
585
|
-
a.translateY = -e.top + e.height * (1 - h);
|
|
586
|
-
}
|
|
587
|
-
},
|
|
588
|
-
{
|
|
589
|
-
spring: p,
|
|
590
|
-
offset: S.scaleUp,
|
|
591
|
-
tick: (h) => {
|
|
592
|
-
a.scale = l + (1 - l) * h;
|
|
593
|
-
}
|
|
594
|
-
}
|
|
595
|
-
], u = [], d = Et({
|
|
596
|
-
items: f,
|
|
597
|
-
from: r,
|
|
598
|
-
to: y,
|
|
599
|
-
recordFrame: (h) => {
|
|
600
|
-
u.push({
|
|
601
|
-
time: h,
|
|
602
|
-
scale: a.scale,
|
|
603
|
-
translateY: a.translateY
|
|
604
|
-
});
|
|
605
|
-
}
|
|
606
|
-
});
|
|
607
|
-
return { snapshots: u, totalDuration: d };
|
|
608
|
-
}
|
|
609
|
-
function L(t, e, o) {
|
|
610
|
-
return t.length === 0 || e === 0 ? [] : t.map((l) => ({
|
|
611
|
-
...o(l),
|
|
612
|
-
offset: Math.min(1, Math.max(0, l.time / e))
|
|
613
|
-
}));
|
|
614
|
-
}
|
|
615
|
-
const es = (t) => {
|
|
616
|
-
var s;
|
|
617
|
-
const e = wt, o = $t, l = ((s = t == null ? void 0 : t.border) == null ? void 0 : s.color) ?? bt;
|
|
618
|
-
return {
|
|
619
|
-
out: async (n, a) => {
|
|
620
|
-
const i = I(a), c = x(document.body, a.positionedParent), p = Ot(l, {
|
|
621
|
-
...i,
|
|
622
|
-
top: c.top
|
|
623
|
-
}), { snapshots: r, totalDuration: y } = _({
|
|
624
|
-
rect: i,
|
|
625
|
-
springs: e,
|
|
626
|
-
scale: o,
|
|
627
|
-
direction: "out",
|
|
628
|
-
override: t == null ? void 0 : t.physics
|
|
629
|
-
}), f = L(
|
|
630
|
-
r,
|
|
631
|
-
y,
|
|
632
|
-
(d) => ({
|
|
633
|
-
transform: `translateY(${d.translateY}px) scale(${d.scale})`
|
|
634
|
-
})
|
|
635
|
-
), u = Ct.map(
|
|
636
|
-
([d, h]) => L(r, y, (g) => {
|
|
637
|
-
const w = (i.width - i.width * g.scale) / 2 * 0.7 * d, b = (i.height - i.height * g.scale) / 2 * 0.7 * h;
|
|
638
|
-
return { transform: `translate(${w}px, ${b}px)` };
|
|
639
|
-
})
|
|
640
|
-
);
|
|
641
|
-
return {
|
|
642
|
-
items: [
|
|
643
|
-
{
|
|
644
|
-
keyframes: { element: n, frames: f, duration: y }
|
|
645
|
-
},
|
|
646
|
-
...u.map((d, h) => ({
|
|
647
|
-
keyframes: {
|
|
648
|
-
element: St[h](p),
|
|
649
|
-
frames: d,
|
|
650
|
-
duration: y
|
|
651
|
-
}
|
|
652
|
-
}))
|
|
653
|
-
],
|
|
654
|
-
schedule: "parallel",
|
|
655
|
-
prepare: () => {
|
|
656
|
-
$(n), D(n, i), Y(n, i), At(n, i);
|
|
657
|
-
for (const d of p)
|
|
658
|
-
a.positionedParent.appendChild(d);
|
|
659
|
-
},
|
|
660
|
-
onEnd: () => {
|
|
661
|
-
n.style.clipPath = "", n.style.transformOrigin = "", setTimeout(() => {
|
|
662
|
-
for (const d of p)
|
|
663
|
-
a.positionedParent.removeChild(d);
|
|
664
|
-
}, 1e3);
|
|
665
|
-
}
|
|
666
|
-
};
|
|
667
|
-
},
|
|
668
|
-
in: async (n, a) => {
|
|
669
|
-
const i = I(a), { snapshots: c, totalDuration: p } = _({
|
|
670
|
-
rect: i,
|
|
671
|
-
springs: e,
|
|
672
|
-
scale: o,
|
|
673
|
-
direction: "in",
|
|
674
|
-
override: t == null ? void 0 : t.physics
|
|
675
|
-
}), r = L(
|
|
676
|
-
c,
|
|
677
|
-
p,
|
|
678
|
-
(y) => ({
|
|
679
|
-
transform: `translateY(${y.translateY}px) scale(${y.scale})`
|
|
680
|
-
})
|
|
681
|
-
);
|
|
682
|
-
return {
|
|
683
|
-
items: [
|
|
684
|
-
{
|
|
685
|
-
keyframes: { element: n, frames: r, duration: p }
|
|
686
|
-
}
|
|
687
|
-
],
|
|
688
|
-
schedule: "parallel",
|
|
689
|
-
prepare: () => {
|
|
690
|
-
D(n, i), Y(n, i), n.style.transform = `translateY(${-i.top + i.height}px) scale(${o})`;
|
|
691
|
-
},
|
|
692
|
-
onEnd: () => {
|
|
693
|
-
n.style.clipPath = "", n.style.transformOrigin = "", n.style.transform = "";
|
|
694
|
-
}
|
|
695
|
-
};
|
|
696
|
-
}
|
|
697
|
-
};
|
|
698
|
-
}, Ct = [
|
|
699
|
-
[1, 1],
|
|
700
|
-
[-1, 1],
|
|
701
|
-
[1, -1],
|
|
702
|
-
[-1, -1]
|
|
703
|
-
], St = [
|
|
704
|
-
(t) => t.topLeft,
|
|
705
|
-
(t) => t.topRight,
|
|
706
|
-
(t) => t.bottomLeft,
|
|
707
|
-
(t) => t.bottomRight
|
|
708
|
-
];
|
|
709
|
-
function Ot(t = "white", e) {
|
|
710
|
-
const s = document.createElement("div");
|
|
711
|
-
s.style.position = "fixed", s.style.pointerEvents = "none", s.style.zIndex = "9999", s.style.top = `${e.top - 1}px`, s.style.left = `${e.left - 1}px`, s.style.width = "15px", s.style.height = "15px";
|
|
712
|
-
const n = document.createElement("div");
|
|
713
|
-
n.style.position = "absolute", n.style.width = "15px", n.style.height = "1px", n.style.backgroundColor = t, n.style.top = "0", n.style.left = "0";
|
|
714
|
-
const a = document.createElement("div");
|
|
715
|
-
a.style.position = "absolute", a.style.width = "1px", a.style.height = "15px", a.style.backgroundColor = t, a.style.top = "0", a.style.left = "0", s.appendChild(n), s.appendChild(a);
|
|
716
|
-
const i = document.createElement("div");
|
|
717
|
-
i.style.position = "fixed", i.style.pointerEvents = "none", i.style.zIndex = "9999", i.style.top = `${e.top - 1}px`, i.style.left = `${e.left + e.width - 15 + 1}px`, i.style.width = "15px", i.style.height = "15px";
|
|
718
|
-
const c = document.createElement("div");
|
|
719
|
-
c.style.position = "absolute", c.style.width = "15px", c.style.height = "1px", c.style.backgroundColor = t, c.style.top = "0", c.style.right = "0";
|
|
720
|
-
const p = document.createElement("div");
|
|
721
|
-
p.style.position = "absolute", p.style.width = "1px", p.style.height = "15px", p.style.backgroundColor = t, p.style.top = "0", p.style.right = "0", i.appendChild(c), i.appendChild(p);
|
|
722
|
-
const r = document.createElement("div");
|
|
723
|
-
r.style.position = "fixed", r.style.pointerEvents = "none", r.style.zIndex = "9999", r.style.top = `${e.top + e.height - 15 + 1}px`, r.style.left = `${e.left - 1}px`, r.style.width = "15px", r.style.height = "15px";
|
|
724
|
-
const y = document.createElement("div");
|
|
725
|
-
y.style.position = "absolute", y.style.width = "15px", y.style.height = "1px", y.style.backgroundColor = t, y.style.bottom = "0", y.style.left = "0";
|
|
726
|
-
const f = document.createElement("div");
|
|
727
|
-
f.style.position = "absolute", f.style.width = "1px", f.style.height = "15px", f.style.backgroundColor = t, f.style.bottom = "0", f.style.left = "0", r.appendChild(y), r.appendChild(f);
|
|
728
|
-
const u = document.createElement("div");
|
|
729
|
-
u.style.position = "fixed", u.style.pointerEvents = "none", u.style.zIndex = "9999", u.style.top = `${e.top + e.height - 15 + 1}px`, u.style.left = `${e.left + e.width - 15 + 1}px`, u.style.width = "15px", u.style.height = "15px";
|
|
730
|
-
const d = document.createElement("div");
|
|
731
|
-
d.style.position = "absolute", d.style.width = "15px", d.style.height = "1px", d.style.backgroundColor = t, d.style.bottom = "0", d.style.right = "0";
|
|
732
|
-
const h = document.createElement("div");
|
|
733
|
-
return h.style.position = "absolute", h.style.width = "1px", h.style.height = "15px", h.style.backgroundColor = t, h.style.top = "0", h.style.right = "0", u.appendChild(d), u.appendChild(h), {
|
|
734
|
-
topLeft: s,
|
|
735
|
-
topRight: i,
|
|
736
|
-
bottomLeft: r,
|
|
737
|
-
bottomRight: u,
|
|
738
|
-
*[Symbol.iterator]() {
|
|
739
|
-
yield s, yield i, yield r, yield u;
|
|
740
|
-
}
|
|
741
|
-
};
|
|
742
|
-
}
|
|
743
|
-
function I(t) {
|
|
744
|
-
const e = x(document.body, t.positionedParent);
|
|
745
|
-
return {
|
|
746
|
-
top: t.scroll.y,
|
|
747
|
-
left: 0,
|
|
748
|
-
width: e.width,
|
|
749
|
-
height: window.innerHeight - e.top
|
|
750
|
-
};
|
|
751
|
-
}
|
|
752
|
-
function D(t, e) {
|
|
753
|
-
const o = e.left + e.width / 2, l = e.top + e.height / 2;
|
|
754
|
-
t.style.transformOrigin = `${o}px ${l}px`;
|
|
755
|
-
}
|
|
756
|
-
function Y(t, e) {
|
|
757
|
-
t.style.clipPath = `polygon(
|
|
758
|
-
${e.left}px ${e.top}px,
|
|
759
|
-
${e.left + e.width}px ${e.top}px,
|
|
760
|
-
${e.left + e.width}px ${e.top + e.height}px,
|
|
761
|
-
${e.left}px ${e.top + e.height}px
|
|
762
|
-
)`;
|
|
763
|
-
}
|
|
764
|
-
function At(t, e) {
|
|
765
|
-
t.style.transform = `translateY(${-e.top}px)`;
|
|
766
|
-
}
|
|
767
|
-
const Tt = {
|
|
768
|
-
spring: { stiffness: 300, damping: 30 }
|
|
769
|
-
};
|
|
770
|
-
function kt(t, e) {
|
|
771
|
-
return t.querySelector(`[data-hero-key="${e}"]`);
|
|
772
|
-
}
|
|
773
|
-
const as = (t = {}) => {
|
|
774
|
-
const e = t.physics ?? Tt, o = t.maxDistance ?? 700;
|
|
775
|
-
let l = null, s = E();
|
|
776
|
-
return {
|
|
777
|
-
in: async (n, a) => {
|
|
778
|
-
const i = n, c = Array.from(i.querySelectorAll("[data-hero-key]"));
|
|
779
|
-
await s.promise;
|
|
780
|
-
const p = c.map((r) => {
|
|
781
|
-
const y = r.getAttribute("data-hero-key");
|
|
782
|
-
if (!y) return null;
|
|
783
|
-
const f = kt(l, y);
|
|
784
|
-
if (!f) return null;
|
|
785
|
-
const u = r, d = x(l, f), h = x(i, u), g = d.left - h.left - a.scrollOffset.x, w = d.top - h.top - a.scrollOffset.y, b = d.width / h.width, C = d.height / h.height, U = u.style.transform, H = u.style.position, X = u.style.transformOrigin, M = u.style.zIndex, z = u.style.willChange;
|
|
786
|
-
return {
|
|
787
|
-
toEl: u,
|
|
788
|
-
dx: g,
|
|
789
|
-
dy: w,
|
|
790
|
-
dw: b,
|
|
791
|
-
dh: C,
|
|
792
|
-
originalTransform: U,
|
|
793
|
-
originalPosition: H,
|
|
794
|
-
originalTransformOrigin: X,
|
|
795
|
-
originalZIndex: M,
|
|
796
|
-
originalWillChange: z
|
|
797
|
-
};
|
|
798
|
-
}).filter(
|
|
799
|
-
(r) => r !== null && Math.abs(r.dy) <= o
|
|
800
|
-
);
|
|
801
|
-
return l = null, s = E(), p.length === 0 ? {
|
|
802
|
-
physics: e,
|
|
803
|
-
tick: () => {
|
|
804
|
-
}
|
|
805
|
-
// No matching hero elements
|
|
806
|
-
} : {
|
|
807
|
-
items: p.map(({ toEl: r, dx: y, dy: f, dw: u, dh: d }) => ({
|
|
808
|
-
physics: e,
|
|
809
|
-
tick: (h) => {
|
|
810
|
-
r.style.transform = `translate(${(1 - h) * y}px, ${(1 - h) * f}px) scale(${h + (1 - h) * u}, ${h + (1 - h) * d})`;
|
|
811
|
-
}
|
|
812
|
-
})),
|
|
813
|
-
schedule: "parallel",
|
|
814
|
-
prepare: () => {
|
|
815
|
-
p.forEach(({ toEl: r }) => {
|
|
816
|
-
r.style.position = "relative", r.style.transformOrigin = "top left", r.style.zIndex = "1000", r.style.willChange = "transform";
|
|
817
|
-
});
|
|
818
|
-
},
|
|
819
|
-
onEnd: () => {
|
|
820
|
-
p.forEach(
|
|
821
|
-
({
|
|
822
|
-
toEl: r,
|
|
823
|
-
originalTransform: y,
|
|
824
|
-
originalPosition: f,
|
|
825
|
-
originalTransformOrigin: u,
|
|
826
|
-
originalZIndex: d,
|
|
827
|
-
originalWillChange: h
|
|
828
|
-
}) => {
|
|
829
|
-
r.style.transform = y, r.style.position = f, r.style.transformOrigin = u, r.style.zIndex = d, r.style.willChange = h;
|
|
830
|
-
}
|
|
831
|
-
);
|
|
832
|
-
}
|
|
833
|
-
};
|
|
834
|
-
},
|
|
835
|
-
out: async (n) => ({
|
|
836
|
-
physics: e,
|
|
837
|
-
tick: () => {
|
|
838
|
-
},
|
|
839
|
-
prepare: () => {
|
|
840
|
-
l = n, s.resolve(), $(n), n.style.opacity = "0";
|
|
841
|
-
}
|
|
842
|
-
})
|
|
843
|
-
};
|
|
844
|
-
}, Pt = {
|
|
845
|
-
spring: { stiffness: 420, damping: 34 }
|
|
846
|
-
};
|
|
847
|
-
function Lt({
|
|
848
|
-
detailRect: t,
|
|
849
|
-
galleryRect: e,
|
|
850
|
-
pageRect: o,
|
|
851
|
-
scrollOffset: l
|
|
852
|
-
}) {
|
|
853
|
-
const s = e.left - t.left + (e.width - t.width) / 2 - l.x, n = e.top - t.top + (e.height - t.height) / 2 - l.y, a = e.width / t.width, i = e.height / t.height, c = Math.max(a, i), p = t.top / o.height * 100, r = (o.width - (t.left + t.width)) / o.width * 100, y = (o.height - (t.top + t.height)) / o.height * 100, f = t.left / o.width * 100;
|
|
854
|
-
return {
|
|
855
|
-
transformOrigin: `${t.left + t.width / 2}px ${t.top + t.height / 2}px`,
|
|
856
|
-
animate: (d) => {
|
|
857
|
-
const h = 1 - d;
|
|
858
|
-
return {
|
|
859
|
-
clipPath: `inset(${p * h}% ${r * h}% ${y * h}% ${f * h}%)`,
|
|
860
|
-
transform: `translate(${s * h}px, ${n * h}px) scale(${1 + (c - 1) * h})`
|
|
861
|
-
};
|
|
862
|
-
}
|
|
863
|
-
};
|
|
864
|
-
}
|
|
865
|
-
function mt({
|
|
866
|
-
detailRect: t,
|
|
867
|
-
galleryRect: e,
|
|
868
|
-
pageRect: o,
|
|
869
|
-
scrollOffset: l
|
|
870
|
-
}) {
|
|
871
|
-
const s = e.left - t.left + (e.width - t.width) / 2 + l.x, n = e.top - t.top + (e.height - t.height) / 2 + l.y, a = e.width / t.width, i = e.height / t.height, c = Math.min(a, i), p = t.top / o.height * 100, r = (o.width - (t.left + t.width)) / o.width * 100, y = (o.height - (t.top + t.height)) / o.height * 100, f = t.left / o.width * 100;
|
|
872
|
-
return {
|
|
873
|
-
transformOrigin: `${t.left + t.width / 2}px ${t.top + t.height / 2}px`,
|
|
874
|
-
animate: (d) => {
|
|
875
|
-
const h = 1 - d;
|
|
876
|
-
return {
|
|
877
|
-
clipPath: `inset(${p * h}% ${r * h}% ${y * h}% ${f * h}%)`,
|
|
878
|
-
transform: `translate(${s * h - l.x}px, ${n * h - l.y}px) scale(${1 + (c - 1) * h})`
|
|
879
|
-
};
|
|
880
|
-
}
|
|
881
|
-
};
|
|
882
|
-
}
|
|
883
|
-
function vt(t, e, o) {
|
|
884
|
-
const l = t.querySelector(
|
|
885
|
-
"[data-instagram-detail-key]"
|
|
886
|
-
), s = e.querySelector(
|
|
887
|
-
"[data-instagram-detail-key]"
|
|
888
|
-
);
|
|
889
|
-
if (t.querySelectorAll("[data-instagram-detail-key]").length > 1 || e.querySelectorAll("[data-instagram-detail-key]").length > 1)
|
|
890
|
-
return null;
|
|
891
|
-
let n = null, a = null, i = !1;
|
|
892
|
-
if (!l && s) {
|
|
893
|
-
a = s;
|
|
894
|
-
const r = a.getAttribute("data-instagram-detail-key");
|
|
895
|
-
if (!r) return null;
|
|
896
|
-
n = t.querySelector(
|
|
897
|
-
`[data-instagram-gallery-key="${r}"]`
|
|
898
|
-
), n && (i = !0);
|
|
899
|
-
} else if (l && !s) {
|
|
900
|
-
a = l;
|
|
901
|
-
const r = a.getAttribute("data-instagram-detail-key");
|
|
902
|
-
if (!r) return null;
|
|
903
|
-
n = e.querySelector(
|
|
904
|
-
`[data-instagram-gallery-key="${r}"]`
|
|
905
|
-
), n && (i = !1);
|
|
906
|
-
}
|
|
907
|
-
if (!n || !a)
|
|
908
|
-
return null;
|
|
909
|
-
const c = x(i ? t : e, n), p = x(i ? e : t, a);
|
|
910
|
-
if (i) {
|
|
911
|
-
const r = Lt({
|
|
912
|
-
detailRect: p,
|
|
913
|
-
galleryRect: c,
|
|
914
|
-
pageRect: e.getBoundingClientRect(),
|
|
915
|
-
scrollOffset: o
|
|
916
|
-
});
|
|
917
|
-
return e.style.transformOrigin = r.transformOrigin, {
|
|
918
|
-
isEnterMode: !0,
|
|
919
|
-
inAnimation: r.animate
|
|
920
|
-
// No outAnimation - gallery stays visible
|
|
921
|
-
};
|
|
922
|
-
} else {
|
|
923
|
-
const r = mt({
|
|
924
|
-
detailRect: p,
|
|
925
|
-
galleryRect: c,
|
|
926
|
-
pageRect: t.getBoundingClientRect(),
|
|
927
|
-
scrollOffset: o
|
|
928
|
-
});
|
|
929
|
-
return t.style.transformOrigin = r.transformOrigin, {
|
|
930
|
-
isEnterMode: !1,
|
|
931
|
-
outAnimation: r.animate
|
|
932
|
-
// No inAnimation - gallery stays visible
|
|
933
|
-
};
|
|
934
|
-
}
|
|
935
|
-
}
|
|
936
|
-
const os = (t = {}) => {
|
|
937
|
-
const e = t.physics ?? Pt, o = t.timeout ?? 300;
|
|
938
|
-
let l = null, s = null, n = null, a = null;
|
|
939
|
-
return {
|
|
940
|
-
in: async (i, { scrollOffset: c }) => {
|
|
941
|
-
const p = i;
|
|
942
|
-
return !await new Promise((y) => {
|
|
943
|
-
l ? y(!0) : (s = y, setTimeout(() => {
|
|
944
|
-
s = null, y(!1);
|
|
945
|
-
}, o));
|
|
946
|
-
}) || !l ? (a == null || a(), a = null, l = null, {
|
|
947
|
-
physics: e,
|
|
948
|
-
css: () => ({})
|
|
949
|
-
}) : (n = vt(l, p, c), a == null || a(), a = null, n ? (l = null, {
|
|
950
|
-
physics: e,
|
|
951
|
-
prepare: () => {
|
|
952
|
-
i.style.willChange = "transform, clip-path", i.style.backfaceVisibility = "hidden", i.style.contain = "layout paint";
|
|
953
|
-
},
|
|
954
|
-
css: (y) => n != null && n.inAnimation ? n.inAnimation(y) : {},
|
|
955
|
-
onEnd: () => {
|
|
956
|
-
i.style.willChange = "auto", i.style.backfaceVisibility = "", i.style.contain = "";
|
|
957
|
-
}
|
|
958
|
-
}) : (l = null, {
|
|
959
|
-
physics: e,
|
|
960
|
-
css: () => ({})
|
|
961
|
-
}));
|
|
962
|
-
},
|
|
963
|
-
out: async (i, c) => {
|
|
964
|
-
const p = new Promise((r) => {
|
|
965
|
-
a = r;
|
|
966
|
-
});
|
|
967
|
-
return {
|
|
968
|
-
physics: e,
|
|
969
|
-
prepare: () => {
|
|
970
|
-
n != null && n.isEnterMode ? $(i) : ($(i, c), i.style.zIndex = "-1"), i.style.willChange = "transform, clip-path", i.style.backfaceVisibility = "hidden", i.style.contain = "layout paint";
|
|
971
|
-
},
|
|
972
|
-
wait: async () => {
|
|
973
|
-
l = i, s && (s(!0), s = null), await p;
|
|
974
|
-
},
|
|
975
|
-
css: (r) => n != null && n.outAnimation ? n.outAnimation(r) : {},
|
|
976
|
-
onEnd: () => {
|
|
977
|
-
i.style.willChange = "auto", i.style.backfaceVisibility = "", i.style.contain = "";
|
|
978
|
-
}
|
|
979
|
-
};
|
|
980
|
-
}
|
|
981
|
-
};
|
|
982
|
-
}, Ft = {
|
|
983
|
-
spring: { stiffness: 50, damping: 30 }
|
|
984
|
-
};
|
|
985
|
-
function _t(t) {
|
|
986
|
-
const e = x(document.body, t.positionedParent);
|
|
987
|
-
return {
|
|
988
|
-
top: t.scroll.y,
|
|
989
|
-
left: 0,
|
|
990
|
-
width: e.width,
|
|
991
|
-
height: window.innerHeight - e.top
|
|
992
|
-
};
|
|
993
|
-
}
|
|
994
|
-
const rs = (t = {}) => {
|
|
995
|
-
const e = t.physics ?? Ft, o = t.initialRotation ?? 45, l = t.initialScale ?? 0.01, s = t.rotationTriggerPoint ?? 0.8;
|
|
996
|
-
return {
|
|
997
|
-
out: async (n, a) => {
|
|
998
|
-
const i = n.style.opacity;
|
|
999
|
-
return {
|
|
1000
|
-
physics: {
|
|
1001
|
-
spring: {
|
|
1002
|
-
stiffness: 80,
|
|
1003
|
-
damping: 25
|
|
1004
|
-
}
|
|
1005
|
-
},
|
|
1006
|
-
from: 1,
|
|
1007
|
-
to: 0,
|
|
1008
|
-
prepare: () => {
|
|
1009
|
-
$(n, a), n.style.opacity = "1";
|
|
1010
|
-
},
|
|
1011
|
-
tick: (c) => {
|
|
1012
|
-
n.style.opacity = String(c);
|
|
1013
|
-
},
|
|
1014
|
-
onEnd: () => {
|
|
1015
|
-
n.style.opacity = i;
|
|
1016
|
-
}
|
|
1017
|
-
};
|
|
1018
|
-
},
|
|
1019
|
-
in: async (n, a) => {
|
|
1020
|
-
const i = _t(a), c = n.style.transform, p = n.style.transformOrigin, r = n.style.position, y = n.style.zIndex;
|
|
1021
|
-
return {
|
|
1022
|
-
physics: e,
|
|
1023
|
-
from: 0,
|
|
1024
|
-
to: 1,
|
|
1025
|
-
prepare: () => {
|
|
1026
|
-
const f = Math.min(i.width, i.height) * 0.4;
|
|
1027
|
-
n.style.setProperty(
|
|
1028
|
-
"--max-border-radius",
|
|
1029
|
-
`${f}px`
|
|
1030
|
-
), n.style.setProperty("--border-radius-scale", "1"), n.style.willChange = "transform", n.style.backfaceVisibility = "hidden";
|
|
1031
|
-
const u = i.left + i.width / 2, d = i.top + i.height / 2;
|
|
1032
|
-
n.style.transformOrigin = `${u}px ${d}px`, n.style.position = "fixed", n.style.top = `${i.top}px`, n.style.left = `${i.left}px`, n.style.width = `${i.width}px`, n.style.height = `${i.height}px`, n.style.zIndex = "1000", n.style.overflow = "hidden", n.style.transform = `rotate(${o}deg) scale(${l}) translateZ(0)`, n.style.borderRadius = "calc(var(--max-border-radius) * var(--border-radius-scale))", n.style.opacity = "1";
|
|
1033
|
-
},
|
|
1034
|
-
tick: (f) => {
|
|
1035
|
-
let u;
|
|
1036
|
-
if (f <= 0.05)
|
|
1037
|
-
u = l;
|
|
1038
|
-
else if (f <= s) {
|
|
1039
|
-
const w = (f - 0.05) / (s - 0.05), b = Math.pow(w, 9);
|
|
1040
|
-
u = l + (0.8 - l) * b;
|
|
1041
|
-
} else {
|
|
1042
|
-
const w = (f - s) / (1 - s);
|
|
1043
|
-
u = 0.8 + 0.2 * (1 - Math.pow(1 - w, 3));
|
|
1044
|
-
}
|
|
1045
|
-
let d;
|
|
1046
|
-
const h = 0.7;
|
|
1047
|
-
if (f <= h)
|
|
1048
|
-
d = o;
|
|
1049
|
-
else {
|
|
1050
|
-
const w = (f - h) / (1 - h), b = 1 - Math.pow(1 - w, 2);
|
|
1051
|
-
d = o * (1 - b);
|
|
1052
|
-
}
|
|
1053
|
-
let g;
|
|
1054
|
-
if (f <= h)
|
|
1055
|
-
g = 1;
|
|
1056
|
-
else {
|
|
1057
|
-
const w = (f - h) / (1 - h);
|
|
1058
|
-
g = 1 - Math.pow(w, 0.5);
|
|
1059
|
-
}
|
|
1060
|
-
n.style.transform = `rotate(${d.toFixed(2)}deg) scale(${u.toFixed(4)}) translateZ(0)`, n.style.setProperty(
|
|
1061
|
-
"--border-radius-scale",
|
|
1062
|
-
g.toFixed(4)
|
|
1063
|
-
);
|
|
1064
|
-
},
|
|
1065
|
-
onEnd: () => {
|
|
1066
|
-
n.style.willChange = "", n.style.backfaceVisibility = "", n.style.removeProperty("--max-border-radius"), n.style.removeProperty("--border-radius-scale"), n.style.transform = c, n.style.transformOrigin = p, n.style.position = r, n.style.zIndex = y, n.style.top = "", n.style.left = "", n.style.width = "", n.style.height = "", n.style.overflow = "", n.style.borderRadius = "";
|
|
1067
|
-
}
|
|
1068
|
-
};
|
|
1069
|
-
}
|
|
1070
|
-
};
|
|
1071
|
-
}, It = {
|
|
1072
|
-
spring: { stiffness: 340, damping: 30, doubleSpring: 1 }
|
|
1073
|
-
};
|
|
1074
|
-
function Dt({
|
|
1075
|
-
detailRect: t,
|
|
1076
|
-
galleryRect: e,
|
|
1077
|
-
pageRect: o,
|
|
1078
|
-
scrollOffset: l
|
|
1079
|
-
}) {
|
|
1080
|
-
const s = e.left - t.left + (e.width - t.width) / 2 - l.x, n = e.top - t.top + (e.height - t.height) / 2 - l.y, a = e.width / t.width, i = e.height / t.height, c = Math.max(a, i), p = t.top / o.height * 100, r = (o.width - (t.left + t.width)) / o.width * 100, y = (o.height - (t.top + t.height)) / o.height * 100, f = t.left / o.width * 100;
|
|
1081
|
-
return {
|
|
1082
|
-
transformOrigin: `${t.left + t.width / 2}px ${t.top + t.height / 2}px`,
|
|
1083
|
-
animate: (d) => {
|
|
1084
|
-
const h = 1 - d;
|
|
1085
|
-
return {
|
|
1086
|
-
clipPath: `inset(${p * h}% ${r * h}% ${y * h}% ${f * h}%)`,
|
|
1087
|
-
transform: `translate(${s * h}px, ${n * h}px) scale(${1 + (c - 1) * h})`
|
|
1088
|
-
};
|
|
1089
|
-
}
|
|
1090
|
-
};
|
|
1091
|
-
}
|
|
1092
|
-
function Yt({
|
|
1093
|
-
galleryRect: t,
|
|
1094
|
-
detailRect: e,
|
|
1095
|
-
scrollOffset: o
|
|
1096
|
-
}) {
|
|
1097
|
-
const l = e.left - t.left + (e.width - t.width) / 2 + o.x, s = e.top - t.top + (e.height - t.height) / 2 + o.y, n = e.width / t.width, a = e.height / t.height, i = Math.max(n, a);
|
|
1098
|
-
return {
|
|
1099
|
-
transformOrigin: `${t.left + t.width / 2}px ${t.top + t.height / 2}px`,
|
|
1100
|
-
animate: (p) => {
|
|
1101
|
-
const r = 1 - p;
|
|
1102
|
-
return {
|
|
1103
|
-
transform: `translate(${l * r - o.x}px, ${s * r - o.y}px) scale(${1 + (i - 1) * r})`,
|
|
1104
|
-
opacity: `${1 - r}`
|
|
1105
|
-
};
|
|
1106
|
-
}
|
|
1107
|
-
};
|
|
1108
|
-
}
|
|
1109
|
-
function Vt({
|
|
1110
|
-
galleryRect: t,
|
|
1111
|
-
detailRect: e,
|
|
1112
|
-
scrollOffset: o
|
|
1113
|
-
}) {
|
|
1114
|
-
const l = e.left - t.left + (e.width - t.width) / 2 - o.x, s = e.top - t.top + (e.height - t.height) / 2 - o.y, n = e.width / t.width, a = e.height / t.height, i = Math.max(n, a);
|
|
1115
|
-
return {
|
|
1116
|
-
transformOrigin: `${t.left + t.width / 2}px ${t.top + t.height / 2}px`,
|
|
1117
|
-
animate: (p) => {
|
|
1118
|
-
const r = 1 - p, y = p;
|
|
1119
|
-
return {
|
|
1120
|
-
transform: `translate(${l * r}px, ${s * r}px) scale(${1 + (i - 1) * r})`,
|
|
1121
|
-
opacity: `${y}`
|
|
1122
|
-
};
|
|
1123
|
-
}
|
|
1124
|
-
};
|
|
1125
|
-
}
|
|
1126
|
-
function Ut({
|
|
1127
|
-
detailRect: t,
|
|
1128
|
-
galleryRect: e,
|
|
1129
|
-
pageRect: o,
|
|
1130
|
-
scrollOffset: l
|
|
1131
|
-
}) {
|
|
1132
|
-
const s = e.left - t.left + (e.width - t.width) / 2 + l.x, n = e.top - t.top + (e.height - t.height) / 2 + l.y, a = e.width / t.width, i = e.height / t.height, c = Math.min(a, i), p = t.top / o.height * 100, r = (o.width - (t.left + t.width)) / o.width * 100, y = (o.height - (t.top + t.height)) / o.height * 100, f = t.left / o.width * 100;
|
|
1133
|
-
return {
|
|
1134
|
-
transformOrigin: `${t.left + t.width / 2}px ${t.top + t.height / 2}px`,
|
|
1135
|
-
animate: (d) => {
|
|
1136
|
-
const h = 1 - d;
|
|
1137
|
-
return {
|
|
1138
|
-
clipPath: `inset(${p * h}% ${r * h}% ${y * h}% ${f * h}%)`,
|
|
1139
|
-
transform: `translate(${s * h - l.x}px, ${n * h - l.y}px) scale(${1 + (c - 1) * h})`
|
|
1140
|
-
};
|
|
1141
|
-
}
|
|
1142
|
-
};
|
|
1143
|
-
}
|
|
1144
|
-
function Ht(t, e, o) {
|
|
1145
|
-
const l = t.querySelector(
|
|
1146
|
-
"[data-pinterest-detail-key]"
|
|
1147
|
-
), s = e.querySelector(
|
|
1148
|
-
"[data-pinterest-detail-key]"
|
|
1149
|
-
);
|
|
1150
|
-
if (t.querySelectorAll("[data-pinterest-detail-key]").length > 1 || e.querySelectorAll("[data-pinterest-detail-key]").length > 1)
|
|
1151
|
-
return null;
|
|
1152
|
-
let n = null, a = null, i = !1;
|
|
1153
|
-
if (!l && s) {
|
|
1154
|
-
a = s;
|
|
1155
|
-
const r = a.getAttribute("data-pinterest-detail-key");
|
|
1156
|
-
if (!r) return null;
|
|
1157
|
-
n = t.querySelector(
|
|
1158
|
-
`[data-pinterest-gallery-key="${r}"]`
|
|
1159
|
-
), n && (i = !0);
|
|
1160
|
-
} else if (l && !s) {
|
|
1161
|
-
a = l;
|
|
1162
|
-
const r = a.getAttribute("data-pinterest-detail-key");
|
|
1163
|
-
if (!r) return null;
|
|
1164
|
-
n = e.querySelector(
|
|
1165
|
-
`[data-pinterest-gallery-key="${r}"]`
|
|
1166
|
-
), n && (i = !1);
|
|
1167
|
-
}
|
|
1168
|
-
if (!n || !a)
|
|
1169
|
-
return null;
|
|
1170
|
-
const c = x(i ? t : e, n), p = x(i ? e : t, a);
|
|
1171
|
-
if (i) {
|
|
1172
|
-
const r = Dt({
|
|
1173
|
-
detailRect: p,
|
|
1174
|
-
galleryRect: c,
|
|
1175
|
-
pageRect: e.getBoundingClientRect(),
|
|
1176
|
-
scrollOffset: o
|
|
1177
|
-
}), y = Yt({
|
|
1178
|
-
galleryRect: c,
|
|
1179
|
-
detailRect: p,
|
|
1180
|
-
scrollOffset: o
|
|
1181
|
-
});
|
|
1182
|
-
return e.style.transformOrigin = r.transformOrigin, t.style.transformOrigin = y.transformOrigin, {
|
|
1183
|
-
inAnimation: r.animate,
|
|
1184
|
-
outAnimation: y.animate
|
|
1185
|
-
};
|
|
1186
|
-
} else {
|
|
1187
|
-
const r = Vt({
|
|
1188
|
-
galleryRect: c,
|
|
1189
|
-
detailRect: p,
|
|
1190
|
-
scrollOffset: o
|
|
1191
|
-
}), y = Ut({
|
|
1192
|
-
detailRect: p,
|
|
1193
|
-
galleryRect: c,
|
|
1194
|
-
pageRect: t.getBoundingClientRect(),
|
|
1195
|
-
scrollOffset: o
|
|
1196
|
-
});
|
|
1197
|
-
return e.style.transformOrigin = r.transformOrigin, t.style.transformOrigin = y.transformOrigin, {
|
|
1198
|
-
inAnimation: r.animate,
|
|
1199
|
-
outAnimation: y.animate
|
|
1200
|
-
};
|
|
1201
|
-
}
|
|
1202
|
-
}
|
|
1203
|
-
const ls = (t = {}) => {
|
|
1204
|
-
const e = t.physics ?? It, o = t.timeout ?? 300;
|
|
1205
|
-
let l = null, s = null, n = null, a = null;
|
|
1206
|
-
return {
|
|
1207
|
-
in: async (i, { scrollOffset: c }) => {
|
|
1208
|
-
const p = i;
|
|
1209
|
-
return !await new Promise((y) => {
|
|
1210
|
-
l ? y(!0) : (s = y, setTimeout(() => {
|
|
1211
|
-
s = null, y(!1);
|
|
1212
|
-
}, o));
|
|
1213
|
-
}) || !l ? (a == null || a(), a = null, l = null, {
|
|
1214
|
-
physics: e,
|
|
1215
|
-
css: () => ({})
|
|
1216
|
-
}) : (n = Ht(l, p, c), a == null || a(), a = null, n ? (l = null, {
|
|
1217
|
-
physics: e,
|
|
1218
|
-
prepare: () => {
|
|
1219
|
-
i.style.willChange = "transform, clip-path", i.style.backfaceVisibility = "hidden", i.style.contain = "layout paint";
|
|
1220
|
-
},
|
|
1221
|
-
css: (y) => n ? n.inAnimation(y) : {},
|
|
1222
|
-
onEnd: () => {
|
|
1223
|
-
i.style.willChange = "auto", i.style.backfaceVisibility = "", i.style.contain = "";
|
|
1224
|
-
}
|
|
1225
|
-
}) : (l = null, {
|
|
1226
|
-
physics: e,
|
|
1227
|
-
css: () => ({})
|
|
1228
|
-
}));
|
|
1229
|
-
},
|
|
1230
|
-
out: async (i) => {
|
|
1231
|
-
const c = new Promise((p) => {
|
|
1232
|
-
a = p;
|
|
1233
|
-
});
|
|
1234
|
-
return {
|
|
1235
|
-
physics: e,
|
|
1236
|
-
prepare: () => {
|
|
1237
|
-
$(i), i.style.zIndex = "-1", i.style.willChange = "transform, clip-path, opacity", i.style.backfaceVisibility = "hidden", i.style.contain = "layout paint", l = i, s && (s(!0), s = null);
|
|
1238
|
-
},
|
|
1239
|
-
wait: async () => {
|
|
1240
|
-
await c;
|
|
1241
|
-
},
|
|
1242
|
-
css: (p) => n ? n.outAnimation(p) : {},
|
|
1243
|
-
onEnd: () => {
|
|
1244
|
-
i.style.willChange = "auto", i.style.backfaceVisibility = "", i.style.contain = "";
|
|
1245
|
-
}
|
|
1246
|
-
};
|
|
1247
|
-
}
|
|
1248
|
-
};
|
|
1249
|
-
}, Xt = {
|
|
1250
|
-
spring: { stiffness: 100, damping: 30 }
|
|
1251
|
-
}, cs = (t = {}) => {
|
|
1252
|
-
const e = t.physics ?? Xt;
|
|
1253
|
-
return {
|
|
1254
|
-
in: (o) => ({
|
|
1255
|
-
physics: e,
|
|
1256
|
-
prepare: () => {
|
|
1257
|
-
o.style.opacity = "0", o.style.transform = "rotate(-180deg)", o.style.transformOrigin = "center center", o.style.willChange = "transform, opacity";
|
|
1258
|
-
},
|
|
1259
|
-
css: (l) => ({
|
|
1260
|
-
// -180deg → 0deg, show after 90deg (progress > 0.5)
|
|
1261
|
-
transform: `rotate(${(l - 1) * 180}deg)`,
|
|
1262
|
-
opacity: l > 0.5 ? 1 : 0
|
|
1263
|
-
}),
|
|
1264
|
-
onEnd: () => {
|
|
1265
|
-
o.style.willChange = "auto", o.style.transform = "", o.style.transformOrigin = "", o.style.opacity = "";
|
|
1266
|
-
}
|
|
1267
|
-
}),
|
|
1268
|
-
out: (o, l) => ({
|
|
1269
|
-
physics: e,
|
|
1270
|
-
prepare: () => {
|
|
1271
|
-
$(o, l), o.style.transformOrigin = "center center", o.style.willChange = "transform, opacity";
|
|
1272
|
-
},
|
|
1273
|
-
css: (s) => ({
|
|
1274
|
-
// 0deg → 180deg, hide after 90deg (progress < 0.5)
|
|
1275
|
-
transform: `rotate(${(1 - s) * 180}deg)`,
|
|
1276
|
-
opacity: s > 0.5 ? 1 : 0
|
|
1277
|
-
}),
|
|
1278
|
-
onEnd: () => {
|
|
1279
|
-
o.style.willChange = "auto";
|
|
1280
|
-
}
|
|
1281
|
-
})
|
|
1282
|
-
};
|
|
1283
|
-
}, Mt = {
|
|
1284
|
-
spring: { stiffness: 5, damping: 4 }
|
|
1285
|
-
}, ys = (t = {}) => {
|
|
1286
|
-
const e = t.direction ?? "up", o = t.physics ?? Mt, l = e === "up";
|
|
1287
|
-
let s = null, n = null, a = null;
|
|
1288
|
-
const i = () => {
|
|
1289
|
-
if (s === null || n === null)
|
|
1290
|
-
return null;
|
|
1291
|
-
const c = Math.min(s, n), p = window.innerHeight;
|
|
1292
|
-
return Math.max(c, p);
|
|
1293
|
-
};
|
|
1294
|
-
return {
|
|
1295
|
-
in: (c) => (n = c.offsetHeight, s !== null && (a = i()), {
|
|
1296
|
-
physics: o,
|
|
1297
|
-
prepare: () => {
|
|
1298
|
-
c.style.willChange = "transform", c.style.backfaceVisibility = "hidden", c.style.contain = "layout paint";
|
|
1299
|
-
},
|
|
1300
|
-
tick: (p) => {
|
|
1301
|
-
a === null && (a = i());
|
|
1302
|
-
const r = a ?? window.innerHeight, y = l ? (1 - p) * r : (1 - p) * -r;
|
|
1303
|
-
c.style.transform = `translate3d(0, ${y}px, 0)`;
|
|
1304
|
-
},
|
|
1305
|
-
onEnd: () => {
|
|
1306
|
-
c.style.willChange = "auto", c.style.backfaceVisibility = "", c.style.contain = "";
|
|
1307
|
-
}
|
|
1308
|
-
}),
|
|
1309
|
-
out: (c, p) => ({
|
|
1310
|
-
physics: o,
|
|
1311
|
-
tick: (r) => {
|
|
1312
|
-
a === null && (a = i());
|
|
1313
|
-
const y = a ?? window.innerHeight, f = l ? (1 - r) * -y : (1 - r) * y;
|
|
1314
|
-
c.style.transform = `translate3d(0, ${f}px, 0)`;
|
|
1315
|
-
},
|
|
1316
|
-
prepare: () => {
|
|
1317
|
-
s = c.offsetHeight, n !== null && (a = i()), $(c, p), c.style.zIndex = l ? "-1" : "1", c.style.willChange = "transform", c.style.backfaceVisibility = "hidden", c.style.contain = "layout paint", c.style.pointerEvents = "none";
|
|
1318
|
-
}
|
|
1319
|
-
})
|
|
1320
|
-
};
|
|
1321
|
-
}, zt = {
|
|
1322
|
-
spring: {
|
|
1323
|
-
stiffness: 200,
|
|
1324
|
-
damping: 24
|
|
1325
|
-
}
|
|
1326
|
-
}, Wt = {
|
|
1327
|
-
inertia: {
|
|
1328
|
-
acceleration: 25,
|
|
1329
|
-
resistance: 1.2
|
|
1330
|
-
}
|
|
1331
|
-
}, Bt = 0.2;
|
|
1332
|
-
function T(t) {
|
|
1333
|
-
const e = x(document.body, t.positionedParent), o = t.scroll.y, l = t.scrollingElement.offsetHeight - e.top, s = {
|
|
1334
|
-
top: o,
|
|
1335
|
-
left: 0,
|
|
1336
|
-
width: e.width,
|
|
1337
|
-
height: l
|
|
1338
|
-
};
|
|
1339
|
-
return {
|
|
1340
|
-
...s,
|
|
1341
|
-
centerX: s.left + s.width / 2,
|
|
1342
|
-
centerY: s.top + s.height / 2
|
|
1343
|
-
};
|
|
1344
|
-
}
|
|
1345
|
-
const ps = (t = {}) => {
|
|
1346
|
-
const { direction: e = "enter" } = t, o = t.physics ?? (e === "enter" ? zt : Wt), l = t.scaleOffset ?? Bt;
|
|
1347
|
-
return e === "enter" ? {
|
|
1348
|
-
// Entering sheet: slides up from bottom
|
|
1349
|
-
in: (s, n) => {
|
|
1350
|
-
const a = T(n);
|
|
1351
|
-
return {
|
|
1352
|
-
physics: o,
|
|
1353
|
-
prepare: () => {
|
|
1354
|
-
s.style.willChange = "transform", s.style.backfaceVisibility = "hidden", s.style.contain = "layout paint", s.style.clipPath = `inset(${a.top}px 0 calc(100% - ${a.top + a.height}px) 0)`;
|
|
1355
|
-
},
|
|
1356
|
-
css: (i) => ({
|
|
1357
|
-
transform: `translate3d(0, ${(1 - i) * a.height}px, 0)`
|
|
1358
|
-
}),
|
|
1359
|
-
onEnd: () => {
|
|
1360
|
-
s.style.willChange = "auto", s.style.backfaceVisibility = "", s.style.contain = "", s.style.clipPath = "";
|
|
1361
|
-
}
|
|
1362
|
-
};
|
|
1363
|
-
},
|
|
1364
|
-
// Exiting background: scales down with fade
|
|
1365
|
-
out: (s, n) => {
|
|
1366
|
-
const a = T(n), i = a.left + a.width / 2, c = a.top + a.height / 2;
|
|
1367
|
-
return {
|
|
1368
|
-
physics: o,
|
|
1369
|
-
prepare: () => {
|
|
1370
|
-
$(s, n), s.style.zIndex = "-1", s.style.willChange = "transform, opacity", s.style.backfaceVisibility = "hidden", s.style.contain = "layout paint", s.style.pointerEvents = "none", s.style.transformOrigin = `${i}px ${c}px`, s.style.clipPath = `inset(${a.top}px 0 calc(100% - ${a.top + a.height}px) 0)`;
|
|
1371
|
-
},
|
|
1372
|
-
css: (p) => ({
|
|
1373
|
-
transform: `scale(${1 - l + p * l})`,
|
|
1374
|
-
opacity: p
|
|
1375
|
-
})
|
|
1376
|
-
};
|
|
1377
|
-
}
|
|
1378
|
-
} : {
|
|
1379
|
-
// Entering background: scales up with fade
|
|
1380
|
-
in: (s, n) => {
|
|
1381
|
-
const a = T(n), i = a.left + a.width / 2, c = a.top + a.height / 2;
|
|
1382
|
-
return {
|
|
1383
|
-
physics: o,
|
|
1384
|
-
prepare: () => {
|
|
1385
|
-
s.style.willChange = "transform, opacity", s.style.backfaceVisibility = "hidden", s.style.contain = "layout paint", s.style.transformOrigin = `${i}px ${c}px`, s.style.clipPath = `inset(${a.top}px 0 calc(100% - ${a.top + a.height}px) 0)`;
|
|
1386
|
-
},
|
|
1387
|
-
css: (p) => ({
|
|
1388
|
-
transform: `scale(${1 - l + p * l})`,
|
|
1389
|
-
opacity: p
|
|
1390
|
-
}),
|
|
1391
|
-
onEnd: () => {
|
|
1392
|
-
s.style.willChange = "auto", s.style.backfaceVisibility = "", s.style.contain = "", s.style.transformOrigin = "", s.style.clipPath = "";
|
|
1393
|
-
}
|
|
1394
|
-
};
|
|
1395
|
-
},
|
|
1396
|
-
// Exiting sheet: slides down with high z-index
|
|
1397
|
-
out: (s, n) => {
|
|
1398
|
-
const i = T(n).height, c = n.scroll.y;
|
|
1399
|
-
return {
|
|
1400
|
-
physics: o,
|
|
1401
|
-
prepare: () => {
|
|
1402
|
-
$(s, n), s.style.zIndex = "100", s.style.willChange = "transform", s.style.backfaceVisibility = "hidden", s.style.contain = "layout paint", s.style.pointerEvents = "none", s.style.clipPath = `inset(${c}px 0 calc(100% - ${c + i}px) 0)`;
|
|
1403
|
-
},
|
|
1404
|
-
css: (p) => ({
|
|
1405
|
-
transform: `translate3d(0, ${(1 - p) * i}px, 0)`
|
|
1406
|
-
})
|
|
1407
|
-
};
|
|
1408
|
-
}
|
|
1409
|
-
};
|
|
1410
|
-
}, qt = {
|
|
1411
|
-
spring: {
|
|
1412
|
-
stiffness: 170,
|
|
1413
|
-
damping: 22,
|
|
1414
|
-
doubleSpring: 0.8
|
|
1415
|
-
}
|
|
1416
|
-
}, hs = (t = {}) => {
|
|
1417
|
-
const e = t.direction ?? "left", o = t.physics ?? qt, l = e === "left";
|
|
1418
|
-
return {
|
|
1419
|
-
in: (s) => ({
|
|
1420
|
-
physics: o,
|
|
1421
|
-
prepare: () => {
|
|
1422
|
-
s.style.willChange = "transform", s.style.backfaceVisibility = "hidden", s.style.contain = "layout paint";
|
|
1423
|
-
},
|
|
1424
|
-
css: (n) => ({
|
|
1425
|
-
transform: `translate3d(${l ? (1 - n) * 100 : (1 - n) * -100}%, 0, 0)`
|
|
1426
|
-
}),
|
|
1427
|
-
onEnd: () => {
|
|
1428
|
-
s.style.willChange = "auto", s.style.backfaceVisibility = "", s.style.contain = "";
|
|
1429
|
-
}
|
|
1430
|
-
}),
|
|
1431
|
-
out: (s, n) => ({
|
|
1432
|
-
physics: o,
|
|
1433
|
-
css: (a) => ({
|
|
1434
|
-
transform: `translate3d(${l ? (1 - a) * -100 : (1 - a) * 100}%, 0, 0)`
|
|
1435
|
-
}),
|
|
1436
|
-
prepare: () => {
|
|
1437
|
-
$(s, n), s.style.willChange = "transform", s.style.backfaceVisibility = "hidden", s.style.contain = "layout paint", s.style.pointerEvents = "none";
|
|
1438
|
-
}
|
|
1439
|
-
})
|
|
1440
|
-
};
|
|
1441
|
-
}, jt = 8, Nt = {
|
|
1442
|
-
spring: {
|
|
1443
|
-
stiffness: 400,
|
|
1444
|
-
damping: 30,
|
|
1445
|
-
restDelta: 0.1,
|
|
1446
|
-
restSpeed: 1e14
|
|
1447
|
-
}
|
|
1448
|
-
}, ds = (t = {}) => {
|
|
1449
|
-
const e = t.direction ?? "left", o = t.physics ?? Nt, l = t.translateOffset ?? jt, s = e === "left";
|
|
1450
|
-
let { promise: n, resolve: a } = E();
|
|
1451
|
-
return {
|
|
1452
|
-
// Entering page: fades in + slides from opposite direction
|
|
1453
|
-
in: (i) => ({
|
|
1454
|
-
physics: o,
|
|
1455
|
-
prepare: () => {
|
|
1456
|
-
i.style.opacity = "0", i.style.willChange = "transform, opacity", i.style.backfaceVisibility = "hidden", i.style.contain = "layout paint";
|
|
1457
|
-
},
|
|
1458
|
-
wait: async () => {
|
|
1459
|
-
if (n) {
|
|
1460
|
-
await n;
|
|
1461
|
-
const c = E();
|
|
1462
|
-
n = c.promise, a = c.resolve;
|
|
1463
|
-
}
|
|
1464
|
-
},
|
|
1465
|
-
css: (c) => {
|
|
1466
|
-
const p = s ? (1 - c) * l : (1 - c) * -l, r = `${c}`;
|
|
1467
|
-
return {
|
|
1468
|
-
transform: `translate3d(${p}px, 0, 0)`,
|
|
1469
|
-
opacity: r
|
|
1470
|
-
};
|
|
1471
|
-
},
|
|
1472
|
-
onEnd: () => {
|
|
1473
|
-
i.style.opacity = "1", i.style.willChange = "auto", i.style.backfaceVisibility = "", i.style.contain = "";
|
|
1474
|
-
}
|
|
1475
|
-
}),
|
|
1476
|
-
// Exiting page: fade out + slide in same direction as navigation
|
|
1477
|
-
out: (i, c) => ({
|
|
1478
|
-
physics: o,
|
|
1479
|
-
prepare: () => {
|
|
1480
|
-
$(i, c), i.style.willChange = "transform, opacity", i.style.backfaceVisibility = "hidden", i.style.contain = "layout paint", i.style.pointerEvents = "none";
|
|
1481
|
-
},
|
|
1482
|
-
css: (p) => {
|
|
1483
|
-
const r = s ? (1 - p) * -l : (1 - p) * l, y = `${p}`;
|
|
1484
|
-
return {
|
|
1485
|
-
transform: `translate3d(${r}px, 0, 0)`,
|
|
1486
|
-
opacity: y
|
|
1487
|
-
};
|
|
1488
|
-
},
|
|
1489
|
-
onEnd: () => {
|
|
1490
|
-
a && a(), i.style.willChange = "auto", i.style.backfaceVisibility = "", i.style.contain = "";
|
|
1491
|
-
}
|
|
1492
|
-
})
|
|
1493
|
-
};
|
|
1494
|
-
}, Gt = {
|
|
1495
|
-
spring: { stiffness: 17, damping: 6 }
|
|
1496
|
-
}, m = 20, k = 800, fs = (t = {}) => {
|
|
1497
|
-
const e = t.physics ?? Gt;
|
|
1498
|
-
let o, l = null;
|
|
1499
|
-
return {
|
|
1500
|
-
in: (s) => ({
|
|
1501
|
-
physics: e,
|
|
1502
|
-
prepare: () => {
|
|
1503
|
-
s.style.willChange = "transform", s.style.backfaceVisibility = "hidden", s.style.contain = "layout paint", s.style.transform = `perspective(${k}px) rotateY(${m}deg) translate3d(-100%, 0, 0)`;
|
|
1504
|
-
},
|
|
1505
|
-
wait: async () => {
|
|
1506
|
-
o && await o;
|
|
1507
|
-
},
|
|
1508
|
-
css: (n) => {
|
|
1509
|
-
const a = (1 - n) * m, i = -(1 - n) * 100;
|
|
1510
|
-
return {
|
|
1511
|
-
transform: `perspective(${k}px) rotateY(${a}deg) translate3d(${i}%, 0, 0)`
|
|
1512
|
-
};
|
|
1513
|
-
},
|
|
1514
|
-
onEnd: () => {
|
|
1515
|
-
s.style.transform = "", s.style.willChange = "auto", s.style.backfaceVisibility = "", s.style.contain = "";
|
|
1516
|
-
}
|
|
1517
|
-
}),
|
|
1518
|
-
out: (s, n) => (o = new Promise((a) => {
|
|
1519
|
-
l = a;
|
|
1520
|
-
}), {
|
|
1521
|
-
physics: e,
|
|
1522
|
-
prepare: () => {
|
|
1523
|
-
$(s, n), s.style.willChange = "transform", s.style.backfaceVisibility = "hidden", s.style.contain = "layout paint", s.style.pointerEvents = "none", s.style.transform = `perspective(${k}px) rotateY(0deg) translate3d(0%, 0, 0)`;
|
|
1524
|
-
},
|
|
1525
|
-
css: (a) => {
|
|
1526
|
-
const i = 1 - a, c = i * m, p = i * 100;
|
|
1527
|
-
return {
|
|
1528
|
-
transform: `perspective(${k}px) rotateY(${-c}deg) translate3d(${p}%, 0, 0)`
|
|
1529
|
-
};
|
|
1530
|
-
},
|
|
1531
|
-
onEnd: () => {
|
|
1532
|
-
l && l(), s.style.transform = "";
|
|
1533
|
-
}
|
|
1534
|
-
})
|
|
1535
|
-
};
|
|
1536
|
-
}, Zt = {
|
|
1537
|
-
spring: {
|
|
1538
|
-
stiffness: 350,
|
|
1539
|
-
damping: 32,
|
|
1540
|
-
restDelta: 0.1,
|
|
1541
|
-
restSpeed: 1e14
|
|
1542
|
-
}
|
|
1543
|
-
}, Kt = 0.05;
|
|
1544
|
-
function Jt(t) {
|
|
1545
|
-
const e = x(document.body, t.positionedParent), o = t.scroll.y, l = window.innerHeight - e.top;
|
|
1546
|
-
return {
|
|
1547
|
-
top: o,
|
|
1548
|
-
left: 0,
|
|
1549
|
-
width: e.width,
|
|
1550
|
-
height: l
|
|
1551
|
-
};
|
|
1552
|
-
}
|
|
1553
|
-
const us = (t = {}) => {
|
|
1554
|
-
const e = t.physics ?? Zt, o = t.scaleOffset ?? Kt;
|
|
1555
|
-
let { promise: l, resolve: s } = E();
|
|
1556
|
-
return {
|
|
1557
|
-
// Entering page: scales up from small (0.95 → 1) with fade in
|
|
1558
|
-
in: (n, a) => {
|
|
1559
|
-
const i = Jt(a), c = i.left + i.width / 2, p = i.top + i.height / 2;
|
|
1560
|
-
return {
|
|
1561
|
-
physics: e,
|
|
1562
|
-
prepare: () => {
|
|
1563
|
-
n.style.opacity = "0", n.style.willChange = "transform, opacity", n.style.backfaceVisibility = "hidden", n.style.contain = "layout paint", n.style.transformOrigin = `${c}px ${p}px`;
|
|
1564
|
-
},
|
|
1565
|
-
wait: async () => {
|
|
1566
|
-
if (l) {
|
|
1567
|
-
await l;
|
|
1568
|
-
const r = E();
|
|
1569
|
-
l = r.promise, s = r.resolve;
|
|
1570
|
-
}
|
|
1571
|
-
},
|
|
1572
|
-
css: (r) => ({
|
|
1573
|
-
transform: `scale(${1 - o + r * o})`,
|
|
1574
|
-
opacity: r
|
|
1575
|
-
}),
|
|
1576
|
-
onEnd: () => {
|
|
1577
|
-
n.style.opacity = "1", n.style.willChange = "auto", n.style.backfaceVisibility = "", n.style.contain = "", n.style.transformOrigin = "";
|
|
1578
|
-
}
|
|
1579
|
-
};
|
|
1580
|
-
},
|
|
1581
|
-
// Exiting page: fade out only (no scale)
|
|
1582
|
-
out: (n, a) => ({
|
|
1583
|
-
physics: e,
|
|
1584
|
-
prepare: () => {
|
|
1585
|
-
$(n, a), n.style.willChange = "opacity", n.style.backfaceVisibility = "hidden", n.style.contain = "layout paint", n.style.pointerEvents = "none";
|
|
1586
|
-
},
|
|
1587
|
-
css: (i) => ({
|
|
1588
|
-
opacity: i
|
|
1589
|
-
}),
|
|
1590
|
-
onEnd: () => {
|
|
1591
|
-
s && s();
|
|
1592
|
-
}
|
|
1593
|
-
})
|
|
1594
|
-
};
|
|
1595
|
-
};
|
|
1596
|
-
export {
|
|
1597
|
-
Rt as blind,
|
|
1598
|
-
ts as curtainReveal,
|
|
1599
|
-
ss as depth,
|
|
1600
|
-
is as drill,
|
|
1601
|
-
ns as fade,
|
|
1602
|
-
es as film,
|
|
1603
|
-
as as hero,
|
|
1604
|
-
os as instagram,
|
|
1605
|
-
rs as jaemin,
|
|
1606
|
-
ls as pinterest,
|
|
1607
|
-
cs as rotate,
|
|
1608
|
-
ys as scroll,
|
|
1609
|
-
ps as sheet,
|
|
1610
|
-
hs as slide,
|
|
1611
|
-
ds as snap,
|
|
1612
|
-
fs as strip,
|
|
1613
|
-
us as swap
|
|
1614
|
-
};
|