quantumtrade-matrix / portfolio.html
jsonet's picture
Desarrolle e implemente completamente una interfaz de usuario y experiencia UX/UI de vanguardia implementando el c贸digo en diferentes paginas independientes interconectadas, para la aplicaci贸n detallada en los siguientes diagramas, cumpliendo con los siguientes requisitos t茅cnicos y de dise帽o:
08ce598 verified
<!DOCTYPE html>
<html lang="en" class="dark">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Portfolio - QuantumTrade Matrix</title>
<link rel="icon" type="image/x-icon" href="/static/favicon.ico">
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/animejs/lib/anime.iife.min.js"></script>
<script src="https://unpkg.com/feather-icons"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<style>
.glass-morphism {
background: rgba(15, 23, 42, 0.7);
backdrop-filter: blur(10px);
border: 1px solid rgba(255, 255, 255, 0.1);
}
.trading-card {
background: linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(30, 41, 59, 0.9) 100%);
border: 1px solid rgba(59, 130, 246, 0.3);
transition: all 0.3s ease;
}
.trading-card:hover {
transform: translateY(-2px);
box-shadow: 0 10px 30px rgba(59, 130, 246, 0.3);
}
.quantum-button {
background: linear-gradient(45deg, #3b82f6, #8b5cf6);
transition: all 0.3s ease;
}
.quantum-button:hover {
transform: translateY(-1px);
box-shadow: 0 5px 20px rgba(139, 92, 246, 0.4);
}
.sidebar-item {
transition: all 0.3s ease;
border-left: 3px solid transparent;
}
.sidebar-item:hover {
background: rgba(59, 130, 246, 0.1);
border-left-color: #3b82f6;
}
.sidebar-item.active {
background: rgba(59, 130, 246, 0.2);
border-left-color: #3b82f6;
}
.portfolio-card {
background: linear-gradient(135deg, rgba(15, 23, 42, 0.8) 0%, rgba(30, 41, 59, 0.8) 100%);
border: 1px solid rgba(255, 255, 255, 0.1);
transition: all 0.3s ease;
}
.portfolio-card:hover {
transform: translateY(-3px);
box-shadow: 0 15px 40px rgba(59, 130, 246, 0.2);
}
.asset-row {
background: rgba(59, 130, 246, 0.05);
border: 1px solid rgba(59, 130, 246, 0.1);
transition: all 0.3s ease;
}
.asset-row:hover {
background: rgba(59, 130, 246, 0.1);
border-color: rgba(59, 130, 246, 0.3);
}
.profit-positive {
color: #10b981;
background: rgba(16, 185, 129, 0.1);
}
.profit-negative {
color: #ef4444;
background: rgba(239, 68, 68, 0.1);
}
.chart-container {
position: relative;
height: 300px;
}
.metric-highlight {
background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
border: 1px solid rgba(59, 130, 246, 0.2);
}
@keyframes slideInLeft {
from {
opacity: 0;
transform: translateX(-30px);
}
to {
opacity: 1;
transform: translateX(0);
}
}
.slide-in-left {
animation: slideInLeft 0.6s ease-out;
}
.price-ticker {
font-family: 'Courier New', monospace;
font-weight: bold;
background: linear-gradient(135deg, #3b82f6, #8b5cf6);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
</style>
</head>
<body class="bg-gray-900 text-white">
<!-- Navigation -->
<nav class="fixed top-0 w-full z-50 glass-morphism">
<div class="container mx-auto px-6 py-4">
<div class="flex items-center justify-between">
<div class="flex items-center space-x-3">
<div class="w-10 h-10 bg-gradient-to-r from-blue-500 to-purple-600 rounded-lg flex items-center justify-center">
<i data-feather="trending-up" class="w-6 h-6"></i>
</div>
<h1 class="text-2xl font-bold bg-gradient-to-r from-blue-400 to-purple-400 bg-clip-text text-transparent">
QuantumTrade Matrix
</h1>
</div>
<div class="flex items-center space-x-4">
<div class="hidden md:flex items-center space-x-2">
<div class="w-3 h-3 bg-green-500 rounded-full pulse"></div>
<span class="text-sm">System Online</span>
</div>
<div class="w-10 h-10 bg-gray-800 rounded-full flex items-center justify-center">
<i data-feather="user" class="w-5 h-5"></i>
</div>
</div>
</div>
</div>
</nav>
<!-- Main Layout -->
<div class="flex pt-20">
<!-- Sidebar -->
<aside class="fixed left-0 top-20 w-64 h-full bg-gray-900 bg-opacity-80 border-r border-gray-800 p-6 overflow-y-auto">
<nav class="space-y-2">
<a href="dashboard.html" class="sidebar-item flex items-center space-x-3 p-3 rounded-lg">
<i data-feather="home" class="w-5 h-5"></i>
<span>Dashboard</span>
</a>
<a href="signals.html" class="sidebar-item flex items-center space-x-3 p-3 rounded-lg">
<i data-feather="radio" class="w-5 h-5"></i>
<span>Signals</span>
</a>
<a href="strategies.html" class="sidebar-item flex items-center space-x-3 p-3 rounded-lg">
<i data-feather="target" class="w-5 h-5"></i>
<span>Strategies</span>
</a>
<a href="portfolio.html" class="sidebar-item active flex items-center space-x-3 p-3 rounded-lg">
<i data-feather="briefcase" class="w-5 h-5"></i>
<span>Portfolio</span>
</a>
<a href="settings.html" class="sidebar-item flex items-center space-x-3 p-3 rounded-lg">
<i data-feather="settings" class="w-5 h-5"></i>
<span>Settings</span>
</a>
</nav>
<div class="mt-8 p-4 glass-morphism rounded-lg">
<h4 class="font-semibold mb-2">Portfolio Summary</h4>
<div class="space-y-2 text-sm">
<div class="flex justify-between">
<span class="text-gray-400">Total Value</span>
<span class="text-blue-400">$45,678</span>
</div>
<div class="flex justify-between">
<span class="text-gray-400">Today's P&L</span>
<span class="text-green-400">+$1,245</span>
</div>
<div class="flex justify-between">
<span class="text-gray-400">Total Return</span>
<span class="text-green-400">+23.4%</span>
</div>
</div>
</div>
</aside>
<!-- Main Content -->
<main class="ml-64 flex-1 p-6">
<!-- Portfolio Overview -->
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8">
<div class="metric-highlight rounded-xl p-6">
<div class="flex items-center justify-between mb-4">
<span class="text-gray-400">Total Balance</span>
<i data-feather="dollar-sign" class="w-5 h-5 text-blue-400"></i>
</div>
<div class="text-3xl font-bold">$45,678.45</div>
<div class="text-green-400 text-sm mt-2">+$1,245.32 today (+2.8%)</div>
</div>
<div class="metric-highlight rounded-xl p-6">
<div class="flex items-center justify-between mb-4">
<span class="text-gray-400">Available Margin</span>
<i data-feather="credit-card" class="w-5 h-5 text-green-400"></i>
</div>
<div class="text-3xl font-bold">$32,456.78</div>
<div class="text-gray-400 text-sm mt-2">Margin used: 29%</div>
</div>
<div class="metric-highlight rounded-xl p-6">
<div class="flex items-center justify-between mb-4">
<span class="text-gray-400">Open P&L</span>
<i data-feather="trending-up" class="w-5 h-5 text-purple-400"></i>
</div>
<div class="text-3xl font-bold text-green-400">+$2,134.56</div>
<div class="text-gray-400 text-sm mt-2">Across 8 positions</div>
</div>
<div class="metric-highlight rounded-xl p-6">
<div class="flex items-center justify-between mb-4">
<span class="text-gray-400">Total Return</span>
<i data-feather="award" class="w-5 h-5 text-yellow-400"></i>
</div>
<div class="text-3xl font-bold">+23.4%</div>
<div class="text-green-400 text-sm mt-2">Since inception</div>
</div>
</div>
<!-- Portfolio Performance Chart -->
<div class="trading-card rounded-xl p-6 mb-8">
<div class="flex items-center justify-between mb-6">
<h3 class="text-xl font-bold">Portfolio Performance</h3>
<div class="flex space-x-2">
<button class="px-3 py-1 rounded text-sm border border-gray-600 hover:bg-gray-700">1D</button>
<button class="px-3 py-1 rounded text-sm border border-gray-600 hover:bg-gray-700">1W</button>
<button class="px-3 py-1 rounded text-sm bg-blue-600">1M</button>
<button class="px-3 py-1 rounded text-sm border border-gray-600 hover:bg-gray-700">3M</button>
<button class="px-3 py-1 rounded text-sm border border-gray-600 hover:bg-gray-700">1Y</button>
<button class="px-3 py-1 rounded text-sm border border-gray-600 hover:bg-gray-700">ALL</button>
</div>
</div>
<div class="chart-container">
<canvas id="portfolioChart"></canvas>
</div>
</div>
<!-- Asset Allocation -->
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6 mb-8">
<div class="trading-card rounded-xl p-6">
<h3 class="text-xl font-bold mb-6">Asset Allocation</h3>
<div class="chart-container mb-6">
<canvas id="allocationChart"></canvas>
</div>
<div class="space-y-3">
<div class="flex items-center justify-between">
<div class="flex items-center space-x-3">
<div class="w-4 h-4 bg-blue-500 rounded"></div>
<span>Forex</span>
</div>
<span class="font-semibold">65.2%</span>
</div>
<div class="flex items-center justify-between">
<div class="flex items-center space-x-3">
<div class="w-4 h-4 bg-green-500 rounded"></div>
<span>Crypto</span>
</div>
<span class="font-semibold">20.8%</span>
</div>
<div class="flex items-center justify-between">
<div class="flex items-center space-x-3">
<div class="w-4 h-4 bg-purple-500 rounded"></div>
<span>Indices</span>
</div>
<span class="font-semibold">10.5%</span>
</div>
<div class="flex items-center justify-between">
<div class="flex items-center space-x-3">
<div class="w-4 h-4 bg-yellow-500 rounded"></div>
<span>Commodities</span>
</div>
<span class="font-semibold">3.5%</span>
</div>
</div>
</div>
<div class="trading-card rounded-xl p-6">
<h3 class="text-xl font-bold mb-6">Top Performers</h3>
<div class="space-y-4">
<div class="asset-row rounded-lg p-4">
<div class="flex items-center justify-between mb-2">
<div class="flex items-center space-x-3">
<span class="text-lg font-semibold">EUR/USD</span>
<span class="text-sm text-gray-400">Long</span>
</div>
<div class="profit-positive px-3 py-1 rounded text-sm font-semibold">
+$456.78
</div>
</div>
<div class="flex justify-between text-sm">
<span class="text-gray-400">Entry: 1.0845</span>
<span class="price-ticker">Current: 1.0856</span>
<span class="text-green-400">+11 pips</span>
</div>
</div>
<div class="asset-row rounded-lg p-4">
<div class="flex items-center justify-between mb-2">
<div class="flex items-center space-x-3">
<span class="text-lg font-semibold">GBP/USD</span>
<span class="text-sm text-gray-400">Short</span>
</div>
<div class="profit-positive px-3 py-1 rounded text-sm font-semibold">
+$234.56
</div>
</div>
<div class="flex justify-between text-sm">
<span class="text-gray-400">Entry: 1.2755</span>
<span class="price-ticker">Current: 1.2743</span>
<span class="text-green-400">+12 pips</span>
</div>
</div>
<div class="asset-row rounded-lg p-4">
<div class="flex items-center justify-between mb-2">
<div class="flex items-center space-x-3">
<span class="text-lg font-semibold">USD/JPY</span>
<span class="text-sm text-gray-400">Long</span>
</div>
<div class="profit-negative px-3 py-1 rounded text-sm font-semibold">
-$123.45
</div>
</div>
<div class="flex justify-between text-sm">
<span class="text-gray-400">Entry: 149.90</span>
<span class="price-ticker">Current: 149.82</span>
<span class="text-red-400">-8 pips</span>
</div>
</div>
<div class="asset-row rounded-lg p-4">
<div class="flex items-center justify-between mb-2">
<div class="flex items-center space-x-3">
<span class="text-lg font-semibold">AUD/USD</span>
<span class="text-sm text-gray-400">Long</span>
</div>
<div class="profit-positive px-3 py-1 rounded text-sm font-semibold">
+$89.23
</div>
</div>
<div class="flex justify-between text-sm">
<span class="text-gray-400">Entry: 0.6543</span>
<span class="price-ticker">Current: 0.6548</span>
<span class="text-green-400">+5 pips</span>
</div>
</div>
</div>
</div>
</div>
<!-- Open Positions -->
<div class="trading-card rounded-xl p-6 mb-8">
<div class="flex items-center justify-between mb-6">
<h3 class="text-xl font-bold">Open Positions</h3>
<button class="quantum-button px-4 py-2 rounded-lg text-sm">
Close All
</button>
</div>
<div class="overflow-x-auto">
<table class="w-full">
<thead>
<tr class="border-b border-gray-700">
<th class="text-left py-3 px-4">Symbol</th>
<th class="text-left py-3 px-4">Type</th>
<th class="text-left py-3 px-4">Volume</th>
<th class="text-left py-3 px-4">Entry</th>
<th class="text-left py-3 px-4">Current</th>
<th class="text-left py-3 px-4">P&L</th>
<th class="text-left py-3 px-4">Margin</th>
<th class="text-left py-3 px-4">Actions</th>
</tr>
</thead>
<tbody id="positionsTable">
<!-- Positions will be populated here -->
</tbody>
</table>
</div>
</div>
<!-- Trade History -->
<div class="trading-card rounded-xl p-6">
<div class="flex items-center justify-between mb-6">
<h3 class="text-xl font-bold">Recent Trades</h3>
<select class="bg-gray-800 border border-gray-700 rounded-lg px-4 py-2 text-sm">
<option>Last 7 Days</option>
<option>Last 30 Days</option>
<option>Last 90 Days</option>
<option>All Time</option>
</select>
</div>
<div class="overflow-x-auto">
<table class="w-full">
<thead>
<tr class="border-b border-gray-700">
<th class="text-left py-3 px-4">Date</th>
<th class="text-left py-3 px-4">Symbol</th>
<th class="text-left py-3 px-4">Type</th>
<th class="text-left py-3 px-4">Volume</th>
<th class="text-left py-3 px-4">Open</th>
<th class="text-left py-3 px-4">Close</th>
<th class="text-left py-3 px-4">P&L</th>
<th class="text-left py-3 px-4">Duration</th>
</tr>
</thead>
<tbody id="tradesTable">
<!-- Trades will be populated here -->
</tbody>
</table>
</div>
</div>
</main>
</div>
<script>
// Initialize portfolio performance chart
const portfolioCtx = document.getElementById('portfolioChart').getContext('2d');
const portfolioChart = new Chart(portfolioCtx, {
type: 'line',
data: {
labels: Array.from({length: 30}, (_, i) => `Day ${i + 1}`),
datasets: [{
label: 'Portfolio Value',
data: Array.from({length: 30}, (_, i) => 40000 + Math.random() * 5000 + i * 150),
borderColor: '#3b82f6',
backgroundColor: 'rgba(59, 130, 246, 0.1)',
tension: 0.4,
fill: true
}, {
label: 'Benchmark',
data: Array.from({length: 30}, (_, i) => 40000 + i * 100),
borderColor: '#6b7280',
borderDash: [5, 5],
tension: 0.4,
fill: false
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
display: true,
labels: {
color: '#9ca3af'
}
}
},
scales: {
x: {
grid: {
color: 'rgba(255, 255, 255, 0.1)'
},
ticks: {
color: '#9ca3af'
}
},
y: {
grid: {
color: 'rgba(255, 255, 255, 0.1)'
},
ticks: {
color: '#9ca3af'
}
}
}
}
});
// Initialize allocation chart
const allocationCtx = document.getElementById('allocationChart').getContext('2d');
const allocationChart = new Chart(allocationCtx, {
type: 'doughnut',
data: {
labels: ['Forex', 'Crypto', 'Indices', 'Commodities'],
datasets: [{
data: [65.2, 20.8, 10.5, 3.5],
backgroundColor: ['#3b82f6', '#10b981', '#8b5cf6', '#f59e0b'],
borderWidth: 0
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
display: false
}
}
}
});
// Generate random positions
function generatePositions() {
const symbols = ['EUR/USD', 'GBP/USD', 'USD/JPY', 'AUD/USD', 'USD/CHF', 'NZD/USD'];
const types = ['BUY', 'SELL'];
const tbody = document.getElementById('positionsTable');
const positions = Array.from({length: 8}, (_, i) => {
const symbol = symbols[Math.floor(Math.random() * symbols.length)];
const type = types[Math.floor(Math.random() * types.length)];
const volume = (Math.random() * 1.9 + 0.1).toFixed(2);
const entry = (1 + Math.random()).toFixed(4);
const current = (parseFloat(entry) + (Math.random() - 0.5) * 0.01).toFixed(4);
const pips = Math.floor((parseFloat(current) - parseFloat(entry)) * 10000);
const pl = (pips * volume * 10).toFixed(2);
const margin = (volume * 1000).toFixed(2);
return {
symbol, type, volume, entry, current, pips, pl, margin
};
});
tbody.innerHTML = positions.map(pos => `
<tr class="border-b border-gray-800 hover:bg-gray-800">
<td class="py-3 px-4">
<div class="flex items-center">
<span class="w-2 h-2 rounded-full ${pos.type === 'BUY' ? 'bg-green-500' : 'bg-red-500'} mr-2"></span>
${pos.symbol}
</div>
</td>
<td class="py-3 px-4">
<span class="${pos.type === 'BUY' ? 'text-green-400' : 'text-red-400'}">${pos.type}</span>
</td>
<td class="py-3 px-4">${pos.volume}</td>
<td class="py-3 px-4">${pos.entry}</td>
<td class="py-3 px-4 price-ticker">${pos.current}</td>
<td class="py-3 px-4 ${pos.pips >= 0 ? 'text-green-400' : 'text-red-400'}">
${pos.pips >= 0 ? '+' : ''}${pos.pl}
</td>
<td class="py-3 px-4">$${pos.margin}</td>
<td class="py-3 px-4">
<button class="text-blue-400 hover:text-blue-300">
<i data-feather="more-horizontal" class="w-5 h-5"></i>
</button>
</td>
</tr>
`).join('');
}
// Generate random trades
function generateTrades() {
const symbols = ['EUR/USD', 'GBP/USD', 'USD/JPY', 'AUD/USD', 'USD/CHF', 'NZD/USD'];
const types = ['BUY', 'SELL'];
const tbody = document.getElementById('tradesTable');
const trades = Array.from({length: 10}, (_, i) => {
const date = new Date(Date.now() - i * 86400000).toLocaleDateString();
const symbol = symbols[Math.floor(Math.random() * symbols.length)];
const type = types[Math.floor(Math.random() * types.length)];
const volume = (Math.random() * 1.9 + 0.1).toFixed(2);
const open = (1 + Math.random()).toFixed(4);
const close = (parseFloat(open) + (Math.random() - 0.5) * 0.02).toFixed(4);
const pips = Math.floor((parseFloat(close) - parseFloat(open)) * 10000);
const pl = (pips * volume * 10).toFixed(2);
const duration = Math.floor(Math.random() * 240) + 15;
return {
date, symbol, type, volume, open, close, pips, pl, duration
};
});
tbody.innerHTML = trades.map(trade => `
<tr class="border-b border-gray-800 hover:bg-gray-800">
<td class="py-3 px-4 text-gray-400">${trade.date}</td>
<td class="py-3 px-4">${trade.symbol}</td>
<td class="py-3 px-4">
<span class="${trade.type === 'BUY' ? 'text-green-400' : 'text-red-400'}">${trade.type}</span>
</td>
<td class="py-3 px-4">${trade.volume}</td>
<td class="py-3 px-4">${trade.open}</td>
<td class="py-3 px-4">${trade.close}</td>
<td class="py-3 px-4 ${trade.pips >= 0 ? 'text-green-400' : 'text-red-400'}">
${trade.pips >= 0 ? '+' : ''}${trade.pl}
</td>
<td class="py-3 px-4 text-gray-400">${trade.duration}m</td>
</tr>
`).join('');
}
// Initial generation
generatePositions();
generateTrades();
// Update positions every 3 seconds
setInterval(generatePositions, 3000);
// Animate elements
anime({
targets: '.metric-highlight',
opacity: [0, 1],
translateY: [20, 0],
delay: anime.stagger(100),
duration: 800,
easing: 'easeOutQuad'
});
anime({
targets: '.portfolio-card',
opacity: [0, 1],
translateX: [-30, 0],
delay: anime.stagger(150),
duration: 800,
easing: 'easeOutQuad'
});
// Add hover effects
document.querySelectorAll('.asset-row').forEach(row => {
row.addEventListener('mouseenter', function() {
anime({
targets: this,
scale: 1.02,
duration: 200,
easing: 'easeOutQuad'
});
});
row.addEventListener('mouseleave', function() {
anime({
targets: this,
scale: 1,
duration: 200,
easing: 'easeOutQuad'
});
});
});
// Initialize Feather icons
feather.replace();
</script>
</body>
</html>