diff --git a/src/admin-panel.js b/src/admin-panel.js index b44f6cc..69d2280 100644 --- a/src/admin-panel.js +++ b/src/admin-panel.js @@ -496,6 +496,7 @@ document.addEventListener('keydown', (e) => { document.querySelectorAll('.modal-overlay.active').forEach(m => m.classList.remove('active')); } }); + `; diff --git a/src/dashboard.js b/src/dashboard.js index ed1f020..aded40f 100644 --- a/src/dashboard.js +++ b/src/dashboard.js @@ -358,6 +358,13 @@ function buildHTML(data, agente, isAgentDashboard = true, diasPeriodo = null, as .netting-kpi-grid { grid-template-columns: repeat(2, 1fr); } } @media (max-width: 900px) { + .trading-terminal { padding: 12px 16px; } + .live-rate-bar { flex-wrap: wrap; gap: 12px; } + .terminal-title { display: none; } + .rate-pair-group { padding: 6px 10px; } + .live-rate-btn { min-width: 100px; padding: 6px 12px; } + .live-rate-btn .rate-value { font-size: 16px; } + .rate-separator { display: none; } .charts-grid { grid-template-columns: 1fr; } .charts-grid-3 { grid-template-columns: 1fr; } .chart-card.full-width { grid-column: span 1; } @@ -367,6 +374,14 @@ function buildHTML(data, agente, isAgentDashboard = true, diasPeriodo = null, as .header-inner { padding: 16px 20px; flex-direction: column; gap: 12px; } } @media (max-width: 600px) { + .trading-terminal { padding: 10px 12px; } + .live-rate-bar { gap: 8px; } + .rate-pair-label { font-size: 9px; } + .live-rate-btn { min-width: 80px; padding: 5px 8px; } + .live-rate-btn .rate-value { font-size: 14px; } + .live-rate-btn .rate-type { font-size: 7px; } + .rate-flags { font-size: 8px; } + .live-rate-time { font-size: 8px; } .kpi-grid { grid-template-columns: 1fr; } .portfolio-kpi-grid { grid-template-columns: 1fr; } .netting-kpi-grid { grid-template-columns: 1fr; } @@ -604,12 +619,14 @@ async function fetchLiveRate() { const usd = json.USDBRL; const eur = json.EURBRL; if (usd) { - const bid = parseFloat(usd.bid), ask = parseFloat(usd.ask); + const bidRaw = parseFloat(usd.bid), askRaw = parseFloat(usd.ask); + const bid = bidRaw * (1 - 0.0043); // compra: -0.38% -5bps = -0.43% + const ask = askRaw * (1 + 0.0005); // venda: +5bps = +0.05% const elC = document.getElementById('rateUsdCompra'), elV = document.getElementById('rateUsdVenda'); elC.textContent = bid.toFixed(4); elV.textContent = ask.toFixed(4); - if (_lastUsdBid !== null && bid !== _lastUsdBid) pulseEl(elC); - if (_lastUsdAsk !== null && ask !== _lastUsdAsk) pulseEl(elV); - _lastUsdBid = bid; _lastUsdAsk = ask; + if (_lastUsdBid !== null && bidRaw !== _lastUsdBid) pulseEl(elC); + if (_lastUsdAsk !== null && askRaw !== _lastUsdAsk) pulseEl(elV); + _lastUsdBid = bidRaw; _lastUsdAsk = askRaw; } if (eur) { const bid = parseFloat(eur.bid), ask = parseFloat(eur.ask);