-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.html
More file actions
670 lines (577 loc) · 18.6 KB
/
main.html
File metadata and controls
670 lines (577 loc) · 18.6 KB
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
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Doc Management Panel</title>
<!-- Google Material Icons -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<style>
/* General Styles */
/* General Styles */
body {
font-family: 'Poppins', sans-serif;
margin: 0;
padding: 0;
color: #ffffff;
text-align: center;
}
h1 {
margin: 20px 0;
font-size: 2.5rem;
color: #ffffff;
text-shadow: 0 3px 8px rgba(0, 0, 0, 0.5);
}
.container {
width: 100%;
max-width: 1800px;
margin: 0 auto;
position: relative;
}
.search-filter {
display: flex;
justify-content: space-between;
align-items: center;
margin: 20px;
margin-bottom: 20px;
gap:50px;
flex-wrap: wrap; /* Ensures responsiveness */
}
.search-filter input,
.search-filter select {
padding: 12px 15px;
font-size: 1rem;
border: 1px solid #ddd;
border-radius: 8px;
background: linear-gradient(145deg, #ffffff, #f0f0f0); /* Subtle gradient for modern feel */
color: #333;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
transition: all 0.3s ease;
outline: none;
}
.search-filter input::placeholder,
.search-filter select {
color: #999; /* Subtle placeholder text color */
}
.search-filter input:hover,
.search-filter select:hover {
border-color: #007bff; /* Highlight border on hover */
box-shadow: 0 6px 15px rgba(0, 123, 255, 0.3);
transform: translateY(-2px); /* Lift effect on hover */
}
.search-filter input:focus,
.search-filter select:focus {
border-color: #007bff;
background-color: #f9f9ff; /* Slight color change on focus */
box-shadow: 0 6px 18px rgba(0, 123, 255, 0.5);
transform: translateY(-3px);
}
.search-filter button {
padding: 12px 20px;
background: linear-gradient(145deg, #007bff, #0056b3); /* Modern gradient button */
border: none;
border-radius: 8px;
color: #fff;
font-size: 1rem;
font-weight: 600;
cursor: pointer;
box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
transition: all 0.3s ease;
}
.search-filter button:hover {
background: linear-gradient(145deg, #0056b3, #003d80);
box-shadow: 0 6px 12px rgba(0, 123, 255, 0.5);
transform: translateY(-2px);
}
.search-filter button:active {
transform: scale(0.98);
box-shadow: 0 3px 6px rgba(0, 123, 255, 0.4);
}
.search-filter {
flex-wrap: wrap; /* Ensure adaptability on smaller screens */
gap: 15px; /* Add space between elements for clarity */
}
/* Add responsiveness */
@media (max-width: 768px) {
.search-filter {
flex-direction: column;
gap: 10px;
}
.search-filter input,
.search-filter select,
.search-filter button {
width: 100%; /* Full width on smaller screens */
}
}
/* Task Table */
table {
width: 100%;
border-collapse: collapse;
background: linear-gradient(120deg, #2b5876, #4e4376);
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
overflow: hidden;
color: #ffffff;
}
th, td {
padding: 15px;
text-align: left;
border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
th {
background-color: rgba(0, 0, 0, 0.8);
text-transform: uppercase;
}
td {
font-size: 1rem;
}
tr:hover td {
background: rgba(255, 255, 255, 0.1);
transition: background 0.3s;
}
/* Status Colors */
td.status-completed {
color: #4caf50;
font-weight: bold;
}
td.status-pending {
color: #ffc107;
font-weight: bold;
}
td.status-rejected {
color: #f44336;
font-weight: bold;
}
/* Add Task Button */
#addTaskButton {
position: fixed;
bottom: 20px;
right: 20px;
background: linear-gradient(135deg, #ff7e5f, #feb47b);
color: #fff;
border: none;
border-radius: 50%;
width: 70px;
height: 70px;
cursor: pointer;
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
transition: transform 0.3s, box-shadow 0.3s;
}
#addTaskButton:hover {
transform: scale(1.1);
box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}
#addTaskButton .material-icons {
font-size: 40px;
}
/* Popup */
.popup {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.7);
display: none;
justify-content: center;
align-items: center;
}
.popup-content {
background: linear-gradient(135deg, #1f4037, #99f2c8);
padding: 30px;
border-radius: 15px;
width: 450px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
text-align: left;
color: #ffffff;
}
.popup-content form label {
display: block;
margin-bottom: 5px;
font-weight: bold;
}
.popup-content form input,
.popup-content form textarea,
.popup-content form select {
width: 90%;
margin-bottom: 15px;
padding: 10px;
border: 1px solid #ccc;
border-radius: 10px;
background: #ffffff;
color: #333;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
.popup-content form input:focus,
.popup-content form textarea:focus,
.popup-content form select:focus {
outline: none;
border-color: #00c6ff;
}
.popup-content form button {
padding: 10px 20px;
border: none;
border-radius: 10px;
cursor: pointer;
font-weight: bold;
color: #ffffff;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}
.popup-content form button:first-of-type {
background: linear-gradient(135deg, #36d1dc, #5b86e5);
margin-right: 10px;
transition: transform 0.3s;
}
.popup-content form button:first-of-type:hover {
transform: scale(1.1);
}
.popup-content form button:last-of-type {
background: #f44336;
}
/* Toast Notifications */
.toast {
position: fixed;
top: 20px;
right: 20px;
background-color: #4caf50;
color: #fff;
padding: 15px 20px;
border-radius: 5px;
display: none;
font-size: 1rem;
}
.dpopup {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.6); /* Slightly darker for emphasis */
display: none;
justify-content: center;
align-items: center;
backdrop-filter: blur(5px); /* Adds a blur effect for a modern look */
z-index: 9999;
}
.dpopup-content {
background: linear-gradient(145deg, #ffffff, #f0f0f0);
padding: 25px;
border-radius: 12px;
width: 450px;
box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
text-align: left;
color: #000;
animation: fadeIn 0.3s ease-in-out;
}
.reject-btn, .update-btn, .delete-btn, .view-btn, .closedpbtn, .status-btn {
padding: 12px 25px;
border: none;
border-radius: 8px;
font-size: 14px;
font-weight: 600;
cursor: pointer;
transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.reject-btn {
background-color: #ff4d4d;
color: #fff;
box-shadow: 0 4px 8px rgba(255, 77, 77, 0.4);
}
.reject-btn:hover {
transform: scale(1.05);
box-shadow: 0 6px 12px rgba(255, 77, 77, 0.6);
}
.update-btn {
background-color: #4caf50;
color: #fff;
box-shadow: 0 4px 8px rgba(76, 175, 80, 0.4);
}
.update-btn:hover {
transform: scale(1.05);
box-shadow: 0 6px 12px rgba(76, 175, 80, 0.6);
}
.delete-btn {
background-color: #333;
color: #fff;
box-shadow: 0 4px 8px rgba(51, 51, 51, 0.4);
}
.delete-btn:hover {
transform: scale(1.05);
box-shadow: 0 6px 12px rgba(51, 51, 51, 0.6);
}
.view-btn {
background-color: #000;
color: #fff;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}
.view-btn:hover {
transform: scale(1.05);
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.6);
}
.closedpbtn {
background-color: #000;
color: #fff;
position: absolute;
top: 15px;
right: 15px;
font-size: 12px;
font-weight: bold;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}
.closedpbtn:hover {
transform: scale(1.1);
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.6);
}
.status-btn {
background-color: #001df5;
color: #fff;
box-shadow: 0 4px 8px rgba(0, 29, 245, 0.4);
}
.status-btn:hover {
transform: scale(1.05);
box-shadow: 0 6px 12px rgba(0, 29, 245, 0.6);
}
@keyframes fadeIn {
from {
opacity: 0;
transform: scale(0.9);
}
to {
opacity: 1;
transform: scale(1);
}
}
</style>
</head>
<body>
<!-- Main Container -->
<div class="container">
<h1>Document Management Panel</h1>
<!-- Search and Filter Section -->
<div class="search-filter">
<input type="text" id="searchInput" placeholder="Search tasks..." oninput="searchTasks()">
<select id="filterStatus" onchange="filterTasks()">
<option value="">All</option>
<option value="Completed">Completed</option>
<option value="Pending">Pending</option>
<option value="Rejected">Rejected</option>
</select>
</div>
<!-- Task Table -->
<table id="taskTable">
<thead>
<tr>
<th>DocID</th>
<th>Task Title</th>
<th>Task Description</th>
<th>Task For</th>
<th>Created On</th>
<th>Updated On</th>
<th>Task Status</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<!-- Dynamic rows will be added here -->
</tbody>
</table>
<!-- Add Task Button -->
<button id="addTaskButton" onclick="openTaskPopup()">
<span class="material-icons">add</span>
</button>
</div>
<!-- Popup for Adding a Task -->
<div id="taskPopup" class="popup">
<div class="popup-content">
<h2>Add New Task</h2>
<form id="taskForm" onsubmit="addTask(event)">
<label for="taskTitle">Task Title</label>
<input type="text" id="taskTitle" required>
<label for="taskDescription">Task Description</label>
<textarea id="taskDescription" required></textarea>
<label for="taskFor">Task For</label>
<select id="taskFor" required>
<option value="Team A">Team A</option>
<option value="Team B">Team B</option>
<option value="Individual">Individual</option>
</select>
<label for="taskStatus">Task Status</label>
<select id="taskStatus" required>
<option value="Pending">Pending</option>
<option value="Completed">Completed</option>
<option value="Rejected">Rejected</option>
</select>
<button type="submit">Add Task</button>
<button type="button" onclick="closeTaskPopup()">Cancel</button>
</form>
</div>
</div>
<!-- Details Popup -->
<div id="detailsPopup" class="dpopup">
<div class="dpopup-content">
<button class="closedpbtn" onclick="closeDetailsPopup()">Close</button>
<h2>Task Details</h2>
<p><strong>Task Title:</strong> <span id="detailsTaskTitle"></span></p>
<p><strong>Task Done By:</strong> <span id="detailsTaskFor"></span></p>
<p><strong>Task Description:</strong> <span id="detailsTaskDescription"></span></p>
<button class="reject-btn" onclick="rejectTask()">Reject</button>
<button class="update-btn" onclick="updateTaskStatus(selectedRow)">Status</button>
<button class="delete-btn" onclick="deleteTaskFromDetails()">Delete</button>
<button class="status-btn" >Update Task</button>
</div>
</div>
<div id="statusPopup" class="dpopup">
<div class="dpopup-content">
<button class="closedpbtn" onclick="closeStatusPopup()">Close</button>
<h2>Task Progress</h2>
<!-- Loading Bar -->
<div style="border: 1px solid #ccc; border-radius: 5px; width: 90%; margin: 20px auto; background-color: #f0f0f0; height: 25px;">
<div id="loadingBar" style="width: 0%; height: 100%; background-color: #4caf50; text-align: center; color: #fff; line-height: 25px;">
0%
</div>
</div>
<!-- Push Button -->
<button class="status-btn" id="pushBtn" onclick="showTextArea()">Push</button>
<!-- Text Area and Submit Button (Initially Hidden) -->
<div id="pushSection" style="display: none; margin-top: 20px;">
<textarea id="pushText" placeholder="Enter your input..." style="width: 90%; height: 100px; padding: 10px; border: 1px solid #ccc; border-radius: 5px;"></textarea>
<button class="update-btn" id="submitBtn" onclick="submitProgress()">Submit</button>
</div>
</div>
</div>
<!-- Toast Notifications -->
<div id="toast" class="toast"></div>
<script>
let selectedRow = null;
function openTaskPopup() {
document.getElementById("taskPopup").style.display = "flex";
}
function closeTaskPopup() {
document.getElementById("taskPopup").style.display = "none";
}
function openDetailsPopup(row) {
selectedRow = row;
const taskTitle = row.cells[1].textContent;
const taskDescription = row.cells[2].textContent;
const taskFor = row.cells[3].textContent;
document.getElementById("detailsTaskTitle").textContent = taskTitle;
document.getElementById("detailsTaskDescription").textContent = taskDescription;
document.getElementById("detailsTaskFor").textContent = taskFor;
document.getElementById("detailsPopup").style.display = "flex";
}
function closeDetailsPopup() {
document.getElementById("detailsPopup").style.display = "none";
}
function addTask(event) {
event.preventDefault();
const title = document.getElementById("taskTitle").value;
const description = document.getElementById("taskDescription").value;
const taskFor = document.getElementById("taskFor").value;
const status = document.getElementById("taskStatus").value;
const table = document.getElementById("taskTable").querySelector("tbody");
const row = table.insertRow();
row.innerHTML = `
<td>${Date.now()}</td>
<td>${title}</td>
<td>${description}</td>
<td>${taskFor}</td>
<td>${new Date().toLocaleString()}</td>
<td>${new Date().toLocaleString()}</td>
<td class="status-${status.toLowerCase()}">${status}</td>
<td><button class="view-btn" onclick="openDetailsPopup(this.parentElement.parentElement)">Details</button></td>
`;
showToast("Task added successfully!");
closeTaskPopup();
document.getElementById("taskForm").reset();
}
function updateTaskStatus(row) {
const statusCell = row.cells[6];
if (statusCell.textContent === "Pending") {
statusCell.textContent = "Completed";
statusCell.className = "status-completed";
showToast("Task status updated to Completed!");
}
}
function rejectTask() {
if (selectedRow) {
const statusCell = selectedRow.cells[6];
statusCell.textContent = "Rejected";
statusCell.className = "status-rejected";
showToast("Task status updated to Rejected!");
closeDetailsPopup();
}
}
function deleteTaskFromDetails() {
if (selectedRow) {
selectedRow.remove();
showToast("Task deleted successfully!");
closeDetailsPopup();
}
}
function searchTasks() {
const input = document.getElementById("searchInput").value.toLowerCase();
const rows = document.querySelectorAll("#taskTable tbody tr");
rows.forEach(row => {
const title = row.cells[1].textContent.toLowerCase();
const description = row.cells[2].textContent.toLowerCase();
row.style.display = (title.includes(input) || description.includes(input)) ? "" : "none";
});
}
function filterTasks() {
const status = document.getElementById("filterStatus").value.toLowerCase();
const rows = document.querySelectorAll("#taskTable tbody tr");
rows.forEach(row => {
const taskStatus = row.cells[6].textContent.toLowerCase();
row.style.display = (status === "" || taskStatus === status) ? "" : "none";
});
}
function showToast(message) {
const toast = document.getElementById("toast");
toast.textContent = message;
toast.style.display = "block";
setTimeout(() => {
toast.style.display = "none";
}, 3000);
}
// To open the status popup
function openStatusPopup() {
document.getElementById("statusPopup").style.display = "flex";
}
// To close the status popup
function closeStatusPopup() {
document.getElementById("statusPopup").style.display = "none";
}
// Show the text area and submit button when "Push" is clicked
function showTextArea() {
document.getElementById("pushSection").style.display = "block";
}
// Handle the loading bar progress
function submitProgress() {
const loadingBar = document.getElementById("loadingBar");
const pushText = document.getElementById("pushText").value.trim();
let currentProgress = parseInt(loadingBar.style.width);
// Validation: Check if the text area is filled
if (pushText === "") {
alert("Please fill in the text area before submitting.");
return;
}
if (currentProgress < 100) {
currentProgress += 25; // Increment by 25%
loadingBar.style.width = currentProgress + "%";
loadingBar.textContent = currentProgress + "%";
// Clear text area after submit
document.getElementById("pushText").value = "";
}
if (currentProgress === 100) {
alert("Task completed!");
}
}
</script>
<!-- Add a click handler for the Status button -->
<script>
document.querySelectorAll('.status-btn').forEach(button => {
button.addEventListener('click', openStatusPopup);
});
</script>
</script>
</body>
</html>