@ssgoi/core 2.0.0 → 2.1.2
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/create-ssgoi-transition-context.d.ts.map +1 -1
- package/dist/create-transition-callback.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +284 -238
- package/dist/transition-strategy.d.ts.map +1 -1
- package/dist/transition.d.ts +51 -11
- package/dist/transition.d.ts.map +1 -1
- package/dist/transitions/blur.d.ts +3 -0
- package/dist/transitions/blur.d.ts.map +1 -1
- package/dist/transitions/bounce.d.ts +3 -0
- package/dist/transitions/bounce.d.ts.map +1 -1
- package/dist/transitions/fade.d.ts +3 -0
- package/dist/transitions/fade.d.ts.map +1 -1
- package/dist/transitions/fly.d.ts +3 -0
- package/dist/transitions/fly.d.ts.map +1 -1
- package/dist/transitions/index.cjs +1 -1
- package/dist/transitions/index.js +121 -105
- package/dist/transitions/none.d.ts +3 -0
- package/dist/transitions/none.d.ts.map +1 -1
- package/dist/transitions/rotate.d.ts +3 -0
- package/dist/transitions/rotate.d.ts.map +1 -1
- package/dist/transitions/scale.d.ts +3 -0
- package/dist/transitions/scale.d.ts.map +1 -1
- package/dist/transitions/slide.d.ts +3 -0
- package/dist/transitions/slide.d.ts.map +1 -1
- package/dist/types.d.ts +11 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/utils-8Eptbv7c.cjs +2 -0
- package/dist/utils-DTRMUQW4.js +31 -0
- package/dist/utils.d.ts +11 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/view-transitions/drill.d.ts +9 -0
- package/dist/view-transitions/drill.d.ts.map +1 -0
- package/dist/view-transitions/fade.d.ts +3 -1
- package/dist/view-transitions/fade.d.ts.map +1 -1
- package/dist/view-transitions/hero.d.ts.map +1 -1
- package/dist/view-transitions/index.cjs +1 -1
- package/dist/view-transitions/index.d.ts +1 -0
- package/dist/view-transitions/index.d.ts.map +1 -1
- package/dist/view-transitions/index.js +234 -169
- package/dist/view-transitions/scroll.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/utils-BSgyev81.cjs +0 -1
- package/dist/utils-DR41YsAh.js +0 -16
|
@@ -1,84 +1,142 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const
|
|
3
|
-
var
|
|
4
|
-
const n = {
|
|
5
|
-
stiffness: ((
|
|
6
|
-
damping: ((
|
|
1
|
+
import { a as x, s as Y } from "../utils-DTRMUQW4.js";
|
|
2
|
+
const b = (t = {}) => {
|
|
3
|
+
var l, r;
|
|
4
|
+
const { opacity: n = !1, direction: s = "enter" } = t, e = {
|
|
5
|
+
stiffness: ((l = t.spring) == null ? void 0 : l.stiffness) ?? 150,
|
|
6
|
+
damping: ((r = t.spring) == null ? void 0 : r.damping) ?? 20
|
|
7
|
+
};
|
|
8
|
+
return s === "enter" ? {
|
|
9
|
+
in: (a) => ({
|
|
10
|
+
spring: e,
|
|
11
|
+
tick: (i) => {
|
|
12
|
+
a.style.transform = `translateX(${(1 - i) * 100}%)`, n && (a.style.opacity = i.toString());
|
|
13
|
+
}
|
|
14
|
+
}),
|
|
15
|
+
out: (a) => ({
|
|
16
|
+
spring: e,
|
|
17
|
+
prepare: (i) => {
|
|
18
|
+
x(i), i.style.zIndex = "-1";
|
|
19
|
+
},
|
|
20
|
+
tick: (i) => {
|
|
21
|
+
a.style.transform = `translateX(${-(1 - i) * 20}%)`, n && (a.style.opacity = i.toString());
|
|
22
|
+
}
|
|
23
|
+
})
|
|
24
|
+
} : {
|
|
25
|
+
in: (a) => ({
|
|
26
|
+
spring: {
|
|
27
|
+
stiffness: 100,
|
|
28
|
+
damping: 20
|
|
29
|
+
},
|
|
30
|
+
tick: (i) => {
|
|
31
|
+
a.style.transform = `translateX(${-(1 - i) * 20}%)`, n && (a.style.opacity = i.toString());
|
|
32
|
+
}
|
|
33
|
+
}),
|
|
34
|
+
out: (a) => ({
|
|
35
|
+
spring: {
|
|
36
|
+
stiffness: 100,
|
|
37
|
+
damping: 20
|
|
38
|
+
},
|
|
39
|
+
prepare: (i) => {
|
|
40
|
+
x(i), i.style.zIndex = "100";
|
|
41
|
+
},
|
|
42
|
+
tick: (i) => {
|
|
43
|
+
a.style.transform = `translateX(${(1 - i) * 100}%)`, n && (a.style.opacity = i.toString());
|
|
44
|
+
}
|
|
45
|
+
})
|
|
7
46
|
};
|
|
47
|
+
}, q = { stiffness: 400, damping: 20 }, F = { stiffness: 40, damping: 8 }, X = 100, v = (t = {}) => {
|
|
48
|
+
const {
|
|
49
|
+
inSpring: n = F,
|
|
50
|
+
outSpring: s = q,
|
|
51
|
+
transitionDelay: e = X
|
|
52
|
+
} = t;
|
|
53
|
+
let l, r = null;
|
|
8
54
|
return {
|
|
9
|
-
in: (
|
|
55
|
+
in: (a) => ({
|
|
10
56
|
spring: n,
|
|
11
|
-
|
|
12
|
-
|
|
57
|
+
prepare: (i) => {
|
|
58
|
+
i.style.opacity = "0";
|
|
59
|
+
},
|
|
60
|
+
wait: async () => {
|
|
61
|
+
l && (await l, await Y(e));
|
|
62
|
+
},
|
|
63
|
+
tick: (i) => {
|
|
64
|
+
a.style.opacity = i.toString();
|
|
13
65
|
}
|
|
14
66
|
}),
|
|
15
|
-
out: (
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
67
|
+
out: (a) => (l = new Promise((i) => {
|
|
68
|
+
r = i;
|
|
69
|
+
}), {
|
|
70
|
+
spring: s,
|
|
71
|
+
tick: (i) => {
|
|
72
|
+
a.style.opacity = i.toString();
|
|
19
73
|
},
|
|
20
|
-
prepare:
|
|
74
|
+
prepare: x,
|
|
75
|
+
onEnd: () => {
|
|
76
|
+
r && r();
|
|
77
|
+
}
|
|
21
78
|
})
|
|
22
79
|
};
|
|
23
80
|
};
|
|
24
|
-
function
|
|
81
|
+
function z(t, n) {
|
|
25
82
|
return t.querySelector(`[data-hero-key="${n}"]`);
|
|
26
83
|
}
|
|
27
84
|
function A(t, n) {
|
|
28
|
-
const
|
|
85
|
+
const s = t.getBoundingClientRect(), e = n.getBoundingClientRect();
|
|
29
86
|
return new DOMRect(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
87
|
+
e.left - s.left,
|
|
88
|
+
e.top - s.top,
|
|
89
|
+
e.width,
|
|
90
|
+
e.height
|
|
34
91
|
);
|
|
35
92
|
}
|
|
36
|
-
const
|
|
37
|
-
var
|
|
93
|
+
const H = (t = {}) => {
|
|
94
|
+
var r, a;
|
|
38
95
|
const n = {
|
|
39
|
-
stiffness: ((
|
|
40
|
-
damping: ((
|
|
41
|
-
},
|
|
42
|
-
let
|
|
96
|
+
stiffness: ((r = t.spring) == null ? void 0 : r.stiffness) ?? 300,
|
|
97
|
+
damping: ((a = t.spring) == null ? void 0 : a.damping) ?? 30
|
|
98
|
+
}, s = t.timeout ?? 300;
|
|
99
|
+
let e = null, l = null;
|
|
43
100
|
return {
|
|
44
|
-
in: async (
|
|
45
|
-
const
|
|
46
|
-
if (
|
|
101
|
+
in: async (i, o) => {
|
|
102
|
+
const c = i, y = Array.from(c.querySelectorAll("[data-hero-key]"));
|
|
103
|
+
if (y.length === 0)
|
|
47
104
|
return {
|
|
48
105
|
spring: n,
|
|
49
106
|
tick: () => {
|
|
50
107
|
}
|
|
51
108
|
// No hero elements, skip animation
|
|
52
109
|
};
|
|
53
|
-
if (!await new Promise((
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
},
|
|
57
|
-
}) || !
|
|
58
|
-
return
|
|
110
|
+
if (!await new Promise((h) => {
|
|
111
|
+
e ? h(!0) : (l = h, setTimeout(() => {
|
|
112
|
+
l = null, h(!1);
|
|
113
|
+
}, s));
|
|
114
|
+
}) || !e)
|
|
115
|
+
return e = null, {
|
|
59
116
|
spring: n,
|
|
60
117
|
tick: () => {
|
|
61
118
|
}
|
|
62
119
|
// No fromNode, skip animation
|
|
63
120
|
};
|
|
64
|
-
const
|
|
65
|
-
const $ =
|
|
121
|
+
const p = y.map((h) => {
|
|
122
|
+
const $ = h.getAttribute("data-hero-key");
|
|
66
123
|
if (!$) return null;
|
|
67
|
-
const
|
|
68
|
-
if (!
|
|
69
|
-
const
|
|
124
|
+
const u = z(e, $);
|
|
125
|
+
if (!u) return null;
|
|
126
|
+
const g = h, f = A(e, u), w = A(c, g), k = f.left - w.left - o.scrollOffset.x, T = f.top - w.top - o.scrollOffset.y, m = f.width / w.width, D = f.height / w.height, E = g.style.transform, B = g.style.position, L = g.style.transformOrigin, P = g.style.zIndex;
|
|
70
127
|
return {
|
|
71
|
-
toEl:
|
|
72
|
-
dx:
|
|
73
|
-
dy:
|
|
74
|
-
dw:
|
|
75
|
-
dh:
|
|
76
|
-
originalTransform:
|
|
77
|
-
originalPosition:
|
|
78
|
-
originalTransformOrigin:
|
|
128
|
+
toEl: g,
|
|
129
|
+
dx: k,
|
|
130
|
+
dy: T,
|
|
131
|
+
dw: m,
|
|
132
|
+
dh: D,
|
|
133
|
+
originalTransform: E,
|
|
134
|
+
originalPosition: B,
|
|
135
|
+
originalTransformOrigin: L,
|
|
136
|
+
originalZIndex: P
|
|
79
137
|
};
|
|
80
138
|
}).filter(Boolean);
|
|
81
|
-
return
|
|
139
|
+
return e = null, p.length === 0 ? {
|
|
82
140
|
spring: n,
|
|
83
141
|
tick: () => {
|
|
84
142
|
}
|
|
@@ -86,164 +144,165 @@ const b = (t = {}) => {
|
|
|
86
144
|
} : {
|
|
87
145
|
spring: n,
|
|
88
146
|
prepare: () => {
|
|
89
|
-
|
|
90
|
-
|
|
147
|
+
p.forEach(({ toEl: h }) => {
|
|
148
|
+
h.style.position = "relative", h.style.transformOrigin = "top left", h.style.zIndex = "1000";
|
|
91
149
|
});
|
|
92
150
|
},
|
|
93
|
-
tick: (
|
|
94
|
-
|
|
95
|
-
$.style.transform = `translate(${(1 -
|
|
151
|
+
tick: (h) => {
|
|
152
|
+
p.forEach(({ toEl: $, dx: u, dy: g, dw: f, dh: w }) => {
|
|
153
|
+
$.style.transform = `translate(${(1 - h) * u}px,${(1 - h) * g}px) scale(${h + (1 - h) * f}, ${h + (1 - h) * w})`;
|
|
96
154
|
});
|
|
97
155
|
},
|
|
98
156
|
onEnd: () => {
|
|
99
|
-
|
|
157
|
+
p.forEach(
|
|
100
158
|
({
|
|
101
|
-
toEl:
|
|
159
|
+
toEl: h,
|
|
102
160
|
originalTransform: $,
|
|
103
|
-
originalPosition:
|
|
104
|
-
originalTransformOrigin:
|
|
161
|
+
originalPosition: u,
|
|
162
|
+
originalTransformOrigin: g,
|
|
163
|
+
originalZIndex: f
|
|
105
164
|
}) => {
|
|
106
|
-
|
|
165
|
+
h.style.transform = $, h.style.position = u, h.style.transformOrigin = g, h.style.zIndex = f;
|
|
107
166
|
}
|
|
108
167
|
);
|
|
109
168
|
}
|
|
110
169
|
};
|
|
111
170
|
},
|
|
112
|
-
out: async (
|
|
171
|
+
out: async (i) => ({
|
|
113
172
|
onStart: () => {
|
|
114
|
-
|
|
173
|
+
e = i, l && (l(!0), l = null);
|
|
115
174
|
},
|
|
116
|
-
prepare: (
|
|
117
|
-
|
|
175
|
+
prepare: (o) => {
|
|
176
|
+
x(o), o.style.opacity = "0";
|
|
118
177
|
}
|
|
119
178
|
})
|
|
120
179
|
};
|
|
121
180
|
};
|
|
122
181
|
function S(t, n) {
|
|
123
|
-
const
|
|
182
|
+
const s = t.getBoundingClientRect(), e = n.getBoundingClientRect();
|
|
124
183
|
return new DOMRect(
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
184
|
+
e.left - s.left,
|
|
185
|
+
e.top - s.top,
|
|
186
|
+
e.width,
|
|
187
|
+
e.height
|
|
129
188
|
);
|
|
130
189
|
}
|
|
131
190
|
function C({
|
|
132
191
|
detailRect: t,
|
|
133
192
|
galleryRect: n,
|
|
134
|
-
pageRect:
|
|
135
|
-
scrollOffset:
|
|
136
|
-
},
|
|
137
|
-
const
|
|
138
|
-
return
|
|
139
|
-
const
|
|
140
|
-
|
|
193
|
+
pageRect: s,
|
|
194
|
+
scrollOffset: e
|
|
195
|
+
}, l) {
|
|
196
|
+
const r = n.left - t.left + (n.width - t.width) / 2 - e.x, a = n.top - t.top + (n.height - t.height) / 2 - e.y, i = n.width / t.width, o = n.height / t.height, c = Math.max(i, o), y = t.top / s.height * 100, d = (s.width - (t.left + t.width)) / s.width * 100, p = (s.height - (t.top + t.height)) / s.height * 100, h = t.left / s.width * 100;
|
|
197
|
+
return l.style.transformOrigin = `${t.left + t.width / 2}px ${t.top + t.height / 2}px`, ($) => {
|
|
198
|
+
const u = 1 - $, g = y * u, f = d * u, w = p * u, k = h * u;
|
|
199
|
+
l.style.clipPath = `inset(${g}% ${f}% ${w}% ${k}%)`, l.style.transform = `translate(${r * u}px, ${a * u}px) scale(${1 + (c - 1) * u})`;
|
|
141
200
|
};
|
|
142
201
|
}
|
|
143
|
-
function
|
|
202
|
+
function M({
|
|
144
203
|
galleryRect: t,
|
|
145
204
|
detailRect: n,
|
|
146
|
-
scrollOffset:
|
|
147
|
-
},
|
|
148
|
-
const
|
|
149
|
-
return (
|
|
150
|
-
|
|
151
|
-
const
|
|
152
|
-
|
|
205
|
+
scrollOffset: s
|
|
206
|
+
}, e) {
|
|
207
|
+
const l = n.left - t.left + (n.width - t.width) / 2 + s.x, r = n.top - t.top + (n.height - t.height) / 2 + s.y, a = n.width / t.width, i = n.height / t.height, o = Math.max(a, i);
|
|
208
|
+
return (c) => {
|
|
209
|
+
e.style.transformOrigin = `${t.left + t.width / 2}px ${t.top + t.height / 2}px`;
|
|
210
|
+
const y = 1 - c;
|
|
211
|
+
e.style.transform = `translate(${l * y - s.x}px, ${r * y - s.y}px) scale(${1 + (o - 1) * y})`, e.style.opacity = `${1 - y}`;
|
|
153
212
|
};
|
|
154
213
|
}
|
|
155
|
-
function
|
|
214
|
+
function O({
|
|
156
215
|
galleryRect: t,
|
|
157
216
|
detailRect: n,
|
|
158
|
-
scrollOffset:
|
|
159
|
-
},
|
|
160
|
-
const
|
|
161
|
-
return (
|
|
162
|
-
const
|
|
163
|
-
|
|
217
|
+
scrollOffset: s
|
|
218
|
+
}, e) {
|
|
219
|
+
const l = n.left - t.left + (n.width - t.width) / 2 - s.x, r = n.top - t.top + (n.height - t.height) / 2 - s.y, a = n.width / t.width, i = n.height / t.height, o = Math.max(a, i);
|
|
220
|
+
return (c) => {
|
|
221
|
+
const y = 1 - c, d = c;
|
|
222
|
+
e.style.transformOrigin = `${t.left + t.width / 2}px ${t.top + t.height / 2}px`, e.style.transform = `translate(${l * y}px, ${r * y}px) scale(${1 + (o - 1) * y})`, e.style.opacity = `${d}`;
|
|
164
223
|
};
|
|
165
224
|
}
|
|
166
|
-
function
|
|
225
|
+
function _({
|
|
167
226
|
detailRect: t,
|
|
168
227
|
galleryRect: n,
|
|
169
|
-
pageRect:
|
|
170
|
-
scrollOffset:
|
|
171
|
-
},
|
|
172
|
-
const
|
|
173
|
-
return
|
|
174
|
-
const
|
|
175
|
-
|
|
228
|
+
pageRect: s,
|
|
229
|
+
scrollOffset: e
|
|
230
|
+
}, l) {
|
|
231
|
+
const r = n.left - t.left + (n.width - t.width) / 2 + e.x, a = n.top - t.top + (n.height - t.height) / 2 + e.y, i = n.width / t.width, o = n.height / t.height, c = Math.min(i, o), y = t.top / s.height * 100, d = (s.width - (t.left + t.width)) / s.width * 100, p = (s.height - (t.top + t.height)) / s.height * 100, h = t.left / s.width * 100;
|
|
232
|
+
return l.style.transformOrigin = `${t.left + t.width / 2}px ${t.top + t.height / 2}px`, ($) => {
|
|
233
|
+
const u = 1 - $, g = y * u, f = d * u, w = p * u, k = h * u;
|
|
234
|
+
l.style.clipPath = `inset(${g}% ${f}% ${w}% ${k}%)`, l.style.transform = `translate(${r * u - e.x}px, ${a * u - e.y}px) scale(${1 + (c - 1) * u})`;
|
|
176
235
|
};
|
|
177
236
|
}
|
|
178
|
-
function
|
|
179
|
-
const
|
|
237
|
+
function U(t, n, s) {
|
|
238
|
+
const e = t.querySelector(
|
|
180
239
|
"[data-pinterest-detail-key]"
|
|
181
|
-
),
|
|
240
|
+
), l = n.querySelector(
|
|
182
241
|
"[data-pinterest-detail-key]"
|
|
183
242
|
);
|
|
184
243
|
if (t.querySelectorAll("[data-pinterest-detail-key]").length > 1 || n.querySelectorAll("[data-pinterest-detail-key]").length > 1)
|
|
185
244
|
return null;
|
|
186
|
-
let
|
|
187
|
-
if (!
|
|
188
|
-
|
|
189
|
-
const
|
|
190
|
-
if (!
|
|
191
|
-
|
|
192
|
-
`[data-pinterest-gallery-key="${
|
|
193
|
-
),
|
|
194
|
-
} else if (
|
|
195
|
-
|
|
196
|
-
const
|
|
197
|
-
if (!
|
|
198
|
-
|
|
199
|
-
`[data-pinterest-gallery-key="${
|
|
200
|
-
),
|
|
245
|
+
let r = null, a = null, i = !1;
|
|
246
|
+
if (!e && l) {
|
|
247
|
+
a = l;
|
|
248
|
+
const d = a.getAttribute("data-pinterest-detail-key");
|
|
249
|
+
if (!d) return null;
|
|
250
|
+
r = t.querySelector(
|
|
251
|
+
`[data-pinterest-gallery-key="${d}"]`
|
|
252
|
+
), r && (i = !0);
|
|
253
|
+
} else if (e && !l) {
|
|
254
|
+
a = e;
|
|
255
|
+
const d = a.getAttribute("data-pinterest-detail-key");
|
|
256
|
+
if (!d) return null;
|
|
257
|
+
r = n.querySelector(
|
|
258
|
+
`[data-pinterest-gallery-key="${d}"]`
|
|
259
|
+
), r && (i = !1);
|
|
201
260
|
}
|
|
202
|
-
if (!
|
|
261
|
+
if (!r || !a)
|
|
203
262
|
return null;
|
|
204
|
-
const
|
|
205
|
-
return
|
|
263
|
+
const o = S(i ? t : n, r), c = S(i ? n : t, a), y = n.getBoundingClientRect();
|
|
264
|
+
return i ? {
|
|
206
265
|
inAnimation: C(
|
|
207
|
-
{ detailRect:
|
|
266
|
+
{ detailRect: c, galleryRect: o, pageRect: y, scrollOffset: s },
|
|
208
267
|
n
|
|
209
268
|
),
|
|
210
|
-
outAnimation:
|
|
211
|
-
{ galleryRect:
|
|
269
|
+
outAnimation: M(
|
|
270
|
+
{ galleryRect: o, detailRect: c, scrollOffset: s },
|
|
212
271
|
t
|
|
213
272
|
)
|
|
214
273
|
} : {
|
|
215
|
-
inAnimation:
|
|
216
|
-
{ galleryRect:
|
|
274
|
+
inAnimation: O(
|
|
275
|
+
{ galleryRect: o, detailRect: c, scrollOffset: s },
|
|
217
276
|
n
|
|
218
277
|
),
|
|
219
|
-
outAnimation:
|
|
220
|
-
{ detailRect:
|
|
278
|
+
outAnimation: _(
|
|
279
|
+
{ detailRect: c, galleryRect: o, pageRect: y, scrollOffset: s },
|
|
221
280
|
t
|
|
222
281
|
)
|
|
223
282
|
};
|
|
224
283
|
}
|
|
225
|
-
const
|
|
226
|
-
var
|
|
284
|
+
const N = (t = {}) => {
|
|
285
|
+
var a, i;
|
|
227
286
|
const n = {
|
|
228
|
-
stiffness: ((
|
|
229
|
-
damping: ((
|
|
230
|
-
},
|
|
231
|
-
let
|
|
287
|
+
stiffness: ((a = t.spring) == null ? void 0 : a.stiffness) ?? 50,
|
|
288
|
+
damping: ((i = t.spring) == null ? void 0 : i.damping) ?? 10
|
|
289
|
+
}, s = t.timeout ?? 300;
|
|
290
|
+
let e = null, l = null, r = null;
|
|
232
291
|
return {
|
|
233
|
-
in: async (
|
|
234
|
-
const
|
|
235
|
-
return !await new Promise((
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
},
|
|
239
|
-
}) || !
|
|
292
|
+
in: async (o, { scrollOffset: c }) => {
|
|
293
|
+
const y = o;
|
|
294
|
+
return !await new Promise((p) => {
|
|
295
|
+
e ? p(!0) : (l = p, setTimeout(() => {
|
|
296
|
+
l = null, p(!1);
|
|
297
|
+
}, s));
|
|
298
|
+
}) || !e ? (e = null, {
|
|
240
299
|
spring: n,
|
|
241
300
|
tick: () => {
|
|
242
301
|
}
|
|
243
|
-
}) : (
|
|
302
|
+
}) : (r = U(e, y, c), r ? (e = null, {
|
|
244
303
|
spring: n,
|
|
245
|
-
tick: (
|
|
246
|
-
|
|
304
|
+
tick: (p) => {
|
|
305
|
+
r && r.inAnimation(p);
|
|
247
306
|
}
|
|
248
307
|
}) : {
|
|
249
308
|
spring: n,
|
|
@@ -251,46 +310,52 @@ const I = (t = {}) => {
|
|
|
251
310
|
}
|
|
252
311
|
});
|
|
253
312
|
},
|
|
254
|
-
out: async (
|
|
313
|
+
out: async (o) => ({
|
|
255
314
|
spring: n,
|
|
256
315
|
onStart: () => {
|
|
257
|
-
|
|
316
|
+
e = o, l && (l(!0), l = null);
|
|
258
317
|
},
|
|
259
|
-
prepare: (
|
|
260
|
-
|
|
318
|
+
prepare: (c) => {
|
|
319
|
+
x(c), c.style.zIndex = "-1";
|
|
261
320
|
},
|
|
262
|
-
tick: (
|
|
263
|
-
|
|
321
|
+
tick: (c) => {
|
|
322
|
+
r && r.outAnimation(c);
|
|
264
323
|
}
|
|
265
324
|
})
|
|
266
325
|
};
|
|
267
|
-
},
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
326
|
+
}, I = {
|
|
327
|
+
stiffness: 30,
|
|
328
|
+
damping: 7
|
|
329
|
+
}, Z = (t = {}) => {
|
|
330
|
+
var l, r;
|
|
331
|
+
const n = t.direction ?? "up", s = {
|
|
332
|
+
stiffness: ((l = t.spring) == null ? void 0 : l.stiffness) ?? I.stiffness,
|
|
333
|
+
damping: ((r = t.spring) == null ? void 0 : r.damping) ?? I.damping
|
|
334
|
+
}, e = n === "up";
|
|
273
335
|
return {
|
|
274
|
-
in: (
|
|
275
|
-
spring:
|
|
276
|
-
tick: (
|
|
277
|
-
const
|
|
278
|
-
|
|
336
|
+
in: (a) => ({
|
|
337
|
+
spring: s,
|
|
338
|
+
tick: (i) => {
|
|
339
|
+
const o = e ? (1 - i) * 100 : (1 - i) * -100;
|
|
340
|
+
a.style.transform = `translateY(${o}vh)`;
|
|
279
341
|
}
|
|
280
342
|
}),
|
|
281
|
-
out: (
|
|
282
|
-
spring:
|
|
283
|
-
tick: (
|
|
284
|
-
const
|
|
285
|
-
|
|
343
|
+
out: (a) => ({
|
|
344
|
+
spring: s,
|
|
345
|
+
tick: (i) => {
|
|
346
|
+
const o = e ? (1 - i) * -100 : (1 - i) * 100;
|
|
347
|
+
a.style.transform = `translateY(${o}vh)`;
|
|
286
348
|
},
|
|
287
|
-
prepare:
|
|
349
|
+
prepare: (i) => {
|
|
350
|
+
x(i), i.style.zIndex = e ? "-1" : "1";
|
|
351
|
+
}
|
|
288
352
|
})
|
|
289
353
|
};
|
|
290
354
|
};
|
|
291
355
|
export {
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
356
|
+
b as drill,
|
|
357
|
+
v as fade,
|
|
358
|
+
H as hero,
|
|
359
|
+
N as pinterest,
|
|
360
|
+
Z as scroll
|
|
296
361
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scroll.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/scroll.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAG9D,UAAU,aAAa;IACrB,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;CAChC;
|
|
1
|
+
{"version":3,"file":"scroll.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/scroll.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAG9D,UAAU,aAAa;IACrB,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;CAChC;AAOD,eAAO,MAAM,MAAM,GAAI,UAAS,aAAkB,KAAG,eAkCpD,CAAC"}
|
package/package.json
CHANGED
package/dist/utils-BSgyev81.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const n=e=>{e.style.position="absolute",e.style.width="100%",e.style.top="0",e.style.left="0"},r=e=>{let t=e.parentElement;for(;t&&t!==document.body;){const l=window.getComputedStyle(t),o=l.overflow+l.overflowY+l.overflowX;if(o.includes("auto")||o.includes("scroll")||t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth)return t;t=t.parentElement}return document.documentElement};exports.getScrollingElement=r;exports.prepareOutgoing=n;
|
package/dist/utils-DR41YsAh.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
const n = (e) => {
|
|
2
|
-
e.style.position = "absolute", e.style.width = "100%", e.style.top = "0", e.style.left = "0";
|
|
3
|
-
}, r = (e) => {
|
|
4
|
-
let t = e.parentElement;
|
|
5
|
-
for (; t && t !== document.body; ) {
|
|
6
|
-
const o = window.getComputedStyle(t), l = o.overflow + o.overflowY + o.overflowX;
|
|
7
|
-
if (l.includes("auto") || l.includes("scroll") || t.scrollHeight > t.clientHeight || t.scrollWidth > t.clientWidth)
|
|
8
|
-
return t;
|
|
9
|
-
t = t.parentElement;
|
|
10
|
-
}
|
|
11
|
-
return document.documentElement;
|
|
12
|
-
};
|
|
13
|
-
export {
|
|
14
|
-
r as g,
|
|
15
|
-
n as p
|
|
16
|
-
};
|