-
Notifications
You must be signed in to change notification settings - Fork 1
/
todos.html
224 lines (208 loc) · 11.8 KB
/
todos.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dashboard</title>
<!-- Fontawesome Kit ==> CHANGE it before pushing to github -->
<!-- PLACE YOUR FONTAWESOME KIT CODE INSIDE THE SRC HERE -->
<script src="....." crossorigin="anonymous"></script>
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<!-- Custom CSS -->
<link rel="stylesheet" href="./styles/todos-styles.css">
<link rel="stylesheet" href="./styles/global-styles.css">
<!-- Google fonts -->
<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=Open+Sans&display=swap" rel="stylesheet">
</head>
<body>
<!-- pre loader -->
<div class="loading d-flex flex-column justify-content-center align-items-center" id="todosloader">
<h3 class="display-4">Loading the page...</h3>
<div class="spinner">
<div class="rect1 me-3"></div>
<div class="rect2 me-3"></div>
<div class="rect3 me-3"></div>
<div class="rect4 me-3"></div>
<div class="rect5 me-3"></div>
</div>
</div>
<!-- Navbar -->
<nav class="navbar navbar-expand-lg mb-2 w-100">
<!-- brand-logo -->
<a class="navbar-brand p-0" href="#">
<img src="../assets/logo-1.png" alt="Simple todo logo" class="img-fluid">
</a>
<!-- burger-nav icon from Font Awesome -->
<button class="navbar-toggler" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarContent" aria-controls="navbarContent"
aria-expanded="false" aria-label="Toggle navigation">
<i class="fa-solid fa-bars-staggered" class="navbar-toggler-icon"></i>
</button>
<!-- navbar links -->
<div class="collapse navbar-collapse" id="navbarContent">
<ul class="navbar-nav w-100 justify-content-end">
<li class="nav-item d-flex align-items-center me-4">
<span class="navbar-text">
Hi there, <span class="text-danger fs-4" id="displayName"></span>
</span>
</li>
<li class="nav-item">
<a class="nav-link btn-warning" id="logoutBtn" role="button">
<i class="fa-solid fa-right-from-bracket me-1 fa-lg"></i> Logout
</a>
</li>
</ul>
</div>
</nav>
<!-- toasts to show right after data is added/updated/deleted -->
<div class="fixed-top toast hide ms-auto d-flex align-items-center" id="toast">
<span id="toastIcon" class="fs-1"></span>
<h4 id="toastMsg" class="fw-bold ms-3"></h4>
</div>
<!-- options section -->
<div class="container">
<section id="options">
<!-- Button trigger for add todo modal -->
<button type="button" class="btn btn-success d-flex align-items-center p-3" data-bs-toggle="modal" data-bs-target="#addTodoModal">
<span><i class="fa-solid fa-circle-plus fs-1 me-2"></i></span>
<span class="fs-3">Add todo</span>
</button>
<!-- search filter -->
<div class="form-floating">
<input type="text" class="form-control" id="searchInput" name="searchInput" placeholder="Filter todos">
<label for="searchInput">Filter todos</label>
<small>Based on title, description</small>
</div>
<!-- add todo modal -->
<div class="modal fade" id="addTodoModal" tabindex="-1" aria-labelledby="addTodoModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg modal-dialog-centered">
<div class="modal-content p-4">
<div class="d-flex flex-row-reverse">
<button type="button" class="btn-close fs-2 border border-3" style="border-color: black !important;" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<h3 class="fs-3">Add a new todo item</h3>
<div class="hrDivider mb-4"></div>
<form id="addTodoForm" method="post" autocomplete="off">
<div class="form-floating mb-3">
<input type="text" class="form-control" id="addTodoTitle" name="title" placeholder="Todo title" required>
<label for="addTodoTitle">Title</label>
</div>
<div class="form-floating mb-3">
<textarea class="form-control" placeholder="Todo description" id="addTodoDescription" name="description"
oninput="this.style.height = ''; this.style.height = this.scrollHeight +'px';" required
></textarea>
<label for="addTodoDescription">Description</label>
</div>
<div class="form-check form-switch mb-3">
<input class="form-check-input" type="checkbox" id="addTodoHasDueDate" name="hasDueDate">
<label class="form-check-label" for="addTodoHasDueDate">Include Due Date?</label>
</div>
<div class="mb-3 d-none">
<label for="addTodoDueDate">Set Due Date & Time</label>
<input type="datetime-local" id="addTodoDueDate" name="dueDate">
</div>
<input type="submit" class="btn btn-success fs-4 p-3 me-4" name="addTodoBtn" value="Add todo">
<input type="reset" class="btn btn-warning fs-4 p-3" value="Reset">
</form>
</div>
</div>
</div>
<!-- sort-by option dropdown -->
<div class="dropdown d-flex align-items-center" id="sortByOptionsDropdown">
<button class="btn btn-info dropdown-toggle" type="button" id="sortByDropdown" data-bs-toggle="dropdown" aria-expanded="false">
<span><i class="fa-solid fa-sort fs-3 me-2"></i></span>
<span class="fs-3">Sort by</span>
</button>
<ul class="dropdown-menu" id="sortByDropdownMenu" aria-labelledby="sortByDropdown">
<li>
<button class="dropdown-item" type="button" name="title-desc">
<span>Title</span>
<span><i class="fa-solid fa-arrow-down-z-a fs-3"></i></span>
</button>
</li>
<li>
<button class="dropdown-item" type="button" name="title-asc">
<span>Title</span>
<span><i class="fa-solid fa-arrow-up-z-a fs-3"></i></span>
</button>
</li>
<li>
<button class="dropdown-item" type="button" name="date-asc">
<span>Due Date</span>
<span><i class="fa-solid fa-arrow-down-1-9 fs-3"></i></span>
</button>
</li>
<li>
<button class="dropdown-item" type="button" name="date-desc">
<span>Due Date</span>
<span><i class="fa-solid fa-arrow-up-1-9 fs-3"></i></span>
</button>
</li>
<li>
<button class="dropdown-item" type="button" name="clear">
<span>Clear filter</span>
<span><i class="fa-solid fa-ban fs-3"></i></span>
</button>
</li>
</ul>
</div>
</section>
</div>
<!-- todos section -->
<div class="container mt-3" id="todosContainer">
<article>
<div id="todos">
</div>
<!-- edit todos modal -->
<!-- add todo modal -->
<div class="modal fade" id="editTodoModal" tabindex="-1" aria-labelledby="editTodoModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg modal-dialog-centered">
<div class="modal-content p-4">
<div class="d-flex flex-row-reverse">
<button type="button" class="btn-close fs-2 border border-3" style="border-color: black !important;" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<h3 class="fs-3">Edit todo item</h3>
<div class="hrDivider mb-3"></div>
<form id="editTodoForm" method="post" autocomplete="off">
<div class="form-floating mb-3">
<input type="text" class="form-control" id="editTodoTitle" name="title" placeholder="Todo title" required>
<label for="editTodoTitle">Title</label>
</div>
<div class="form-floating mb-3">
<!-- oninput="this.style.height = ''; this.style.height = this.scrollHeight +'px';" -->
<textarea class="form-control" placeholder="Todo description" id="editTodoDescription" name="description"
oninput="this.style.height = ''; this.style.height = this.scrollHeight +'px'"
required
></textarea>
<label for="editTodoDescription">Description</label>
</div>
<div class="form-check form-switch mb-3">
<input class="form-check-input" type="checkbox" id="editTodoHasDueDate" name="hasDueDate">
<label class="form-check-label" for="editTodoHasDueDate">Include Due Date?</label>
</div>
<div class="mb-3 d-none">
<label for="editTodoDueDate">Set Due Date & Time</label>
<input type="datetime-local" id="editTodoDueDate" name="dueDate">
</div>
<div class="form-floating mb-3">
<input type="text" class="form-control" id="editCreatedAt" name="createdAt" disabled placeholder="Created at">
<label for="editCreatedAt">Created at</label>
</div>
<input type="submit" class="btn btn-success fs-5 p-3 me-4 mb-3" value="Update">
<button type="button" class="btn btn-danger fs-5 p-3 mb-3" data-bs-dismiss="modal">Cancel</button>
</form>
</div>
</div>
</div>
</article>
</div>
<!-- Bootstrap bundle -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
<!-- Custom scripts -->
<script type="module" src="./src/todos-script.js"></script>
</body>
</html>