fix css i js

This commit is contained in:
Mateusz Gruszczyński
2025-07-05 16:12:08 +02:00
parent 11617755fb
commit 270c5318d5
8 changed files with 40 additions and 28 deletions

View File

@ -11,13 +11,14 @@
.bg-success {
background-color: #1e7e34 !important;
}
.bg-light {
background-color: #2c2f33 !important;
}
.item-not-checked {
background-color: #2c2f33 !important;
color: white !important;
}
/* --- Styl przycisku wyboru pliku --- */
input[type="file"]::file-selector-button {
background-color: #127429;
background-color: #225d36;
color: #fff;
border: none;
padding: 0.5em 1em;

View File

@ -113,7 +113,7 @@ function setupList(listId, username) {
socket.on('item_added', data => {
showToast(`${data.added_by} dodał: ${data.name}`);
const li = document.createElement('li');
li.className = 'list-group-item d-flex justify-content-between align-items-center flex-wrap bg-light text-dark';
li.className = 'list-group-item d-flex justify-content-between align-items-center flex-wrap item-not-checked';
li.id = `item-${data.id}`;
let quantityBadge = '';
@ -212,7 +212,7 @@ function updateItemState(itemId, isChecked) {
if (isChecked) {
li.classList.add('bg-success', 'text-white');
} else {
li.classList.add('bg-light', 'text-dark');
li.classList.add('item-not-checked');
}
const sp = li.querySelector('.spinner-border');
@ -264,7 +264,7 @@ function deleteItem(id) {
}
function editItem(id, oldName, oldQuantity) {
const newName = prompt('Podaj nową nazwę (lub zostaw starą):', oldName);
const newName = prompt('Podaj nową nazwę (lub zostaw o):', oldName);
if (newName === null) return; // anulował
const newQuantityStr = prompt('Podaj nową ilość:', oldQuantity);
@ -280,7 +280,7 @@ function editItem(id, oldName, oldQuantity) {
socket.emit('edit_item', { item_id: id, new_name: finalName, new_quantity: newQuantity });
}
function submitExpense() {
function submitExpense(listId) {
const amountInput = document.getElementById('expenseAmount');
const amount = parseFloat(amountInput.value);
if (isNaN(amount) || amount <= 0) {
@ -288,13 +288,12 @@ function submitExpense() {
return;
}
socket.emit('add_expense', {
list_id: LIST_ID,
list_id: listId,
amount: amount
});
amountInput.value = '';
}
function copyLink(link) {
if (navigator.share) {
navigator.share({