Page Projets : copie URL dans le menu ⋯ + refonte thème barre Fusion/Spark (#44, #45)
CI / test (push) Successful in 4m24s

This commit is contained in:
2026-10-28 22:59:11 -04:00
parent 6a938cf778
commit f0ca8b9ec6
+20
View File
@@ -34,6 +34,26 @@
if (window.innerWidth > 900) closeDrawer();
});
/* Bascule Dark/Light (#52) : le choix est mémorisé et
l'amorce de _header.html l'a déjà appliqué avant le rendu.
Ici, on ne fait que synchroniser le libellé et le clic. */
var themeBtn = document.getElementById('theme-toggle');
function syncThemeBtn(theme) {
if (!themeBtn) return;
var light = theme === 'light';
themeBtn.textContent = light ? '🌙 Mode sombre' : '☀️ Mode clair';
themeBtn.setAttribute('aria-pressed', light ? 'true' : 'false');
}
if (themeBtn) {
syncThemeBtn(document.documentElement.getAttribute('data-theme') || 'dark');
themeBtn.addEventListener('click', function () {
var next = document.documentElement.getAttribute('data-theme') === 'light' ? 'dark' : 'light';
document.documentElement.setAttribute('data-theme', next);
try { localStorage.setItem('kanbante-theme', next); } catch (e) { /* non-fatal */ }
syncThemeBtn(next);
});
}
if (collapseBtn) {
collapseBtn.addEventListener('click', function () {
var collapsed = document.body.classList.toggle('sidebar-collapsed');