-
Notifications
You must be signed in to change notification settings - Fork 1
/
notes_dashboard.html
442 lines (388 loc) · 19.8 KB
/
notes_dashboard.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
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Notes dashboard </title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel = "stylesheet" href = 'notes_styles.css'>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/js/bootstrap.bundle.min.js"></script>
<script src="notes_script.js"></script>
</head>
<body>
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet">
<div class="page-content container note-has-grid">
<ul class="nav nav-pills p-3 bg-white mb-3 rounded-pill align-items-center">
<li class="nav-item">
<a href="javascript:void(0)" class="nav-link rounded-pill note-link d-flex align-items-center px-2 px-md-3 mr-0 mr-md-2 active" id="all-category">
<i class="icon-layers mr-1"></i><span class="d-none d-md-block">All Notes</span>
</a>
</li>
<li class="nav-item">
<a href="javascript:void(0)" class="nav-link rounded-pill note-link d-flex align-items-center px-2 px-md-3 mr-0 mr-md-2" id="note-important"> <i class="icon-tag mr-1"></i><span class="d-none d-md-block">Important</span></a>
</li>
<li class="nav-item ml-auto">
<a href="javascript:void(0)" class="nav-link btn-primary rounded-pill d-flex align-items-center px-3" id="add-notes"> <i class="icon-note m-0"></i><h5><span class="d-none d-md-block font-14"> + </span></h5></a>
</li>
<!--- LOG OUT BUTTON STARTS --->
<li class="nav-item">
<a href="index.html" style="text-decoration:none;" onMouseOver="this.style.color='#E32636'" onMouseOut="this.style.color='red'"> <i class="icon-tag mr-1"></i><span class="d-none d-md-block" style = "margin-bottom: 25px; margin-right: 20px; margin-left: 15px;" id = "logout">Sign Out</span></a>
</li>
<!--- LOG OUT BUTTON ENDS --->
</ul>
<div class="tab-content bg-transparent">
<div id="note-full-container" class="note-has-grid row">
<div class="col-md-4 single-note-item all-category note-important" style="">
<div class="card card-body">
<span class="side-stick"></span>
<h5 class="note-title text-truncate w-75 mb-0" data-noteheading="Go for lunch">MINI PROJECT <i class="point fa fa-circle ml-1 font-10"></i></h5>
<p class="note-date font-12 text-muted">19 November 2021</p>
<div class="note-content">
<p>1. To-Do App </p>
<p>2. Covid Fighter</p>
<p>3. Subnet Calc </p>
</div>
<div class="d-flex align-items-center">
<span class="mr-1"><i class="fa fa-star favourite-note"></i></span>
<span class="mr-1"><i class="fa fa-trash remove-note"></i></span>
<div class="ml-auto">
<div class="category-selector btn-group">
<a class="nav-link dropdown-toggle category-dropdown label-group p-0" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="true">
<div class="category">
<div class="category-important"></div>
<span class="more-options text-dark"><i class="icon-options-vertical"></i></span>
</div>
</a>
<div class="dropdown-menu dropdown-menu-right category-menu">
<a class="note-important badge-group-item badge-important dropdown-item position-relative category-important text-danger" href="javascript:void(0);">
<i class="mdi mdi-checkbox-blank-circle-outline mr-1"></i> Important
</a>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-4 single-note-item all-category note-important" style="">
<div class="card card-body">
<span class="side-stick"></span>
<h5 class="note-title text-truncate w-75 mb-0" data-noteheading="Go for lunch">Movie Night Suggestions<i class="point fa fa-circle ml-1 font-10"></i></h5>
<p class="note-date font-12 text-muted">26 Dec 2021</p>
<div class="note-content">
<p>1. Tumbard</p>
<p>2. Shang Chi</p>
<p>3. Dark</p>
</div>
<div class="d-flex align-items-center">
<span class="mr-1"><i class="fa fa-star favourite-note"></i></span>
<span class="mr-1"><i class="fa fa-trash remove-note"></i></span>
<div class="ml-auto">
<div class="category-selector btn-group">
<a class="nav-link dropdown-toggle category-dropdown label-group p-0" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="true">
<div class="category">
<div class="category-important"></div>
<span class="more-options text-dark"><i class="icon-options-vertical"></i></span>
</div>
</a>
<div class="dropdown-menu dropdown-menu-right category-menu">
<a class="note-important badge-group-item badge-important dropdown-item position-relative category-important text-danger" href="javascript:void(0);">
<i class="mdi mdi-checkbox-blank-circle-outline mr-1"></i> Important
</a>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Modal Add notes -->
<div class="modal fade" id="addnotesmodal" tabindex="-1" role="dialog" aria-labelledby="addnotesmodalTitle" style="display: none;" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content border-0">
<div class="modal-header bg-info text-white">
<h5 class="modal-title text-white">Add Notes</h5>
<button type="button" class="close text-white" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="notes-box">
<div class="notes-content">
<form action="javascript:void(0);" id="addnotesmodalTitle">
<div class="row">
<div class="col-md-12 mb-3">
<div class="note-title">
<label>Note Title</label>
<input type="text" id="note-has-title" class="form-control" minlength="25" placeholder="Title" />
</div>
</div>
<div class="col-md-12">
<div class="note-description">
<label>Note Description</label>
<textarea id="note-has-description" class="form-control" minlength="60" placeholder="Description" rows="3"></textarea>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
<div class="modal-footer">
<button id="btn-n-save" class="float-left btn btn-success" style="display: none;">Save</button>
<button class="btn btn-danger" data-dismiss="modal">Discard</button>
<button id="btn-n-add" class="btn btn-info" disabled="disabled">Add</button>
</div>
</div>
</div>
</div>
</div>
<style type="text/css">
body{
background: #edf1f5;
margin-top:20px;
}
.card {
position: relative;
display: flex;
flex-direction: column;
min-width: 0;
word-wrap: break-word;
background-color: #fff;
background-clip: border-box;
border: 0 solid transparent;
border-radius: 0;
}
.card {
margin-bottom: 30px;
}
.card-body {
flex: 1 1 auto;
padding: 1.57rem;
}
.note-has-grid .nav-link {
padding: .5rem
}
.note-has-grid .single-note-item .card {
border-radius: 10px
}
.note-has-grid .single-note-item .favourite-note {
cursor: pointer
}
.note-has-grid .single-note-item .side-stick {
position: absolute;
width: 3px;
height: 35px;
left: 0;
background-color: rgba(82, 95, 127, .5)
}
.note-has-grid .single-note-item .category-dropdown.dropdown-toggle:after {
display: none
}
.note-has-grid .single-note-item .category [class*=category-] {
height: 15px;
width: 15px;
display: none
}
.note-has-grid .single-note-item .category [class*=category-]::after {
content: "\f0d7";
font: normal normal normal 14px/1 FontAwesome;
font-size: 12px;
color: #fff;
position: absolute
}
.note-has-grid .single-note-item .category .category-business {
background-color: rgba(44, 208, 126, .5);
border: 2px solid #2cd07e
}
.note-has-grid .single-note-item .category .category-social {
background-color: rgba(44, 171, 227, .5);
border: 2px solid #2cabe3
}
.note-has-grid .single-note-item .category .category-important {
background-color: rgba(255, 80, 80, .5);
border: 2px solid #ff5050
}
.note-has-grid .single-note-item.all-category .point {
color: rgba(82, 95, 127, .5)
}
.note-has-grid .single-note-item.note-business .point {
color: rgba(44, 208, 126, .5)
}
.note-has-grid .single-note-item.note-business .side-stick {
background-color: rgba(44, 208, 126, .5)
}
.note-has-grid .single-note-item.note-business .category .category-business {
display: inline-block
}
.note-has-grid .single-note-item.note-favourite .favourite-note {
color: #ffc107
}
.note-has-grid .single-note-item.note-social .point {
color: rgba(44, 171, 227, .5)
}
.note-has-grid .single-note-item.note-social .side-stick {
background-color: rgba(44, 171, 227, .5)
}
.note-has-grid .single-note-item.note-social .category .category-social {
display: inline-block
}
.note-has-grid .single-note-item.note-important .point {
color: rgba(255, 80, 80, .5)
}
.note-has-grid .single-note-item.note-important .side-stick {
background-color: rgba(255, 80, 80, .5)
}
.note-has-grid .single-note-item.note-important .category .category-important {
display: inline-block
}
.note-has-grid .single-note-item.all-category .more-options,
.note-has-grid .single-note-item.all-category.note-favourite .more-options {
display: block
}
.note-has-grid .single-note-item.all-category.note-business .more-options,
.note-has-grid .single-note-item.all-category.note-favourite.note-business .more-options,
.note-has-grid .single-note-item.all-category.note-favourite.note-important .more-options,
.note-has-grid .single-note-item.all-category.note-favourite.note-social .more-options,
.note-has-grid .single-note-item.all-category.note-important .more-options,
.note-has-grid .single-note-item.all-category.note-social .more-options {
display: none
}
@media (max-width:767.98px) {
.note-has-grid .single-note-item {
max-width: 100%
}
}
@media (max-width:991.98px) {
.note-has-grid .single-note-item {
max-width: 216px
}
}
</style>
<script type="text/javascript">
$(function() {
function removeNote() {
$(".remove-note").off('click').on('click', function(event) {
event.stopPropagation();
$(this).parents('.single-note-item').remove();
})
}
function favouriteNote() {
$(".favourite-note").off('click').on('click', function(event) {
event.stopPropagation();
$(this).parents('.single-note-item').toggleClass('note-favourite');
})
}
function addLabelGroups() {
$('.category-selector .badge-group-item').off('click').on('click', function(event) {
event.preventDefault();
/* Act on the event */
var getclass = this.className;
var getSplitclass = getclass.split(' ')[0];
if ($(this).hasClass('badge-business')) {
$(this).parents('.single-note-item').removeClass('note-social');
$(this).parents('.single-note-item').removeClass('note-important');
$(this).parents('.single-note-item').toggleClass(getSplitclass);
} else if ($(this).hasClass('badge-social')) {
$(this).parents('.single-note-item').removeClass('note-business');
$(this).parents('.single-note-item').removeClass('note-important');
$(this).parents('.single-note-item').toggleClass(getSplitclass);
} else if ($(this).hasClass('badge-important')) {
$(this).parents('.single-note-item').removeClass('note-social');
$(this).parents('.single-note-item').removeClass('note-business');
$(this).parents('.single-note-item').toggleClass(getSplitclass);
}
});
}
var $btns = $('.note-link').click(function() {
if (this.id == 'all-category') {
var $el = $('.' + this.id).fadeIn();
$('#note-full-container > div').not($el).hide();
} if (this.id == 'important') {
var $el = $('.' + this.id).fadeIn();
$('#note-full-container > div').not($el).hide();
} else {
var $el = $('.' + this.id).fadeIn();
$('#note-full-container > div').not($el).hide();
}
$btns.removeClass('active');
$(this).addClass('active');
})
$('#add-notes').on('click', function(event) {
$('#addnotesmodal').modal('show');
$('#btn-n-save').hide();
$('#btn-n-add').show();
})
// Button add
$("#btn-n-add").on('click', function(event) {
event.preventDefault();
/* Act on the event */
var today = new Date();
var dd = String(today.getDate()).padStart(2, '0');
var mm = String(today.getMonth()); //January is 0!
var yyyy = today.getFullYear();
var monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ];
today = dd + ' ' + monthNames[mm] + ' ' + yyyy;
var $_noteTitle = document.getElementById('note-has-title').value;
var $_noteDescription = document.getElementById('note-has-description').value;
$html = '<div class="col-md-4 single-note-item all-category"><div class="card card-body">' +
'<span class="side-stick"></span>' +
'<h5 class="note-title text-truncate w-75 mb-0" data-noteHeading="'+$_noteTitle+'">'+$_noteTitle+'<i class="point fa fa-circle ml-1 font-10"></i></h5>' +
'<p class="note-date font-12 text-muted">'+today+'</p>' +
'<div class="note-content">' +
'<p class="note-inner-content text-muted" data-noteContent="'+$_noteDescription+'">'+$_noteDescription+'</p>' +
'</div>' +
'<div class="d-flex align-items-center">' +
'<span class="mr-1"><i class="fa fa-star favourite-note"></i></span>' +
'<span class="mr-1"><i class="fa fa-trash remove-note"></i></span>' +
'<div class="ml-auto">' +
'<div class="category-selector btn-group">' +
'<a class="nav-link dropdown-toggle category-dropdown label-group p-0" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="true">' +
'<div class="category">' +
'<div class="category-business"></div>' +
'<div class="category-social"></div>' +
'<div class="category-important"></div>' +
'<span class="more-options text-dark"><i class="icon-options-vertical"></i></span>'+
'</div>' +
'</a>' +
'<div class="dropdown-menu dropdown-menu-right category-menu">' +
'<a class="note-business badge-group-item badge-business dropdown-item position-relative category-business text-success" href="javascript:void(0);"><i class="mdi mdi-checkbox-blank-circle-outline mr-1"></i>Business</a>' +
'<a class="note-social badge-group-item badge-social dropdown-item position-relative category-social text-info" href="javascript:void(0);"><i class="mdi mdi-checkbox-blank-circle-outline mr-1"></i> Social</a>' +
'<a class="note-important badge-group-item badge-important dropdown-item position-relative category-important text-danger" href="javascript:void(0);"><i class="mdi mdi-checkbox-blank-circle-outline mr-1"></i> Important</a>' +
'</div>' +
'</div>' +
'</div>' +
'</div>' +
'</div></div> ';
$("#note-full-container").prepend($html);
$('#addnotesmodal').modal('hide');
removeNote();
favouriteNote();
addLabelGroups();
});
$('#addnotesmodal').on('hidden.bs.modal', function (event) {
event.preventDefault();
document.getElementById('note-has-title').value = '';
document.getElementById('note-has-description').value = '';
})
removeNote();
favouriteNote();
addLabelGroups();
$('#btn-n-add').attr('disabled', 'disabled');
})
$('#note-has-title').keyup(function() {
var empty = false;
$('#note-has-title').each(function() {
if ($(this).val() == '') {
empty = true;
}
});
if (empty) {
$('#btn-n-add').attr('disabled', 'disabled');
} else {
$('#btn-n-add').removeAttr('disabled');
}
});
</script>
</body>
</html>