UI Update on Analyze page
Browse filesFiles changed (2)
100 unmodified lines10110210310410510610710859 unmodified lines16816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923035 unmodified lines266267268269270271272273274100 unmodified lines</header><main className="max-w-7xl mx-auto px-4 py-6 space-y-6 text-emerald-50"><div className="grid lg:grid-cols-2 gap-6 items-start"><section className="space-y-4"><divonDrop={onDrop}onDragOver={onDragOver}59 unmodified lines)}</div></form></section><aside className="space-y-4"><div className="bg-slate-950 border border-emerald-900 rounded-xl p-5 shadow-md shadow-emerald-900/40">{result ? (<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}onFrameClick={handleFrameClick}/></div>) : (<div className="text-sm text-emerald-300/70">Run analysis to see frames and predictions here.</div>)}</div><div className="bg-slate-950 border border-emerald-900 rounded-xl p-5 shadow-md shadow-emerald-900/40"><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 ? ((() => {const fakeProb = typeof result.final_score === "number" ? result.final_score : 0;const realProb = 1 - fakeProb;const isFake = result.final_label === "fake";const percent = Math.round((isFake ? fakeProb : realProb) * 100);const labelText = isFake ? "FAKE" : "REAL";const barColor = isFake ? "bg-red-500" : "bg-emerald-500";return (<div className="space-y-2"><div className="flex items-center justify-between text-xs font-mono text-emerald-200/80"><span>{labelText} confidence</span><span>{percent}%</span></div><div className="h-2 w-full rounded-full bg-slate-800 overflow-hidden"><divclassName={`${barColor} h-full transition-all`}style={{ width: `${percent}%` }}/></div><p className="text-xs text-emerald-300/80">This bar shows how strongly the model leans toward {labelText.toLowerCase()} for thisvideo.</p></div>);})()) : (<div className="text-sm text-emerald-300/70">Run an analysis to see the final confidence bar.</div>)}</div></aside></div></main><footer className="text-center text-xs text-gray-500 dark:text-gray-400 py-8">© {new Date().getFullYear()} Deepfake Detector</footer>35 unmodified lines<buttontype="button"onClick={closeFrameModal}className="text-xs text-emerald-200/80 hover:text-emerald-100">Close</button></div>100 unmodified lines10110210310410510610710859 unmodified lines16816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222335 unmodified lines259260261262263264265266267268100 unmodified lines</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}59 unmodified lines)}</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}onFrameClick={handleFrameClick}/></div></div><div className="bg-slate-950 border border-emerald-900 rounded-xl p-5 shadow-md shadow-emerald-900/40 animate-fade-in-scale"><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>{(() => {const fakeProb = typeof result.final_score === "number" ? result.final_score : 0;const realProb = 1 - fakeProb;const isFake = result.final_label === "fake";const percent = Math.round((isFake ? fakeProb : realProb) * 100);const labelText = isFake ? "FAKE" : "REAL";const barColor = isFake ? "bg-red-500" : "bg-emerald-500";return (<div className="space-y-2"><div className="flex items-center justify-between text-xs font-mono text-emerald-200/80"><span>{labelText} confidence</span><span>{percent}%</span></div><div className="h-2 w-full rounded-full bg-slate-800 overflow-hidden"><divclassName={`${barColor} h-full transition-all`}style={{ width: `${percent}%` }}/></div><p className="text-xs text-emerald-300/80">This bar shows how strongly the model leans toward {labelText.toLowerCase()} for thisvideo.</p></div>);})()}</div></section>)}</main><footer className="text-center text-xs text-gray-500 dark:text-gray-400 py-8">© {new Date().getFullYear()} Deepfake Detector</footer>35 unmodified lines<buttontype="button"onClick={closeFrameModal}className="text-xs flex items-center gap-1 text-red-400 hover:text-red-300"><span className="text-sm leading-none">✕</span><span>Close</span></button></div>
14 unmodified lines15161718192014 unmodified linesbackgroundImage: {'radial-fade': 'radial-gradient(1200px 600px at 80% -10%, rgba(16,185,129,0.22), transparent 70%)',},},},plugins: [],14 unmodified lines151617181920212223242526272829303132333414 unmodified linesbackgroundImage: {'radial-fade': 'radial-gradient(1200px 600px at 80% -10%, rgba(16,185,129,0.22), transparent 70%)',},keyframes: {fadeInUp: {'0%': { opacity: '0', transform: 'translateY(8px)' },'100%': { opacity: '1', transform: 'translateY(0)' },},fadeInScale: {'0%': { opacity: '0', transform: 'scale(0.96)' },'100%': { opacity: '1', transform: 'scale(1)' },},},animation: {'fade-in-up': 'fadeInUp 0.35s ease-out','fade-in-scale': 'fadeInScale 0.3s ease-out',},},},plugins: [],
frontend/pages/analyze.jsx+47-53
frontend/tailwind.config.js+14