aditya-rAj19 commited on
Commit
afbdbab
·
1 Parent(s): ca509be

Redesign loading tab: friendly messages (no internal pipeline jargon) + spinner/percentage

Browse files
Files changed (1) hide show
  1. frontend/src/pages/AppPage.jsx +19 -7
frontend/src/pages/AppPage.jsx CHANGED
@@ -28,12 +28,19 @@ function Toast({ msg, onClose }) {
28
  /* Progress bar */
29
  function ProgressBar({ pct, label }) {
30
  return (
31
- <div className="bg-white border border-border shadow-sm rounded-xl p-4 sm:p-5 flex flex-col gap-3">
32
- <div className="h-1.5 bg-bg3 rounded-full overflow-hidden">
33
- <motion.div className="h-full rounded-full bg-teal"
 
 
 
 
 
 
 
34
  animate={{ width: `${pct}%` }} transition={{ duration: 0.35 }} />
35
  </div>
36
- <p className="text-xs text-navy-light text-center font-medium">{label}</p>
37
  </div>
38
  );
39
  }
@@ -94,10 +101,15 @@ function ImagePreview({ file, b64, onClear, infoEl }) {
94
  );
95
  }
96
 
 
97
  const STAGES = [
98
- [10,'Detecting faces...'], [20,'Extracting landmarks...'], [35,'Segmenting hair and neck...'],
99
- [50,'Running deep swap model...'], [65,'Matching skin tones...'], [75,'Blending hair to neck...'],
100
- [85,'Applying Laplacian blend...'], [93,'Harmonising colours...'], [98,'Quality metrics...'],
 
 
 
 
101
  ];
102
 
103
 
 
28
  /* Progress bar */
29
  function ProgressBar({ pct, label }) {
30
  return (
31
+ <div className="bg-white border border-border/60 shadow-sm rounded-2xl p-5 sm:p-6 flex flex-col items-center gap-4">
32
+ <div className="flex items-center gap-3">
33
+ <svg className="w-5 h-5 text-teal animate-spin shrink-0" fill="none" viewBox="0 0 24 24">
34
+ <circle className="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" strokeWidth="4" />
35
+ <path className="opacity-90" fill="currentColor" d="M4 12a8 8 0 018-8v4a4 4 0 00-4 4z" />
36
+ </svg>
37
+ <span className="text-sm font-bold text-navy">{label}</span>
38
+ </div>
39
+ <div className="w-full h-2 bg-bg3 rounded-full overflow-hidden">
40
+ <motion.div className="h-full rounded-full bg-gradient-to-r from-teal to-teal-light"
41
  animate={{ width: `${pct}%` }} transition={{ duration: 0.35 }} />
42
  </div>
43
+ <span className="text-[11px] text-slate font-semibold tracking-wide">{Math.round(pct)}%</span>
44
  </div>
45
  );
46
  }
 
101
  );
102
  }
103
 
104
+ // Friendly, non-technical loading messages (no internal pipeline jargon).
105
  const STAGES = [
106
+ [12, 'Analysing your photo...'],
107
+ [28, 'Preparing your campus look...'],
108
+ [45, 'Placing you in the scene...'],
109
+ [62, 'Blending everything naturally...'],
110
+ [78, 'Enhancing the details...'],
111
+ [90, 'Adding the final touches...'],
112
+ [97, 'Almost ready...'],
113
  ];
114
 
115