Spaces:
Running
Running
Add 2 files
Browse files- README.md +7 -5
- index.html +594 -19
README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: chopemeter
|
| 3 |
+
emoji: 🐳
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: green
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite
|
| 10 |
---
|
| 11 |
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
|
@@ -1,19 +1,594 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="pt-BR">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>ChopeMeter - Seu Controle de Chope Inteligente</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
| 9 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 10 |
+
<style>
|
| 11 |
+
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Poppins:wght@400;600;700&display=swap');
|
| 12 |
+
|
| 13 |
+
body {
|
| 14 |
+
font-family: 'Poppins', sans-serif;
|
| 15 |
+
background-color: #f8f4e9;
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
.logo {
|
| 19 |
+
font-family: 'Bebas Neue', cursive;
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
.beer-card {
|
| 23 |
+
transition: all 0.3s ease;
|
| 24 |
+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
.beer-card:hover {
|
| 28 |
+
transform: translateY(-5px);
|
| 29 |
+
box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
.beer-ipa {
|
| 33 |
+
background: linear-gradient(to bottom right, #f0a71e, #d6821a);
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
.beer-lager {
|
| 37 |
+
background: linear-gradient(to bottom right, #ffcc33, #ff9900);
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
.beer-stout {
|
| 41 |
+
background: linear-gradient(to bottom right, #2c1a0a, #4a3717);
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
.beer-pilsen {
|
| 45 |
+
background: linear-gradient(to bottom right, #ffd700, #ffb347);
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
.beer-glass {
|
| 49 |
+
animation: float 3s ease-in-out infinite;
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
+
@keyframes float {
|
| 53 |
+
0% { transform: translateY(0px); }
|
| 54 |
+
50% { transform: translateY(-10px); }
|
| 55 |
+
100% { transform: translateY(0px); }
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
.progress-bar {
|
| 59 |
+
background: #e0e0e0;
|
| 60 |
+
border-radius: 20px;
|
| 61 |
+
overflow: hidden;
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
.progress-bar-fill {
|
| 65 |
+
height: 20px;
|
| 66 |
+
border-radius: 20px;
|
| 67 |
+
background: linear-gradient(to right, #f0a71e, #e67e22);
|
| 68 |
+
transition: width 0.5s ease-out;
|
| 69 |
+
}
|
| 70 |
+
</style>
|
| 71 |
+
</head>
|
| 72 |
+
<body class="min-h-screen bg-amber-50">
|
| 73 |
+
<div class="container mx-auto px-4 py-8">
|
| 74 |
+
<!-- Header with Logo -->
|
| 75 |
+
<header class="flex flex-col items-center mb-10">
|
| 76 |
+
<div class="relative w-32 h-32 mb-4">
|
| 77 |
+
<div class="absolute inset-0 bg-amber-500 rounded-full flex items-center justify-center">
|
| 78 |
+
<i class="fa-solid fa-beer-mug-empty text-white text-6xl beer-glass"></i>
|
| 79 |
+
</div>
|
| 80 |
+
<div class="absolute -bottom-2 -right-2 bg-amber-700 w-12 h-12 rounded-full flex items-center justify-center">
|
| 81 |
+
<i class="fa-solid fa-chart-line text-white text-xl"></i>
|
| 82 |
+
</div>
|
| 83 |
+
</div>
|
| 84 |
+
<h1 class="logo text-5xl md:text-6xl font-bold text-amber-900 mb-2">ChopeMeter</h1>
|
| 85 |
+
<p class="text-lg text-amber-800 font-medium">Seu controle inteligente de chope</p>
|
| 86 |
+
</header>
|
| 87 |
+
|
| 88 |
+
<div class="grid grid-cols-1 lg:grid-cols-3 gap-8 mb-10">
|
| 89 |
+
<!-- Beer Consumption Form -->
|
| 90 |
+
<div class="lg:col-span-2 bg-white rounded-xl shadow-lg overflow-hidden">
|
| 91 |
+
<div class="bg-amber-700 px-6 py-4">
|
| 92 |
+
<h2 class="text-xl font-bold text-white">Registrar novo chope</h2>
|
| 93 |
+
</div>
|
| 94 |
+
<div class="p-6">
|
| 95 |
+
<form id="beerForm" class="space-y-4">
|
| 96 |
+
<!-- Bar Selection -->
|
| 97 |
+
<div>
|
| 98 |
+
<label class="block text-amber-900 font-medium mb-2" for="bar">Bar</label>
|
| 99 |
+
<select id="bar" name="bar" class="w-full px-4 py-3 rounded-lg border-2 border-amber-200 focus:border-amber-500 focus:outline-none transition bg-amber-50">
|
| 100 |
+
<option value="" disabled selected>Selecione o bar</option>
|
| 101 |
+
<option value="Bar do Mineiro">Bar do Mineiro</option>
|
| 102 |
+
<option value="Choperia da Vila">Choperia da Vila</option>
|
| 103 |
+
<option value="Bierhaus">Bierhaus</option>
|
| 104 |
+
<option value="Bar do Alemão">Bar do Alemão</option>
|
| 105 |
+
<option value="Cervejaria Artesanal">Cervejaria Artesanal</option>
|
| 106 |
+
<option value="other">Outro (especificar)</option>
|
| 107 |
+
</select>
|
| 108 |
+
<input type="text" id="otherBar" name="otherBar" placeholder="Nome do bar" class="w-full px-4 py-3 mt-2 rounded-lg border-2 border-amber-200 focus:border-amber-500 focus:outline-none transition bg-amber-50 hidden">
|
| 109 |
+
</div>
|
| 110 |
+
|
| 111 |
+
<!-- Beer Style -->
|
| 112 |
+
<div>
|
| 113 |
+
<label class="block text-amber-900 font-medium mb-2">Estilo de Cerveja</label>
|
| 114 |
+
<div class="grid grid-cols-2 sm:grid-cols-4 gap-3">
|
| 115 |
+
<div>
|
| 116 |
+
<input type="radio" name="beerStyle" id="ipa" value="IPA" class="hidden peer">
|
| 117 |
+
<label for="ipa" class="beer-card beer-ipa cursor-pointer flex flex-col items-center justify-center py-4 px-2 rounded-lg text-white font-bold peer-checked:ring-4 peer-checked:ring-amber-400">
|
| 118 |
+
<i class="fa-solid fa-beer-mug text-3xl mb-2"></i>
|
| 119 |
+
<span>IPA</span>
|
| 120 |
+
</label>
|
| 121 |
+
</div>
|
| 122 |
+
<div>
|
| 123 |
+
<input type="radio" name="beerStyle" id="lager" value="Lager" class="hidden peer">
|
| 124 |
+
<label for="lager" class="beer-card beer-lager cursor-pointer flex flex-col items-center justify-center py-4 px-2 rounded-lg text-white font-bold peer-checked:ring-4 peer-checked:ring-amber-400">
|
| 125 |
+
<i class="fa-solid fa-beer-mug text-3xl mb-2"></i>
|
| 126 |
+
<span>Lager</span>
|
| 127 |
+
</label>
|
| 128 |
+
</div>
|
| 129 |
+
<div>
|
| 130 |
+
<input type="radio" name="beerStyle" id="stout" value="Stout" class="hidden peer">
|
| 131 |
+
<label for="stout" class="beer-card beer-stout cursor-pointer flex flex-col items-center justify-center py-4 px-2 rounded-lg text-white font-bold peer-checked:ring-4 peer-checked:ring-amber-400">
|
| 132 |
+
<i class="fa-solid fa-beer-mug text-3xl mb-2"></i>
|
| 133 |
+
<span>Stout</span>
|
| 134 |
+
</label>
|
| 135 |
+
</div>
|
| 136 |
+
<div>
|
| 137 |
+
<input type="radio" name="beerStyle" id="pilsen" value="Pilsen" class="hidden peer">
|
| 138 |
+
<label for="pilsen" class="beer-card beer-pilsen cursor-pointer flex flex-col items-center justify-center py-4 px-2 rounded-lg text-white font-bold peer-checked:ring-4 peer-checked:ring-amber-400">
|
| 139 |
+
<i class="fa-solid fa-beer-mug text-3xl mb-2"></i>
|
| 140 |
+
<span>Pilsen</span>
|
| 141 |
+
</label>
|
| 142 |
+
</div>
|
| 143 |
+
</div>
|
| 144 |
+
</div>
|
| 145 |
+
|
| 146 |
+
<!-- Glass Size -->
|
| 147 |
+
<div>
|
| 148 |
+
<label class="block text-amber-900 font-medium mb-2" for="glassSize">Tamanho do Copo (ml)</label>
|
| 149 |
+
<div class="relative">
|
| 150 |
+
<input type="range" id="glassSize" name="glassSize" min="300" max="600" step="50" value="300" class="w-full h-3 bg-amber-200 rounded-lg appearance-none cursor-pointer">
|
| 151 |
+
<div class="flex justify-between text-sm text-amber-700 mt-2">
|
| 152 |
+
<span>300ml</span>
|
| 153 |
+
<span>350ml</span>
|
| 154 |
+
<span>400ml</span>
|
| 155 |
+
<span>450ml</span>
|
| 156 |
+
<span>500ml</span>
|
| 157 |
+
<span>550ml</span>
|
| 158 |
+
<span>600ml</span>
|
| 159 |
+
</div>
|
| 160 |
+
<output for="glassSize" id="glassSizeValue" class="absolute -top-8 right-0 bg-amber-600 text-white px-3 py-1 rounded-full text-sm font-bold">300ml</output>
|
| 161 |
+
</div>
|
| 162 |
+
</div>
|
| 163 |
+
|
| 164 |
+
<!-- Beer Price -->
|
| 165 |
+
<div>
|
| 166 |
+
<label class="block text-amber-900 font-medium mb-2" for="beerPrice">Valor (R$)</label>
|
| 167 |
+
<div class="relative">
|
| 168 |
+
<span class="absolute left-3 top-1/2 -translate-y-1/2 text-amber-700 font-bold">R$</span>
|
| 169 |
+
<input type="number" id="beerPrice" name="beerPrice" min="5" max="50" step="0.01" class="w-full pl-8 pr-4 py-3 rounded-lg border-2 border-amber-200 focus:border-amber-500 focus:outline-none transition bg-amber-50" placeholder="10.00">
|
| 170 |
+
</div>
|
| 171 |
+
</div>
|
| 172 |
+
|
| 173 |
+
<button type="submit" class="w-full bg-amber-600 hover:bg-amber-700 text-white font-bold py-3 px-4 rounded-lg transition duration-200 flex items-center justify-center">
|
| 174 |
+
<i class="fa-solid fa-beer-mug mr-2"></i> Adicionar Chope
|
| 175 |
+
</button>
|
| 176 |
+
</form>
|
| 177 |
+
</div>
|
| 178 |
+
</div>
|
| 179 |
+
|
| 180 |
+
<!-- Stats Summary -->
|
| 181 |
+
<div class="bg-white rounded-xl shadow-lg overflow-hidden">
|
| 182 |
+
<div class="bg-amber-700 px-6 py-4">
|
| 183 |
+
<h2 class="text-xl font-bold text-white">Meu Resumo</h2>
|
| 184 |
+
</div>
|
| 185 |
+
<div class="p-6">
|
| 186 |
+
<div class="space-y-6">
|
| 187 |
+
<div>
|
| 188 |
+
<h3 class="text-sm font-medium text-amber-600 uppercase tracking-wider mb-2">Consumo Hoje</h3>
|
| 189 |
+
<div class="bg-amber-100 p-4 rounded-lg">
|
| 190 |
+
<div class="flex items-center justify-between mb-2">
|
| 191 |
+
<span class="text-amber-900 font-bold">Total de Chopes</span>
|
| 192 |
+
<span id="totalBeersToday" class="text-2xl font-bold text-amber-700">0</span>
|
| 193 |
+
</div>
|
| 194 |
+
<div class="flex items-center justify-between">
|
| 195 |
+
<span class="text-amber-900 font-bold">Total Litros</span>
|
| 196 |
+
<span id="totalLitersToday" class="text-2xl font-bold text-amber-700">0.00L</span>
|
| 197 |
+
</div>
|
| 198 |
+
</div>
|
| 199 |
+
</div>
|
| 200 |
+
|
| 201 |
+
<div>
|
| 202 |
+
<h3 class="text-sm font-medium text-amber-600 uppercase tracking-wider mb-2">Gasto Total</h3>
|
| 203 |
+
<div class="bg-amber-100 p-4 rounded-lg">
|
| 204 |
+
<div class="flex items-center justify-between">
|
| 205 |
+
<span class="text-amber-900 font-bold">Hoje</span>
|
| 206 |
+
<span id="totalSpentToday" class="text-xl font-bold text-amber-700">R$ 0,00</span>
|
| 207 |
+
</div>
|
| 208 |
+
<div class="flex items-center justify-between mt-2">
|
| 209 |
+
<span class="text-amber-900 font-bold">Mês Atual</span>
|
| 210 |
+
<span id="totalSpentMonth" class="text-xl font-bold text-amber-700">R$ 0,00</span>
|
| 211 |
+
</div>
|
| 212 |
+
</div>
|
| 213 |
+
</div>
|
| 214 |
+
|
| 215 |
+
<div>
|
| 216 |
+
<h3 class="text-sm font-medium text-amber-600 uppercase tracking-wider mb-2">Meu Limite Diário</h3>
|
| 217 |
+
<div class="space-y-3">
|
| 218 |
+
<div class="progress-bar">
|
| 219 |
+
<div id="limitProgress" class="progress-bar-fill" style="width: 0%"></div>
|
| 220 |
+
</div>
|
| 221 |
+
<div class="flex justify-between text-sm font-medium text-amber-900">
|
| 222 |
+
<span>0ml</span>
|
| 223 |
+
<span id="currentProgress">0ml / 1000ml</span>
|
| 224 |
+
<span>1000ml</span>
|
| 225 |
+
</div>
|
| 226 |
+
</div>
|
| 227 |
+
<button id="setLimitBtn" class="mt-3 text-amber-700 hover:text-amber-900 text-sm font-medium flex items-center">
|
| 228 |
+
<i class="fa-solid fa-sliders mr-1"></i> Ajustar Limite
|
| 229 |
+
</button>
|
| 230 |
+
<div id="limitContainer" class="mt-3 hidden">
|
| 231 |
+
<div class="flex items-center space-x-2">
|
| 232 |
+
<input type="number" id="dailyLimit" min="100" max="3000" step="100" value="1000" class="w-24 px-3 py-2 rounded-lg border-2 border-amber-200 focus:border-amber-500 focus:outline-none transition bg-amber-50">
|
| 233 |
+
<span class="text-amber-900 font-medium">ml</span>
|
| 234 |
+
<button id="saveLimitBtn" class="bg-amber-600 hover:bg-amber-700 text-white px-3 py-2 rounded-lg transition text-sm">Salvar</button>
|
| 235 |
+
</div>
|
| 236 |
+
</div>
|
| 237 |
+
</div>
|
| 238 |
+
</div>
|
| 239 |
+
</div>
|
| 240 |
+
</div>
|
| 241 |
+
</div>
|
| 242 |
+
|
| 243 |
+
<!-- Charts Section -->
|
| 244 |
+
<div class="grid grid-cols-1 lg:grid-cols-2 gap-8 mb-10">
|
| 245 |
+
<div class="bg-white rounded-xl shadow-lg overflow-hidden">
|
| 246 |
+
<div class="bg-amber-700 px-6 py-4">
|
| 247 |
+
<h2 class="text-xl font-bold text-white">Consumo Diário (últimos 7 dias)</h2>
|
| 248 |
+
</div>
|
| 249 |
+
<div class="p-6">
|
| 250 |
+
<canvas id="dailyConsumptionChart"></canvas>
|
| 251 |
+
</div>
|
| 252 |
+
</div>
|
| 253 |
+
|
| 254 |
+
<div class="bg-white rounded-xl shadow-lg overflow-hidden">
|
| 255 |
+
<div class="bg-amber-700 px-6 py-4">
|
| 256 |
+
<h2 class="text-xl font-bold text-white">Estilos de Cerveja</h2>
|
| 257 |
+
</div>
|
| 258 |
+
<div class="p-6">
|
| 259 |
+
<canvas id="beerStylesChart"></canvas>
|
| 260 |
+
</div>
|
| 261 |
+
</div>
|
| 262 |
+
</div>
|
| 263 |
+
|
| 264 |
+
<!-- Recent Beers Table -->
|
| 265 |
+
<div class="bg-white rounded-xl shadow-lg overflow-hidden mb-10">
|
| 266 |
+
<div class="bg-amber-700 px-6 py-4">
|
| 267 |
+
<h2 class="text-xl font-bold text-white">Meus Chopes Recentes</h2>
|
| 268 |
+
</div>
|
| 269 |
+
<div class="p-6">
|
| 270 |
+
<div class="overflow-x-auto">
|
| 271 |
+
<table class="min-w-full divide-y divide-amber-200">
|
| 272 |
+
<thead class="bg-amber-50">
|
| 273 |
+
<tr>
|
| 274 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-amber-700 uppercase tracking-wider">Data</th>
|
| 275 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-amber-700 uppercase tracking-wider">Bar</th>
|
| 276 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-amber-700 uppercase tracking-wider">Estilo</th>
|
| 277 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-amber-700 uppercase tracking-wider">Tamanho</th>
|
| 278 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-amber-700 uppercase tracking-wider">Valor</th>
|
| 279 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-amber-700 uppercase tracking-wider">Ações</th>
|
| 280 |
+
</tr>
|
| 281 |
+
</thead>
|
| 282 |
+
<tbody id="recentBeersTable" class="bg-white divide-y divide-amber-200">
|
| 283 |
+
<tr>
|
| 284 |
+
<td colspan="6" class="px-6 py-4 text-center text-gray-500">Nenhum chope registrado ainda.</td>
|
| 285 |
+
</tr>
|
| 286 |
+
</tbody>
|
| 287 |
+
</table>
|
| 288 |
+
</div>
|
| 289 |
+
</div>
|
| 290 |
+
</div>
|
| 291 |
+
|
| 292 |
+
<!-- Bottom Banner -->
|
| 293 |
+
<div class="bg-amber-600 rounded-xl overflow-hidden">
|
| 294 |
+
<div class="p-6 md:p-8 text-center">
|
| 295 |
+
<h2 class="text-2xl md:text-3xl font-bold text-white mb-3">Beba com moderação!</h2>
|
| 296 |
+
<p class="text-amber-100 mb-4">O ChopeMeter ajuda você a controlar seu consumo de forma responsável.</p>
|
| 297 |
+
<div class="inline-flex space-x-4">
|
| 298 |
+
<span class="inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-amber-800 text-amber-100">
|
| 299 |
+
<i class="fa-solid fa-droplet mr-1"></i> Hidrate-se
|
| 300 |
+
</span>
|
| 301 |
+
<span class="inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-amber-800 text-amber-100">
|
| 302 |
+
<i class="fa-solid fa-utensils mr-1"></i> Coma algo
|
| 303 |
+
</span>
|
| 304 |
+
<span class="inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-amber-800 text-amber-100">
|
| 305 |
+
<i class="fa-solid fa-taxi mr-1"></i> Volte com segurança
|
| 306 |
+
</span>
|
| 307 |
+
</div>
|
| 308 |
+
</div>
|
| 309 |
+
</div>
|
| 310 |
+
</div>
|
| 311 |
+
|
| 312 |
+
<script>
|
| 313 |
+
// DOM Elements
|
| 314 |
+
const beerForm = document.getElementById('beerForm');
|
| 315 |
+
const barSelect = document.getElementById('bar');
|
| 316 |
+
const otherBarInput = document.getElementById('otherBar');
|
| 317 |
+
const glassSizeInput = document.getElementById('glassSize');
|
| 318 |
+
const glassSizeOutput = document.getElementById('glassSizeValue');
|
| 319 |
+
const totalBeersToday = document.getElementById('totalBeersToday');
|
| 320 |
+
const totalLitersToday = document.getElementById('totalLitersToday');
|
| 321 |
+
const totalSpentToday = document.getElementById('totalSpentToday');
|
| 322 |
+
const totalSpentMonth = document.getElementById('totalSpentMonth');
|
| 323 |
+
const limitProgress = document.getElementById('limitProgress');
|
| 324 |
+
const currentProgress = document.getElementById('currentProgress');
|
| 325 |
+
const setLimitBtn = document.getElementById('setLimitBtn');
|
| 326 |
+
const limitContainer = document.getElementById('limitContainer');
|
| 327 |
+
const dailyLimitInput = document.getElementById('dailyLimit');
|
| 328 |
+
const saveLimitBtn = document.getElementById('saveLimitBtn');
|
| 329 |
+
const recentBeersTable = document.getElementById('recentBeersTable');
|
| 330 |
+
|
| 331 |
+
// Charts
|
| 332 |
+
let dailyConsumptionChart, beerStylesChart;
|
| 333 |
+
|
| 334 |
+
// Data Storage
|
| 335 |
+
let beers = JSON.parse(localStorage.getItem('chopemeter_beers')) || [];
|
| 336 |
+
let dailyLimit = localStorage.getItem('chopemeter_dailyLimit') || 1000;
|
| 337 |
+
dailyLimitInput.value = dailyLimit;
|
| 338 |
+
|
| 339 |
+
// Display other bar input if "other" is selected
|
| 340 |
+
barSelect.addEventListener('change', function() {
|
| 341 |
+
otherBarInput.style.display = this.value === 'other' ? 'block' : 'none';
|
| 342 |
+
});
|
| 343 |
+
|
| 344 |
+
// Update glass size output
|
| 345 |
+
glassSizeInput.addEventListener('input', function() {
|
| 346 |
+
glassSizeOutput.textContent = `${this.value}ml`;
|
| 347 |
+
glassSizeOutput.style.transform = 'scale(1.2)';
|
| 348 |
+
setTimeout(() => glassSizeOutput.style.transform = 'scale(1)', 200);
|
| 349 |
+
});
|
| 350 |
+
|
| 351 |
+
// Set limit button
|
| 352 |
+
setLimitBtn.addEventListener('click', function() {
|
| 353 |
+
limitContainer.classList.toggle('hidden');
|
| 354 |
+
});
|
| 355 |
+
|
| 356 |
+
// Save limit
|
| 357 |
+
saveLimitBtn.addEventListener('click', function() {
|
| 358 |
+
dailyLimit = dailyLimitInput.value;
|
| 359 |
+
localStorage.setItem('chopemeter_dailyLimit', dailyLimit);
|
| 360 |
+
limitContainer.classList.add('hidden');
|
| 361 |
+
updateStats();
|
| 362 |
+
});
|
| 363 |
+
|
| 364 |
+
// Form submit
|
| 365 |
+
beerForm.addEventListener('submit', function(e) {
|
| 366 |
+
e.preventDefault();
|
| 367 |
+
|
| 368 |
+
const formData = new FormData(this);
|
| 369 |
+
const bar = formData.get('bar') === 'other' ? formData.get('otherBar') : formData.get('bar');
|
| 370 |
+
const beerStyle = formData.get('beerStyle');
|
| 371 |
+
const glassSize = formData.get('glassSize');
|
| 372 |
+
const beerPrice = parseFloat(formData.get('beerPrice')).toFixed(2);
|
| 373 |
+
const date = new Date();
|
| 374 |
+
|
| 375 |
+
const newBeer = {
|
| 376 |
+
id: Date.now(),
|
| 377 |
+
date: date.toISOString(),
|
| 378 |
+
bar,
|
| 379 |
+
beerStyle,
|
| 380 |
+
glassSize: parseInt(glassSize),
|
| 381 |
+
beerPrice: parseFloat(beerPrice)
|
| 382 |
+
};
|
| 383 |
+
|
| 384 |
+
beers.unshift(newBeer);
|
| 385 |
+
localStorage.setItem('chopemeter_beers', JSON.stringify(beers));
|
| 386 |
+
|
| 387 |
+
// Reset form
|
| 388 |
+
this.reset();
|
| 389 |
+
glassSizeInput.value = 300;
|
| 390 |
+
glassSizeOutput.textContent = '300ml';
|
| 391 |
+
|
| 392 |
+
// Update UI
|
| 393 |
+
updateStats();
|
| 394 |
+
updateRecentBeers();
|
| 395 |
+
updateCharts();
|
| 396 |
+
|
| 397 |
+
// Success animation
|
| 398 |
+
const beerIcon = document.querySelector('.beer-glass');
|
| 399 |
+
beerIcon.style.transform = 'rotate(30deg) scale(1.2)';
|
| 400 |
+
setTimeout(() => {
|
| 401 |
+
beerIcon.style.transform = 'rotate(-30deg)';
|
| 402 |
+
setTimeout(() => beerIcon.style.transform = 'rotate(0deg)', 300);
|
| 403 |
+
}, 300);
|
| 404 |
+
});
|
| 405 |
+
|
| 406 |
+
// Update all stats
|
| 407 |
+
function updateStats() {
|
| 408 |
+
const today = new Date().toISOString().split('T')[0];
|
| 409 |
+
const currentMonth = new Date().getMonth() + 1;
|
| 410 |
+
const currentYear = new Date().getFullYear();
|
| 411 |
+
|
| 412 |
+
// Today's stats
|
| 413 |
+
const todayBeers = beers.filter(beer => beer.date.split('T')[0] === today);
|
| 414 |
+
const todayTotalLiters = todayBeers.reduce((sum, beer) => sum + beer.glassSize, 0) / 1000;
|
| 415 |
+
const todayTotalSpent = todayBeers.reduce((sum, beer) => sum + beer.beerPrice, 0);
|
| 416 |
+
|
| 417 |
+
// Month's stats
|
| 418 |
+
const monthBeers = beers.filter(beer => {
|
| 419 |
+
const beerDate = new Date(beer.date);
|
| 420 |
+
return beerDate.getMonth() + 1 === currentMonth && beerDate.getFullYear() === currentYear;
|
| 421 |
+
});
|
| 422 |
+
const monthTotalSpent = monthBeers.reduce((sum, beer) => sum + beer.beerPrice, 0);
|
| 423 |
+
|
| 424 |
+
// Update DOM
|
| 425 |
+
totalBeersToday.textContent = todayBeers.length;
|
| 426 |
+
totalLitersToday.textContent = todayTotalLiters.toFixed(2) + 'L';
|
| 427 |
+
totalSpentToday.textContent = 'R$ ' + todayTotalSpent.toFixed(2).replace('.', ',');
|
| 428 |
+
totalSpentMonth.textContent = 'R$ ' + monthTotalSpent.toFixed(2).replace('.', ',');
|
| 429 |
+
|
| 430 |
+
// Update progress bar
|
| 431 |
+
const progressPercentage = Math.min((todayTotalLiters * 1000) / dailyLimit * 100, 100);
|
| 432 |
+
limitProgress.style.width = `${progressPercentage}%`;
|
| 433 |
+
|
| 434 |
+
// Change color if close to limit
|
| 435 |
+
if (progressPercentage >= 80) {
|
| 436 |
+
limitProgress.style.background = 'linear-gradient(to right, #e74c3c, #c0392b)';
|
| 437 |
+
} else {
|
| 438 |
+
limitProgress.style.background = 'linear-gradient(to right, #f0a71e, #e67e22)';
|
| 439 |
+
}
|
| 440 |
+
|
| 441 |
+
currentProgress.textContent = `${todayTotalLiters * 1000}ml / ${dailyLimit}ml`;
|
| 442 |
+
}
|
| 443 |
+
|
| 444 |
+
// Update recent beers table
|
| 445 |
+
function updateRecentBeers() {
|
| 446 |
+
if (beers.length === 0) {
|
| 447 |
+
recentBeersTable.innerHTML = `
|
| 448 |
+
<tr>
|
| 449 |
+
<td colspan="6" class="px-6 py-4 text-center text-gray-500">Nenhum chope registrado ainda.</td>
|
| 450 |
+
</tr>
|
| 451 |
+
`;
|
| 452 |
+
return;
|
| 453 |
+
}
|
| 454 |
+
|
| 455 |
+
recentBeersTable.innerHTML = beers.slice(0, 5).map(beer => {
|
| 456 |
+
const date = new Date(beer.date);
|
| 457 |
+
const formattedDate = date.toLocaleDateString('pt-BR', {
|
| 458 |
+
day: '2-digit',
|
| 459 |
+
month: '2-digit',
|
| 460 |
+
year: 'numeric',
|
| 461 |
+
hour: '2-digit',
|
| 462 |
+
minute: '2-digit'
|
| 463 |
+
});
|
| 464 |
+
|
| 465 |
+
return `
|
| 466 |
+
<tr>
|
| 467 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-amber-900">${formattedDate}</td>
|
| 468 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-amber-900">${beer.bar}</td>
|
| 469 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-amber-900">${beer.beerStyle}</td>
|
| 470 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-amber-900">${beer.glassSize}ml</td>
|
| 471 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-amber-900">R$ ${beer.beerPrice.toFixed(2).replace('.', ',')}</td>
|
| 472 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-amber-900">
|
| 473 |
+
<button onclick="deleteBeer(${beer.id})" class="text-red-500 hover:text-red-700">
|
| 474 |
+
<i class="fa-solid fa-trash-can"></i>
|
| 475 |
+
</button>
|
| 476 |
+
</td>
|
| 477 |
+
</tr>
|
| 478 |
+
`;
|
| 479 |
+
}).join('');
|
| 480 |
+
}
|
| 481 |
+
|
| 482 |
+
// Delete a beer
|
| 483 |
+
window.deleteBeer = function(id) {
|
| 484 |
+
if (confirm('Tem certeza que deseja excluir este chope?')) {
|
| 485 |
+
beers = beers.filter(beer => beer.id !== id);
|
| 486 |
+
localStorage.setItem('chopemeter_beers', JSON.stringify(beers));
|
| 487 |
+
updateStats();
|
| 488 |
+
updateRecentBeers();
|
| 489 |
+
updateCharts();
|
| 490 |
+
}
|
| 491 |
+
}
|
| 492 |
+
|
| 493 |
+
// Update charts
|
| 494 |
+
function updateCharts() {
|
| 495 |
+
// Last 7 days data
|
| 496 |
+
const dates = [];
|
| 497 |
+
const consumptionData = [];
|
| 498 |
+
|
| 499 |
+
for (let i = 6; i >= 0; i--) {
|
| 500 |
+
const date = new Date();
|
| 501 |
+
date.setDate(date.getDate() - i);
|
| 502 |
+
const dateStr = date.toISOString().split('T')[0];
|
| 503 |
+
|
| 504 |
+
const dayBeers = beers.filter(beer => beer.date.split('T')[0] === dateStr);
|
| 505 |
+
const dayTotalLiters = dayBeers.reduce((sum, beer) => sum + beer.glassSize, 0) / 1000;
|
| 506 |
+
|
| 507 |
+
dates.push(
|
| 508 |
+
date.toLocaleDateString('pt-BR', { day: '2-digit', month: '2-digit' })
|
| 509 |
+
);
|
| 510 |
+
consumptionData.push(dayTotalLiters);
|
| 511 |
+
}
|
| 512 |
+
|
| 513 |
+
// Beer styles data
|
| 514 |
+
const styles = ['IPA', 'Lager', 'Stout', 'Pilsen'];
|
| 515 |
+
const styleCounts = styles.map(style => {
|
| 516 |
+
return beers.filter(beer => beer.beerStyle === style).length;
|
| 517 |
+
});
|
| 518 |
+
|
| 519 |
+
// Update daily consumption chart
|
| 520 |
+
if (dailyConsumptionChart) {
|
| 521 |
+
dailyConsumptionChart.destroy();
|
| 522 |
+
}
|
| 523 |
+
|
| 524 |
+
const dailyCtx = document.getElementById('dailyConsumptionChart').getContext('2d');
|
| 525 |
+
dailyConsumptionChart = new Chart(dailyCtx, {
|
| 526 |
+
type: 'bar',
|
| 527 |
+
data: {
|
| 528 |
+
labels: dates,
|
| 529 |
+
datasets: [{
|
| 530 |
+
label: 'Litros consumidos',
|
| 531 |
+
data: consumptionData,
|
| 532 |
+
backgroundColor: 'rgba(234, 179, 8, 0.7)',
|
| 533 |
+
borderColor: 'rgba(234, 179, 8, 1)',
|
| 534 |
+
borderWidth: 1
|
| 535 |
+
}]
|
| 536 |
+
},
|
| 537 |
+
options: {
|
| 538 |
+
scales: {
|
| 539 |
+
y: {
|
| 540 |
+
beginAtZero: true,
|
| 541 |
+
ticks: {
|
| 542 |
+
callback: function(value) {
|
| 543 |
+
return value + 'L';
|
| 544 |
+
}
|
| 545 |
+
}
|
| 546 |
+
}
|
| 547 |
+
}
|
| 548 |
+
}
|
| 549 |
+
});
|
| 550 |
+
|
| 551 |
+
// Update beer styles chart
|
| 552 |
+
if (beerStylesChart) {
|
| 553 |
+
beerStylesChart.destroy();
|
| 554 |
+
}
|
| 555 |
+
|
| 556 |
+
const beerStylesCtx = document.getElementById('beerStylesChart').getContext('2d');
|
| 557 |
+
beerStylesChart = new Chart(beerStylesCtx, {
|
| 558 |
+
type: 'doughnut',
|
| 559 |
+
data: {
|
| 560 |
+
labels: styles,
|
| 561 |
+
datasets: [{
|
| 562 |
+
data: styleCounts,
|
| 563 |
+
backgroundColor: [
|
| 564 |
+
'rgba(240, 167, 30, 0.7)',
|
| 565 |
+
'rgba(255, 204, 51, 0.7)',
|
| 566 |
+
'rgba(44, 26, 10, 0.7)',
|
| 567 |
+
'rg255, 215, 0, 0.7)'
|
| 568 |
+
],
|
| 569 |
+
borderColor: [
|
| 570 |
+
'rgba(240, 167, 30, 1)',
|
| 571 |
+
'rgba(255, 204, 51, 1)',
|
| 572 |
+
'rgba(44, 26, 10, 1)',
|
| 573 |
+
'rgba(255, 215, 0, 1)'
|
| 574 |
+
],
|
| 575 |
+
borderWidth: 1
|
| 576 |
+
}]
|
| 577 |
+
},
|
| 578 |
+
options: {
|
| 579 |
+
plugins: {
|
| 580 |
+
legend: {
|
| 581 |
+
position: 'bottom'
|
| 582 |
+
}
|
| 583 |
+
}
|
| 584 |
+
}
|
| 585 |
+
});
|
| 586 |
+
}
|
| 587 |
+
|
| 588 |
+
// Initial setup
|
| 589 |
+
updateStats();
|
| 590 |
+
updateRecentBeers();
|
| 591 |
+
updateCharts();
|
| 592 |
+
</script>
|
| 593 |
+
<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=maverickv8/chopemeter" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 594 |
+
</html>
|