@primestyleai/tryon 3.4.0 → 3.4.1
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/react/index.js +5 -2
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -246,6 +246,8 @@ function PrimeStyleTryonInner({
|
|
|
246
246
|
useEffect(() => {
|
|
247
247
|
if (view === "processing") {
|
|
248
248
|
progressRef.current = 0;
|
|
249
|
+
if (progressBarRef.current) progressBarRef.current.style.width = "0%";
|
|
250
|
+
if (progressTextRef.current) progressTextRef.current.textContent = "0%";
|
|
249
251
|
const statuses = [
|
|
250
252
|
{ at: 0, text: "Preparing your image..." },
|
|
251
253
|
{ at: 15, text: "Analyzing body proportions..." },
|
|
@@ -256,6 +258,7 @@ function PrimeStyleTryonInner({
|
|
|
256
258
|
];
|
|
257
259
|
const interval = setInterval(() => {
|
|
258
260
|
const p = progressRef.current;
|
|
261
|
+
if (p >= 100) return;
|
|
259
262
|
const increment = p < 30 ? 1.2 : p < 60 ? 0.8 : p < 80 ? 0.4 : p < 95 ? 0.15 : 0;
|
|
260
263
|
progressRef.current = Math.min(p + increment, 95);
|
|
261
264
|
const val = Math.round(progressRef.current);
|
|
@@ -985,7 +988,7 @@ function PrimeStyleTryonInner({
|
|
|
985
988
|
/* @__PURE__ */ jsx("div", { className: "ps-tryon-scan-overlay" })
|
|
986
989
|
] }),
|
|
987
990
|
/* @__PURE__ */ jsxs("div", { className: "ps-tryon-progress-section", children: [
|
|
988
|
-
/* @__PURE__ */ jsx("div", { className: "ps-tryon-progress-bar-wrap", children: /* @__PURE__ */ jsx("div", { ref: progressBarRef, className: "ps-tryon-progress-bar-fill"
|
|
991
|
+
/* @__PURE__ */ jsx("div", { className: "ps-tryon-progress-bar-wrap", children: /* @__PURE__ */ jsx("div", { ref: progressBarRef, className: "ps-tryon-progress-bar-fill" }) }),
|
|
989
992
|
/* @__PURE__ */ jsx("span", { ref: progressTextRef, className: "ps-tryon-progress-pct", children: "0%" })
|
|
990
993
|
] }),
|
|
991
994
|
/* @__PURE__ */ jsx("div", { ref: progressStatusRef, className: cx("ps-tryon-processing-text", cn.processingText), children: "Preparing your image..." }),
|
|
@@ -1499,7 +1502,7 @@ const STYLES = `
|
|
|
1499
1502
|
}
|
|
1500
1503
|
.ps-tryon-progress-bar-fill {
|
|
1501
1504
|
height: 100%; background: linear-gradient(90deg, #bb945c, #d6ba7d);
|
|
1502
|
-
border-radius: 3px; transition: width 0.3s ease;
|
|
1505
|
+
border-radius: 3px; transition: width 0.3s ease; width: 0%;
|
|
1503
1506
|
}
|
|
1504
1507
|
.ps-tryon-progress-pct {
|
|
1505
1508
|
font-size: 13px; font-weight: 700; color: #bb945c; min-width: 36px; text-align: right;
|