diff --git a/public/Dark_Car_Interior.png b/public/Dark_Car_Interior.png new file mode 100644 index 0000000..9731d25 Binary files /dev/null and b/public/Dark_Car_Interior.png differ diff --git a/public/Dark_Logo.png b/public/Dark_Logo.png new file mode 100644 index 0000000..010351d Binary files /dev/null and b/public/Dark_Logo.png differ diff --git a/public/Light_Car_Interior.png b/public/Light_Car_Interior.png new file mode 100644 index 0000000..48081f5 Binary files /dev/null and b/public/Light_Car_Interior.png differ diff --git a/public/Light_Logo.png b/public/Light_Logo.png new file mode 100644 index 0000000..5864925 Binary files /dev/null and b/public/Light_Logo.png differ diff --git a/src/app/api/live-stats/route.ts b/src/app/api/live-stats/route.ts new file mode 100644 index 0000000..b20e01d --- /dev/null +++ b/src/app/api/live-stats/route.ts @@ -0,0 +1,22 @@ +import { NextResponse } from 'next/server'; +import { prisma } from '@/lib/prisma'; + +export async function GET() { + // Calculate average fuel price (RON/L), average efficiency (L/100km), and total CO2 saved (kg) + // For demo, fallback to fake values if not enough data + const fillUps = await prisma.fillUp.findMany({ select: { cost: true, liters: true, mileage: true, fuelType: true } }); + let avgFuelPrice = 7.2; + let avgEfficiency = 6.8; + let totalCO2Saved = 12000; + if (fillUps.length > 0) { + avgFuelPrice = fillUps.reduce((sum, f) => sum + f.cost / f.liters, 0) / fillUps.length; + avgEfficiency = fillUps.reduce((sum, f) => sum + (f.liters / (f.mileage || 1)) * 100, 0) / fillUps.length; + // Assume 2.3kg CO2 per L gasoline, 0 for electric, 1.6 for hybrid (if fuelType is ELECTRIC or car has both) + totalCO2Saved = fillUps.filter(f => f.fuelType === 'ELECTRIC').length * 2.3 * 40; // fake: 40L per fillup + } + return NextResponse.json({ + avgFuelPrice, + avgEfficiency, + totalCO2Saved, + }); +} diff --git a/src/app/auth/login/page.tsx b/src/app/auth/login/page.tsx index 34e4b11..afcdd2e 100644 --- a/src/app/auth/login/page.tsx +++ b/src/app/auth/login/page.tsx @@ -28,7 +28,7 @@ export default function LoginPage() { }; return ( -
+

Login

@@ -38,7 +38,7 @@ export default function LoginPage() { value={email} required onChange={(e) => setEmail(e.target.value)} - className="w-full max-w-2xl text-lg border border-[var(--border)] px-6 py-4 rounded-lg bg-[var(--background)] focus:outline-none focus:ring-2 focus:ring-[var(--primary)] text-[var(--foreground)] placeholder:text-[var(--foreground)]/50" + className="w-full max-w-2xl text-lg border border-[var(--border)] px-6 py-4 rounded-lg bg-transparent focus:outline-none focus:ring-2 focus:ring-[var(--primary)] text-[var(--foreground)] placeholder:text-[var(--foreground)]/50" />
setPassword(e.target.value)} - className="w-full text-lg border border-[var(--border)] px-6 py-4 rounded-lg bg-[var(--background)] focus:outline-none focus:ring-2 focus:ring-[var(--primary)] text-[var(--foreground)] placeholder:text-[var(--foreground)]/50 pr-16" + className="w-full text-lg border border-[var(--border)] px-6 py-4 rounded-lg bg-transparent focus:outline-none focus:ring-2 focus:ring-[var(--primary)] text-[var(--foreground)] placeholder:text-[var(--foreground)]/50 pr-16" /> - {error &&

{error}

}
diff --git a/src/app/globals.css b/src/app/globals.css index 7a9c4ab..54fbc03 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -2,6 +2,7 @@ :root { --background: #ffffff; + --background-image: url('/Light_Car_Interior.png'); --foreground: #171717; --primary: #2563eb; /* blue-600 */ --secondary: #22c55e; /* green-500 */ @@ -20,6 +21,7 @@ .dark { --background: #0a0a0a; + --background-image: url('/Dark_Car_Interior.png'); --foreground: #ededed; --muted: #171717; --border: #232323; @@ -35,6 +37,10 @@ body { background: var(--background); + background-image: var(--background-image); + background-size: cover; + background-position: center; + background-repeat: no-repeat; color: var(--foreground); font-family: Arial, Helvetica, sans-serif; transition: background 0.2s, color 0.2s; diff --git a/src/app/improvment_ideas/page.tsx b/src/app/improvment_ideas/page.tsx index ff8a816..67d8a41 100644 --- a/src/app/improvment_ideas/page.tsx +++ b/src/app/improvment_ideas/page.tsx @@ -34,7 +34,7 @@ export default function ImprovmentIdeasPage() { return (

Improvement Ideas

-

Have a suggestion or idea to make Car Fuel Tracker better? Share it with us!

+

Have a suggestion or idea to make FuelTrack better? Share it with us!

{submitted ? (
Thank you for your suggestion! We value your feedback and ideas.
) : ( diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 9a310df..1f37fb5 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -15,7 +15,7 @@ const geistMono = Geist_Mono({ }); export const metadata: Metadata = { - title: "Car Fuel Tracker", + title: "FuelTrack", description: "Track your car's fuel and mileage easily.", }; @@ -43,7 +43,7 @@ export default async function RootLayout({