anim-3d-obj 2.0.9 → 2.0.11

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.js ADDED
@@ -0,0 +1,666 @@
1
+ import * as React from 'react';
2
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
+
4
+ // src/components/Obj.tsx
5
+
6
+ // src/keyframes.ts
7
+ function ensureStyleTag() {
8
+ let tag = document.getElementById(
9
+ "anim3d-keyframes"
10
+ );
11
+ if (!tag) {
12
+ tag = document.createElement("style");
13
+ tag.id = "anim3d-keyframes";
14
+ document.head.appendChild(tag);
15
+ }
16
+ return tag;
17
+ }
18
+ function inject(css) {
19
+ if (typeof document === "undefined") return;
20
+ const tag = ensureStyleTag();
21
+ tag.appendChild(document.createTextNode(css));
22
+ }
23
+ function builtInKeyframes(name, cfg) {
24
+ const hi = cfg.degreesHi ?? 15;
25
+ const lo = cfg.degreesLow ?? -15;
26
+ switch (name) {
27
+ case "Y360":
28
+ return `@keyframes Y360 { from { transform: rotateY(0deg) } to { transform: rotateY(360deg) } }`;
29
+ case "X360":
30
+ return `@keyframes X360 { from { transform: rotateX(0deg) } to { transform: rotateX(360deg) } }`;
31
+ case "Z360":
32
+ return `@keyframes Z360 { from { transform: rotateZ(0deg) } to { transform: rotateZ(360deg) } }`;
33
+ case "rockY":
34
+ return `@keyframes rockY { 0%{ transform: rotateY(${lo}deg) } 50%{ transform: rotateY(${hi}deg) } 100%{ transform: rotateY(${lo}deg) } }`;
35
+ case "rockX":
36
+ return `@keyframes rockX { 0%{ transform: rotateX(${lo}deg) } 50%{ transform: rotateX(${hi}deg) } 100%{ transform: rotateX(${lo}deg) } }`;
37
+ default:
38
+ return "";
39
+ }
40
+ }
41
+ function resolveAnimation(cfg) {
42
+ if (!cfg) return null;
43
+ const name = cfg.name;
44
+ const builtIn = builtInKeyframes(name, cfg);
45
+ if (builtIn) {
46
+ const marker = `/*kf-${name}*/`;
47
+ if (typeof document !== "undefined") {
48
+ const tag = ensureStyleTag();
49
+ if (!tag.innerHTML.includes(marker)) {
50
+ inject(`${builtIn}
51
+ ${marker}`);
52
+ }
53
+ }
54
+ return name;
55
+ }
56
+ return name;
57
+ }
58
+ function toAnimationShorthand(cfg) {
59
+ const name = resolveAnimation(cfg);
60
+ if (!cfg || !name) return null;
61
+ const dur = (cfg.duration ?? 10) + "s";
62
+ const delay = (cfg.delay ?? 0) + "s";
63
+ const iter = cfg.iterationCount ?? "infinite";
64
+ const dir = cfg.direction ?? "normal";
65
+ const timing = cfg.timing ?? "linear";
66
+ const fill = cfg.fillMode ?? "forwards";
67
+ const play = cfg.animationPlayState ?? "running";
68
+ return `${name} ${dur} ${timing} ${delay} ${iter} ${dir} ${fill} ${play}`;
69
+ }
70
+ function faceTransform3D(name, w, h, d) {
71
+ const hw = w / 2;
72
+ const hh = h / 2;
73
+ const hd = d / 2;
74
+ switch (name) {
75
+ case "front":
76
+ return `translate(-50%, -50%) translateZ(${hd}px)`;
77
+ case "back":
78
+ return `translate(-50%, -50%) rotateY(180deg) translateZ(${hd}px)`;
79
+ case "left":
80
+ return `translate(-50%, -50%) rotateY(-90deg) translateZ(${hw}px)`;
81
+ case "right":
82
+ return `translate(-50%, -50%) rotateY(90deg) translateZ(${hw}px)`;
83
+ case "top":
84
+ return `translate(-50%, -50%) rotateX(90deg) translateZ(${hh}px)`;
85
+ case "bottom":
86
+ return `translate(-50%, -50%) rotateX(-90deg) translateZ(${hh}px)`;
87
+ case "top_front":
88
+ return `translate(-50%, -50%) rotateX(45deg) translateZ(${hh}px)`;
89
+ case "top_rear":
90
+ return `translate(-50%, -50%) rotateX(135deg) translateZ(${hh}px)`;
91
+ case "bottom_front":
92
+ return `translate(-50%, -50%) rotateX(-45deg) translateZ(${hh}px)`;
93
+ case "bottom_rear":
94
+ return `translate(-50%, -50%) rotateX(-135deg) translateZ(${hh}px)`;
95
+ default:
96
+ return `translate(-50%, -50%) translateZ(${hd}px)`;
97
+ }
98
+ }
99
+ function faceTransformFlat(name, w, h, d) {
100
+ const total = 2 * w + 2 * d;
101
+ const half = total / 2;
102
+ let cx;
103
+ switch (name) {
104
+ case "front":
105
+ cx = w / 2;
106
+ break;
107
+ case "right":
108
+ cx = w + d / 2;
109
+ break;
110
+ case "back":
111
+ cx = w + d + w / 2;
112
+ break;
113
+ case "left":
114
+ cx = w + d + w + d / 2;
115
+ break;
116
+ case "top":
117
+ case "top_front":
118
+ case "top_rear":
119
+ cx = w / 2;
120
+ return `translate(-50%, -50%) translateX(${cx - half}px) translateY(-${h}px)`;
121
+ case "bottom":
122
+ case "bottom_front":
123
+ case "bottom_rear":
124
+ cx = w / 2;
125
+ return `translate(-50%, -50%) translateX(${cx - half}px) translateY(${h}px)`;
126
+ default:
127
+ cx = w / 2;
128
+ break;
129
+ }
130
+ return `translate(-50%, -50%) translateX(${cx - half}px)`;
131
+ }
132
+ function parseCssText(css) {
133
+ if (!css) return {};
134
+ const style = {};
135
+ css.split(";").forEach((rule) => {
136
+ const [prop, ...rest] = rule.split(":");
137
+ if (!prop || rest.length === 0) return;
138
+ const key = prop.trim().replace(/-([a-z])/g, (_, c) => c.toUpperCase());
139
+ style[key] = rest.join(":").trim();
140
+ });
141
+ return style;
142
+ }
143
+ function faceDimensions(name, w, h, d) {
144
+ switch (name) {
145
+ case "left":
146
+ case "right":
147
+ return { width: d, height: h };
148
+ case "top":
149
+ case "bottom":
150
+ case "top_front":
151
+ case "top_rear":
152
+ case "bottom_front":
153
+ case "bottom_rear":
154
+ return { width: w, height: d };
155
+ default:
156
+ return { width: w, height: h };
157
+ }
158
+ }
159
+ function faceAppearance(face, globalDef) {
160
+ const globalStyle = parseCssText(globalDef?.css);
161
+ const faceInlineStyle = parseCssText(face.css);
162
+ const style = {
163
+ ...globalStyle,
164
+ ...globalDef?.style ?? {},
165
+ ...faceInlineStyle,
166
+ ...face.style ?? {}
167
+ };
168
+ const className = ["anim3d-face", face.className].filter(Boolean).join(" ");
169
+ const body = face.body ?? globalDef?.body ?? null;
170
+ return { style, className, body };
171
+ }
172
+ var DEFAULT_FACE_NAMES = [
173
+ "front",
174
+ "back",
175
+ "left",
176
+ "right",
177
+ "top",
178
+ "bottom"
179
+ ];
180
+ var STAGGER_ORDER = [
181
+ "front",
182
+ "right",
183
+ "back",
184
+ "left",
185
+ "top",
186
+ "bottom",
187
+ "top_front",
188
+ "top_rear",
189
+ "bottom_front",
190
+ "bottom_rear"
191
+ ];
192
+ var Obj = React.memo(
193
+ ({
194
+ width = 160,
195
+ height = 160,
196
+ depth = 150,
197
+ perspective = 600,
198
+ perspectiveOrigin = "50% 50%",
199
+ faces,
200
+ global: globalDef,
201
+ anim1,
202
+ anim2,
203
+ showCenterDiv = false,
204
+ flat = false,
205
+ transitionDuration = 1,
206
+ oneAtATime = false,
207
+ remainJoined = false,
208
+ ytilt = false,
209
+ backfaceHidden = false,
210
+ chainEffects,
211
+ onChainComplete,
212
+ onChainReverseComplete,
213
+ className,
214
+ style
215
+ }) => {
216
+ const w = typeof width === "number" ? width : parseFloat(String(width));
217
+ const h = typeof height === "number" ? height : parseFloat(String(height));
218
+ const d = typeof depth === "number" ? depth : parseFloat(String(depth));
219
+ const animation1 = toAnimationShorthand(anim1) ?? void 0;
220
+ const animation2 = toAnimationShorthand(anim2) ?? void 0;
221
+ const [phase, setPhase] = React.useState(
222
+ flat ? "chained" : "folded"
223
+ );
224
+ const hasChain = Array.isArray(chainEffects) && chainEffects.length > 0;
225
+ const sideCountRef = React.useRef(0);
226
+ const chainDur = React.useMemo(() => {
227
+ if (!hasChain) return 0;
228
+ return Math.max(
229
+ 0,
230
+ ...chainEffects.map(
231
+ (e) => (e.duration ?? 0.5) + (e.delay ?? 0)
232
+ )
233
+ );
234
+ }, [chainEffects, hasChain]);
235
+ const prevFlatForChain = React.useRef(flat);
236
+ React.useEffect(() => {
237
+ if (flat === prevFlatForChain.current) return;
238
+ prevFlatForChain.current = flat;
239
+ if (flat) {
240
+ setPhase("unfolding");
241
+ } else {
242
+ if (hasChain && (phase === "chained" || phase === "chaining")) {
243
+ setPhase("unchaining");
244
+ } else {
245
+ setPhase("folding");
246
+ }
247
+ }
248
+ }, [flat]);
249
+ React.useEffect(() => {
250
+ let timer;
251
+ if (phase === "unfolding") {
252
+ const sideCount = sideCountRef.current;
253
+ const unfoldDur = oneAtATime ? transitionDuration * sideCount : transitionDuration;
254
+ timer = setTimeout(() => {
255
+ if (hasChain) {
256
+ setPhase("chaining");
257
+ } else {
258
+ setPhase("chained");
259
+ onChainComplete?.();
260
+ }
261
+ }, unfoldDur * 1e3 + 60);
262
+ }
263
+ if (phase === "chaining") {
264
+ timer = setTimeout(() => {
265
+ setPhase("chained");
266
+ onChainComplete?.();
267
+ }, chainDur * 1e3 + 60);
268
+ }
269
+ if (phase === "unchaining") {
270
+ timer = setTimeout(() => {
271
+ setPhase("folding");
272
+ }, chainDur * 1e3 + 60);
273
+ }
274
+ if (phase === "folding") {
275
+ const sideCount = sideCountRef.current;
276
+ const foldDur = oneAtATime ? transitionDuration * sideCount : transitionDuration;
277
+ timer = setTimeout(() => {
278
+ setPhase("folded");
279
+ onChainReverseComplete?.();
280
+ }, foldDur * 1e3 + 60);
281
+ }
282
+ return () => {
283
+ if (timer) clearTimeout(timer);
284
+ };
285
+ }, [
286
+ phase,
287
+ hasChain,
288
+ chainDur,
289
+ transitionDuration,
290
+ oneAtATime,
291
+ onChainComplete,
292
+ onChainReverseComplete
293
+ ]);
294
+ const isFlatNow = phase === "unfolding" || phase === "chaining" || phase === "chained" || phase === "unchaining";
295
+ const chainActive = phase === "chaining" || phase === "chained";
296
+ const chainMap = React.useMemo(() => {
297
+ const map = /* @__PURE__ */ new Map();
298
+ if (chainEffects) {
299
+ for (const e of chainEffects) {
300
+ map.set(e.faceName, e);
301
+ }
302
+ }
303
+ return map;
304
+ }, [chainEffects]);
305
+ const chainKeyframeCache = React.useRef(/* @__PURE__ */ new Map());
306
+ function getChainKeyframes(faceName, eff, baseTransform, reverse) {
307
+ const sx = eff.scaleX ?? 1;
308
+ const sy = eff.scaleY ?? 1;
309
+ const dir = reverse ? "rev" : "fwd";
310
+ const cacheKey = `${faceName}-${sx}-${sy}-${dir}-${baseTransform}`;
311
+ const cached = chainKeyframeCache.current.get(cacheKey);
312
+ if (cached) return cached;
313
+ const fromScale = reverse ? `scaleX(${sx}) scaleY(${sy})` : `scaleX(1) scaleY(1)`;
314
+ const toScale = reverse ? `scaleX(1) scaleY(1)` : `scaleX(${sx}) scaleY(${sy})`;
315
+ const name = `anim3d-chain-${faceName}-${dir}-${Date.now()}`;
316
+ let styleEl = document.getElementById("anim3d-chain-keyframes");
317
+ if (!styleEl) {
318
+ styleEl = document.createElement("style");
319
+ styleEl.id = "anim3d-chain-keyframes";
320
+ document.head.appendChild(styleEl);
321
+ }
322
+ styleEl.textContent += `
323
+ @keyframes ${name} {
324
+ from { transform: ${baseTransform} ${fromScale}; }
325
+ to { transform: ${baseTransform} ${toScale}; }
326
+ }
327
+ `;
328
+ chainKeyframeCache.current.set(cacheKey, name);
329
+ return name;
330
+ }
331
+ function chainStyle(faceName, baseTransform) {
332
+ const eff = chainMap.get(faceName);
333
+ if (!eff) return {};
334
+ const dur = eff.duration ?? 0.5;
335
+ const delay = eff.delay ?? 0;
336
+ const timing = eff.timing ?? "ease-in-out";
337
+ const styles = {};
338
+ const base = baseTransform ?? "";
339
+ const hasScale = eff.scaleX !== void 0 || eff.scaleY !== void 0;
340
+ if (hasScale) {
341
+ if (chainActive) {
342
+ const kfName = getChainKeyframes(faceName, eff, base, false);
343
+ styles.animation = `${kfName} ${dur}s ${timing} ${delay}s forwards`;
344
+ } else if (phase === "unchaining") {
345
+ const kfName = getChainKeyframes(faceName, eff, base, true);
346
+ styles.animation = `${kfName} ${dur}s ${timing} ${delay}s forwards`;
347
+ }
348
+ }
349
+ if (eff.background !== void 0) {
350
+ if (chainActive) {
351
+ styles.background = eff.background;
352
+ }
353
+ }
354
+ if (eff.opacity !== void 0) {
355
+ if (chainActive) {
356
+ styles.opacity = eff.opacity;
357
+ }
358
+ }
359
+ return styles;
360
+ }
361
+ const faceList = faces && faces.length > 0 ? faces : DEFAULT_FACE_NAMES.map((name) => ({ name }));
362
+ sideCountRef.current = faceList.filter(
363
+ (f) => ["front", "right", "back", "left"].includes(f.name)
364
+ ).length;
365
+ const bfv = backfaceHidden ? "hidden" : "visible";
366
+ const transitionCss = (delay = 0) => `transform ${transitionDuration}s ease-in-out ${delay}s`;
367
+ const tiltCount = React.useRef(0);
368
+ const prevFlat = React.useRef(flat);
369
+ const [tiltAnim, setTiltAnim] = React.useState(void 0);
370
+ React.useEffect(() => {
371
+ if (flat !== prevFlat.current) {
372
+ prevFlat.current = flat;
373
+ if (ytilt) {
374
+ tiltCount.current += 1;
375
+ const sideCount = faceList.filter(
376
+ (f) => ["front", "right", "back", "left"].includes(
377
+ f.name
378
+ )
379
+ ).length;
380
+ const totalDur = oneAtATime ? transitionDuration * sideCount : transitionDuration;
381
+ const name = tiltCount.current % 2 === 0 ? "anim3d-ytilt-a" : "anim3d-ytilt-b";
382
+ setTiltAnim(
383
+ `${name} ${totalDur}s ease-in-out 1 forwards`
384
+ );
385
+ const timer = setTimeout(
386
+ () => setTiltAnim(void 0),
387
+ totalDur * 1e3 + 50
388
+ );
389
+ return () => clearTimeout(timer);
390
+ }
391
+ }
392
+ }, [flat, ytilt, transitionDuration, oneAtATime, faceList]);
393
+ const renderStandard = () => faceList.map((face, i) => {
394
+ const dims = faceDimensions(face.name, w, h, d);
395
+ const baseTransform = isFlatNow ? faceTransformFlat(face.name, w, h, d) : faceTransform3D(face.name, w, h, d);
396
+ const {
397
+ style: fStyle,
398
+ className: fCls,
399
+ body
400
+ } = faceAppearance(face, globalDef);
401
+ const idx = STAGGER_ORDER.indexOf(face.name);
402
+ const delay = oneAtATime ? (idx >= 0 ? idx : i) * transitionDuration : 0;
403
+ const cStyle = chainStyle(face.name, baseTransform);
404
+ const foldTransition = transitionCss(delay);
405
+ return /* @__PURE__ */ jsx(
406
+ "div",
407
+ {
408
+ className: fCls,
409
+ style: {
410
+ ...fStyle,
411
+ ...cStyle,
412
+ width: dims.width,
413
+ height: dims.height,
414
+ transform: baseTransform,
415
+ transition: foldTransition,
416
+ backfaceVisibility: bfv
417
+ },
418
+ children: body
419
+ },
420
+ face.name + "-" + i
421
+ );
422
+ });
423
+ const renderJoined = () => {
424
+ const findFace = (n) => faceList.find((f) => f.name === n);
425
+ const frontFace = findFace("front");
426
+ const rightFace = findFace("right");
427
+ const backFace = findFace("back");
428
+ const leftFace = findFace("left");
429
+ const sideNames = /* @__PURE__ */ new Set([
430
+ "front",
431
+ "right",
432
+ "back",
433
+ "left"
434
+ ]);
435
+ const otherFaces = faceList.filter(
436
+ (f) => !sideNames.has(f.name)
437
+ );
438
+ const step = oneAtATime ? transitionDuration : 0;
439
+ const renderFaceEl = (face, dims, extra, key) => {
440
+ if (!face) return null;
441
+ const {
442
+ style: fStyle,
443
+ className: fCls,
444
+ body
445
+ } = faceAppearance(face, globalDef);
446
+ const baseTransform = extra.transform ?? "";
447
+ const cStyle = chainStyle(face.name, baseTransform);
448
+ const eff = chainMap.get(face.name);
449
+ const hasChainAnim = !!cStyle.animation;
450
+ let chainOrigin;
451
+ if (hasChainAnim && eff) {
452
+ const xOrigin = remainJoined && isFlatNow ? "left" : "center";
453
+ const yOrigin = eff.keepAligned ?? "center";
454
+ chainOrigin = `${xOrigin} ${yOrigin}`;
455
+ }
456
+ return /* @__PURE__ */ jsx(
457
+ "div",
458
+ {
459
+ className: fCls,
460
+ style: {
461
+ ...fStyle,
462
+ ...cStyle,
463
+ width: dims.width,
464
+ height: dims.height,
465
+ display: "flex",
466
+ alignItems: "center",
467
+ justifyContent: "center",
468
+ boxSizing: "border-box",
469
+ backfaceVisibility: bfv,
470
+ ...extra,
471
+ ...chainOrigin ? { transformOrigin: chainOrigin } : {}
472
+ },
473
+ children: body
474
+ },
475
+ key
476
+ );
477
+ };
478
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
479
+ renderFaceEl(
480
+ frontFace,
481
+ { width: w, height: h },
482
+ {
483
+ position: "absolute",
484
+ left: "50%",
485
+ top: "50%",
486
+ transform: isFlatNow ? "translate(-50%, -50%)" : `translate(-50%, -50%) translateZ(${d / 2}px)`,
487
+ transition: transitionCss(0)
488
+ },
489
+ "front-j"
490
+ ),
491
+ /* @__PURE__ */ jsxs(
492
+ "div",
493
+ {
494
+ style: {
495
+ position: "absolute",
496
+ left: `calc(50% + ${w / 2}px)`,
497
+ top: "50%",
498
+ width: 0,
499
+ height: 0,
500
+ transformOrigin: "0 0",
501
+ transformStyle: "preserve-3d",
502
+ transform: isFlatNow ? "none" : `translateZ(${d / 2}px) rotateY(90deg)`,
503
+ transition: transitionCss(step)
504
+ },
505
+ children: [
506
+ renderFaceEl(
507
+ rightFace,
508
+ { width: d, height: h },
509
+ {
510
+ position: "absolute",
511
+ left: 0,
512
+ top: 0,
513
+ transform: "translateY(-50%)"
514
+ },
515
+ "right-j"
516
+ ),
517
+ /* @__PURE__ */ jsxs(
518
+ "div",
519
+ {
520
+ style: {
521
+ position: "absolute",
522
+ left: d,
523
+ top: 0,
524
+ width: 0,
525
+ height: 0,
526
+ transformOrigin: "0 0",
527
+ transformStyle: "preserve-3d",
528
+ transform: isFlatNow ? "none" : "rotateY(90deg)",
529
+ transition: transitionCss(step * 2)
530
+ },
531
+ children: [
532
+ renderFaceEl(
533
+ backFace,
534
+ { width: w, height: h },
535
+ {
536
+ position: "absolute",
537
+ left: 0,
538
+ top: 0,
539
+ transform: "translateY(-50%)"
540
+ },
541
+ "back-j"
542
+ ),
543
+ /* @__PURE__ */ jsx(
544
+ "div",
545
+ {
546
+ style: {
547
+ position: "absolute",
548
+ left: w,
549
+ top: 0,
550
+ width: 0,
551
+ height: 0,
552
+ transformOrigin: "0 0",
553
+ transformStyle: "preserve-3d",
554
+ transform: isFlatNow ? "none" : "rotateY(90deg)",
555
+ transition: transitionCss(step * 3)
556
+ },
557
+ children: renderFaceEl(
558
+ leftFace,
559
+ { width: d, height: h },
560
+ {
561
+ position: "absolute",
562
+ left: 0,
563
+ top: 0,
564
+ transform: "translateY(-50%)"
565
+ },
566
+ "left-j"
567
+ )
568
+ }
569
+ )
570
+ ]
571
+ }
572
+ )
573
+ ]
574
+ }
575
+ ),
576
+ otherFaces.map((face, i) => {
577
+ const dims = faceDimensions(face.name, w, h, d);
578
+ const xform = isFlatNow ? faceTransformFlat(face.name, w, h, d) : faceTransform3D(face.name, w, h, d);
579
+ const {
580
+ style: fStyle,
581
+ className: fCls,
582
+ body
583
+ } = faceAppearance(face, globalDef);
584
+ return /* @__PURE__ */ jsx(
585
+ "div",
586
+ {
587
+ className: fCls,
588
+ style: {
589
+ ...fStyle,
590
+ width: dims.width,
591
+ height: dims.height,
592
+ transform: xform,
593
+ transition: transitionCss(0),
594
+ backfaceVisibility: bfv
595
+ },
596
+ children: body
597
+ },
598
+ face.name + "-o-" + i
599
+ );
600
+ })
601
+ ] });
602
+ };
603
+ const cssVars = {
604
+ "--obj-w": w + "px",
605
+ "--obj-h": h + "px",
606
+ "--obj-d": d + "px"
607
+ };
608
+ return /* @__PURE__ */ jsx(
609
+ "div",
610
+ {
611
+ className: ["anim3d-stage", className].filter(Boolean).join(" "),
612
+ style: {
613
+ perspective,
614
+ perspectiveOrigin,
615
+ ...cssVars,
616
+ ...style
617
+ },
618
+ "data-anim-3d-obj": true,
619
+ role: "img",
620
+ "aria-label": "3D object",
621
+ children: /* @__PURE__ */ jsx(
622
+ "div",
623
+ {
624
+ style: {
625
+ transformStyle: "preserve-3d",
626
+ animation: tiltAnim
627
+ },
628
+ children: /* @__PURE__ */ jsx(
629
+ "div",
630
+ {
631
+ className: "anim3d-wrapper",
632
+ style: {
633
+ ...cssVars,
634
+ animation: isFlatNow ? "none" : animation1,
635
+ transformStyle: "preserve-3d",
636
+ transition: transitionCss()
637
+ },
638
+ children: /* @__PURE__ */ jsxs(
639
+ "div",
640
+ {
641
+ className: "anim3d-wrapper",
642
+ style: {
643
+ ...cssVars,
644
+ animation: isFlatNow ? "none" : animation2,
645
+ transformStyle: "preserve-3d",
646
+ transition: transitionCss()
647
+ },
648
+ children: [
649
+ showCenterDiv && /* @__PURE__ */ jsx("div", { className: "anim3d-center" }),
650
+ remainJoined ? renderJoined() : renderStandard()
651
+ ]
652
+ }
653
+ )
654
+ }
655
+ )
656
+ }
657
+ )
658
+ }
659
+ );
660
+ }
661
+ );
662
+ Obj.displayName = "Obj";
663
+
664
+ export { Obj, Obj as default, resolveAnimation, toAnimationShorthand };
665
+ //# sourceMappingURL=index.js.map
666
+ //# sourceMappingURL=index.js.map