batteryfix commited on
Commit
9e3cf6c
·
verified ·
1 Parent(s): 8339c61

Task page also know as index page needs to allow me to add tasks and place them in the right category

Browse files
Files changed (2) hide show
  1. index.html +0 -149
  2. style.css +20 -1
index.html CHANGED
@@ -1,149 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>TaskMaster Pro</title>
7
- <link rel="stylesheet" href="style.css">
8
- <script src="https://cdn.tailwindcss.com"></script>
9
- <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
10
- <script src="https://unpkg.com/feather-icons"></script>
11
- <script>
12
- tailwind.config = {
13
- theme: {
14
- extend: {
15
- colors: {
16
- primary: '#6366f1',
17
- secondary: '#8b5cf6',
18
- }
19
- }
20
- }
21
- }
22
- </script>
23
- </head>
24
- <body class="bg-gray-50 min-h-screen flex flex-col">
25
- <custom-navbar></custom-navbar>
26
-
27
- <main class="flex-1 container mx-auto px-4 py-8">
28
- <div class="max-w-6xl mx-auto">
29
- <div class="flex justify-between items-center mb-8">
30
- <h1 class="text-3xl font-bold text-gray-800">Your Tasks</h1>
31
- <button id="addTaskBtn" class="bg-primary hover:bg-primary-600 text-white px-4 py-2 rounded-lg flex items-center gap-2 transition" onclick="taskManager.openModal()">
32
- <i data-feather="plus"></i> Add Task
33
- </button>
34
- </div>
35
- <div class="grid grid-cols-1 md:grid-cols-4 gap-6 mb-8">
36
- <div class="bg-white p-6 rounded-xl shadow-sm border border-gray-100 cursor-pointer hover:bg-gray-50 transition" onclick="showTasksModal('all')">
37
- <h3 class="text-gray-500 text-sm font-medium mb-1">Total Tasks</h3>
38
- <p id="totalTasks" class="text-3xl font-bold text-gray-800">0</p>
39
- </div>
40
- <div class="bg-white p-6 rounded-xl shadow-sm border border-gray-100 cursor-pointer hover:bg-gray-50 transition" onclick="showTasksModal('completed')">
41
- <h3 class="text-gray-500 text-sm font-medium mb-1">Completed</h3>
42
- <p id="completedTasks" class="text-3xl font-bold text-green-500">0</p>
43
- </div>
44
- <div class="bg-white p-6 rounded-xl shadow-sm border border-gray-100 cursor-pointer hover:bg-gray-50 transition" onclick="showTasksModal('pending')">
45
- <h3 class="text-gray-500 text-sm font-medium mb-1">Pending</h3>
46
- <p id="pendingTasks" class="text-3xl font-bold text-yellow-500">0</p>
47
- </div>
48
- <div class="bg-white p-6 rounded-xl shadow-sm border border-gray-100 cursor-pointer hover:bg-gray-50 transition" onclick="showTasksModal('high')">
49
- <h3 class="text-gray-500 text-sm font-medium mb-1">High Priority</h3>
50
- <p id="highPriorityTasks" class="text-3xl font-bold text-red-500">0</p>
51
- </div>
52
- </div>
53
-
54
- <!-- Tasks Stats Modal -->
55
- <div id="tasksStatsModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden" onclick="if(event.target === this) this.classList.add('hidden')">
56
- <div class="bg-white rounded-xl shadow-lg w-full max-w-md mx-4 max-h-[80vh] overflow-y-auto" onclick="event.stopPropagation()">
57
- <div class="flex justify-between items-center sticky top-0 bg-white p-4 border-b border-gray-200 z-10">
58
- <h3 id="statsModalTitle" class="text-xl font-semibold text-gray-800">Tasks</h3>
59
- <button onclick="document.getElementById('tasksStatsModal').classList.add('hidden')"
60
- class="text-gray-500 hover:text-gray-700 p-1 rounded-full hover:bg-gray-100">
61
- <i data-feather="x"></i>
62
- </button>
63
- </div>
64
- <div class="p-4" id="statsModalContent">
65
- <!-- Tasks will be loaded here -->
66
- </div>
67
- </div>
68
- </div>
69
- <div class="bg-white rounded-xl shadow-sm border border-gray-100 overflow-hidden">
70
- <div class="flex justify-between items-center p-4 border-b border-gray-100">
71
- <div class="flex gap-2">
72
- <button id="filterAll" class="filter-btn active px-4 py-2 rounded-lg bg-primary text-white">
73
- All
74
- </button>
75
- <button id="filterPending" class="filter-btn px-4 py-2 rounded-lg bg-gray-100 hover:bg-gray-200 text-gray-700">
76
- Pending
77
- </button>
78
- <button id="filterCompleted" class="filter-btn px-4 py-2 rounded-lg bg-gray-100 hover:bg-gray-200 text-gray-700">
79
- Completed
80
- </button>
81
- </div>
82
- <div class="relative">
83
- <input type="text" id="searchTasks" placeholder="Search tasks..." class="pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary focus:border-primary outline-none">
84
- <i data-feather="search" class="absolute left-3 top-2.5 text-gray-400"></i>
85
- </div>
86
- </div>
87
- <div id="tasksContainer" class="divide-y divide-gray-100">
88
- <!-- Tasks will be loaded here -->
89
- <div class="p-6 text-center text-gray-500">
90
- <i data-feather="inbox" class="w-12 h-12 mx-auto text-gray-300 mb-2"></i>
91
- <p>No tasks found. Add your first task!</p>
92
- </div>
93
- </div>
94
- </div>
95
- </div>
96
- </main>
97
-
98
- <!-- Add/Edit Task Modal -->
99
- <div id="taskModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
100
- <div class="bg-white rounded-xl shadow-lg w-full max-w-md mx-4">
101
- <div class="flex justify-between items-center border-b border-gray-200 p-4">
102
- <h3 class="text-lg font-semibold text-gray-800" id="modalTitle">Add New Task</h3>
103
- <button id="closeModalBtn" class="text-gray-500 hover:text-gray-700">
104
- <i data-feather="x"></i>
105
- </button>
106
- </div>
107
- <form id="taskForm" class="p-4 space-y-4">
108
- <input type="hidden" id="taskId">
109
- <div>
110
- <label for="taskTitle" class="block text-sm font-medium text-gray-700 mb-1">Title</label>
111
- <input type="text" id="taskTitle" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:ring-primary focus:border-primary outline-none" required>
112
- </div>
113
- <div>
114
- <label for="taskDescription" class="block text-sm font-medium text-gray-700 mb-1">Description</label>
115
- <textarea id="taskDescription" rows="3" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:ring-primary focus:border-primary outline-none"></textarea>
116
- </div>
117
- <div class="grid grid-cols-2 gap-4">
118
- <div>
119
- <label for="taskPriority" class="block text-sm font-medium text-gray-700 mb-1">Priority</label>
120
- <select id="taskPriority" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:ring-primary focus:border-primary outline-none">
121
- <option value="high">High</option>
122
- <option value="medium">Medium</option>
123
- <option value="low">Low</option>
124
- </select>
125
- </div>
126
- <div>
127
- <label for="taskDueDate" class="block text-sm font-medium text-gray-700 mb-1">Due Date</label>
128
- <input type="date" id="taskDueDate" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:ring-primary focus:border-primary outline-none">
129
- </div>
130
- </div>
131
- <div class="flex justify-end gap-2 pt-4">
132
- <button type="button" id="cancelModalBtn" class="px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50">Cancel</button>
133
- <button type="submit" class="px-4 py-2 bg-primary hover:bg-primary-600 text-white rounded-md">Save Task</button>
134
- </div>
135
- </form>
136
- </div>
137
- </div>
138
-
139
- <custom-footer></custom-footer>
140
-
141
- <script src="components/navbar.js"></script>
142
- <script src="components/footer.js"></script>
143
- <script src="script.js"></script>
144
- <script>
145
- const taskManager = new TaskManager();
146
- feather.replace();
147
- </script>
148
- </body>
149
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
style.css CHANGED
@@ -45,11 +45,30 @@ body {
45
  background-color: #dbeafe;
46
  color: #1e40af;
47
  }
48
-
49
  .status-completed {
50
  background-color: #d1fae5;
51
  color: #065f46;
52
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  /* Stats cards hover effect */
54
  .grid > div:hover {
55
  transform: translateY(-2px);
 
45
  background-color: #dbeafe;
46
  color: #1e40af;
47
  }
 
48
  .status-completed {
49
  background-color: #d1fae5;
50
  color: #065f46;
51
  }
52
+
53
+ .category-badge {
54
+ margin-bottom: 0.5rem;
55
+ }
56
+
57
+ .task-card.category-work {
58
+ border-left: 4px solid #3b82f6;
59
+ }
60
+
61
+ .task-card.category-personal {
62
+ border-left: 4px solid #8b5cf6;
63
+ }
64
+
65
+ .task-card.category-shopping {
66
+ border-left: 4px solid #10b981;
67
+ }
68
+
69
+ .task-card.category-other {
70
+ border-left: 4px solid #6b7280;
71
+ }
72
  /* Stats cards hover effect */
73
  .grid > div:hover {
74
  transform: translateY(-2px);