style: align admin and landing with jokey barnyard aesthetic
This commit is contained in:
+233
-310
@@ -1,331 +1,254 @@
|
||||
'use client';
|
||||
"use client";
|
||||
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { useStore } from '@/lib/store';
|
||||
import { adminApi } from '@/lib/api';
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import { Label } from '@/components/ui/label';
|
||||
import { Badge } from '@/components/ui/badge';
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';
|
||||
import {
|
||||
Users,
|
||||
Settings,
|
||||
Pause,
|
||||
Play,
|
||||
TrendingUp,
|
||||
Search,
|
||||
Gift
|
||||
} from 'lucide-react';
|
||||
import { formatNumber } from '@/lib/utils';
|
||||
import { toast } from 'sonner';
|
||||
import {
|
||||
ArrowLeft,
|
||||
ChevronRight,
|
||||
Database,
|
||||
Minus,
|
||||
Plus,
|
||||
RefreshCcw,
|
||||
Search,
|
||||
Settings,
|
||||
ShieldAlert,
|
||||
TrendingUp,
|
||||
Users,
|
||||
} from "lucide-react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useEffect, useState } from "react";
|
||||
import { toast } from "sonner";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
CardDescription,
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
} from "@/components/ui/card";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { adminApi, api } from "@/lib/api";
|
||||
import { useStore } from "@/lib/store";
|
||||
import { formatNumber } from "@/lib/utils";
|
||||
|
||||
interface Analytics {
|
||||
users: {
|
||||
total: number;
|
||||
with_wallet: number;
|
||||
new_this_week: number;
|
||||
};
|
||||
transactions: {
|
||||
total_earned: number;
|
||||
total_spent: number;
|
||||
total_transactions: number;
|
||||
};
|
||||
watchStats: {
|
||||
total_seconds: number;
|
||||
total_credits: number;
|
||||
total_events: number;
|
||||
};
|
||||
users: { total: number; with_wallet: number; active_30d: number };
|
||||
transactions: {
|
||||
total_earned: number;
|
||||
total_spent: number;
|
||||
total_count: number;
|
||||
};
|
||||
requests: {
|
||||
total: number;
|
||||
pending: number;
|
||||
approved: number;
|
||||
declined: number;
|
||||
};
|
||||
}
|
||||
|
||||
interface User {
|
||||
id: string;
|
||||
plexUsername: string;
|
||||
email: string | null;
|
||||
isAdmin: boolean;
|
||||
isActive: boolean;
|
||||
totalEarned: number;
|
||||
totalSpent: number;
|
||||
watchTimeMinutes: number;
|
||||
createdAt: string;
|
||||
id: string;
|
||||
plexUsername: string;
|
||||
isAdmin: boolean;
|
||||
totalEarned: number;
|
||||
totalSpent: number;
|
||||
}
|
||||
|
||||
export default function AdminPage() {
|
||||
const router = useRouter();
|
||||
const { user, isAuthenticated } = useStore();
|
||||
const [analytics, setAnalytics] = useState<Analytics | null>(null);
|
||||
const [users, setUsers] = useState<User[]>([]);
|
||||
const [settings, setSettings] = useState<any>(null);
|
||||
const [isLoading, setIsLoading] = useState(true);
|
||||
const [searchQuery, setSearchQuery] = useState('');
|
||||
const router = useRouter();
|
||||
const { user, isAuthenticated } = useStore();
|
||||
const [analytics, setAnalytics] = useState<Analytics | null>(null);
|
||||
const [users, setUsers] = useState<User[]>([]);
|
||||
const [searchQuery, setSearchQuery] = useState("");
|
||||
const [isLoading, setIsLoading] = useState(true);
|
||||
|
||||
useEffect(() => {
|
||||
if (!isAuthenticated) {
|
||||
router.push('/login');
|
||||
return;
|
||||
}
|
||||
useEffect(() => {
|
||||
if (!isAuthenticated || !user?.isAdmin) {
|
||||
router.push("/dashboard");
|
||||
return;
|
||||
}
|
||||
loadData();
|
||||
}, [isAuthenticated, user, router]);
|
||||
|
||||
if (!user?.isAdmin) {
|
||||
router.push('/dashboard');
|
||||
return;
|
||||
}
|
||||
const loadData = async () => {
|
||||
try {
|
||||
const [analyticsRes, usersRes] = await Promise.all([
|
||||
api.get("/admin/analytics"),
|
||||
api.get("/admin/users"),
|
||||
]);
|
||||
setAnalytics(analyticsRes.data);
|
||||
setUsers(usersRes.data);
|
||||
} catch {
|
||||
toast.error("Failed to load coop secrets");
|
||||
} finally {
|
||||
setIsLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
loadData();
|
||||
}, [isAuthenticated, user, router]);
|
||||
const adjustUser = async (userId: string, amount: number, reason: string) => {
|
||||
try {
|
||||
await adminApi.adjustUser(userId, amount, reason);
|
||||
toast.success("Feathers adjusted!");
|
||||
loadData();
|
||||
} catch {
|
||||
toast.error("Failed to adjust nest");
|
||||
}
|
||||
};
|
||||
|
||||
const loadData = async () => {
|
||||
try {
|
||||
const [analyticsRes, usersRes, settingsRes] = await Promise.all([
|
||||
adminApi.getAnalytics(),
|
||||
adminApi.getUsers(),
|
||||
adminApi.getSettings()
|
||||
]);
|
||||
const toggleAdmin = async (userId: string, isAdmin: boolean) => {
|
||||
try {
|
||||
await api.patch(`/admin/users/${userId}`, { isAdmin });
|
||||
toast.success(isAdmin ? "Promoted to Rooster!" : "Demoted to Hen.");
|
||||
loadData();
|
||||
} catch {
|
||||
toast.error("Failed to change pecking order");
|
||||
}
|
||||
};
|
||||
|
||||
setAnalytics(analyticsRes.data);
|
||||
setUsers(usersRes.data.users);
|
||||
setSettings(settingsRes.data);
|
||||
} catch (error) {
|
||||
toast.error('Failed to load admin data');
|
||||
} finally {
|
||||
setIsLoading(false);
|
||||
}
|
||||
};
|
||||
const filteredUsers = users.filter((u) =>
|
||||
u.plexUsername?.toLowerCase().includes(searchQuery.toLowerCase()),
|
||||
);
|
||||
|
||||
const handlePause = async () => {
|
||||
try {
|
||||
await adminApi.pause();
|
||||
toast.success('Minting paused');
|
||||
loadData();
|
||||
} catch (error) {
|
||||
toast.error('Failed to pause minting');
|
||||
}
|
||||
};
|
||||
if (isLoading)
|
||||
return (
|
||||
<div className="p-8 font-display animate-pulse text-primary">
|
||||
COUNTING THE CHICKENS...
|
||||
</div>
|
||||
);
|
||||
|
||||
const handleResume = async () => {
|
||||
try {
|
||||
await adminApi.resume();
|
||||
toast.success('Minting resumed');
|
||||
loadData();
|
||||
} catch (error) {
|
||||
toast.error('Failed to resume minting');
|
||||
}
|
||||
};
|
||||
return (
|
||||
<div className="min-h-screen bg-background p-4 sm:p-8 font-sans">
|
||||
<div className="mx-auto max-w-6xl space-y-8">
|
||||
{/* Admin Header */}
|
||||
<div className="flex flex-col items-start justify-between gap-4 rounded-3xl border-4 border-primary bg-secondary/20 p-6 shadow-[8px_8px_0px_0px_rgba(0,0,0,1)] md:flex-row md:items-center">
|
||||
<div className="flex items-center gap-4">
|
||||
<Button
|
||||
variant="ghost"
|
||||
onClick={() => router.push("/dashboard")}
|
||||
className="rounded-full p-2 h-10 w-10"
|
||||
>
|
||||
<ArrowLeft className="h-6 w-6" />
|
||||
</Button>
|
||||
<div>
|
||||
<h1 className="font-display text-4xl leading-none text-primary uppercase italic tracking-tighter">
|
||||
COOP CONTROL
|
||||
</h1>
|
||||
<p className="text-sm font-bold text-muted-foreground">
|
||||
Admin Peering Glass
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<Button
|
||||
onClick={loadData}
|
||||
variant="outline"
|
||||
className="rounded-full border-2 border-primary font-bold"
|
||||
>
|
||||
<RefreshCcw className="mr-2 h-4 w-4" /> REFRESH
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
const handleGrantBonus = async (userId: string) => {
|
||||
const amount = prompt('Enter bonus amount:');
|
||||
if (!amount) return;
|
||||
{/* Big Stats */}
|
||||
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-4">
|
||||
<div className="rounded-2xl border-4 border-foreground bg-card p-4 shadow-[4px_4px_0px_0px_rgba(0,0,0,1)]">
|
||||
<div className="flex items-center gap-2 text-primary font-black uppercase text-[10px]">
|
||||
<Users className="h-3 w-3" /> Flock Size
|
||||
</div>
|
||||
<div className="mt-1 text-3xl font-black">
|
||||
{analytics?.users.total || 0}
|
||||
</div>
|
||||
</div>
|
||||
<div className="rounded-2xl border-4 border-foreground bg-card p-4 shadow-[4px_4px_0px_0px_rgba(0,0,0,1)]">
|
||||
<div className="flex items-center gap-2 text-primary font-black uppercase text-[10px]">
|
||||
<Database className="h-3 w-3" /> Total $COOP
|
||||
</div>
|
||||
<div className="mt-1 text-3xl font-black">
|
||||
{formatNumber(analytics?.transactions.total_earned || 0)}
|
||||
</div>
|
||||
</div>
|
||||
<div className="rounded-2xl border-4 border-foreground bg-card p-4 shadow-[4px_4px_0px_0px_rgba(0,0,0,1)]">
|
||||
<div className="flex items-center gap-2 text-primary font-black uppercase text-[10px]">
|
||||
<TrendingUp className="h-3 w-3" /> Requests
|
||||
</div>
|
||||
<div className="mt-1 text-3xl font-black">
|
||||
{analytics?.requests.total || 0}
|
||||
</div>
|
||||
</div>
|
||||
<div className="rounded-2xl border-4 border-foreground bg-card p-4 shadow-[4px_4px_0px_0px_rgba(0,0,0,1)]">
|
||||
<div className="flex items-center gap-2 text-primary font-black uppercase text-[10px]">
|
||||
<ShieldAlert className="h-3 w-3" /> Pending
|
||||
</div>
|
||||
<div className="mt-1 text-3xl font-black">
|
||||
{analytics?.requests.pending || 0}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
try {
|
||||
await adminApi.grantBonus(userId, parseInt(amount), 'Admin bonus');
|
||||
toast.success('Bonus granted');
|
||||
loadData();
|
||||
} catch (error) {
|
||||
toast.error('Failed to grant bonus');
|
||||
}
|
||||
};
|
||||
{/* User Management */}
|
||||
<div className="rounded-[2.5rem] border-4 border-foreground bg-card p-6 shadow-[10px_10px_0px_0px_rgba(0,0,0,0.05)]">
|
||||
<div className="mb-6 flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
|
||||
<h2 className="font-display text-3xl uppercase italic">
|
||||
The Peeps
|
||||
</h2>
|
||||
<div className="relative w-full sm:w-64">
|
||||
<Search className="absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" />
|
||||
<Input
|
||||
placeholder="Search chickens..."
|
||||
value={searchQuery}
|
||||
onChange={(e) => setSearchQuery(e.target.value)}
|
||||
className="rounded-full border-2 border-foreground pl-10 focus-visible:ring-primary"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
if (!isAuthenticated || !user?.isAdmin) {
|
||||
return null;
|
||||
}
|
||||
<div className="space-y-4">
|
||||
{filteredUsers.map((u) => (
|
||||
<div
|
||||
key={u.id}
|
||||
className="flex flex-col gap-4 rounded-2xl border-2 border-foreground bg-accent/5 p-4 sm:flex-row sm:items-center sm:justify-between hover:bg-accent/10 transition-colors"
|
||||
>
|
||||
<div>
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="font-black text-lg">{u.plexUsername}</span>
|
||||
{u.isAdmin && (
|
||||
<span className="rounded-full bg-primary px-2 py-0.5 text-[10px] font-bold text-white uppercase">
|
||||
Rooster
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
<div className="text-xs font-bold text-muted-foreground">
|
||||
Balance: {formatNumber(u.totalEarned - u.totalSpent)} $COOP
|
||||
</div>
|
||||
</div>
|
||||
|
||||
if (isLoading) {
|
||||
return (
|
||||
<div className="min-h-screen flex items-center justify-center">
|
||||
<p>Loading...</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="min-h-screen bg-background">
|
||||
<header className="border-b bg-card">
|
||||
<div className="max-w-7xl mx-auto px-4 py-4 flex items-center justify-between">
|
||||
<div className="flex items-center gap-4">
|
||||
<h1 className="text-2xl font-bold">Admin Dashboard</h1>
|
||||
<Badge variant="secondary">{user.plexUsername}</Badge>
|
||||
</div>
|
||||
<Button variant="ghost" onClick={() => router.push('/dashboard')}>
|
||||
Back to Dashboard
|
||||
</Button>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main className="max-w-7xl mx-auto px-4 py-8">
|
||||
{/* Stats Overview */}
|
||||
<div className="grid grid-cols-1 md:grid-cols-4 gap-4 mb-8">
|
||||
<Card>
|
||||
<CardHeader className="flex flex-row items-center justify-between pb-2">
|
||||
<CardTitle className="text-sm font-medium">Total Users</CardTitle>
|
||||
<Users className="h-4 w-4 text-muted-foreground" />
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="text-2xl font-bold">{analytics?.users.total || 0}</div>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
{analytics?.users.with_wallet || 0} with wallets
|
||||
</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
<Card>
|
||||
<CardHeader className="flex flex-row items-center justify-between pb-2">
|
||||
<CardTitle className="text-sm font-medium">Total Minted</CardTitle>
|
||||
<TrendingUp className="h-4 w-4 text-green-500" />
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="text-2xl font-bold">
|
||||
{formatNumber(analytics?.transactions.total_earned || 0)} $COOP
|
||||
</div>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
{analytics?.transactions.total_transactions || 0} transactions
|
||||
</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
<Card>
|
||||
<CardHeader className="flex flex-row items-center justify-between pb-2">
|
||||
<CardTitle className="text-sm font-medium">Watch Time</CardTitle>
|
||||
<TrendingUp className="h-4 w-4 text-blue-500" />
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="text-2xl font-bold">
|
||||
{Math.floor((analytics?.watchStats.total_seconds || 0) / 3600)}h
|
||||
</div>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
{analytics?.watchStats.total_events || 0} watch events
|
||||
</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
<Card>
|
||||
<CardHeader className="flex flex-row items-center justify-between pb-2">
|
||||
<CardTitle className="text-sm font-medium">System Status</CardTitle>
|
||||
<Settings className="h-4 w-4 text-muted-foreground" />
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="flex items-center gap-2">
|
||||
<div className={`w-2 h-2 rounded-full ${settings?.mintingPaused ? 'bg-red-500' : 'bg-green-500'}`} />
|
||||
<span className="font-bold">
|
||||
{settings?.mintingPaused ? 'Paused' : 'Active'}
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex gap-2 mt-2">
|
||||
<Button size="sm" variant="outline" onClick={handlePause} disabled={settings?.mintingPaused}>
|
||||
<Pause className="h-3 w-3 mr-1" />
|
||||
Pause
|
||||
</Button>
|
||||
<Button size="sm" variant="outline" onClick={handleResume} disabled={!settings?.mintingPaused}>
|
||||
<Play className="h-3 w-3 mr-1" />
|
||||
Resume
|
||||
</Button>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
{/* Tabs */}
|
||||
<Tabs defaultValue="users">
|
||||
<TabsList>
|
||||
<TabsTrigger value="users">Users</TabsTrigger>
|
||||
<TabsTrigger value="settings">Settings</TabsTrigger>
|
||||
</TabsList>
|
||||
|
||||
<TabsContent value="users" className="space-y-4">
|
||||
<div className="flex gap-4">
|
||||
<div className="relative flex-1 max-w-sm">
|
||||
<Search className="absolute left-3 top-3 h-4 w-4 text-muted-foreground" />
|
||||
<Input
|
||||
placeholder="Search users..."
|
||||
value={searchQuery}
|
||||
onChange={(e) => setSearchQuery(e.target.value)}
|
||||
className="pl-10"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Card>
|
||||
<CardContent className="p-0">
|
||||
<div className="divide-y">
|
||||
{users.map((u) => (
|
||||
<div key={u.id} className="flex items-center justify-between p-4">
|
||||
<div>
|
||||
<p className="font-medium">{u.plexUsername}</p>
|
||||
<p className="text-sm text-muted-foreground">{u.email}</p>
|
||||
<div className="flex gap-2 mt-1">
|
||||
{u.isAdmin && <Badge variant="default">Admin</Badge>}
|
||||
{!u.isActive && <Badge variant="destructive">Inactive</Badge>}
|
||||
</div>
|
||||
</div>
|
||||
<div className="text-right">
|
||||
<p className="font-mono text-sm">
|
||||
{formatNumber(u.totalEarned - u.totalSpent)} $COOP
|
||||
</p>
|
||||
<Button
|
||||
size="sm"
|
||||
variant="ghost"
|
||||
onClick={() => handleGrantBonus(u.id)}
|
||||
>
|
||||
<Gift className="h-4 w-4 mr-1" />
|
||||
Bonus
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</TabsContent>
|
||||
|
||||
<TabsContent value="settings">
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>Minting Settings</CardTitle>
|
||||
<CardDescription>Configure how users earn $COOP</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-4">
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
<div className="space-y-2">
|
||||
<Label>Credits Per Minute</Label>
|
||||
<Input
|
||||
type="number"
|
||||
value={settings?.creditsPerMinute || 10}
|
||||
onChange={(e) => setSettings({ ...settings, creditsPerMinute: parseInt(e.target.value) })}
|
||||
/>
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
<Label>Min Watch Percent</Label>
|
||||
<Input
|
||||
type="number"
|
||||
value={settings?.minWatchPercent || 80}
|
||||
onChange={(e) => setSettings({ ...settings, minWatchPercent: parseInt(e.target.value) })}
|
||||
/>
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
<Label>Movie Request Cost</Label>
|
||||
<Input
|
||||
type="number"
|
||||
value={settings?.movieRequestCost || 100}
|
||||
onChange={(e) => setSettings({ ...settings, movieRequestCost: parseInt(e.target.value) })}
|
||||
/>
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
<Label>TV Request Cost</Label>
|
||||
<Input
|
||||
type="number"
|
||||
value={settings?.tvRequestCost || 200}
|
||||
onChange={(e) => setSettings({ ...settings, tvRequestCost: parseInt(e.target.value) })}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<Button onClick={() => adminApi.updateSettings(settings).then(() => toast.success('Settings saved'))}>
|
||||
Save Settings
|
||||
</Button>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</TabsContent>
|
||||
</Tabs>
|
||||
</main>
|
||||
</div>
|
||||
);
|
||||
<div className="flex flex-wrap gap-2">
|
||||
<Button
|
||||
size="sm"
|
||||
variant="outline"
|
||||
className="rounded-full border-2"
|
||||
onClick={() => adjustUser(u.id, 100, "Admin bonus")}
|
||||
>
|
||||
<Plus className="h-3 w-3 mr-1" /> 100
|
||||
</Button>
|
||||
<Button
|
||||
size="sm"
|
||||
variant="outline"
|
||||
className="rounded-full border-2"
|
||||
onClick={() => adjustUser(u.id, -100, "Admin correction")}
|
||||
>
|
||||
<Minus className="h-3 w-3 mr-1" /> 100
|
||||
</Button>
|
||||
<Button
|
||||
size="sm"
|
||||
variant={u.isAdmin ? "destructive" : "secondary"}
|
||||
className="rounded-full font-bold"
|
||||
onClick={() => toggleAdmin(u.id, !u.isAdmin)}
|
||||
>
|
||||
{u.isAdmin ? "Demote" : "Make Admin"}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
+62
-94
@@ -13,7 +13,7 @@ import { Button } from "@/components/ui/button";
|
||||
|
||||
export default function LandingPage() {
|
||||
return (
|
||||
<div className="min-h-screen flex flex-col bg-background selection:bg-primary selection:text-primary-foreground">
|
||||
<div className="min-h-screen flex flex-col bg-background selection:bg-primary selection:text-primary-foreground font-sans">
|
||||
<div
|
||||
className="fixed inset-0 pointer-events-none z-0 opacity-[0.06]"
|
||||
style={{
|
||||
@@ -23,38 +23,42 @@ export default function LandingPage() {
|
||||
}}
|
||||
/>
|
||||
|
||||
<header className="sticky top-0 z-50 w-full border-b bg-background/80 backdrop-blur-md">
|
||||
<div className="container mx-auto flex h-16 items-center justify-between px-4">
|
||||
<header className="sticky top-0 z-50 w-full border-b-4 border-primary bg-background/80 backdrop-blur-md">
|
||||
<div className="container mx-auto flex h-20 items-center justify-between px-4">
|
||||
<div className="flex items-center gap-2 group cursor-pointer">
|
||||
<div className="flex h-8 w-8 items-center justify-center rounded-lg bg-primary transition-transform group-hover:rotate-12">
|
||||
<Egg className="h-5 w-5 text-primary-foreground" />
|
||||
<div className="flex h-10 w-10 items-center justify-center rounded-full bg-primary transition-transform group-hover:rotate-12 shadow-lg">
|
||||
<Egg className="h-6 w-6 text-primary-foreground" />
|
||||
</div>
|
||||
<span className="font-display text-xl tracking-tight">
|
||||
<span className="font-display text-3xl tracking-tight uppercase italic text-primary">
|
||||
CoopCredits
|
||||
</span>
|
||||
</div>
|
||||
<nav className="hidden items-center gap-8 md:flex">
|
||||
<a
|
||||
href="#features"
|
||||
className="text-sm font-medium text-muted-foreground transition-colors hover:text-foreground"
|
||||
className="text-sm font-black uppercase transition-colors hover:text-primary"
|
||||
>
|
||||
Features
|
||||
</a>
|
||||
<a
|
||||
href="#how-it-works"
|
||||
className="text-sm font-medium text-muted-foreground transition-colors hover:text-foreground"
|
||||
className="text-sm font-black uppercase transition-colors hover:text-primary"
|
||||
>
|
||||
How it Works
|
||||
</a>
|
||||
<Link href="/login">
|
||||
<Button variant="outline" size="sm" className="rounded-full px-6">
|
||||
Dashboard
|
||||
<Button
|
||||
variant="outline"
|
||||
size="lg"
|
||||
className="rounded-full px-8 border-2 font-black"
|
||||
>
|
||||
LOGIN
|
||||
</Button>
|
||||
</Link>
|
||||
</nav>
|
||||
<Link href="/login" className="md:hidden">
|
||||
<Button size="sm" className="rounded-full">
|
||||
Login
|
||||
<Button size="sm" className="rounded-full font-black">
|
||||
LOGIN
|
||||
</Button>
|
||||
</Link>
|
||||
</div>
|
||||
@@ -64,13 +68,13 @@ export default function LandingPage() {
|
||||
<section className="overflow-hidden py-20 md:py-32">
|
||||
<div className="container mx-auto px-4">
|
||||
<div className="mx-auto max-w-4xl space-y-8 text-center">
|
||||
<div className="inline-flex items-center gap-2 rounded-full border border-primary/20 bg-primary/10 px-3 py-1 text-xs font-bold uppercase tracking-widest text-primary animate-in fade-in slide-in-from-bottom-4 duration-500">
|
||||
<Coins className="h-3 w-3" /> Barnyard rewards
|
||||
<div className="inline-flex items-center gap-2 rounded-full border-2 border-primary bg-primary/10 px-4 py-1 text-xs font-black uppercase tracking-widest text-primary animate-bounce">
|
||||
<Coins className="h-4 w-4" /> Barnyard rewards
|
||||
</div>
|
||||
<h1 className="font-display text-5xl leading-[1.1] tracking-tight animate-in fade-in slide-in-from-bottom-8 duration-700 delay-100 md:text-7xl">
|
||||
Welcome to the Coop, Friend
|
||||
<h1 className="font-display text-6xl leading-none tracking-tighter animate-in fade-in slide-in-from-bottom-8 duration-700 delay-100 md:text-8xl italic uppercase text-primary">
|
||||
Join the Flock!
|
||||
</h1>
|
||||
<p className="mx-auto max-w-2xl text-xl text-muted-foreground animate-in fade-in slide-in-from-bottom-12 duration-1000 delay-200">
|
||||
<p className="mx-auto max-w-2xl text-2xl font-bold text-muted-foreground animate-in fade-in slide-in-from-bottom-12 duration-1000 delay-200">
|
||||
Earn $COOP automatically for every minute you watch on Plex.
|
||||
Spend it like golden eggs to request movies and shows.
|
||||
</p>
|
||||
@@ -78,19 +82,18 @@ export default function LandingPage() {
|
||||
<Link href="/login">
|
||||
<Button
|
||||
size="lg"
|
||||
className="h-14 rounded-full px-8 text-lg shadow-lg shadow-primary/20 group"
|
||||
className="h-16 rounded-full px-10 text-xl font-black shadow-[6px_6px_0px_0px_rgba(0,0,0,1)] hover:translate-x-[2px] hover:translate-y-[2px] hover:shadow-none transition-all uppercase"
|
||||
>
|
||||
Join the Flock{" "}
|
||||
<ChevronRight className="ml-2 h-5 w-5 transition-transform group-hover:translate-x-1" />
|
||||
Enter the Coop <ChevronRight className="ml-2 h-6 w-6" />
|
||||
</Button>
|
||||
</Link>
|
||||
<a href="#features">
|
||||
<Button
|
||||
size="lg"
|
||||
variant="outline"
|
||||
className="h-14 rounded-full px-8 text-lg"
|
||||
className="h-16 rounded-full px-10 text-xl font-black border-4"
|
||||
>
|
||||
See how it works
|
||||
The Secret
|
||||
</Button>
|
||||
</a>
|
||||
</div>
|
||||
@@ -98,93 +101,58 @@ export default function LandingPage() {
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="features" className="border-y bg-card/50 py-20">
|
||||
<section
|
||||
id="features"
|
||||
className="border-t-8 border-primary bg-secondary/20 py-24"
|
||||
>
|
||||
<div className="container mx-auto px-4">
|
||||
<div className="mb-12 text-center">
|
||||
<p className="text-sm font-bold uppercase tracking-[0.3em] text-primary">
|
||||
Why the flock likes it
|
||||
<div className="mb-16 text-center">
|
||||
<p className="text-lg font-black uppercase tracking-[0.3em] text-primary">
|
||||
Pecking Order
|
||||
</p>
|
||||
<h2 className="mt-3 font-display text-3xl md:text-5xl">
|
||||
Simple, warm, and built for watching
|
||||
<h2 className="mt-3 font-display text-5xl md:text-7xl uppercase italic tracking-tighter">
|
||||
Simple. Fun. Fast.
|
||||
</h2>
|
||||
</div>
|
||||
<div className="grid gap-6 md:grid-cols-3">
|
||||
<div className="rounded-3xl border bg-background/80 p-6 shadow-sm">
|
||||
<PlayCircle className="h-10 w-10 text-primary" />
|
||||
<h3 className="mt-4 text-xl font-bold">Watch earns</h3>
|
||||
<p className="mt-2 text-muted-foreground">
|
||||
Every minute on Plex fills your nest with $COOP.
|
||||
<div className="grid gap-8 md:grid-cols-3">
|
||||
<div className="rounded-[3rem] border-4 border-foreground bg-background p-8 shadow-[8px_8px_0px_0px_rgba(0,0,0,1)] transition-transform hover:scale-105">
|
||||
<div className="bg-primary/10 w-16 h-16 rounded-2xl flex items-center justify-center mb-6">
|
||||
<PlayCircle className="h-10 w-10 text-primary" />
|
||||
</div>
|
||||
<h3 className="text-3xl font-black uppercase italic">Watch</h3>
|
||||
<p className="mt-4 text-xl font-bold text-muted-foreground">
|
||||
Every minute on Plex fills your nest with $COOP automatically.
|
||||
</p>
|
||||
</div>
|
||||
<div className="rounded-3xl border bg-background/80 p-6 shadow-sm">
|
||||
<Shield className="h-10 w-10 text-primary" />
|
||||
<h3 className="mt-4 text-xl font-bold">Safe balance</h3>
|
||||
<p className="mt-2 text-muted-foreground">
|
||||
Your credits live in the coop database and update fast.
|
||||
<div className="rounded-[3rem] border-4 border-foreground bg-background p-8 shadow-[8px_8px_0px_0px_rgba(0,0,0,1)] transition-transform hover:scale-105">
|
||||
<div className="bg-primary/10 w-16 h-16 rounded-2xl flex items-center justify-center mb-6">
|
||||
<Shield className="h-10 w-10 text-primary" />
|
||||
</div>
|
||||
<h3 className="text-3xl font-black uppercase italic">Earn</h3>
|
||||
<p className="mt-4 text-xl font-bold text-muted-foreground">
|
||||
Your credits live in the cozy coop database. Safe and warm.
|
||||
</p>
|
||||
</div>
|
||||
<div className="rounded-3xl border bg-background/80 p-6 shadow-sm">
|
||||
<Zap className="h-10 w-10 text-primary" />
|
||||
<h3 className="mt-4 text-xl font-bold">Request fast</h3>
|
||||
<p className="mt-2 text-muted-foreground">
|
||||
Spend credits on movie and TV requests with a few taps.
|
||||
<div className="rounded-[3rem] border-4 border-foreground bg-background p-8 shadow-[8px_8px_0px_0px_rgba(0,0,0,1)] transition-transform hover:scale-105">
|
||||
<div className="bg-primary/10 w-16 h-16 rounded-2xl flex items-center justify-center mb-6">
|
||||
<Zap className="h-10 w-10 text-primary" />
|
||||
</div>
|
||||
<h3 className="text-3xl font-black uppercase italic">Spend</h3>
|
||||
<p className="mt-4 text-xl font-bold text-muted-foreground">
|
||||
Exchange golden eggs for any movie or TV series you desire.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="how-it-works" className="py-20">
|
||||
<div className="container mx-auto grid gap-10 px-4 lg:grid-cols-[1.1fr_0.9fr] lg:items-center">
|
||||
<div className="space-y-6">
|
||||
<p className="text-sm font-bold uppercase tracking-[0.3em] text-primary">
|
||||
How it works
|
||||
</p>
|
||||
<h2 className="font-display text-3xl md:text-5xl">
|
||||
A cozy loop: watch, earn, request, repeat
|
||||
</h2>
|
||||
<p className="max-w-xl text-lg text-muted-foreground">
|
||||
No weird hoops. Plex watch time becomes credits. Credits become
|
||||
requests. The coop keeps score.
|
||||
</p>
|
||||
<ul className="space-y-4 text-sm text-muted-foreground">
|
||||
<li>• Log in with Plex.</li>
|
||||
<li>• Watch content.</li>
|
||||
<li>• Get $COOP in your balance.</li>
|
||||
<li>• Request new content from dashboard.</li>
|
||||
</ul>
|
||||
<Link href="/login">
|
||||
<Button size="lg" className="rounded-full px-8">
|
||||
Enter the Coop <ChevronRight className="ml-2 h-5 w-5" />
|
||||
</Button>
|
||||
</Link>
|
||||
</div>
|
||||
<div className="rounded-[2rem] border bg-card p-8 shadow-[0_25px_60px_-35px_rgba(0,0,0,0.5)]">
|
||||
<div className="space-y-4">
|
||||
<div className="rounded-2xl bg-primary/10 p-4">
|
||||
<div className="text-xs uppercase tracking-[0.3em] text-muted-foreground">
|
||||
Balance
|
||||
</div>
|
||||
<div className="mt-2 text-4xl font-bold">$COOP</div>
|
||||
</div>
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
<div className="rounded-2xl bg-secondary p-4">
|
||||
<div className="text-xs uppercase tracking-[0.25em] text-muted-foreground">
|
||||
Watch
|
||||
</div>
|
||||
<div className="mt-2 text-2xl font-bold">Earn</div>
|
||||
</div>
|
||||
<div className="rounded-2xl bg-secondary p-4">
|
||||
<div className="text-xs uppercase tracking-[0.25em] text-muted-foreground">
|
||||
Spend
|
||||
</div>
|
||||
<div className="mt-2 text-2xl font-bold">Request</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer className="py-12 border-t-4 border-foreground bg-accent/20">
|
||||
<div className="container mx-auto px-4 text-center">
|
||||
<p className="font-black uppercase tracking-widest text-primary italic">
|
||||
Keep on Peckin' © 2026
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
</footer>
|
||||
</main>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user