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