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
+105 -161
View File
@@ -2,17 +2,7 @@
import { useEffect, useState } from "react";
import { useRouter } from "next/navigation";
import {
BadgeDollarSign,
Clock3,
Loader2,
RefreshCw,
ShieldCheck,
PlusCircle,
History,
LayoutDashboard,
Trophy,
} from "lucide-react";
import { Terminal } from "lucide-react";
import { toast } from "sonner";
import { Button } from "@/components/ui/button";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
@@ -59,7 +49,7 @@ export default function DashboardPage() {
setWallet(walletRes.data);
setPendingRequests(reqRes.data.requests || []);
} catch {
toast.error("Failed to load dashboard");
toast.error("ERR_DASH_LOAD");
} finally {
setIsLoading(false);
}
@@ -90,176 +80,130 @@ export default function DashboardPage() {
if (isLoading)
return (
<div className="flex min-h-screen items-center justify-center bg-background">
<Loader2 className="h-10 w-10 animate-spin text-primary" />
<div className="flex min-h-screen items-center justify-center bg-background font-mono text-primary">
_LOADING_COOP_V1.0.4
</div>
);
return (
<div className="relative min-h-screen bg-background p-4 sm:p-8">
<div className="pointer-events-none absolute inset-0 overflow-hidden">
<div className="absolute -top-[10%] -left-[5%] h-[40%] w-[30%] rounded-full bg-secondary/30 blur-[120px]" />
<div className="absolute -bottom-[10%] -right-[5%] h-[40%] w-[30%] rounded-full bg-primary/10 blur-[120px]" />
</div>
<div className="relative mx-auto max-w-7xl space-y-8">
<div className="flex flex-col gap-6 md:flex-row md:items-center md:justify-between">
<div>
<div className="flex items-center gap-2 text-xs font-bold uppercase tracking-[0.3em] text-primary/80">
<div className="h-1 w-4 bg-primary" />
Barnyard coop
</div>
<h1 className="font-display text-4xl mt-1 text-foreground">
Nest Dashboard
</h1>
<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="mx-auto max-w-7xl border-2 border-foreground bg-card shadow-[4px_4px_0px_0px_rgba(0,0,0,1)]">
<div className="flex items-center justify-between border-b-2 border-foreground bg-primary p-2 text-primary-foreground">
<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 className="flex items-center gap-3">
<div className="grid grid-cols-2 gap-0 border-b-2 border-foreground sm:grid-cols-4">
<div className="border-r-2 border-foreground p-3">
<div className="text-[10px] uppercase text-muted-foreground underline">
User_Balance
</div>
<div className="text-xl font-black">
{formatNumber(wallet?.balance || 0)} $COOP
</div>
</div>
<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
onClick={() => setIsSearchModalOpen(true)}
size="lg"
className="rounded-full px-8 shadow-lg shadow-primary/20 hover:scale-105 transition-transform"
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"
>
<PlusCircle className="mr-2 h-5 w-5" />
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
[+] NEW_REQ
</Button>
</div>
</div>
<div className="grid gap-6 lg:grid-cols-[1fr_380px]">
<div className="space-y-6">
<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 className="grid lg:grid-cols-[1fr_300px]">
<div className="border-r-2 border-foreground min-h-[600px]">
<Tabs defaultValue="history" className="w-full">
<TabsList className="flex w-full rounded-none border-b-2 border-foreground bg-muted p-0">
<TabsTrigger
value="history"
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"
>
HIST
</TabsTrigger>
<TabsTrigger
value="requests"
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"
>
REQS
</TabsTrigger>
<TabsTrigger
value="leaderboard"
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"
>
FLCK
</TabsTrigger>
</TabsList>
<div className="p-4">
<TabsContent value="history" className="mt-0">
<WatchHistory />
</TabsContent>
<TabsContent value="requests" className="mt-0">
<RequestHistory onRefresh={handleRefresh} />
</TabsContent>
<TabsContent value="leaderboard" className="mt-0">
<Leaderboard />
</TabsContent>
</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">
<TabsList className="grid w-full grid-cols-3 rounded-[2rem] bg-muted/50 p-1">
<TabsTrigger
value="history"
className="rounded-[1.5rem] py-3 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=active]:shadow-lg"
>
<History className="mr-2 h-4 w-4" />
History
</TabsTrigger>
<TabsTrigger
value="requests"
className="rounded-[1.5rem] py-3 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=active]:shadow-lg"
>
<LayoutDashboard className="mr-2 h-4 w-4" />
Requests
</TabsTrigger>
<TabsTrigger
value="leaderboard"
className="rounded-[1.5rem] py-3 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=active]:shadow-lg"
>
<Trophy className="mr-2 h-4 w-4" />
Flock
</TabsTrigger>
</TabsList>
<div className="p-4 sm:p-6">
<TabsContent
value="history"
className="mt-0 focus-visible:outline-none"
>
<WatchHistory />
</TabsContent>
<TabsContent
value="requests"
className="mt-0 focus-visible:outline-none"
>
<RequestHistory onRefresh={handleRefresh} />
</TabsContent>
<TabsContent
value="leaderboard"
className="mt-0 focus-visible:outline-none"
>
<Leaderboard />
</TabsContent>
</div>
</Tabs>
</div>
</Tabs>
</div>
<div className="space-y-6">
<div className="rounded-[2.5rem] bg-card/80 p-6 border border-primary/5 shadow-xl backdrop-blur-md">
<div className="mb-6 flex items-center justify-between">
<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 className="max-h-[600px] overflow-y-auto pr-2 scrollbar-hide">
<ActivityFeed />
</div>
<div className="bg-muted/30">
<div className="border-b-2 border-foreground bg-secondary/40 p-2 font-bold uppercase text-[10px] tracking-widest">
&gt;&gt; SYSTEM_LOG
</div>
<div className="p-2 text-[11px] leading-tight">
<ActivityFeed />
</div>
</div>
</div>
<SearchRequestModal
open={isSearchModalOpen}
onOpenChange={setIsSearchModalOpen}
costs={requestCosts}
/>
<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>
<SearchRequestModal
open={isSearchModalOpen}
onOpenChange={setIsSearchModalOpen}
costs={requestCosts}
/>
</div>
);
}
+2 -2
View File
@@ -1,8 +1,8 @@
@import "tailwindcss";
@theme {
--font-sans: var(--font-inter), ui-sans-serif, system-ui, sans-serif;
--font-display: var(--font-abril), Georgia, "Times New Roman", serif;
--font-sans: "JetBrains Mono", "Fira Code", monospace;
--font-display: "JetBrains Mono", monospace;
--color-border: hsl(var(--border));
--color-input: hsl(var(--input));