diff --git a/.gitignore b/.gitignore index a547bf3..9bef1b4 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ yarn-error.log* pnpm-debug.log* lerna-debug.log* +package-lock.json node_modules dist dist-ssr diff --git a/bun.lockb b/bun.lockb index 402d8f9..f6aed1c 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/index.html b/index.html index 743db32..f672aab 100644 --- a/index.html +++ b/index.html @@ -8,7 +8,7 @@ - +
diff --git a/package.json b/package.json index 63aae88..98f3a00 100644 --- a/package.json +++ b/package.json @@ -14,12 +14,14 @@ "@noir-lang/backend_barretenberg": "^0.30.0", "@noir-lang/noir_js": "^0.30.0", "asn1.js": "^5.4.1", + "chart.js": "^4.4.8", "dotenv": "^16.4.5", "face-api.js": "^0.22.2", "pkijs": "^3.2.4", "protobufjs": "^7.4.0", "rollup-plugin-copy": "^3.5.0", "vue": "^3.5.13", + "vue-chartjs": "^5.3.2", "vue-router": "^4.5.0" }, "devDependencies": { @@ -31,7 +33,7 @@ "rollup-plugin-visualizer": "^5.12.0", "tailwindcss": "^3.4.15", "typescript": "^5.7.2", - "vite": "^5.4.11", + "vite": "^5.4.14", "vue-tsc": "^2.1.10" } } diff --git a/src/App.vue b/src/App.vue index 276cb20..f5ef77f 100644 --- a/src/App.vue +++ b/src/App.vue @@ -15,7 +15,7 @@ h3, h4, h5, h6 { - @apply font-anton uppercase; + @apply font-display uppercase; } h1 { @@ -27,27 +27,27 @@ h2 { } body { - @apply bg-primary; + @apply bg-background text-foreground; } button { - @apply bg-gray-900 font-anton uppercase rounded-lg px-4 py-2 text-white; + @apply font-display uppercase rounded-xl transition-all duration-200; } -button:hover:not(:disabled) { - @apply tracking-widest; +button:not([class*="bg-"]) { + @apply bg-white/80 backdrop-blur-sm border border-white/20 text-secondary hover:bg-secondary/5; } button:active:not(:disabled) { - @apply bg-secondary text-primary; + @apply bg-primary/10 text-primary border-primary/20; } button:disabled { - @apply bg-gray-500 text-opacity-50; + @apply opacity-50 cursor-not-allowed; } p a { - @apply border-b-2 border-secondary; + @apply border-b-2 border-primary; } i.spinner { @@ -58,14 +58,14 @@ i.spinner { input, select, textarea { - @apply text-primary font-mono p-2 rounded-lg leading-snug; + @apply text-foreground font-text p-2 rounded-lg leading-snug; } input[type="file"] { - @apply text-secondary text-sm; + @apply text-neutral text-sm; } label { - @apply font-anton bg-opacity-50 bg-black px-2 rounded-t-lg; + @apply font-display bg-secondary/10 px-2 rounded-t-lg text-secondary; } diff --git a/src/explorer/Block.vue b/src/explorer/Block.vue index e6741a8..fc7d08e 100644 --- a/src/explorer/Block.vue +++ b/src/explorer/Block.vue @@ -1,5 +1,5 @@ + + diff --git a/src/explorer/Blocks.vue b/src/explorer/Blocks.vue new file mode 100644 index 0000000..7be4304 --- /dev/null +++ b/src/explorer/Blocks.vue @@ -0,0 +1,159 @@ + + + \ No newline at end of file diff --git a/src/explorer/Contract.vue b/src/explorer/Contract.vue index dda4ddd..0efb87b 100644 --- a/src/explorer/Contract.vue +++ b/src/explorer/Contract.vue @@ -14,16 +14,99 @@ watchEffect(() => { }); const data = computed(() => contractStore.value.data?.[contract_name.value]); + +const tabs = [ + { name: 'Overview', active: true }, + { name: 'Raw JSON', active: false } +]; + + diff --git a/src/explorer/Header.vue b/src/explorer/Header.vue index b6a3b4e..8c12c47 100644 --- a/src/explorer/Header.vue +++ b/src/explorer/Header.vue @@ -1,24 +1,9 @@ + diff --git a/src/explorer/Transaction.vue b/src/explorer/Transaction.vue index edf83ee..98077b7 100644 --- a/src/explorer/Transaction.vue +++ b/src/explorer/Transaction.vue @@ -1,34 +1,151 @@ + + diff --git a/src/explorer/Transactions.vue b/src/explorer/Transactions.vue new file mode 100644 index 0000000..a2fa838 --- /dev/null +++ b/src/explorer/Transactions.vue @@ -0,0 +1,27 @@ + + + \ No newline at end of file diff --git a/src/explorer/components/Navbar.vue b/src/explorer/components/Navbar.vue new file mode 100644 index 0000000..2901c0a --- /dev/null +++ b/src/explorer/components/Navbar.vue @@ -0,0 +1,66 @@ + + + \ No newline at end of file diff --git a/src/explorer/components/NetworkChart.vue b/src/explorer/components/NetworkChart.vue new file mode 100644 index 0000000..0d214aa --- /dev/null +++ b/src/explorer/components/NetworkChart.vue @@ -0,0 +1,97 @@ + + + \ No newline at end of file diff --git a/src/main.ts b/src/main.ts index 83a978c..bc9fe36 100644 --- a/src/main.ts +++ b/src/main.ts @@ -6,6 +6,8 @@ import Home from "@/explorer/Home.vue"; import Transaction from "./explorer/Transaction.vue"; import Block from "./explorer/Block.vue"; import Contract from "./explorer/Contract.vue"; +import Blocks from "./explorer/Blocks.vue"; +import Transactions from "./explorer/Transactions.vue"; const routes = [ { path: "/", component: Home, name: "Home" }, @@ -19,6 +21,16 @@ const routes = [ component: Block, name: "Block", }, + { + path: "/blocks", + component: Blocks, + name: "Blocks", + }, + { + path: "/transactions", + component: Transactions, + name: "Transactions", + }, { path: "/contract/:contract_name", component: Contract, diff --git a/src/state/transactions.ts b/src/state/transactions.ts index ee9bd19..f9a4bd1 100644 --- a/src/state/transactions.ts +++ b/src/state/transactions.ts @@ -32,5 +32,6 @@ export class TransactionStore { const response = await fetch(`${getNetworkApiUrl(this.network)}/v1/indexer/transaction/hash/${tx_hash}?no_cache=${Date.now()}`); let item = await response.json(); this.data[item.tx_hash] = item; + return item; } } diff --git a/src/style.css b/src/style.css index 5f16e3c..f3b6392 100644 --- a/src/style.css +++ b/src/style.css @@ -4,8 +4,40 @@ @layer base { :root { + --background: #F8F9FA; + --foreground: #1E2933; --color-primary: 224 72 46; --color-secondary: 245 245 245; --color-secondary-darker: 225 225 225; } } + +@layer components { + .card { + @apply bg-white rounded-2xl shadow-card p-6 transition-all duration-200 hover:shadow-lg; + } + + .section-title { + @apply text-2xl font-display font-bold text-secondary mb-4; + } + + .link-item { + @apply p-4 rounded-xl transition-all duration-200 hover:bg-neutral/5; + } + + .hash-text { + @apply font-mono text-xs text-neutral hover:text-primary transition-colors; + } + + .stat-card { + @apply bg-white/50 backdrop-blur-sm p-4 rounded-xl border border-white/20 shadow-sm; + } + + .data-grid { + @apply grid gap-4 md:grid-cols-2 lg:grid-cols-3; + } + + .list-item { + @apply flex items-center space-x-3 p-3 rounded-lg hover:bg-secondary/5 transition-colors; + } +} diff --git a/tailwind.config.js b/tailwind.config.js index ad8527f..f2010b9 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -4,14 +4,25 @@ export default { theme: { extend: { colors: { - primary: "rgb(var(--color-primary) / )", - secondary: "rgb(var(--color-secondary) / )", - "secondary-darker": "rgb(var(--color-secondary-darker) / )", + background: "var(--background)", + foreground: "var(--foreground)", + primary: "#DF6445", // Coral/Orange + secondary: "#1E2933", // Dark Blue/Navy + neutral: "#516273", // Gray/Slate + black: "#000000", // Pure Black + white: "#FFFFFF", // Pure White }, fontFamily: { - text: ["Roboto", "sans-serif"], - anton: ['"Anton"', "sans-serif"], + text: ["Inter", "sans-serif"], + display: ["Montserrat", "sans-serif"], }, + borderRadius: { + 'xl': '1rem', + '2xl': '1.5rem', + }, + boxShadow: { + 'card': '0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)', + } }, }, plugins: [],