feat: initial commit for TodoFlow - Conteneurised API and Glassmorphic Desktop Widget

This commit is contained in:
Michael committed 2026-05-26 17:42:14 +02:00
commit a996f0694b
23 files changed
+1897

No files matched your search

+339
View File
@@ -0,0 +1,339 @@
// --- CONFIGURATIONS INITIALES ET ÉTATS ---
// Références vers l'API Tauri (uniquement si exécuté sous Tauri)
const tauri = window.__TAURI__;
const appWindow = tauri ? tauri.window.getCurrent() : null;
const invoke = tauri ? tauri.invoke : null;
// État local de l'application
let state = {
apiUrl: "http://localhost:8000",
apiKey: "widget-token-secure-789",
alwaysOnTop: false,
autostart: false,
tasks: [],
pollingInterval: null
};
// --- SÉLECTEURS DOM ---
const statusIndicator = document.getElementById("connection-status");
const taskProgress = document.getElementById("task-progress");
const tasksList = document.getElementById("tasks-list");
const addTaskForm = document.getElementById("add-task-form");
const taskInput = document.getElementById("task-input");
// Paramètres panel
const settingsPanel = document.getElementById("settings-panel");
const btnSettings = document.getElementById("btn-settings");
const btnSettingsClose = document.getElementById("btn-settings-close");
const btnSaveSettings = document.getElementById("btn-save-settings");
// Inputs de configuration
const inputApiUrl = document.getElementById("setting-api-url");
const inputApiKey = document.getElementById("setting-api-key");
const inputAlwaysOnTop = document.getElementById("setting-always-on-top");
const inputAutostart = document.getElementById("setting-autostart");
// Contrôles de fenêtre
const btnMinimize = document.getElementById("btn-minimize");
const btnClose = document.getElementById("btn-close");
// --- INITIALISATION ---
document.addEventListener("DOMContentLoaded", async () => {
// Chargement des paramètres stockés localement
loadSettingsFromStorage();
// Remplissage initial des champs du panneau de configuration
inputApiUrl.value = state.apiUrl;
inputApiKey.value = state.apiKey;
inputAlwaysOnTop.checked = state.alwaysOnTop;
// Événements d'ouverture/fermeture des paramètres
btnSettings.addEventListener("click", () => settingsPanel.classList.add("open"));
btnSettingsClose.addEventListener("click", () => settingsPanel.classList.remove("open"));
btnSaveSettings.addEventListener("click", saveSettings);
// Événements Tauri pour le contrôle de la fenêtre de bureau
if (appWindow) {
btnMinimize.addEventListener("click", () => appWindow.minimize());
btnClose.addEventListener("click", () => appWindow.hide()); // Masquer vers le tray au clic sur 'Fermer'
// Récupération de l'état réel du démarrage automatique depuis le registre Windows
try {
state.autostart = await invoke("get_autostart");
inputAutostart.checked = state.autostart;
} catch (e) {
console.warn("Impossible de lire l'état de démarrage automatique :", e);
}
} else {
// Si exécuté hors de Tauri (ex: navigateur classique), masquer les boutons de fenêtre
btnMinimize.style.display = "none";
btnClose.style.display = "none";
document.querySelector(".setting-toggle").style.display = "none"; // Cacher l'autostart
}
// Événement d'ajout de tâche
addTaskForm.addEventListener("submit", handleAddTask);
// Démarrage de la synchronisation en temps réel (Polling toutes les 4 secondes)
fetchTasks();
state.pollingInterval = setInterval(fetchTasks, 4000);
});
// --- ENREGISTREMENT ET CHARGEMENT DES PARAMÈTRES ---
function loadSettingsFromStorage() {
// Charge la configuration pour assurer la persistance des ordinateurs de travail
const storedApiUrl = localStorage.getItem("todoflow_api_url");
const storedApiKey = localStorage.getItem("todoflow_api_key");
const storedAlwaysOnTop = localStorage.getItem("todoflow_always_on_top");
if (storedApiUrl) state.apiUrl = storedApiUrl;
if (storedApiKey) state.apiKey = storedApiKey;
if (storedAlwaysOnTop) {
state.alwaysOnTop = storedAlwaysOnTop === "true";
// Appliquer directement la préférence au démarrage
if (appWindow && invoke) {
invoke("toggle_always_on_top", { enabled: state.alwaysOnTop }).catch(console.error);
}
}
}
async function saveSettings() {
const newUrl = inputApiUrl.value.trim().replace(/\/$/, ""); // Retirer le slash de fin éventuel
const newKey = inputApiKey.value.trim();
const newAlwaysOnTop = inputAlwaysOnTop.checked;
const newAutostart = inputAutostart.checked;
state.apiUrl = newUrl;
state.apiKey = newKey;
state.alwaysOnTop = newAlwaysOnTop;
localStorage.setItem("todoflow_api_url", newUrl);
localStorage.setItem("todoflow_api_key", newKey);
localStorage.setItem("todoflow_always_on_top", newAlwaysOnTop.toString());
// Appel des fonctions système Windows natives via Tauri
if (appWindow && invoke) {
try {
await invoke("toggle_always_on_top", { enabled: newAlwaysOnTop });
await invoke("set_autostart", { enabled: newAutostart });
state.autostart = newAutostart;
} catch (e) {
alert(`Erreur système : ${e}`);
}
}
// Fermer le volet et forcer un rafraîchissement immédiat de la liste
settingsPanel.classList.remove("open");
fetchTasks();
}
// --- APPELS API (CRUD) ---
async function fetchTasks() {
// Récupération asynchrone des tâches avec la clé API
try {
const response = await fetch(`${state.apiUrl}/api/v1/tasks`, {
method: "GET",
headers: {
"X-API-Key": state.apiKey,
"Accept": "application/json"
}
});
if (!response.ok) throw new Error("Accès refusé ou serveur indisponible");
const tasks = await response.json();
state.tasks = tasks;
// Mise à jour de l'indicateur lumineux sur le header (Connecté)
statusIndicator.className = "status-indicator connected";
statusIndicator.title = "Connecté à la base centralisée";
renderTasksList();
} catch (error) {
console.error("Erreur de synchronisation :", error);
statusIndicator.className = "status-indicator disconnected";
statusIndicator.title = "Erreur de connexion avec le serveur";
}
}
async function handleAddTask(e) {
e.preventDefault();
const title = taskInput.value.trim();
if (!title) return;
// Création directe via un appel POST à l'API centralisée
try {
const response = await fetch(`${state.apiUrl}/api/v1/tasks`, {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-Key": state.apiKey
},
json: true,
body: JSON.stringify({
title: title,
status: "A faire" // Statut initial par défaut
})
});
if (!response.ok) throw new Error("Échec de la création de la tâche");
taskInput.value = ""; // Vider le champ après création
fetchTasks(); // Rafraîchir pour afficher la tâche créée avec son animation
} catch (error) {
alert("Impossible d'ajouter la tâche : vérifiez votre connexion ou clé API.");
}
}
async function toggleTaskDone(taskId, currentStatus) {
// Permet de cocher ou décocher une tâche
const targetStatus = currentStatus === "Termine" ? "A faire" : "Termine";
try {
const response = await fetch(`${state.apiUrl}/api/v1/tasks/${taskId}`, {
method: "PUT",
headers: {
"Content-Type": "application/json",
"X-API-Key": state.apiKey
},
body: JSON.stringify({
status: targetStatus
})
});
if (!response.ok) throw new Error("Échec de mise à jour");
fetchTasks();
} catch (error) {
console.error("Erreur de mise à jour du statut :", error);
}
}
async function toggleTaskInProgress(taskId, currentStatus) {
// Permet de basculer spécifiquement les travaux "En cours" ou "À faire"
if (currentStatus === "Termine") return; // On ne modifie pas directement les tâches terminées par ici
const targetStatus = currentStatus === "En cours" ? "A faire" : "En cours";
try {
const response = await fetch(`${state.apiUrl}/api/v1/tasks/${taskId}`, {
method: "PUT",
headers: {
"Content-Type": "application/json",
"X-API-Key": state.apiKey
},
body: JSON.stringify({
status: targetStatus
})
});
if (!response.ok) throw new Error("Échec de mise à jour");
fetchTasks();
} catch (error) {
console.error("Erreur de mise à jour de l'état de travail :", error);
}
}
// --- AFFICHAGE ET LOGIQUE DE RENDU ---
function renderTasksList() {
if (state.tasks.length === 0) {
tasksList.innerHTML = `
<div class="empty-state">
<p>Aucune tâche en cours</p>
<span class="empty-subtext">Tout est à jour ! Excellent travail.</span>
</div>
`;
taskProgress.style.width = "0%";
return;
}
// Calcul et mise à jour de la barre de progression linéaire
const completedTasks = state.tasks.filter(t => t.status === "Termine").length;
const progressPercent = Math.round((completedTasks / state.tasks.length) * 100);
taskProgress.style.width = `${progressPercent}%`;
tasksList.innerHTML = "";
state.tasks.forEach(task => {
const isCompleted = task.status === "Termine";
// Structure de la carte de tâche
const card = document.createElement("div");
card.className = `task-card ${isCompleted ? 'completed' : ''}`;
// Checkbox personnalisée cochable
const checkbox = document.createElement("div");
checkbox.className = `custom-checkbox ${isCompleted ? 'checked' : ''}`;
checkbox.innerHTML = `
<svg width="10" height="8" viewBox="0 0 10 8" fill="none">
<path d="M1.5 4L3.75 6.25L8.5 1.5" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
`;
checkbox.addEventListener("click", (e) => {
e.stopPropagation();
toggleTaskDone(task.id, task.status);
});
// Bloc de contenu (Titre & Date)
const content = document.createElement("div");
content.className = "task-content";
const title = document.createElement("span");
title.className = "task-title";
title.textContent = task.title;
title.title = task.title; // Tooltip d'accessibilité
const date = document.createElement("span");
date.className = "task-date";
date.textContent = `Créé le ${formatDate(task.created_at)}`;
content.appendChild(title);
content.appendChild(date);
// Badge de statut (En cours / À faire)
const badge = document.createElement("span");
if (task.status === "Termine") {
badge.className = "status-badge done";
badge.textContent = "Terminé";
} else if (task.status === "En cours") {
badge.className = "status-badge in-progress";
badge.textContent = "En cours";
badge.title = "Cliquer pour marquer 'À faire'";
badge.addEventListener("click", () => toggleTaskInProgress(task.id, task.status));
} else {
badge.className = "status-badge todo";
badge.textContent = "À faire";
badge.title = "Cliquer pour marquer 'En cours'";
badge.addEventListener("click", () => toggleTaskInProgress(task.id, task.status));
}
card.appendChild(checkbox);
card.appendChild(content);
card.appendChild(badge);
tasksList.appendChild(card);
});
}
// Formatage de la date en français épuré
function formatDate(dateString) {
try {
const date = new Date(dateString);
// Format : "26 mai • 14:15"
const optionsDay = { day: 'numeric', month: 'short' };
const dayStr = date.toLocaleDateString('fr-FR', optionsDay);
const hours = date.getHours().toString().padStart(2, '0');
const minutes = date.getMinutes().toString().padStart(2, '0');
return `${dayStr} • ${hours}:${minutes}`;
} catch (e) {
return dateString;
}
}
+107
View File
@@ -0,0 +1,107 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>TodoFlow</title>
<!-- Importation de la police Google Fonts Inter pour une typographie premium -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="todo-widget">
<!-- Barre supérieure personnalisée avec zone de déplacement pour Tauri -->
<header class="widget-header" data-tauri-drag-region>
<div class="header-left" data-tauri-drag-region>
<span class="status-indicator disconnected" id="connection-status" title="Déconnecté"></span>
<h1 class="widget-title" data-tauri-drag-region>TodoFlow</h1>
</div>
<div class="header-right">
<!-- Boutons de contrôle de la fenêtre (indispensables en mode sans bordure) -->
<button class="win-btn" id="btn-minimize" title="Réduire">
<svg width="12" height="12" viewBox="0 0 12 12"><rect x="2" y="5.5" width="8" height="1" fill="currentColor"/></svg>
</button>
<button class="win-btn" id="btn-settings" title="Paramètres">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg>
</button>
<button class="win-btn btn-close" id="btn-close" title="Fermer (Masquer)">
<svg width="12" height="12" viewBox="0 0 12 12"><path d="M2.5 2.5 L9.5 9.5 M9.5 2.5 L2.5 9.5" stroke="currentColor" stroke-width="1.2"/></svg>
</button>
</div>
</header>
<!-- Indicateur de progression des tâches -->
<div class="progress-container">
<div class="progress-bar" id="task-progress" style="width: 0%"></div>
</div>
<!-- Zone de contenu principal -->
<div class="widget-body">
<!-- Formulaire d'ajout rapide (Création directe via le widget) -->
<form id="add-task-form" class="add-task-form">
<input type="text" id="task-input" placeholder="Ajouter une tâche..." required maxlength="100">
<button type="submit" class="btn-add" title="Ajouter la tâche">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>
</button>
</form>
<!-- Liste des Tâches -->
<main class="tasks-list" id="tasks-list">
<!-- Rempli dynamiquement en JS -->
<div class="empty-state">
<p>Aucune tâche disponible</p>
<span class="empty-subtext">Configurez l'API dans les paramètres</span>
</div>
</main>
</div>
<!-- Panneau de Paramètres (Glisse depuis le bas) -->
<div class="settings-panel" id="settings-panel">
<div class="settings-header">
<h2>Configuration</h2>
<button class="btn-icon-close" id="btn-settings-close">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
</button>
</div>
<div class="settings-body">
<div class="setting-group">
<label for="setting-api-url">URL du Serveur API</label>
<input type="url" id="setting-api-url" placeholder="http://localhost:8000" required>
</div>
<div class="setting-group">
<label for="setting-api-key">Clé API (X-API-Key)</label>
<input type="password" id="setting-api-key" placeholder="widget-token-secure-789" required>
</div>
<div class="setting-toggle">
<label class="switch-container">
<span class="switch-label">Toujours au premier plan</span>
<input type="checkbox" id="setting-always-on-top">
<span class="switch-slider"></span>
</label>
</div>
<div class="setting-toggle">
<label class="switch-container">
<span class="switch-label">Lancer au démarrage</span>
<input type="checkbox" id="setting-autostart">
<span class="switch-slider"></span>
</label>
</div>
<button class="btn-save" id="btn-save-settings">Enregistrer</button>
</div>
</div>
</div>
<!-- Intégration de l'API Tauri pour la communication inter-processus -->
<script>
// Import dynamique pour supporter l'exécution dans le navigateur pendant le dév
window.__TAURI__ = window.__TAURI__ || null;
</script>
<script src="app.js"></script>
</body>
</html>
+573
View File
@@ -0,0 +1,573 @@
/* --- SYSTÈME DE DESIGN & TOKENS --- */
:root {
--bg-widget: rgba(18, 22, 33, 0.70);
--bg-card: rgba(255, 255, 255, 0.03);
--bg-card-hover: rgba(255, 255, 255, 0.07);
--border-widget: 1px solid rgba(255, 255, 255, 0.09);
--border-card: 1px solid rgba(255, 255, 255, 0.05);
/* Couleurs thématiques HSL */
--accent-indigo: hsl(250, 85%, 65%);
--accent-indigo-glow: rgba(99, 102, 241, 0.3);
--accent-mint: hsl(165, 80%, 42%);
--accent-mint-glow: rgba(16, 185, 129, 0.15);
--accent-amber: hsl(38, 95%, 55%);
--accent-amber-glow: rgba(245, 158, 11, 0.15);
/* Textes */
--text-primary: hsl(220, 20%, 96%);
--text-secondary: hsl(220, 12%, 68%);
--text-muted: rgba(241, 243, 249, 0.45);
}
/* Réinitialisation de base */
* {
box-sizing: border-box;
margin: 0;
padding: 0;
user-select: none; /* Évite la sélection de texte accidentelle pour un widget */
}
body {
background: transparent; /* Indispensable pour la transparence de la fenêtre Tauri */
font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
color: var(--text-primary);
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
overflow: hidden;
}
/* --- LE CONTAINER DU WIDGET (GLASSMORPHISM PREMIUM) --- */
.todo-widget {
width: 340px;
height: 520px;
background: var(--bg-widget);
backdrop-filter: blur(30px) saturate(125%);
-webkit-backdrop-filter: blur(30px) saturate(125%);
border-radius: 16px;
border: var(--border-widget);
box-shadow:
0 8px 32px 0 rgba(0, 0, 0, 0.35),
0 1px 0px 0px rgba(255, 255, 255, 0.12) inset;
display: flex;
flex-direction: column;
position: relative;
overflow: hidden;
}
/* --- HEADER DU WIDGET --- */
.widget-header {
padding: 16px 16px 12px 16px;
display: flex;
justify-content: space-between;
align-items: center;
cursor: grab; /* Indique qu'on peut faire glisser le widget */
}
.widget-header:active {
cursor: grabbing;
}
.header-left {
display: flex;
align-items: center;
gap: 8px;
}
/* Indicateur d'état connecté à l'API */
.status-indicator {
width: 8px;
height: 8px;
border-radius: 50%;
transition: all 0.5s ease;
}
.status-indicator.connected {
background-color: var(--accent-mint);
box-shadow: 0 0 8px var(--accent-mint);
}
.status-indicator.disconnected {
background-color: hsl(0, 80%, 60%);
box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}
.widget-title {
font-size: 14px;
font-weight: 700;
letter-spacing: 0.8px;
text-transform: uppercase;
color: var(--text-primary);
opacity: 0.95;
}
.header-right {
display: flex;
align-items: center;
gap: 4px;
z-index: 10; /* Assure le clic par-dessus la zone de drag */
}
/* Boutons de contrôle style Windows */
.win-btn {
background: transparent;
border: none;
width: 26px;
height: 26px;
border-radius: 6px;
color: var(--text-secondary);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.2s ease;
}
.win-btn:hover {
background: rgba(255, 255, 255, 0.08);
color: var(--text-primary);
}
.win-btn.btn-close:hover {
background: hsl(0, 75%, 50%);
color: #fff;
}
/* --- INDICATEUR DE PROGRESSION --- */
.progress-container {
width: 100%;
height: 2px;
background: rgba(255, 255, 255, 0.05);
overflow: hidden;
}
.progress-bar {
height: 100%;
background: linear-gradient(90deg, var(--accent-indigo), var(--accent-mint));
transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
/* --- ZONE DE CORPS --- */
.widget-body {
flex: 1;
padding: 16px;
display: flex;
flex-direction: column;
gap: 16px;
overflow: hidden;
}
/* Formulaire d'ajout de tâche */
.add-task-form {
display: flex;
gap: 8px;
background: rgba(0, 0, 0, 0.15);
border: 1px solid rgba(255, 255, 255, 0.03);
border-radius: 10px;
padding: 4px 6px;
transition: border-color 0.3s;
}
.add-task-form:focus-within {
border-color: rgba(99, 102, 241, 0.4);
}
.add-task-form input {
flex: 1;
background: transparent;
border: none;
outline: none;
color: var(--text-primary);
font-size: 13px;
padding: 6px;
font-family: inherit;
}
.add-task-form input::placeholder {
color: rgba(241, 243, 249, 0.35);
}
.btn-add {
background: var(--accent-indigo);
border: none;
width: 28px;
height: 28px;
border-radius: 8px;
color: #fff;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-add:hover {
transform: scale(1.05);
box-shadow: 0 0 10px var(--accent-indigo-glow);
}
.btn-add svg {
transition: transform 0.3s ease;
}
.btn-add:hover svg {
transform: rotate(90deg);
}
/* --- LISTE DES TÂCHES --- */
.tasks-list {
flex: 1;
overflow-y: auto;
padding-right: 2px;
display: flex;
flex-direction: column;
gap: 8px;
}
/* Personnalisation Scrollbar */
.tasks-list::-webkit-scrollbar {
width: 4px;
}
.tasks-list::-webkit-scrollbar-track {
background: transparent;
}
.tasks-list::-webkit-scrollbar-thumb {
background: rgba(255, 255, 255, 0.1);
border-radius: 10px;
}
/* --- CARTE DE TÂCHE INDIVIDUELLE --- */
.task-card {
background: var(--bg-card);
border: var(--border-card);
border-radius: 12px;
padding: 12px 14px;
display: flex;
align-items: center;
gap: 12px;
transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
position: relative;
opacity: 1;
}
.task-card:hover {
transform: translateY(-2px);
background: var(--bg-card-hover);
border-color: rgba(99, 102, 241, 0.2);
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}
/* Checkbox personnalisée */
.custom-checkbox {
width: 18px;
height: 18px;
border-radius: 50%;
border: 1.5px solid rgba(255, 255, 255, 0.35);
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
flex-shrink: 0;
}
.custom-checkbox:hover {
border-color: var(--accent-indigo);
background: rgba(99, 102, 241, 0.08);
}
/* Checkbox cochée (Terminé) */
.custom-checkbox.checked {
background: linear-gradient(135deg, hsl(165, 80%, 42%), hsl(165, 80%, 32%));
border-color: transparent;
animation: checkboxPop 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.custom-checkbox.checked svg {
display: block;
color: white;
}
.custom-checkbox svg {
display: none;
}
@keyframes checkboxPop {
50% { transform: scale(1.2); }
100% { transform: scale(1); }
}
/* Contenu textuel de la carte */
.task-content {
display: flex;
flex-direction: column;
flex-grow: 1;
min-width: 0; /* Permet le troncage correct du texte */
}
.task-title {
font-size: 13px;
font-weight: 500;
color: var(--text-primary);
transition: color 0.3s;
position: relative;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: inline-block;
}
.task-date {
font-size: 9.5px;
color: var(--text-secondary);
margin-top: 3px;
}
/* --- BADGES DE STATUT --- */
.status-badge {
font-size: 8.5px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.5px;
padding: 3px 7px;
border-radius: 20px;
flex-shrink: 0;
}
.status-badge.in-progress {
background: var(--accent-amber-glow);
color: var(--accent-amber);
border: 1px solid rgba(245, 158, 11, 0.1);
cursor: pointer;
}
.status-badge.todo {
background: rgba(255, 255, 255, 0.05);
color: var(--text-secondary);
border: 1px solid rgba(255, 255, 255, 0.05);
cursor: pointer;
}
.status-badge.done {
background: var(--accent-mint-glow);
color: var(--accent-mint);
border: 1px solid rgba(16, 185, 129, 0.1);
}
/* --- DESIGN DES TÂCHES TERMINÉES (ANIMÉ) --- */
.task-card.completed {
opacity: 0.5;
}
.task-card.completed .task-title {
color: var(--text-muted);
}
.task-card.completed .task-title::after {
content: '';
position: absolute;
left: 0;
top: 52%;
width: 100%;
height: 1px;
background: var(--text-muted);
transform: scaleX(0);
transform-origin: left;
transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.task-card.completed .task-title::after {
transform: scaleX(1);
}
/* État vide */
.empty-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
text-align: center;
color: var(--text-secondary);
padding: 20px;
}
.empty-state p {
font-size: 13px;
font-weight: 500;
margin-bottom: 4px;
}
.empty-subtext {
font-size: 10.5px;
opacity: 0.7;
}
/* --- PANNEAU DE PARAMÈTRES (BOTTOM SLIDE) --- */
.settings-panel {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 380px;
background: rgba(15, 18, 28, 0.95);
border-top: var(--border-widget);
border-radius: 16px 16px 0 0;
padding: 20px;
display: flex;
flex-direction: column;
gap: 16px;
transform: translateY(100%);
transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
z-index: 100;
box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.4);
}
.settings-panel.open {
transform: translateY(0);
}
.settings-header {
display: flex;
justify-content: space-between;
align-items: center;
}
.settings-header h2 {
font-size: 14px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.btn-icon-close {
background: transparent;
border: none;
color: var(--text-secondary);
cursor: pointer;
width: 24px;
height: 24px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.2s;
}
.btn-icon-close:hover {
background: rgba(255, 255, 255, 0.08);
color: var(--text-primary);
}
.settings-body {
display: flex;
flex-direction: column;
gap: 14px;
overflow-y: auto;
}
.setting-group {
display: flex;
flex-direction: column;
gap: 6px;
}
.setting-group label {
font-size: 11px;
font-weight: 500;
color: var(--text-secondary);
}
.setting-group input {
background: rgba(255, 255, 255, 0.05);
border: 1px solid rgba(255, 255, 255, 0.08);
border-radius: 8px;
padding: 8px 10px;
color: var(--text-primary);
font-size: 12px;
outline: none;
font-family: inherit;
transition: border-color 0.3s;
}
.setting-group input:focus {
border-color: var(--accent-indigo);
}
/* Switch Toggles */
.setting-toggle {
display: flex;
align-items: center;
justify-content: space-between;
padding: 4px 0;
}
.switch-container {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
cursor: pointer;
}
.switch-label {
font-size: 12px;
font-weight: 500;
color: var(--text-primary);
}
.switch-container input {
display: none;
}
.switch-slider {
width: 34px;
height: 18px;
background-color: rgba(255, 255, 255, 0.15);
border-radius: 20px;
position: relative;
transition: background-color 0.3s;
}
.switch-slider::before {
content: "";
position: absolute;
width: 12px;
height: 12px;
left: 3px;
bottom: 3px;
background-color: white;
border-radius: 50%;
transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.switch-container input:checked + .switch-slider {
background-color: var(--accent-indigo);
}
.switch-container input:checked + .switch-slider::before {
transform: translateX(16px);
}
/* Bouton enregistrer */
.btn-save {
background: var(--accent-indigo);
color: white;
border: none;
border-radius: 8px;
padding: 10px;
font-size: 13px;
font-weight: 600;
cursor: pointer;
margin-top: 8px;
transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-save:hover {
background: hsl(250, 85%, 58%);
box-shadow: 0 0 10px var(--accent-indigo-glow);
}