Changed colour of button and made all same

This commit is contained in:
sumona-banerjeee
2026-02-11 17:34:31 +05:30
parent 09cd20e838
commit 12b6a99531
11 changed files with 140 additions and 267 deletions

View File

@@ -316,3 +316,50 @@
color: oklch(0.60 0.02 280);
}
}
@layer utilities {
@keyframes logo-float {
0%,
100% {
transform: translateY(0) scale(1);
}
50% {
transform: translateY(-3px) scale(1.02);
}
}
@keyframes logo-spin-slow {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
@keyframes logo-spin-reverse-slow {
from {
transform: rotate(360deg);
}
to {
transform: rotate(0deg);
}
}
.animate-logo-float {
animation: logo-float 3s ease-in-out infinite;
}
.animate-logo-spin-slow {
animation: logo-spin-slow 12s linear infinite;
}
.animate-logo-spin-reverse-slow {
animation: logo-spin-reverse-slow 8s linear infinite;
}
}

View File

@@ -14,71 +14,10 @@ import {
clearSession
} from "@/lib/api"
import { getVideoFile, clearVideoFile } from "@/lib/video-storage"
import { DetectionData, DetectionType } from "@/lib/types"
const API_URL = process.env.NEXT_PUBLIC_API_URL || "http://127.0.0.1:8000/api/v1"
type DetectionType = "pothole-detection" | "sign-board-detection"
type DetectionData = {
video_id: string
detection_type?: string
output_video_path?: string
video_info: {
fps: number
width: number
height: number
total_frames: number
}
summary: {
unique_potholes?: number
unique_signboards?: number
total_detections: number
total_frames: number
detection_rate: number
}
pothole_list?: Array<{
pothole_id: number
first_detected_frame: number
first_detected_time: number
confidence: number
lat?: number
lng?: number
}>
signboard_list?: Array<{
signboard_id: number
type: string
first_detected_frame: number
first_detected_time: number
confidence: number
lat?: number
lng?: number
}>
frames: Array<{
frame_id: number
potholes?: Array<{
pothole_id: number
bbox: {
x1: number
y1: number
x2: number
y2: number
}
confidence: number
}>
signboards?: Array<{
signboard_id: number
type: string
bbox: {
x1: number
y1: number
x2: number
y2: number
}
confidence: number
}>
}>
}
export default function ResultsPage() {
const router = useRouter()
const [session, setSession] = useState<SessionContext | null>(null)

View File

@@ -213,13 +213,13 @@ export default function UploadPage() {
</div>
</div>
<Button
variant="ghost"
size="sm"
onClick={handleBackToSelection}
className="text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 text-xs"
className="bg-blue-600 hover:bg-blue-700 text-white text-xs"
>
Change Selection
</Button>
</div>
</div>
</div>
@@ -229,7 +229,7 @@ export default function UploadPage() {
<Card className="rounded-xl overflow-hidden animate-in fade-in slide-in-from-bottom duration-700 delay-150 flex-1">
<CardHeader className="pb-4 border-b border-gray-100 dark:border-gray-700 bg-white dark:bg-gray-900">
<CardTitle className="text-xl font-bold">
<span className="bg-gradient-to-r from-indigo-600 via-purple-500 to-indigo-600 dark:from-indigo-400 dark:via-purple-400 dark:to-indigo-400 bg-clip-text text-transparent">
<span className="bg-gradient-to-r from-blue-600 via-blue-500 to-blue-600 dark:from-blue-400 dark:via-blue-300 dark:to-blue-400 bg-clip-text text-transparent">
Upload Video
</span>
</CardTitle>
@@ -253,7 +253,7 @@ export default function UploadPage() {
setError(null)
}}
disabled={uploading}
className="h-10 bg-gray-50 dark:bg-gray-800 file:mr-3 file:py-1.5 file:px-3 file:rounded-md file:border-0 file:bg-indigo-100 dark:file:bg-indigo-900/50 file:text-indigo-600 dark:file:text-indigo-400 file:font-medium file:text-xs hover:file:bg-indigo-200"
className="h-10 bg-gray-50 dark:bg-gray-800 file:mr-3 file:py-1.5 file:px-3 file:rounded-md file:border-0 file:bg-blue-100 dark:file:bg-blue-900/50 file:text-blue-600 dark:file:text-blue-400 file:font-medium file:text-xs hover:file:bg-blue-200"
/>
</div>
@@ -271,7 +271,7 @@ export default function UploadPage() {
setError(null)
}}
disabled={uploading}
className="h-10 bg-gray-50 dark:bg-gray-800 file:mr-3 file:py-1.5 file:px-3 file:rounded-md file:border-0 file:bg-indigo-100 dark:file:bg-indigo-900/50 file:text-indigo-600 dark:file:text-indigo-400 file:font-medium file:text-xs hover:file:bg-indigo-200"
className="h-10 bg-gray-50 dark:bg-gray-800 file:mr-3 file:py-1.5 file:px-3 file:rounded-md file:border-0 file:bg-blue-100 dark:file:bg-blue-900/50 file:text-blue-600 dark:file:text-blue-400 file:font-medium file:text-xs hover:file:bg-blue-200"
/>
</div>
@@ -331,7 +331,9 @@ export default function UploadPage() {
<Button
onClick={handleUpload}
disabled={!file || uploading}
className={`w-full h-12 text-sm font-semibold transition-all rounded-xl ${file && !uploading ? 'bg-gradient-to-r from-indigo-500 to-purple-600 hover:from-indigo-600 hover:to-purple-700 text-white shadow-lg shadow-indigo-500/25' : ''
className={`w-full h-12 text-sm font-semibold transition-all rounded-xl ${file && !uploading
? 'bg-gradient-to-r from-blue-500 to-blue-700 hover:from-blue-600 hover:to-blue-800 text-white shadow-lg shadow-blue-500/25'
: ''
}`}
size="lg"
>
@@ -347,13 +349,13 @@ export default function UploadPage() {
{/* Progress Section */}
{uploading && (
<div className="space-y-3 p-4 rounded-xl bg-indigo-50 dark:bg-indigo-950/30 border border-indigo-200 dark:border-indigo-800 animate-in fade-in slide-in-from-top duration-500">
<div className="space-y-3 p-4 rounded-xl bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 animate-in fade-in slide-in-from-top duration-500">
<div className="space-y-2">
<div className="flex items-center justify-between text-sm">
<span className="font-medium text-gray-700 dark:text-gray-300 text-xs">Processing Progress</span>
<span className="font-bold text-indigo-600 dark:text-indigo-400 text-xs">{progress}%</span>
<span className="font-bold text-blue-600 dark:text-blue-400 text-xs">{progress}%</span>
</div>
<div className="h-2 rounded-full bg-indigo-100 dark:bg-indigo-900/50 overflow-hidden">
<div className="h-2 rounded-full bg-blue-100 dark:bg-blue-900/50 overflow-hidden">
<div
className="h-full bg-gradient-to-r from-indigo-500 to-purple-600 rounded-full transition-all duration-300"
style={{ width: `${progress}%` }}

BIN
build_log.txt Normal file

Binary file not shown.

View File

@@ -39,7 +39,7 @@ export function FilterSelector({
<div className="flex flex-wrap items-center gap-3 p-3 rounded-xl bg-card border border-[var(--border)] shadow-sm">
{/* Project Dropdown */}
<div className="flex items-center gap-2">
<div className="p-1.5 rounded-lg bg-indigo-100 dark:bg-indigo-900/50">
<div className="p-1.5 rounded-lg bg-blue-100 dark:bg-blue-900/50">
<FolderOpen className="h-4 w-4 text-indigo-500" />
</div>
<Select

View File

@@ -36,7 +36,7 @@ export function DataTable<T extends Record<string, any>>({
</div>
<Button
onClick={onAddNew}
className="bg-blue-600 hover:bg-blue-800 text-white shadow-md transition-all duration-300 hover:scale-105 active:scale-95 border-none h-8 px-4 text-xs font-semibold"
className="bg-blue-600 hover:bg-blue-700 text-white shadow-lg shadow-blue-500/25 transition-all duration-300 hover:scale-105 active:scale-95 border-none h-8 px-4 text-xs font-semibold"
>
<Plus className="h-3.5 w-3.5 mr-1.5 stroke-[3px]" />
{addButtonText}

View File

@@ -2,7 +2,7 @@
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
import { Target, AlertTriangle, Film, Activity, Gauge, Monitor } from "lucide-react"
import type { DetectionData } from "@/app/page"
import type { DetectionData } from "@/lib/types"
type SummarySectionProps = {
data: DetectionData

View File

@@ -8,7 +8,7 @@ import { Label } from "@/components/ui/label"
import { Progress } from "@/components/ui/progress"
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"
import { Upload, Loader2, AlertCircle } from "lucide-react"
import type { DetectionData, DetectionType } from "@/app/page"
import type { DetectionData, DetectionType } from "@/lib/types"
const API_URL = process.env.NEXT_PUBLIC_API_URL || "http://127.0.0.1:8000/api/v1"
const WS_URL = process.env.NEXT_PUBLIC_WS_URL || "ws://127.0.0.1:8000/api/v1"
@@ -308,7 +308,8 @@ export function UploadSection({ onDetectionComplete, onDetectionTypeChange }: Up
<Button
onClick={handleUpload}
disabled={!file || uploading}
className="w-full transition-all"
className="w-full transition-all bg-blue-600 hover:bg-blue-700 text-white shadow-lg shadow-blue-500/25"
size="lg"
>
{uploading ? (

View File

@@ -296,7 +296,8 @@ function DetailedSummarySection({
{allDetections.map(({ detection, locationName, packageName }, idx) => (
<div
key={`${detection.id}-${idx}`}
className="text-xs p-2 bg-card rounded border-l-2 border-blue-500"
className="text-xs p-2 bg-white dark:bg-gray-900 rounded shadow-sm border border-gray-100 dark:border-gray-800"
>
<div className="flex items-center justify-between mb-1">
<span className="font-semibold">
@@ -413,8 +414,8 @@ function SummarySection({ data, show, detectionType }: { data: DetectionData; sh
className="flex flex-col items-center justify-center p-3 rounded-xl transition-all hover:scale-105 animate-in fade-in slide-in-from-bottom duration-500 border border-gray-100 dark:border-gray-800 bg-gradient-to-br from-white to-gray-50 dark:from-gray-900 dark:to-gray-800 shadow-sm hover:shadow-md"
style={{ animationDelay: `${index * 100}ms` }}
>
<div className={`${stat.bgColor} p-2.5 rounded-lg mb-2 transition-all shadow-inner`}>
<Icon className={`h-5 w-5 ${stat.color}`} />
<div className={`${stat.bgColor} p-3 rounded-lg mb-2 transition-all shadow-inner`}>
<Icon className={`h-6 w-6 ${stat.color}`} />
</div>
<div className={`text-xl font-bold ${stat.color} mb-1`}>{stat.value}</div>
<div className="text-[10px] text-muted-foreground text-center leading-tight font-medium uppercase tracking-wide">{stat.label}</div>
@@ -940,8 +941,8 @@ export default function VideoPlayerSection({ data, videoId, videoFile, detection
<div
key={`${log.frame}-${index}`}
onClick={() => seekToFrame(log.frame)}
className={`text-xs p-3 bg-card rounded-md border-l-2 cursor-pointer hover:bg-accent/50 transition-colors ${isPothole ? "border-red-500" : "border-blue-500"
}`}
className="text-xs p-3 bg-white dark:bg-gray-900 rounded-md cursor-pointer hover:bg-accent/50 transition-colors shadow-sm"
>
<div className="flex items-center justify-between mb-2">
<span className="font-semibold text-foreground">Frame: {log.frame}</span>

61
lib/types.ts Normal file
View File

@@ -0,0 +1,61 @@
export type DetectionType = "pothole-detection" | "sign-board-detection"
export type DetectionData = {
video_id: string
detection_type?: string
output_video_path?: string
video_info: {
fps: number
width: number
height: number
total_frames: number
}
summary: {
unique_potholes?: number
unique_signboards?: number
total_detections: number
total_frames: number
detection_rate: number
}
pothole_list?: Array<{
pothole_id: number
first_detected_frame: number
first_detected_time: number
confidence: number
lat?: number
lng?: number
}>
signboard_list?: Array<{
signboard_id: number
type: string
first_detected_frame: number
first_detected_time: number
confidence: number
lat?: number
lng?: number
}>
frames: Array<{
frame_id: number
potholes?: Array<{
pothole_id: number
bbox: {
x1: number
y1: number
x2: number
y2: number
}
confidence: number
}>
signboards?: Array<{
signboard_id: number
type: string
bbox: {
x1: number
y1: number
x2: number
y2: number
}
confidence: number
}>
}>
}

View File

@@ -1,178 +0,0 @@
@import 'tailwindcss';
@import 'tw-animate-css';
@custom-variant dark (&:is(.dark *));
:root {
--background: #f8fafc;
--foreground: oklch(0.145 0 0);
--card: oklch(1 0 0);
--card-foreground: oklch(0.145 0 0);
--popover: oklch(1 0 0);
--popover-foreground: oklch(0.145 0 0);
--primary: oklch(0.205 0 0);
--primary-foreground: oklch(0.985 0 0);
--secondary: oklch(0.97 0 0);
--secondary-foreground: oklch(0.205 0 0);
--muted: oklch(0.97 0 0);
--muted-foreground: oklch(0.556 0 0);
--accent: oklch(0.97 0 0);
--accent-foreground: oklch(0.205 0 0);
--destructive: oklch(0.577 0.245 27.325);
--destructive-foreground: oklch(0.577 0.245 27.325);
--border: oklch(0.922 0 0);
--input: oklch(0.922 0 0);
--ring: oklch(0.708 0 0);
--chart-1: oklch(0.646 0.222 41.116);
--chart-2: oklch(0.6 0.118 184.704);
--chart-3: oklch(0.398 0.07 227.392);
--chart-4: oklch(0.828 0.189 84.429);
--chart-5: oklch(0.769 0.188 70.08);
--radius: 0.625rem;
--sidebar: #ffffff;
--sidebar-foreground: #64748b;
--sidebar-primary: #2563eb;
--sidebar-primary-foreground: #ffffff;
--sidebar-accent: #f1f5f9;
--sidebar-accent-foreground: #0f172a;
--sidebar-border: #e2e8f0;
--sidebar-ring: #3b82f6;
}
.dark {
--background: oklch(0.145 0 0);
--foreground: oklch(0.985 0 0);
--card: oklch(0.145 0 0);
--card-foreground: oklch(0.985 0 0);
--popover: oklch(0.145 0 0);
--popover-foreground: oklch(0.985 0 0);
--primary: oklch(0.985 0 0);
--primary-foreground: oklch(0.205 0 0);
--secondary: oklch(0.269 0 0);
--secondary-foreground: oklch(0.985 0 0);
--muted: oklch(0.269 0 0);
--muted-foreground: oklch(0.708 0 0);
--accent: oklch(0.269 0 0);
--accent-foreground: oklch(0.985 0 0);
--destructive: oklch(0.396 0.141 25.723);
--destructive-foreground: oklch(0.637 0.237 25.331);
--border: oklch(0.269 0 0);
--input: oklch(0.269 0 0);
--ring: oklch(0.439 0 0);
--chart-1: oklch(0.488 0.243 264.376);
--chart-2: oklch(0.696 0.17 162.48);
--chart-3: oklch(0.769 0.188 70.08);
--chart-4: oklch(0.627 0.265 303.9);
--chart-5: oklch(0.645 0.246 16.439);
--sidebar: oklch(0.205 0 0);
--sidebar-foreground: oklch(0.985 0 0);
--sidebar-primary: oklch(0.488 0.243 264.376);
--sidebar-primary-foreground: oklch(0.985 0 0);
--sidebar-accent: oklch(0.269 0 0);
--sidebar-accent-foreground: oklch(0.985 0 0);
--sidebar-border: oklch(0.269 0 0);
--sidebar-ring: oklch(0.439 0 0);
}
@theme inline {
--font-sans: 'Geist', 'Geist Fallback';
--font-mono: 'Geist Mono', 'Geist Mono Fallback';
--color-background: var(--background);
--color-foreground: var(--foreground);
--color-card: var(--card);
--color-card-foreground: var(--card-foreground);
--color-popover: var(--popover);
--color-popover-foreground: var(--popover-foreground);
--color-primary: var(--primary);
--color-primary-foreground: var(--primary-foreground);
--color-secondary: var(--secondary);
--color-secondary-foreground: var(--secondary-foreground);
--color-muted: var(--muted);
--color-muted-foreground: var(--muted-foreground);
--color-accent: var(--accent);
--color-accent-foreground: var(--accent-foreground);
--color-destructive: var(--destructive);
--color-destructive-foreground: var(--destructive-foreground);
--color-border: var(--border);
--color-input: var(--input);
--color-ring: var(--ring);
--color-chart-1: var(--chart-1);
--color-chart-2: var(--chart-2);
--color-chart-3: var(--chart-3);
--color-chart-4: var(--chart-4);
--color-chart-5: var(--chart-5);
--radius-sm: calc(var(--radius) - 4px);
--radius-md: calc(var(--radius) - 2px);
--radius-lg: var(--radius);
--radius-xl: calc(var(--radius) + 4px);
--color-sidebar: var(--sidebar);
--color-sidebar-foreground: var(--sidebar-foreground);
--color-sidebar-primary: var(--sidebar-primary);
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
--color-sidebar-accent: var(--sidebar-accent);
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
--color-sidebar-border: var(--sidebar-border);
--color-sidebar-ring: var(--sidebar-ring);
}
@layer utilities {
@keyframes logo-float {
0%,
100% {
transform: translateY(0) scale(1);
}
50% {
transform: translateY(-3px) scale(1.02);
}
}
@keyframes logo-spin-slow {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
@keyframes logo-spin-reverse-slow {
from {
transform: rotate(360deg);
}
to {
transform: rotate(0deg);
}
}
.animate-logo-float {
animation: logo-float 3s ease-in-out infinite;
}
.animate-logo-spin-slow {
animation: logo-spin-slow 12s linear infinite;
}
.animate-logo-spin-reverse-slow {
animation: logo-spin-reverse-slow 8s linear infinite;
}
}
@layer base {
* {
@apply border-border outline-ring/50;
}
body {
@apply bg-background text-foreground;
}
button:not([role="tab"]),
[role="button"] {
border-radius: 9999px !important;
}
}