@cliquify.me/animations 9.0.12 → 9.0.14
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.es.js +369 -355
- package/dist/index.umd.js +9 -9
- package/dist/use-animation.d.ts +6 -1
- package/package.json +4 -4
package/dist/index.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { interpolate as
|
|
4
|
-
const
|
|
1
|
+
import { jsx as X, Fragment as U } from "react/jsx-runtime";
|
|
2
|
+
import L, { useMemo as q } from "react";
|
|
3
|
+
import { interpolate as H, Easing as y } from "remotion";
|
|
4
|
+
const D = () => ({
|
|
5
5
|
scale: (t) => ({ transform: `scale(${t})` }),
|
|
6
6
|
growIn: (t) => ({ transform: `scale(${t})` }),
|
|
7
7
|
shrinkIn: (t) => ({ transform: `scale(${t})` }),
|
|
@@ -81,329 +81,343 @@ const z = () => ({
|
|
|
81
81
|
transform: `translateY(${t}px)`,
|
|
82
82
|
overflow: "hidden"
|
|
83
83
|
}),
|
|
84
|
-
moveTranslateY: (t) => ({ transform: `translateY(${t}%)` })
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
84
|
+
moveTranslateY: (t) => ({ transform: `translateY(${t}%)` }),
|
|
85
|
+
"hide-show": (t) => ({ opacity: t }),
|
|
86
|
+
hide: (t) => ({ opacity: t }),
|
|
87
|
+
show: (t) => ({ opacity: t }),
|
|
88
|
+
borderRadius: (t) => ({
|
|
89
|
+
borderRadius: `${t}px`,
|
|
90
|
+
overflow: "hidden"
|
|
91
|
+
}),
|
|
92
|
+
"corner-radius": (t) => ({
|
|
93
|
+
borderRadius: `${t}px`,
|
|
94
|
+
overflow: "hidden"
|
|
95
|
+
})
|
|
96
|
+
}), z = (t, l = 0) => {
|
|
97
|
+
const e = [], r = t / 5;
|
|
98
|
+
for (let i = 0; i < 6; i += 1)
|
|
99
|
+
e.push(i * r + l);
|
|
100
|
+
return e;
|
|
101
|
+
}, G = (t, l, e, r = !1) => {
|
|
102
|
+
const { from: i, to: s, ease: g } = l, p = l.durationInFrames || 30, d = Number(i), a = Number(s), n = Math.max(1, Number(p));
|
|
103
|
+
if (isNaN(d) || isNaN(a))
|
|
93
104
|
return console.error("Invalid animation values:", {
|
|
94
|
-
from:
|
|
95
|
-
to:
|
|
96
|
-
animationDurationInFrames:
|
|
97
|
-
property:
|
|
98
|
-
}),
|
|
99
|
-
|
|
100
|
-
`durationInFrames is undefined for animation: ${
|
|
105
|
+
from: i,
|
|
106
|
+
to: s,
|
|
107
|
+
animationDurationInFrames: p,
|
|
108
|
+
property: l.property
|
|
109
|
+
}), d;
|
|
110
|
+
p === void 0 && console.warn(
|
|
111
|
+
`durationInFrames is undefined for animation: ${l.property}. Using 1 frame as default.`
|
|
101
112
|
);
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
113
|
+
const c = l.delay || 0;
|
|
114
|
+
if (l.property === "hide-show" || l.property === "hide" || l.property === "show")
|
|
115
|
+
return t < c ? d : a;
|
|
116
|
+
let $;
|
|
117
|
+
if (l.property === "moveScaleIn" ? $ = r ? [
|
|
118
|
+
e - n - c,
|
|
119
|
+
e - n * 0.5 - c
|
|
107
120
|
] : [
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
] :
|
|
111
|
-
|
|
112
|
-
|
|
121
|
+
c + n * 0.5,
|
|
122
|
+
c + n
|
|
123
|
+
] : l.property === "moveTranslateY" ? $ = r ? [
|
|
124
|
+
e - n * 0.5 - c,
|
|
125
|
+
e - c
|
|
113
126
|
] : [
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
] :
|
|
117
|
-
|
|
118
|
-
|
|
127
|
+
c,
|
|
128
|
+
c + n * 0.5
|
|
129
|
+
] : $ = r ? [
|
|
130
|
+
e - n - c,
|
|
131
|
+
e - c
|
|
119
132
|
] : [
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
],
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
) :
|
|
127
|
-
return
|
|
133
|
+
c,
|
|
134
|
+
c + n
|
|
135
|
+
], l.property.includes("shake")) {
|
|
136
|
+
const b = r ? z(
|
|
137
|
+
n,
|
|
138
|
+
e - n - c
|
|
139
|
+
) : z(n, c);
|
|
140
|
+
return H(
|
|
128
141
|
t,
|
|
129
|
-
|
|
130
|
-
[0,
|
|
142
|
+
b,
|
|
143
|
+
[0, d, a, d, a, 0],
|
|
131
144
|
{
|
|
132
145
|
extrapolateLeft: "clamp",
|
|
133
146
|
extrapolateRight: "clamp",
|
|
134
|
-
easing:
|
|
147
|
+
easing: g
|
|
135
148
|
}
|
|
136
149
|
);
|
|
137
150
|
}
|
|
138
|
-
return
|
|
151
|
+
return H(t, $, [d, a], {
|
|
139
152
|
extrapolateLeft: "clamp",
|
|
140
153
|
extrapolateRight: "clamp",
|
|
141
|
-
easing:
|
|
154
|
+
easing: g
|
|
142
155
|
});
|
|
143
|
-
},
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
156
|
+
}, Z = (t) => {
|
|
157
|
+
if (t == null) return 0;
|
|
158
|
+
if (typeof t == "number")
|
|
159
|
+
return Number.isNaN(t) ? 0 : t;
|
|
160
|
+
if (typeof t == "object") {
|
|
161
|
+
if (t.rotate !== void 0 && t.rotate !== null) {
|
|
162
|
+
const i = parseFloat(String(t.rotate));
|
|
163
|
+
if (!Number.isNaN(i)) return i;
|
|
164
|
+
}
|
|
165
|
+
if (t.rotation !== void 0 && t.rotation !== null) {
|
|
166
|
+
const i = parseFloat(String(t.rotation));
|
|
167
|
+
if (!Number.isNaN(i)) return i;
|
|
168
|
+
}
|
|
169
|
+
return t.transform ? Z(t.transform) : 0;
|
|
170
|
+
}
|
|
171
|
+
const l = String(t), e = /rotate\((-?[\d.]+)deg\)/.exec(l);
|
|
172
|
+
if (e)
|
|
173
|
+
return parseFloat(e[1]) || 0;
|
|
174
|
+
const r = /matrix\(([^)]+)\)/.exec(l);
|
|
175
|
+
if (r) {
|
|
176
|
+
const i = r[1].split(",").map((s) => parseFloat(s.trim()));
|
|
177
|
+
if (i.length >= 4) {
|
|
178
|
+
const [s, g] = i;
|
|
179
|
+
return Math.atan2(g, s) * (180 / Math.PI);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
return 0;
|
|
183
|
+
}, W = (t, l, e, r, i) => {
|
|
184
|
+
var d, a, n, c, $;
|
|
185
|
+
const { property: s } = t;
|
|
186
|
+
if (s === "move") {
|
|
187
|
+
const b = Number(((d = t.details) == null ? void 0 : d.fromX) ?? t.from ?? 0), w = Number(((a = t.details) == null ? void 0 : a.toX) ?? t.to ?? 0), R = Number(((n = t.details) == null ? void 0 : n.fromY) ?? 0), N = Number(((c = t.details) == null ? void 0 : c.toY) ?? 0), j = Number((($ = t.details) == null ? void 0 : $.scale) || 1) || 1;
|
|
188
|
+
let A = i;
|
|
189
|
+
if (A == null || Number.isNaN(A)) {
|
|
190
|
+
const Y = t.details;
|
|
191
|
+
A = Z((Y == null ? void 0 : Y.rotate) ?? (Y == null ? void 0 : Y.rotation) ?? (Y == null ? void 0 : Y.transform));
|
|
192
|
+
}
|
|
193
|
+
const E = t.delay || 0, B = t.durationInFrames || 30, u = r ? [e - B - E, e - E] : [E, E + B], M = H(l, u, [b, w], {
|
|
148
194
|
extrapolateLeft: "clamp",
|
|
149
195
|
extrapolateRight: "clamp",
|
|
150
196
|
easing: t.ease
|
|
151
|
-
}),
|
|
197
|
+
}), f = H(l, u, [R, N], {
|
|
152
198
|
extrapolateLeft: "clamp",
|
|
153
199
|
extrapolateRight: "clamp",
|
|
154
200
|
easing: t.ease
|
|
155
|
-
}),
|
|
201
|
+
}), v = (A || 0) * Math.PI / 180, m = Math.cos(v), S = Math.sin(v), h = M * m + f * S, x = -M * S + f * m, F = h / j, I = x / j;
|
|
156
202
|
return {
|
|
157
|
-
transform: `translateX(${
|
|
203
|
+
transform: `translateX(${F}px) translateY(${I}px)`
|
|
158
204
|
};
|
|
159
205
|
}
|
|
160
|
-
const
|
|
161
|
-
return (
|
|
162
|
-
},
|
|
206
|
+
const g = G(l, t, e, r), p = D();
|
|
207
|
+
return (p[s] || p.default)(g);
|
|
208
|
+
}, T = (t, l, e, r = !1, i = !1, s) => L.useMemo(() => {
|
|
163
209
|
if (t.length === 0) return {};
|
|
164
|
-
const
|
|
165
|
-
(
|
|
210
|
+
const g = t.filter(
|
|
211
|
+
(p) => p.from !== void 0 && p.to !== void 0
|
|
166
212
|
);
|
|
167
|
-
if (
|
|
168
|
-
const
|
|
169
|
-
|
|
170
|
-
const n =
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
} : M : u[x] = M;
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
$.push(n);
|
|
186
|
-
});
|
|
187
|
-
const o = { ...$.reduce(
|
|
188
|
-
(e, n) => (Object.keys(n).forEach((l) => {
|
|
189
|
-
l === "transform" || l === "filter" ? e[l] = e[l] ? `${e[l]} ${n[l]}` : n[l] : e[l] = n[l];
|
|
190
|
-
}), e),
|
|
213
|
+
if (g.length !== t.length && console.error("Some animations are invalid and will be ignored"), i) {
|
|
214
|
+
const p = [];
|
|
215
|
+
return g.reverse().forEach((a) => {
|
|
216
|
+
const n = W(
|
|
217
|
+
a,
|
|
218
|
+
e,
|
|
219
|
+
l,
|
|
220
|
+
!1,
|
|
221
|
+
s
|
|
222
|
+
);
|
|
223
|
+
p.push(n);
|
|
224
|
+
}), p.reduce(
|
|
225
|
+
(a, n) => (Object.keys(n).forEach((c) => {
|
|
226
|
+
c === "transform" || c === "filter" ? a[c] = a[c] ? `${a[c]} ${n[c]}` : n[c] : a[c] = n[c];
|
|
227
|
+
}), a),
|
|
191
228
|
{}
|
|
192
|
-
)
|
|
193
|
-
return Object.keys(u).forEach((e) => {
|
|
194
|
-
const n = u[e];
|
|
195
|
-
(e === "transform" || e === "filter") && n[e] ? o[e] = o[e] ? `${o[e]} ${n[e]}` : String(n[e]) : n[e] !== void 0 && (o[e] = n[e]);
|
|
196
|
-
}), o;
|
|
229
|
+
);
|
|
197
230
|
} else
|
|
198
|
-
return
|
|
199
|
-
(
|
|
200
|
-
|
|
201
|
-
}),
|
|
231
|
+
return g.map((d) => W(d, e, l, r, s)).reduce(
|
|
232
|
+
(d, a) => (Object.keys(a).forEach((n) => {
|
|
233
|
+
n === "transform" || n === "filter" ? d[n] = d[n] ? `${d[n]} ${a[n]}` : a[n] : d[n] = a[n];
|
|
234
|
+
}), d),
|
|
202
235
|
{}
|
|
203
236
|
);
|
|
204
|
-
}, [t,
|
|
205
|
-
const
|
|
206
|
-
return t.forEach((
|
|
207
|
-
Array.isArray(
|
|
208
|
-
}),
|
|
209
|
-
(
|
|
210
|
-
) ?
|
|
211
|
-
(
|
|
212
|
-
...
|
|
213
|
-
from: Math.min(
|
|
214
|
-
to: Math.max(
|
|
237
|
+
}, [t, e, l, r, s]), P = (t) => t ? Array.isArray(t) ? t : [t] : [], rt = (...t) => {
|
|
238
|
+
const l = [];
|
|
239
|
+
return t.forEach((e) => {
|
|
240
|
+
Array.isArray(e) ? l.push(...e) : e && l.push(e);
|
|
241
|
+
}), l.filter((e) => e !== void 0).reduce((e, r) => e.find(
|
|
242
|
+
(s) => s.property === r.property
|
|
243
|
+
) ? e.map(
|
|
244
|
+
(s) => s.property === r.property ? {
|
|
245
|
+
...s,
|
|
246
|
+
from: Math.min(s.from, r.from),
|
|
247
|
+
to: Math.max(s.to, r.to),
|
|
215
248
|
durationInFrames: Math.max(
|
|
216
|
-
|
|
217
|
-
|
|
249
|
+
s.durationInFrames,
|
|
250
|
+
r.durationInFrames
|
|
218
251
|
),
|
|
219
|
-
delay: Math.min(
|
|
220
|
-
ease: (
|
|
252
|
+
delay: Math.min(s.delay || 0, r.delay || 0),
|
|
253
|
+
ease: (g) => (s.ease(g) + r.ease(g)) / 2
|
|
221
254
|
// Average the easing functions
|
|
222
|
-
} :
|
|
223
|
-
) : [...
|
|
224
|
-
},
|
|
255
|
+
} : s
|
|
256
|
+
) : [...e, r], []);
|
|
257
|
+
}, ot = ({
|
|
225
258
|
animationIn: t,
|
|
226
|
-
animationOut:
|
|
227
|
-
durationInFrames:
|
|
228
|
-
children:
|
|
229
|
-
style:
|
|
230
|
-
frame:
|
|
231
|
-
isTransition:
|
|
232
|
-
basicCharAnimationsIn:
|
|
233
|
-
basicCharAnimationsOut:
|
|
259
|
+
animationOut: l,
|
|
260
|
+
durationInFrames: e,
|
|
261
|
+
children: r,
|
|
262
|
+
style: i = {},
|
|
263
|
+
frame: s,
|
|
264
|
+
isTransition: g = !1,
|
|
265
|
+
basicCharAnimationsIn: p = [],
|
|
266
|
+
basicCharAnimationsOut: d = []
|
|
234
267
|
}) => {
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
268
|
+
const a = Z(
|
|
269
|
+
(i == null ? void 0 : i.transform) || (i == null ? void 0 : i.rotate) || (i == null ? void 0 : i.rotation)
|
|
270
|
+
), n = T(
|
|
271
|
+
P(t),
|
|
272
|
+
e,
|
|
238
273
|
s,
|
|
239
|
-
|
|
240
|
-
!1
|
|
241
|
-
|
|
242
|
-
|
|
274
|
+
!1,
|
|
275
|
+
!1,
|
|
276
|
+
a
|
|
277
|
+
), c = T(
|
|
278
|
+
P(l),
|
|
279
|
+
e,
|
|
243
280
|
s,
|
|
244
|
-
|
|
245
|
-
!
|
|
246
|
-
|
|
247
|
-
|
|
281
|
+
!0,
|
|
282
|
+
!1,
|
|
283
|
+
a
|
|
284
|
+
), $ = T(
|
|
285
|
+
P(p),
|
|
286
|
+
e,
|
|
248
287
|
s,
|
|
249
|
-
|
|
250
|
-
!
|
|
251
|
-
|
|
252
|
-
|
|
288
|
+
!0,
|
|
289
|
+
!1,
|
|
290
|
+
a
|
|
291
|
+
), b = T(
|
|
292
|
+
P(d),
|
|
293
|
+
e,
|
|
253
294
|
s,
|
|
254
|
-
|
|
255
|
-
!
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
295
|
+
!0,
|
|
296
|
+
!1,
|
|
297
|
+
a
|
|
298
|
+
), w = L.useMemo(() => {
|
|
299
|
+
const f = Object.keys(n).length > 0, v = t == null ? void 0 : t.reduce(
|
|
300
|
+
(S, h) => Math.min(S, h.delay || 0),
|
|
259
301
|
1 / 0
|
|
260
|
-
),
|
|
261
|
-
return
|
|
262
|
-
}, [
|
|
263
|
-
if (
|
|
264
|
-
return { visibility:
|
|
265
|
-
const
|
|
266
|
-
if (!
|
|
302
|
+
), m = s - (v || 0);
|
|
303
|
+
return f && m < 0 ? { visibility: g ? "visible" : "hidden" } : n;
|
|
304
|
+
}, [n, s, t, g]), R = L.useMemo(() => {
|
|
305
|
+
if (s > e)
|
|
306
|
+
return { visibility: g ? "visible" : "hidden" };
|
|
307
|
+
const f = P(l);
|
|
308
|
+
if (!f || f.length === 0) return {};
|
|
267
309
|
let v = 0;
|
|
268
|
-
|
|
269
|
-
const
|
|
270
|
-
|
|
310
|
+
f.forEach((S) => {
|
|
311
|
+
const h = (S.durationInFrames || 0) + (S.delay || 0);
|
|
312
|
+
h > v && (v = h);
|
|
271
313
|
});
|
|
272
|
-
const
|
|
273
|
-
return
|
|
274
|
-
}, [
|
|
275
|
-
const
|
|
276
|
-
...
|
|
277
|
-
// , ...timedStyle
|
|
314
|
+
const m = Math.max(0, e - v);
|
|
315
|
+
return s < m ? {} : c;
|
|
316
|
+
}, [c, s, l, e, g]), N = L.useMemo(() => {
|
|
317
|
+
const f = {
|
|
318
|
+
...w
|
|
278
319
|
};
|
|
279
|
-
return Object.entries(
|
|
280
|
-
v === "transform" ?
|
|
281
|
-
}),
|
|
282
|
-
}, [
|
|
283
|
-
|
|
284
|
-
const h = y.transform;
|
|
285
|
-
y.transform = h.replace(
|
|
286
|
-
/rotate\(([^)]+)deg\)/,
|
|
287
|
-
(v, w) => `rotate(${parseFloat(w) - V}deg)`
|
|
288
|
-
);
|
|
289
|
-
}
|
|
290
|
-
const F = W(() => {
|
|
291
|
-
const h = y.transform || "", {
|
|
320
|
+
return Object.entries(R).forEach(([v, m]) => {
|
|
321
|
+
v === "transform" ? f[v] = `${f[v] || ""} ${m || ""}`.trim() : v in f && typeof f[v] == "number" && typeof m == "number" ? f[v] = f[v] * m : f[v] = m;
|
|
322
|
+
}), f;
|
|
323
|
+
}, [w, R]), j = q(() => {
|
|
324
|
+
const f = N.transform || "", {
|
|
292
325
|
translateX: v,
|
|
293
|
-
translateY:
|
|
294
|
-
scale:
|
|
295
|
-
rotation:
|
|
296
|
-
rotateX:
|
|
297
|
-
rotateY:
|
|
298
|
-
rotateZ:
|
|
299
|
-
} =
|
|
300
|
-
return `${
|
|
301
|
-
}, [
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
transform:
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
});
|
|
310
|
-
const {
|
|
311
|
-
top: X,
|
|
312
|
-
left: g,
|
|
313
|
-
position: T,
|
|
314
|
-
transform: _,
|
|
315
|
-
...L
|
|
316
|
-
} = m || {};
|
|
317
|
-
return /* @__PURE__ */ N(
|
|
326
|
+
translateY: m,
|
|
327
|
+
scale: S,
|
|
328
|
+
rotation: h,
|
|
329
|
+
rotateX: x,
|
|
330
|
+
rotateY: F,
|
|
331
|
+
rotateZ: I
|
|
332
|
+
} = J(f);
|
|
333
|
+
return `${h} ${v} ${m} ${S} ${x} ${F} ${I}`.trim();
|
|
334
|
+
}, [N]), {
|
|
335
|
+
top: A,
|
|
336
|
+
left: E,
|
|
337
|
+
position: B,
|
|
338
|
+
transform: u,
|
|
339
|
+
...M
|
|
340
|
+
} = i || {};
|
|
341
|
+
return /* @__PURE__ */ X(
|
|
318
342
|
"div",
|
|
319
343
|
{
|
|
320
344
|
style: {
|
|
321
345
|
width: "100%",
|
|
322
346
|
height: "100%",
|
|
323
|
-
overflow:
|
|
347
|
+
overflow: N.overflow || $.overflow || b.overflow || "visible",
|
|
324
348
|
pointerEvents: "none"
|
|
325
349
|
},
|
|
326
|
-
children: /* @__PURE__ */
|
|
350
|
+
children: /* @__PURE__ */ X(
|
|
327
351
|
"div",
|
|
328
352
|
{
|
|
329
353
|
style: {
|
|
330
354
|
width: "100%",
|
|
331
355
|
height: "100%",
|
|
332
|
-
...
|
|
333
|
-
...
|
|
334
|
-
rotate: `${V}deg`,
|
|
356
|
+
...M,
|
|
357
|
+
...N,
|
|
335
358
|
overflow: "visible",
|
|
336
|
-
transform:
|
|
359
|
+
transform: j,
|
|
337
360
|
pointerEvents: "none",
|
|
338
|
-
background: Object.keys(
|
|
361
|
+
background: Object.keys(N).length === 0 ? "transparent" : N.backgroundColor
|
|
339
362
|
},
|
|
340
|
-
children:
|
|
363
|
+
children: r
|
|
341
364
|
}
|
|
342
365
|
)
|
|
343
366
|
}
|
|
344
367
|
);
|
|
345
|
-
},
|
|
346
|
-
let
|
|
347
|
-
const
|
|
348
|
-
|
|
349
|
-
const
|
|
350
|
-
|
|
351
|
-
const
|
|
352
|
-
|
|
353
|
-
const
|
|
354
|
-
|
|
355
|
-
const
|
|
356
|
-
|
|
357
|
-
const
|
|
358
|
-
|
|
359
|
-
const
|
|
360
|
-
return
|
|
368
|
+
}, J = (t) => {
|
|
369
|
+
let l = "", e = "", r = "scale(1)", i = "", s = "", g = "", p = "";
|
|
370
|
+
const d = t.match(/translateX\([^)]+\)/g);
|
|
371
|
+
d && (l = d[d.length - 1]);
|
|
372
|
+
const a = t.match(/translateY\([^)]+\)/g);
|
|
373
|
+
a && (e = a[a.length - 1]);
|
|
374
|
+
const n = t.match(/scale\([^)]+\)/g);
|
|
375
|
+
n && (r = n[n.length - 1]);
|
|
376
|
+
const c = t.match(/rotate\([^)]+\)/g);
|
|
377
|
+
c && (i = c[c.length - 1]);
|
|
378
|
+
const $ = t.match(/rotateX\([^)]+\)/g);
|
|
379
|
+
$ && (s = $[$.length - 1]);
|
|
380
|
+
const b = t.match(/rotateY\([^)]+\)/g);
|
|
381
|
+
b && (g = b[b.length - 1]);
|
|
382
|
+
const w = t.match(/rotateZ\([^)]+\)/g);
|
|
383
|
+
return w && (p = w[w.length - 1]), { translateX: l, translateY: e, scale: r, rotation: i, rotateX: s, rotateY: g, rotateZ: p };
|
|
361
384
|
}, st = ({
|
|
362
385
|
animationTimed: t,
|
|
363
|
-
durationInFrames:
|
|
364
|
-
children:
|
|
365
|
-
style:
|
|
366
|
-
frame:
|
|
386
|
+
durationInFrames: l,
|
|
387
|
+
children: e,
|
|
388
|
+
style: r = {},
|
|
389
|
+
frame: i
|
|
367
390
|
}) => {
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
391
|
+
const s = Z(
|
|
392
|
+
(r == null ? void 0 : r.transform) || (r == null ? void 0 : r.rotate) || (r == null ? void 0 : r.rotation)
|
|
393
|
+
), g = T(
|
|
394
|
+
P(t),
|
|
395
|
+
l,
|
|
396
|
+
i,
|
|
373
397
|
!1,
|
|
374
|
-
!0
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
e.transform = d.replace(
|
|
381
|
-
/rotate\(([^)]+)deg\)/,
|
|
382
|
-
(S, M) => `rotate(${parseFloat(M) - o}deg)`
|
|
383
|
-
);
|
|
384
|
-
}
|
|
385
|
-
let n = e;
|
|
386
|
-
return p > 0 && n.transform && n.transform.includes("translateX") && (n = {
|
|
387
|
-
...n,
|
|
388
|
-
transform: n.transform.replace(
|
|
389
|
-
/translateX\(([^)]+)\)/g,
|
|
390
|
-
(d, S) => `translateX(${parseFloat(S)}%)`
|
|
391
|
-
)
|
|
392
|
-
}), /* @__PURE__ */ N(
|
|
398
|
+
!0,
|
|
399
|
+
s
|
|
400
|
+
), p = L.useMemo(() => ({
|
|
401
|
+
...g
|
|
402
|
+
}), [g]), d = !!p.borderRadius;
|
|
403
|
+
return /* @__PURE__ */ X(
|
|
393
404
|
"div",
|
|
394
405
|
{
|
|
395
406
|
style: {
|
|
396
|
-
overflow:
|
|
407
|
+
overflow: d ? "hidden" : p.overflow || "visible",
|
|
408
|
+
borderRadius: p.borderRadius,
|
|
397
409
|
pointerEvents: "none",
|
|
398
|
-
height:
|
|
399
|
-
width:
|
|
400
|
-
...
|
|
410
|
+
height: r.height || "100%",
|
|
411
|
+
width: r.width || "100%",
|
|
412
|
+
...p,
|
|
413
|
+
...d ? { overflow: "hidden" } : {}
|
|
401
414
|
},
|
|
402
|
-
children: /* @__PURE__ */
|
|
415
|
+
children: /* @__PURE__ */ X(
|
|
403
416
|
"div",
|
|
404
417
|
{
|
|
405
418
|
style: {
|
|
406
|
-
overflow: "visible",
|
|
419
|
+
overflow: d ? "hidden" : "visible",
|
|
420
|
+
borderRadius: p.borderRadius,
|
|
407
421
|
pointerEvents: "none",
|
|
408
422
|
height: "100%",
|
|
409
423
|
width: "100%",
|
|
@@ -411,79 +425,79 @@ const z = () => ({
|
|
|
411
425
|
alignItems: "center",
|
|
412
426
|
justifyContent: "center"
|
|
413
427
|
},
|
|
414
|
-
children:
|
|
428
|
+
children: e
|
|
415
429
|
}
|
|
416
430
|
)
|
|
417
431
|
}
|
|
418
432
|
);
|
|
419
|
-
},
|
|
433
|
+
}, K = (t) => {
|
|
420
434
|
if (typeof (t == null ? void 0 : t.ease) == "function")
|
|
421
435
|
return t.ease;
|
|
422
436
|
switch (t == null ? void 0 : t.easing) {
|
|
423
437
|
case "ease-in":
|
|
424
438
|
case "accelerate":
|
|
425
|
-
return
|
|
439
|
+
return y.in(y.cubic);
|
|
426
440
|
case "ease-out":
|
|
427
441
|
case "smooth":
|
|
428
442
|
case "slowDown":
|
|
429
|
-
return
|
|
443
|
+
return y.out(y.cubic);
|
|
430
444
|
case "ease-in-out":
|
|
431
445
|
case "natural":
|
|
432
446
|
case "swing":
|
|
433
|
-
return
|
|
447
|
+
return y.inOut(y.cubic);
|
|
434
448
|
case "bounce":
|
|
435
|
-
return
|
|
449
|
+
return y.bounce;
|
|
436
450
|
case "elastic":
|
|
437
|
-
return
|
|
451
|
+
return y.elastic(1);
|
|
438
452
|
case "overshoot":
|
|
439
453
|
case "impulse":
|
|
440
|
-
return
|
|
454
|
+
return y.out(y.back(1.7));
|
|
441
455
|
case "none":
|
|
442
456
|
case "linear":
|
|
443
457
|
default:
|
|
444
|
-
return
|
|
458
|
+
return y.linear;
|
|
445
459
|
}
|
|
446
|
-
},
|
|
460
|
+
}, O = ({
|
|
447
461
|
children: t,
|
|
448
|
-
currentWidth:
|
|
449
|
-
currentHeight:
|
|
450
|
-
frame:
|
|
451
|
-
item:
|
|
452
|
-
keyframeAnimations:
|
|
453
|
-
durationInFrames:
|
|
462
|
+
currentWidth: l,
|
|
463
|
+
currentHeight: e,
|
|
464
|
+
frame: r,
|
|
465
|
+
item: i,
|
|
466
|
+
keyframeAnimations: s,
|
|
467
|
+
durationInFrames: g
|
|
454
468
|
}) => {
|
|
455
|
-
var
|
|
456
|
-
if (!
|
|
457
|
-
return /* @__PURE__ */
|
|
458
|
-
const
|
|
459
|
-
var
|
|
460
|
-
return !!((
|
|
461
|
-
},
|
|
462
|
-
var
|
|
463
|
-
return !!((
|
|
464
|
-
},
|
|
465
|
-
(
|
|
466
|
-
),
|
|
467
|
-
(
|
|
469
|
+
var _, k;
|
|
470
|
+
if (!s || !Array.isArray(s) || s.length === 0)
|
|
471
|
+
return /* @__PURE__ */ X(U, { children: t });
|
|
472
|
+
const p = (o) => {
|
|
473
|
+
var V, C;
|
|
474
|
+
return !!((V = o == null ? void 0 : o.property) != null && V.includes("maskReveal") || (C = o == null ? void 0 : o.id) != null && C.includes("maskReveal"));
|
|
475
|
+
}, d = (o) => {
|
|
476
|
+
var V, C;
|
|
477
|
+
return !!((o == null ? void 0 : o.type) === "exit" || (V = o == null ? void 0 : o.property) != null && V.includes("Out") || (C = o == null ? void 0 : o.id) != null && C.includes("Out"));
|
|
478
|
+
}, a = s.find(
|
|
479
|
+
(o) => p(o) && !d(o)
|
|
480
|
+
), n = s.find(
|
|
481
|
+
(o) => p(o) && d(o)
|
|
468
482
|
);
|
|
469
|
-
if (!
|
|
470
|
-
return /* @__PURE__ */
|
|
471
|
-
const
|
|
472
|
-
let
|
|
473
|
-
if (
|
|
474
|
-
const
|
|
475
|
-
|
|
483
|
+
if (!a && !n)
|
|
484
|
+
return /* @__PURE__ */ X(U, { children: t });
|
|
485
|
+
const c = Math.max(1, g || 300);
|
|
486
|
+
let $ = null, b = !1, w = 30, R = 0;
|
|
487
|
+
if (n) {
|
|
488
|
+
const o = Math.max(1, Number(n.durationInFrames || 30)), V = Math.max(0, Number(n.delay || 0)), C = Math.max(0, c - o - V);
|
|
489
|
+
r >= C && ($ = n, b = !0, w = o, R = r - C);
|
|
476
490
|
}
|
|
477
|
-
if (
|
|
478
|
-
|
|
479
|
-
const
|
|
480
|
-
|
|
491
|
+
if (!$ && a) {
|
|
492
|
+
$ = a, b = !1, w = Math.max(1, Number(a.durationInFrames || 30));
|
|
493
|
+
const o = Math.max(0, Number(a.delay || 0));
|
|
494
|
+
R = r - o;
|
|
481
495
|
}
|
|
482
|
-
if (
|
|
483
|
-
return /* @__PURE__ */
|
|
484
|
-
const
|
|
485
|
-
if (!
|
|
486
|
-
return /* @__PURE__ */
|
|
496
|
+
if (!$)
|
|
497
|
+
return /* @__PURE__ */ X(U, { children: t });
|
|
498
|
+
const N = a ? Math.max(0, Number(a.delay || 0)) : 0, j = a ? Math.max(1, Number(a.durationInFrames || 30)) : 30;
|
|
499
|
+
if (!b && a && r >= N + j)
|
|
500
|
+
return /* @__PURE__ */ X(
|
|
487
501
|
"div",
|
|
488
502
|
{
|
|
489
503
|
style: {
|
|
@@ -495,8 +509,8 @@ const z = () => ({
|
|
|
495
509
|
children: t
|
|
496
510
|
}
|
|
497
511
|
);
|
|
498
|
-
if (!
|
|
499
|
-
return /* @__PURE__ */
|
|
512
|
+
if (!b && a && r < N)
|
|
513
|
+
return /* @__PURE__ */ X(
|
|
500
514
|
"div",
|
|
501
515
|
{
|
|
502
516
|
style: {
|
|
@@ -508,72 +522,72 @@ const z = () => ({
|
|
|
508
522
|
children: t
|
|
509
523
|
}
|
|
510
524
|
);
|
|
511
|
-
const
|
|
512
|
-
let
|
|
513
|
-
if (
|
|
514
|
-
const
|
|
515
|
-
|
|
516
|
-
${
|
|
525
|
+
const A = Math.max(0, R), E = Math.min(Math.max(0, A / w), 1), B = K($), u = Math.max(0, Math.min(1, B(E))), M = String($.property || $.id || ""), f = ((_ = $.details) == null ? void 0 : _.direction) || "up", v = M.includes("ShrinkScale"), m = M.includes("CenterScale"), S = M.includes("Slide") || M.includes("slide");
|
|
526
|
+
let h, x = "";
|
|
527
|
+
if (m) {
|
|
528
|
+
const o = b ? 50 * u : 50 * (1 - u);
|
|
529
|
+
h = `inset(
|
|
530
|
+
${o}%
|
|
517
531
|
0%
|
|
518
|
-
${
|
|
532
|
+
${o}%
|
|
519
533
|
0%
|
|
520
534
|
)`;
|
|
521
|
-
} else if (
|
|
522
|
-
const
|
|
523
|
-
|
|
524
|
-
${
|
|
525
|
-
${
|
|
526
|
-
${
|
|
527
|
-
${
|
|
535
|
+
} else if (v) {
|
|
536
|
+
const o = b ? 25 * u : 25 * (1 - u);
|
|
537
|
+
h = `inset(
|
|
538
|
+
${o}%
|
|
539
|
+
${o}%
|
|
540
|
+
${o}%
|
|
541
|
+
${o}%
|
|
528
542
|
)`;
|
|
529
|
-
} else if (
|
|
530
|
-
|
|
531
|
-
else if (
|
|
532
|
-
|
|
533
|
-
else if (
|
|
534
|
-
const
|
|
535
|
-
|
|
543
|
+
} else if (S)
|
|
544
|
+
h = "inset(0% 0% 0% 0%)", b ? f === "down" ? x = `translateY(${100 * u}%)` : f === "left" ? x = `translateX(${-100 * u}%)` : f === "right" ? x = `translateX(${100 * u}%)` : x = `translateY(${-100 * u}%)` : f === "down" ? x = `translateY(${-100 * (1 - u)}%)` : f === "left" ? x = `translateX(${100 * (1 - u)}%)` : f === "right" ? x = `translateX(${-100 * (1 - u)}%)` : x = `translateY(${100 * (1 - u)}%)`;
|
|
545
|
+
else if (M.includes("Center"))
|
|
546
|
+
h = `circle(${b ? 150 * (1 - u) : 150 * u}% at 50% 50%)`;
|
|
547
|
+
else if (M.includes("Corner")) {
|
|
548
|
+
const o = b ? u : 1 - u;
|
|
549
|
+
f === "down" ? h = `inset(0 ${100 * o}% ${100 * o}% 0)` : f === "up" ? h = `inset(${100 * o}% ${100 * o}% 0 0)` : f === "left" ? h = `inset(0 0 ${100 * o}% ${100 * o}%)` : f === "right" ? h = `inset(${100 * o}% 0 0 ${100 * o}%)` : h = `inset(0 ${100 * o}% ${100 * o}% 0)`;
|
|
536
550
|
} else
|
|
537
|
-
|
|
538
|
-
const
|
|
539
|
-
let
|
|
540
|
-
|
|
541
|
-
const
|
|
551
|
+
b ? f === "down" ? h = `inset(${100 * u}% 0 0 0)` : f === "left" ? h = `inset(0 ${100 * u}% 0 0)` : f === "right" ? h = `inset(0 0 0 ${100 * u}%)` : h = `inset(0 0 ${100 * u}% 0)` : f === "down" ? h = `inset(0 0 ${100 * (1 - u)}% 0)` : f === "left" ? h = `inset(0 0 0 ${100 * (1 - u)}%)` : f === "right" ? h = `inset(0 ${100 * (1 - u)}% 0 0)` : h = `inset(${100 * (1 - u)}% 0 0 0)`;
|
|
552
|
+
const F = !!((k = $ == null ? void 0 : $.details) != null && k.scale || $ != null && $.scale);
|
|
553
|
+
let I = 1;
|
|
554
|
+
m || v ? I = b ? 1 + 0.5 * u : 1.5 - 0.5 * u : F && (I = b ? 1 - 0.2 * u : 0.8 + 0.2 * u);
|
|
555
|
+
const Y = [x, `scale(${I})`].filter(Boolean).join(" ");
|
|
542
556
|
return console.log("[MaskAnim] Rendering:", {
|
|
543
|
-
propName:
|
|
544
|
-
frame:
|
|
545
|
-
localFrame:
|
|
546
|
-
animDuration:
|
|
547
|
-
progress:
|
|
548
|
-
easedProgress:
|
|
549
|
-
isOut:
|
|
550
|
-
isShrinkScale:
|
|
551
|
-
isCenterScale:
|
|
552
|
-
isSlide:
|
|
553
|
-
direction:
|
|
554
|
-
clipPath:
|
|
555
|
-
translateTransform:
|
|
556
|
-
isScale:
|
|
557
|
-
scaleValue:
|
|
558
|
-
innerTransform:
|
|
559
|
-
}), /* @__PURE__ */
|
|
557
|
+
propName: M,
|
|
558
|
+
frame: r,
|
|
559
|
+
localFrame: R,
|
|
560
|
+
animDuration: w,
|
|
561
|
+
progress: E,
|
|
562
|
+
easedProgress: u,
|
|
563
|
+
isOut: b,
|
|
564
|
+
isShrinkScale: v,
|
|
565
|
+
isCenterScale: m,
|
|
566
|
+
isSlide: S,
|
|
567
|
+
direction: f,
|
|
568
|
+
clipPath: h,
|
|
569
|
+
translateTransform: x,
|
|
570
|
+
isScale: F,
|
|
571
|
+
scaleValue: I,
|
|
572
|
+
innerTransform: Y
|
|
573
|
+
}), /* @__PURE__ */ X(
|
|
560
574
|
"div",
|
|
561
575
|
{
|
|
562
576
|
style: {
|
|
563
|
-
width:
|
|
564
|
-
height:
|
|
577
|
+
width: l !== void 0 ? l : "100%",
|
|
578
|
+
height: e !== void 0 ? e : "100%",
|
|
565
579
|
position: "relative",
|
|
566
|
-
clipPath:
|
|
567
|
-
WebkitClipPath:
|
|
580
|
+
clipPath: h,
|
|
581
|
+
WebkitClipPath: h,
|
|
568
582
|
overflow: "hidden"
|
|
569
583
|
},
|
|
570
|
-
children: /* @__PURE__ */
|
|
584
|
+
children: /* @__PURE__ */ X(
|
|
571
585
|
"div",
|
|
572
586
|
{
|
|
573
587
|
style: {
|
|
574
588
|
width: "100%",
|
|
575
589
|
height: "100%",
|
|
576
|
-
transform:
|
|
590
|
+
transform: Y,
|
|
577
591
|
transformOrigin: "center"
|
|
578
592
|
},
|
|
579
593
|
children: t
|
|
@@ -581,13 +595,13 @@ const z = () => ({
|
|
|
581
595
|
)
|
|
582
596
|
}
|
|
583
597
|
);
|
|
584
|
-
},
|
|
598
|
+
}, nt = O;
|
|
585
599
|
export {
|
|
586
|
-
|
|
600
|
+
ot as BoxAnim,
|
|
587
601
|
st as ContentAnim,
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
602
|
+
nt as MaskAnim,
|
|
603
|
+
rt as combine,
|
|
604
|
+
P as combineAnimations,
|
|
605
|
+
J as extractTransformations,
|
|
606
|
+
T as useAnimation
|
|
593
607
|
};
|
package/dist/index.umd.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
(function(Y,w){typeof exports=="object"&&typeof module<"u"?w(exports,require("react/jsx-runtime"),require("react"),require("remotion")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","remotion"],w):(Y=typeof globalThis<"u"?globalThis:Y||self,w(Y.animations={},Y.jsxRuntime,Y.React,Y.remotion))})(this,function(Y,w,I,X){"use strict";const Z=()=>({scale:t=>({transform:`scale(${t})`}),growIn:t=>({transform:`scale(${t})`}),shrinkIn:t=>({transform:`scale(${t})`}),shrinkOut:t=>({transform:`scale(${t})`}),opacity:t=>({opacity:t}),translateX:t=>({transform:`translateX(${t}%)`}),translateY:t=>({transform:`translateY(${t}%)`}),rotate:t=>({transform:`rotate(${t}deg)`}),spin:t=>({transform:`rotate(${t}deg)`}),spinIn:t=>({transform:`rotate(${t}deg)`}),twistIn:t=>({transform:`rotate(${t}deg)`}),twistOut:t=>({transform:`rotate(${t}deg)`}),moveScaleIn:t=>({transform:`scale(${t})`}),spinOut:t=>({transform:`rotate(${t}deg)`}),default:()=>({}),rotateY:t=>({transform:`rotateY(${t}deg)`}),rotateX:t=>({transform:`rotateX(${t}deg)`}),blur:t=>({filter:`blur(${t}px)`}),blurIn:t=>({filter:`blur(${t}px)`}),blurOut:t=>({filter:`blur(${t}px)`}),blurV2In:t=>({filter:`blur(${t}px)`}),blurSlide:t=>({filter:`blur(${t}px)`,transform:`translateY(${t*5}%)`}),blurSlideV2In:t=>({filter:`blur(${t}px)`}),brightness:t=>({filter:`brightness(${t}%)`}),contrast:t=>({filter:`contrast(${t}%)`}),grayscale:t=>({filter:`grayscale(${t}%)`}),hue:t=>({filter:`hue-rotate(${t}deg)`}),saturation:t=>({filter:`saturate(${t}%)`}),vignette:t=>({filter:`contrast(${100+t*20}%) brightness(${100-t*20}%)`}),noise:t=>({filter:`contrast(${100+t*40}%) brightness(${100+t*20}%)`}),pixelate:t=>({filter:`contrast(${100+t*2}%)`}),chromaticAberration:t=>({filter:`hue-rotate(${t*10}deg) contrast(110%)`}),lightLeak:t=>({filter:`brightness(${100+t*50}%) saturate(${100+t*30}%)`}),duotone:t=>({filter:`sepia(${t*100}%) hue-rotate(${t*180}deg)`}),shakeHorizontalIn:t=>({transform:`translateX(${t}px)`}),shakeVerticalIn:t=>({transform:`translateY(${t}px)`}),shakeHorizontalOut:t=>({transform:`translateX(${t}px)`}),shakeVerticalOut:t=>({transform:`translateY(${t}px)`}),maskUpIn:t=>({transform:`translateY(${t}px)`,overflow:"hidden"}),maskUpOut:t=>({transform:`translateY(${t}px)`,overflow:"hidden"}),maskDownIn:t=>({transform:`translateY(${t}px)`,overflow:"hidden"}),maskDownOut:t=>({transform:`translateY(${t}px)`,overflow:"hidden"}),moveTranslateY:t=>({transform:`translateY(${t}%)`})}),q=(t,f=0)=>{const s=[],c=t/5;for(let $=0;$<6;$+=1)s.push($*c+f);return s},z=(t,f,s,c=!1)=>{const{from:$,to:o,ease:g}=f,u=f.durationInFrames||30,p=Number($),n=Number(o),e=Math.max(1,Number(u));if(isNaN(p)||isNaN(n))return console.error("Invalid animation values:",{from:$,to:o,animationDurationInFrames:u,property:f.property}),p;u===void 0&&console.warn(`durationInFrames is undefined for animation: ${f.property}. Using 1 frame as default.`);const a=f.delay||0;let l;if(f.property==="moveScaleIn"?l=c?[s-e-a,s-e*.5-a]:[a+e*.5,a+e]:f.property==="moveTranslateY"?l=c?[s-e*.5-a,s-a]:[a,a+e*.5]:l=c?[s-e-a,s-a]:[a,a+e],f.property.includes("shake")){const d=c?q(e,s-e-a):q(e,a);return X.interpolate(t,d,[0,p,n,p,n,0],{extrapolateLeft:"clamp",extrapolateRight:"clamp",easing:g})}return X.interpolate(t,l,[p,n],{extrapolateLeft:"clamp",extrapolateRight:"clamp",easing:g})},U=(t,f,s,c)=>{var u,p,n,e,a;const{property:$}=t;if($==="move"){const l=Number(((u=t.details)==null?void 0:u.fromX)??t.from??0),d=Number(((p=t.details)==null?void 0:p.toX)??t.to??0),S=Number(((n=t.details)==null?void 0:n.fromY)??0),A=Number(((e=t.details)==null?void 0:e.toY)??0),x=Number(((a=t.details)==null?void 0:a.scale)||1)||1,E=t.delay||0,O=t.durationInFrames||30,M=c?[s-O-E,s-E]:[E,E+O],C=X.interpolate(f,M,[l,d],{extrapolateLeft:"clamp",extrapolateRight:"clamp",easing:t.ease}),i=X.interpolate(f,M,[S,A],{extrapolateLeft:"clamp",extrapolateRight:"clamp",easing:t.ease}),N=C/x,m=i/x;return{transform:`translateX(${N}px) translateY(${m}px)`}}const o=z(f,t,s,c),g=Z();return(g[$]||g.default)(o)},P=(t,f,s,c=!1,$=!1)=>I.useMemo(()=>{if(t.length===0)return{};const o=t.filter(g=>g.from!==void 0&&g.to!==void 0);if(o.length!==t.length&&console.error("Some animations are invalid and will be ignored"),$){const g=[],u={};o.reverse().forEach(e=>{const a=U(e,s,f,!1);if(e.persist===!0&&s-(e.delay||0)>=e.durationInFrames){const d=e.to,S=Z(),A=e.property==="move"?(()=>{var i,N,m;const x=Number(((i=e.details)==null?void 0:i.toX)??e.to??0),E=Number(((N=e.details)==null?void 0:N.toY)??0),O=Number(((m=e.details)==null?void 0:m.scale)||1)||1,M=x/O,C=E/O;return{transform:`translateX(${M}px) translateY(${C}px)`}})():(S[e.property]||S.default)(d);Object.keys(A).forEach(x=>{x==="transform"?u[x]=u[x]?{[x]:`${u[x][x]} ${A[x]}`}:A:u[x]=A})}g.push(a)});const n={...g.reduce((e,a)=>(Object.keys(a).forEach(l=>{l==="transform"||l==="filter"?e[l]=e[l]?`${e[l]} ${a[l]}`:a[l]:e[l]=a[l]}),e),{})};return Object.keys(u).forEach(e=>{const a=u[e];(e==="transform"||e==="filter")&&a[e]?n[e]=n[e]?`${n[e]} ${a[e]}`:String(a[e]):a[e]!==void 0&&(n[e]=a[e])}),n}else return o.map(u=>U(u,s,f,c)).reduce((u,p)=>(Object.keys(p).forEach(n=>{n==="transform"||n==="filter"?u[n]=u[n]?`${u[n]} ${p[n]}`:p[n]:u[n]=p[n]}),u),{})},[t,s,f,c]),T=t=>t?Array.isArray(t)?t:[t]:[],G=(...t)=>{const f=[];return t.forEach(s=>{Array.isArray(s)?f.push(...s):s&&f.push(s)}),f.filter(s=>s!==void 0).reduce((s,c)=>s.find(o=>o.property===c.property)?s.map(o=>o.property===c.property?{...o,from:Math.min(o.from,c.from),to:Math.max(o.to,c.to),durationInFrames:Math.max(o.durationInFrames,c.durationInFrames),delay:Math.min(o.delay||0,c.delay||0),ease:g=>(o.ease(g)+c.ease(g))/2}:o):[...s,c],[])},J=({animationIn:t,animationOut:f,durationInFrames:s,children:c,style:$={},frame:o,isTransition:g=!1,basicCharAnimationsIn:u=[],basicCharAnimationsOut:p=[]})=>{var b;const n=P(T(t),s,o,!1),e=P(T(f),s,o,!0),a=P(T(u),s,o,!0),l=P(T(p),s,o,!0),d=I.useMemo(()=>{const h=Object.keys(n).length>0,v=t==null?void 0:t.reduce((V,F)=>Math.min(V,F.delay||0),1/0),y=o-(v||0);return h&&y<0?{visibility:g?"visible":"hidden"}:n},[n,o,t]),S=I.useMemo(()=>{if(o>s)return{visibility:g?"visible":"hidden"};const h=T(f);if(!h||h.length===0)return{};let v=0;h.forEach(V=>{const F=(V.durationInFrames||0)+(V.delay||0);F>v&&(v=F)});const y=Math.max(0,s-v);return o<y?{}:e},[e,o,f,s,g]),x=(($==null?void 0:$.transform)||"").match(/rotate\((-?[\d.]+)deg\)/),E=x?parseFloat(x[1]):0,O=-E,M=I.useMemo(()=>{const h={...d};return Object.entries(S).forEach(([v,y])=>{v==="transform"?h[v]=`${h[v]||""} ${y||""}`.trim():v in h&&typeof h[v]=="number"&&typeof y=="number"?h[v]=h[v]*y:h[v]=y}),h},[d,S]);if((b=M.transform)!=null&&b.includes("rotate")){const h=M.transform;M.transform=h.replace(/rotate\(([^)]+)deg\)/,(v,y)=>`rotate(${parseFloat(y)-O}deg)`)}const C=I.useMemo(()=>{const h=M.transform||"",{translateX:v,translateY:y,scale:V,rotation:F,rotateX:H,rotateY:r,rotateZ:j}=W(h);return`${v} ${y} ${V} ${F||`rotate(${E}deg)`} ${H} ${r} ${j}`.trim()},[M,E]);let i=n;E>0&&i.transform&&i.transform.includes("translateX")&&(i={...i,transform:i.transform.replace(/translateX\(([^)]+)\)/g,(h,v)=>`translateX(${parseFloat(v)}%)`)});const{top:N,left:m,position:_,transform:B,...L}=$||{};return w.jsx("div",{style:{width:"100%",height:"100%",overflow:M.overflow||a.overflow||l.overflow||"visible",pointerEvents:"none"},children:w.jsx("div",{style:{width:"100%",height:"100%",...L,...M,rotate:`${O}deg`,overflow:"visible",transform:C,pointerEvents:"none",background:Object.keys(M).length===0?"transparent":M.backgroundColor},children:c})})},W=t=>{let f="",s="",c="scale(1)",$="",o="",g="",u="";const p=t.match(/translateX\([^)]+\)/g);p&&(f=p[p.length-1]);const n=t.match(/translateY\([^)]+\)/g);n&&(s=n[n.length-1]);const e=t.match(/scale\([^)]+\)/g);e&&(c=e[e.length-1]);const a=t.match(/rotate\([^)]+\)/g);a&&($=a[a.length-1]);const l=t.match(/rotateX\([^)]+\)/g);l&&(o=l[l.length-1]);const d=t.match(/rotateY\([^)]+\)/g);d&&(g=d[d.length-1]);const S=t.match(/rotateZ\([^)]+\)/g);return S&&(u=S[S.length-1]),{translateX:f,translateY:s,scale:c,rotation:$,rotateX:o,rotateY:g,rotateZ:u}},K=({animationTimed:t,durationInFrames:f,children:s,style:c={},frame:$})=>{var l;const o=P(T(t),f,$,!1,!0),u=((c==null?void 0:c.transform)||"").match(/rotate\((-?[\d.]+)deg\)/),p=u?parseFloat(u[1]):0,n=-p,e=I.useMemo(()=>({...o}),[o]);if((l=e.transform)!=null&&l.includes("rotate")){const d=e.transform;e.transform=d.replace(/rotate\(([^)]+)deg\)/,(S,A)=>`rotate(${parseFloat(A)-n}deg)`)}let a=e;return p>0&&a.transform&&a.transform.includes("translateX")&&(a={...a,transform:a.transform.replace(/translateX\(([^)]+)\)/g,(d,S)=>`translateX(${parseFloat(S)}%)`)}),w.jsx("div",{style:{overflow:e.overflow||"visible",pointerEvents:"none",height:c.height||"100%",width:c.width||"100%",...a},children:w.jsx("div",{style:{overflow:"visible",pointerEvents:"none",height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:s})})},Q=t=>{if(typeof(t==null?void 0:t.ease)=="function")return t.ease;switch(t==null?void 0:t.easing){case"ease-in":case"accelerate":return X.Easing.in(X.Easing.cubic);case"ease-out":case"smooth":case"slowDown":return X.Easing.out(X.Easing.cubic);case"ease-in-out":case"natural":case"swing":return X.Easing.inOut(X.Easing.cubic);case"bounce":return X.Easing.bounce;case"elastic":return X.Easing.elastic(1);case"overshoot":case"impulse":return X.Easing.out(X.Easing.back(1.7));case"none":case"linear":default:return X.Easing.linear}},R=({children:t,currentWidth:f,currentHeight:s,frame:c,item:$,keyframeAnimations:o,durationInFrames:g})=>{var F,H;if(!o||!Array.isArray(o)||o.length===0)return w.jsx(w.Fragment,{children:t});const u=r=>{var j,D;return!!((j=r==null?void 0:r.property)!=null&&j.includes("maskReveal")||(D=r==null?void 0:r.id)!=null&&D.includes("maskReveal"))},p=r=>{var j,D;return!!((r==null?void 0:r.type)==="exit"||(j=r==null?void 0:r.property)!=null&&j.includes("Out")||(D=r==null?void 0:r.id)!=null&&D.includes("Out"))},n=o.find(r=>u(r)&&!p(r)),e=o.find(r=>u(r)&&p(r));if(!n&&!e)return w.jsx(w.Fragment,{children:t});const a=Math.max(1,g||300);let l=null,d=!1,S=30,A=0;if(e){const r=Math.max(1,Number(e.durationInFrames||30)),j=Math.max(0,Number(e.delay||0)),D=Math.max(0,a-r-j);c>=D&&(l=e,d=!0,S=r,A=c-D)}if(!l&&n){l=n,d=!1,S=Math.max(1,Number(n.durationInFrames||30));const r=Math.max(0,Number(n.delay||0));A=c-r}if(!l)return w.jsx(w.Fragment,{children:t});const x=n?Math.max(0,Number(n.delay||0)):0,E=n?Math.max(1,Number(n.durationInFrames||30)):30;if(!d&&n&&c>=x+E)return w.jsx("div",{style:{width:"100%",height:"100%",position:"relative",overflow:"visible"},children:t});if(!d&&n&&c<x)return w.jsx("div",{style:{width:"100%",height:"100%",position:"relative",visibility:"hidden"},children:t});const O=Math.max(0,A),M=Math.min(Math.max(0,O/S),1),C=Q(l),i=Math.max(0,Math.min(1,C(M))),N=String(l.property||l.id||""),m=((F=l.details)==null?void 0:F.direction)||"up",_=N.includes("ShrinkScale"),B=N.includes("CenterScale"),L=N.includes("Slide")||N.includes("slide");let b,h="";if(B){const r=d?50*i:50*(1-i);b=`inset(
|
|
2
|
-
${
|
|
1
|
+
(function(M,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("react/jsx-runtime"),require("react"),require("remotion")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","remotion"],x):(M=typeof globalThis<"u"?globalThis:M||self,x(M.animations={},M.jsxRuntime,M.React,M.remotion))})(this,function(M,x,P,w){"use strict";const z=()=>({scale:t=>({transform:`scale(${t})`}),growIn:t=>({transform:`scale(${t})`}),shrinkIn:t=>({transform:`scale(${t})`}),shrinkOut:t=>({transform:`scale(${t})`}),opacity:t=>({opacity:t}),translateX:t=>({transform:`translateX(${t}%)`}),translateY:t=>({transform:`translateY(${t}%)`}),rotate:t=>({transform:`rotate(${t}deg)`}),spin:t=>({transform:`rotate(${t}deg)`}),spinIn:t=>({transform:`rotate(${t}deg)`}),twistIn:t=>({transform:`rotate(${t}deg)`}),twistOut:t=>({transform:`rotate(${t}deg)`}),moveScaleIn:t=>({transform:`scale(${t})`}),spinOut:t=>({transform:`rotate(${t}deg)`}),default:()=>({}),rotateY:t=>({transform:`rotateY(${t}deg)`}),rotateX:t=>({transform:`rotateX(${t}deg)`}),blur:t=>({filter:`blur(${t}px)`}),blurIn:t=>({filter:`blur(${t}px)`}),blurOut:t=>({filter:`blur(${t}px)`}),blurV2In:t=>({filter:`blur(${t}px)`}),blurSlide:t=>({filter:`blur(${t}px)`,transform:`translateY(${t*5}%)`}),blurSlideV2In:t=>({filter:`blur(${t}px)`}),brightness:t=>({filter:`brightness(${t}%)`}),contrast:t=>({filter:`contrast(${t}%)`}),grayscale:t=>({filter:`grayscale(${t}%)`}),hue:t=>({filter:`hue-rotate(${t}deg)`}),saturation:t=>({filter:`saturate(${t}%)`}),vignette:t=>({filter:`contrast(${100+t*20}%) brightness(${100-t*20}%)`}),noise:t=>({filter:`contrast(${100+t*40}%) brightness(${100+t*20}%)`}),pixelate:t=>({filter:`contrast(${100+t*2}%)`}),chromaticAberration:t=>({filter:`hue-rotate(${t*10}deg) contrast(110%)`}),lightLeak:t=>({filter:`brightness(${100+t*50}%) saturate(${100+t*30}%)`}),duotone:t=>({filter:`sepia(${t*100}%) hue-rotate(${t*180}deg)`}),shakeHorizontalIn:t=>({transform:`translateX(${t}px)`}),shakeVerticalIn:t=>({transform:`translateY(${t}px)`}),shakeHorizontalOut:t=>({transform:`translateX(${t}px)`}),shakeVerticalOut:t=>({transform:`translateY(${t}px)`}),maskUpIn:t=>({transform:`translateY(${t}px)`,overflow:"hidden"}),maskUpOut:t=>({transform:`translateY(${t}px)`,overflow:"hidden"}),maskDownIn:t=>({transform:`translateY(${t}px)`,overflow:"hidden"}),maskDownOut:t=>({transform:`translateY(${t}px)`,overflow:"hidden"}),moveTranslateY:t=>({transform:`translateY(${t}%)`}),"hide-show":t=>({opacity:t}),hide:t=>({opacity:t}),show:t=>({opacity:t}),borderRadius:t=>({borderRadius:`${t}px`,overflow:"hidden"}),"corner-radius":t=>({borderRadius:`${t}px`,overflow:"hidden"})}),Z=(t,i=0)=>{const e=[],r=t/5;for(let l=0;l<6;l+=1)e.push(l*r+i);return e},O=(t,i,e,r=!1)=>{const{from:l,to:o,ease:$}=i,p=i.durationInFrames||30,d=Number(l),a=Number(o),n=Math.max(1,Number(p));if(isNaN(d)||isNaN(a))return console.error("Invalid animation values:",{from:l,to:o,animationDurationInFrames:p,property:i.property}),d;p===void 0&&console.warn(`durationInFrames is undefined for animation: ${i.property}. Using 1 frame as default.`);const c=i.delay||0;if(i.property==="hide-show"||i.property==="hide"||i.property==="show")return t<c?d:a;let g;if(i.property==="moveScaleIn"?g=r?[e-n-c,e-n*.5-c]:[c+n*.5,c+n]:i.property==="moveTranslateY"?g=r?[e-n*.5-c,e-c]:[c,c+n*.5]:g=r?[e-n-c,e-c]:[c,c+n],i.property.includes("shake")){const b=r?Z(n,e-n-c):Z(n,c);return w.interpolate(t,b,[0,d,a,d,a,0],{extrapolateLeft:"clamp",extrapolateRight:"clamp",easing:$})}return w.interpolate(t,g,[d,a],{extrapolateLeft:"clamp",extrapolateRight:"clamp",easing:$})},H=t=>{if(t==null)return 0;if(typeof t=="number")return Number.isNaN(t)?0:t;if(typeof t=="object"){if(t.rotate!==void 0&&t.rotate!==null){const l=parseFloat(String(t.rotate));if(!Number.isNaN(l))return l}if(t.rotation!==void 0&&t.rotation!==null){const l=parseFloat(String(t.rotation));if(!Number.isNaN(l))return l}return t.transform?H(t.transform):0}const i=String(t),e=/rotate\((-?[\d.]+)deg\)/.exec(i);if(e)return parseFloat(e[1])||0;const r=/matrix\(([^)]+)\)/.exec(i);if(r){const l=r[1].split(",").map(o=>parseFloat(o.trim()));if(l.length>=4){const[o,$]=l;return Math.atan2($,o)*(180/Math.PI)}}return 0},q=(t,i,e,r,l)=>{var d,a,n,c,g;const{property:o}=t;if(o==="move"){const b=Number(((d=t.details)==null?void 0:d.fromX)??t.from??0),Y=Number(((a=t.details)==null?void 0:a.toX)??t.to??0),E=Number(((n=t.details)==null?void 0:n.fromY)??0),X=Number(((c=t.details)==null?void 0:c.toY)??0),L=Number(((g=t.details)==null?void 0:g.scale)||1)||1;let I=l;if(I==null||Number.isNaN(I)){const A=t.details;I=H((A==null?void 0:A.rotate)??(A==null?void 0:A.rotation)??(A==null?void 0:A.transform))}const j=t.delay||0,k=t.durationInFrames||30,u=r?[e-k-j,e-j]:[j,j+k],y=w.interpolate(i,u,[b,Y],{extrapolateLeft:"clamp",extrapolateRight:"clamp",easing:t.ease}),f=w.interpolate(i,u,[E,X],{extrapolateLeft:"clamp",extrapolateRight:"clamp",easing:t.ease}),v=(I||0)*Math.PI/180,m=Math.cos(v),N=Math.sin(v),h=y*m+f*N,S=-y*N+f*m,R=h/L,C=S/L;return{transform:`translateX(${R}px) translateY(${C}px)`}}const $=O(i,t,e,r),p=z();return(p[o]||p.default)($)},B=(t,i,e,r=!1,l=!1,o)=>P.useMemo(()=>{if(t.length===0)return{};const $=t.filter(p=>p.from!==void 0&&p.to!==void 0);if($.length!==t.length&&console.error("Some animations are invalid and will be ignored"),l){const p=[];return $.reverse().forEach(a=>{const n=q(a,e,i,!1,o);p.push(n)}),p.reduce((a,n)=>(Object.keys(n).forEach(c=>{c==="transform"||c==="filter"?a[c]=a[c]?`${a[c]} ${n[c]}`:n[c]:a[c]=n[c]}),a),{})}else return $.map(d=>q(d,e,i,r,o)).reduce((d,a)=>(Object.keys(a).forEach(n=>{n==="transform"||n==="filter"?d[n]=d[n]?`${d[n]} ${a[n]}`:a[n]:d[n]=a[n]}),d),{})},[t,e,i,r,o]),F=t=>t?Array.isArray(t)?t:[t]:[],D=(...t)=>{const i=[];return t.forEach(e=>{Array.isArray(e)?i.push(...e):e&&i.push(e)}),i.filter(e=>e!==void 0).reduce((e,r)=>e.find(o=>o.property===r.property)?e.map(o=>o.property===r.property?{...o,from:Math.min(o.from,r.from),to:Math.max(o.to,r.to),durationInFrames:Math.max(o.durationInFrames,r.durationInFrames),delay:Math.min(o.delay||0,r.delay||0),ease:$=>(o.ease($)+r.ease($))/2}:o):[...e,r],[])},G=({animationIn:t,animationOut:i,durationInFrames:e,children:r,style:l={},frame:o,isTransition:$=!1,basicCharAnimationsIn:p=[],basicCharAnimationsOut:d=[]})=>{const a=H((l==null?void 0:l.transform)||(l==null?void 0:l.rotate)||(l==null?void 0:l.rotation)),n=B(F(t),e,o,!1,!1,a),c=B(F(i),e,o,!0,!1,a),g=B(F(p),e,o,!0,!1,a),b=B(F(d),e,o,!0,!1,a),Y=P.useMemo(()=>{const f=Object.keys(n).length>0,v=t==null?void 0:t.reduce((N,h)=>Math.min(N,h.delay||0),1/0),m=o-(v||0);return f&&m<0?{visibility:$?"visible":"hidden"}:n},[n,o,t,$]),E=P.useMemo(()=>{if(o>e)return{visibility:$?"visible":"hidden"};const f=F(i);if(!f||f.length===0)return{};let v=0;f.forEach(N=>{const h=(N.durationInFrames||0)+(N.delay||0);h>v&&(v=h)});const m=Math.max(0,e-v);return o<m?{}:c},[c,o,i,e,$]),X=P.useMemo(()=>{const f={...Y};return Object.entries(E).forEach(([v,m])=>{v==="transform"?f[v]=`${f[v]||""} ${m||""}`.trim():v in f&&typeof f[v]=="number"&&typeof m=="number"?f[v]=f[v]*m:f[v]=m}),f},[Y,E]),L=P.useMemo(()=>{const f=X.transform||"",{translateX:v,translateY:m,scale:N,rotation:h,rotateX:S,rotateY:R,rotateZ:C}=U(f);return`${h} ${v} ${m} ${N} ${S} ${R} ${C}`.trim()},[X]),{top:I,left:j,position:k,transform:u,...y}=l||{};return x.jsx("div",{style:{width:"100%",height:"100%",overflow:X.overflow||g.overflow||b.overflow||"visible",pointerEvents:"none"},children:x.jsx("div",{style:{width:"100%",height:"100%",...y,...X,overflow:"visible",transform:L,pointerEvents:"none",background:Object.keys(X).length===0?"transparent":X.backgroundColor},children:r})})},U=t=>{let i="",e="",r="scale(1)",l="",o="",$="",p="";const d=t.match(/translateX\([^)]+\)/g);d&&(i=d[d.length-1]);const a=t.match(/translateY\([^)]+\)/g);a&&(e=a[a.length-1]);const n=t.match(/scale\([^)]+\)/g);n&&(r=n[n.length-1]);const c=t.match(/rotate\([^)]+\)/g);c&&(l=c[c.length-1]);const g=t.match(/rotateX\([^)]+\)/g);g&&(o=g[g.length-1]);const b=t.match(/rotateY\([^)]+\)/g);b&&($=b[b.length-1]);const Y=t.match(/rotateZ\([^)]+\)/g);return Y&&(p=Y[Y.length-1]),{translateX:i,translateY:e,scale:r,rotation:l,rotateX:o,rotateY:$,rotateZ:p}},J=({animationTimed:t,durationInFrames:i,children:e,style:r={},frame:l})=>{const o=H((r==null?void 0:r.transform)||(r==null?void 0:r.rotate)||(r==null?void 0:r.rotation)),$=B(F(t),i,l,!1,!0,o),p=P.useMemo(()=>({...$}),[$]),d=!!p.borderRadius;return x.jsx("div",{style:{overflow:d?"hidden":p.overflow||"visible",borderRadius:p.borderRadius,pointerEvents:"none",height:r.height||"100%",width:r.width||"100%",...p,...d?{overflow:"hidden"}:{}},children:x.jsx("div",{style:{overflow:d?"hidden":"visible",borderRadius:p.borderRadius,pointerEvents:"none",height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:e})})},K=t=>{if(typeof(t==null?void 0:t.ease)=="function")return t.ease;switch(t==null?void 0:t.easing){case"ease-in":case"accelerate":return w.Easing.in(w.Easing.cubic);case"ease-out":case"smooth":case"slowDown":return w.Easing.out(w.Easing.cubic);case"ease-in-out":case"natural":case"swing":return w.Easing.inOut(w.Easing.cubic);case"bounce":return w.Easing.bounce;case"elastic":return w.Easing.elastic(1);case"overshoot":case"impulse":return w.Easing.out(w.Easing.back(1.7));case"none":case"linear":default:return w.Easing.linear}},Q=({children:t,currentWidth:i,currentHeight:e,frame:r,item:l,keyframeAnimations:o,durationInFrames:$})=>{var W,_;if(!o||!Array.isArray(o)||o.length===0)return x.jsx(x.Fragment,{children:t});const p=s=>{var V,T;return!!((V=s==null?void 0:s.property)!=null&&V.includes("maskReveal")||(T=s==null?void 0:s.id)!=null&&T.includes("maskReveal"))},d=s=>{var V,T;return!!((s==null?void 0:s.type)==="exit"||(V=s==null?void 0:s.property)!=null&&V.includes("Out")||(T=s==null?void 0:s.id)!=null&&T.includes("Out"))},a=o.find(s=>p(s)&&!d(s)),n=o.find(s=>p(s)&&d(s));if(!a&&!n)return x.jsx(x.Fragment,{children:t});const c=Math.max(1,$||300);let g=null,b=!1,Y=30,E=0;if(n){const s=Math.max(1,Number(n.durationInFrames||30)),V=Math.max(0,Number(n.delay||0)),T=Math.max(0,c-s-V);r>=T&&(g=n,b=!0,Y=s,E=r-T)}if(!g&&a){g=a,b=!1,Y=Math.max(1,Number(a.durationInFrames||30));const s=Math.max(0,Number(a.delay||0));E=r-s}if(!g)return x.jsx(x.Fragment,{children:t});const X=a?Math.max(0,Number(a.delay||0)):0,L=a?Math.max(1,Number(a.durationInFrames||30)):30;if(!b&&a&&r>=X+L)return x.jsx("div",{style:{width:"100%",height:"100%",position:"relative",overflow:"visible"},children:t});if(!b&&a&&r<X)return x.jsx("div",{style:{width:"100%",height:"100%",position:"relative",visibility:"hidden"},children:t});const I=Math.max(0,E),j=Math.min(Math.max(0,I/Y),1),k=K(g),u=Math.max(0,Math.min(1,k(j))),y=String(g.property||g.id||""),f=((W=g.details)==null?void 0:W.direction)||"up",v=y.includes("ShrinkScale"),m=y.includes("CenterScale"),N=y.includes("Slide")||y.includes("slide");let h,S="";if(m){const s=b?50*u:50*(1-u);h=`inset(
|
|
2
|
+
${s}%
|
|
3
3
|
0%
|
|
4
|
-
${
|
|
4
|
+
${s}%
|
|
5
5
|
0%
|
|
6
|
-
)`}else if(
|
|
7
|
-
${
|
|
8
|
-
${
|
|
9
|
-
${
|
|
10
|
-
${
|
|
11
|
-
)`}else if(
|
|
6
|
+
)`}else if(v){const s=b?25*u:25*(1-u);h=`inset(
|
|
7
|
+
${s}%
|
|
8
|
+
${s}%
|
|
9
|
+
${s}%
|
|
10
|
+
${s}%
|
|
11
|
+
)`}else if(N)h="inset(0% 0% 0% 0%)",b?f==="down"?S=`translateY(${100*u}%)`:f==="left"?S=`translateX(${-100*u}%)`:f==="right"?S=`translateX(${100*u}%)`:S=`translateY(${-100*u}%)`:f==="down"?S=`translateY(${-100*(1-u)}%)`:f==="left"?S=`translateX(${100*(1-u)}%)`:f==="right"?S=`translateX(${-100*(1-u)}%)`:S=`translateY(${100*(1-u)}%)`;else if(y.includes("Center"))h=`circle(${b?150*(1-u):150*u}% at 50% 50%)`;else if(y.includes("Corner")){const s=b?u:1-u;f==="down"?h=`inset(0 ${100*s}% ${100*s}% 0)`:f==="up"?h=`inset(${100*s}% ${100*s}% 0 0)`:f==="left"?h=`inset(0 0 ${100*s}% ${100*s}%)`:f==="right"?h=`inset(${100*s}% 0 0 ${100*s}%)`:h=`inset(0 ${100*s}% ${100*s}% 0)`}else b?f==="down"?h=`inset(${100*u}% 0 0 0)`:f==="left"?h=`inset(0 ${100*u}% 0 0)`:f==="right"?h=`inset(0 0 0 ${100*u}%)`:h=`inset(0 0 ${100*u}% 0)`:f==="down"?h=`inset(0 0 ${100*(1-u)}% 0)`:f==="left"?h=`inset(0 0 0 ${100*(1-u)}%)`:f==="right"?h=`inset(0 ${100*(1-u)}% 0 0)`:h=`inset(${100*(1-u)}% 0 0 0)`;const R=!!((_=g==null?void 0:g.details)!=null&&_.scale||g!=null&&g.scale);let C=1;m||v?C=b?1+.5*u:1.5-.5*u:R&&(C=b?1-.2*u:.8+.2*u);const A=[S,`scale(${C})`].filter(Boolean).join(" ");return console.log("[MaskAnim] Rendering:",{propName:y,frame:r,localFrame:E,animDuration:Y,progress:j,easedProgress:u,isOut:b,isShrinkScale:v,isCenterScale:m,isSlide:N,direction:f,clipPath:h,translateTransform:S,isScale:R,scaleValue:C,innerTransform:A}),x.jsx("div",{style:{width:i!==void 0?i:"100%",height:e!==void 0?e:"100%",position:"relative",clipPath:h,WebkitClipPath:h,overflow:"hidden"},children:x.jsx("div",{style:{width:"100%",height:"100%",transform:A,transformOrigin:"center"},children:t})})};M.BoxAnim=G,M.ContentAnim=J,M.MaskAnim=Q,M.combine=D,M.combineAnimations=F,M.extractTransformations=U,M.useAnimation=B,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"})});
|
package/dist/use-animation.d.ts
CHANGED
|
@@ -9,6 +9,11 @@ export interface Animation {
|
|
|
9
9
|
delay?: number;
|
|
10
10
|
persist?: boolean;
|
|
11
11
|
}
|
|
12
|
-
export declare const
|
|
12
|
+
export declare const extractRotationAngle: (transformOrDetails?: string | number | {
|
|
13
|
+
rotate?: any;
|
|
14
|
+
rotation?: any;
|
|
15
|
+
transform?: string;
|
|
16
|
+
}) => number;
|
|
17
|
+
export declare const useAnimation: (animations: Animation[], durationInFrames: number, frame: number, isOut?: boolean, isTimed?: boolean, rotationAngle?: number) => React.CSSProperties;
|
|
13
18
|
export declare const combineAnimations: (animations: Animation | Animation[] | undefined) => Animation[];
|
|
14
19
|
export declare const combine: (...animations: (Animation | Animation[] | undefined)[]) => Animation[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cliquify.me/animations",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.14",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"typescript": "^5.3.3",
|
|
27
27
|
"vite": "^5.2.0",
|
|
28
28
|
"vite-plugin-dts": "^3.9.1",
|
|
29
|
-
"@cliquify.me/
|
|
30
|
-
"@cliquify.me/
|
|
29
|
+
"@cliquify.me/types": "8.0.13",
|
|
30
|
+
"@cliquify.me/typescript-config": "0.0.2"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"remotion": "4.0.506",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@designcombo/events": "^1.0.2",
|
|
39
39
|
"react": "^18.2.0 || ^19.0.0",
|
|
40
40
|
"remotion": "4.0.506",
|
|
41
|
-
"@cliquify.me/types": "8.0.
|
|
41
|
+
"@cliquify.me/types": "8.0.13"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"dev": "vite",
|