From 4e465087f30d3d0cf381021c7ab7099516c37632 Mon Sep 17 00:00:00 2001 From: WhyKorp <117651228+whykorp@users.noreply.github.com> Date: Sun, 22 Sep 2024 16:49:02 +0200 Subject: [PATCH] Rework --- ruty/todo copy.php | 256 +++++++++++++++++++++++++++++ ruty/todo.php | 394 +++++++++++++++++++++------------------------ 2 files changed, 443 insertions(+), 207 deletions(-) create mode 100644 ruty/todo copy.php diff --git a/ruty/todo copy.php b/ruty/todo copy.php new file mode 100644 index 0000000..00a312e --- /dev/null +++ b/ruty/todo copy.php @@ -0,0 +1,256 @@ + + + Ruty - ToDo List + + + + + + + + + + + +
+
+ + +
+ × +

Ajouter une tâche

+
+
+

+ +
+

+ +
+

+ + +
+
+ + + +

Liste des tâches

+ + + + + + + diff --git a/ruty/todo.php b/ruty/todo.php index 00a312e..d136c50 100644 --- a/ruty/todo.php +++ b/ruty/todo.php @@ -1,10 +1,10 @@ - - Ruty - ToDo List - - - - - - - - - - - -
+
- - -
- × -

Ajouter une tâche

-
-
-

- -
-

- -
-

- - -
-
- - + #close-menu { + position: absolute; + top: 10px; + right: 10px; + font-size: 20px; + cursor: pointer; + } + + /* Menu latéral de modification de tâche */ + #task-edit-menu { + position: fixed; + top: 0; + right: -400px; + width: 300px; + height: 100%; + background-color: #f4f4f4; + box-shadow: -2px 0 5px rgba(0, 0, 0, 0.5); + padding: 20px; + transition: right 0.3s ease-in-out; + z-index: 20; + } + + #task-edit-menu.open { + right: 0; + } + + #close-edit-menu { + position: absolute; + top: 10px; + right: 10px; + font-size: 20px; + cursor: pointer; + } + + .completed { + text-decoration: line-through; + color: gray; + } + + + + + + + +
+
+ + +
+ × +

Ajouter une tâche

+
+
+

+ +
+

+ +
+

+ + +
+
+ +

Liste des tâches

- -
-

+ +
+ × +

Modifier la tâche

+ + -
-

+
+

-
-

+
+

- - +
+

+ + + +
+ + - - - - - - - + } - - + // Mettre à jour les détails de la tâche + function updateTaskDetails() { + const taskId = document.getElementById('edit-task-id').value; + const taskName = document.getElementById('edit-task-name').value; + const description = document.getElementById('edit-description').value; + const tags = document.getElementById('edit-tags').value.split(',').map(tag => tag.trim()); + + const xhr = new XMLHttpRequest(); + xhr.open('POST', 'update_task_details.php', true); + xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); + + xhr.onload = function() { + if (this.status === 200) { + alert('Tâche mise à jour avec succès.'); + document.getElementById('task-edit-menu').classList.remove('open'); + location.reload(); + } + }; + + const data = `task_id=${taskId}&task_name=${encodeURIComponent(taskName)}&description=${encodeURIComponent(description)}&tags=${encodeURIComponent(tags.join(','))}`; + xhr.send(data); + } + +