feat: revamp dashboard, trades, and add landing/legal pages

- Major UI updates across dashboard, analytics, posts, trades, settings
- New landing page, robots/sitemap, contact/privacy/terms pages
- Updated globals.css with extensive styling and new landing.css
- Refactor signedRequest, realtime data hook, and dashboard store

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
k
2026-04-25 16:04:57 +08:00
parent 83e5892ddf
commit 040e1df685
28 changed files with 4133 additions and 690 deletions
+457 -11
View File
@@ -6,6 +6,7 @@
/* Surfaces — warm off-whites */
--bg: oklch(99% 0.004 85);
--bg-sunk: oklch(97.8% 0.006 85);
--bg-elev: #ffffff;
--surface: #ffffff;
--surface-2: oklch(97.2% 0.006 85);
--surface-3: oklch(94% 0.008 85);
@@ -54,6 +55,7 @@
html[data-theme="dark"] {
--bg: oklch(15% 0.008 85);
--bg-sunk: oklch(12% 0.008 85);
--bg-elev: oklch(20% 0.008 85);
--surface: oklch(18% 0.008 85);
--surface-2: oklch(21% 0.008 85);
--surface-3: oklch(25% 0.01 85);
@@ -271,6 +273,31 @@ html[data-theme="dark"] .asset-switch button.on { background: var(--surface-2);
background: linear-gradient(135deg, var(--amber), oklch(65% 0.2 35));
}
.wallet-menu {
display: none;
position: absolute;
right: 0;
top: calc(100% + 6px);
min-width: 180px;
padding: 6px;
z-index: 1000;
background: var(--bg-elev);
border: 1px solid var(--line);
border-radius: var(--r-sm);
box-shadow: var(--shadow-2);
}
.wallet-menu.open { display: block; }
.wallet-menu button {
width: 100%;
padding: 8px 10px;
font-size: 13px;
text-align: left;
border-radius: 6px;
color: var(--ink);
}
.wallet-menu button:hover { background: var(--bg-sunk); }
.wallet-menu button.danger { color: var(--down); }
/* ============================================================
Page shell
============================================================ */
@@ -405,6 +432,158 @@ html[data-theme="dark"] .asset-switch button.on { background: var(--surface-2);
.delta.up { color: oklch(42% 0.16 148); }
.delta.down { color: oklch(46% 0.2 25); }
/* ── iOS-style toggle switch ──────────────────────────────── */
.switch {
position: relative;
display: inline-block;
width: 34px;
height: 20px;
flex-shrink: 0;
}
.switch input {
opacity: 0;
width: 0;
height: 0;
}
.switch-track {
position: absolute;
cursor: pointer;
top: 0; left: 0; right: 0; bottom: 0;
background: var(--line-2);
border-radius: 999px;
transition: background 160ms;
}
.switch-track::before {
content: '';
position: absolute;
height: 16px;
width: 16px;
left: 2px;
top: 2px;
background: #fff;
border-radius: 50%;
transition: transform 160ms;
box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.switch input:checked + .switch-track { background: var(--amber); }
.switch input:checked + .switch-track::before { transform: translateX(14px); }
.switch.up input:checked + .switch-track { background: var(--up); }
.switch.down input:checked + .switch-track { background: var(--down); }
/* ── Form row: label | control, strict-aligned ─────────────── */
.form-row {
display: grid;
grid-template-columns: 200px 1fr;
align-items: center;
gap: 24px;
padding: 14px 0;
}
.form-row + .form-row { border-top: 1px solid var(--line); }
.form-row-label {
font-size: 13px;
font-weight: 500;
color: var(--ink);
}
.form-row-label .hint {
display: block;
font-size: 11px;
font-weight: 400;
color: var(--ink-4);
margin-top: 3px;
}
.form-row-control {
display: flex;
align-items: center;
gap: 10px;
min-width: 0;
}
/* ── Section divider with label ────────────────────────────── */
.section-head {
display: flex;
align-items: center;
gap: 12px;
margin: 10px 0 2px;
padding-top: 18px;
border-top: 1px solid var(--line);
}
.section-head:first-child { border-top: 0; padding-top: 0; }
.section-head-label {
font-size: 11px;
font-weight: 600;
letter-spacing: 0.08em;
text-transform: uppercase;
color: var(--ink-4);
}
/* ── Inline $ prefix input ─────────────────────────────────── */
.num-field {
display: inline-flex;
align-items: center;
background: var(--bg-sunk);
border: 1px solid var(--line);
border-radius: var(--r-sm);
padding: 0 10px;
transition: border-color 120ms, background 120ms;
}
.num-field:focus-within { border-color: var(--amber-ring); background: var(--bg); }
.num-field[data-disabled='true'] { opacity: 0.4; pointer-events: none; }
.num-field .prefix, .num-field .suffix {
font-size: 12px;
color: var(--ink-3);
font-family: var(--mono);
}
.num-field input {
border: 0;
background: transparent;
font-family: var(--mono);
font-size: 13px;
padding: 8px 6px;
width: 80px;
outline: none;
color: var(--ink);
}
.num-field input::-webkit-inner-spin-button,
.num-field input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
/* ── Slider: unified look ──────────────────────────────────── */
.slider-field { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.slider-field input[type=range] {
-webkit-appearance: none;
width: 100%;
height: 4px;
background: var(--line-2);
border-radius: 999px;
outline: none;
}
.slider-field input[type=range]::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 16px;
height: 16px;
background: var(--amber);
border: 2px solid var(--bg);
border-radius: 50%;
box-shadow: 0 1px 3px rgba(0,0,0,0.18);
cursor: pointer;
}
.slider-field .ticks {
display: flex;
justify-content: space-between;
font-size: 10px;
color: var(--ink-4);
font-variant-numeric: tabular-nums;
}
.slider-readout {
font-family: var(--mono);
font-size: 14px;
font-weight: 600;
min-width: 48px;
text-align: right;
color: var(--ink);
font-variant-numeric: tabular-nums;
}
/* ============================================================
Dashboard specific
============================================================ */
@@ -607,6 +786,70 @@ html[data-theme="dark"] .asset-switch button.on { background: var(--surface-2);
transition: width 600ms ease-out;
}
.ai-metric-head {
display: flex;
justify-content: space-between;
align-items: baseline;
gap: 12px;
margin-bottom: 8px;
font-size: 13px;
color: var(--ink-3);
}
.ai-metric-head strong {
font-size: 18px;
line-height: 1;
color: var(--ink);
font-family: var(--mono);
font-weight: 600;
letter-spacing: -0.02em;
}
.ai-reasoning-label {
display: inline-flex;
align-items: center;
gap: 8px;
margin-bottom: 10px;
font-size: 12px;
font-weight: 700;
letter-spacing: 0.12em;
text-transform: uppercase;
color: var(--amber-ink);
}
.ai-reasoning-label::before {
content: '';
width: 8px;
height: 8px;
border-radius: 999px;
background: linear-gradient(135deg, var(--amber), oklch(68% 0.2 45));
box-shadow: 0 0 0 4px color-mix(in oklab, var(--amber) 18%, transparent);
}
.ai-reasoning-card {
padding: 16px 18px;
background:
linear-gradient(180deg, color-mix(in oklab, var(--amber-soft) 55%, var(--surface)) 0%, var(--bg-sunk) 100%);
border-radius: 18px;
border: 1px solid color-mix(in oklab, var(--amber-ring) 55%, var(--line));
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), var(--shadow-1);
font-size: 15px;
line-height: 1.78;
color: var(--ink);
}
.ai-reasoning-card.scroll {
max-height: 180px;
overflow-y: auto;
padding-right: 14px;
}
html[data-theme="dark"] .ai-reasoning-card {
background:
linear-gradient(180deg, color-mix(in oklab, var(--amber-soft) 30%, var(--surface-2)) 0%, var(--surface) 100%);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), var(--shadow-1);
}
/* Bot status */
.bot-status {
background: linear-gradient(160deg, oklch(22% 0.01 85) 0%, oklch(14% 0.01 85) 100%);
@@ -672,19 +915,31 @@ html[data-theme="dark"] .asset-switch button.on { background: var(--surface-2);
gap: 10px;
}
.post-row {
display: flex;
flex-direction: column;
background: var(--surface);
border: 1px solid var(--line);
border-radius: var(--r-md);
transition: border-color 120ms, background 120ms;
cursor: pointer;
overflow: hidden;
}
.post-row:hover { border-color: var(--line-2); }
.post-row.selected { border-color: var(--amber-ring); background: oklch(99% 0.02 85); }
.post-row-main {
display: grid;
grid-template-columns: 36px 1fr auto;
gap: 14px;
padding: 14px 16px;
background: var(--surface);
border: 1px solid var(--line);
border-radius: var(--r-md);
align-items: flex-start;
transition: border-color 120ms, background 120ms;
cursor: pointer;
}
.post-row:hover { border-color: var(--line-2); }
.post-row.selected { border-color: var(--amber-ring); background: oklch(99% 0.02 85); }
.post-row-detail {
border-top: 1px solid var(--line);
padding: 14px 16px;
display: flex;
flex-direction: column;
gap: 14px;
}
.src-ico {
width: 36px;
height: 36px;
@@ -827,6 +1082,7 @@ html[data-theme="dark"] .asset-switch button.on { background: var(--surface-2);
border-radius: var(--r-sm);
padding: 11px 14px;
font-size: 14px;
width: 100%;
outline: none;
transition: border-color 120ms, box-shadow 120ms;
color: var(--ink);
@@ -836,7 +1092,7 @@ html[data-theme="dark"] .asset-switch button.on { background: var(--surface-2);
box-shadow: 0 0 0 3px oklch(88% 0.12 80 / 0.4);
}
.switch {
.settings-switch {
--w: 40px;
width: var(--w);
height: 24px;
@@ -848,7 +1104,7 @@ html[data-theme="dark"] .asset-switch button.on { background: var(--surface-2);
border: 1px solid var(--line);
flex-shrink: 0;
}
.switch::after {
.settings-switch::after {
content: '';
position: absolute;
top: 2px;
@@ -860,11 +1116,11 @@ html[data-theme="dark"] .asset-switch button.on { background: var(--surface-2);
box-shadow: var(--shadow-1);
transition: transform 180ms;
}
.switch.on {
.settings-switch.on {
background: var(--ink);
border-color: var(--ink);
}
.switch.on::after { transform: translateX(16px); }
.settings-switch.on::after { transform: translateX(16px); }
.setting-row {
display: flex;
@@ -884,6 +1140,196 @@ html[data-theme="dark"] .asset-switch button.on { background: var(--surface-2);
gap: 16px;
}
@media (max-width: 1180px) {
.dash-grid {
grid-template-columns: 1fr;
}
.rail {
order: -1;
}
}
@media (max-width: 900px) {
.nav {
height: auto;
min-height: 64px;
padding: 12px 18px;
flex-wrap: wrap;
gap: 12px;
}
.brand {
flex: 1;
}
.nav-tabs {
order: 3;
width: 100%;
overflow-x: auto;
justify-content: flex-start;
}
.nav-right {
margin-left: auto;
}
.page {
padding: 24px 18px 64px;
}
.page-head {
align-items: flex-start;
flex-direction: column;
gap: 12px;
}
.page-title {
font-size: 28px;
}
.kpi-row,
.metric-grid {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
.settings-grid,
.form-row {
grid-template-columns: 1fr;
gap: 10px;
}
.settings-side {
position: static;
}
.chart-footnote {
flex-wrap: wrap;
}
.chart-footnote > div:last-child {
margin-left: 0 !important;
width: 100%;
}
.table {
min-width: 760px;
}
.card.flush {
overflow-x: auto !important;
}
}
@media (max-width: 900px) {
.nav-tabs {
/* Edge-to-edge horizontal scroll with snap on mobile */
margin: 0 -18px;
padding: 0 18px;
gap: 4px;
scroll-snap-type: x proximity;
-webkit-overflow-scrolling: touch;
scrollbar-width: none;
}
.nav-tabs::-webkit-scrollbar { display: none; }
.nav-tab {
flex: 0 0 auto;
scroll-snap-align: start;
padding: 8px 12px;
font-size: 13px;
}
}
@media (max-width: 640px) {
.nav {
padding: 10px 14px;
}
.brand span:last-child {
display: none;
}
.connect-btn.lg {
padding: 9px 12px;
font-size: 13px;
}
.wallet-chip {
padding: 6px 10px !important;
font-size: 12px;
}
.page {
padding: 20px 14px 56px;
}
.kpi-row,
.metric-grid {
grid-template-columns: 1fr;
}
.row.between {
align-items: flex-start;
}
.post-row-main {
grid-template-columns: 32px 1fr;
}
.post-aside {
grid-column: 2;
align-items: flex-start;
min-width: 0;
}
.src-ico {
width: 32px;
height: 32px;
}
.chart-wrap,
.chart-wrap > div {
height: 300px !important;
}
.hero-value {
font-size: 34px;
}
.asset-switch,
.tf-bar {
max-width: 100%;
overflow-x: auto;
}
footer {
flex-wrap: wrap;
padding: 18px 14px !important;
}
.card[style*='grid-template-columns: 1fr auto'] {
grid-template-columns: 1fr !important;
}
/* Tables: horizontal-scroll with subtle hint rather than page overflow */
.card.flush { border-radius: 10px; }
.table { font-size: 12px; }
.table th, .table td { padding: 10px 12px !important; }
/* Modals / dialogs on small screens */
.modal, .dialog { width: calc(100vw - 24px) !important; max-width: calc(100vw - 24px) !important; }
}
@media (max-width: 380px) {
.nav { padding: 8px 12px; }
.page { padding: 16px 12px 48px; }
.page-title { font-size: 24px; }
.hero-value { font-size: 28px; }
.connect-btn.lg { padding: 8px 10px; font-size: 12px; }
}
/* Global safety: no page-level horizontal scroll */
html, body { max-width: 100%; overflow-x: hidden; }
/* Misc utilities */
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }