File tree Expand file tree Collapse file tree 6 files changed +41
-1
lines changed Expand file tree Collapse file tree 6 files changed +41
-1
lines changed Original file line number Diff line number Diff line change 5
5
< meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
6
6
< title > To-Do List with Delete Button</ title >
7
7
< link rel ="stylesheet " href ="style.css ">
8
+ < link rel ="icon " type ="image/x-icon " href ="sources\website.png ">
8
9
<!-- Link to Font Awesome for icons -->
9
10
< link rel ="stylesheet " href ="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css ">
10
11
< link rel ="preconnect " href ="https://fonts.googleapis.com ">
16
17
<!-- <div class="logo">
17
18
<img src="sources\a.jpeg" alt="My Logo" style="width: 50px; height:50px;border-radius: 50%;">
18
19
</div> -->
20
+ < button id ="resetButton " onclick ="reset() "> Help in Bug</ button >
21
+
19
22
< h2 > Remind list</ h2 >
20
23
< div class ="box1 ">
21
24
< input type ="text " id ="taskInput " class ="inp " placeholder ="Enter a Quick Task to Add.. ">
22
25
< button class ="add "id ="add " onclick ="addTask(),effect() "> Add Task</ button >
23
26
</ div >
24
27
< ul id ="taskList "> </ ul >
25
-
28
+
26
29
< script src ="script.js "> </ script >
27
30
</ body >
28
31
</ html >
Original file line number Diff line number Diff line change @@ -110,4 +110,26 @@ function displayTasks() {
110
110
} ) ;
111
111
}
112
112
113
+
114
+ function reset ( ) {
115
+ if ( confirm ( "Are you sure you want to reset all tasks?" ) ) {
116
+ console . log ( "Enter the reset phase" ) ;
117
+
118
+ let tasks = [ ] ;
119
+ localStorage . setItem ( 'tasks' , JSON . stringify ( tasks ) ) ;
120
+
121
+ const taskList = document . getElementById ( 'taskList' ) ;
122
+ taskList . innerHTML = '' ;
123
+ } else {
124
+ console . log ( "Reset cancelled" ) ;
125
+ }
126
+ }
127
+
128
+
129
+ function showResetButton ( ) {
130
+ const resetButton = document . getElementById ( 'resetButton' ) ;
131
+ resetButton . classList . add ( 'visible' ) ;
132
+ }
133
+
134
+ showResetButton ( ) ;
113
135
window . onload = displayTasks ;
Original file line number Diff line number Diff line change @@ -121,6 +121,21 @@ li {
121
121
padding : 10px ;
122
122
}
123
123
124
+ # resetButton {
125
+ position : fixed;
126
+ color : # 8E0E00 ;
127
+ top : 10px ;
128
+ right : 10px ;
129
+ opacity : 0 ;
130
+ transition : opacity 0.3s ;
131
+ }
132
+
133
+ # resetButton .visible {
134
+ opacity : 1 ;
135
+ }
136
+
137
+
138
+
124
139
@media (max-width : 600px ) {
125
140
h2 {
126
141
font-size : 2rem ;
You can’t perform that action at this time.
0 commit comments