Spaces:
Sleeping
Sleeping
frontend build fixed
Browse files- frontend/src/App.jsx +84 -3
- frontend/tailwind.config.js +13 -0
frontend/src/App.jsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
import React, { useState, useEffect } from 'react';
|
| 2 |
import axios from 'axios';
|
| 3 |
-
import { Search, Share2, Activity, Database, Zap, Wallet, ChevronRight, Terminal, Layers, Hash } from 'lucide-react';
|
| 4 |
import { motion, AnimatePresence } from 'framer-motion';
|
| 5 |
import PersonaChart from './components/PersonaChart';
|
| 6 |
import RoastCard from './components/RoastCard';
|
|
@@ -8,6 +8,79 @@ import Logo from './assets/logo.svg';
|
|
| 8 |
|
| 9 |
const API_BASE = import.meta.env.VITE_API_URL || "http://localhost:8000";
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
function StatusCycler() {
|
| 12 |
const [msgIndex, setMsgIndex] = useState(0);
|
| 13 |
const messages = [
|
|
@@ -40,6 +113,7 @@ function App() {
|
|
| 40 |
const [status, setStatus] = useState("idle");
|
| 41 |
const [data, setData] = useState(null);
|
| 42 |
const [errorMsg, setErrorMsg] = useState("");
|
|
|
|
| 43 |
|
| 44 |
const analyzeWallet = async () => {
|
| 45 |
if (!wallet.startsWith("0x")) {
|
|
@@ -96,8 +170,10 @@ function App() {
|
|
| 96 |
};
|
| 97 |
|
| 98 |
return (
|
| 99 |
-
<div className="h-screen flex flex-col overflow-hidden bg-bg-main text-sm">
|
| 100 |
|
|
|
|
|
|
|
| 101 |
{/* 1. Compact Top Navigation Bar (Command Deck Layout) */}
|
| 102 |
<header className="h-auto md:h-14 border-b border-border bg-bg-panel flex flex-col md:flex-row items-stretch md:items-center px-4 py-3 md:py-0 gap-3 md:gap-0 justify-between shrink-0 z-20">
|
| 103 |
|
|
@@ -111,7 +187,12 @@ function App() {
|
|
| 111 |
CLUSTER<span className="text-text-secondary">PROTOCOL</span>
|
| 112 |
</h1>
|
| 113 |
</div>
|
| 114 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 115 |
</div>
|
| 116 |
|
| 117 |
{/* Deck 2: Command Line (Search) */}
|
|
|
|
| 1 |
import React, { useState, useEffect } from 'react';
|
| 2 |
import axios from 'axios';
|
| 3 |
+
import { Search, Share2, Activity, Database, Zap, Wallet, ChevronRight, Terminal, Layers, Hash, Info, X } from 'lucide-react';
|
| 4 |
import { motion, AnimatePresence } from 'framer-motion';
|
| 5 |
import PersonaChart from './components/PersonaChart';
|
| 6 |
import RoastCard from './components/RoastCard';
|
|
|
|
| 8 |
|
| 9 |
const API_BASE = import.meta.env.VITE_API_URL || "http://localhost:8000";
|
| 10 |
|
| 11 |
+
function InfoModal({ onClose }) {
|
| 12 |
+
return (
|
| 13 |
+
<div className="fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/80 backdrop-blur-sm">
|
| 14 |
+
<div className="w-full max-w-2xl bg-bg-panel border border-border shadow-2xl relative max-h-[90vh] overflow-y-auto">
|
| 15 |
+
<button
|
| 16 |
+
onClick={onClose}
|
| 17 |
+
className="absolute top-3 right-3 text-text-secondary hover:text-text-primary"
|
| 18 |
+
>
|
| 19 |
+
<X size={20} />
|
| 20 |
+
</button>
|
| 21 |
+
|
| 22 |
+
<div className="p-6 space-y-6">
|
| 23 |
+
<div className="border-b border-border pb-4">
|
| 24 |
+
<h2 className="text-xl font-mono font-bold text-text-primary flex items-center gap-2">
|
| 25 |
+
<Info size={20} className="text-accent" />
|
| 26 |
+
SYSTEM PROTOCOLS
|
| 27 |
+
</h2>
|
| 28 |
+
<p className="text-xs text-text-secondary font-mono mt-1">OPERATIONAL CONSTRAINTS & SPECIFICATIONS</p>
|
| 29 |
+
</div>
|
| 30 |
+
|
| 31 |
+
<div className="space-y-4 font-mono text-xs md:text-sm text-text-primary/90">
|
| 32 |
+
|
| 33 |
+
<section>
|
| 34 |
+
<h3 className="font-bold text-accent mb-1">1. NETWORK: ETHEREUM MAINNET ONLY</h3>
|
| 35 |
+
<ul className="list-disc pl-5 space-y-1 text-text-secondary">
|
| 36 |
+
<li>Compatible: Ethereum Mainnet (L1).</li>
|
| 37 |
+
<li>Incompatible: Base, Arbitrum, Optimism, Polygon, Solana, Bitcoin.</li>
|
| 38 |
+
<li>Result: Wallets active only on L2s will show 0 activity.</li>
|
| 39 |
+
</ul>
|
| 40 |
+
</section>
|
| 41 |
+
|
| 42 |
+
<section>
|
| 43 |
+
<h3 className="font-bold text-accent mb-1">2. ENTITY RECOGNITION</h3>
|
| 44 |
+
<ul className="list-disc pl-5 space-y-1 text-text-secondary">
|
| 45 |
+
<li>Optimized for: <strong>User Wallets (EOA)</strong>.</li>
|
| 46 |
+
<li>Supported: Smart Contracts (data retrieval works).</li>
|
| 47 |
+
<li>Warning: Analyzing Contracts (e.g., Uniswap Router) may yield skewed "Whale" personas due to pooled funds.</li>
|
| 48 |
+
</ul>
|
| 49 |
+
</section>
|
| 50 |
+
|
| 51 |
+
<section>
|
| 52 |
+
<h3 className="font-bold text-accent mb-1">3. ASSET COVERAGE</h3>
|
| 53 |
+
<ul className="list-disc pl-5 space-y-1 text-text-secondary">
|
| 54 |
+
<li>Native ETH: 100% Coverage.</li>
|
| 55 |
+
<li>ERC-20 Tokens: 100% Coverage (USDC, PEPE, UNI, etc.).</li>
|
| 56 |
+
<li>NFTs: ERC-721 & ERC-1155 Standard.</li>
|
| 57 |
+
</ul>
|
| 58 |
+
</section>
|
| 59 |
+
|
| 60 |
+
<section>
|
| 61 |
+
<h3 className="font-bold text-accent mb-1">4. TEMPORAL HORIZON (OPTIMIZATION)</h3>
|
| 62 |
+
<ul className="list-disc pl-5 space-y-1 text-text-secondary">
|
| 63 |
+
<li>ETH Txs: <strong>Full History (Since 2015)</strong>. Accurate age/gas stats.</li>
|
| 64 |
+
<li>DeFi/NFTs: <strong>Post-2018 Analysis</strong>. Ignores experimental pre-2018 token activity for query speed.</li>
|
| 65 |
+
</ul>
|
| 66 |
+
</section>
|
| 67 |
+
|
| 68 |
+
</div>
|
| 69 |
+
|
| 70 |
+
<div className="pt-4 border-t border-border flex justify-end">
|
| 71 |
+
<button
|
| 72 |
+
onClick={onClose}
|
| 73 |
+
className="px-6 py-2 bg-accent text-black font-bold font-mono text-xs uppercase tracking-wider hover:bg-amber-400 transition-colors"
|
| 74 |
+
>
|
| 75 |
+
ACKNOWLEDGE
|
| 76 |
+
</button>
|
| 77 |
+
</div>
|
| 78 |
+
</div>
|
| 79 |
+
</div>
|
| 80 |
+
</div>
|
| 81 |
+
);
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
function StatusCycler() {
|
| 85 |
const [msgIndex, setMsgIndex] = useState(0);
|
| 86 |
const messages = [
|
|
|
|
| 113 |
const [status, setStatus] = useState("idle");
|
| 114 |
const [data, setData] = useState(null);
|
| 115 |
const [errorMsg, setErrorMsg] = useState("");
|
| 116 |
+
const [showInfo, setShowInfo] = useState(false);
|
| 117 |
|
| 118 |
const analyzeWallet = async () => {
|
| 119 |
if (!wallet.startsWith("0x")) {
|
|
|
|
| 170 |
};
|
| 171 |
|
| 172 |
return (
|
| 173 |
+
<div className="h-screen flex flex-col overflow-hidden bg-bg-main text-sm relative">
|
| 174 |
|
| 175 |
+
{showInfo && <InfoModal onClose={() => setShowInfo(false)} />}
|
| 176 |
+
|
| 177 |
{/* 1. Compact Top Navigation Bar (Command Deck Layout) */}
|
| 178 |
<header className="h-auto md:h-14 border-b border-border bg-bg-panel flex flex-col md:flex-row items-stretch md:items-center px-4 py-3 md:py-0 gap-3 md:gap-0 justify-between shrink-0 z-20">
|
| 179 |
|
|
|
|
| 187 |
CLUSTER<span className="text-text-secondary">PROTOCOL</span>
|
| 188 |
</h1>
|
| 189 |
</div>
|
| 190 |
+
<div className="flex items-center gap-2">
|
| 191 |
+
<span className="px-2 py-0.5 rounded-full bg-border text-[10px] text-text-secondary font-mono">v2.1.0</span>
|
| 192 |
+
<button onClick={() => setShowInfo(true)} className="text-text-secondary hover:text-accent transition-colors">
|
| 193 |
+
<Info size={16} />
|
| 194 |
+
</button>
|
| 195 |
+
</div>
|
| 196 |
</div>
|
| 197 |
|
| 198 |
{/* Deck 2: Command Line (Search) */}
|
frontend/tailwind.config.js
CHANGED
|
@@ -11,6 +11,19 @@ export default {
|
|
| 11 |
sans: ['"Space Mono"', 'monospace'], // Force mono everywhere for this look
|
| 12 |
},
|
| 13 |
colors: {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
retro: {
|
| 15 |
bg: '#050505', // Void Black
|
| 16 |
surface: '#111111', // Dark Gray
|
|
|
|
| 11 |
sans: ['"Space Mono"', 'monospace'], // Force mono everywhere for this look
|
| 12 |
},
|
| 13 |
colors: {
|
| 14 |
+
// Map App.jsx classes to Retro Theme
|
| 15 |
+
bg: {
|
| 16 |
+
main: '#050505',
|
| 17 |
+
panel: '#111111',
|
| 18 |
+
},
|
| 19 |
+
border: '#333333',
|
| 20 |
+
text: {
|
| 21 |
+
primary: '#e5e5e5', // Almost white
|
| 22 |
+
secondary: '#888888', // Muted gray
|
| 23 |
+
},
|
| 24 |
+
accent: '#ffb000', // Amber
|
| 25 |
+
|
| 26 |
+
// Original Retro Palette (kept for reference)
|
| 27 |
retro: {
|
| 28 |
bg: '#050505', // Void Black
|
| 29 |
surface: '#111111', // Dark Gray
|