Spaces:
Running
Running
Add 2 files
Browse files- index.html +153 -2
- prompts.txt +2 -1
index.html
CHANGED
|
@@ -143,12 +143,12 @@
|
|
| 143 |
<span class="nav-text ml-3">Dashboard</span>
|
| 144 |
</a>
|
| 145 |
|
| 146 |
-
<a href="#" class="nav-item flex items-center px-4 py-3 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-slate-700 transition-colors duration-200">
|
| 147 |
<i class="fas fa-money-bill-wave w-6 text-red-500"></i>
|
| 148 |
<span class="nav-text ml-3">Despesas</span>
|
| 149 |
</a>
|
| 150 |
|
| 151 |
-
<a href="#" class="nav-item flex items-center px-4 py-3 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-slate-700 transition-colors duration-200">
|
| 152 |
<i class="fas fa-hand-holding-usd w-6 text-green-500"></i>
|
| 153 |
<span class="nav-text ml-3">Receitas</span>
|
| 154 |
</a>
|
|
@@ -265,6 +265,94 @@
|
|
| 265 |
</div>
|
| 266 |
</div>
|
| 267 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 268 |
<!-- Charts -->
|
| 269 |
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6 mb-8">
|
| 270 |
<div class="lg:col-span-2 bg-white dark:bg-slate-800 rounded-lg shadow p-6">
|
|
@@ -601,6 +689,69 @@
|
|
| 601 |
// Set Dashboard as active initially
|
| 602 |
navItems[0].classList.add('bg-gray-100', 'dark:bg-slate-700');
|
| 603 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 604 |
// Transaction Modal Handling
|
| 605 |
const transactionModal = document.getElementById('transaction-modal');
|
| 606 |
const addTransactionBtn = document.getElementById('add-transaction-btn');
|
|
|
|
| 143 |
<span class="nav-text ml-3">Dashboard</span>
|
| 144 |
</a>
|
| 145 |
|
| 146 |
+
<a href="#" id="expenses-link" class="nav-item flex items-center px-4 py-3 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-slate-700 transition-colors duration-200">
|
| 147 |
<i class="fas fa-money-bill-wave w-6 text-red-500"></i>
|
| 148 |
<span class="nav-text ml-3">Despesas</span>
|
| 149 |
</a>
|
| 150 |
|
| 151 |
+
<a href="#" id="income-link" class="nav-item flex items-center px-4 py-3 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-slate-700 transition-colors duration-200">
|
| 152 |
<i class="fas fa-hand-holding-usd w-6 text-green-500"></i>
|
| 153 |
<span class="nav-text ml-3">Receitas</span>
|
| 154 |
</a>
|
|
|
|
| 265 |
</div>
|
| 266 |
</div>
|
| 267 |
|
| 268 |
+
<!-- Filters Section -->
|
| 269 |
+
<div class="bg-white dark:bg-slate-800 rounded-lg shadow p-6 mb-6">
|
| 270 |
+
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4">
|
| 271 |
+
<div>
|
| 272 |
+
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">Data Inicial</label>
|
| 273 |
+
<input type="date" class="w-full px-4 py-2 border border-gray-300 dark:border-slate-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 dark:bg-slate-700 dark:text-white">
|
| 274 |
+
</div>
|
| 275 |
+
<div>
|
| 276 |
+
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">Data Final</label>
|
| 277 |
+
<input type="date" class="w-full px-4 py-2 border border-gray-300 dark:border-slate-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 dark:bg-slate-700 dark:text-white">
|
| 278 |
+
</div>
|
| 279 |
+
<div>
|
| 280 |
+
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">Categoria</label>
|
| 281 |
+
<select class="w-full px-4 py-2 border border-gray-300 dark:border-slate-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 dark:bg-slate-700 dark:text-white">
|
| 282 |
+
<option value="">Todas</option>
|
| 283 |
+
<option>Alimentação</option>
|
| 284 |
+
<option>Transporte</option>
|
| 285 |
+
<option>Moradia</option>
|
| 286 |
+
<option>Lazer</option>
|
| 287 |
+
<option>Saúde</option>
|
| 288 |
+
</select>
|
| 289 |
+
</div>
|
| 290 |
+
<div>
|
| 291 |
+
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">Descrição</label>
|
| 292 |
+
<div class="relative">
|
| 293 |
+
<input type="text" placeholder="Pesquisar..." class="w-full pl-10 pr-4 py-2 border border-gray-300 dark:border-slate-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 dark:bg-slate-700 dark:text-white">
|
| 294 |
+
<i class="fas fa-search absolute left-3 top-3 text-gray-400"></i>
|
| 295 |
+
</div>
|
| 296 |
+
</div>
|
| 297 |
+
</div>
|
| 298 |
+
<div class="flex justify-end mt-4 space-x-3">
|
| 299 |
+
<button class="px-4 py-2 border border-gray-300 dark:border-slate-600 rounded-md text-gray-700 dark:text-white hover:bg-gray-100 dark:hover:bg-slate-700 transition-colors">
|
| 300 |
+
Limpar
|
| 301 |
+
</button>
|
| 302 |
+
<button class="px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors">
|
| 303 |
+
Aplicar Filtros
|
| 304 |
+
</button>
|
| 305 |
+
</div>
|
| 306 |
+
</div>
|
| 307 |
+
|
| 308 |
+
<!-- Transactions Listing -->
|
| 309 |
+
<div class="bg-white dark:bg-slate-800 rounded-lg shadow overflow-hidden mb-8">
|
| 310 |
+
<div class="px-6 py-4 border-b border-gray-200 dark:border-slate-700 flex justify-between items-center">
|
| 311 |
+
<h2 class="text-lg font-semibold text-gray-800 dark:text-white" id="transactions-title">Transações</h2>
|
| 312 |
+
<div class="flex items-center space-x-2">
|
| 313 |
+
<span class="text-sm text-gray-500 dark:text-gray-400">Total: <span id="total-amount" class="font-medium">R$ 0,00</span></span>
|
| 314 |
+
<select class="bg-gray-100 dark:bg-slate-700 border border-gray-300 dark:border-slate-600 text-gray-700 dark:text-white text-sm rounded-md px-3 py-1 focus:outline-none focus:ring-2 focus:ring-blue-500">
|
| 315 |
+
<option>Últimos 30 dias</option>
|
| 316 |
+
<option>Este mês</option>
|
| 317 |
+
<option>Mês passado</option>
|
| 318 |
+
<option>Personalizado</option>
|
| 319 |
+
</select>
|
| 320 |
+
</div>
|
| 321 |
+
</div>
|
| 322 |
+
<div class="overflow-x-auto">
|
| 323 |
+
<table class="min-w-full divide-y divide-gray-200 dark:divide-slate-700">
|
| 324 |
+
<thead class="bg-gray-50 dark:bg-slate-700">
|
| 325 |
+
<tr>
|
| 326 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Data</th>
|
| 327 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Descrição</th>
|
| 328 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Categoria</th>
|
| 329 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Valor</th>
|
| 330 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Ações</th>
|
| 331 |
+
</tr>
|
| 332 |
+
</thead>
|
| 333 |
+
<tbody class="bg-white dark:bg-slate-800 divide-y divide-gray-200 dark:divide-slate-700" id="transactions-body">
|
| 334 |
+
<!-- Transactions will be loaded here -->
|
| 335 |
+
<tr>
|
| 336 |
+
<td colspan="5" class="px-6 py-4 text-center text-gray-500 dark:text-gray-400">Nenhuma transação encontrada</td>
|
| 337 |
+
</tr>
|
| 338 |
+
</tbody>
|
| 339 |
+
</table>
|
| 340 |
+
</div>
|
| 341 |
+
<div class="px-6 py-4 border-t border-gray-200 dark:border-slate-700 flex justify-between items-center">
|
| 342 |
+
<div class="text-sm text-gray-500 dark:text-gray-400">
|
| 343 |
+
Mostrando <span class="font-medium">1</span> a <span class="font-medium">10</span> de <span class="font-medium">25</span> resultados
|
| 344 |
+
</div>
|
| 345 |
+
<div class="flex space-x-2">
|
| 346 |
+
<button class="px-3 py-1 border border-gray-300 dark:border-slate-600 rounded-md text-gray-700 dark:text-white hover:bg-gray-100 dark:hover:bg-slate-700 disabled:opacity-50" disabled>
|
| 347 |
+
Anterior
|
| 348 |
+
</button>
|
| 349 |
+
<button class="px-3 py-1 border border-gray-300 dark:border-slate-600 rounded-md text-gray-700 dark:text-white hover:bg-gray-100 dark:hover:bg-slate-700">
|
| 350 |
+
Próxima
|
| 351 |
+
</button>
|
| 352 |
+
</div>
|
| 353 |
+
</div>
|
| 354 |
+
</div>
|
| 355 |
+
|
| 356 |
<!-- Charts -->
|
| 357 |
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6 mb-8">
|
| 358 |
<div class="lg:col-span-2 bg-white dark:bg-slate-800 rounded-lg shadow p-6">
|
|
|
|
| 689 |
// Set Dashboard as active initially
|
| 690 |
navItems[0].classList.add('bg-gray-100', 'dark:bg-slate-700');
|
| 691 |
|
| 692 |
+
// Expenses/Income View Toggle
|
| 693 |
+
const expensesLink = document.getElementById('expenses-link');
|
| 694 |
+
const incomeLink = document.getElementById('income-link');
|
| 695 |
+
const transactionsTitle = document.getElementById('transactions-title');
|
| 696 |
+
const transactionsBody = document.getElementById('transactions-body');
|
| 697 |
+
const totalAmount = document.getElementById('total-amount');
|
| 698 |
+
|
| 699 |
+
function loadTransactions(type) {
|
| 700 |
+
// In a real app, this would fetch data from an API
|
| 701 |
+
transactionsTitle.textContent = type === 'expenses' ? 'Despesas' : 'Receitas';
|
| 702 |
+
|
| 703 |
+
// Sample data - replace with actual API call
|
| 704 |
+
const sampleData = type === 'expenses' ? [
|
| 705 |
+
{ date: '2023-06-12', description: 'Compras no Supermercado', category: 'Alimentação', amount: -256.80 },
|
| 706 |
+
{ date: '2023-06-10', description: 'Combustível', category: 'Transporte', amount: -150.00 },
|
| 707 |
+
{ date: '2023-06-05', description: 'Almoço', category: 'Alimentação', amount: -45.90 }
|
| 708 |
+
] : [
|
| 709 |
+
{ date: '2023-06-05', description: 'Salário', category: 'Renda', amount: 3200.00 },
|
| 710 |
+
{ date: '2023-06-15', description: 'Freelance', category: 'Renda', amount: 800.00 }
|
| 711 |
+
];
|
| 712 |
+
|
| 713 |
+
// Calculate total
|
| 714 |
+
const total = sampleData.reduce((sum, item) => sum + item.amount, 0);
|
| 715 |
+
totalAmount.textContent = `R$ ${Math.abs(total).toFixed(2)}`;
|
| 716 |
+
totalAmount.className = type === 'expenses' ? 'font-medium text-red-500' : 'font-medium text-green-500';
|
| 717 |
+
|
| 718 |
+
// Populate table
|
| 719 |
+
transactionsBody.innerHTML = sampleData.length > 0 ?
|
| 720 |
+
sampleData.map(item => `
|
| 721 |
+
<tr class="hover:bg-gray-50 dark:hover:bg-slate-700">
|
| 722 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-400">${item.date}</td>
|
| 723 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-800 dark:text-white">${item.description}</td>
|
| 724 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-400">${item.category}</td>
|
| 725 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm ${item.amount < 0 ? 'text-red-500' : 'text-green-500'}">R$ ${Math.abs(item.amount).toFixed(2)}</td>
|
| 726 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-400">
|
| 727 |
+
<button class="text-blue-500 hover:text-blue-700 dark:hover:text-blue-400 mr-3"><i class="fas fa-edit"></i></button>
|
| 728 |
+
<button class="text-red-500 hover:text-red-700 dark:hover:text-red-400"><i class="fas fa-trash"></i></button>
|
| 729 |
+
</td>
|
| 730 |
+
</tr>
|
| 731 |
+
`).join('') : `
|
| 732 |
+
<tr>
|
| 733 |
+
<td colspan="5" class="px-6 py-4 text-center text-gray-500 dark:text-gray-400">Nenhuma transação encontrada</td>
|
| 734 |
+
</tr>
|
| 735 |
+
`;
|
| 736 |
+
}
|
| 737 |
+
|
| 738 |
+
expensesLink.addEventListener('click', (e) => {
|
| 739 |
+
e.preventDefault();
|
| 740 |
+
navItems.forEach(item => item.classList.remove('bg-gray-100', 'dark:bg-slate-700'));
|
| 741 |
+
expensesLink.classList.add('bg-gray-100', 'dark:bg-slate-700');
|
| 742 |
+
loadTransactions('expenses');
|
| 743 |
+
});
|
| 744 |
+
|
| 745 |
+
incomeLink.addEventListener('click', (e) => {
|
| 746 |
+
e.preventDefault();
|
| 747 |
+
navItems.forEach(item => item.classList.remove('bg-gray-100', 'dark:bg-slate-700'));
|
| 748 |
+
incomeLink.classList.add('bg-gray-100', 'dark:bg-slate-700');
|
| 749 |
+
loadTransactions('income');
|
| 750 |
+
});
|
| 751 |
+
|
| 752 |
+
// Load expenses by default
|
| 753 |
+
loadTransactions('expenses');
|
| 754 |
+
|
| 755 |
// Transaction Modal Handling
|
| 756 |
const transactionModal = document.getElementById('transaction-modal');
|
| 757 |
const addTransactionBtn = document.getElementById('add-transaction-btn');
|
prompts.txt
CHANGED
|
@@ -3,4 +3,5 @@ Na página de dashboard, colocar 3 botões na mesma temática, um deles no canto
|
|
| 3 |
Na página "Calendário", terá um calendário interativo, a transação seja despesa ou receita irá aparecer no dia em questão que foi cadastrada, no calendário terá informações resumidas apenas com uma abreviação da descriaparecendo um pop-up com todas as informações
|
| 4 |
Continuando na página "Calendário", não desaparecer com o menu das páginas, este menu tem que ser visível em todas as páginas, exceto a de login, no calendário interativo, aparece a transação na data da transação com informações resumidas apenas com a cor da categoria e descrição abreviada, quando seleciona ou passa em cima o mouse abre uma janela flutuante com todas as informações referentes à aquela transação, contendo também um botão de navegação de data para meses ou anos ou alguma data especifica com inicio e fim
|
| 5 |
Na página "Calendário", menu com as páginas tem que ser visível em todas as páginas, exceto a de login, no calendário interativo, aparece a transação na data que foi descrita com informações resumidas, com a cor da categoria e descrição abreviada, quando seleciona ou passa em cima o mouse abre uma janela flutuante com todas as informações referentes à aquela transação, contendo também um botão de navegação de data para meses ou anos ou alguma data especifica.
|
| 6 |
-
Na página de dashboard, colocar 3 botões na mesma temática no canto superior direito, o primeiro para cadastro de transação, nele abre uma janela flutuante contendo check box se for receita ou despesa, Descrição, Categoria, Sub-Categoria, Valor, Check box se for Crédito, caso seja abrir mais duas opções: Parcelas e Cartão. Segundo botão "Importar", terá como função abrir um carregamento de arquivos excel do tipo CSV, seja de despesa ou receita para importar ao banco de dados. O terceiro botão "Exportar", faz um download de todos as transações feitas até então em arquivo CSV.
|
|
|
|
|
|
| 3 |
Na página "Calendário", terá um calendário interativo, a transação seja despesa ou receita irá aparecer no dia em questão que foi cadastrada, no calendário terá informações resumidas apenas com uma abreviação da descriaparecendo um pop-up com todas as informações
|
| 4 |
Continuando na página "Calendário", não desaparecer com o menu das páginas, este menu tem que ser visível em todas as páginas, exceto a de login, no calendário interativo, aparece a transação na data da transação com informações resumidas apenas com a cor da categoria e descrição abreviada, quando seleciona ou passa em cima o mouse abre uma janela flutuante com todas as informações referentes à aquela transação, contendo também um botão de navegação de data para meses ou anos ou alguma data especifica com inicio e fim
|
| 5 |
Na página "Calendário", menu com as páginas tem que ser visível em todas as páginas, exceto a de login, no calendário interativo, aparece a transação na data que foi descrita com informações resumidas, com a cor da categoria e descrição abreviada, quando seleciona ou passa em cima o mouse abre uma janela flutuante com todas as informações referentes à aquela transação, contendo também um botão de navegação de data para meses ou anos ou alguma data especifica.
|
| 6 |
+
Na página de dashboard, colocar 3 botões na mesma temática no canto superior direito, o primeiro para cadastro de transação, nele abre uma janela flutuante contendo check box se for receita ou despesa, Descrição, Categoria, Sub-Categoria, Valor, Check box se for Crédito, caso seja abrir mais duas opções: Parcelas e Cartão. Segundo botão "Importar", terá como função abrir um carregamento de arquivos excel do tipo CSV, seja de despesa ou receita para importar ao banco de dados. O terceiro botão "Exportar", faz um download de todos as transações feitas até então em arquivo CSV.
|
| 7 |
+
Na página Despesas e Receitas ter uma listagem com filtros para pesquisa de descri
|