style: brutalist terminal dashboard

This commit is contained in:
2026-04-23 09:59:17 -04:00
parent daf21f67ad
commit 1cb5ad205e
2 changed files with 107 additions and 163 deletions
+75 -131
View File
@@ -2,17 +2,7 @@
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { useRouter } from "next/navigation"; import { useRouter } from "next/navigation";
import { import { Terminal } from "lucide-react";
BadgeDollarSign,
Clock3,
Loader2,
RefreshCw,
ShieldCheck,
PlusCircle,
History,
LayoutDashboard,
Trophy,
} from "lucide-react";
import { toast } from "sonner"; import { toast } from "sonner";
import { Button } from "@/components/ui/button"; import { Button } from "@/components/ui/button";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
@@ -59,7 +49,7 @@ export default function DashboardPage() {
setWallet(walletRes.data); setWallet(walletRes.data);
setPendingRequests(reqRes.data.requests || []); setPendingRequests(reqRes.data.requests || []);
} catch { } catch {
toast.error("Failed to load dashboard"); toast.error("ERR_DASH_LOAD");
} finally { } finally {
setIsLoading(false); setIsLoading(false);
} }
@@ -90,168 +80,123 @@ export default function DashboardPage() {
if (isLoading) if (isLoading)
return ( return (
<div className="flex min-h-screen items-center justify-center bg-background"> <div className="flex min-h-screen items-center justify-center bg-background font-mono text-primary">
<Loader2 className="h-10 w-10 animate-spin text-primary" /> _LOADING_COOP_V1.0.4
</div> </div>
); );
return ( return (
<div className="relative min-h-screen bg-background p-4 sm:p-8"> <div className="min-h-screen bg-background font-mono text-foreground p-2 sm:p-4 selection:bg-primary selection:text-primary-foreground">
<div className="pointer-events-none absolute inset-0 overflow-hidden"> <div className="mx-auto max-w-7xl border-2 border-foreground bg-card shadow-[4px_4px_0px_0px_rgba(0,0,0,1)]">
<div className="absolute -top-[10%] -left-[5%] h-[40%] w-[30%] rounded-full bg-secondary/30 blur-[120px]" /> <div className="flex items-center justify-between border-b-2 border-foreground bg-primary p-2 text-primary-foreground">
<div className="absolute -bottom-[10%] -right-[5%] h-[40%] w-[30%] rounded-full bg-primary/10 blur-[120px]" /> <div className="flex items-center gap-2 font-bold uppercase tracking-tighter">
<Terminal className="h-4 w-4" />
<span>COOP_STATION_V1 // {new Date().toLocaleDateString()}</span>
</div>
<div className="flex items-center gap-4 text-xs">
<button
type="button"
onClick={handleRefresh}
className="hover:underline"
>
[REFRESH]
</button>
<button
type="button"
onClick={handleLogout}
className="hover:underline"
>
[LOGOUT]
</button>
</div>
</div> </div>
<div className="relative mx-auto max-w-7xl space-y-8"> <div className="grid grid-cols-2 gap-0 border-b-2 border-foreground sm:grid-cols-4">
<div className="flex flex-col gap-6 md:flex-row md:items-center md:justify-between"> <div className="border-r-2 border-foreground p-3">
<div> <div className="text-[10px] uppercase text-muted-foreground underline">
<div className="flex items-center gap-2 text-xs font-bold uppercase tracking-[0.3em] text-primary/80"> User_Balance
<div className="h-1 w-4 bg-primary" />
Barnyard coop
</div> </div>
<h1 className="font-display text-4xl mt-1 text-foreground"> <div className="text-xl font-black">
Nest Dashboard {formatNumber(wallet?.balance || 0)} $COOP
</h1>
</div> </div>
</div>
<div className="flex items-center gap-3"> <div className="border-r-2 border-foreground p-3 bg-secondary/20">
<div className="text-[10px] uppercase text-muted-foreground underline">
In_Transit
</div>
<div className="text-xl font-black">
{pendingRequests.length} PKTS
</div>
</div>
<div className="border-r-2 border-foreground p-3 hidden sm:block">
<div className="text-[10px] uppercase text-muted-foreground underline">
Sys_Costs
</div>
<div className="text-xl font-black">
{requestCosts.movie}/{requestCosts.tv}
</div>
</div>
<div className="p-3 bg-primary/10">
<Button <Button
onClick={() => setIsSearchModalOpen(true)} onClick={() => setIsSearchModalOpen(true)}
size="lg" className="h-full w-full rounded-none border-2 border-foreground bg-primary font-bold uppercase shadow-[2px_2px_0px_0px_rgba(0,0,0,1)] hover:translate-x-[1px] hover:translate-y-[1px] hover:shadow-none transition-none"
className="rounded-full px-8 shadow-lg shadow-primary/20 hover:scale-105 transition-transform"
> >
<PlusCircle className="mr-2 h-5 w-5" /> [+] NEW_REQ
Request feed
</Button>
<Button
variant="outline"
size="icon"
onClick={handleRefresh}
className="rounded-full border-primary/20 bg-card/50 text-primary hover:bg-primary/10"
>
<RefreshCw className="h-5 w-5" />
</Button>
<Button
variant="ghost"
onClick={handleLogout}
className="text-muted-foreground hover:text-destructive"
>
Logout
</Button> </Button>
</div> </div>
</div> </div>
<div className="grid gap-6 lg:grid-cols-[1fr_380px]"> <div className="grid lg:grid-cols-[1fr_300px]">
<div className="space-y-6"> <div className="border-r-2 border-foreground min-h-[600px]">
<div className="grid grid-cols-2 gap-4 sm:grid-cols-3">
<div className="rounded-[2rem] bg-secondary/40 p-6 border border-secondary/20 shadow-sm transition-all hover:shadow-md">
<div className="flex items-center gap-3 text-secondary-foreground/60">
<ShieldCheck className="h-4 w-4" />
<span className="text-[10px] uppercase tracking-widest font-bold">
Nest Egg
</span>
</div>
<div className="mt-3 text-4xl font-bold text-foreground leading-none">
{formatNumber(wallet?.balance || 0)}
<span className="ml-2 text-sm text-muted-foreground">
$COOP
</span>
</div>
</div>
<div className="rounded-[2rem] bg-accent/20 p-6 border border-accent/20 shadow-sm transition-all hover:shadow-md">
<div className="flex items-center gap-3 text-accent-foreground/60">
<Clock3 className="h-4 w-4" />
<span className="text-[10px] uppercase tracking-widest font-bold">
In Transit
</span>
</div>
<div className="mt-3 text-4xl font-bold text-foreground leading-none">
{pendingRequests.length}
<span className="ml-2 text-sm text-muted-foreground text-opacity-70">
Pipes
</span>
</div>
</div>
<div className="hidden rounded-[2rem] bg-card p-6 border shadow-sm transition-all hover:shadow-md sm:block">
<div className="flex items-center gap-3 text-muted-foreground">
<BadgeDollarSign className="h-4 w-4" />
<span className="text-[10px] uppercase tracking-widest font-bold">
Costs
</span>
</div>
<div className="mt-3 text-2xl font-bold text-foreground leading-none">
{requestCosts.movie} / {requestCosts.tv}
<div className="mt-1 text-[10px] text-muted-foreground">
Movie / TV
</div>
</div>
</div>
</div>
<div className="rounded-[2.5rem] bg-card/60 p-2 border border-primary/5 shadow-inner backdrop-blur-md">
<Tabs defaultValue="history" className="w-full"> <Tabs defaultValue="history" className="w-full">
<TabsList className="grid w-full grid-cols-3 rounded-[2rem] bg-muted/50 p-1"> <TabsList className="flex w-full rounded-none border-b-2 border-foreground bg-muted p-0">
<TabsTrigger <TabsTrigger
value="history" value="history"
className="rounded-[1.5rem] py-3 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=active]:shadow-lg" className="flex-1 rounded-none border-r-2 border-foreground py-2 font-bold uppercase data-[state=active]:bg-background data-[state=active]:text-primary data-[state=active]:shadow-none transition-none"
> >
<History className="mr-2 h-4 w-4" /> HIST
History
</TabsTrigger> </TabsTrigger>
<TabsTrigger <TabsTrigger
value="requests" value="requests"
className="rounded-[1.5rem] py-3 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=active]:shadow-lg" className="flex-1 rounded-none border-r-2 border-foreground py-2 font-bold uppercase data-[state=active]:bg-background data-[state=active]:text-primary data-[state=active]:shadow-none transition-none"
> >
<LayoutDashboard className="mr-2 h-4 w-4" /> REQS
Requests
</TabsTrigger> </TabsTrigger>
<TabsTrigger <TabsTrigger
value="leaderboard" value="leaderboard"
className="rounded-[1.5rem] py-3 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=active]:shadow-lg" className="flex-1 rounded-none py-2 font-bold uppercase data-[state=active]:bg-background data-[state=active]:text-primary data-[state=active]:shadow-none transition-none"
> >
<Trophy className="mr-2 h-4 w-4" /> FLCK
Flock
</TabsTrigger> </TabsTrigger>
</TabsList> </TabsList>
<div className="p-4 sm:p-6"> <div className="p-4">
<TabsContent <TabsContent value="history" className="mt-0">
value="history"
className="mt-0 focus-visible:outline-none"
>
<WatchHistory /> <WatchHistory />
</TabsContent> </TabsContent>
<TabsContent <TabsContent value="requests" className="mt-0">
value="requests"
className="mt-0 focus-visible:outline-none"
>
<RequestHistory onRefresh={handleRefresh} /> <RequestHistory onRefresh={handleRefresh} />
</TabsContent> </TabsContent>
<TabsContent <TabsContent value="leaderboard" className="mt-0">
value="leaderboard"
className="mt-0 focus-visible:outline-none"
>
<Leaderboard /> <Leaderboard />
</TabsContent> </TabsContent>
</div> </div>
</Tabs> </Tabs>
</div> </div>
</div>
<div className="space-y-6"> <div className="bg-muted/30">
<div className="rounded-[2.5rem] bg-card/80 p-6 border border-primary/5 shadow-xl backdrop-blur-md"> <div className="border-b-2 border-foreground bg-secondary/40 p-2 font-bold uppercase text-[10px] tracking-widest">
<div className="mb-6 flex items-center justify-between"> &gt;&gt; SYSTEM_LOG
<h3 className="font-display text-2xl text-foreground">
Barn Noise
</h3>
<div className="h-2 w-2 animate-pulse rounded-full bg-primary" />
</div> </div>
<div className="max-h-[600px] overflow-y-auto pr-2 scrollbar-hide"> <div className="p-2 text-[11px] leading-tight">
<ActivityFeed /> <ActivityFeed />
</div> </div>
</div> </div>
</div> </div>
<div className="border-t-2 border-foreground bg-muted p-1 text-[9px] uppercase flex justify-between px-2">
<span>COOP OS // ALL_SYSTEMS_GO</span>
<span>LATENCY: 42MS // BH: {wallet?.totalEarned || 0}</span>
</div>
</div> </div>
<SearchRequestModal <SearchRequestModal
@@ -260,6 +205,5 @@ export default function DashboardPage() {
costs={requestCosts} costs={requestCosts}
/> />
</div> </div>
</div>
); );
} }
+2 -2
View File
@@ -1,8 +1,8 @@
@import "tailwindcss"; @import "tailwindcss";
@theme { @theme {
--font-sans: var(--font-inter), ui-sans-serif, system-ui, sans-serif; --font-sans: "JetBrains Mono", "Fira Code", monospace;
--font-display: var(--font-abril), Georgia, "Times New Roman", serif; --font-display: "JetBrains Mono", monospace;
--color-border: hsl(var(--border)); --color-border: hsl(var(--border));
--color-input: hsl(var(--input)); --color-input: hsl(var(--input));