From 8590eba91858ecef384bcce8d608a998bc2887ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Gruszczy=C5=84ski?= Date: Wed, 6 Aug 2025 13:44:18 +0200 Subject: [PATCH] poprawki w jogice js, progressbar warstwowy i fix w notatkach --- static/js/functions.js | 5 ++--- templates/list.html | 1 - templates/main.html | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/static/js/functions.js b/static/js/functions.js index 51ba022..c228eb5 100644 --- a/static/js/functions.js +++ b/static/js/functions.js @@ -39,8 +39,8 @@ function updateProgressBar() { const progressLabel = document.getElementById('progress-label'); const percent = total > 0 ? Math.round((purchased / total) * 100) : 0; progressLabel.textContent = `${percent}%`; - progressLabel.classList.toggle('text-white', percent < 50); - progressLabel.classList.toggle('text-dark', percent >= 50); + progressLabel.classList.toggle('text-white', percent < 51); + progressLabel.classList.toggle('text-dark', percent >= 51); // liczniki document.getElementById('purchased-count').textContent = purchased; @@ -48,7 +48,6 @@ function updateProgressBar() { document.getElementById('percent-value').textContent = percent; } - function addItem(listId) { const name = document.getElementById('newItem').value; const quantityInput = document.getElementById('newQuantity'); diff --git a/templates/list.html b/templates/list.html index 63e3f72..ac13720 100644 --- a/templates/list.html +++ b/templates/list.html @@ -80,7 +80,6 @@ - {% if total_expense > 0 %}
💸 Łącznie wydano: {{ '%.2f'|format(total_expense) }} PLN diff --git a/templates/main.html b/templates/main.html index 9fa1b35..fbd20e7 100644 --- a/templates/main.html +++ b/templates/main.html @@ -116,7 +116,7 @@ aria-valuemin="0" aria-valuemax="100">
+ {% if percent < 51 %}text-white{% else %}text-dark{% endif %}"> Produkty: {{ purchased_count }}/{{ total_count }} ({{ percent|round(0) }}%) {% if l.total_expense > 0 %} — 💸 {{ '%.2f'|format(l.total_expense) }} PLN @@ -172,7 +172,7 @@ aria-valuemin="0" aria-valuemax="100"> + {% if percent < 51 %}text-white{% else %}text-dark{% endif %}"> Produkty: {{ purchased_count }}/{{ total_count }} ({{ percent|round(0) }}%) {% if l.total_expense > 0 %} — 💸 {{ '%.2f'|format(l.total_expense) }} PLN