feat: aggiunti: loggica random, tema scuro, correzioni mail, miglioramenti generali, cache;

This commit is contained in:
StefanoSalemi
2026-04-17 18:27:37 +02:00
parent a7ef46640d
commit 104ad53a9a
26 changed files with 861 additions and 216 deletions

View File

@@ -47,7 +47,23 @@
<div class="content-wrapper">
<!-- Theme Settings Card -->
<div class="card" style="margin-bottom: 2rem;">
<div class="card-header">
<h3>Tema</h3>
</div>
<div class="card-body">
<div class="form-group">
<label style="font-weight: 500; display: block; margin-bottom: 0.5rem;">Tema dell'applicazione</label>
<select id="themeSelect" class="form-select" style="max-width: 300px;">
<option value="system">Sistema (Predefinito)</option>
<option value="light">Chiaro</option>
<option value="dark">Scuro</option>
</select>
<small class="text-muted" style="display: block; margin-top: 0.5rem;">Scegli il tema preferito da utilizzare nell'applicazione.</small>
</div>
</div>
</div>
<div class="card">
<div class="card-header">
<h3>Notifiche Parcheggio</h3>
@@ -138,6 +154,10 @@
document.getElementById('notifyParkingChanges').checked = currentUser.notify_parking_changes !== 0;
updateDailyTimeVisibility();
// Populate Theme
const savedTheme = localStorage.getItem('theme') || 'system';
document.getElementById('themeSelect').value = savedTheme;
}
function updateDailyTimeVisibility() {
@@ -173,6 +193,15 @@
// Toggle daily time visibility
document.getElementById('notifyDailyParking').addEventListener('change', updateDailyTimeVisibility);
// Save Theme dynamically
document.getElementById('themeSelect').addEventListener('change', (e) => {
const theme = e.target.value;
if (typeof applyTheme === 'function') {
applyTheme(theme);
utils.showMessage('Tema aggiornato', 'success');
}
});
}
</script>
</body>