Ragnarucem commited on
Commit
e728afb
·
verified ·
1 Parent(s): fa16c6a

Crea una web con streamlit de python que permita crear tareas, leerlas, actualizarlas y borrarlas - Initial Deployment

Browse files
Files changed (2) hide show
  1. README.md +7 -5
  2. index.html +563 -19
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Taskflow Rag
3
- emoji: 💻
4
- colorFrom: red
5
- colorTo: yellow
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: taskflow-rag
3
+ emoji: 🐳
4
+ colorFrom: purple
5
+ colorTo: gray
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,563 @@
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>TaskFlow - Task Management App</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
+ <script>
10
+ tailwind.config = {
11
+ theme: {
12
+ extend: {
13
+ colors: {
14
+ primary: '#3B82F6',
15
+ secondary: '#10B981',
16
+ dark: '#1F2937',
17
+ }
18
+ }
19
+ }
20
+ }
21
+ </script>
22
+ <style>
23
+ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
24
+
25
+ body {
26
+ font-family: 'Inter', sans-serif;
27
+ background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
28
+ min-height: 100vh;
29
+ }
30
+
31
+ .task-card {
32
+ transition: all 0.3s ease;
33
+ transform-origin: top;
34
+ animation: fadeIn 0.5s ease-out;
35
+ }
36
+
37
+ .task-card:hover {
38
+ transform: translateY(-3px);
39
+ box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
40
+ }
41
+
42
+ .priority-high { border-left: 4px solid #EF4444; }
43
+ .priority-medium { border-left: 4px solid #F59E0B; }
44
+ .priority-low { border-left: 4px solid #10B981; }
45
+
46
+ @keyframes fadeIn {
47
+ from { opacity: 0; transform: translateY(10px); }
48
+ to { opacity: 1; transform: translateY(0); }
49
+ }
50
+
51
+ .modal {
52
+ animation: modalFade 0.3s ease-out;
53
+ }
54
+
55
+ @keyframes modalFade {
56
+ from { opacity: 0; transform: translateY(-20px); }
57
+ to { opacity: 1; transform: translateY(0); }
58
+ }
59
+
60
+ .completed-task {
61
+ opacity: 0.7;
62
+ position: relative;
63
+ }
64
+
65
+ .completed-task::after {
66
+ content: '';
67
+ position: absolute;
68
+ top: 50%;
69
+ left: 10px;
70
+ right: 10px;
71
+ height: 1px;
72
+ background-color: #10B981;
73
+ }
74
+ </style>
75
+ </head>
76
+ <body class="bg-gray-50">
77
+ <!-- Header -->
78
+ <header class="bg-white shadow-sm">
79
+ <div class="container mx-auto px-4 py-6 flex flex-col md:flex-row justify-between items-center">
80
+ <div class="flex items-center mb-4 md:mb-0">
81
+ <div class="bg-primary p-3 rounded-lg mr-3">
82
+ <i class="fas fa-tasks text-white text-xl"></i>
83
+ </div>
84
+ <h1 class="text-3xl font-bold text-gray-800">Task<span class="text-primary">Flow</span></h1>
85
+ </div>
86
+ <div class="flex items-center space-x-4">
87
+ <div class="relative">
88
+ <input type="text" placeholder="Search tasks..." class="pl-10 pr-4 py-2 rounded-full border border-gray-300 focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent">
89
+ <i class="fas fa-search absolute left-3 top-3 text-gray-400"></i>
90
+ </div>
91
+ <button class="bg-primary hover:bg-blue-700 text-white px-6 py-2 rounded-full transition duration-300">
92
+ <i class="fas fa-plus mr-2"></i>New Task
93
+ </button>
94
+ </div>
95
+ </div>
96
+ </header>
97
+
98
+ <!-- Main Content -->
99
+ <main class="container mx-auto px-4 py-8">
100
+ <div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
101
+ <!-- Task Form -->
102
+ <div class="lg:col-span-1">
103
+ <div class="bg-white rounded-xl shadow-md p-6 sticky top-6">
104
+ <h2 class="text-2xl font-bold text-gray-800 mb-6">Create New Task</h2>
105
+ <form id="taskForm" class="space-y-4">
106
+ <div>
107
+ <label for="title" class="block text-sm font-medium text-gray-700 mb-1">Task Title</label>
108
+ <input type="text" id="title" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent" placeholder="What needs to be done?" required>
109
+ </div>
110
+
111
+ <div>
112
+ <label for="description" class="block text-sm font-medium text-gray-700 mb-1">Description</label>
113
+ <textarea id="description" rows="3" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent" placeholder="Add details..."></textarea>
114
+ </div>
115
+
116
+ <div class="grid grid-cols-2 gap-4">
117
+ <div>
118
+ <label for="dueDate" class="block text-sm font-medium text-gray-700 mb-1">Due Date</label>
119
+ <input type="date" id="dueDate" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent">
120
+ </div>
121
+
122
+ <div>
123
+ <label for="priority" class="block text-sm font-medium text-gray-700 mb-1">Priority</label>
124
+ <select id="priority" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent">
125
+ <option value="low">Low</option>
126
+ <option value="medium" selected>Medium</option>
127
+ <option value="high">High</option>
128
+ </select>
129
+ </div>
130
+ </div>
131
+
132
+ <div>
133
+ <label for="category" class="block text-sm font-medium text-gray-700 mb-1">Category</label>
134
+ <select id="category" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent">
135
+ <option value="work">Work</option>
136
+ <option value="personal">Personal</option>
137
+ <option value="shopping">Shopping</option>
138
+ <option value="health">Health</option>
139
+ <option value="other">Other</option>
140
+ </select>
141
+ </div>
142
+
143
+ <div class="pt-4">
144
+ <button type="submit" class="w-full bg-primary hover:bg-blue-700 text-white font-medium py-3 rounded-lg transition duration-300">
145
+ <i class="fas fa-plus-circle mr-2"></i>Add Task
146
+ </button>
147
+ </div>
148
+ </form>
149
+ </div>
150
+ </div>
151
+
152
+ <!-- Task List -->
153
+ <div class="lg:col-span-2">
154
+ <div class="flex justify-between items-center mb-6">
155
+ <h2 class="text-2xl font-bold text-gray-800">My Tasks</h2>
156
+ <div class="flex space-x-2">
157
+ <button class="px-4 py-2 rounded-lg border border-gray-300 text-gray-700 hover:bg-gray-50">
158
+ <i class="fas fa-filter mr-2"></i>Filter
159
+ </button>
160
+ <button class="px-4 py-2 rounded-lg border border-gray-300 text-gray-700 hover:bg-gray-50">
161
+ <i class="fas fa-sort mr-2"></i>Sort
162
+ </button>
163
+ </div>
164
+ </div>
165
+
166
+ <!-- Stats Cards -->
167
+ <div class="grid grid-cols-1 md:grid-cols-3 gap-4 mb-8">
168
+ <div class="bg-white rounded-xl shadow-sm p-4">
169
+ <div class="flex justify-between">
170
+ <div>
171
+ <p class="text-sm text-gray-500">Total Tasks</p>
172
+ <h3 class="text-2xl font-bold text-gray-800">12</h3>
173
+ </div>
174
+ <div class="bg-blue-100 p-3 rounded-lg">
175
+ <i class="fas fa-tasks text-primary text-xl"></i>
176
+ </div>
177
+ </div>
178
+ </div>
179
+
180
+ <div class="bg-white rounded-xl shadow-sm p-4">
181
+ <div class="flex justify-between">
182
+ <div>
183
+ <p class="text-sm text-gray-500">Completed</p>
184
+ <h3 class="text-2xl font-bold text-gray-800">8</h3>
185
+ </div>
186
+ <div class="bg-green-100 p-3 rounded-lg">
187
+ <i class="fas fa-check-circle text-secondary text-xl"></i>
188
+ </div>
189
+ </div>
190
+ </div>
191
+
192
+ <div class="bg-white rounded-xl shadow-sm p-4">
193
+ <div class="flex justify-between">
194
+ <div>
195
+ <p class="text-sm text-gray-500">Pending</p>
196
+ <h3 class="text-2xl font-bold text-gray-800">4</h3>
197
+ </div>
198
+ <div class="bg-yellow-100 p-3 rounded-lg">
199
+ <i class="fas fa-exclamation-circle text-yellow-500 text-xl"></i>
200
+ </div>
201
+ </div>
202
+ </div>
203
+ </div>
204
+
205
+ <!-- Task List Content -->
206
+ <div id="taskList" class="space-y-4">
207
+ <!-- Task cards will be added here dynamically -->
208
+ </div>
209
+
210
+ <!-- Empty State -->
211
+ <div id="emptyState" class="text-center py-12 hidden">
212
+ <div class="mx-auto bg-gray-100 p-6 rounded-full w-24 h-24 flex items-center justify-center mb-4">
213
+ <i class="fas fa-check-circle text-gray-400 text-4xl"></i>
214
+ </div>
215
+ <h3 class="text-xl font-semibold text-gray-700 mb-2">No tasks yet</h3>
216
+ <p class="text-gray-500 max-w-md mx-auto">Get started by creating your first task. Click the "New Task" button to add a task.</p>
217
+ </div>
218
+ </div>
219
+ </div>
220
+ </main>
221
+
222
+ <!-- Edit Task Modal -->
223
+ <div id="editModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
224
+ <div class="bg-white rounded-xl shadow-xl w-full max-w-md mx-4 modal">
225
+ <div class="p-6">
226
+ <div class="flex justify-between items-center mb-4">
227
+ <h3 class="text-xl font-bold text-gray-800">Edit Task</h3>
228
+ <button id="closeModal" class="text-gray-500 hover:text-gray-700">
229
+ <i class="fas fa-times"></i>
230
+ </button>
231
+ </div>
232
+ <form id="editForm" class="space-y-4">
233
+ <input type="hidden" id="editId">
234
+ <div>
235
+ <label for="editTitle" class="block text-sm font-medium text-gray-700 mb-1">Task Title</label>
236
+ <input type="text" id="editTitle" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent" required>
237
+ </div>
238
+
239
+ <div>
240
+ <label for="editDescription" class="block text-sm font-medium text-gray-700 mb-1">Description</label>
241
+ <textarea id="editDescription" rows="3" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent"></textarea>
242
+ </div>
243
+
244
+ <div class="grid grid-cols-2 gap-4">
245
+ <div>
246
+ <label for="editDueDate" class="block text-sm font-medium text-gray-700 mb-1">Due Date</label>
247
+ <input type="date" id="editDueDate" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent">
248
+ </div>
249
+
250
+ <div>
251
+ <label for="editPriority" class="block text-sm font-medium text-gray-700 mb-1">Priority</label>
252
+ <select id="editPriority" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent">
253
+ <option value="low">Low</option>
254
+ <option value="medium">Medium</option>
255
+ <option value="high">High</option>
256
+ </select>
257
+ </div>
258
+ </div>
259
+
260
+ <div>
261
+ <label for="editCategory" class="block text-sm font-medium text-gray-700 mb-1">Category</label>
262
+ <select id="editCategory" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent">
263
+ <option value="work">Work</option>
264
+ <option value="personal">Personal</option>
265
+ <option value="shopping">Shopping</option>
266
+ <option value="health">Health</option>
267
+ <option value="other">Other</option>
268
+ </select>
269
+ </div>
270
+
271
+ <div class="pt-4 flex space-x-3">
272
+ <button type="button" id="deleteTask" class="flex-1 bg-red-100 hover:bg-red-200 text-red-700 font-medium py-3 rounded-lg transition duration-300">
273
+ <i class="fas fa-trash mr-2"></i>Delete
274
+ </button>
275
+ <button type="submit" class="flex-1 bg-primary hover:bg-blue-700 text-white font-medium py-3 rounded-lg transition duration-300">
276
+ <i class="fas fa-save mr-2"></i>Save Changes
277
+ </button>
278
+ </div>
279
+ </form>
280
+ </div>
281
+ </div>
282
+ </div>
283
+
284
+ <!-- Footer -->
285
+ <footer class="bg-white border-t mt-12">
286
+ <div class="container mx-auto px-4 py-6">
287
+ <div class="flex flex-col md:flex-row justify-between items-center">
288
+ <p class="text-gray-600">© 2023 TaskFlow. All rights reserved.</p>
289
+ <div class="flex space-x-4 mt-4 md:mt-0">
290
+ <a href="#" class="text-gray-500 hover:text-primary">
291
+ <i class="fab fa-twitter"></i>
292
+ </a>
293
+ <a href="#" class="text-gray-500 hover:text-primary">
294
+ <i class="fab fa-facebook"></i>
295
+ </a>
296
+ <a href="#" class="text-gray-500 hover:text-primary">
297
+ <i class="fab fa-github"></i>
298
+ </a>
299
+ </div>
300
+ </div>
301
+ </div>
302
+ </footer>
303
+
304
+ <script>
305
+ // Sample initial tasks
306
+ let tasks = [
307
+ {
308
+ id: 1,
309
+ title: "Complete project proposal",
310
+ description: "Finish and submit the project proposal document to the client",
311
+ dueDate: "2023-06-15",
312
+ priority: "high",
313
+ category: "work",
314
+ completed: false
315
+ },
316
+ {
317
+ id: 2,
318
+ title: "Grocery shopping",
319
+ description: "Milk, eggs, bread, fruits, and vegetables",
320
+ dueDate: "2023-06-10",
321
+ priority: "medium",
322
+ category: "shopping",
323
+ completed: false
324
+ },
325
+ {
326
+ id: 3,
327
+ title: "Morning jog",
328
+ description: "5km run in the park",
329
+ dueDate: "2023-06-08",
330
+ priority: "low",
331
+ category: "health",
332
+ completed: true
333
+ }
334
+ ];
335
+
336
+ // DOM Elements
337
+ const taskForm = document.getElementById('taskForm');
338
+ const editForm = document.getElementById('editForm');
339
+ const taskList = document.getElementById('taskList');
340
+ const emptyState = document.getElementById('emptyState');
341
+ const editModal = document.getElementById('editModal');
342
+ const closeModal = document.getElementById('closeModal');
343
+ const deleteButton = document.getElementById('deleteTask');
344
+
345
+ // Initialize app
346
+ document.addEventListener('DOMContentLoaded', () => {
347
+ renderTasks();
348
+ setupEventListeners();
349
+ });
350
+
351
+ // Set up event listeners
352
+ function setupEventListeners() {
353
+ taskForm.addEventListener('submit', addTask);
354
+ editForm.addEventListener('submit', updateTask);
355
+ closeModal.addEventListener('click', () => editModal.classList.add('hidden'));
356
+ deleteButton.addEventListener('click', deleteTask);
357
+
358
+ // Close modal when clicking outside
359
+ editModal.addEventListener('click', (e) => {
360
+ if (e.target === editModal) {
361
+ editModal.classList.add('hidden');
362
+ }
363
+ });
364
+ }
365
+
366
+ // Add new task
367
+ function addTask(e) {
368
+ e.preventDefault();
369
+
370
+ const title = document.getElementById('title').value;
371
+ const description = document.getElementById('description').value;
372
+ const dueDate = document.getElementById('dueDate').value;
373
+ const priority = document.getElementById('priority').value;
374
+ const category = document.getElementById('category').value;
375
+
376
+ const newTask = {
377
+ id: Date.now(),
378
+ title,
379
+ description,
380
+ dueDate,
381
+ priority,
382
+ category,
383
+ completed: false
384
+ };
385
+
386
+ tasks.push(newTask);
387
+ renderTasks();
388
+
389
+ // Reset form
390
+ taskForm.reset();
391
+
392
+ // Show notification
393
+ showNotification('Task added successfully!');
394
+ }
395
+
396
+ // Update task
397
+ function updateTask(e) {
398
+ e.preventDefault();
399
+
400
+ const id = parseInt(document.getElementById('editId').value);
401
+ const title = document.getElementById('editTitle').value;
402
+ const description = document.getElementById('editDescription').value;
403
+ const dueDate = document.getElementById('editDueDate').value;
404
+ const priority = document.getElementById('editPriority').value;
405
+ const category = document.getElementById('editCategory').value;
406
+
407
+ const taskIndex = tasks.findIndex(task => task.id === id);
408
+
409
+ if (taskIndex !== -1) {
410
+ tasks[taskIndex] = {
411
+ ...tasks[taskIndex],
412
+ title,
413
+ description,
414
+ dueDate,
415
+ priority,
416
+ category
417
+ };
418
+
419
+ renderTasks();
420
+ editModal.classList.add('hidden');
421
+
422
+ // Show notification
423
+ showNotification('Task updated successfully!');
424
+ }
425
+ }
426
+
427
+ // Delete task
428
+ function deleteTask() {
429
+ const id = parseInt(document.getElementById('editId').value);
430
+
431
+ tasks = tasks.filter(task => task.id !== id);
432
+ renderTasks();
433
+ editModal.classList.add('hidden');
434
+
435
+ // Show notification
436
+ showNotification('Task deleted successfully!');
437
+ }
438
+
439
+ // Toggle task completion
440
+ function toggleTaskCompletion(id) {
441
+ const task = tasks.find(task => task.id === id);
442
+ if (task) {
443
+ task.completed = !task.completed;
444
+ renderTasks();
445
+
446
+ // Show notification
447
+ const message = task.completed ? 'Task marked as completed!' : 'Task marked as pending!';
448
+ showNotification(message);
449
+ }
450
+ }
451
+
452
+ // Open edit modal
453
+ function openEditModal(id) {
454
+ const task = tasks.find(task => task.id === id);
455
+
456
+ if (task) {
457
+ document.getElementById('editId').value = task.id;
458
+ document.getElementById('editTitle').value = task.title;
459
+ document.getElementById('editDescription').value = task.description;
460
+ document.getElementById('editDueDate').value = task.dueDate;
461
+ document.getElementById('editPriority').value = task.priority;
462
+ document.getElementById('editCategory').value = task.category;
463
+
464
+ editModal.classList.remove('hidden');
465
+ }
466
+ }
467
+
468
+ // Render tasks
469
+ function renderTasks() {
470
+ if (tasks.length === 0) {
471
+ taskList.classList.add('hidden');
472
+ emptyState.classList.remove('hidden');
473
+ return;
474
+ }
475
+
476
+ taskList.classList.remove('hidden');
477
+ emptyState.classList.add('hidden');
478
+
479
+ taskList.innerHTML = '';
480
+
481
+ // Sort tasks: uncompleted first, then by priority (high to low)
482
+ const sortedTasks = [...tasks].sort((a, b) => {
483
+ if (a.completed !== b.completed) {
484
+ return a.completed ? 1 : -1;
485
+ }
486
+
487
+ const priorityOrder = { high: 3, medium: 2, low: 1 };
488
+ return priorityOrder[b.priority] - priorityOrder[a.priority];
489
+ });
490
+
491
+ sortedTasks.forEach(task => {
492
+ const taskCard = document.createElement('div');
493
+ taskCard.className = `task-card bg-white rounded-xl shadow-sm overflow-hidden ${task.completed ? 'completed-task' : ''}`;
494
+ taskCard.innerHTML = `
495
+ <div class="p-5 flex">
496
+ <div class="mr-4 mt-1">
497
+ <button onclick="toggleTaskCompletion(${task.id})" class="w-6 h-6 rounded-full border-2 flex items-center justify-center ${task.completed ? 'bg-secondary border-secondary' : 'border-gray-300'}">
498
+ ${task.completed ? '<i class="fas fa-check text-white text-xs"></i>' : ''}
499
+ </button>
500
+ </div>
501
+ <div class="flex-1">
502
+ <div class="flex justify-between items-start">
503
+ <h3 class="font-semibold text-gray-800 ${task.completed ? 'line-through' : ''}">${task.title}</h3>
504
+ <span class="text-xs font-medium px-2 py-1 rounded-full ${task.priority === 'high' ? 'bg-red-100 text-red-800' : task.priority === 'medium' ? 'bg-yellow-100 text-yellow-800' : 'bg-green-100 text-green-800'}">
505
+ ${task.priority.charAt(0).toUpperCase() + task.priority.slice(1)}
506
+ </span>
507
+ </div>
508
+ <p class="text-gray-600 text-sm mt-1 ${task.completed ? 'line-through' : ''}">${task.description || 'No description'}</p>
509
+
510
+ <div class="flex justify-between items-center mt-3">
511
+ <div class="flex items-center text-sm text-gray-500">
512
+ <i class="far fa-calendar mr-1"></i>
513
+ <span>${task.dueDate || 'No due date'}</span>
514
+ </div>
515
+ <div class="flex space-x-2">
516
+ <button onclick="openEditModal(${task.id})" class="text-gray-500 hover:text-primary">
517
+ <i class="fas fa-edit"></i>
518
+ </button>
519
+ <span class="text-xs font-medium px-2 py-1 rounded-full bg-gray-100 text-gray-700">
520
+ ${task.category.charAt(0).toUpperCase() + task.category.slice(1)}
521
+ </span>
522
+ </div>
523
+ </div>
524
+ </div>
525
+ </div>
526
+ `;
527
+ taskList.appendChild(taskCard);
528
+ });
529
+ }
530
+
531
+ // Show notification
532
+ function showNotification(message) {
533
+ // Create notification element
534
+ const notification = document.createElement('div');
535
+ notification.className = 'fixed top-4 right-4 bg-white shadow-lg rounded-lg px-4 py-3 flex items-center transform translate-y-0 opacity-100 transition-all duration-300';
536
+ notification.innerHTML = `
537
+ <div class="bg-green-100 p-2 rounded-full mr-3">
538
+ <i class="fas fa-check-circle text-green-600"></i>
539
+ </div>
540
+ <div>
541
+ <p class="font-medium text-gray-800">Success</p>
542
+ <p class="text-sm text-gray-600">${message}</p>
543
+ </div>
544
+ `;
545
+
546
+ document.body.appendChild(notification);
547
+
548
+ // Remove notification after 3 seconds
549
+ setTimeout(() => {
550
+ notification.style.transform = 'translateY(-20px)';
551
+ notification.style.opacity = '0';
552
+ setTimeout(() => {
553
+ document.body.removeChild(notification);
554
+ }, 300);
555
+ }, 3000);
556
+ }
557
+
558
+ // Expose functions to global scope for inline event handlers
559
+ window.toggleTaskCompletion = toggleTaskCompletion;
560
+ window.openEditModal = openEditModal;
561
+ </script>
562
+ <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=Ragnarucem/taskflow-rag" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
563
+ </html>