Skip to content

Commit ac3aab5

Browse files
committed
Script updated for Bug
1 parent 014c0ab commit ac3aab5

File tree

6 files changed

+41
-1
lines changed

6 files changed

+41
-1
lines changed

image.png

20 KB
Loading

index.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66
<title>To-Do List with Delete Button</title>
77
<link rel="stylesheet" href="style.css">
8+
<link rel="icon" type="image/x-icon" href="sources\website.png">
89
<!-- Link to Font Awesome for icons -->
910
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
1011
<link rel="preconnect" href="https://fonts.googleapis.com">
@@ -16,13 +17,15 @@
1617
<!-- <div class="logo">
1718
<img src="sources\a.jpeg" alt="My Logo" style="width: 50px; height:50px;border-radius: 50%;">
1819
</div> -->
20+
<button id="resetButton" onclick="reset()">Help in Bug</button>
21+
1922
<h2>Remind list</h2>
2023
<div class="box1">
2124
<input type="text" id="taskInput" class="inp" placeholder="Enter a Quick Task to Add..">
2225
<button class="add"id="add" onclick="addTask(),effect()">Add Task</button>
2326
</div>
2427
<ul id="taskList"></ul>
25-
28+
2629
<script src="script.js"></script>
2730
</body>
2831
</html>

script.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,26 @@ function displayTasks() {
110110
});
111111
}
112112

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();
113135
window.onload = displayTasks;

sources/monitor.png

19.1 KB
Loading

sources/website.png

15.5 KB
Loading

style.css

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,21 @@ li {
121121
padding: 10px;
122122
}
123123

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+
124139
@media (max-width: 600px) {
125140
h2 {
126141
font-size: 2rem;

0 commit comments

Comments
 (0)