mayankgrd commited on
Commit
c7d8cdc
·
verified ·
1 Parent(s): 342cd1f

Add 2 files

Browse files
Files changed (2) hide show
  1. README.md +7 -5
  2. index.html +708 -19
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Deepseek Task Matrix
3
- emoji: 🏃
4
- colorFrom: indigo
5
- colorTo: purple
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: deepseek-task-matrix
3
+ emoji: 🐳
4
+ colorFrom: purple
5
+ colorTo: red
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
index.html CHANGED
@@ -1,19 +1,708 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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>Task Matrix Pro</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9
+ <style>
10
+ .task-card {
11
+ transition: all 0.3s ease;
12
+ }
13
+ .task-card:hover {
14
+ transform: translateY(-2px);
15
+ box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
16
+ }
17
+ .kanban-column {
18
+ min-height: 400px;
19
+ }
20
+ .calendar-day {
21
+ transition: all 0.2s ease;
22
+ }
23
+ .calendar-day:hover {
24
+ background-color: #f3f4f6;
25
+ }
26
+ .calendar-day.has-tasks::after {
27
+ content: '';
28
+ display: block;
29
+ width: 6px;
30
+ height: 6px;
31
+ background-color: #3b82f6;
32
+ border-radius: 50%;
33
+ margin: 2px auto 0;
34
+ }
35
+ .active-tab {
36
+ border-bottom: 3px solid #3b82f6;
37
+ font-weight: 600;
38
+ }
39
+ [draggable="true"] {
40
+ cursor: move;
41
+ }
42
+ .kanban-column.highlight {
43
+ background-color: #f0f9ff;
44
+ }
45
+ </style>
46
+ </head>
47
+ <body class="bg-gray-50 min-h-screen">
48
+ <div class="container mx-auto px-4 py-8">
49
+ <!-- Header -->
50
+ <header class="mb-8">
51
+ <h1 class="text-3xl font-bold text-gray-800">Task Matrix Pro</h1>
52
+ <p class="text-gray-600">Organize your tasks with Eisenhower Matrix</p>
53
+ </header>
54
+
55
+ <!-- Navigation Tabs -->
56
+ <div class="flex border-b border-gray-200 mb-6">
57
+ <button id="matrix-tab" class="px-4 py-2 active-tab">Matrix View</button>
58
+ <button id="kanban-tab" class="px-4 py-2">Kanban Board</button>
59
+ <button id="calendar-tab" class="px-4 py-2">Calendar</button>
60
+ </div>
61
+
62
+ <!-- Matrix View -->
63
+ <div id="matrix-view" class="view-content">
64
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6">
65
+ <!-- Task Input Form -->
66
+ <div class="bg-white p-4 rounded-lg shadow">
67
+ <h2 class="text-xl font-semibold mb-4">Add New Task</h2>
68
+ <form id="task-form" class="space-y-4">
69
+ <div>
70
+ <label for="task-title" class="block text-sm font-medium text-gray-700">Task Title</label>
71
+ <input type="text" id="task-title" class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 p-2 border">
72
+ </div>
73
+ <div>
74
+ <label for="task-description" class="block text-sm font-medium text-gray-700">Description</label>
75
+ <textarea id="task-description" rows="2" class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 p-2 border"></textarea>
76
+ </div>
77
+ <div class="grid grid-cols-2 gap-4">
78
+ <div>
79
+ <label class="block text-sm font-medium text-gray-700">Urgency</label>
80
+ <div class="mt-1 flex space-x-4">
81
+ <label class="inline-flex items-center">
82
+ <input type="radio" name="urgency" value="urgent" class="h-4 w-4 text-blue-600 focus:ring-blue-500">
83
+ <span class="ml-2 text-sm text-gray-700">Urgent</span>
84
+ </label>
85
+ <label class="inline-flex items-center">
86
+ <input type="radio" name="urgency" value="not-urgent" class="h-4 w-4 text-blue-600 focus:ring-blue-500">
87
+ <span class="ml-2 text-sm text-gray-700">Not Urgent</span>
88
+ </label>
89
+ </div>
90
+ </div>
91
+ <div>
92
+ <label class="block text-sm font-medium text-gray-700">Importance</label>
93
+ <div class="mt-1 flex space-x-4">
94
+ <label class="inline-flex items-center">
95
+ <input type="radio" name="importance" value="important" class="h-4 w-4 text-blue-600 focus:ring-blue-500">
96
+ <span class="ml-2 text-sm text-gray-700">Important</span>
97
+ </label>
98
+ <label class="inline-flex items-center">
99
+ <input type="radio" name="importance" value="not-important" class="h-4 w-4 text-blue-600 focus:ring-blue-500">
100
+ <span class="ml-2 text-sm text-gray-700">Not Important</span>
101
+ </label>
102
+ </div>
103
+ </div>
104
+ </div>
105
+ <div>
106
+ <label for="task-due" class="block text-sm font-medium text-gray-700">Due Date</label>
107
+ <input type="date" id="task-due" class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 p-2 border">
108
+ </div>
109
+ <button type="submit" class="w-full bg-blue-600 text-white py-2 px-4 rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2">
110
+ Add Task
111
+ </button>
112
+ </form>
113
+ </div>
114
+
115
+ <!-- Eisenhower Matrix Explanation -->
116
+ <div class="bg-white p-4 rounded-lg shadow">
117
+ <h2 class="text-xl font-semibold mb-4">Eisenhower Matrix Guide</h2>
118
+ <div class="grid grid-cols-2 gap-2">
119
+ <div class="bg-red-100 p-3 rounded">
120
+ <h3 class="font-medium text-red-800">Urgent & Important</h3>
121
+ <p class="text-sm text-red-700">Do these tasks immediately</p>
122
+ </div>
123
+ <div class="bg-yellow-100 p-3 rounded">
124
+ <h3 class="font-medium text-yellow-800">Important, Not Urgent</h3>
125
+ <p class="text-sm text-yellow-700">Schedule these tasks</p>
126
+ </div>
127
+ <div class="bg-blue-100 p-3 rounded">
128
+ <h3 class="font-medium text-blue-800">Urgent, Not Important</h3>
129
+ <p class="text-sm text-blue-700">Delegate if possible</p>
130
+ </div>
131
+ <div class="bg-green-100 p-3 rounded">
132
+ <h3 class="font-medium text-green-800">Not Urgent, Not Important</h3>
133
+ <p class="text-sm text-green-700">Consider eliminating</p>
134
+ </div>
135
+ </div>
136
+ <div class="mt-4 text-sm text-gray-600">
137
+ <p>The Eisenhower Matrix helps you prioritize tasks based on urgency and importance. This method was popularized by US President Dwight D. Eisenhower.</p>
138
+ </div>
139
+ </div>
140
+ </div>
141
+
142
+ <!-- Task Matrix -->
143
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
144
+ <!-- Quadrant 1: Urgent & Important -->
145
+ <div class="bg-red-50 p-4 rounded-lg shadow">
146
+ <h2 class="text-lg font-semibold text-red-800 mb-4 flex items-center">
147
+ <i class="fas fa-exclamation-triangle mr-2"></i> Urgent & Important
148
+ </h2>
149
+ <div id="quadrant-1" class="space-y-3">
150
+ <!-- Tasks will be added here dynamically -->
151
+ </div>
152
+ </div>
153
+
154
+ <!-- Quadrant 2: Important, Not Urgent -->
155
+ <div class="bg-yellow-50 p-4 rounded-lg shadow">
156
+ <h2 class="text-lg font-semibold text-yellow-800 mb-4 flex items-center">
157
+ <i class="fas fa-calendar-check mr-2"></i> Important, Not Urgent
158
+ </h2>
159
+ <div id="quadrant-2" class="space-y-3">
160
+ <!-- Tasks will be added here dynamically -->
161
+ </div>
162
+ </div>
163
+
164
+ <!-- Quadrant 3: Urgent, Not Important -->
165
+ <div class="bg-blue-50 p-4 rounded-lg shadow">
166
+ <h2 class="text-lg font-semibold text-blue-800 mb-4 flex items-center">
167
+ <i class="fas fa-share-square mr-2"></i> Urgent, Not Important
168
+ </h2>
169
+ <div id="quadrant-3" class="space-y-3">
170
+ <!-- Tasks will be added here dynamically -->
171
+ </div>
172
+ </div>
173
+
174
+ <!-- Quadrant 4: Not Urgent, Not Important -->
175
+ <div class="bg-green-50 p-4 rounded-lg shadow">
176
+ <h2 class="text-lg font-semibold text-green-800 mb-4 flex items-center">
177
+ <i class="fas fa-trash-alt mr-2"></i> Not Urgent, Not Important
178
+ </h2>
179
+ <div id="quadrant-4" class="space-y-3">
180
+ <!-- Tasks will be added here dynamically -->
181
+ </div>
182
+ </div>
183
+ </div>
184
+ </div>
185
+
186
+ <!-- Kanban Board View (hidden by default) -->
187
+ <div id="kanban-view" class="view-content hidden">
188
+ <div class="grid grid-cols-1 md:grid-cols-3 gap-6">
189
+ <!-- Backlog Column -->
190
+ <div class="bg-gray-100 p-4 rounded-lg shadow kanban-column"
191
+ id="backlog-column"
192
+ ondrop="handleDrop(event, 'backlog')"
193
+ ondragover="handleDragOver(event)"
194
+ ondragenter="handleDragEnter(event)"
195
+ ondragleave="handleDragLeave(event)">
196
+ <h2 class="text-lg font-semibold text-gray-800 mb-4 flex items-center justify-between">
197
+ <span><i class="fas fa-clipboard-list mr-2"></i> Backlog</span>
198
+ <span id="backlog-count" class="bg-gray-200 text-gray-700 text-xs font-medium px-2.5 py-0.5 rounded-full">0</span>
199
+ </h2>
200
+ <div id="backlog-tasks" class="space-y-3">
201
+ <!-- Tasks will be added here dynamically -->
202
+ </div>
203
+ </div>
204
+
205
+ <!-- In Progress Column -->
206
+ <div class="bg-blue-100 p-4 rounded-lg shadow kanban-column"
207
+ id="progress-column"
208
+ ondrop="handleDrop(event, 'progress')"
209
+ ondragover="handleDragOver(event)"
210
+ ondragenter="handleDragEnter(event)"
211
+ ondragleave="handleDragLeave(event)">
212
+ <h2 class="text-lg font-semibold text-blue-800 mb-4 flex items-center justify-between">
213
+ <span><i class="fas fa-spinner mr-2"></i> In Progress</span>
214
+ <span id="progress-count" class="bg-blue-200 text-blue-800 text-xs font-medium px-2.5 py-0.5 rounded-full">0</span>
215
+ </h2>
216
+ <div id="progress-tasks" class="space-y-3">
217
+ <!-- Tasks will be added here dynamically -->
218
+ </div>
219
+ </div>
220
+
221
+ <!-- Done Column -->
222
+ <div class="bg-green-100 p-4 rounded-lg shadow kanban-column"
223
+ id="done-column"
224
+ ondrop="handleDrop(event, 'done')"
225
+ ondragover="handleDragOver(event)"
226
+ ondragenter="handleDragEnter(event)"
227
+ ondragleave="handleDragLeave(event)">
228
+ <h2 class="text-lg font-semibold text-green-800 mb-4 flex items-center justify-between">
229
+ <span><i class="fas fa-check-circle mr-2"></i> Done</span>
230
+ <span id="done-count" class="bg-green-200 text-green-800 text-xs font-medium px-2.5 py-0.5 rounded-full">0</span>
231
+ </h2>
232
+ <div id="done-tasks" class="space-y-3">
233
+ <!-- Tasks will be added here dynamically -->
234
+ </div>
235
+ </div>
236
+ </div>
237
+ </div>
238
+
239
+ <!-- Calendar View (hidden by default) -->
240
+ <div id="calendar-view" class="view-content hidden">
241
+ <div class="bg-white p-4 rounded-lg shadow mb-6">
242
+ <div class="flex items-center justify-between mb-4">
243
+ <button id="prev-month" class="p-2 rounded-full hover:bg-gray-100">
244
+ <i class="fas fa-chevron-left"></i>
245
+ </button>
246
+ <h2 id="current-month" class="text-xl font-semibold">July 2023</h2>
247
+ <button id="next-month" class="p-2 rounded-full hover:bg-gray-100">
248
+ <i class="fas fa-chevron-right"></i>
249
+ </button>
250
+ </div>
251
+ <div class="grid grid-cols-7 gap-1">
252
+ <div class="text-center font-medium text-gray-500 py-2">Sun</div>
253
+ <div class="text-center font-medium text-gray-500 py-2">Mon</div>
254
+ <div class="text-center font-medium text-gray-500 py-2">Tue</div>
255
+ <div class="text-center font-medium text-gray-500 py-2">Wed</div>
256
+ <div class="text-center font-medium text-gray-500 py-2">Thu</div>
257
+ <div class="text-center font-medium text-gray-500 py-2">Fri</div>
258
+ <div class="text-center font-medium text-gray-500 py-2">Sat</div>
259
+ </div>
260
+ <div id="calendar-days" class="grid grid-cols-7 gap-1">
261
+ <!-- Calendar days will be generated here -->
262
+ </div>
263
+ </div>
264
+
265
+ <div id="day-tasks" class="bg-white p-4 rounded-lg shadow">
266
+ <h2 id="selected-day" class="text-xl font-semibold mb-4">Select a date to view tasks</h2>
267
+ <div id="day-tasks-list" class="space-y-3">
268
+ <!-- Tasks for selected day will appear here -->
269
+ </div>
270
+ </div>
271
+ </div>
272
+ </div>
273
+
274
+ <script>
275
+ // Task data structure
276
+ let tasks = [];
277
+ let currentDate = new Date();
278
+ let selectedDay = null;
279
+ let draggedTaskId = null;
280
+
281
+ // DOM Elements
282
+ const taskForm = document.getElementById('task-form');
283
+ const matrixView = document.getElementById('matrix-view');
284
+ const kanbanView = document.getElementById('kanban-view');
285
+ const calendarView = document.getElementById('calendar-view');
286
+ const views = [matrixView, kanbanView, calendarView];
287
+
288
+ // Tab buttons
289
+ const matrixTab = document.getElementById('matrix-tab');
290
+ const kanbanTab = document.getElementById('kanban-tab');
291
+ const calendarTab = document.getElementById('calendar-tab');
292
+ const tabs = [matrixTab, kanbanTab, calendarTab];
293
+
294
+ // Calendar elements
295
+ const prevMonthBtn = document.getElementById('prev-month');
296
+ const nextMonthBtn = document.getElementById('next-month');
297
+ const currentMonthEl = document.getElementById('current-month');
298
+ const calendarDaysEl = document.getElementById('calendar-days');
299
+ const selectedDayEl = document.getElementById('selected-day');
300
+ const dayTasksListEl = document.getElementById('day-tasks-list');
301
+
302
+ // Initialize the app
303
+ document.addEventListener('DOMContentLoaded', function() {
304
+ // Load tasks from localStorage if available
305
+ const savedTasks = localStorage.getItem('tasks');
306
+ if (savedTasks) {
307
+ tasks = JSON.parse(savedTasks);
308
+ } else {
309
+ // Initialize with some sample tasks if none exist
310
+ tasks = [
311
+ {
312
+ id: '1',
313
+ title: 'Complete project proposal',
314
+ description: 'Finish writing the project proposal document',
315
+ dueDate: formatDateForInput(new Date()),
316
+ urgency: 'urgent',
317
+ importance: 'important',
318
+ status: 'progress',
319
+ createdAt: new Date().toISOString()
320
+ },
321
+ {
322
+ id: '2',
323
+ title: 'Schedule team meeting',
324
+ description: 'Plan next week\'s team meeting',
325
+ dueDate: formatDateForInput(new Date(Date.now() + 86400000 * 2)),
326
+ urgency: 'not-urgent',
327
+ importance: 'important',
328
+ status: 'backlog',
329
+ createdAt: new Date().toISOString()
330
+ }
331
+ ];
332
+ saveTasks();
333
+ }
334
+
335
+ // Set up event listeners
336
+ setupEventListeners();
337
+
338
+ // Render initial views
339
+ renderMatrixView();
340
+ renderKanbanView();
341
+ renderCalendar();
342
+
343
+ // Set matrix view as default
344
+ switchView(0);
345
+ });
346
+
347
+ // Set up event listeners
348
+ function setupEventListeners() {
349
+ // Task form submission
350
+ taskForm.addEventListener('submit', function(e) {
351
+ e.preventDefault();
352
+ addNewTask();
353
+ });
354
+
355
+ // Tab switching
356
+ tabs.forEach((tab, index) => {
357
+ tab.addEventListener('click', () => switchView(index));
358
+ });
359
+
360
+ // Calendar navigation
361
+ prevMonthBtn.addEventListener('click', () => {
362
+ currentDate.setMonth(currentDate.getMonth() - 1);
363
+ renderCalendar();
364
+ });
365
+
366
+ nextMonthBtn.addEventListener('click', () => {
367
+ currentDate.setMonth(currentDate.getMonth() + 1);
368
+ renderCalendar();
369
+ });
370
+ }
371
+
372
+ // Switch between views
373
+ function switchView(index) {
374
+ views.forEach(view => view.classList.add('hidden'));
375
+ views[index].classList.remove('hidden');
376
+
377
+ tabs.forEach(tab => tab.classList.remove('active-tab'));
378
+ tabs[index].classList.add('active-tab');
379
+
380
+ // Update specific views when switched to
381
+ if (index === 1) renderKanbanView();
382
+ if (index === 2) renderCalendar();
383
+ }
384
+
385
+ // Add a new task
386
+ function addNewTask() {
387
+ const title = document.getElementById('task-title').value.trim();
388
+ const description = document.getElementById('task-description').value.trim();
389
+ const dueDate = document.getElementById('task-due').value;
390
+ const urgency = document.querySelector('input[name="urgency"]:checked')?.value;
391
+ const importance = document.querySelector('input[name="importance"]:checked')?.value;
392
+
393
+ if (!title || !urgency || !importance) {
394
+ alert('Please fill in all required fields');
395
+ return;
396
+ }
397
+
398
+ const newTask = {
399
+ id: Date.now().toString(),
400
+ title,
401
+ description,
402
+ dueDate,
403
+ urgency,
404
+ importance,
405
+ status: 'backlog', // Default status for Kanban
406
+ createdAt: new Date().toISOString()
407
+ };
408
+
409
+ tasks.push(newTask);
410
+ saveTasks();
411
+ renderMatrixView();
412
+ renderKanbanView();
413
+ renderCalendar();
414
+
415
+ // Reset form
416
+ taskForm.reset();
417
+ }
418
+
419
+ // Save tasks to localStorage
420
+ function saveTasks() {
421
+ localStorage.setItem('tasks', JSON.stringify(tasks));
422
+ }
423
+
424
+ // Render the matrix view
425
+ function renderMatrixView() {
426
+ const quadrants = {
427
+ 'quadrant-1': { urgency: 'urgent', importance: 'important' },
428
+ 'quadrant-2': { urgency: 'not-urgent', importance: 'important' },
429
+ 'quadrant-3': { urgency: 'urgent', importance: 'not-important' },
430
+ 'quadrant-4': { urgency: 'not-urgent', importance: 'not-important' }
431
+ };
432
+
433
+ // Clear all quadrants
434
+ for (const quadrantId in quadrants) {
435
+ document.getElementById(quadrantId).innerHTML = '';
436
+ }
437
+
438
+ // Add tasks to their respective quadrants
439
+ tasks.forEach(task => {
440
+ const { urgency, importance } = task;
441
+ let quadrantId = '';
442
+
443
+ if (urgency === 'urgent' && importance === 'important') {
444
+ quadrantId = 'quadrant-1';
445
+ } else if (urgency === 'not-urgent' && importance === 'important') {
446
+ quadrantId = 'quadrant-2';
447
+ } else if (urgency === 'urgent' && importance === 'not-important') {
448
+ quadrantId = 'quadrant-3';
449
+ } else {
450
+ quadrantId = 'quadrant-4';
451
+ }
452
+
453
+ const taskElement = createTaskElement(task, true);
454
+ document.getElementById(quadrantId).appendChild(taskElement);
455
+ });
456
+ }
457
+
458
+ // Render the kanban view
459
+ function renderKanbanView() {
460
+ const statuses = ['backlog', 'progress', 'done'];
461
+ const statusIds = ['backlog-tasks', 'progress-tasks', 'done-tasks'];
462
+ const countIds = ['backlog-count', 'progress-count', 'done-count'];
463
+
464
+ // Clear all columns
465
+ statusIds.forEach(id => {
466
+ document.getElementById(id).innerHTML = '';
467
+ });
468
+
469
+ // Update counts
470
+ statuses.forEach((status, index) => {
471
+ const count = tasks.filter(task => task.status === status).length;
472
+ document.getElementById(countIds[index]).textContent = count;
473
+ });
474
+
475
+ // Add tasks to their respective columns
476
+ tasks.forEach(task => {
477
+ let columnId = '';
478
+ switch(task.status) {
479
+ case 'backlog': columnId = 'backlog-tasks'; break;
480
+ case 'progress': columnId = 'progress-tasks'; break;
481
+ case 'done': columnId = 'done-tasks'; break;
482
+ }
483
+
484
+ const taskElement = createTaskElement(task, false);
485
+ taskElement.setAttribute('draggable', 'true');
486
+ taskElement.addEventListener('dragstart', (e) => {
487
+ draggedTaskId = task.id;
488
+ e.dataTransfer.setData('text/plain', task.id);
489
+ e.currentTarget.classList.add('opacity-50');
490
+ });
491
+ taskElement.addEventListener('dragend', (e) => {
492
+ e.currentTarget.classList.remove('opacity-50');
493
+ });
494
+
495
+ document.getElementById(columnId).appendChild(taskElement);
496
+ });
497
+ }
498
+
499
+ // Drag and drop handlers
500
+ function handleDragStart(e) {
501
+ draggedTaskId = e.target.dataset.id;
502
+ e.dataTransfer.setData('text/plain', draggedTaskId);
503
+ e.target.classList.add('opacity-50');
504
+ }
505
+
506
+ function handleDragEnd(e) {
507
+ e.target.classList.remove('opacity-50');
508
+ }
509
+
510
+ function handleDragOver(e) {
511
+ e.preventDefault();
512
+ }
513
+
514
+ function handleDragEnter(e) {
515
+ if (e.target.classList.contains('kanban-column')) {
516
+ e.target.classList.add('highlight');
517
+ }
518
+ }
519
+
520
+ function handleDragLeave(e) {
521
+ if (e.target.classList.contains('kanban-column')) {
522
+ e.target.classList.remove('highlight');
523
+ }
524
+ }
525
+
526
+ function handleDrop(e, newStatus) {
527
+ e.preventDefault();
528
+ e.target.classList.remove('highlight');
529
+
530
+ const taskId = e.dataTransfer.getData('text/plain');
531
+ const taskIndex = tasks.findIndex(task => task.id === taskId);
532
+
533
+ if (taskIndex !== -1) {
534
+ tasks[taskIndex].status = newStatus;
535
+ saveTasks();
536
+ renderKanbanView();
537
+ }
538
+ }
539
+
540
+ // Render the calendar
541
+ function renderCalendar() {
542
+ // Update month display
543
+ const options = { month: 'long', year: 'numeric' };
544
+ currentMonthEl.textContent = currentDate.toLocaleDateString('en-US', options);
545
+
546
+ // Get first day of month and total days
547
+ const firstDay = new Date(currentDate.getFullYear(), currentDate.getMonth(), 1).getDay();
548
+ const daysInMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 0).getDate();
549
+
550
+ // Clear calendar
551
+ calendarDaysEl.innerHTML = '';
552
+
553
+ // Add empty cells for days before the first day of the month
554
+ for (let i = 0; i < firstDay; i++) {
555
+ const emptyCell = document.createElement('div');
556
+ emptyCell.className = 'h-12';
557
+ calendarDaysEl.appendChild(emptyCell);
558
+ }
559
+
560
+ // Add cells for each day of the month
561
+ for (let day = 1; day <= daysInMonth; day++) {
562
+ const dayCell = document.createElement('div');
563
+ dayCell.className = 'h-12 border border-gray-200 flex items-center justify-center calendar-day';
564
+ dayCell.textContent = day;
565
+
566
+ // Check if this day has tasks
567
+ const dateStr = `${currentDate.getFullYear()}-${(currentDate.getMonth() + 1).toString().padStart(2, '0')}-${day.toString().padStart(2, '0')}`;
568
+ const dayTasks = tasks.filter(task => task.dueDate === dateStr);
569
+
570
+ if (dayTasks.length > 0) {
571
+ dayCell.classList.add('has-tasks');
572
+ }
573
+
574
+ // Add click event to show tasks for this day
575
+ dayCell.addEventListener('click', () => {
576
+ selectedDay = dateStr;
577
+ showDayTasks(dateStr);
578
+ });
579
+
580
+ calendarDaysEl.appendChild(dayCell);
581
+ }
582
+ }
583
+
584
+ // Show tasks for a specific day
585
+ function showDayTasks(dateStr) {
586
+ const date = new Date(dateStr);
587
+ const options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
588
+ selectedDayEl.textContent = date.toLocaleDateString('en-US', options);
589
+
590
+ // Filter tasks for this day
591
+ const dayTasks = tasks.filter(task => task.dueDate === dateStr);
592
+
593
+ // Clear previous tasks
594
+ dayTasksListEl.innerHTML = '';
595
+
596
+ if (dayTasks.length === 0) {
597
+ dayTasksListEl.innerHTML = '<p class="text-gray-500">No tasks for this day</p>';
598
+ return;
599
+ }
600
+
601
+ // Add tasks to the list
602
+ dayTasks.forEach(task => {
603
+ const taskElement = createTaskElement(task, true);
604
+ dayTasksListEl.appendChild(taskElement);
605
+ });
606
+ }
607
+
608
+ // Create a task element
609
+ function createTaskElement(task, showDelete) {
610
+ const taskElement = document.createElement('div');
611
+ taskElement.className = 'bg-white p-3 rounded shadow task-card';
612
+ taskElement.id = `task-${task.id}`;
613
+ taskElement.dataset.id = task.id;
614
+
615
+ // Determine priority color
616
+ let priorityClass = '';
617
+ if (task.urgency === 'urgent' && task.importance === 'important') {
618
+ priorityClass = 'bg-red-100 text-red-800';
619
+ } else if (task.urgency === 'not-urgent' && task.importance === 'important') {
620
+ priorityClass = 'bg-yellow-100 text-yellow-800';
621
+ } else if (task.urgency === 'urgent' && task.importance === 'not-important') {
622
+ priorityClass = 'bg-blue-100 text-blue-800';
623
+ } else {
624
+ priorityClass = 'bg-green-100 text-green-800';
625
+ }
626
+
627
+ // Task content
628
+ taskElement.innerHTML = `
629
+ <div class="flex justify-between items-start mb-1">
630
+ <h3 class="font-medium">${task.title}</h3>
631
+ <span class="text-xs px-2 py-1 rounded-full ${priorityClass}">
632
+ ${task.urgency === 'urgent' ? 'Urgent' : 'Not Urgent'},
633
+ ${task.importance === 'important' ? 'Important' : 'Not Important'}
634
+ </span>
635
+ </div>
636
+ ${task.description ? `<p class="text-sm text-gray-600 mb-2">${task.description}</p>` : ''}
637
+ ${task.dueDate ? `<p class="text-xs text-gray-500"><i class="far fa-calendar-alt mr-1"></i> Due: ${formatDate(task.dueDate)}</p>` : ''}
638
+ <div class="mt-2 flex justify-between items-center">
639
+ <span class="text-xs text-gray-400">Created: ${formatDate(task.createdAt, true)}</span>
640
+ ${showDelete ? `<button class="delete-task text-red-500 hover:text-red-700 text-sm" data-id="${task.id}">
641
+ <i class="fas fa-trash-alt"></i> Delete
642
+ </button>` : ''}
643
+ </div>
644
+ `;
645
+
646
+ // Add delete event listener if needed
647
+ if (showDelete) {
648
+ const deleteBtn = taskElement.querySelector('.delete-task');
649
+ deleteBtn.addEventListener('click', (e) => {
650
+ e.stopPropagation();
651
+ deleteTask(task.id);
652
+ });
653
+ }
654
+
655
+ return taskElement;
656
+ }
657
+
658
+ // Delete a task
659
+ function deleteTask(taskId) {
660
+ if (confirm('Are you sure you want to delete this task?')) {
661
+ tasks = tasks.filter(task => task.id !== taskId);
662
+ saveTasks();
663
+ renderMatrixView();
664
+ renderKanbanView();
665
+ renderCalendar();
666
+
667
+ // If viewing day tasks, update that view too
668
+ if (selectedDay) {
669
+ showDayTasks(selectedDay);
670
+ }
671
+ }
672
+ }
673
+
674
+ // Helper function to format dates
675
+ function formatDate(dateStr, includeTime = false) {
676
+ const date = new Date(dateStr);
677
+ if (includeTime) {
678
+ return date.toLocaleString('en-US', {
679
+ month: 'short',
680
+ day: 'numeric',
681
+ year: 'numeric',
682
+ hour: '2-digit',
683
+ minute: '2-digit'
684
+ });
685
+ } else {
686
+ return date.toLocaleDateString('en-US', {
687
+ month: 'short',
688
+ day: 'numeric',
689
+ year: 'numeric'
690
+ });
691
+ }
692
+ }
693
+
694
+ // Helper function to format date for input field
695
+ function formatDateForInput(date) {
696
+ const d = new Date(date);
697
+ let month = '' + (d.getMonth() + 1);
698
+ let day = '' + d.getDate();
699
+ const year = d.getFullYear();
700
+
701
+ if (month.length < 2) month = '0' + month;
702
+ if (day.length < 2) day = '0' + day;
703
+
704
+ return [year, month, day].join('-');
705
+ }
706
+ </script>
707
+ <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=mayankgrd/deepseek-task-matrix" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
708
+ </html>