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 {
|
||||||
import { useRouter } from 'next/navigation';
|
ArrowLeft,
|
||||||
import { useStore } from '@/lib/store';
|
ChevronRight,
|
||||||
import { adminApi } from '@/lib/api';
|
Database,
|
||||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
|
Minus,
|
||||||
import { Button } from '@/components/ui/button';
|
Plus,
|
||||||
import { Input } from '@/components/ui/input';
|
RefreshCcw,
|
||||||
import { Label } from '@/components/ui/label';
|
Search,
|
||||||
import { Badge } from '@/components/ui/badge';
|
Settings,
|
||||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';
|
ShieldAlert,
|
||||||
import {
|
TrendingUp,
|
||||||
Users,
|
Users,
|
||||||
Settings,
|
} from "lucide-react";
|
||||||
Pause,
|
import { useRouter } from "next/navigation";
|
||||||
Play,
|
import { useEffect, useState } from "react";
|
||||||
TrendingUp,
|
import { toast } from "sonner";
|
||||||
Search,
|
import { Button } from "@/components/ui/button";
|
||||||
Gift
|
import {
|
||||||
} from 'lucide-react';
|
Card,
|
||||||
import { formatNumber } from '@/lib/utils';
|
CardContent,
|
||||||
import { toast } from 'sonner';
|
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 {
|
interface Analytics {
|
||||||
users: {
|
users: { total: number; with_wallet: number; active_30d: number };
|
||||||
total: number;
|
transactions: {
|
||||||
with_wallet: number;
|
total_earned: number;
|
||||||
new_this_week: number;
|
total_spent: number;
|
||||||
};
|
total_count: number;
|
||||||
transactions: {
|
};
|
||||||
total_earned: number;
|
requests: {
|
||||||
total_spent: number;
|
total: number;
|
||||||
total_transactions: number;
|
pending: number;
|
||||||
};
|
approved: number;
|
||||||
watchStats: {
|
declined: number;
|
||||||
total_seconds: number;
|
};
|
||||||
total_credits: number;
|
|
||||||
total_events: number;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface User {
|
interface User {
|
||||||
id: string;
|
id: string;
|
||||||
plexUsername: string;
|
plexUsername: string;
|
||||||
email: string | null;
|
isAdmin: boolean;
|
||||||
isAdmin: boolean;
|
totalEarned: number;
|
||||||
isActive: boolean;
|
totalSpent: number;
|
||||||
totalEarned: number;
|
|
||||||
totalSpent: number;
|
|
||||||
watchTimeMinutes: number;
|
|
||||||
createdAt: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function AdminPage() {
|
export default function AdminPage() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { user, isAuthenticated } = useStore();
|
const { user, isAuthenticated } = useStore();
|
||||||
const [analytics, setAnalytics] = useState<Analytics | null>(null);
|
const [analytics, setAnalytics] = useState<Analytics | null>(null);
|
||||||
const [users, setUsers] = useState<User[]>([]);
|
const [users, setUsers] = useState<User[]>([]);
|
||||||
const [settings, setSettings] = useState<any>(null);
|
const [searchQuery, setSearchQuery] = useState("");
|
||||||
const [isLoading, setIsLoading] = useState(true);
|
const [isLoading, setIsLoading] = useState(true);
|
||||||
const [searchQuery, setSearchQuery] = useState('');
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!isAuthenticated) {
|
if (!isAuthenticated || !user?.isAdmin) {
|
||||||
router.push('/login');
|
router.push("/dashboard");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
loadData();
|
||||||
|
}, [isAuthenticated, user, router]);
|
||||||
|
|
||||||
if (!user?.isAdmin) {
|
const loadData = async () => {
|
||||||
router.push('/dashboard');
|
try {
|
||||||
return;
|
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();
|
const adjustUser = async (userId: string, amount: number, reason: string) => {
|
||||||
}, [isAuthenticated, user, router]);
|
try {
|
||||||
|
await adminApi.adjustUser(userId, amount, reason);
|
||||||
|
toast.success("Feathers adjusted!");
|
||||||
|
loadData();
|
||||||
|
} catch {
|
||||||
|
toast.error("Failed to adjust nest");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const loadData = async () => {
|
const toggleAdmin = async (userId: string, isAdmin: boolean) => {
|
||||||
try {
|
try {
|
||||||
const [analyticsRes, usersRes, settingsRes] = await Promise.all([
|
await api.patch(`/admin/users/${userId}`, { isAdmin });
|
||||||
adminApi.getAnalytics(),
|
toast.success(isAdmin ? "Promoted to Rooster!" : "Demoted to Hen.");
|
||||||
adminApi.getUsers(),
|
loadData();
|
||||||
adminApi.getSettings()
|
} catch {
|
||||||
]);
|
toast.error("Failed to change pecking order");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
setAnalytics(analyticsRes.data);
|
const filteredUsers = users.filter((u) =>
|
||||||
setUsers(usersRes.data.users);
|
u.plexUsername?.toLowerCase().includes(searchQuery.toLowerCase()),
|
||||||
setSettings(settingsRes.data);
|
);
|
||||||
} catch (error) {
|
|
||||||
toast.error('Failed to load admin data');
|
|
||||||
} finally {
|
|
||||||
setIsLoading(false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handlePause = async () => {
|
if (isLoading)
|
||||||
try {
|
return (
|
||||||
await adminApi.pause();
|
<div className="p-8 font-display animate-pulse text-primary">
|
||||||
toast.success('Minting paused');
|
COUNTING THE CHICKENS...
|
||||||
loadData();
|
</div>
|
||||||
} catch (error) {
|
);
|
||||||
toast.error('Failed to pause minting');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleResume = async () => {
|
return (
|
||||||
try {
|
<div className="min-h-screen bg-background p-4 sm:p-8 font-sans">
|
||||||
await adminApi.resume();
|
<div className="mx-auto max-w-6xl space-y-8">
|
||||||
toast.success('Minting resumed');
|
{/* Admin Header */}
|
||||||
loadData();
|
<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">
|
||||||
} catch (error) {
|
<div className="flex items-center gap-4">
|
||||||
toast.error('Failed to resume minting');
|
<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) => {
|
{/* Big Stats */}
|
||||||
const amount = prompt('Enter bonus amount:');
|
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-4">
|
||||||
if (!amount) return;
|
<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 {
|
{/* User Management */}
|
||||||
await adminApi.grantBonus(userId, parseInt(amount), 'Admin bonus');
|
<div className="rounded-[2.5rem] border-4 border-foreground bg-card p-6 shadow-[10px_10px_0px_0px_rgba(0,0,0,0.05)]">
|
||||||
toast.success('Bonus granted');
|
<div className="mb-6 flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
|
||||||
loadData();
|
<h2 className="font-display text-3xl uppercase italic">
|
||||||
} catch (error) {
|
The Peeps
|
||||||
toast.error('Failed to grant bonus');
|
</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) {
|
<div className="space-y-4">
|
||||||
return null;
|
{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) {
|
<div className="flex flex-wrap gap-2">
|
||||||
return (
|
<Button
|
||||||
<div className="min-h-screen flex items-center justify-center">
|
size="sm"
|
||||||
<p>Loading...</p>
|
variant="outline"
|
||||||
</div>
|
className="rounded-full border-2"
|
||||||
);
|
onClick={() => adjustUser(u.id, 100, "Admin bonus")}
|
||||||
}
|
>
|
||||||
|
<Plus className="h-3 w-3 mr-1" /> 100
|
||||||
return (
|
</Button>
|
||||||
<div className="min-h-screen bg-background">
|
<Button
|
||||||
<header className="border-b bg-card">
|
size="sm"
|
||||||
<div className="max-w-7xl mx-auto px-4 py-4 flex items-center justify-between">
|
variant="outline"
|
||||||
<div className="flex items-center gap-4">
|
className="rounded-full border-2"
|
||||||
<h1 className="text-2xl font-bold">Admin Dashboard</h1>
|
onClick={() => adjustUser(u.id, -100, "Admin correction")}
|
||||||
<Badge variant="secondary">{user.plexUsername}</Badge>
|
>
|
||||||
</div>
|
<Minus className="h-3 w-3 mr-1" /> 100
|
||||||
<Button variant="ghost" onClick={() => router.push('/dashboard')}>
|
</Button>
|
||||||
Back to Dashboard
|
<Button
|
||||||
</Button>
|
size="sm"
|
||||||
</div>
|
variant={u.isAdmin ? "destructive" : "secondary"}
|
||||||
</header>
|
className="rounded-full font-bold"
|
||||||
|
onClick={() => toggleAdmin(u.id, !u.isAdmin)}
|
||||||
<main className="max-w-7xl mx-auto px-4 py-8">
|
>
|
||||||
{/* Stats Overview */}
|
{u.isAdmin ? "Demote" : "Make Admin"}
|
||||||
<div className="grid grid-cols-1 md:grid-cols-4 gap-4 mb-8">
|
</Button>
|
||||||
<Card>
|
</div>
|
||||||
<CardHeader className="flex flex-row items-center justify-between pb-2">
|
</div>
|
||||||
<CardTitle className="text-sm font-medium">Total Users</CardTitle>
|
))}
|
||||||
<Users className="h-4 w-4 text-muted-foreground" />
|
</div>
|
||||||
</CardHeader>
|
</div>
|
||||||
<CardContent>
|
</div>
|
||||||
<div className="text-2xl font-bold">{analytics?.users.total || 0}</div>
|
</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>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|||||||
+62
-94
@@ -13,7 +13,7 @@ import { Button } from "@/components/ui/button";
|
|||||||
|
|
||||||
export default function LandingPage() {
|
export default function LandingPage() {
|
||||||
return (
|
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
|
<div
|
||||||
className="fixed inset-0 pointer-events-none z-0 opacity-[0.06]"
|
className="fixed inset-0 pointer-events-none z-0 opacity-[0.06]"
|
||||||
style={{
|
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">
|
<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-16 items-center justify-between px-4">
|
<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 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">
|
<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-5 w-5 text-primary-foreground" />
|
<Egg className="h-6 w-6 text-primary-foreground" />
|
||||||
</div>
|
</div>
|
||||||
<span className="font-display text-xl tracking-tight">
|
<span className="font-display text-3xl tracking-tight uppercase italic text-primary">
|
||||||
CoopCredits
|
CoopCredits
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<nav className="hidden items-center gap-8 md:flex">
|
<nav className="hidden items-center gap-8 md:flex">
|
||||||
<a
|
<a
|
||||||
href="#features"
|
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
|
Features
|
||||||
</a>
|
</a>
|
||||||
<a
|
<a
|
||||||
href="#how-it-works"
|
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
|
How it Works
|
||||||
</a>
|
</a>
|
||||||
<Link href="/login">
|
<Link href="/login">
|
||||||
<Button variant="outline" size="sm" className="rounded-full px-6">
|
<Button
|
||||||
Dashboard
|
variant="outline"
|
||||||
|
size="lg"
|
||||||
|
className="rounded-full px-8 border-2 font-black"
|
||||||
|
>
|
||||||
|
LOGIN
|
||||||
</Button>
|
</Button>
|
||||||
</Link>
|
</Link>
|
||||||
</nav>
|
</nav>
|
||||||
<Link href="/login" className="md:hidden">
|
<Link href="/login" className="md:hidden">
|
||||||
<Button size="sm" className="rounded-full">
|
<Button size="sm" className="rounded-full font-black">
|
||||||
Login
|
LOGIN
|
||||||
</Button>
|
</Button>
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
@@ -64,13 +68,13 @@ export default function LandingPage() {
|
|||||||
<section className="overflow-hidden py-20 md:py-32">
|
<section className="overflow-hidden py-20 md:py-32">
|
||||||
<div className="container mx-auto px-4">
|
<div className="container mx-auto px-4">
|
||||||
<div className="mx-auto max-w-4xl space-y-8 text-center">
|
<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">
|
<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-3 w-3" /> Barnyard rewards
|
<Coins className="h-4 w-4" /> Barnyard rewards
|
||||||
</div>
|
</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">
|
<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">
|
||||||
Welcome to the Coop, Friend
|
Join the Flock!
|
||||||
</h1>
|
</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.
|
Earn $COOP automatically for every minute you watch on Plex.
|
||||||
Spend it like golden eggs to request movies and shows.
|
Spend it like golden eggs to request movies and shows.
|
||||||
</p>
|
</p>
|
||||||
@@ -78,19 +82,18 @@ export default function LandingPage() {
|
|||||||
<Link href="/login">
|
<Link href="/login">
|
||||||
<Button
|
<Button
|
||||||
size="lg"
|
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{" "}
|
Enter the Coop <ChevronRight className="ml-2 h-6 w-6" />
|
||||||
<ChevronRight className="ml-2 h-5 w-5 transition-transform group-hover:translate-x-1" />
|
|
||||||
</Button>
|
</Button>
|
||||||
</Link>
|
</Link>
|
||||||
<a href="#features">
|
<a href="#features">
|
||||||
<Button
|
<Button
|
||||||
size="lg"
|
size="lg"
|
||||||
variant="outline"
|
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>
|
</Button>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -98,93 +101,58 @@ export default function LandingPage() {
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</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="container mx-auto px-4">
|
||||||
<div className="mb-12 text-center">
|
<div className="mb-16 text-center">
|
||||||
<p className="text-sm font-bold uppercase tracking-[0.3em] text-primary">
|
<p className="text-lg font-black uppercase tracking-[0.3em] text-primary">
|
||||||
Why the flock likes it
|
Pecking Order
|
||||||
</p>
|
</p>
|
||||||
<h2 className="mt-3 font-display text-3xl md:text-5xl">
|
<h2 className="mt-3 font-display text-5xl md:text-7xl uppercase italic tracking-tighter">
|
||||||
Simple, warm, and built for watching
|
Simple. Fun. Fast.
|
||||||
</h2>
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
<div className="grid gap-6 md:grid-cols-3">
|
<div className="grid gap-8 md:grid-cols-3">
|
||||||
<div className="rounded-3xl border bg-background/80 p-6 shadow-sm">
|
<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">
|
||||||
<PlayCircle className="h-10 w-10 text-primary" />
|
<div className="bg-primary/10 w-16 h-16 rounded-2xl flex items-center justify-center mb-6">
|
||||||
<h3 className="mt-4 text-xl font-bold">Watch earns</h3>
|
<PlayCircle className="h-10 w-10 text-primary" />
|
||||||
<p className="mt-2 text-muted-foreground">
|
</div>
|
||||||
Every minute on Plex fills your nest with $COOP.
|
<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>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="rounded-3xl border bg-background/80 p-6 shadow-sm">
|
<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">
|
||||||
<Shield className="h-10 w-10 text-primary" />
|
<div className="bg-primary/10 w-16 h-16 rounded-2xl flex items-center justify-center mb-6">
|
||||||
<h3 className="mt-4 text-xl font-bold">Safe balance</h3>
|
<Shield className="h-10 w-10 text-primary" />
|
||||||
<p className="mt-2 text-muted-foreground">
|
</div>
|
||||||
Your credits live in the coop database and update fast.
|
<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>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="rounded-3xl border bg-background/80 p-6 shadow-sm">
|
<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">
|
||||||
<Zap className="h-10 w-10 text-primary" />
|
<div className="bg-primary/10 w-16 h-16 rounded-2xl flex items-center justify-center mb-6">
|
||||||
<h3 className="mt-4 text-xl font-bold">Request fast</h3>
|
<Zap className="h-10 w-10 text-primary" />
|
||||||
<p className="mt-2 text-muted-foreground">
|
</div>
|
||||||
Spend credits on movie and TV requests with a few taps.
|
<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>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section id="how-it-works" className="py-20">
|
<footer className="py-12 border-t-4 border-foreground bg-accent/20">
|
||||||
<div className="container mx-auto grid gap-10 px-4 lg:grid-cols-[1.1fr_0.9fr] lg:items-center">
|
<div className="container mx-auto px-4 text-center">
|
||||||
<div className="space-y-6">
|
<p className="font-black uppercase tracking-widest text-primary italic">
|
||||||
<p className="text-sm font-bold uppercase tracking-[0.3em] text-primary">
|
Keep on Peckin' © 2026
|
||||||
How it works
|
</p>
|
||||||
</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>
|
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</footer>
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user