@ssgoi/react 0.0.5 → 0.0.7
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/index.cjs +1 -1
- package/dist/index.js +435 -431
- package/dist/transitions/index.cjs +1 -1
- package/dist/transitions/index.js +98 -98
- package/dist/{utils-BSgyev81.cjs → utils-DR41YsAh-CN_CfgYX.cjs} +1 -1
- package/dist/{utils-DR41YsAh.js → utils-DR41YsAh-mLT5vDuI.js} +4 -4
- package/dist/view-transitions/index.cjs +1 -1
- package/dist/view-transitions/index.js +177 -173
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=(o={})=>{const{from:i=0,to:a=1,spring:e={stiffness:300,damping:30}}=o;return{in:r=>({spring:e,tick:n=>{const t=i+(a-i)*n;r.style.opacity=t.toString()}}),out:r=>({spring:e,tick:n=>{const t=i+(a-i)*n;r.style.opacity=t.toString()}})}},g=(o={})=>{const{from:i=0,to:a=1,spring:e={stiffness:300,damping:30}}=o;return{in:r=>({spring:e,tick:n=>{const t=i+(a-i)*n;r.style.transform=`scale(${t})`}}),out:r=>({spring:e,tick:n=>{const t=i+(a-i)*n;r.style.transform=`scale(${t})`}})}},f=(o={})=>{const{direction:i="left",distance:a=100,fade:e=!0,spring:r={stiffness:400,damping:35}}=o,n=t=>{const s=(1-t)*a;switch(i){case"left":return`translateX(${-s}px)`;case"right":return`translateX(${s}px)`;case"up":return`translateY(${-s}px)`;case"down":return`translateY(${s}px)`}};return{in:t=>({spring:r,tick:s=>{t.style.transform=n(s),e&&(t.style.opacity=s.toString())}}),out:t=>({spring:r,tick:s=>{t.style.transform=n(s),e&&(t.style.opacity=s.toString())}})}},u=(o={})=>{const{degrees:i=360,clockwise:a=!0,scale:e=!1,fade:r=!1,spring:n={stiffness:500,damping:25}}=o,t=a?i:-i;return{in:s=>({spring:n,tick:c=>{const l=[`rotate(${c*t}deg)`];e&&l.push(`scale(${c})`),s.style.transform=l.join(" "),r&&(s.style.opacity=c.toString())}}),out:s=>({spring:n,tick:c=>{const l=[`rotate(${c*t}deg)`];e&&l.push(`scale(${c})`),s.style.transform=l.join(" "),r&&(s.style.opacity=c.toString())}})}},y=(o={})=>{const{height:i=20,scale:a=!0,fade:e=!1,spring:r={stiffness:800,damping:15}}=o;return{in:n=>({spring:r,tick:t=>{const s=[],c=Math.sin(t*Math.PI)*i*(1-t);s.push(`translateY(${-c}px)`),a&&s.push(`scale(${.8+t*.2})`),n.style.transform=s.join(" "),e&&(n.style.opacity=t.toString())}}),out:n=>({spring:r,tick:t=>{const s=[],c=Math.sin(t*Math.PI)*i*(1-t);s.push(`translateY(${-c}px)`),a&&s.push(`scale(${.8+t*.2})`),n.style.transform=s.join(" "),e&&(n.style.opacity=t.toString())}})}},d=(o={})=>{const{amount:i=10,scale:a=!1,fade:e=!0,spring:r={stiffness:300,damping:30}}=o;return{in:n=>({spring:r,tick:t=>{const s=[`blur(${(1-t)*i}px)`];n.style.filter=s.join(" "),a&&(n.style.transform=`scale(${.8+t*.2})`),e&&(n.style.opacity=t.toString())}}),out:n=>({spring:r,tick:t=>{const s=[`blur(${(1-t)*i}px)`];n.style.filter=s.join(" "),a&&(n.style.transform=`scale(${.8+t*.2})`),e&&(n.style.opacity=t.toString())}})}},m=(o={})=>{const{spring:i={stiffness:1e3,damping:100}}=o;return{in:a=>({spring:i,tick:e=>{}}),out:a=>({spring:i,tick:e=>{}})}};exports.blur=d;exports.bounce=y;exports.fade=p;exports.none=m;exports.rotate=u;exports.scale=g;exports.slide=f;
|
|
@@ -1,173 +1,173 @@
|
|
|
1
|
-
const l = (
|
|
1
|
+
const l = (o = {}) => {
|
|
2
2
|
const {
|
|
3
3
|
from: i = 0,
|
|
4
|
-
to:
|
|
5
|
-
spring:
|
|
6
|
-
} =
|
|
4
|
+
to: a = 1,
|
|
5
|
+
spring: r = { stiffness: 300, damping: 30 }
|
|
6
|
+
} = o;
|
|
7
7
|
return {
|
|
8
|
-
in: (
|
|
9
|
-
spring:
|
|
10
|
-
tick: (
|
|
11
|
-
const t = i + (
|
|
12
|
-
|
|
8
|
+
in: (e) => ({
|
|
9
|
+
spring: r,
|
|
10
|
+
tick: (n) => {
|
|
11
|
+
const t = i + (a - i) * n;
|
|
12
|
+
e.style.opacity = t.toString();
|
|
13
13
|
}
|
|
14
14
|
}),
|
|
15
|
-
out: (
|
|
16
|
-
spring:
|
|
17
|
-
tick: (
|
|
18
|
-
const t = i + (
|
|
19
|
-
|
|
15
|
+
out: (e) => ({
|
|
16
|
+
spring: r,
|
|
17
|
+
tick: (n) => {
|
|
18
|
+
const t = i + (a - i) * n;
|
|
19
|
+
e.style.opacity = t.toString();
|
|
20
20
|
}
|
|
21
21
|
})
|
|
22
22
|
};
|
|
23
|
-
},
|
|
23
|
+
}, g = (o = {}) => {
|
|
24
24
|
const {
|
|
25
25
|
from: i = 0,
|
|
26
|
-
to:
|
|
27
|
-
spring:
|
|
28
|
-
} =
|
|
26
|
+
to: a = 1,
|
|
27
|
+
spring: r = { stiffness: 300, damping: 30 }
|
|
28
|
+
} = o;
|
|
29
29
|
return {
|
|
30
|
-
in: (
|
|
31
|
-
spring:
|
|
32
|
-
tick: (
|
|
33
|
-
const t = i + (
|
|
34
|
-
|
|
30
|
+
in: (e) => ({
|
|
31
|
+
spring: r,
|
|
32
|
+
tick: (n) => {
|
|
33
|
+
const t = i + (a - i) * n;
|
|
34
|
+
e.style.transform = `scale(${t})`;
|
|
35
35
|
}
|
|
36
36
|
}),
|
|
37
|
-
out: (
|
|
38
|
-
spring:
|
|
39
|
-
tick: (
|
|
40
|
-
const t = i + (
|
|
41
|
-
|
|
37
|
+
out: (e) => ({
|
|
38
|
+
spring: r,
|
|
39
|
+
tick: (n) => {
|
|
40
|
+
const t = i + (a - i) * n;
|
|
41
|
+
e.style.transform = `scale(${t})`;
|
|
42
42
|
}
|
|
43
43
|
})
|
|
44
44
|
};
|
|
45
|
-
},
|
|
45
|
+
}, f = (o = {}) => {
|
|
46
46
|
const {
|
|
47
47
|
direction: i = "left",
|
|
48
|
-
distance:
|
|
49
|
-
fade:
|
|
50
|
-
spring:
|
|
51
|
-
} =
|
|
52
|
-
const
|
|
48
|
+
distance: a = 100,
|
|
49
|
+
fade: r = !0,
|
|
50
|
+
spring: e = { stiffness: 400, damping: 35 }
|
|
51
|
+
} = o, n = (t) => {
|
|
52
|
+
const s = (1 - t) * a;
|
|
53
53
|
switch (i) {
|
|
54
54
|
case "left":
|
|
55
|
-
return `translateX(${-
|
|
55
|
+
return `translateX(${-s}px)`;
|
|
56
56
|
case "right":
|
|
57
|
-
return `translateX(${
|
|
57
|
+
return `translateX(${s}px)`;
|
|
58
58
|
case "up":
|
|
59
|
-
return `translateY(${-
|
|
59
|
+
return `translateY(${-s}px)`;
|
|
60
60
|
case "down":
|
|
61
|
-
return `translateY(${
|
|
61
|
+
return `translateY(${s}px)`;
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
64
|
return {
|
|
65
65
|
in: (t) => ({
|
|
66
|
-
spring:
|
|
67
|
-
tick: (
|
|
68
|
-
t.style.transform = s
|
|
66
|
+
spring: e,
|
|
67
|
+
tick: (s) => {
|
|
68
|
+
t.style.transform = n(s), r && (t.style.opacity = s.toString());
|
|
69
69
|
}
|
|
70
70
|
}),
|
|
71
71
|
out: (t) => ({
|
|
72
|
-
spring:
|
|
73
|
-
tick: (
|
|
74
|
-
t.style.transform = s
|
|
72
|
+
spring: e,
|
|
73
|
+
tick: (s) => {
|
|
74
|
+
t.style.transform = n(s), r && (t.style.opacity = s.toString());
|
|
75
75
|
}
|
|
76
76
|
})
|
|
77
77
|
};
|
|
78
|
-
},
|
|
78
|
+
}, u = (o = {}) => {
|
|
79
79
|
const {
|
|
80
80
|
degrees: i = 360,
|
|
81
|
-
clockwise:
|
|
82
|
-
scale:
|
|
83
|
-
fade:
|
|
84
|
-
spring:
|
|
85
|
-
} =
|
|
81
|
+
clockwise: a = !0,
|
|
82
|
+
scale: r = !1,
|
|
83
|
+
fade: e = !1,
|
|
84
|
+
spring: n = { stiffness: 500, damping: 25 }
|
|
85
|
+
} = o, t = a ? i : -i;
|
|
86
86
|
return {
|
|
87
|
-
in: (
|
|
88
|
-
spring:
|
|
89
|
-
tick: (
|
|
90
|
-
const
|
|
91
|
-
|
|
87
|
+
in: (s) => ({
|
|
88
|
+
spring: n,
|
|
89
|
+
tick: (c) => {
|
|
90
|
+
const p = [`rotate(${c * t}deg)`];
|
|
91
|
+
r && p.push(`scale(${c})`), s.style.transform = p.join(" "), e && (s.style.opacity = c.toString());
|
|
92
92
|
}
|
|
93
93
|
}),
|
|
94
|
-
out: (
|
|
95
|
-
spring:
|
|
96
|
-
tick: (
|
|
97
|
-
const
|
|
98
|
-
|
|
94
|
+
out: (s) => ({
|
|
95
|
+
spring: n,
|
|
96
|
+
tick: (c) => {
|
|
97
|
+
const p = [`rotate(${c * t}deg)`];
|
|
98
|
+
r && p.push(`scale(${c})`), s.style.transform = p.join(" "), e && (s.style.opacity = c.toString());
|
|
99
99
|
}
|
|
100
100
|
})
|
|
101
101
|
};
|
|
102
|
-
},
|
|
102
|
+
}, y = (o = {}) => {
|
|
103
103
|
const {
|
|
104
104
|
height: i = 20,
|
|
105
|
-
scale:
|
|
106
|
-
fade:
|
|
107
|
-
spring:
|
|
108
|
-
} =
|
|
105
|
+
scale: a = !0,
|
|
106
|
+
fade: r = !1,
|
|
107
|
+
spring: e = { stiffness: 800, damping: 15 }
|
|
108
|
+
} = o;
|
|
109
109
|
return {
|
|
110
|
-
in: (
|
|
111
|
-
spring:
|
|
110
|
+
in: (n) => ({
|
|
111
|
+
spring: e,
|
|
112
112
|
tick: (t) => {
|
|
113
|
-
const
|
|
114
|
-
|
|
113
|
+
const s = [], c = Math.sin(t * Math.PI) * i * (1 - t);
|
|
114
|
+
s.push(`translateY(${-c}px)`), a && s.push(`scale(${0.8 + t * 0.2})`), n.style.transform = s.join(" "), r && (n.style.opacity = t.toString());
|
|
115
115
|
}
|
|
116
116
|
}),
|
|
117
|
-
out: (
|
|
118
|
-
spring:
|
|
117
|
+
out: (n) => ({
|
|
118
|
+
spring: e,
|
|
119
119
|
tick: (t) => {
|
|
120
|
-
const
|
|
121
|
-
|
|
120
|
+
const s = [], c = Math.sin(t * Math.PI) * i * (1 - t);
|
|
121
|
+
s.push(`translateY(${-c}px)`), a && s.push(`scale(${0.8 + t * 0.2})`), n.style.transform = s.join(" "), r && (n.style.opacity = t.toString());
|
|
122
122
|
}
|
|
123
123
|
})
|
|
124
124
|
};
|
|
125
|
-
},
|
|
125
|
+
}, m = (o = {}) => {
|
|
126
126
|
const {
|
|
127
127
|
amount: i = 10,
|
|
128
|
-
scale:
|
|
129
|
-
fade:
|
|
130
|
-
spring:
|
|
131
|
-
} =
|
|
128
|
+
scale: a = !1,
|
|
129
|
+
fade: r = !0,
|
|
130
|
+
spring: e = { stiffness: 300, damping: 30 }
|
|
131
|
+
} = o;
|
|
132
132
|
return {
|
|
133
|
-
in: (
|
|
134
|
-
spring:
|
|
133
|
+
in: (n) => ({
|
|
134
|
+
spring: e,
|
|
135
135
|
tick: (t) => {
|
|
136
|
-
const
|
|
137
|
-
|
|
136
|
+
const s = [`blur(${(1 - t) * i}px)`];
|
|
137
|
+
n.style.filter = s.join(" "), a && (n.style.transform = `scale(${0.8 + t * 0.2})`), r && (n.style.opacity = t.toString());
|
|
138
138
|
}
|
|
139
139
|
}),
|
|
140
|
-
out: (
|
|
141
|
-
spring:
|
|
140
|
+
out: (n) => ({
|
|
141
|
+
spring: e,
|
|
142
142
|
tick: (t) => {
|
|
143
|
-
const
|
|
144
|
-
|
|
143
|
+
const s = [`blur(${(1 - t) * i}px)`];
|
|
144
|
+
n.style.filter = s.join(" "), a && (n.style.transform = `scale(${0.8 + t * 0.2})`), r && (n.style.opacity = t.toString());
|
|
145
145
|
}
|
|
146
146
|
})
|
|
147
147
|
};
|
|
148
|
-
},
|
|
148
|
+
}, d = (o = {}) => {
|
|
149
149
|
const {
|
|
150
150
|
spring: i = { stiffness: 1e3, damping: 100 }
|
|
151
|
-
} =
|
|
151
|
+
} = o;
|
|
152
152
|
return {
|
|
153
|
-
in: (
|
|
153
|
+
in: (a) => ({
|
|
154
154
|
spring: i,
|
|
155
|
-
tick: (
|
|
155
|
+
tick: (r) => {
|
|
156
156
|
}
|
|
157
157
|
}),
|
|
158
|
-
out: (
|
|
158
|
+
out: (a) => ({
|
|
159
159
|
spring: i,
|
|
160
|
-
tick: (
|
|
160
|
+
tick: (r) => {
|
|
161
161
|
}
|
|
162
162
|
})
|
|
163
163
|
};
|
|
164
164
|
};
|
|
165
165
|
export {
|
|
166
|
-
|
|
167
|
-
|
|
166
|
+
m as blur,
|
|
167
|
+
y as bounce,
|
|
168
168
|
l as fade,
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
169
|
+
d as none,
|
|
170
|
+
u as rotate,
|
|
171
|
+
g as scale,
|
|
172
|
+
f as slide
|
|
173
173
|
};
|
|
@@ -1 +1 @@
|
|
|
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.
|
|
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.n=n;exports.r=r;
|
|
@@ -3,14 +3,14 @@ const n = (e) => {
|
|
|
3
3
|
}, r = (e) => {
|
|
4
4
|
let t = e.parentElement;
|
|
5
5
|
for (; t && t !== document.body; ) {
|
|
6
|
-
const
|
|
7
|
-
if (
|
|
6
|
+
const l = window.getComputedStyle(t), o = l.overflow + l.overflowY + l.overflowX;
|
|
7
|
+
if (o.includes("auto") || o.includes("scroll") || t.scrollHeight > t.clientHeight || t.scrollWidth > t.clientWidth)
|
|
8
8
|
return t;
|
|
9
9
|
t = t.parentElement;
|
|
10
10
|
}
|
|
11
11
|
return document.documentElement;
|
|
12
12
|
};
|
|
13
13
|
export {
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
n,
|
|
15
|
+
r
|
|
16
16
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("../utils-DR41YsAh-CN_CfgYX.cjs"),P=(t={})=>{var e,n;const i={stiffness:((e=t.spring)==null?void 0:e.stiffness)??300,damping:((n=t.spring)==null?void 0:n.damping)??30};return{in:r=>({spring:i,tick:l=>{r.style.opacity=l.toString()}}),out:r=>({spring:i,tick:l=>{r.style.opacity=l.toString()},prepare:x.n})}};function E(t,e){return t.querySelector(`[data-hero-key="${e}"]`)}function R(t,e){const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return new DOMRect(i.left-n.left,i.top-n.top,i.width,i.height)}const B=(t={})=>{var e,n;const i={stiffness:((e=t.spring)==null?void 0:e.stiffness)??300,damping:((n=t.spring)==null?void 0:n.damping)??30},r=t.timeout??300;let l=null,s=null;return{in:async(a,g)=>{const h=a,p=Array.from(h.querySelectorAll("[data-hero-key]"));if(p.length===0)return{spring:i,tick:()=>{}};if(!await new Promise(c=>{l?c(!0):(s=c,setTimeout(()=>{s=null,c(!1)},r))})||!l)return l=null,{spring:i,tick:()=>{}};const f=p.map(c=>{const u=c.getAttribute("data-hero-key");if(!u)return null;const d=E(l,u);if(!d)return null;const o=c,y=R(l,d),m=R(h,o),w=y.left-m.left-g.scrollOffset.x,$=y.top-m.top-g.scrollOffset.y,A=y.width/m.width,S=y.height/m.height,v=o.style.transform,q=o.style.position,M=o.style.transformOrigin;return{toEl:o,dx:w,dy:$,dw:A,dh:S,originalTransform:v,originalPosition:q,originalTransformOrigin:M}}).filter(Boolean);return l=null,f.length===0?{spring:i,tick:()=>{}}:{spring:i,prepare:()=>{f.forEach(({toEl:c})=>{c.style.position="relative",c.style.transformOrigin="top left"})},tick:c=>{f.forEach(({toEl:u,dx:d,dy:o,dw:y,dh:m})=>{u.style.transform=`translate(${(1-c)*d}px,${(1-c)*o}px) scale(${c+(1-c)*y}, ${c+(1-c)*m})`})},onEnd:()=>{f.forEach(({toEl:c,originalTransform:u,originalPosition:d,originalTransformOrigin:o})=>{c.style.transform=u,c.style.position=d,c.style.transformOrigin=o})}}},out:async a=>({onStart:()=>{l=a,s&&(s(!0),s=null)},prepare:g=>{x.n(g),g.style.opacity="0"}})}};function O(t,e){const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return new DOMRect(i.left-n.left,i.top-n.top,i.width,i.height)}function T({detailRect:t,galleryRect:e,pageRect:n,scrollOffset:i},r){const l=e.left-t.left+(e.width-t.width)/2-i.x,s=e.top-t.top+(e.height-t.height)/2-i.y,a=e.width/t.width,g=e.height/t.height,h=Math.max(a,g),p=t.top/n.height*100,f=(n.width-(t.left+t.width))/n.width*100,c=(n.height-(t.top+t.height))/n.height*100,u=t.left/n.width*100;return r.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`,d=>{const o=1-d,y=p*o,m=f*o,w=c*o,$=u*o;r.style.clipPath=`inset(${y}% ${m}% ${w}% ${$}%)`,r.style.transform=`translate(${l*o}px, ${s*o}px) scale(${1+(h-1)*o})`}}function C({galleryRect:t,detailRect:e,scrollOffset:n},i){const r=e.left-t.left+(e.width-t.width)/2+n.x,l=e.top-t.top+(e.height-t.height)/2+n.y,s=e.width/t.width,a=e.height/t.height,g=Math.max(s,a);return h=>{i.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`;const p=1-h;i.style.transform=`translate(${r*p-n.x}px, ${l*p-n.y}px) scale(${1+(g-1)*p})`,i.style.opacity=`${1-p}`}}function b({galleryRect:t,detailRect:e,scrollOffset:n},i){const r=e.left-t.left+(e.width-t.width)/2-n.x,l=e.top-t.top+(e.height-t.height)/2-n.y,s=e.width/t.width,a=e.height/t.height,g=Math.max(s,a);return h=>{const p=1-h,f=h;i.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`,i.style.transform=`translate(${r*p}px, ${l*p}px) scale(${1+(g-1)*p})`,i.style.opacity=`${f}`}}function D({detailRect:t,galleryRect:e,pageRect:n,scrollOffset:i},r){const l=e.left-t.left+(e.width-t.width)/2+i.x,s=e.top-t.top+(e.height-t.height)/2+i.y,a=e.width/t.width,g=e.height/t.height,h=Math.min(a,g),p=t.top/n.height*100,f=(n.width-(t.left+t.width))/n.width*100,c=(n.height-(t.top+t.height))/n.height*100,u=t.left/n.width*100;return r.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`,d=>{const o=1-d,y=p*o,m=f*o,w=c*o,$=u*o;r.style.clipPath=`inset(${y}% ${m}% ${w}% ${$}%)`,r.style.transform=`translate(${l*o-i.x}px, ${s*o-i.y}px) scale(${1+(h-1)*o})`}}function z(t,e,n){const i=t.querySelector("[data-pinterest-detail-key]"),r=e.querySelector("[data-pinterest-detail-key]");if(t.querySelectorAll("[data-pinterest-detail-key]").length>1||e.querySelectorAll("[data-pinterest-detail-key]").length>1)return null;let l=null,s=null,a=!1;if(!i&&r){s=r;const f=s.getAttribute("data-pinterest-detail-key");if(!f)return null;l=t.querySelector(`[data-pinterest-gallery-key="${f}"]`),l&&(a=!0)}else if(i&&!r){s=i;const f=s.getAttribute("data-pinterest-detail-key");if(!f)return null;l=e.querySelector(`[data-pinterest-gallery-key="${f}"]`),l&&(a=!1)}if(!l||!s)return null;const g=O(a?t:e,l),h=O(a?e:t,s),p=e.getBoundingClientRect();return a?{inAnimation:T({detailRect:h,galleryRect:g,pageRect:p,scrollOffset:n},e),outAnimation:C({galleryRect:g,detailRect:h,scrollOffset:n},t)}:{inAnimation:b({galleryRect:g,detailRect:h,scrollOffset:n},e),outAnimation:D({detailRect:h,galleryRect:g,pageRect:p,scrollOffset:n},t)}}const H=(t={})=>{var e,n;const i={stiffness:((e=t.spring)==null?void 0:e.stiffness)??50,damping:((n=t.spring)==null?void 0:n.damping)??10},r=t.timeout??300;let l=null,s=null,a=null;return{in:async(g,{scrollOffset:h})=>{const p=g;return!await new Promise(f=>{l?f(!0):(s=f,setTimeout(()=>{s=null,f(!1)},r))})||!l?(l=null,{spring:i,tick:()=>{}}):(a=z(l,p,h),a?(l=null,{spring:i,tick:f=>{a&&a.inAnimation(f)}}):{spring:i,tick:()=>{}})},out:async g=>({spring:i,onStart:()=>{l=g,s&&(s(!0),s=null)},prepare:h=>{x.n(h),h.style.zIndex="-1"},tick:h=>{a&&a.outAnimation(h)}})}};function k(t){const e=t.getBoundingClientRect(),n=t.clientHeight,i=50*(window.innerHeight-e.top)/n;return Math.min(Math.max(i,0),100)}const I=(t={})=>{var e,n;const i={stiffness:((e=t.spring)==null?void 0:e.stiffness)??300,damping:((n=t.spring)==null?void 0:n.damping)??200};return{in:r=>{const l=k(r);return{spring:i,tick:s=>{r.style.clipPath=`circle(${s*100}% at 50% ${l}%)`}}},out:r=>{const l=k(r);return{spring:i,tick:s=>{r.style.clipPath=`circle(${s*100}% at 50% ${l}%)`,r.style.zIndex="100"},prepare:x.n}}}};exports.fade=P;exports.hero=B;exports.pinterest=H;exports.ripple=I;
|