Extra UI Fix
Browse files99 unmodified lines1001011021031041051061071081091101111123 unmodified lines1161171181191201211221231241 unmodified line1261271281291301311327 unmodified lines14014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218399 unmodified lines</div></header><main className="max-w-7xl mx-auto px-4 py-6 space-y-6 text-emerald-50"><section className="grid lg:grid-cols-2 gap-6 items-start"><div className="space-y-4"><divonDrop={onDrop}onDragOver={onDragOver}className="bg-slate-950 border-dashed border-2 border-emerald-800 rounded-xl p-6 shadow-md shadow-emerald-900/40 flex flex-col items-center justify-center text-center cursor-pointer hover:border-emerald-500"onClick={() => fileInputRef.current?.click()}><input3 unmodified linesclassName="hidden"onChange={onFileChange}/>{videoFile && (<div className="w-full"><div className="flex items-center justify-between mb-2"><div className="text-sm text-emerald-50 truncate"><span className="font-medium">Selected:</span> {videoFile.name}<span className="ml-2 text-emerald-300/70">({Math.round(videoFile.size / 1024 / 1024)} MB)</span>1 unmodified line<buttontype="button"onClick={(e) => { e.stopPropagation(); setVideoFile(null); setResult(null); setError(""); }}className="text-sm text-blue-600 hover:underline">Change</button></div>{previewUrl && (7 unmodified lines)}</div><form onSubmit={onSubmit} className="bg-slate-950 border border-emerald-900 rounded-xl p-5 shadow-md shadow-emerald-900/40 flex flex-col gap-2"><div className="flex items-center gap-3 w-full"><buttontype="submit"disabled={loading || !videoFile}className="px-4 py-2 rounded bg-emerald-500 text-slate-950 disabled:opacity-50 inline-flex items-center gap-2 hover:bg-emerald-400">{loading && (<span className="inline-block h-4 w-4 border-2 border-white/50 border-t-white rounded-full animate-spin"></span>)}{loading ? "Processing..." : "Analyze Video"}</button>{loading && (<div className="flex-1 min-w-[120px]"><div className="h-1 w-full bg-slate-800 rounded-full overflow-hidden"><div className="h-full w-1/2 bg-gradient-to-r from-emerald-400 to-emerald-600 animate-pulse" /></div></div>)}</div><div className="flex flex-col gap-1">{error && <span className="text-red-400 text-sm">{error}</span>}{!videoFile && <span className="text-sm text-emerald-200/80">Select a video to start.</span>}{!loading && result && (<span className="text-xs text-emerald-300/80">Tip: click a frame to view it larger.</span>)}</div></form></div><div className="hidden lg:block" /></section>{result && (<section className="grid lg:grid-cols-2 gap-6 items-start animate-fade-in-up"><div className="bg-slate-950 border border-emerald-900 rounded-xl p-5 shadow-md shadow-emerald-900/40 animate-fade-in-scale"><div className="border-t border-gray-800 pt-3 max-h-[480px] overflow-y-auto"><h3 className="text-sm font-semibold mb-2">Frames & predictions</h3><FrameGridframes={result.frames}predictions={result.predictions}99 unmodified lines1001011021031041051061071081091101111121131141151161171181191201211221231243 unmodified lines1281291301311321331341351361371381391401411421431 unmodified line1451461471481491501517 unmodified lines15916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520699 unmodified lines</div></header><main className="max-w-7xl mx-auto px-4 py-6 space-y-8 text-emerald-50"><section className="flex justify-center"><formonSubmit={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"><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>{result && (<span className="px-2 py-0.5 rounded-full bg-emerald-500/10 border border-emerald-600/40 text-[10px]">Last run: {result.frames?.length || 0} frames</span>)}</div><divonDrop={onDrop}onDragOver={onDragOver}className="border-dashed border-2 border-emerald-800 rounded-xl p-6 flex flex-col items-center justify-center text-center cursor-pointer hover:border-emerald-500 bg-slate-950/60"onClick={() => fileInputRef.current?.click()}><input3 unmodified linesclassName="hidden"onChange={onFileChange}/>{!videoFile && (<><div className="text-5xl mb-2">🎥</div><p className="mt-1 font-medium">Drop a video here or click to choose</p><p className="text-xs text-emerald-200/80">MP4 recommended · we sample about 20 frames</p></>)}{videoFile && (<div className="w-full space-y-3"><div className="flex items-center justify-between mb-1"><div className="text-sm text-emerald-50 truncate"><span className="font-medium">Selected:</span> {videoFile.name}<span className="ml-2 text-emerald-300/70">({Math.round(videoFile.size / 1024 / 1024)} MB)</span>1 unmodified line<buttontype="button"onClick={(e) => { e.stopPropagation(); setVideoFile(null); setResult(null); setError(""); }}className="text-xs text-cyan-300 hover:text-cyan-200">Change</button></div>{previewUrl && (7 unmodified lines)}</div><div className="flex flex-col gap-2"><div className="flex items-center gap-3 w-full justify-center md:justify-start"><buttontype="submit"disabled={loading || !videoFile}className="px-5 py-2.5 rounded-lg bg-emerald-500 text-slate-950 disabled:opacity-50 inline-flex items-center gap-2 hover:bg-emerald-400 text-sm md:text-base">{loading && (<span className="inline-block h-4 w-4 border-2 border-white/50 border-t-white rounded-full animate-spin"></span>)}{loading ? "Analyzing..." : "Analyze video"}</button>{loading && (<div className="flex-1 min-w-[140px] max-w-xs"><div className="h-1.5 w-full bg-slate-800 rounded-full overflow-hidden"><div className="h-full w-1/2 bg-gradient-to-r from-emerald-400 via-cyan-400 to-emerald-500 animate-pulse" /></div></div>)}</div><div className="flex flex-col gap-1 text-xs md:text-sm">{error && <span className="text-red-400">{error}</span>}{!videoFile && <span className="text-emerald-200/80">Select a video to begin the check.</span>}{!loading && result && (<span className="text-emerald-300/80">Tip: click any frame below to open it in a larger view.</span>)}</div></div></form></section>{result && (<section className="space-y-4 animate-fade-in-up"><div className="bg-slate-950 border border-emerald-900 rounded-xl p-5 shadow-md shadow-emerald-900/40 animate-fade-in-scale"><div className="flex items-center justify-between mb-2 text-xs font-mono text-emerald-300/80"><span className="uppercase tracking-[0.18em] text-emerald-400/80">Frames & predictions</span><span className="px-2 py-0.5 rounded-full bg-slate-900 border border-cyan-500/40 text-[10px] text-cyan-200 flex items-center gap-1"><span className="h-1.5 w-1.5 rounded-full bg-cyan-300" />{result.frames?.length || 0} frames</span></div><div className="border-t border-gray-800 pt-3 max-h-[480px] overflow-y-auto"><FrameGridframes={result.frames}predictions={result.predictions}
frontend/pages/analyze.jsx+47-24