FODASSE QUE BORRAÇO
This commit is contained in:
+206
-57
@@ -1,65 +1,214 @@
|
||||
import Image from "next/image";
|
||||
// app/page.tsx
|
||||
// Homepage - navbar/footer now in layout.tsx
|
||||
|
||||
import Link from 'next/link';
|
||||
import { query } from '@/lib/db';
|
||||
import { TrophyIcon, ChartIcon, CircleIcon, UsersIcon, ServerIcon, ActivityIcon } from '@/components/ui/icons';
|
||||
|
||||
async function getStats() {
|
||||
const driversOnline = await query(`
|
||||
SELECT COUNT(*) as count
|
||||
FROM users
|
||||
WHERE is_connect = true
|
||||
`);
|
||||
|
||||
const totalDrivers = await query(`
|
||||
SELECT COUNT(*) as count
|
||||
FROM users
|
||||
`);
|
||||
|
||||
const activeServers = await query(`
|
||||
SELECT COUNT(DISTINCT server_id) as count
|
||||
FROM servers
|
||||
WHERE connected_players > 0
|
||||
`);
|
||||
|
||||
return {
|
||||
driversOnline: driversOnline[0]?.count || 0,
|
||||
totalDrivers: totalDrivers[0]?.count || 0,
|
||||
activeServers: activeServers[0]?.count || 0,
|
||||
};
|
||||
}
|
||||
|
||||
export default async function HomePage() {
|
||||
const stats = await getStats();
|
||||
|
||||
export default function Home() {
|
||||
return (
|
||||
<div className="flex min-h-screen items-center justify-center bg-zinc-50 font-sans dark:bg-black">
|
||||
<main className="flex min-h-screen w-full max-w-3xl flex-col items-center justify-between py-32 px-16 bg-white dark:bg-black sm:items-start">
|
||||
<Image
|
||||
className="dark:invert"
|
||||
src="/next.svg"
|
||||
alt="Next.js logo"
|
||||
width={100}
|
||||
height={20}
|
||||
priority
|
||||
/>
|
||||
<div className="flex flex-col items-center gap-6 text-center sm:items-start sm:text-left">
|
||||
<h1 className="max-w-xs text-3xl font-semibold leading-10 tracking-tight text-black dark:text-zinc-50">
|
||||
To get started, edit the page.tsx file.
|
||||
</h1>
|
||||
<p className="max-w-md text-lg leading-8 text-zinc-600 dark:text-zinc-400">
|
||||
Looking for a starting point or more instructions? Head over to{" "}
|
||||
<a
|
||||
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
|
||||
className="font-medium text-zinc-950 dark:text-zinc-50"
|
||||
>
|
||||
Templates
|
||||
</a>{" "}
|
||||
or the{" "}
|
||||
<a
|
||||
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
|
||||
className="font-medium text-zinc-950 dark:text-zinc-50"
|
||||
>
|
||||
Learning
|
||||
</a>{" "}
|
||||
center.
|
||||
<>
|
||||
{/* Hero */}
|
||||
<div className="relative border-b border-white/10">
|
||||
<div className="absolute inset-0 grid-overlay opacity-50"></div>
|
||||
|
||||
<div className="max-w-7xl mx-auto px-6 py-32 relative">
|
||||
<div className="text-center space-y-8">
|
||||
{/* Logo */}
|
||||
<div className="flex justify-center mb-8">
|
||||
<img
|
||||
src="https://openwheels.racing/files/img/Openwheels_landscape.svg"
|
||||
alt="OpenWheels"
|
||||
className="h-24 brightness-0 invert"
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Tagline */}
|
||||
<div className="space-y-4">
|
||||
<h1 className="text-7xl font-bold tracking-tight leading-none">
|
||||
FREE RACING.<br/>
|
||||
NO BARRIERS.
|
||||
</h1>
|
||||
|
||||
<p className="text-xl text-white/60 max-w-2xl mx-auto leading-relaxed">
|
||||
Join our community of passionate racers. Compete in multiple leagues,
|
||||
track your progress, and race for free on dedicated infrastructure.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{/* CTA */}
|
||||
<div className="flex items-center justify-center space-x-4 pt-8">
|
||||
<Link
|
||||
href="/dashboard"
|
||||
className="px-8 py-4 border-2 border-white hover:bg-white hover:text-[#0a0a0a] transition-all text-base font-medium"
|
||||
>
|
||||
VIEW DASHBOARD
|
||||
</Link>
|
||||
<a
|
||||
href="https://discord.gg/nvuB8EvT9P"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="px-8 py-4 border border-white/30 hover:border-white transition-all text-base"
|
||||
>
|
||||
JOIN COMMUNITY
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Live Stats */}
|
||||
<div className="grid grid-cols-1 md:grid-cols-3 gap-4 mt-24">
|
||||
<LiveStatCard
|
||||
value={stats.driversOnline}
|
||||
label="ONLINE NOW"
|
||||
icon={<UsersIcon />}
|
||||
/>
|
||||
<LiveStatCard
|
||||
value={stats.activeServers}
|
||||
label="ACTIVE SERVERS"
|
||||
icon={<ServerIcon />}
|
||||
/>
|
||||
<LiveStatCard
|
||||
value={stats.totalDrivers}
|
||||
label="TOTAL DRIVERS"
|
||||
icon={<ActivityIcon />}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Features Grid */}
|
||||
<div className="max-w-7xl mx-auto px-6 py-24">
|
||||
<div className="text-center mb-20">
|
||||
<h2 className="text-5xl font-bold tracking-tight mb-4">
|
||||
INFRASTRUCTURE
|
||||
</h2>
|
||||
<p className="text-white/60 text-lg">
|
||||
Everything required for competitive sim racing
|
||||
</p>
|
||||
</div>
|
||||
<div className="flex flex-col gap-4 text-base font-medium sm:flex-row">
|
||||
<a
|
||||
className="flex h-12 w-full items-center justify-center gap-2 rounded-full bg-foreground px-5 text-background transition-colors hover:bg-[#383838] dark:hover:bg-[#ccc] md:w-[158px]"
|
||||
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<Image
|
||||
className="dark:invert"
|
||||
src="/vercel.svg"
|
||||
alt="Vercel logomark"
|
||||
width={16}
|
||||
height={16}
|
||||
/>
|
||||
Deploy Now
|
||||
</a>
|
||||
<a
|
||||
className="flex h-12 w-full items-center justify-center rounded-full border border-solid border-black/[.08] px-5 transition-colors hover:border-transparent hover:bg-black/[.04] dark:border-white/[.145] dark:hover:bg-[#1a1a1a] md:w-[158px]"
|
||||
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
Documentation
|
||||
</a>
|
||||
|
||||
<div className="grid grid-cols-1 md:grid-cols-3 gap-6">
|
||||
<FeatureCard
|
||||
icon={<TrophyIcon className="w-10 h-10" />}
|
||||
title="MULTIPLE LEAGUES"
|
||||
description="Progress through skill-based divisions. C-Class to Pro level competition across all disciplines."
|
||||
/>
|
||||
<FeatureCard
|
||||
icon={<ChartIcon className="w-10 h-10" />}
|
||||
title="LIVE RANKINGS"
|
||||
description="Real-time performance tracking. Transparent ELO system with historical data and statistics."
|
||||
/>
|
||||
<FeatureCard
|
||||
icon={<CircleIcon className="w-10 h-10" />}
|
||||
title="FREE ACCESS"
|
||||
description="No subscriptions. No hidden costs. Open infrastructure for the racing community."
|
||||
/>
|
||||
<FeatureCard
|
||||
icon={<TrophyIcon className="w-10 h-10" />}
|
||||
title="WEATHER SYSTEMS"
|
||||
description="Dynamic conditions. Rain, dry, variable grip. Test your adaptability in all scenarios."
|
||||
/>
|
||||
<FeatureCard
|
||||
icon={<ActivityIcon className="w-10 h-10" />}
|
||||
title="MULTIPLE CLASSES"
|
||||
description="MX5, GT4, GT3 categories. Different cars for different racing philosophies and styles."
|
||||
/>
|
||||
<FeatureCard
|
||||
icon={<UsersIcon className="w-10 h-10" />}
|
||||
title="ACTIVE COMMUNITY"
|
||||
description="Discord integration. Event organization, race coordination, and community engagement tools."
|
||||
/>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
{/* System Status */}
|
||||
<div className="border-t border-white/10">
|
||||
<div className="max-w-7xl mx-auto px-6 py-12">
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="flex items-center space-x-3">
|
||||
<div className="w-2 h-2 bg-white rounded-full animate-pulse"></div>
|
||||
<span className="text-xs tracking-wider text-white/60">SYSTEM OPERATIONAL</span>
|
||||
</div>
|
||||
<div className="text-xs text-white/40 font-mono">
|
||||
v2.0.0 | UPTIME: 99.9%
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function LiveStatCard({
|
||||
value,
|
||||
label,
|
||||
icon
|
||||
}: {
|
||||
value: number;
|
||||
label: string;
|
||||
icon: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<div className="border border-white/10 p-8 sharp-border">
|
||||
<div className="flex items-center justify-between mb-4">
|
||||
<div className="text-white/40">
|
||||
{icon}
|
||||
</div>
|
||||
<div className="w-2 h-2 bg-white rounded-full animate-pulse"></div>
|
||||
</div>
|
||||
<div className="text-5xl font-bold tracking-tight mb-2">
|
||||
{value.toLocaleString()}
|
||||
</div>
|
||||
<div className="text-sm text-white/60 tracking-wider font-medium">
|
||||
{label}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function FeatureCard({
|
||||
icon,
|
||||
title,
|
||||
description
|
||||
}: {
|
||||
icon: React.ReactNode;
|
||||
title: string;
|
||||
description: string;
|
||||
}) {
|
||||
return (
|
||||
<div className="border border-white/10 p-8 sharp-border topo-lines-dense bg-black">
|
||||
<div className="mb-6 text-white/80">
|
||||
{icon}
|
||||
</div>
|
||||
<h3 className="text-xl font-bold tracking-tight mb-3">{title}</h3>
|
||||
<p className="text-white/60 leading-relaxed">{description}</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user