forked from avinash201199/To-Do-List
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
281 lines (242 loc) · 11.2 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<!-- <link
rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"
/> -->
<title>To-Do List</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=no" />
<!-- favicon -->
<link rel="shortcut icon" type="image/jpg" href="assets/images/favicon.png" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css"
integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Baloo+Bhai+2&family=Montserrat:wght@500&display=swap"
rel="stylesheet">
<!-- jquery CDN -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script>
<!-- FontAwesome CDN-->
<link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.10.0/css/all.css"
integrity="sha384-AYmEC3Yw5cVb3ZcuHtOA93w35dYTsvhLPVnYs9eStHfGJvOvKxVfELGroGkvsg+p" crossorigin="anonymous" />
<link href='https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css' rel='stylesheet'
integrity='sha384-F3w7mX95PdgyTmZZMECAngseQB83DfGTowi0iMjiWaeVhAn4FJkqJByhZMI3AhiU' crossorigin='anonymous'>
<link rel="stylesheet" href="assets/css/style.css" />
</head>
<body>
<!-- Confirmation dialog -->
<div id="custom-confirm" class="custom-confirm">
<div class="confirm-content">
<div class="optbox_header">
<i id="confirm-cancel" class="fas fa-times close-button"></i>
</div>
<h2>Confirmation</h2>
<h4 id="confirm-msg">Are you sure you want to delete this task?</h4>
<div class="option_box">
<button class="btn btn-success mt-5 col-3"id="confirm-yes">Yes</button>
<button class="btn btn-danger mt-5 col-3" id="confirm-no">No</button>
</div>
</div>
</div>
<header>
<div class="navbar">
<a href="index.html"><img src="assets\images\logo.png" alt="logo" width="120px"></a>
<a href="#">
<div class="header"><b>
<h1>To-Do List</h1>
</b></div>
</a>
<a href="#">
<div class="col-auto">
<input type="checkbox" id="light" class="checkbox" onclick="switchToDarkMode()">
<label for="checkbox" class="label">
<i class="fas fa-sun"></i>
<i class='fas fa-moon'></i>
<div class='ball'>
</label>
</div>
</a>
</div>
</header>
<div class="modal red" id="Modal">
<div class="content" id="content">
<span id="modal-text font-bold"> Some Text </span>
<button onclick="closemodal()" class="modal-btn">
<i class="fas fa-times"></i>
</button>
</div>
</div>
<!-- Clock Modification -->
<div class="Clock">
<div id="time"></div>
<div class="week">
<div id="day"></div>
<div id="date"></div>
</div>
</div>
<section class="pt-3 pb-4">
<div class="container">
<div class="row">
<div class="col-lg-9 mx-auto py-3">
<div class="row">
<div class="col-md-4 position-relative">
<div class="p-3 text-center">
<h1 class="text-gradient text-white"><span id="state1">0</span></h1>
<h5 class="mt-3 text-white font-bold ">Total Tasks</h5>
<p class="text-sm font-weight-normal text-white ">Number of tasks you have created</p>
</div>
<hr class="vertical dark">
</div>
<div class="col-md-4 position-relative">
<div class="p-3 text-center">
<h1 class="text-gradient text-white"> <span id="state2">0</span></h1>
<h5 class="mt-3 text-white font-bold">Remaining To Do</h5>
<p class="text-sm font-weight-normal text-white">Tasks remaining to complete.</p>
</div>
<hr class="vertical dark">
</div>
<div class="col-md-4">
<div class="p-3 text-center">
<h1 class="text-gradient text-white" id="state3">0</h1>
<h5 class="mt-3 text-white">Completed Tasks</h5>
<p class="text-sm font-weight-normal text-white font-bold">Total Number of tasks completed</p>
</div>
<hr class="vertical dark">
</div>
</div>
</div>
</div>
</div>
</section>
<div class="buttons-wrapper mt-0">
<div class="button-div">
<button type="button" id="myBtn" class="myBtn">Add a new task</button>
</div>
<div class="select">
<select name="todos" class="filter-todo" style="color: black">
<option value="all" style="color: black">All</option>
<option value="completed" style="color: black">Completed</option>
<option value="incomplete" style="color: black">Incomplete</option>
</select>
</div>
<!-- Add the search input field below -->
<div class="search-container">
<input type="text" id="searchInput" placeholder="Search..." oninput="searchTasks()">
</div>
</div>
<!-- The Modal -->
<div id="myModal" class="modal-new">
<!-- Modal content -->
<div class="modal-content">
<span class="close">×</span>
<form class="todoform">
<div class="input-group mb-3">
<input type="text" placeholder="Add a new Task .." class="todo-input form-control" id="textInput"
required />
<select id="categorySelect" class="form-select" >
<option value="work">Work</option>
<option value="personal">Personal</option>
<option value="shopping">Shopping</option>
<option value="shopping">Household</option>
</select>
<div class="abc">
<button id="todo-button" class="todo-button" type="submit">
<i class="fas fa-plus-square"></i>
</button>
</div>
</div>
</form>
</div>
</div>
<div style="color: whitesmoke; font-size: xx-small" class="no-to-do-item">
<h1>THE LIST IS EMPTY !</h1>
</div>
<div class="todo-container">
<ul class="todo-list"></ul>
</div>
<button class="delete-all" onclick="show_alert()">Delete All Tasks</button>
<!-- <div cla ss="confirmation_box"></div> -->
<div class="confirmation_box hide " id="confirmation_box">
<div class="confirmation_box_inner">
<div class="optbox_header">
<i class="fas fa-times" onclick="goback()"></i>
</div>
<p id="text-modal">Are you sure you want to delete all tasks?</p>
<div class="option_box">
<button class="proceed btn btn-success mt-5 col-3" id="txt-color" onclick="deleteAll();">Yes</button>
<button class="donot_proceed btn btn-danger mt-5 col-3" id="txt-color1" onclick="goback()">No</button>
</div>
</div>
</div>
<!-- footer -->
<footer>
<div class = "footer">
<div class="social-media">
<!-- instagram -->
<a class="link" href="https://www.instagram.com/lets__code/" target="_blank" rel="noopener noreferrer"><img
class="social-icon" src="assets/images/instagram.svg" alt="instagram" /></a>
<!-- linkedin -->
<a class="link" href="https://www.linkedin.com/in/avinash-singh-071b79175/" target="_blank"
rel="noopener noreferrer"><img class="social-icon" src="assets/images/linkedin.svg"
alt="linkedin" /></a>
<!-- gmail -->
<a class="link" href="mailto: [email protected]" target="_blank" rel="noopener noreferrer"><img
class="social-icon" src="assets/images/gmail.svg" alt="gmail" /></a>
<!-- github -->
<a class="link" href="https://github.com/avinash201199" target="_blank" rel="noopener noreferrer"><img
class="social-icon" src="assets/images/github.svg" alt="Github" /></a>
</div>
<div class="2ndrow-foter">
<p class="footer-desc footerelements">This project is a part of <a class="footer-desc footerelements"
href="https://hacktoberfest.digitalocean.com/" target="_blank"
rel="noopener noreferrer">Hacktoberfest
2023</a>
</p>
</div>
<div class="3rd-row-footer footer-creator-label footerclasses">
<h3 class="footerelements">Made with <i class="fas fa-heart fa-heart-custom"></i> by Avinash Singh</h3>
</div>
</div>
</footer>
<script src="assets/js/app.js"></script>
<button onclick="scrollWindow()" id="scrollTop" title="Go to top">⇑</button>
<script>
let scrollBtn = document.getElementById("scrollTop");
// When the user scrolls down 20px from the top of the document, show the button
window.onscroll = function () { scrollFunction() };
function scrollFunction() {
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
scrollBtn.style.display = "block";
} else {
scrollBtn.style.display = "none";
}
}
const scrollWindow = function () {
if (window.scrollY != 0) {
setTimeout(function () {
window.scrollTo(0, window.scrollY - 50);
window.scroll({ top: 0, behavior: "smooth" })
scrollWindow();
}, 10);
}
}
</script>
<script>
// Function to search tasks
function searchTasks() {
const searchInput = document.getElementById("searchInput").value.toLowerCase();
const tasks = document.querySelectorAll(".todo");
tasks.forEach(function(task) {
const taskText = task.querySelector("li").innerText.toLowerCase();
if (taskText.includes(searchInput)) {
task.style.display = "flex"; // Display matching tasks
} else {
task.style.display = "none"; // Hide non-matching tasks
}
});
}
</script>
</body>
</html>