Download index.html from Lobs9/budget: direct link, hf CLI and curl.
- Browser
- Download file 27.3 kB
-
https://huggingface.co/spaces/Lobs9/budget/resolve/main/index.html
- Command line
-
hf download hf://spaces/Lobs9/budget/index.html
-
curl -L -o index.html https://huggingface.co/spaces/Lobs9/budget/resolve/main/index.html
27.3 kB
| <html lang="it"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Budget PRO - Gestione Bilancio Personale</title> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> | |
| <script> | |
| tailwind.config = { | |
| theme: { | |
| extend: { | |
| colors: { | |
| primary: '#4f46e5', | |
| secondary: '#10b981', | |
| danger: '#ef4444', | |
| warning: '#f59e0b', | |
| } | |
| } | |
| } | |
| } | |
| </script> | |
| <style> | |
| .chart-container { | |
| position: relative; | |
| height: 300px; | |
| width: 100%; | |
| } | |
| .progress-ring__circle { | |
| transition: stroke-dashoffset 0.35s; | |
| transform: rotate(-90deg); | |
| transform-origin: 50% 50%; | |
| } | |
| .floating-btn { | |
| box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); | |
| transition: all 0.3s ease; | |
| } | |
| .floating-btn:hover { | |
| transform: translateY(-3px); | |
| box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25); | |
| } | |
| .transaction-item { | |
| transition: all 0.2s ease; | |
| } | |
| .transaction-item:hover { | |
| transform: translateX(5px); | |
| background-color: #f8fafc; | |
| } | |
| </style> | |
| </head> | |
| <body class="bg-gray-50 min-h-screen"> | |
| <div class="container mx-auto px-4 py-8 max-w-4xl"> | |
| <!-- Header --> | |
| <header class="mb-8"> | |
| <div class="flex justify-between items-center"> | |
| <div> | |
| <h1 class="text-3xl font-bold text-gray-800">Budget PRO</h1> | |
| <p class="text-gray-600">Gestione bilancio semplice e efficace</p> | |
| </div> | |
| <div class="flex items-center space-x-4"> | |
| <div class="relative"> | |
| <select id="month-select" class="appearance-none bg-white border border-gray-300 rounded-md py-2 pl-3 pr-8 text-gray-700 focus:outline-none focus:ring-2 focus:ring-primary focus:border-primary"> | |
| <option value="0">Gennaio</option> | |
| <option value="1">Febbraio</option> | |
| <option value="2">Marzo</option> | |
| <option value="3">Aprile</option> | |
| <option value="4">Maggio</option> | |
| <option value="5">Giugno</option> | |
| <option value="6">Luglio</option> | |
| <option value="7">Agosto</option> | |
| <option value="8">Settembre</option> | |
| <option value="9">Ottobre</option> | |
| <option value="10">Novembre</option> | |
| <option value="11">Dicembre</option> | |
| </select> | |
| <div class="pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-700"> | |
| <i class="fas fa-chevron-down"></i> | |
| </div> | |
| </div> | |
| <div class="relative"> | |
| <select id="year-select" class="appearance-none bg-white border border-gray-300 rounded-md py-2 pl-3 pr-8 text-gray-700 focus:outline-none focus:ring-2 focus:ring-primary focus:border-primary"> | |
| <option>2023</option> | |
| <option selected>2024</option> | |
| <option>2025</option> | |
| </select> | |
| <div class="pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-700"> | |
| <i class="fas fa-chevron-down"></i> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </header> | |
| <!-- Summary Cards --> | |
| <div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-8"> | |
| <!-- Income Card --> | |
| <div class="bg-white rounded-xl shadow-md p-6 border-l-4 border-secondary"> | |
| <div class="flex justify-between items-start"> | |
| <div> | |
| <p class="text-gray-500 font-medium">Entrate</p> | |
| <h2 class="text-3xl font-bold text-gray-800 mt-2">€<span id="total-income">0</span></h2> | |
| </div> | |
| <div class="bg-green-100 p-3 rounded-full"> | |
| <i class="fas fa-arrow-up text-secondary text-xl"></i> | |
| </div> | |
| </div> | |
| <div class="mt-4"> | |
| <p class="text-sm text-gray-500">Rispetto al mese scorso: <span class="text-secondary font-medium">+12%</span></p> | |
| </div> | |
| </div> | |
| <!-- Expenses Card --> | |
| <div class="bg-white rounded-xl shadow-md p-6 border-l-4 border-danger"> | |
| <div class="flex justify-between items-start"> | |
| <div> | |
| <p class="text-gray-500 font-medium">Uscite</p> | |
| <h2 class="text-3xl font-bold text-gray-800 mt-2">€<span id="total-expenses">0</span></h2> | |
| </div> | |
| <div class="bg-red-100 p-3 rounded-full"> | |
| <i class="fas fa-arrow-down text-danger text-xl"></i> | |
| </div> | |
| </div> | |
| <div class="mt-4"> | |
| <p class="text-sm text-gray-500">Rispetto al mese scorso: <span class="text-danger font-medium">-5%</span></p> | |
| </div> | |
| </div> | |
| <!-- Balance Card --> | |
| <div class="bg-white rounded-xl shadow-md p-6 border-l-4 border-primary"> | |
| <div class="flex justify-between items-start"> | |
| <div> | |
| <p class="text-gray-500 font-medium">Bilancio</p> | |
| <h2 class="text-3xl font-bold text-gray-800 mt-2">€<span id="total-balance">0</span></h2> | |
| </div> | |
| <div class="bg-blue-100 p-3 rounded-full"> | |
| <i class="fas fa-wallet text-primary text-xl"></i> | |
| </div> | |
| </div> | |
| <div class="mt-4"> | |
| <p class="text-sm text-gray-500">Obiettivo mensile: <span class="text-primary font-medium">€1,500</span></p> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Charts and Transactions --> | |
| <div class="grid grid-cols-1 lg:grid-cols-3 gap-6 mb-8"> | |
| <!-- Categories Chart --> | |
| <div class="lg:col-span-2 bg-white rounded-xl shadow-md p-6"> | |
| <div class="flex justify-between items-center mb-6"> | |
| <h3 class="text-lg font-semibold text-gray-800">Distribuzione per Categoria</h3> | |
| <div class="relative"> | |
| <select id="chart-type" class="appearance-none bg-white border border-gray-300 rounded-md py-1 pl-2 pr-6 text-sm text-gray-700 focus:outline-none focus:ring-2 focus:ring-primary focus:border-primary"> | |
| <option value="expenses">Uscite</option> | |
| <option value="income">Entrate</option> | |
| </select> | |
| <div class="pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-700"> | |
| <i class="fas fa-chevron-down text-xs"></i> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="chart-container"> | |
| <canvas id="categories-chart"></canvas> | |
| </div> | |
| </div> | |
| <!-- Budget Progress --> | |
| <div class="bg-white rounded-xl shadow-md p-6"> | |
| <h3 class="text-lg font-semibold text-gray-800 mb-6">Progresso Budget</h3> | |
| <div class="flex flex-col items-center"> | |
| <div class="relative w-40 h-40 mb-4"> | |
| <svg class="w-full h-full" viewBox="0 0 100 100"> | |
| <circle class="text-gray-200" stroke-width="8" stroke="currentColor" fill="transparent" r="40" cx="50" cy="50" /> | |
| <circle class="text-primary progress-ring__circle" stroke-width="8" stroke-linecap="round" stroke="currentColor" fill="transparent" r="40" cx="50" cy="50" | |
| stroke-dasharray="251.2" stroke-dashoffset="calc(251.2 - (251.2 * 65) / 100)" /> | |
| </svg> | |
| <div class="absolute inset-0 flex items-center justify-center"> | |
| <span class="text-2xl font-bold text-gray-800">65%</span> | |
| </div> | |
| </div> | |
| <div class="w-full"> | |
| <div class="flex justify-between mb-1"> | |
| <span class="text-sm font-medium text-gray-600">Budget utilizzato</span> | |
| <span class="text-sm font-medium text-gray-600">€975/€1,500</span> | |
| </div> | |
| <div class="w-full bg-gray-200 rounded-full h-2"> | |
| <div class="bg-primary h-2 rounded-full" style="width: 65%"></div> | |
| </div> | |
| </div> | |
| <div class="mt-6 w-full"> | |
| <div class="flex items-center justify-between mb-2"> | |
| <div class="flex items-center"> | |
| <div class="w-3 h-3 rounded-full bg-secondary mr-2"></div> | |
| <span class="text-sm text-gray-600">Risparmi</span> | |
| </div> | |
| <span class="text-sm font-medium text-gray-800">35%</span> | |
| </div> | |
| <div class="flex items-center justify-between"> | |
| <div class="flex items-center"> | |
| <div class="w-3 h-3 rounded-full bg-danger mr-2"></div> | |
| <span class="text-sm text-gray-600">Spese</span> | |
| </div> | |
| <span class="text-sm font-medium text-gray-800">65%</span> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Recent Transactions --> | |
| <div class="bg-white rounded-xl shadow-md overflow-hidden mb-8"> | |
| <div class="px-6 py-4 border-b border-gray-200"> | |
| <div class="flex justify-between items-center"> | |
| <h3 class="text-lg font-semibold text-gray-800">Transazioni Recenti</h3> | |
| <button id="filter-btn" class="flex items-center text-sm text-gray-600 hover:text-primary"> | |
| <i class="fas fa-filter mr-1"></i> | |
| Filtra | |
| </button> | |
| </div> | |
| </div> | |
| <div class="divide-y divide-gray-200"> | |
| <!-- Transaction items will be added here --> | |
| <div id="transactions-list"> | |
| <!-- Sample transactions --> | |
| <div class="transaction-item px-6 py-4 flex justify-between items-center"> | |
| <div class="flex items-center"> | |
| <div class="bg-blue-100 p-3 rounded-full mr-4"> | |
| <i class="fas fa-shopping-bag text-primary"></i> | |
| </div> | |
| <div> | |
| <p class="font-medium text-gray-800">Spesa Supermercato</p> | |
| <p class="text-sm text-gray-500">Alimentari</p> | |
| </div> | |
| </div> | |
| <div class="text-right"> | |
| <p class="font-medium text-danger">-€85.50</p> | |
| <p class="text-sm text-gray-500">15 Giu 2024</p> | |
| </div> | |
| </div> | |
| <div class="transaction-item px-6 py-4 flex justify-between items-center"> | |
| <div class="flex items-center"> | |
| <div class="bg-green-100 p-3 rounded-full mr-4"> | |
| <i class="fas fa-money-bill-wave text-secondary"></i> | |
| </div> | |
| <div> | |
| <p class="font-medium text-gray-800">Stipendio</p> | |
| <p class="text-sm text-gray-500">Lavoro</p> | |
| </div> | |
| </div> | |
| <div class="text-right"> | |
| <p class="font-medium text-secondary">+€2,300.00</p> | |
| <p class="text-sm text-gray-500">10 Giu 2024</p> | |
| </div> | |
| </div> | |
| <div class="transaction-item px-6 py-4 flex justify-between items-center"> | |
| <div class="flex items-center"> | |
| <div class="bg-red-100 p-3 rounded-full mr-4"> | |
| <i class="fas fa-utensils text-danger"></i> | |
| </div> | |
| <div> | |
| <p class="font-medium text-gray-800">Cena al Ristorante</p> | |
| <p class="text-sm text-gray-500">Svago</p> | |
| </div> | |
| </div> | |
| <div class="text-right"> | |
| <p class="font-medium text-danger">-€42.75</p> | |
| <p class="text-sm text-gray-500">8 Giu 2024</p> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="px-6 py-3 bg-gray-50 text-center"> | |
| <button class="text-primary font-medium text-sm hover:underline">Visualizza tutte le transazioni</button> | |
| </div> | |
| </div> | |
| <!-- Add Transaction Button --> | |
| <button id="add-transaction-btn" class="fixed bottom-8 right-8 bg-primary text-white rounded-full p-5 floating-btn hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-opacity-50"> | |
| <i class="fas fa-plus text-xl"></i> | |
| </button> | |
| <!-- Add Transaction Modal --> | |
| <div id="transaction-modal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden"> | |
| <div class="bg-white rounded-xl shadow-xl w-full max-w-md"> | |
| <div class="px-6 py-4 border-b border-gray-200 flex justify-between items-center"> | |
| <h3 class="text-lg font-semibold text-gray-800">Aggiungi Transazione</h3> | |
| <button id="close-modal-btn" class="text-gray-400 hover:text-gray-600"> | |
| <i class="fas fa-times"></i> | |
| </button> | |
| </div> | |
| <div class="p-6"> | |
| <form id="transaction-form"> | |
| <div class="mb-4"> | |
| <label for="transaction-type" class="block text-sm font-medium text-gray-700 mb-1">Tipo</label> | |
| <div class="flex border border-gray-300 rounded-md overflow-hidden"> | |
| <button type="button" data-type="expense" class="flex-1 py-2 px-4 text-center font-medium border-r border-gray-300 bg-danger text-white"> | |
| Uscita | |
| </button> | |
| <button type="button" data-type="income" class="flex-1 py-2 px-4 text-center font-medium bg-secondary text-white"> | |
| Entrata | |
| </button> | |
| </div> | |
| <input type="hidden" id="transaction-type" name="type" value="expense"> | |
| </div> | |
| <div class="mb-4"> | |
| <label for="transaction-amount" class="block text-sm font-medium text-gray-700 mb-1">Importo</label> | |
| <div class="relative rounded-md shadow-sm"> | |
| <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"> | |
| <span class="text-gray-500 sm:text-sm">€</span> | |
| </div> | |
| <input type="number" id="transaction-amount" name="amount" class="focus:ring-primary focus:border-primary block w-full pl-7 pr-12 py-2 border-gray-300 rounded-md" placeholder="0.00"> | |
| </div> | |
| </div> | |
| <div class="mb-4"> | |
| <label for="transaction-category" class="block text-sm font-medium text-gray-700 mb-1">Categoria</label> | |
| <select id="transaction-category" name="category" class="mt-1 block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-primary focus:border-primary rounded-md"> | |
| <option value="food">Alimentari</option> | |
| <option value="transport">Trasporti</option> | |
| <option value="housing">Casa</option> | |
| <option value="entertainment">Svago</option> | |
| <option value="shopping">Shopping</option> | |
| <option value="salary">Stipendio</option> | |
| <option value="other">Altro</option> | |
| </select> | |
| </div> | |
| <div class="mb-4"> | |
| <label for="transaction-date" class="block text-sm font-medium text-gray-700 mb-1">Data</label> | |
| <input type="date" id="transaction-date" name="date" class="mt-1 focus:ring-primary focus:border-primary block w-full shadow-sm border-gray-300 rounded-md"> | |
| </div> | |
| <div class="mb-4"> | |
| <label for="transaction-description" class="block text-sm font-medium text-gray-700 mb-1">Descrizione</label> | |
| <input type="text" id="transaction-description" name="description" class="mt-1 focus:ring-primary focus:border-primary block w-full shadow-sm border-gray-300 rounded-md" placeholder="Descrizione opzionale"> | |
| </div> | |
| <div class="mt-6"> | |
| <button type="submit" class="w-full bg-primary text-white py-2 px-4 rounded-md hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2"> | |
| Aggiungi Transazione | |
| </button> | |
| </div> | |
| </form> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <script src="https://cdn.jsdelivr.net/npm/chart.js"></script> | |
| <script> | |
| document.addEventListener('DOMContentLoaded', function() { | |
| // Initialize Chart | |
| const ctx = document.getElementById('categories-chart').getContext('2d'); | |
| const categoriesChart = new Chart(ctx, { | |
| type: 'doughnut', | |
| data: { | |
| labels: ['Alimentari', 'Trasporti', 'Casa', 'Svago', 'Shopping', 'Altro'], | |
| datasets: [{ | |
| data: [35, 15, 25, 10, 10, 5], | |
| backgroundColor: [ | |
| '#ef4444', | |
| '#f59e0b', | |
| '#10b981', | |
| '#3b82f6', | |
| '#8b5cf6', | |
| '#64748b' | |
| ], | |
| borderWidth: 0 | |
| }] | |
| }, | |
| options: { | |
| responsive: true, | |
| maintainAspectRatio: false, | |
| plugins: { | |
| legend: { | |
| position: 'right', | |
| }, | |
| tooltip: { | |
| callbacks: { | |
| label: function(context) { | |
| const label = context.label || ''; | |
| const value = context.raw || 0; | |
| const total = context.dataset.data.reduce((a, b) => a + b, 0); | |
| const percentage = Math.round((value / total) * 100); | |
| return `${label}: €${value} (${percentage}%)`; | |
| } | |
| } | |
| } | |
| }, | |
| cutout: '70%' | |
| } | |
| }); | |
| // Update chart type | |
| document.getElementById('chart-type').addEventListener('change', function() { | |
| const type = this.value; | |
| if (type === 'income') { | |
| categoriesChart.data.labels = ['Stipendio', 'Investimenti', 'Regali', 'Altro']; | |
| categoriesChart.data.datasets[0].data = [80, 10, 5, 5]; | |
| categoriesChart.data.datasets[0].backgroundColor = [ | |
| '#10b981', | |
| '#3b82f6', | |
| '#8b5cf6', | |
| '#64748b' | |
| ]; | |
| } else { | |
| categoriesChart.data.labels = ['Alimentari', 'Trasporti', 'Casa', 'Svago', 'Shopping', 'Altro']; | |
| categoriesChart.data.datasets[0].data = [35, 15, 25, 10, 10, 5]; | |
| categoriesChart.data.datasets[0].backgroundColor = [ | |
| '#ef4444', | |
| '#f59e0b', | |
| '#10b981', | |
| '#3b82f6', | |
| '#8b5cf6', | |
| '#64748b' | |
| ]; | |
| } | |
| categoriesChart.update(); | |
| }); | |
| // Transaction modal | |
| const modal = document.getElementById('transaction-modal'); | |
| const addBtn = document.getElementById('add-transaction-btn'); | |
| const closeBtn = document.getElementById('close-modal-btn'); | |
| addBtn.addEventListener('click', () => { | |
| modal.classList.remove('hidden'); | |
| document.body.style.overflow = 'hidden'; | |
| }); | |
| closeBtn.addEventListener('click', () => { | |
| modal.classList.add('hidden'); | |
| document.body.style.overflow = 'auto'; | |
| }); | |
| // Type buttons in modal | |
| const typeButtons = document.querySelectorAll('[data-type]'); | |
| const typeInput = document.getElementById('transaction-type'); | |
| typeButtons.forEach(button => { | |
| button.addEventListener('click', () => { | |
| typeButtons.forEach(btn => { | |
| btn.classList.remove('bg-danger', 'bg-secondary', 'text-white'); | |
| btn.classList.add('bg-gray-100', 'text-gray-700'); | |
| }); | |
| button.classList.remove('bg-gray-100', 'text-gray-700'); | |
| if (button.dataset.type === 'expense') { | |
| button.classList.add('bg-danger', 'text-white'); | |
| } else { | |
| button.classList.add('bg-secondary', 'text-white'); | |
| } | |
| typeInput.value = button.dataset.type; | |
| }); | |
| }); | |
| // Set default type to expense | |
| document.querySelector('[data-type="expense"]').click(); | |
| // Set today's date as default | |
| const today = new Date().toISOString().split('T')[0]; | |
| document.getElementById('transaction-date').value = today; | |
| // Form submission | |
| document.getElementById('transaction-form').addEventListener('submit', function(e) { | |
| e.preventDefault(); | |
| const type = document.getElementById('transaction-type').value; | |
| const amount = parseFloat(document.getElementById('transaction-amount').value); | |
| const category = document.getElementById('transaction-category').value; | |
| const date = document.getElementById('transaction-date').value; | |
| const description = document.getElementById('transaction-description').value || 'Nessuna descrizione'; | |
| if (!amount || isNaN(amount)) { | |
| alert('Inserisci un importo valido'); | |
| return; | |
| } | |
| // Here you would normally save the transaction to your database | |
| console.log('Nuova transazione:', { | |
| type, | |
| amount, | |
| category, | |
| date, | |
| description | |
| }); | |
| // For demo purposes, we'll just show an alert and close the modal | |
| alert('Transazione aggiunta con successo!'); | |
| modal.classList.add('hidden'); | |
| document.body.style.overflow = 'auto'; | |
| this.reset(); | |
| document.getElementById('transaction-date').value = today; | |
| document.querySelector('[data-type="expense"]').click(); | |
| }); | |
| // Calculate and display totals (demo data) | |
| const totalIncome = 2300; | |
| const totalExpenses = 975; | |
| const totalBalance = totalIncome - totalExpenses; | |
| document.getElementById('total-income').textContent = totalIncome.toFixed(2); | |
| document.getElementById('total-expenses').textContent = totalExpenses.toFixed(2); | |
| document.getElementById('total-balance').textContent = totalBalance.toFixed(2); | |
| }); | |
| </script> | |
| <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Lobs9/budget" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> | |
| </html> |