Extra UI Fix
Browse files99 unmodified lines1001011021031041051031041051061071081091101111121131141151161171181191201091211221231243 unmodified lines1281291301311321331341351361371381201211391401411421431 unmodified line1451461471291481491501517 unmodified lines15916016114314416216316416516614816716816917017115317217317415615715817517617717817918018116316416518218318418516718618718817017117217318919019119219317719419519619719819920020120220318020420520699 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"> <main className="max-w-7xl mx-auto px-4 py-6 space-y-8 text-emerald-50"> <section className="flex justify-center"> <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" > <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>
<div onDrop={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" 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 lines className="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"> <div className="flex items-center justify-between mb-2"> <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 <button type="button" onClick={(e) => { e.stopPropagation(); setVideoFile(null); setResult(null); setError(""); }} className="text-sm text-blue-600 hover:underline" className="text-xs text-cyan-300 hover:text-cyan-200" >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"> <div className="flex flex-col gap-2"> <div className="flex items-center gap-3 w-full justify-center md:justify-start"> <button type="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" 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 ? "Processing..." : "Analyze Video"} {loading ? "Analyzing..." : "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 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"> {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>} <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-xs text-emerald-300/80">Tip: click a frame to view it larger.</span> <span className="text-emerald-300/80">Tip: click any frame below to open it in a larger view.</span> )} </div> </form> </div>
<div className="hidden lg:block" /> </div> </form> </section>
{result && ( <section className="grid lg:grid-cols-2 gap-6 items-start animate-fade-in-up"> <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"> <h3 className="text-sm font-semibold mb-2">Frames & predictions</h3> <FrameGrid frames={result.frames} predictions={result.predictions}frontend/pages/analyze.jsx+47-24