From 07ceec32469ea3f34f7d51fd1d6e5d35a58a940e Mon Sep 17 00:00:00 2001 From: Emmanuel Imoh <124444241+Masterpiece34@users.noreply.github.com> Date: Mon, 16 Feb 2026 21:47:08 +0100 Subject: [PATCH 1/2] Add toggleTask function to toggle task completion --- public/script.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/public/script.js b/public/script.js index 9c6912e..a71b738 100644 --- a/public/script.js +++ b/public/script.js @@ -10,3 +10,13 @@ document.addEventListener('DOMContentLoaded', () => { // Load tasks will be called here later (Issue #9) }); +//add task complete toggel +function toggleTask(id) { + tasks = tasks.map(task => { + if (task.id === id) { + return { ...task, completed: !task.completed }; + } + return task; + }); + renderTasks(); +} From fd615ef93b96f955d72df32991ba6c7daeec22b4 Mon Sep 17 00:00:00 2001 From: Emmanuel Imoh <124444241+Masterpiece34@users.noreply.github.com> Date: Mon, 16 Feb 2026 21:51:27 +0100 Subject: [PATCH 2/2] Add styles for completed task items --- public/style.css | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/public/style.css b/public/style.css index 01d4310..3c23224 100644 --- a/public/style.css +++ b/public/style.css @@ -19,4 +19,9 @@ body { display: flex; flex-direction: column; } +.task-item.completed span { + text-decoration: line-through; + color: #888; +} +