-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
185 lines (163 loc) · 6.26 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<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=Catamaran:wght@100;200;300;400;500;600&display=swap"
rel="stylesheet"
/>
<link rel="stylesheet" href="styles.css" />
<link rel="icon" type="image/x-icon" href="img/tasks-icon.ico" />
<script
src="https://kit.fontawesome.com/bcdb4329ce.js"
crossorigin="anonymous"
></script>
<title>Task Tracker</title>
</head>
<body>
<!-- Dark and Light mode toggle -->
<div class="toggle-icon" onclick="toggleDarkMode()">
<i class="fa fa-toggle-on fa-lg"></i>
</div>
<!-- GitHub icon -->
<a
href="https://github.com/lebogangolifant/task_tracker"
target="_blank"
class="github-icon"
>
<i class="fab fa-github fa-m"></i>
</a>
<!-- Main web app container-->
<div class="container">
<div class="logo-container">
<img src="img/tasks-logo.png" alt="Task Tracker" class="logo" />
<h1 id="logo">Task <span class="logo-theme">tracker.</span></h1>
</div>
<!-- div for digital clock -->
<div id="digitalClock"></div>
<!-- User Login Form -->
<form
id="loginForm"
class="login-container"
style="display: none"
onsubmit="event.preventDefault(); loginUser()"
>
<h1>Login</h1>
<label for="loginUsername">Username:</label>
<input type="text" id="loginUsername" required />
<label for="loginPassword">Password:</label>
<input type="password" id="loginPassword" required />
<button type="submit">Login</button>
<a id="forgot-password-button" href="#" onclick="showForgotPasswordForm()"
>Forgot Password</a
>
</form>
<!-- User Registration Form -->
<form
id="registrationForm"
class="register-container"
style="display: none"
onsubmit="event.preventDefault(); registerUser()"
>
<h2>Register</h2>
<label for="registerUsername">Username:</label>
<input type="text" id="registerUsername" required />
<label for="registerEmail">Email:</label>
<input type="email" id="registerEmail" required />
<label for="registerPassword">Password:</label>
<input type="password" id="registerPassword" required />
<label for="confirmPassword">Confirm Password:</label>
<input type="password" id="confirmPassword" required />
<button type="submit">Register</button>
</form>
<!-- Forgot Password Form -->
<form
id="forgotPasswordForm"
class="forgot-password-container"
style="display: none"
onsubmit="event.preventDefault(); forgotPassword()"
>
<h2>Forgot Password</h2>
<label for="forgotUsername">Username:</label>
<input type="text" id="forgotUsername" required />
<label for="forgotEmail">Email:</label>
<input type="email" id="forgotEmail" required />
<button type="submit">Reset Password</button>
</form>
<div class="welcome-message">
Join us! Log in or register below to start managing your tasks.
</div>
<!-- Navigation links for login and register -->
<div class="navigation-links">
<a href="#" onclick="showLoginForm()" class="nav-button">Login</a>
<a href="#" onclick="showRegistrationForm()" class="nav-button"
>Register</a
>
</div>
<!-- Main app content -->
<div id="task-app">
<!-- Logout button -->
<a id="logout-button" href="#" onclick="logoutUser()" class="nav-button">Logout</a>
<!-- Task form -->
<form id="taskForm">
<label for="title">Title:</label>
<input type="text" id="title" required />
<label for="description">Description:</label>
<textarea id="description" required></textarea>
<label for="dueDate">Due Date:</label>
<input type="date" id="dueDate" required />
<button type="button" onclick="addTask()">
<i class="fas fa-plus-square"></i> Add Task
</button>
</form>
<button id="addTaskButton" type="button" onclick="showTaskForm()">
<i class="fas fa-plus-square"></i> Add Task
</button>
<!-- New elements for filters and sorting -->
<div id="filtersAndSort">
<label for="statusFilter">Filter by Status:</label>
<select id="statusFilter" onchange="renderTasks()">
<option value="all">All</option>
<option value="pending">Pending</option>
<option value="completed">Completed</option>
</select>
<label for="completedFilter">Show Completed:</label>
<input
type="checkbox"
id="completedFilter"
onchange="renderTasks()"
/>
<label for="sortBy">Sort by:</label>
<select id="sortBy" onchange="renderTasks()">
<option value="dueDate">Due Date</option>
<option value="status">Status</option>
</select>
</div>
<div id="taskList">
<!-- Tasks will be displayed here -->
</div>
<!-- New elements for task update form -->
<div id="updateFormContainer">
<h2>Update Task</h2>
<form id="updateForm">
<input type="hidden" id="updateTaskId" />
<label for="updateTitle">Title:</label>
<input type="text" id="updateTitle" required />
<label for="updateDescription">Description:</label>
<textarea id="updateDescription" required></textarea>
<label for="updateDueDate">Due Date:</label>
<input type="date" id="updateDueDate" required />
<button type="button" onclick="updateTask()">Update Task</button>
<button type="button" onclick="cancelUpdate()">Cancel</button>
</form>
</div>
</div>
</div>
<!-- Overlay for background shadow -->
<div id="overlay"></div>
<script src="script.js"></script>
</body>
</html>