StealThis .dev

Web3 — Token Balance Row (price · 24h · value)

A glassy Web3 wallet portfolio list where each token row pairs a gradient logo, monospace balance and unit price with a green or red 24h change, a sign-aware SVG sparkline and a right-aligned fiat value. A portfolio total header shows a weighted 24h delta, while controls let you sort by value or 24h change, toggle hide-small-balances, and watch every figure count up on load with hover-elevated rows. Mock data, fictional tokens, no on-chain calls.

在 Lab 中打开
html css vanilla-js
目标: JS HTML

代码

Token Balance Row (price · 24h · value)

A self-contained wallet portfolio component built for a Crypto/Web3 design system. A gradient-bordered header shows the total balance, a truncated monospace address (0x7a3f…c41d), the connected network chip, and a weighted 24h delta in green or red. Below it, a glassy card lists six fictional tokens — ETH, USDC, NOVA, ARB, LUMEN and DRIP — each as a row with a gradient logo circle, name and symbol, a monospace balance and unit price, a 24h change with an up/down arrow, a sign-aware SVG sparkline, and a right-aligned fiat value.

Interactions are pure vanilla JS. A segmented toggle re-sorts the list by portfolio value or by 24h change; a switch hides small balances (under a fiat threshold) and recomputes the total; and every fiat figure animates with a cubic count-up on load and on each re-render. Rows lift on hover, the sparkline fill tracks the change sign, and a small toast() helper confirms each action.

All numbers, addresses, hashes and amounts use JetBrains Mono with tabular figures, while Space Grotesk carries the UI. The layout stays usable down to ~360px (sparklines collapse, the total scales) and respects reduced-motion preferences. There is no wallet connection, RPC, ethers/web3 library, or price feed — the data is hardcoded and static.

UI-only simulation — no real wallet, RPC, or on-chain calls. Mock data, fictional tokens.