Download index.html from brunosda/teste: direct link, hf CLI and curl.
- Browser
- Download file 30.8 kB
-
https://huggingface.co/spaces/brunosda/teste/resolve/main/index.html
- Command line
-
hf download hf://spaces/brunosda/teste/index.html
-
curl -L -o index.html https://huggingface.co/spaces/brunosda/teste/resolve/main/index.html
30.8 kB
| <html lang="pt-BR"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>SweetRing - Sistema de Gestão</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: { | |
| donutPink: '#FF9BAA', | |
| donutPurple: '#B399D4', | |
| donutBlue: '#89CFF0', | |
| donutGreen: '#A7E8BD', | |
| donutYellow: '#FFEE93' | |
| } | |
| } | |
| } | |
| } | |
| </script> | |
| <style> | |
| .tab-content { | |
| display: none; | |
| } | |
| .tab-content.active { | |
| display: block; | |
| animation: fadeIn 0.5s; | |
| } | |
| @keyframes fadeIn { | |
| from { opacity: 0; } | |
| to { opacity: 1; } | |
| } | |
| .donut-chart { | |
| position: relative; | |
| width: 200px; | |
| height: 200px; | |
| border-radius: 50%; | |
| background: conic-gradient( | |
| #FF9BAA 0% 25%, | |
| #B399D4 25% 50%, | |
| #89CFF0 50% 75%, | |
| #A7E8BD 75% 100% | |
| ); | |
| } | |
| .chart-center { | |
| position: absolute; | |
| width: 70%; | |
| height: 70%; | |
| background: white; | |
| border-radius: 50%; | |
| top: 15%; | |
| left: 15%; | |
| display: flex; | |
| align-items: center; | |
| justify-content: center; | |
| font-weight: bold; | |
| color: #7E6B8F; | |
| } | |
| </style> | |
| </head> | |
| <body class="bg-gray-100 font-sans"> | |
| <div class="container mx-auto px-4 py-8 max-w-6xl"> | |
| <!-- Header --> | |
| <header class="bg-white rounded-xl shadow-md p-6 mb-8 flex flex-col md:flex-row items-center justify-between"> | |
| <div class="flex items-center mb-4 md:mb-0"> | |
| <div class="w-16 h-16 rounded-full bg-gradient-to-r from-donutPink to-donutPurple flex items-center justify-center text-white text-2xl mr-4 overflow-hidden"> | |
| <img src="https://images.unsplash.com/photo-1551024506-0ecc3ec5ee1f?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=200&q=80" alt="Donut" class="w-full h-full object-cover"> | |
| </div> | |
| <div> | |
| <h1 class="text-3xl font-bold text-gray-800">Donu</h1> | |
| <p class="text-donutPurple">Controle de qualidade</p> | |
| </div> | |
| </div> | |
| <div class="flex items-center space-x-4"> | |
| <div class="bg-donutYellow rounded-full p-3 text-center"> | |
| <p class="text-sm font-semibold">Pontos Hoje</p> | |
| <p class="text-2xl font-bold" id="todayPoints">0</p> | |
| </div> | |
| <div class="bg-donutGreen rounded-full p-3 text-center"> | |
| <p class="text-sm font-semibold">Pontos Mês</p> | |
| <p class="text-2xl font-bold" id="monthPoints">0</p> | |
| </div> | |
| </div> | |
| </header> | |
| <!-- Main Content --> | |
| <div class="bg-white rounded-xl shadow-md overflow-hidden"> | |
| <!-- Tabs --> | |
| <div class="flex border-b border-gray-200"> | |
| <button class="tab-btn py-4 px-6 font-medium text-gray-500 hover:text-donutPurple hover:bg-gray-50 active" data-tab="sales"> | |
| <i class="fas fa-chart-line mr-2"></i>Vendas | |
| </button> | |
| <button class="tab-btn py-4 px-6 font-medium text-gray-500 hover:text-donutPurple hover:bg-gray-50" data-tab="ingredients"> | |
| <i class="fas fa-utensils mr-2"></i>Insumos | |
| </button> | |
| <button class="tab-btn py-4 px-6 font-medium text-gray-500 hover:text-donutPurple hover:bg-gray-50" data-tab="reports"> | |
| <i class="fas fa-file-alt mr-2"></i>Relatórios | |
| </button> | |
| </div> | |
| <!-- Tab Contents --> | |
| <div class="p-6"> | |
| <!-- Sales Tab --> | |
| <div id="sales" class="tab-content active"> | |
| <div class="flex flex-col md:flex-row justify-between mb-6"> | |
| <h2 class="text-2xl font-bold text-gray-800 mb-4 md:mb-0">Controle de Vendas</h2> | |
| <div class="flex space-x-2"> | |
| <select id="salesPeriod" class="border rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-donutPurple"> | |
| <option value="daily">Diário</option> | |
| <option value="weekly">Semanal</option> | |
| <option value="monthly">Mensal</option> | |
| </select> | |
| <button id="addSaleBtn" class="bg-donutPurple text-white px-4 py-2 rounded-lg hover:bg-opacity-90 transition"> | |
| <i class="fas fa-plus mr-2"></i>Nova Venda | |
| </button> | |
| </div> | |
| </div> | |
| <div class="grid grid-cols-1 lg:grid-cols-3 gap-6 mb-6"> | |
| <div class="bg-donutPink bg-opacity-10 p-6 rounded-xl"> | |
| <h3 class="text-lg font-semibold text-gray-700 mb-2">Total Vendido</h3> | |
| <p class="text-3xl font-bold text-donutPink">R$ <span id="totalSales">0,00</span></p> | |
| <p class="text-sm text-gray-500 mt-1"><span id="salesCount">0</span> vendas realizadas</p> | |
| </div> | |
| <div class="bg-donutBlue bg-opacity-10 p-6 rounded-xl"> | |
| <h3 class="text-lg font-semibold text-gray-700 mb-2">Meta do Dia</h3> | |
| <p class="text-3xl font-bold text-donutBlue">R$ <span id="dailyGoal">1.500,00</span></p> | |
| <div class="w-full bg-gray-200 rounded-full h-2.5 mt-2"> | |
| <div class="bg-donutBlue h-2.5 rounded-full" style="width: 45%"></div> | |
| </div> | |
| <p class="text-sm text-gray-500 mt-1">45% alcançado</p> | |
| </div> | |
| <div class="bg-donutGreen bg-opacity-10 p-6 rounded-xl flex flex-col items-center justify-center"> | |
| <h3 class="text-lg font-semibold text-gray-700 mb-2">Distribuição</h3> | |
| <div class="donut-chart"> | |
| <div class="chart-center"> | |
| <span>100%</span> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="overflow-x-auto"> | |
| <table class="min-w-full bg-white rounded-lg overflow-hidden"> | |
| <thead class="bg-gray-50"> | |
| <tr> | |
| <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Data/Hora</th> | |
| <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Produto</th> | |
| <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Quantidade</th> | |
| <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Valor</th> | |
| <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Pontos</th> | |
| <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Ações</th> | |
| </tr> | |
| </thead> | |
| <tbody id="salesTableBody" class="divide-y divide-gray-200"> | |
| <!-- Sales data will be inserted here --> | |
| </tbody> | |
| </table> | |
| </div> | |
| </div> | |
| <!-- Ingredients Tab --> | |
| <div id="ingredients" class="tab-content"> | |
| <div class="flex flex-col md:flex-row justify-between mb-6"> | |
| <h2 class="text-2xl font-bold text-gray-800 mb-4 md:mb-0">Controle de Insumos</h2> | |
| <div class="flex space-x-2"> | |
| <button id="addIngredientBtn" class="bg-donutPurple text-white px-4 py-2 rounded-lg hover:bg-opacity-90 transition"> | |
| <i class="fas fa-plus mr-2"></i>Adicionar Insumo | |
| </button> | |
| </div> | |
| </div> | |
| <div class="grid grid-cols-1 lg:grid-cols-3 gap-6 mb-6"> | |
| <div class="bg-donutYellow bg-opacity-10 p-6 rounded-xl"> | |
| <h3 class="text-lg font-semibold text-gray-700 mb-2">Gasto Semanal</h3> | |
| <p class="text-3xl font-bold text-donutYellow">R$ <span id="weeklySpending">0,00</span></p> | |
| <p class="text-sm text-gray-500 mt-1"><span id="ingredientsCount">0</span> insumos registrados</p> | |
| </div> | |
| <div class="bg-donutBlue bg-opacity-10 p-6 rounded-xl"> | |
| <h3 class="text-lg font-semibold text-gray-700 mb-2">Orçamento</h3> | |
| <p class="text-3xl font-bold text-donutBlue">R$ <span id="ingredientBudget">2.000,00</span></p> | |
| <div class="w-full bg-gray-200 rounded-full h-2.5 mt-2"> | |
| <div class="bg-donutBlue h-2.5 rounded-full" style="width: 15%"></div> | |
| </div> | |
| <p class="text-sm text-gray-500 mt-1">15% utilizado</p> | |
| </div> | |
| <div class="bg-donutPink bg-opacity-10 p-6 rounded-xl"> | |
| <h3 class="text-lg font-semibold text-gray-700 mb-2">Estoque Crítico</h3> | |
| <p class="text-3xl font-bold text-donutPink"><span id="criticalItems">3</span></p> | |
| <p class="text-sm text-gray-500 mt-1">itens com baixo estoque</p> | |
| </div> | |
| </div> | |
| <div class="overflow-x-auto"> | |
| <table class="min-w-full bg-white rounded-lg overflow-hidden"> | |
| <thead class="bg-gray-50"> | |
| <tr> | |
| <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Insumo</th> | |
| <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Quantidade</th> | |
| <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Unidade</th> | |
| <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Custo Unitário</th> | |
| <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Total</th> | |
| <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Fornecedor</th> | |
| <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Ações</th> | |
| </tr> | |
| </thead> | |
| <tbody id="ingredientsTableBody" class="divide-y divide-gray-200"> | |
| <!-- Ingredients data will be inserted here --> | |
| </tbody> | |
| </table> | |
| </div> | |
| </div> | |
| <!-- Reports Tab --> | |
| <div id="reports" class="tab-content"> | |
| <h2 class="text-2xl font-bold text-gray-800 mb-6">Relatórios</h2> | |
| <div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-8"> | |
| <div class="bg-white border border-gray-200 rounded-xl p-6 shadow-sm"> | |
| <h3 class="text-lg font-semibold text-gray-700 mb-4">Relatório de Vendas</h3> | |
| <div class="space-y-4"> | |
| <div> | |
| <label class="block text-sm font-medium text-gray-700 mb-1">Período</label> | |
| <select class="border rounded-lg px-4 py-2 w-full focus:outline-none focus:ring-2 focus:ring-donutPurple"> | |
| <option>Últimos 7 dias</option> | |
| <option>Últimos 30 dias</option> | |
| <option>Este mês</option> | |
| <option>Mês passado</option> | |
| <option>Personalizado</option> | |
| </select> | |
| </div> | |
| <button class="w-full bg-donutPurple text-white px-4 py-2 rounded-lg hover:bg-opacity-90 transition"> | |
| <i class="fas fa-file-pdf mr-2"></i>Gerar Relatório | |
| </button> | |
| </div> | |
| </div> | |
| <div class="bg-white border border-gray-200 rounded-xl p-6 shadow-sm"> | |
| <h3 class="text-lg font-semibold text-gray-700 mb-4">Relatório de Insumos</h3> | |
| <div class="space-y-4"> | |
| <div> | |
| <label class="block text-sm font-medium text-gray-700 mb-1">Semana</label> | |
| <select class="border rounded-lg px-4 py-2 w-full focus:outline-none focus:ring-2 focus:ring-donutPurple"> | |
| <option>Esta semana</option> | |
| <option>Semana passada</option> | |
| <option>Últimas 4 semanas</option> | |
| <option>Personalizado</option> | |
| </select> | |
| </div> | |
| <button class="w-full bg-donutPink text-white px-4 py-2 rounded-lg hover:bg-opacity-90 transition"> | |
| <i class="fas fa-file-excel mr-2"></i>Gerar Relatório | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="bg-white border border-gray-200 rounded-xl p-6 shadow-sm"> | |
| <h3 class="text-lg font-semibold text-gray-700 mb-4">Análise de Desempenho</h3> | |
| <div class="grid grid-cols-1 md:grid-cols-3 gap-4"> | |
| <div class="border border-gray-200 rounded-lg p-4"> | |
| <h4 class="text-sm font-medium text-gray-500 mb-2">Vendas Mensais</h4> | |
| <p class="text-2xl font-bold text-donutPurple">R$ 42.560,00</p> | |
| <p class="text-sm text-green-500"><i class="fas fa-arrow-up mr-1"></i>12% vs mês anterior</p> | |
| </div> | |
| <div class="border border-gray-200 rounded-lg p-4"> | |
| <h4 class="text-sm font-medium text-gray-500 mb-2">Custo Insumos</h4> | |
| <p class="text-2xl font-bold text-donutPink">R$ 8.240,00</p> | |
| <p class="text-sm text-red-500"><i class="fas fa-arrow-up mr-1"></i>5% vs mês anterior</p> | |
| </div> | |
| <div class="border border-gray-200 rounded-lg p-4"> | |
| <h4 class="text-sm font-medium text-gray-500 mb-2">Lucro Líquido</h4> | |
| <p class="text-2xl font-bold text-donutGreen">R$ 34.320,00</p> | |
| <p class="text-sm text-green-500"><i class="fas fa-arrow-up mr-1"></i>15% vs mês anterior</p> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Modals --> | |
| <!-- Add Sale Modal --> | |
| <div id="addSaleModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden"> | |
| <div class="bg-white rounded-xl p-6 w-full max-w-md"> | |
| <div class="flex justify-between items-center mb-4"> | |
| <h3 class="text-xl font-bold text-gray-800">Registrar Nova Venda</h3> | |
| <button id="closeSaleModal" class="text-gray-500 hover:text-gray-700"> | |
| <i class="fas fa-times"></i> | |
| </button> | |
| </div> | |
| <form id="saleForm" class="space-y-4"> | |
| <div> | |
| <label class="block text-sm font-medium text-gray-700 mb-1">Produto</label> | |
| <select class="border rounded-lg px-4 py-2 w-full focus:outline-none focus:ring-2 focus:ring-donutPurple" required> | |
| <option value="">Selecione um produto</option> | |
| <option>Donut Tradicional</option> | |
| <option>Donut Recheado</option> | |
| <option>Donut Gourmet</option> | |
| <option>Donut Especial</option> | |
| <option>Combo Familiar</option> | |
| <option>Bebidas</option> | |
| </select> | |
| </div> | |
| <div> | |
| <label class="block text-sm font-medium text-gray-700 mb-1">Quantidade</label> | |
| <input type="number" min="1" class="border rounded-lg px-4 py-2 w-full focus:outline-none focus:ring-2 focus:ring-donutPurple" required> | |
| </div> | |
| <div> | |
| <label class="block text-sm font-medium text-gray-700 mb-1">Valor Unitário</label> | |
| <input type="number" step="0.01" min="0" class="border rounded-lg px-4 py-2 w-full focus:outline-none focus:ring-2 focus:ring-donutPurple" required> | |
| </div> | |
| <div> | |
| <label class="block text-sm font-medium text-gray-700 mb-1">Método de Pagamento</label> | |
| <select class="border rounded-lg px-4 py-2 w-full focus:outline-none focus:ring-2 focus:ring-donutPurple" required> | |
| <option value="">Selecione</option> | |
| <option>Dinheiro</option> | |
| <option>Cartão de Débito</option> | |
| <option>Cartão de Crédito</option> | |
| <option>PIX</option> | |
| </select> | |
| </div> | |
| <div class="pt-2"> | |
| <button type="submit" class="w-full bg-donutPurple text-white px-4 py-2 rounded-lg hover:bg-opacity-90 transition"> | |
| Registrar Venda | |
| </button> | |
| </div> | |
| </form> | |
| </div> | |
| </div> | |
| <!-- Add Ingredient Modal --> | |
| <div id="addIngredientModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden"> | |
| <div class="bg-white rounded-xl p-6 w-full max-w-md"> | |
| <div class="flex justify-between items-center mb-4"> | |
| <h3 class="text-xl font-bold text-gray-800">Adicionar Insumo</h3> | |
| <button id="closeIngredientModal" class="text-gray-500 hover:text-gray-700"> | |
| <i class="fas fa-times"></i> | |
| </button> | |
| </div> | |
| <form id="ingredientForm" class="space-y-4"> | |
| <div> | |
| <label class="block text-sm font-medium text-gray-700 mb-1">Nome do Insumo</label> | |
| <input type="text" class="border rounded-lg px-4 py-2 w-full focus:outline-none focus:ring-2 focus:ring-donutPurple" required> | |
| </div> | |
| <div class="grid grid-cols-2 gap-4"> | |
| <div> | |
| <label class="block text-sm font-medium text-gray-700 mb-1">Quantidade</label> | |
| <input type="number" min="0" step="0.01" class="border rounded-lg px-4 py-2 w-full focus:outline-none focus:ring-2 focus:ring-donutPurple" required> | |
| </div> | |
| <div> | |
| <label class="block text-sm font-medium text-gray-700 mb-1">Unidade</label> | |
| <select class="border rounded-lg px-4 py-2 w-full focus:outline-none focus:ring-2 focus:ring-donutPurple" required> | |
| <option value="">Selecione</option> | |
| <option>kg</option> | |
| <option>g</option> | |
| <option>L</option> | |
| <option>ml</option> | |
| <option>un</option> | |
| <option>cx</option> | |
| </select> | |
| </div> | |
| </div> | |
| <div> | |
| <label class="block text-sm font-medium text-gray-700 mb-1">Custo Unitário</label> | |
| <input type="number" step="0.01" min="0" class="border rounded-lg px-4 py-2 w-full focus:outline-none focus:ring-2 focus:ring-donutPurple" required> | |
| </div> | |
| <div> | |
| <label class="block text-sm font-medium text-gray-700 mb-1">Fornecedor</label> | |
| <input type="text" class="border rounded-lg px-4 py-2 w-full focus:outline-none focus:ring-2 focus:ring-donutPurple" required> | |
| </div> | |
| <div> | |
| <label class="block text-sm font-medium text-gray-700 mb-1">Data da Compra</label> | |
| <input type="date" class="border rounded-lg px-4 py-2 w-full focus:outline-none focus:ring-2 focus:ring-donutPurple" required> | |
| </div> | |
| <div class="pt-2"> | |
| <button type="submit" class="w-full bg-donutPurple text-white px-4 py-2 rounded-lg hover:bg-opacity-90 transition"> | |
| Adicionar Insumo | |
| </button> | |
| </div> | |
| </form> | |
| </div> | |
| </div> | |
| <script> | |
| // Tab functionality | |
| document.addEventListener('DOMContentLoaded', function() { | |
| const tabButtons = document.querySelectorAll('.tab-btn'); | |
| const tabContents = document.querySelectorAll('.tab-content'); | |
| tabButtons.forEach(button => { | |
| button.addEventListener('click', () => { | |
| const tabId = button.getAttribute('data-tab'); | |
| // Remove active class from all buttons and contents | |
| tabButtons.forEach(btn => btn.classList.remove('active')); | |
| tabContents.forEach(content => content.classList.remove('active')); | |
| // Add active class to clicked button and corresponding content | |
| button.classList.add('active'); | |
| document.getElementById(tabId).classList.add('active'); | |
| }); | |
| }); | |
| // Modal functionality | |
| const addSaleBtn = document.getElementById('addSaleBtn'); | |
| const addSaleModal = document.getElementById('addSaleModal'); | |
| const closeSaleModal = document.getElementById('closeSaleModal'); | |
| const addIngredientBtn = document.getElementById('addIngredientBtn'); | |
| const addIngredientModal = document.getElementById('addIngredientModal'); | |
| const closeIngredientModal = document.getElementById('closeIngredientModal'); | |
| addSaleBtn.addEventListener('click', () => { | |
| addSaleModal.classList.remove('hidden'); | |
| }); | |
| closeSaleModal.addEventListener('click', () => { | |
| addSaleModal.classList.add('hidden'); | |
| }); | |
| addIngredientBtn.addEventListener('click', () => { | |
| addIngredientModal.classList.remove('hidden'); | |
| }); | |
| closeIngredientModal.addEventListener('click', () => { | |
| addIngredientModal.classList.add('hidden'); | |
| }); | |
| // Close modals when clicking outside | |
| window.addEventListener('click', (e) => { | |
| if (e.target === addSaleModal) { | |
| addSaleModal.classList.add('hidden'); | |
| } | |
| if (e.target === addIngredientModal) { | |
| addIngredientModal.classList.add('hidden'); | |
| } | |
| }); | |
| // Empty data arrays to start fresh | |
| const salesData = []; | |
| const ingredientsData = []; | |
| // Populate sales table | |
| const salesTableBody = document.getElementById('salesTableBody'); | |
| let totalSales = 0; | |
| let totalPoints = 0; | |
| salesData.forEach(sale => { | |
| const row = document.createElement('tr'); | |
| row.innerHTML = ` | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${sale.date}</td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">${sale.product}</td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${sale.quantity}</td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">R$ ${sale.value.toFixed(2)}</td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${sale.points}</td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"> | |
| <button class="text-donutPurple hover:text-donutPink mr-2"> | |
| <i class="fas fa-edit"></i> | |
| </button> | |
| <button class="text-red-500 hover:text-red-700"> | |
| <i class="fas fa-trash"></i> | |
| </button> | |
| </td> | |
| `; | |
| salesTableBody.appendChild(row); | |
| totalSales += sale.value; | |
| totalPoints += sale.points; | |
| }); | |
| document.getElementById('totalSales').textContent = '0,00'; | |
| document.getElementById('salesCount').textContent = '0'; | |
| document.getElementById('todayPoints').textContent = '0'; | |
| document.getElementById('monthPoints').textContent = '0'; | |
| // Populate ingredients table | |
| const ingredientsTableBody = document.getElementById('ingredientsTableBody'); | |
| let weeklySpending = 0; | |
| ingredientsData.forEach(ingredient => { | |
| const totalCost = ingredient.quantity * ingredient.unitCost; | |
| weeklySpending += totalCost; | |
| const row = document.createElement('tr'); | |
| row.innerHTML = ` | |
| <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">${ingredient.name}</td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 ${ingredient.quantity < 10 ? 'text-red-500 font-bold' : ''}">${ingredient.quantity}</td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${ingredient.unit}</td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">R$ ${ingredient.unitCost.toFixed(2)}</td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">R$ ${totalCost.toFixed(2)}</td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${ingredient.supplier}</td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"> | |
| <button class="text-donutPurple hover:text-donutPink mr-2"> | |
| <i class="fas fa-edit"></i> | |
| </button> | |
| <button class="text-red-500 hover:text-red-700"> | |
| <i class="fas fa-trash"></i> | |
| </button> | |
| </td> | |
| `; | |
| ingredientsTableBody.appendChild(row); | |
| }); | |
| document.getElementById('weeklySpending').textContent = '0,00'; | |
| document.getElementById('ingredientsCount').textContent = '0'; | |
| document.getElementById('criticalItems').textContent = '0'; | |
| // Form submissions | |
| document.getElementById('saleForm').addEventListener('submit', function(e) { | |
| e.preventDefault(); | |
| alert('Venda registrada com sucesso!'); | |
| this.reset(); | |
| addSaleModal.classList.add('hidden'); | |
| }); | |
| document.getElementById('ingredientForm').addEventListener('submit', function(e) { | |
| e.preventDefault(); | |
| alert('Insumo adicionado com sucesso!'); | |
| this.reset(); | |
| addIngredientModal.classList.add('hidden'); | |
| }); | |
| }); | |
| </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=brunosda/teste" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> | |
| </html> |