@chao-component/bag-animation-ui 1.0.20 → 1.0.22
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 +5 -2
- package/dist/index.mjs +5 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -846,6 +846,9 @@ function BagAnimation({
|
|
|
846
846
|
}, [isAnimating]);
|
|
847
847
|
(0, import_react.useEffect)(() => {
|
|
848
848
|
if (!isAnimating || !canvasRef.current || !hasChances) {
|
|
849
|
+
if (!hasChances && isAnimating) {
|
|
850
|
+
setIsAnimating(false);
|
|
851
|
+
}
|
|
849
852
|
return;
|
|
850
853
|
}
|
|
851
854
|
const canvas = canvasRef.current;
|
|
@@ -1037,7 +1040,7 @@ function BagAnimation({
|
|
|
1037
1040
|
}
|
|
1038
1041
|
};
|
|
1039
1042
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `flex w-full relative justify-center items-center ${className}`, children: [
|
|
1040
|
-
!isAnimating && hasChances && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "absolute top-
|
|
1043
|
+
!isAnimating && hasChances && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "absolute top-4 left-[calc(50%-0px)] transform -translate-x-1/2 z-50 pointer-events-none", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-col items-center animate-bounce", children: [
|
|
1041
1044
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1042
1045
|
"p",
|
|
1043
1046
|
{
|
|
@@ -1169,7 +1172,7 @@ function BagAnimation({
|
|
|
1169
1172
|
onClick: () => {
|
|
1170
1173
|
setIsAnimating(true);
|
|
1171
1174
|
},
|
|
1172
|
-
className: "w-36 h-36 md:w-96 md:h-96 object-contain relative mt-
|
|
1175
|
+
className: "w-36 h-36 md:w-96 md:h-96 object-contain relative mt-24 z-10"
|
|
1173
1176
|
}
|
|
1174
1177
|
)
|
|
1175
1178
|
] }) });
|
package/dist/index.mjs
CHANGED
|
@@ -830,6 +830,9 @@ function BagAnimation({
|
|
|
830
830
|
}, [isAnimating]);
|
|
831
831
|
useEffect(() => {
|
|
832
832
|
if (!isAnimating || !canvasRef.current || !hasChances) {
|
|
833
|
+
if (!hasChances && isAnimating) {
|
|
834
|
+
setIsAnimating(false);
|
|
835
|
+
}
|
|
833
836
|
return;
|
|
834
837
|
}
|
|
835
838
|
const canvas = canvasRef.current;
|
|
@@ -1021,7 +1024,7 @@ function BagAnimation({
|
|
|
1021
1024
|
}
|
|
1022
1025
|
};
|
|
1023
1026
|
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("div", { className: `flex w-full relative justify-center items-center ${className}`, children: [
|
|
1024
|
-
!isAnimating && hasChances && /* @__PURE__ */ jsx("div", { className: "absolute top-
|
|
1027
|
+
!isAnimating && hasChances && /* @__PURE__ */ jsx("div", { className: "absolute top-4 left-[calc(50%-0px)] transform -translate-x-1/2 z-50 pointer-events-none", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center animate-bounce", children: [
|
|
1025
1028
|
/* @__PURE__ */ jsx(
|
|
1026
1029
|
"p",
|
|
1027
1030
|
{
|
|
@@ -1153,7 +1156,7 @@ function BagAnimation({
|
|
|
1153
1156
|
onClick: () => {
|
|
1154
1157
|
setIsAnimating(true);
|
|
1155
1158
|
},
|
|
1156
|
-
className: "w-36 h-36 md:w-96 md:h-96 object-contain relative mt-
|
|
1159
|
+
className: "w-36 h-36 md:w-96 md:h-96 object-contain relative mt-24 z-10"
|
|
1157
1160
|
}
|
|
1158
1161
|
)
|
|
1159
1162
|
] }) });
|