Some frontend fixes
Browse filesFiles changed (2)
7 unmodified lines89101112131424 unmodified lines3940414243444544464748495051525354555653 unmodified lines11011111210411311411510711611711811978 unmodified lines1981992001922012022032048 unmodified lines21321421520721621720921821922022122221422322422522657 unmodified lines2842852862782872882892902912927 unmodified lines const [error, setError] = useState(""); const [result, setResult] = useState(null); const [selectedFrameIndex, setSelectedFrameIndex] = useState(null); const [isModalClosing, setIsModalClosing] = useState(false); const fileInputRef = useRef(null);
const onFileChange = (e) => {24 unmodified lines
const handleFrameClick = (idx) => { if (!result || !result.frames || !result.frames.length) return; setIsModalClosing(false); setSelectedFrameIndex(idx); };
const closeFrameModal = () => setSelectedFrameIndex(null); const closeFrameModal = () => { if (selectedFrameIndex === null) return; setIsModalClosing(true); setTimeout(() => { setSelectedFrameIndex(null); setIsModalClosing(false); }, 200); };
const showPrevFrame = () => { if (!result || !result.frames || selectedFrameIndex === null) return;53 unmodified lines </header>
<main className="max-w-7xl mx-auto px-4 py-6 space-y-8 text-emerald-50"> <section className="grid gap-6 lg:grid-cols-[minmax(0,2fr)_minmax(0,1.4fr)] items-start animate-fade-in-up"> <section className="grid gap-6 lg:grid-cols-[minmax(0,2fr)_minmax(0,1.4fr)] items-stretch animate-fade-in-up max-w-5xl mx-auto"> <form onSubmit={onSubmit} className="w-full max-w-2xl bg-slate-950 border border-emerald-900 rounded-2xl p-6 md:p-7 shadow-md shadow-emerald-900/40 flex flex-col gap-5 items-stretch text-center md:text-left mx-auto" className="w-full bg-slate-950 border border-emerald-900 rounded-2xl p-6 md:p-7 shadow-md shadow-emerald-900/40 flex flex-col gap-5 items-stretch text-center md:text-left h-full" > <div className="flex items-center justify-between text-[11px] font-mono text-emerald-300/80"> <span className="uppercase tracking-[0.2em] text-emerald-400/80">Upload & analyze</span>78 unmodified lines </div> </form>
<div className="w-full max-w-md lg:max-w-none mx-auto bg-slate-950 border border-emerald-900 rounded-2xl p-5 shadow-md shadow-emerald-900/40 animate-fade-in-scale"> <div className="w-full bg-slate-950 border border-emerald-900 rounded-2xl p-5 shadow-md shadow-emerald-900/40 animate-fade-in-scale h-full flex flex-col justify-between"> <h2 className="text-lg font-semibold mb-2">Final conclusion</h2> <p className="text-sm text-emerald-200/80 mb-3">Overall confidence based on all faces found.</p> {result ? (8 unmodified lines <div className="space-y-3"> <div className="flex items-center justify-between text-xs font-mono text-emerald-200/80"> <span>{labelText} confidence</span> <span>{percent}%</span> <span>{isNaN(percent) ? '-' : `${percent}%`}</span> </div> <div className="flex items-end gap-4 h-24"> <div className="flex items-end gap-4 h-28"> <div className="flex-1 flex items-end justify-center"> <div className="h-full w-4 rounded-full bg-slate-800 overflow-hidden border border-slate-700"> <div className={`${barColor} w-full transition-all`} style={{ height: `${percent}%` }} style={{ height: `${Math.max(0, Math.min(100, isNaN(percent) ? 0 : percent))}%` }} /> </div> </div>57 unmodified lines return ( <div className="fixed inset-0 z-50 flex items-center justify-center bg-black/80 px-4" onClick={closeFrameModal}> <div className="max-w-4xl w-full bg-slate-950 border border-emerald-800 rounded-xl shadow-2xl shadow-emerald-900/60 p-4 md:p-5" className={`max-w-4xl w-full bg-slate-950 border border-emerald-800 rounded-xl shadow-2xl shadow-emerald-900/60 p-4 md:p-5 ${ isModalClosing ? 'animate-fade-out-scale' : 'animate-fade-in-scale' }`} onClick={(e) => e.stopPropagation()} > <div className="flex items-center justify-between mb-3">27 unmodified lines2829303132333435363738394041424327 unmodified lines '0%': { opacity: '0' }, '100%': { opacity: '1' }, }, fadeOutScale: { '0%': { opacity: '1', transform: 'scale(1)' }, '100%': { opacity: '0', transform: 'scale(0.96)' }, }, }, animation: { 'fade-in-up': 'fadeInUp 0.35s ease-out', 'fade-in-scale': 'fadeInScale 0.3s ease-out', 'fade-in': 'fadeIn 0.4s ease-out', 'fade-out-scale': 'fadeOutScale 0.2s ease-in', }, }, },frontend/pages/analyze.jsx+19-8
frontend/tailwind.config.js+5