File tree Expand file tree Collapse file tree 3 files changed +22
-7
lines changed
Expand file tree Collapse file tree 3 files changed +22
-7
lines changed Original file line number Diff line number Diff 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.
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change @@ -30,10 +30,10 @@ export function toggleCompletedOnTask(todos, taskIndex) {
3030
3131// Removes all completed ToDos from the given list
3232export 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+ }
You can’t perform that action at this time.
0 commit comments