Dashboard V9: Simplified Clean Design - No Sidebar
- REMOVED: Sidebar navigation (no added value) - LAYOUT: Clean centered content, full width - METRICS: Minimum 2 tiles per row (Portfolio + USDT) - DESKTOP: 3 tiles in row (Portfolio, USDT, Positions) - MOBILE: 2x2 grid layout (always 2 per row) - DESIGN: Same grayscale + green accents - TABLES: Live Prices + Holdings sections below - PERFORMANCE: Smooth animations, loading optimized - RESPONSIVE: Modern CSS Grid with minmax - TYPOGRAPHY: Fluid scaling via clamp() - FOOTER: None (clean end) - VERSION: V9 ENHANCED
This commit is contained in:
parent
b7b311e3cf
commit
ec1e7213cc
|
|
@ -103,7 +103,7 @@ async def root():
|
|||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
|
||||
<title>Trading Bot V8</title>
|
||||
<title>Trading Bot V9</title>
|
||||
<style>
|
||||
:root {{
|
||||
--bg-primary: #1a1a1a;
|
||||
|
|
@ -138,113 +138,43 @@ body {{
|
|||
}}
|
||||
|
||||
.app-container {{
|
||||
display: flex;
|
||||
width: 100%;
|
||||
min-height: 100vh;
|
||||
flex-direction: row;
|
||||
}}
|
||||
|
||||
/* ===== SIDEBAR ===== */
|
||||
.sidebar {{
|
||||
width: 260px;
|
||||
background: var(--bg-secondary);
|
||||
border-right: 1px solid var(--border);
|
||||
padding: var(--spacing);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow-y: auto;
|
||||
transition: transform 0.3s ease;
|
||||
}}
|
||||
|
||||
.sidebar-header {{
|
||||
font-size: clamp(12px, 3vw, 14px);
|
||||
font-weight: bold;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 1px;
|
||||
color: var(--accent);
|
||||
margin-bottom: calc(var(--spacing) * 1.5);
|
||||
padding-bottom: calc(var(--spacing) * 0.75);
|
||||
border-bottom: 1px solid var(--border);
|
||||
}}
|
||||
|
||||
.sidebar-item {{
|
||||
padding: calc(var(--spacing) * 0.75) var(--spacing);
|
||||
margin-bottom: 0.5rem;
|
||||
font-size: clamp(12px, 2vw, 13px);
|
||||
color: var(--text-secondary);
|
||||
cursor: pointer;
|
||||
border-radius: 4px;
|
||||
transition: all 0.2s;
|
||||
border-left: 2px solid transparent;
|
||||
padding-left: calc(var(--spacing) * 0.75);
|
||||
}}
|
||||
|
||||
.sidebar-item:hover {{
|
||||
background: var(--bg-hover);
|
||||
color: var(--accent);
|
||||
}}
|
||||
|
||||
.sidebar-item.active {{
|
||||
background: var(--bg-tertiary);
|
||||
color: var(--accent);
|
||||
border-left-color: var(--accent);
|
||||
}}
|
||||
|
||||
.menu-toggle {{
|
||||
display: none;
|
||||
background: var(--bg-tertiary);
|
||||
border: 1px solid var(--border);
|
||||
color: var(--accent);
|
||||
padding: calc(var(--spacing) * 0.75);
|
||||
cursor: pointer;
|
||||
border-radius: 4px;
|
||||
font-size: 18px;
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-bottom: var(--spacing);
|
||||
}}
|
||||
|
||||
/* ===== MAIN CONTENT ===== */
|
||||
.main {{
|
||||
flex: 1;
|
||||
padding: calc(var(--spacing) * 1.5);
|
||||
overflow-y: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}}
|
||||
|
||||
.header {{
|
||||
margin-bottom: calc(var(--spacing) * 2);
|
||||
margin-bottom: calc(var(--spacing) * 2.5);
|
||||
}}
|
||||
|
||||
.logo {{
|
||||
font-size: clamp(20px, 5vw, 28px);
|
||||
font-size: clamp(24px, 6vw, 32px);
|
||||
font-weight: bold;
|
||||
color: var(--accent);
|
||||
margin-bottom: 0.25rem;
|
||||
margin-bottom: 0.5rem;
|
||||
}}
|
||||
|
||||
.version {{
|
||||
font-size: clamp(11px, 2vw, 12px);
|
||||
font-size: clamp(11px, 2vw, 13px);
|
||||
color: var(--text-secondary);
|
||||
}}
|
||||
|
||||
/* ===== METRICS GRID ===== */
|
||||
.metrics-grid {{
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
||||
gap: calc(var(--spacing) * 1.25);
|
||||
margin-bottom: calc(var(--spacing) * 2.5);
|
||||
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
||||
gap: calc(var(--spacing) * 1.5);
|
||||
margin-bottom: calc(var(--spacing) * 3);
|
||||
}}
|
||||
|
||||
.metric-card {{
|
||||
background: var(--bg-tertiary);
|
||||
border: 1px solid var(--border);
|
||||
padding: calc(var(--spacing) * 1.25);
|
||||
border-radius: 6px;
|
||||
padding: calc(var(--spacing) * 1.5);
|
||||
border-radius: 8px;
|
||||
transition: all 0.3s ease;
|
||||
cursor: pointer;
|
||||
min-height: 120px;
|
||||
min-height: 140px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
|
|
@ -257,18 +187,19 @@ body {{
|
|||
.metric-card:hover {{
|
||||
background: var(--bg-hover);
|
||||
border-color: var(--accent);
|
||||
box-shadow: 0 0 20px rgba(0, 255, 136, 0.1);
|
||||
}}
|
||||
|
||||
.metric-label {{
|
||||
font-size: clamp(10px, 1.5vw, 11px);
|
||||
font-size: clamp(11px, 1.5vw, 12px);
|
||||
color: var(--text-secondary);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
margin-bottom: 0.75rem;
|
||||
letter-spacing: 0.8px;
|
||||
margin-bottom: 1rem;
|
||||
}}
|
||||
|
||||
.metric-value {{
|
||||
font-size: clamp(18px, 4vw, 28px);
|
||||
font-size: clamp(20px, 5vw, 32px);
|
||||
font-weight: bold;
|
||||
color: var(--text-primary);
|
||||
word-break: break-word;
|
||||
|
|
@ -280,15 +211,15 @@ body {{
|
|||
|
||||
/* ===== SECTIONS ===== */
|
||||
.section {{
|
||||
margin-bottom: calc(var(--spacing) * 2.5);
|
||||
margin-bottom: calc(var(--spacing) * 3);
|
||||
}}
|
||||
|
||||
.section-title {{
|
||||
font-size: clamp(12px, 2.5vw, 14px);
|
||||
font-size: clamp(13px, 2.5vw, 15px);
|
||||
color: var(--text-secondary);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 1px;
|
||||
margin-bottom: var(--spacing);
|
||||
letter-spacing: 1.2px;
|
||||
margin-bottom: calc(var(--spacing) * 1.25);
|
||||
padding-bottom: calc(var(--spacing) * 0.75);
|
||||
border-bottom: 1px solid var(--border);
|
||||
}}
|
||||
|
|
@ -297,30 +228,32 @@ body {{
|
|||
.table-wrapper {{
|
||||
overflow-x: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
border-radius: 6px;
|
||||
border-radius: 8px;
|
||||
border: 1px solid var(--border);
|
||||
background: var(--bg-tertiary);
|
||||
}}
|
||||
|
||||
table {{
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
font-size: clamp(11px, 2vw, 13px);
|
||||
font-size: clamp(12px, 2vw, 14px);
|
||||
}}
|
||||
|
||||
th {{
|
||||
background: var(--bg-tertiary);
|
||||
color: var(--text-secondary);
|
||||
padding: calc(var(--spacing) * 0.75);
|
||||
padding: calc(var(--spacing) * 1);
|
||||
text-align: left;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
letter-spacing: 0.6px;
|
||||
border-bottom: 1px solid var(--border);
|
||||
white-space: nowrap;
|
||||
font-size: clamp(10px, 1.5vw, 12px);
|
||||
}}
|
||||
|
||||
td {{
|
||||
padding: calc(var(--spacing) * 0.75);
|
||||
padding: calc(var(--spacing) * 0.875);
|
||||
border-bottom: 1px solid var(--border);
|
||||
}}
|
||||
|
||||
|
|
@ -328,12 +261,16 @@ tr:last-child td {{
|
|||
border-bottom: none;
|
||||
}}
|
||||
|
||||
tbody tr {{
|
||||
transition: background 0.2s ease;
|
||||
}}
|
||||
|
||||
tbody tr:hover {{
|
||||
background: var(--bg-hover);
|
||||
}}
|
||||
|
||||
tbody tr:active {{
|
||||
background: var(--bg-tertiary);
|
||||
background: var(--bg-secondary);
|
||||
}}
|
||||
|
||||
.price-positive {{
|
||||
|
|
@ -342,9 +279,9 @@ tbody tr:active {{
|
|||
}}
|
||||
|
||||
/* ===== RESPONSIVE ===== */
|
||||
@media (max-width: 1024px) {{
|
||||
@media (max-width: 1200px) {{
|
||||
.metrics-grid {{
|
||||
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
|
||||
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
||||
}}
|
||||
}}
|
||||
|
||||
|
|
@ -354,29 +291,7 @@ tbody tr:active {{
|
|||
}}
|
||||
|
||||
.app-container {{
|
||||
flex-direction: column;
|
||||
}}
|
||||
|
||||
.sidebar {{
|
||||
width: 100%;
|
||||
border-right: none;
|
||||
border-bottom: 1px solid var(--border);
|
||||
padding: var(--spacing);
|
||||
max-height: 0;
|
||||
overflow: hidden;
|
||||
transition: max-height 0.3s ease;
|
||||
}}
|
||||
|
||||
.sidebar.active {{
|
||||
max-height: 500px;
|
||||
}}
|
||||
|
||||
.menu-toggle {{
|
||||
display: flex;
|
||||
}}
|
||||
|
||||
.main {{
|
||||
padding: var(--spacing);
|
||||
padding: calc(var(--spacing) * 1.25);
|
||||
}}
|
||||
|
||||
.metrics-grid {{
|
||||
|
|
@ -384,17 +299,31 @@ tbody tr:active {{
|
|||
gap: var(--spacing);
|
||||
}}
|
||||
|
||||
.section {{
|
||||
margin-bottom: var(--spacing);
|
||||
.metric-card {{
|
||||
padding: var(--spacing);
|
||||
min-height: 120px;
|
||||
}}
|
||||
|
||||
th, td {{
|
||||
padding: calc(var(--spacing) * 0.6);
|
||||
font-size: 11px;
|
||||
.metric-label {{
|
||||
margin-bottom: 0.75rem;
|
||||
font-size: 10px;
|
||||
}}
|
||||
|
||||
.metric-value {{
|
||||
font-size: clamp(16px, 3vw, 22px);
|
||||
font-size: clamp(18px, 4vw, 26px);
|
||||
}}
|
||||
|
||||
.section {{
|
||||
margin-bottom: calc(var(--spacing) * 1.75);
|
||||
}}
|
||||
|
||||
th, td {{
|
||||
padding: calc(var(--spacing) * 0.75);
|
||||
font-size: 11px;
|
||||
}}
|
||||
|
||||
th {{
|
||||
font-size: 10px;
|
||||
}}
|
||||
}}
|
||||
|
||||
|
|
@ -403,44 +332,54 @@ tbody tr:active {{
|
|||
--spacing: 0.75rem;
|
||||
}}
|
||||
|
||||
.sidebar {{
|
||||
padding: calc(var(--spacing) * 0.75);
|
||||
}}
|
||||
|
||||
.main {{
|
||||
padding: calc(var(--spacing) * 0.75);
|
||||
.app-container {{
|
||||
padding: var(--spacing);
|
||||
}}
|
||||
|
||||
.metrics-grid {{
|
||||
grid-template-columns: 1fr;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
gap: calc(var(--spacing) * 0.75);
|
||||
}}
|
||||
|
||||
.metric-card {{
|
||||
padding: var(--spacing);
|
||||
min-height: 100px;
|
||||
padding: calc(var(--spacing) * 0.875);
|
||||
min-height: 110px;
|
||||
}}
|
||||
|
||||
.metric-label {{
|
||||
font-size: 9px;
|
||||
margin-bottom: 0.5rem;
|
||||
letter-spacing: 0.5px;
|
||||
}}
|
||||
|
||||
.metric-value {{
|
||||
font-size: clamp(14px, 2.5vw, 18px);
|
||||
font-size: clamp(16px, 3.5vw, 22px);
|
||||
}}
|
||||
|
||||
.logo {{
|
||||
font-size: clamp(20px, 5vw, 26px);
|
||||
}}
|
||||
|
||||
.version {{
|
||||
font-size: 10px;
|
||||
}}
|
||||
|
||||
.section-title {{
|
||||
font-size: 11px;
|
||||
margin-bottom: calc(var(--spacing) * 0.75);
|
||||
margin-bottom: var(--spacing);
|
||||
}}
|
||||
|
||||
th, td {{
|
||||
padding: calc(var(--spacing) * 0.5);
|
||||
font-size: 10px;
|
||||
padding: calc(var(--spacing) * 0.6);
|
||||
font-size: 9px;
|
||||
}}
|
||||
|
||||
table {{
|
||||
font-size: 10px;
|
||||
th {{
|
||||
font-size: 8px;
|
||||
}}
|
||||
|
||||
.logo {{
|
||||
font-size: clamp(18px, 4vw, 24px);
|
||||
.table-wrapper {{
|
||||
border-radius: 6px;
|
||||
}}
|
||||
}}
|
||||
|
||||
|
|
@ -462,77 +401,90 @@ tbody tr:active {{
|
|||
::-webkit-scrollbar-thumb:hover {{
|
||||
background: var(--text-secondary);
|
||||
}}
|
||||
|
||||
/* ===== ANIMATIONS ===== */
|
||||
@keyframes fadeIn {{
|
||||
from {{
|
||||
opacity: 0;
|
||||
transform: translateY(10px);
|
||||
}}
|
||||
to {{
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}}
|
||||
}}
|
||||
|
||||
.metric-card {{
|
||||
animation: fadeIn 0.5s ease forwards;
|
||||
}}
|
||||
|
||||
.metric-card:nth-child(2) {{
|
||||
animation-delay: 0.1s;
|
||||
}}
|
||||
|
||||
.metric-card:nth-child(3) {{
|
||||
animation-delay: 0.2s;
|
||||
}}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="app-container">
|
||||
<button class="menu-toggle" onclick="toggleSidebar()">☰</button>
|
||||
|
||||
<div class="sidebar" id="sidebar">
|
||||
<div class="sidebar-header">⚙️ Status</div>
|
||||
<div class="sidebar-item active">🟢 Running</div>
|
||||
<div class="sidebar-item">📊 Analytics</div>
|
||||
<div class="sidebar-item">⚡ Performance</div>
|
||||
<div class="sidebar-item">🔧 Settings</div>
|
||||
<div class="header">
|
||||
<div class="logo">💰 Trading Bot</div>
|
||||
<div class="version">V9 — Real-time Portfolio Dashboard</div>
|
||||
</div>
|
||||
|
||||
<div class="main">
|
||||
<div class="header">
|
||||
<div class="logo">💰 Trading Bot</div>
|
||||
<div class="version">V8 — Real-time Portfolio</div>
|
||||
<div class="metrics-grid">
|
||||
<div class="metric-card">
|
||||
<div class="metric-label">Portfolio Value</div>
|
||||
<div class="metric-value">${portfolio_val:.2f}</div>
|
||||
</div>
|
||||
|
||||
<div class="metrics-grid">
|
||||
<div class="metric-card">
|
||||
<div class="metric-label">Portfolio Value</div>
|
||||
<div class="metric-value">${portfolio_val:.2f}</div>
|
||||
</div>
|
||||
<div class="metric-card">
|
||||
<div class="metric-label">USDT Available</div>
|
||||
<div class="metric-value accent">${usdt_free:.2f}</div>
|
||||
</div>
|
||||
<div class="metric-card">
|
||||
<div class="metric-label">Open Positions</div>
|
||||
<div class="metric-value">{trades_count}</div>
|
||||
</div>
|
||||
<div class="metric-card">
|
||||
<div class="metric-label">USDT Available</div>
|
||||
<div class="metric-value accent">${usdt_free:.2f}</div>
|
||||
</div>
|
||||
<div class="metric-card">
|
||||
<div class="metric-label">Open Positions</div>
|
||||
<div class="metric-value">{trades_count}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<div class="section-title">Live Prices</div>
|
||||
<div class="table-wrapper">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Asset</th>
|
||||
<th>Price</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>'''
|
||||
<div class="section">
|
||||
<div class="section-title">Live Prices</div>
|
||||
<div class="table-wrapper">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Asset</th>
|
||||
<th>Price</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>'''
|
||||
|
||||
for asset, price in prices.items():
|
||||
html += f'''<tr>
|
||||
<td>{asset}</td>
|
||||
<td class="price-positive">${price:.2f}</td>
|
||||
</tr>'''
|
||||
<td>{asset}</td>
|
||||
<td class="price-positive">${price:.2f}</td>
|
||||
</tr>'''
|
||||
|
||||
html += '''</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<div class="section-title">Holdings</div>
|
||||
<div class="table-wrapper">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Asset</th>
|
||||
<th>Free</th>
|
||||
<th>Total</th>
|
||||
<th>Value</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>'''
|
||||
<div class="section">
|
||||
<div class="section-title">Holdings</div>
|
||||
<div class="table-wrapper">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Asset</th>
|
||||
<th>Free</th>
|
||||
<th>Total</th>
|
||||
<th>Value</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>'''
|
||||
|
||||
tracked = ['BTC', 'ETH', 'SOL', 'BNB', 'XRP', 'USDT', 'USDC']
|
||||
balance = state.get('balance', {})
|
||||
|
|
@ -543,33 +495,19 @@ tbody tr:active {{
|
|||
price = prices.get(asset, 0)
|
||||
value = data['total'] * price
|
||||
html += f'''<tr>
|
||||
<td>{asset}</td>
|
||||
<td>{data['free']:.4f}</td>
|
||||
<td>{data['total']:.4f}</td>
|
||||
<td class="price-positive">${value:.2f}</td>
|
||||
</tr>'''
|
||||
<td>{asset}</td>
|
||||
<td>{data['free']:.4f}</td>
|
||||
<td>{data['total']:.4f}</td>
|
||||
<td class="price-positive">${value:.2f}</td>
|
||||
</tr>'''
|
||||
|
||||
html += '''</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function toggleSidebar() {{
|
||||
const sidebar = document.getElementById('sidebar');
|
||||
sidebar.classList.toggle('active');
|
||||
}}
|
||||
|
||||
document.addEventListener('click', function(event) {{
|
||||
const sidebar = document.getElementById('sidebar');
|
||||
const toggle = document.querySelector('.menu-toggle');
|
||||
if (!sidebar.contains(event.target) && !toggle.contains(event.target)) {{
|
||||
sidebar.classList.remove('active');
|
||||
}}
|
||||
}});
|
||||
|
||||
// Refresh prices every 5 seconds
|
||||
setInterval(function() {{
|
||||
location.reload();
|
||||
|
|
|
|||
Loading…
Reference in New Issue