Homepage fixes and added file limit
Browse filesFiles changed (2)
1 unmodified line23456783 unmodified lines1213141516171819202122232425262711 unmodified lines394041334243444546474849505152531 unmodified lineimport FrameGrid from "../components/FrameGrid";
export default function Analyze() { const MAX_FILE_BYTES = 15 * 1024 * 1024; // 15 MB cap const [videoFile, setVideoFile] = useState(null); const [previewUrl, setPreviewUrl] = useState(""); const [loading, setLoading] = useState(false);3 unmodified lines const [isModalClosing, setIsModalClosing] = useState(false); const fileInputRef = useRef(null);
const isValidSize = (file) => file && file.size <= MAX_FILE_BYTES;
const onFileChange = (e) => { const f = e.target.files?.[0]; if (f && !isValidSize(f)) { setError("Video must be 15 MB or smaller."); setVideoFile(null); return; } setError(""); setVideoFile(f || null); };
11 unmodified lines e.preventDefault(); e.stopPropagation(); const f = e.dataTransfer.files?.[0]; if (f && f.type.startsWith("video/")) setVideoFile(f); if (f && f.type.startsWith("video/")) { if (!isValidSize(f)) { setError("Video must be 15 MB or smaller."); setVideoFile(null); return; } setError(""); setVideoFile(f); } };
const onDragOver = (e) => {12234567891011122 unmodified lines151617181920212223242526272829303132333435363711 unmodified lines495051333452535455565758405960616268 unmodified lines13113213311513413513613713813914014114233 unmodified lines176177178155179180181182183184161185186187188189import Link from "next/link";import { useEffect, useState } from "react";import { useEffect, useRef, useState } from "react";
const HERO_FRAMES = ["/1.jpg", "/2.jpg", "/3.jpg", "/4.jpg", "/5.jpg"];
export default function Landing() { const [heroFrameIndex, setHeroFrameIndex] = useState(0); const [howVisible, setHowVisible] = useState(false); const howRef = useRef(null);
useEffect(() => { if (!HERO_FRAMES.length) return;2 unmodified lines }, 3500); return () => clearInterval(id); }, []);
useEffect(() => { if (!howRef.current) return; const observer = new IntersectionObserver( (entries) => { entries.forEach((entry) => { if (entry.isIntersecting) { setHowVisible(true); observer.unobserve(entry.target); } }); }, { threshold: 0.2 } ); observer.observe(howRef.current); return () => observer.disconnect(); }, []); return ( <div className="min-h-screen flex flex-col bg-slate-950 text-emerald-50 text-sm md:text-base bg-radial-fade animate-fade-in"> <header className="border-b border-emerald-800/60 bg-slate-950/80 backdrop-blur">11 unmodified lines </div> </header>
<main className="flex-1 space-y-10 md:space-y-12"> <section className="relative overflow-hidden border-b border-emerald-900/60 animate-fade-in-up"> <main className="flex-1"> <section className="relative overflow-hidden border-b border-emerald-900/60 animate-fade-in-up min-h-[70vh] md:min-h-[80vh] pt-16 md:pt-24 pb-24 md:pb-32"> <div className="absolute inset-0 pointer-events-none"> <div className="absolute inset-0 opacity-20 bg-[radial-gradient(circle_at_top,_#22c55e33,_transparent_60%)]" /> <div className="absolute inset-0 opacity-[0.07] bg-[linear-gradient(to_right,#10b981_10%,transparent_10%),linear-gradient(to_bottom,#10b981_10%,transparent_10%)] bg-[length:20px_20px]" /> </div>
<div className="relative max-w-7xl mx-auto px-4 py-16 md:py-20 grid md:grid-cols-2 gap-10 items-center"> <div className="relative max-w-7xl mx-auto px-4 grid gap-12 lg:grid-cols-[1.15fr,0.85fr] items-start"> <div className="space-y-5 animate-fade-in-scale"> <p className="text-xs md:text-sm font-mono uppercase tracking-[0.35em] text-emerald-400/80"> Real-time video forensics68 unmodified lines </div> </section>
<section className="max-w-7xl mx-auto px-4 py-12 md:py-16 animate-fade-in-up"> <section ref={howRef} className={`max-w-7xl mx-auto px-4 py-12 md:py-16 -mt-10 md:-mt-14 transition-all duration-700 ${ howVisible ? "opacity-100 translate-y-0" : "opacity-0 translate-y-10" }`} > <div className="max-w-3xl"> <h2 className="text-xl md:text-2xl font-semibold">How it works</h2> </div>33 unmodified lines ].map((step, idx) => ( <div key={step.title} className={`rounded-lg border bg-slate-950/80 p-3 flex flex-col gap-1 ${ className={`rounded-lg border bg-slate-950/80 p-3 flex flex-col gap-1 transition-all duration-500 ${ idx % 3 === 0 ? "border-emerald-700/60" : idx % 3 === 1 ? "border-cyan-600/60" : "border-fuchsia-600/60" }`} } ${howVisible ? "opacity-100 translate-y-0" : "opacity-0 translate-y-4"}`} style={{ transitionDelay: howVisible ? `${idx * 80}ms` : "0ms" }} > <div className="text-[10px] uppercase tracking-wide text-emerald-400/90">{step.title}</div> <div className="font-semibold">{step.heading}</div>frontend/pages/analyze.jsx+18-1
frontend/pages/index.jsx+32-7