Skip to content

Commit b22e557

Browse files
committed
add styling in style.css
1 parent 20ce01c commit b22e557

File tree

3 files changed

+22
-7
lines changed

3 files changed

+22
-7
lines changed

Sprint-3/todo-list/index.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,8 @@ <h1>My ToDo List</h1>
2020

2121
<ul id="todo-list" class="todo-list">
2222
</ul>
23-
<button id="delete-completed-btn">
24-
<!-- update styling -->
25-
Delete completed tasks
26-
</button>
23+
<!-- i added this -->
24+
<button id="delete-completed-btn" class="delete-completed-btn"><span class="fa-solid fa-trash-arrow-up" aria-hidden="true"></span> Delete Completed Tasks</button>
2725
<!--
2826
This is a template for the To-do list item.
2927
It can simplify the creation of list item node in JS script.

Sprint-3/todo-list/style.css

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ h1 {
4141
.todo-input button {
4242
padding: 10px 20px;
4343
font-size: 16px;
44-
background-color: #4CAF50;
44+
background-color: #4caf50;
4545
color: white;
4646
border: none;
4747
border-radius: 6px;
@@ -105,3 +105,20 @@ h1 {
105105
text-decoration: line-through;
106106
color: gray;
107107
}
108+
109+
#delete-completed-btn {
110+
width: 100%;
111+
margin-top: 15px;
112+
padding: 10px;
113+
background-color: gray;
114+
color: white;
115+
border: none;
116+
border-radius: 6px;
117+
font-size: 16px;
118+
cursor: pointer;
119+
transition: background-color 0.3s ease;
120+
}
121+
122+
#delete-completed-btn:hover {
123+
background-color: #e74c3c;
124+
}

Sprint-3/todo-list/todos.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ export function toggleCompletedOnTask(todos, taskIndex) {
3030

3131
// Removes all completed ToDos from the given list
3232
export function deleteCompleted(todos) {
33-
// We iterate backwards to avoid index shifting issues during mutation
33+
// Loop backwards so removing items doesn't shift indexes and skip elements
3434
for (let i = todos.length - 1; i >= 0; i--) {
3535
if (todos[i].completed) {
3636
todos.splice(i, 1);
3737
}
3838
}
39-
}
39+
}

0 commit comments

Comments
 (0)